tabexseriescomponents 0.0.174 → 0.0.176

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -8391,6 +8391,8 @@ var Filter$1 = function Filter(props) {
8391
8391
  var ProductFilterObjContext = props.actions.ProductFilterObjContext;
8392
8392
  var setProductFilterObjContext = props.actions.setProductFilterObjContext;
8393
8393
  var authdetailsContext = props.actions.authdetailsContext;
8394
+ var routingcountext = props.actions.routingcountext;
8395
+ var StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
8394
8396
  var _useState = useState(''),
8395
8397
  _useState2 = _slicedToArray(_useState, 2),
8396
8398
  sectionproperties = _useState2[0],
@@ -8452,15 +8454,17 @@ var Filter$1 = function Filter(props) {
8452
8454
  }, [ProductFilterObjContext]);
8453
8455
  var filterupdater = function filterupdater() {
8454
8456
  if (instfilters.length != 0) {
8457
+ var _ProductFilterObjCont;
8455
8458
  var tempinstfilters = _toConsumableArray(instfilters);
8456
- tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8459
+ tempinstfilters === null || tempinstfilters === void 0 ? void 0 : tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8457
8460
  instfilteritem.productvaluesfilter.forEach(function (valefilteritem, valefilteritemindex) {
8458
8461
  valefilteritem.isfilterselected = false;
8459
8462
  });
8460
8463
  });
8461
- ProductFilterObjContext.FilterOptions.forEach(function (filteritem, filterindex) {
8462
- tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8463
- instfilteritem.productvaluesfilter.forEach(function (valefilteritem, valefilteritemindex) {
8464
+ ProductFilterObjContext === null || ProductFilterObjContext === void 0 ? void 0 : (_ProductFilterObjCont = ProductFilterObjContext.FilterOptions) === null || _ProductFilterObjCont === void 0 ? void 0 : _ProductFilterObjCont.forEach(function (filteritem, filterindex) {
8465
+ tempinstfilters === null || tempinstfilters === void 0 ? void 0 : tempinstfilters.forEach(function (instfilteritem, instfilterindex) {
8466
+ var _instfilteritem$produ;
8467
+ instfilteritem === null || instfilteritem === void 0 ? void 0 : (_instfilteritem$produ = instfilteritem.productvaluesfilter) === null || _instfilteritem$produ === void 0 ? void 0 : _instfilteritem$produ.forEach(function (valefilteritem, valefilteritemindex) {
8464
8468
  if (filteritem.valueid == valefilteritem.valueid) {
8465
8469
  valefilteritem.isfilterselected = true;
8466
8470
  }
@@ -8470,12 +8474,13 @@ var Filter$1 = function Filter(props) {
8470
8474
  setinstfilters(_toConsumableArray(tempinstfilters));
8471
8475
  }
8472
8476
  if (instcollections.length != 0) {
8477
+ var _ProductFilterObjCont2;
8473
8478
  var tempInstcollections = _toConsumableArray(instcollections);
8474
8479
  tempInstcollections.forEach(function (instfilteritem, valefilteritemindex) {
8475
8480
  instfilteritem.isfilterselected = false;
8476
8481
  });
8477
- ProductFilterObjContext.collections.forEach(function (filteritem, filterindex) {
8478
- tempInstcollections.forEach(function (instfilteritem, instfilterindex) {
8482
+ ProductFilterObjContext === null || ProductFilterObjContext === void 0 ? void 0 : (_ProductFilterObjCont2 = ProductFilterObjContext.collections) === null || _ProductFilterObjCont2 === void 0 ? void 0 : _ProductFilterObjCont2.forEach(function (filteritem, filterindex) {
8483
+ tempInstcollections === null || tempInstcollections === void 0 ? void 0 : tempInstcollections.forEach(function (instfilteritem, instfilterindex) {
8479
8484
  if (instfilteritem.collectionid == filteritem) {
8480
8485
  instfilteritem.isfilterselected = true;
8481
8486
  }
@@ -8489,8 +8494,9 @@ var Filter$1 = function Filter(props) {
8489
8494
  if (type == 'clearfilters') {
8490
8495
  tempfetchproductsfilerobjcontext.FilterOptions = [];
8491
8496
  } else {
8497
+ var _tempfetchproductsfil;
8492
8498
  var FilterExists = false;
8493
- tempfetchproductsfilerobjcontext.FilterOptions.forEach(function (filteritem, filterindex) {
8499
+ tempfetchproductsfilerobjcontext === null || tempfetchproductsfilerobjcontext === void 0 ? void 0 : (_tempfetchproductsfil = tempfetchproductsfilerobjcontext.FilterOptions) === null || _tempfetchproductsfil === void 0 ? void 0 : _tempfetchproductsfil.forEach(function (filteritem, filterindex) {
8494
8500
  if (filteritem.valueid == valueid) {
8495
8501
  FilterExists = true;
8496
8502
  tempfetchproductsfilerobjcontext.FilterOptions.splice(filterindex, 1);
@@ -8507,12 +8513,15 @@ var Filter$1 = function Filter(props) {
8507
8513
  } else {
8508
8514
  tempfetchproductsfilerobjcontext.isfilter = 1;
8509
8515
  }
8516
+ tempfetchproductsfilerobjcontext.page = 0;
8510
8517
  setProductFilterObjContext(_objectSpread$1C({}, tempfetchproductsfilerobjcontext));
8518
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, encodeURIComponent(JSON.stringify(tempfetchproductsfilerobjcontext)));
8511
8519
  };
8512
8520
  var setCollectionFilterFunc = function setCollectionFilterFunc(collectionid) {
8521
+ var _tempfetchproductsfil2;
8513
8522
  var tempfetchproductsfilerobjcontext = _objectSpread$1C({}, ProductFilterObjContext);
8514
8523
  var CollectionExists = false;
8515
- tempfetchproductsfilerobjcontext.collections.forEach(function (filteritem, filterindex) {
8524
+ tempfetchproductsfilerobjcontext === null || tempfetchproductsfilerobjcontext === void 0 ? void 0 : (_tempfetchproductsfil2 = tempfetchproductsfilerobjcontext.collections) === null || _tempfetchproductsfil2 === void 0 ? void 0 : _tempfetchproductsfil2.forEach(function (filteritem, filterindex) {
8516
8525
  if (filteritem == collectionid) {
8517
8526
  CollectionExists = true;
8518
8527
  tempfetchproductsfilerobjcontext.collections.splice(filterindex, 1);
@@ -8521,7 +8530,9 @@ var Filter$1 = function Filter(props) {
8521
8530
  if (!CollectionExists) {
8522
8531
  tempfetchproductsfilerobjcontext.collections.push(collectionid);
8523
8532
  }
8533
+ tempfetchproductsfilerobjcontext.page = 0;
8524
8534
  setProductFilterObjContext(_objectSpread$1C({}, tempfetchproductsfilerobjcontext));
8535
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, encodeURIComponent(JSON.stringify(tempfetchproductsfilerobjcontext)));
8525
8536
  };
8526
8537
  var filter_cssstyles = {
8527
8538
  collapsetitle: css({
@@ -8764,6 +8775,7 @@ var Filter$1 = function Filter(props) {
8764
8775
  tempfetchproductsfilerobjcontext[item.payloadvalue] = valueitem.value;
8765
8776
  }
8766
8777
  setProductFilterObjContext(_objectSpread$1C({}, tempfetchproductsfilerobjcontext));
8778
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, encodeURIComponent(JSON.stringify(tempfetchproductsfilerobjcontext)));
8767
8779
  }
8768
8780
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
8769
8781
  className: " ".concat(ischecked ? filter_cssstyles.btn_item_active : '', " ").concat(filterstyles.btn_item, " ").concat(filter_cssstyles.btn_item) + ' mb-2 d-flex align-items-center '
@@ -9227,6 +9239,13 @@ var CardsSection = function CardsSection(props) {
9227
9239
  // }
9228
9240
  // }, [inView]);
9229
9241
  useEffect(function () {
9242
+ if (props.filterparamsprops != undefined) {
9243
+ var filterpar = decodeURIComponent(props.filterparamsprops);
9244
+ var filterparsed = JSON.parse(filterpar);
9245
+ if (filterparsed != undefined) {
9246
+ setProductFilterObjContext(filterparsed);
9247
+ }
9248
+ }
9230
9249
  StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
9231
9250
  if (sectionitem.sectionid == props.sectionidprops) {
9232
9251
  var secpropobj = {};
@@ -9296,7 +9315,9 @@ var CardsSection = function CardsSection(props) {
9296
9315
  var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
9297
9316
  tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
9298
9317
  if (ProductsFetchingTypeSectionObj.grouptype == 'collections' || ProductsFetchingTypeSectionObj.grouptype == 'categories' || ProductsFetchingTypeSectionObj.grouptype == 'parentcollections') ; else {
9299
- tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
9318
+ if (tempfetchproductsfilerobjcontext.collections != undefined) {
9319
+ tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
9320
+ }
9300
9321
  }
9301
9322
  tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
9302
9323
  tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
@@ -9523,18 +9544,26 @@ var CardsSection = function CardsSection(props) {
9523
9544
  var handlePageClick = function handlePageClick(event) {
9524
9545
  props.scrolltotop();
9525
9546
  var tempProductFilterObjContext = _objectSpread$1B({}, ProductFilterObjContext);
9526
- tempProductFilterObjContext.page = event.selected;
9547
+ tempProductFilterObjContext.page = event === null || event === void 0 ? void 0 : event.selected;
9527
9548
  setProductFilterObjContext(_objectSpread$1B({}, tempProductFilterObjContext));
9549
+ var pasturl = '';
9550
+ if (props.grouptypeprops != undefined) {
9551
+ if (props.collectionidprops != undefined) {
9552
+ pasturl = props.grouptypeprops + '/' + props.collectionidprops + '/';
9553
+ }
9554
+ }
9555
+ routingcountext(StaticPagesLinksContext.GeneralProductsComponent, true, pasturl + encodeURIComponent(JSON.stringify(tempProductFilterObjContext)));
9528
9556
  };
9529
9557
  function PaginatedItems(_ref) {
9530
9558
  var _fetchProductsQuery$d7, _fetchProductsQuery$d8, _fetchProductsQuery$d9, _fetchProductsQuery$d10;
9531
9559
  _ref.itemsPerPage;
9532
9560
  // Here we use item offsets; we could also use page offsets
9533
9561
  // following the API or data you're working with.
9534
- var _useState13 = useState(0),
9535
- _useState14 = _slicedToArray(_useState13, 2);
9536
- _useState14[0];
9537
- _useState14[1];
9562
+ // const [itemOffset, setItemOffset] = useState(0);
9563
+ // Simulate fetching items from another resources.
9564
+ // (This could be items from props; or items loaded in a local state
9565
+ // from an API endpoint with useEffect and useState)
9566
+ // const endOffset = itemOffset + itemsPerPage;
9538
9567
 
9539
9568
  // const currentItems = items.slice(itemOffset, endOffset);
9540
9569
  // const pageCount = Math.ceil(items.length / itemsPerPage);
@@ -28823,11 +28852,10 @@ var CardsSection2 = function CardsSection2(props) {
28823
28852
  }
28824
28853
  } else if (fetchingtype == 'products') {
28825
28854
  if (fetchProductsQuery.isSuccess) {
28855
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
28826
28856
  var allpagesarr = [];
28827
- fetchProductsQuery.data.pages.forEach(function (page) {
28828
- page.data.products.forEach(function (productobj) {
28829
- allpagesarr.push(productobj);
28830
- });
28857
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
28858
+ allpagesarr.push(item);
28831
28859
  });
28832
28860
  cardobjassigner(allpagesarr);
28833
28861
  }
@@ -28859,11 +28887,10 @@ var CardsSection2 = function CardsSection2(props) {
28859
28887
  useEffect(function () {
28860
28888
  if (fetchingtype == 'products') {
28861
28889
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
28890
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
28862
28891
  var allpagesarr = [];
28863
- fetchProductsQuery.data.pages.forEach(function (page) {
28864
- page.data.products.forEach(function (productobj) {
28865
- allpagesarr.push(productobj);
28866
- });
28892
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
28893
+ allpagesarr.push(item);
28867
28894
  });
28868
28895
  cardobjassigner(allpagesarr);
28869
28896
  }
@@ -29218,11 +29245,10 @@ var Sixverticalcardssection = function Sixverticalcardssection(props) {
29218
29245
  }
29219
29246
  } else if (fetchingtype == 'products') {
29220
29247
  if (fetchProductsQuery.isSuccess) {
29248
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
29221
29249
  var allpagesarr = [];
29222
- fetchProductsQuery.data.pages.forEach(function (page) {
29223
- page.data.products.forEach(function (productobj) {
29224
- allpagesarr.push(productobj);
29225
- });
29250
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
29251
+ allpagesarr.push(item);
29226
29252
  });
29227
29253
  cardobjassigner(allpagesarr);
29228
29254
  }
@@ -29253,11 +29279,10 @@ var Sixverticalcardssection = function Sixverticalcardssection(props) {
29253
29279
  useEffect(function () {
29254
29280
  if (fetchingtype == 'products') {
29255
29281
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29282
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
29256
29283
  var allpagesarr = [];
29257
- fetchProductsQuery.data.pages.forEach(function (page) {
29258
- page.data.products.forEach(function (productobj) {
29259
- allpagesarr.push(productobj);
29260
- });
29284
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
29285
+ allpagesarr.push(item);
29261
29286
  });
29262
29287
  cardobjassigner(allpagesarr);
29263
29288
  }
@@ -29614,222 +29639,6 @@ var ModernCardsSection = function ModernCardsSection(props) {
29614
29639
  var _useInView = useInView(),
29615
29640
  ref = _useInView.ref,
29616
29641
  inView = _useInView.inView;
29617
- // const StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
29618
- // const lang = props.actions.lang;
29619
- // const langdetect = props.actions.langdetect;
29620
- // const fetchcustomercartQueryContext = props.actions.fetchcustomercartQueryContext;
29621
- // const favoriteprojectscountContext = props.actions.favoriteprojectscountContext;
29622
- // const routingcountext = props.actions.routingcountext;
29623
- // const StaticPagesLinksContext = props.actions.StaticPagesLinksContext;
29624
- // const ProductFilterObjContext = props.actions.ProductFilterObjContext;
29625
- // const setProductFilterObjContext = props.actions.setProductFilterObjContext;
29626
- // const TabexSectionsComponentsContext = props.actions.TabexSectionsComponentsContext;
29627
- // const FetchQueriesEngineContext = props.actions.FetchQueriesEngineContext;
29628
- // const setFetchQueriesEngineContext = props.actions.setFetchQueriesEngineContext;
29629
- // const fetchProductsQuery = props.actions.fetchProductsQuery;
29630
- // const fetchcollectionsQueryContext = props.actions.fetchcollectionsQueryContext;
29631
- // const setParentCollectionsForCollectionQueryArr = props.actions.setParentCollectionsForCollectionQueryArr;
29632
- // const ParentCollectionsForCollectionQueryArr = props.actions.ParentCollectionsForCollectionQueryArr;
29633
- // const setfetchingtype = props.actions.setfetchingtype;
29634
- // const fetchingtype = props.actions.fetchingtype;
29635
- // const addtofavoritescontext = props.actions.addtofavoritescontext;
29636
- // const actions = props.actions;
29637
- // const [sectionproperties, setsectionproperties] = useState('');
29638
- // const [imagesarray, setimagesarray] = useState([]);
29639
- // const [cardsarray, setcardsarray] = useState([]);
29640
- // const [searchinput, setsearchinput] = useState('');
29641
- // React.useEffect(() => {
29642
- // if (inView) {
29643
- // fetchProductsQuery.fetchNextPage();
29644
- // }
29645
- // }, [inView]);
29646
- // const [ProductsFetchingTypeSectionObj, setProductsFetchingTypeSectionObj] = useState({ productfetchingtype: 'Random', collectionid: '', grouptype: '' });
29647
-
29648
- // useEffect(() => {
29649
- // StatePagePropertiesContext.pageobj.sections.forEach(function (sectionitem, sectionindex) {
29650
- // if (sectionitem.sectionid == props.sectionidprops) {
29651
- // var secpropobj = {};
29652
- // sectionitem.sectionproperties.forEach(function (sectionpropertiesobj, sectionpropertiesindex) {
29653
- // secpropobj[sectionpropertiesobj.property_css_name] = sectionpropertiesobj.property_value;
29654
- // });
29655
- // setsectionproperties({ ...secpropobj });
29656
-
29657
- // if (props.srcfromprops == 'GeneralProductsComponent') {
29658
- // setfetchingtype('products');
29659
- // setProductsFetchingTypeSectionObj({
29660
- // productfetchingtype: 'Random',
29661
- // collectionid: props.collectionidprops,
29662
- // grouptype: props.grouptypeprops,
29663
- // grouptyperefid: props.grouptyperefidprops,
29664
- // });
29665
- // } else {
29666
- // setfetchingtype(sectionitem.fetchingtype);
29667
- // setProductsFetchingTypeSectionObj({
29668
- // productfetchingtype: sectionitem.productsfetchingtype,
29669
- // collectionid: sectionitem.productsfetchingtypeCollectioncollectionid,
29670
- // grouptype: props.grouptypeprops,
29671
- // grouptyperefid: props.grouptyperefidprops,
29672
- // });
29673
- // }
29674
- // }
29675
- // });
29676
- // }, [StatePagePropertiesContext]);
29677
- // useEffect(() => {
29678
- // if (sectionproperties.length != 0) {
29679
- // if (cardsarray.length == 0) {
29680
- // if (fetchingtype == 'collections') {
29681
- // if (fetchcollectionsQueryContext.isSuccess) {
29682
- // cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
29683
- // }
29684
- // } else if (fetchingtype == 'products') {
29685
- // if (fetchProductsQuery.isSuccess) {
29686
- // var allpagesarr = [];
29687
- // fetchProductsQuery.data.pages.forEach((page) => {
29688
- // page.data.products.forEach((productobj) => {
29689
- // allpagesarr.push(productobj);
29690
- // });
29691
- // });
29692
- // cardobjassigner(allpagesarr);
29693
- // }
29694
- // }
29695
- // }
29696
- // }
29697
- // }, [sectionproperties]);
29698
- // useEffect(() => {
29699
- // if (fetchingtype.length != 0) {
29700
- // var tempFetchQueriesEngineContext = FetchQueriesEngineContext;
29701
- // if (fetchingtype == 'collections') {
29702
- // // tempFetchQueriesEngineContext.collections = true;
29703
- // if (ProductsFetchingTypeSectionObj.collectionid == 'all' || ProductsFetchingTypeSectionObj.collectionid == null || ProductsFetchingTypeSectionObj.collectionid == undefined) {
29704
- // setParentCollectionsForCollectionQueryArr('all');
29705
- // } else {
29706
- // setParentCollectionsForCollectionQueryArr([ProductsFetchingTypeSectionObj.collectionid]);
29707
- // }
29708
- // }
29709
- // if (fetchingtype == 'products') {
29710
- // var tempfetchproductsfilerobjcontext = ProductFilterObjContext;
29711
- // tempfetchproductsfilerobjcontext.ProductFetchingType = ProductsFetchingTypeSectionObj.productfetchingtype;
29712
- // if (
29713
- // ProductsFetchingTypeSectionObj.grouptype == 'collections' ||
29714
- // ProductsFetchingTypeSectionObj.grouptype == 'categories' ||
29715
- // ProductsFetchingTypeSectionObj.grouptype == 'parentcollections'
29716
- // ) {
29717
- // } else {
29718
- // tempfetchproductsfilerobjcontext.collections.push(ProductsFetchingTypeSectionObj.collectionid);
29719
- // }
29720
- // tempfetchproductsfilerobjcontext.grouptype = ProductsFetchingTypeSectionObj.grouptype;
29721
- // tempfetchproductsfilerobjcontext.grouptyperefid = ProductsFetchingTypeSectionObj.grouptyperefid;
29722
- // setProductFilterObjContext({ ...tempfetchproductsfilerobjcontext });
29723
- // }
29724
-
29725
- // setFetchQueriesEngineContext({ ...tempFetchQueriesEngineContext });
29726
- // }
29727
- // }, [fetchingtype, ProductsFetchingTypeSectionObj]);
29728
- // useEffect(() => {
29729
- // if (fetchingtype == 'products') {
29730
- // if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29731
- // var allpagesarr = [];
29732
- // fetchProductsQuery.data.pages.forEach((page) => {
29733
- // page.data.products.forEach((productobj) => {
29734
- // allpagesarr.push(productobj);
29735
- // });
29736
- // });
29737
- // cardobjassigner(allpagesarr);
29738
- // }
29739
- // }
29740
- // }, [fetchProductsQuery.isSuccess, fetchProductsQuery.dataUpdatedAt, fetchProductsQuery.data, fetchcustomercartQueryContext.dataUpdatedAt]);
29741
- // useEffect(() => {
29742
- // if (fetchingtype == 'collections') {
29743
- // if (fetchcollectionsQueryContext.isSuccess) {
29744
- // cardobjassigner(fetchcollectionsQueryContext.data.data.collections);
29745
- // }
29746
- // }
29747
- // }, [fetchcollectionsQueryContext.isSuccess]);
29748
- // useEffect(() => {
29749
- // favassigner();
29750
- // }, [favoriteprojectscountContext]);
29751
- // const favassigner = () => {
29752
- // if (fetchingtype == 'products') {
29753
- // if (cardsarray.length != 0) {
29754
- // if (favoriteprojectscountContext != undefined && Array.isArray(favoriteprojectscountContext)) {
29755
- // var tempcardsarray = [...cardsarray];
29756
- // tempcardsarray.forEach(function (arrayItem, arrayindex) {
29757
- // arrayItem.IsFavExists = false;
29758
- // });
29759
- // tempcardsarray.forEach(function (arrayItem, arrayindex) {
29760
- // favoriteprojectscountContext.forEach(function (favitem, favindex) {
29761
- // if (arrayItem.productid == favitem) {
29762
- // arrayItem.IsFavExists = true;
29763
- // }
29764
- // });
29765
- // });
29766
- // setcardsarray([...tempcardsarray]);
29767
- // }
29768
- // }
29769
- // }
29770
- // };
29771
- // const cardobjassigner = (fetchedarray) => {
29772
- // var temparray = [];
29773
- // fetchedarray.forEach(function (arrayItem, arrayindex) {
29774
- // var cardobj = {
29775
- // name: '',
29776
- // image: '',
29777
- // };
29778
- // if (fetchingtype == 'products') {
29779
- // var itemquantity = 0;
29780
- // if (langdetect == 'en') {
29781
- // cardobj.name = arrayItem.productinfo.name_en;
29782
- // } else {
29783
- // cardobj.name = arrayItem.productinfo.name_ar;
29784
- // }
29785
- // if (langdetect == 'en') {
29786
- // cardobj.description = arrayItem.productinfo.description_en;
29787
- // } else {
29788
- // cardobj.description = arrayItem.productinfo.description_ar;
29789
- // }
29790
- // if (arrayItem.productinfo.hasvariants == 0) {
29791
- // fetchcustomercartQueryContext.data.data.customercart.cartitems.forEach(function (cartitem, cartindex) {
29792
- // if (cartitem.productid == arrayItem.productinfo.productid) {
29793
- // itemquantity = cartitem.quantity;
29794
- // }
29795
- // });
29796
- // }
29797
- // cardobj.image = arrayItem.productinfo.productmainimage;
29798
- // cardobj.hassale = arrayItem.productinfo.hassale;
29799
- // cardobj.productid = arrayItem.productinfo.productid;
29800
- // cardobj.hasvariants = arrayItem.productinfo.hasvariants;
29801
- // cardobj.description_en = arrayItem.productinfo.description_en;
29802
- // cardobj.description_ar = arrayItem.productinfo.description_ar;
29803
- // cardobj.defaultprice = arrayItem.productinfo.defaultprice;
29804
- // cardobj.defaultsaleprice = arrayItem.productinfo.defaultsaleprice;
29805
- // cardobj.productimages = arrayItem.productinfo.productimages;
29806
- // cardobj.quantity = itemquantity;
29807
- // cardobj.timestamp = arrayItem.productinfo.timestamp;
29808
-
29809
- // if (favoriteprojectscountContext != undefined && favoriteprojectscountContext.length != 0) {
29810
- // favoriteprojectscountContext.forEach(function (favitem, favindex) {
29811
- // if (arrayItem.productinfo.productid == favitem) {
29812
- // cardobj.IsFavExists = true;
29813
- // }
29814
- // });
29815
- // }
29816
- // } else if (fetchingtype == 'collections') {
29817
- // cardobj.collectionid = arrayItem.collectionid;
29818
- // if (langdetect == 'en') {
29819
- // cardobj.name = arrayItem.title_en;
29820
- // cardobj.description = arrayItem.description_en;
29821
- // } else if (langdetect == 'ar') {
29822
- // cardobj.name = arrayItem.title_ar;
29823
- // cardobj.description = arrayItem.description_ar;
29824
- // }
29825
- // cardobj.image = arrayItem.collectionlogo;
29826
- // } else if (fetchingtype == 'custom') {
29827
- // }
29828
- // temparray.push(cardobj);
29829
- // });
29830
-
29831
- // setcardsarray([...temparray]);
29832
- // };
29833
29642
  var StatePagePropertiesContext = props.actions.StatePagePropertiesContext;
29834
29643
  props.actions.lang;
29835
29644
  var langdetect = props.actions.langdetect;
@@ -29916,11 +29725,10 @@ var ModernCardsSection = function ModernCardsSection(props) {
29916
29725
  }
29917
29726
  } else if (fetchingtype == 'products') {
29918
29727
  if (fetchProductsQuery.isSuccess) {
29728
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
29919
29729
  var allpagesarr = [];
29920
- fetchProductsQuery.data.pages.forEach(function (page) {
29921
- page.data.products.forEach(function (productobj) {
29922
- allpagesarr.push(productobj);
29923
- });
29730
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
29731
+ allpagesarr.push(item);
29924
29732
  });
29925
29733
  cardobjassigner(allpagesarr);
29926
29734
  }
@@ -30029,11 +29837,10 @@ var ModernCardsSection = function ModernCardsSection(props) {
30029
29837
  useEffect(function () {
30030
29838
  if (fetchingtype == 'products') {
30031
29839
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
29840
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
30032
29841
  var allpagesarr = [];
30033
- fetchProductsQuery.data.pages.forEach(function (page) {
30034
- page.data.products.forEach(function (productobj) {
30035
- allpagesarr.push(productobj);
30036
- });
29842
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
29843
+ allpagesarr.push(item);
30037
29844
  });
30038
29845
  cardobjassigner(allpagesarr);
30039
29846
  }
@@ -31367,11 +31174,10 @@ var CardsSectionwithfilter = function CardsSectionwithfilter(props) {
31367
31174
  }
31368
31175
  // } else if (fetchingtype == 'products') {
31369
31176
  if (fetchProductsQuery.isSuccess) {
31177
+ var _fetchProductsQuery$d, _fetchProductsQuery$d2, _fetchProductsQuery$d3;
31370
31178
  var allpagesarr = [];
31371
- fetchProductsQuery.data.pages.forEach(function (page) {
31372
- page.data.products.forEach(function (productobj) {
31373
- allpagesarr.push(productobj);
31374
- });
31179
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d = fetchProductsQuery.data) === null || _fetchProductsQuery$d === void 0 ? void 0 : (_fetchProductsQuery$d2 = _fetchProductsQuery$d.data) === null || _fetchProductsQuery$d2 === void 0 ? void 0 : (_fetchProductsQuery$d3 = _fetchProductsQuery$d2.products) === null || _fetchProductsQuery$d3 === void 0 ? void 0 : _fetchProductsQuery$d3.forEach(function (item) {
31180
+ allpagesarr.push(item);
31375
31181
  });
31376
31182
  productcardobjassigner(allpagesarr);
31377
31183
  }
@@ -31402,11 +31208,10 @@ var CardsSectionwithfilter = function CardsSectionwithfilter(props) {
31402
31208
  useEffect(function () {
31403
31209
  // if (fetchingtype == 'products') {
31404
31210
  if (fetchProductsQuery.isSuccess && fetchcustomercartQueryContext.isSuccess) {
31211
+ var _fetchProductsQuery$d4, _fetchProductsQuery$d5, _fetchProductsQuery$d6;
31405
31212
  var allpagesarr = [];
31406
- fetchProductsQuery.data.pages.forEach(function (page) {
31407
- page.data.products.forEach(function (productobj) {
31408
- allpagesarr.push(productobj);
31409
- });
31213
+ fetchProductsQuery === null || fetchProductsQuery === void 0 ? void 0 : (_fetchProductsQuery$d4 = fetchProductsQuery.data) === null || _fetchProductsQuery$d4 === void 0 ? void 0 : (_fetchProductsQuery$d5 = _fetchProductsQuery$d4.data) === null || _fetchProductsQuery$d5 === void 0 ? void 0 : (_fetchProductsQuery$d6 = _fetchProductsQuery$d5.products) === null || _fetchProductsQuery$d6 === void 0 ? void 0 : _fetchProductsQuery$d6.forEach(function (item) {
31214
+ allpagesarr.push(item);
31410
31215
  });
31411
31216
  productcardobjassigner(allpagesarr);
31412
31217
  }
@@ -31828,16 +31633,6 @@ var CardsSectionwithfilter = function CardsSectionwithfilter(props) {
31828
31633
  },
31829
31634
  onClick: function onClick() {
31830
31635
  alert('hh0');
31831
- // if (fetchProductsQuery.isSuccess) {
31832
- // var allpagesarr = [];
31833
- // fetchProductsQuery.data.data.pages.forEach((page) => {
31834
- // page.data.products.forEach((productobj) => {
31835
- // allpagesarr.push(productobj);
31836
- // });
31837
- // });
31838
- // cardobjassigner(allpagesarr);
31839
- // alert(JSON.stringify(allpagesarr));
31840
- // }
31841
31636
  }
31842
31637
  }, /*#__PURE__*/React.createElement("p", null, item.name));
31843
31638
  }))), /*#__PURE__*/React.createElement("div", {