s-platform-landing-section 0.1.20 → 0.1.22

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.
@@ -1,12 +1,13 @@
1
1
  import React__default, { useState, useRef, useEffect, forwardRef, useImperativeHandle, createElement, memo } from 'react';
2
- import { IoCartOutline, IoChevronDownOutline, IoInformationCircleOutline, IoLogOutOutline, IoBagOutline, IoSearchOutline, IoChevronBackOutline, IoChevronForwardOutline, IoLocationOutline, IoCallOutline } from 'react-icons/io5';
3
- import { FaUserCircle, FaFacebookF, FaFacebookMessenger, FaBoxOpen, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight } from 'react-icons/fa';
4
- import { FiMenu, FiShoppingCart, FiSearch } from 'react-icons/fi';
2
+ import { IoCartOutline, IoChevronDownOutline, IoPersonCircleOutline, IoLogOutOutline, IoInformationCircleOutline, IoBagOutline, IoSearchOutline, IoChevronBackOutline, IoChevronForwardOutline } from 'react-icons/io5';
3
+ import { FaUserCircle, FaRegNewspaper, FaFacebookF, FaFacebookMessenger, FaBoxOpen, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight, FaPhoneAlt } from 'react-icons/fa';
4
+ import { FiMenu, FiLogIn, FiHome, FiBox, FiPhoneCall, FiShoppingCart, FiSearch } from 'react-icons/fi';
5
5
  import { RxCross2 } from 'react-icons/rx';
6
+ import { PiHandHeartBold } from 'react-icons/pi';
7
+ import { TbCategory } from 'react-icons/tb';
6
8
  import { SiZalo, SiVisa } from 'react-icons/si';
7
- import { IoIosStar, IoIosArrowBack, IoIosArrowForward, IoMdCheckmark, IoIosHeartEmpty, IoMdQuote } from 'react-icons/io';
9
+ import { IoIosStar, IoIosArrowBack, IoIosArrowForward, IoMdCheckmark, IoIosHeartEmpty } from 'react-icons/io';
8
10
  import { FaMinus, FaRegEyeSlash, FaPlus, FaArrowsRotate, FaStar, FaRegStarHalfStroke, FaRegStar } from 'react-icons/fa6';
9
- import 'react-icons/pi';
10
11
  import 'react-icons/ci';
11
12
  import { BsCurrencyDollar } from 'react-icons/bs';
12
13
  import { LuSearch } from 'react-icons/lu';
@@ -15,8 +16,10 @@ import 'react-datepicker/dist/react-datepicker.css';
15
16
  import Slider from 'react-slick';
16
17
  import 'slick-carousel/slick/slick.css';
17
18
  import 'slick-carousel/slick/slick-theme.css';
18
- import { AiOutlineShoppingCart } from 'react-icons/ai';
19
+ import { AiOutlineShoppingCart, AiOutlinePhone } from 'react-icons/ai';
19
20
  import { GoCreditCard, GoClock } from 'react-icons/go';
21
+ import { HiOutlineLocationMarker } from 'react-icons/hi';
22
+ import { MdOutlineFormatQuote } from 'react-icons/md';
20
23
  import { RiDeleteBin7Line } from 'react-icons/ri';
21
24
  import { GiNewspaper } from 'react-icons/gi';
22
25
 
@@ -108,36 +111,35 @@ var getDurationValue = function getDurationValue(attributes) {
108
111
  });
109
112
  return durationAtt ? ((durationAtt === null || durationAtt === void 0 ? void 0 : (_durationAtt$value = durationAtt.value) === null || _durationAtt$value === void 0 ? void 0 : _durationAtt$value[0]) || "0") + " p" : "";
110
113
  };
111
- var genProductSlug = function genProductSlug(productName, id) {
112
- var _slug, _slug2, _slug3, _slug4, _slug5, _slug6, _slug7, _slug8, _slug9, _slug10, _slug11;
113
- var slug = productName === null || productName === void 0 ? void 0 : productName.toLowerCase();
114
- slug = (_slug = slug) === null || _slug === void 0 ? void 0 : _slug.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, "a");
115
- slug = (_slug2 = slug) === null || _slug2 === void 0 ? void 0 : _slug2.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, "e");
116
- slug = (_slug3 = slug) === null || _slug3 === void 0 ? void 0 : _slug3.replace(/(ì|í|ị|ỉ|ĩ)/g, "i");
117
- slug = (_slug4 = slug) === null || _slug4 === void 0 ? void 0 : _slug4.replace(/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/g, "o");
118
- slug = (_slug5 = slug) === null || _slug5 === void 0 ? void 0 : _slug5.replace(/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/g, "u");
119
- slug = (_slug6 = slug) === null || _slug6 === void 0 ? void 0 : _slug6.replace(/(ỳ|ý|ỵ|ỷ|ỹ)/g, "y");
120
- slug = (_slug7 = slug) === null || _slug7 === void 0 ? void 0 : _slug7.replace(/(đ)/g, "d");
121
- slug = (_slug8 = slug) === null || _slug8 === void 0 ? void 0 : _slug8.replace(/([^0-9a-z-\s])/g, "");
122
- slug = (_slug9 = slug) === null || _slug9 === void 0 ? void 0 : _slug9.replace(/(\s+)/g, "-");
123
- slug = (_slug10 = slug) === null || _slug10 === void 0 ? void 0 : _slug10.replace(/^-+/g, "");
124
- slug = (_slug11 = slug) === null || _slug11 === void 0 ? void 0 : _slug11.replace(/-+$/g, "");
125
- return slug + "-" + id;
114
+ var genProductSlugVi = function genProductSlugVi(productName, id) {
115
+ var _productName$replace;
116
+ return (productName === null || productName === void 0 ? void 0 : (_productName$replace = productName.replace(/\s+/g, "-")) === null || _productName$replace === void 0 ? void 0 : _productName$replace.replace(/\//g, "~")) + "-" + id;
126
117
  };
127
118
  var getLinkProductDetail = function getLinkProductDetail(product) {
128
- var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
129
- return "/product/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
119
+ var slug = genProductSlugVi(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
120
+ return "/san-pham/" + slug;
130
121
  };
131
122
  var getLinkServiceDetail = function getLinkServiceDetail(product) {
132
- var slug = genProductSlug(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
133
- return "/service/" + slug + "/" + (product === null || product === void 0 ? void 0 : product.shopId);
123
+ var slug = genProductSlugVi(product === null || product === void 0 ? void 0 : product.productName, product === null || product === void 0 ? void 0 : product.productId);
124
+ return "/dich-vu/" + slug;
134
125
  };
135
126
  var getLinkNewsDetail = function getLinkNewsDetail(news) {
136
- var slug = genProductSlug(news === null || news === void 0 ? void 0 : news.title, news === null || news === void 0 ? void 0 : news.articleId);
137
- return "/news_detail/" + slug + "/" + (news === null || news === void 0 ? void 0 : news.catId) + "/" + (news === null || news === void 0 ? void 0 : news.shopId);
127
+ var slug = genProductSlugVi(news === null || news === void 0 ? void 0 : news.title, news === null || news === void 0 ? void 0 : news.articleId);
128
+ var category = genProductSlugVi(news === null || news === void 0 ? void 0 : news.catName, news === null || news === void 0 ? void 0 : news.catId);
129
+ return "/tin-tuc/" + category + "/" + slug;
138
130
  };
139
131
  var getLinkNewsByCategory = function getLinkNewsByCategory(news) {
140
- return "/news_by_category/" + (news === null || news === void 0 ? void 0 : news.catId) + "/" + (news === null || news === void 0 ? void 0 : news.shopId);
132
+ var slug = genProductSlugVi(news === null || news === void 0 ? void 0 : news.catName, news === null || news === void 0 ? void 0 : news.catId);
133
+ return "/tin-tuc-theo-danh-muc/" + slug;
134
+ };
135
+ var getLinkProductsByCategory = function getLinkProductsByCategory(product) {
136
+ if (product !== null && product !== void 0 && product.categoryName) {
137
+ var slug = genProductSlugVi(product === null || product === void 0 ? void 0 : product.categoryName, product === null || product === void 0 ? void 0 : product.categoryId);
138
+ return "/danh-muc/" + slug;
139
+ } else {
140
+ var _slug12 = genProductSlugVi(product === null || product === void 0 ? void 0 : product.cateName, product === null || product === void 0 ? void 0 : product.categoryId);
141
+ return "/danh-muc/" + _slug12;
142
+ }
141
143
  };
142
144
  var LinkToPage = function LinkToPage(props) {
143
145
  var _props$Link = props.Link,
@@ -147,12 +149,22 @@ var LinkToPage = function LinkToPage(props) {
147
149
  };
148
150
  var SSHOP_SPA_TOKEN = "sshop-spa-token";
149
151
  var genLinkSearch = function genLinkSearch(keyword) {
150
- return "/search?keyword=" + keyword;
152
+ return "/tim-kiem?tu-khoa=" + keyword;
151
153
  };
152
154
  var configSvg = function configSvg(data) {
153
155
  var _data$replace, _data$replace$replace;
154
156
  return data === null || data === void 0 ? void 0 : (_data$replace = data.replace(/<path(?![^>]*fill=")[^>]*>/g, "<path fill=\"currentColor\" $&")) === null || _data$replace === void 0 ? void 0 : (_data$replace$replace = _data$replace.replace(/width="[^"]*"/, '')) === null || _data$replace$replace === void 0 ? void 0 : _data$replace$replace.replace(/height="[^"]*"/, '');
155
157
  };
158
+ var urlMappings = {
159
+ "/products": "/san-pham",
160
+ "/news": "/tin-tuc",
161
+ "/services": "/dich-vu",
162
+ "/booking": "/dat-lich",
163
+ "/about": "/gioi-thieu"
164
+ };
165
+ function convertURL(path) {
166
+ return urlMappings[path] || path;
167
+ }
156
168
 
157
169
  var Options = function Options(props) {
158
170
  var _props$className = props.className,
@@ -219,6 +231,29 @@ var Options = function Options(props) {
219
231
  }))) : null);
220
232
  };
221
233
 
234
+ var listIconRoute = {
235
+ home: /*#__PURE__*/React__default.createElement(FiHome, {
236
+ size: 20
237
+ }),
238
+ products: /*#__PURE__*/React__default.createElement(FiBox, {
239
+ size: 20
240
+ }),
241
+ services: /*#__PURE__*/React__default.createElement(FiPhoneCall, {
242
+ size: 20
243
+ }),
244
+ booking: /*#__PURE__*/React__default.createElement(PiHandHeartBold, {
245
+ size: 20
246
+ }),
247
+ news: /*#__PURE__*/React__default.createElement(FaRegNewspaper, {
248
+ size: 20
249
+ }),
250
+ news_by_category: /*#__PURE__*/React__default.createElement(TbCategory, {
251
+ size: 20
252
+ }),
253
+ about: /*#__PURE__*/React__default.createElement(IoInformationCircleOutline, {
254
+ size: 24
255
+ })
256
+ };
222
257
  var NavBar7 = function NavBar7(props) {
223
258
  var _routes$find, _shopConfigStyle$navB, _shopConfigStyle$navB2, _shopConfigStyle$navB3, _shopConfigStyle$navB4;
224
259
  var _useState = useState(false),
@@ -278,7 +313,7 @@ var NavBar7 = function NavBar7(props) {
278
313
  var cart = function cart() {
279
314
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
280
315
  Link: Link,
281
- href: "/carts"
316
+ href: "/gio-hang"
282
317
  }, /*#__PURE__*/React__default.createElement("div", {
283
318
  className: "relative cursor-pointer"
284
319
  }, /*#__PURE__*/React__default.createElement(IoCartOutline, {
@@ -290,7 +325,12 @@ var NavBar7 = function NavBar7(props) {
290
325
  };
291
326
  return /*#__PURE__*/React__default.createElement("div", {
292
327
  className: "w-full sticky top-0 shadow z-50 bg-background"
293
- }, /*#__PURE__*/React__default.createElement("div", {
328
+ }, /*#__PURE__*/React__default.createElement("h1", {
329
+ style: {
330
+ position: "fixed",
331
+ top: "-100px"
332
+ }
333
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.defaultDomain, " | ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName), /*#__PURE__*/React__default.createElement("div", {
294
334
  className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20"
295
335
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
296
336
  Link: Link,
@@ -309,8 +349,8 @@ var NavBar7 = function NavBar7(props) {
309
349
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (item, index) {
310
350
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
311
351
  Link: Link,
312
- href: item === null || item === void 0 ? void 0 : item.route,
313
- key: index
352
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
353
+ key: "dhfs" + index
314
354
  }, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
315
355
  className: "whitespace-nowrap py-1 border-b text-textHeading border-textHeading"
316
356
  }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
@@ -321,7 +361,7 @@ var NavBar7 = function NavBar7(props) {
321
361
  React__default.createElement("div", {
322
362
  className: "flex justify-center"
323
363
  }, /*#__PURE__*/React__default.createElement(FaUserCircle, {
324
- className: "text-bgSecondary",
364
+ className: "text-primary",
325
365
  size: 48
326
366
  }), /*#__PURE__*/React__default.createElement("div", {
327
367
  className: "ml-2"
@@ -341,7 +381,7 @@ var NavBar7 = function NavBar7(props) {
341
381
  className: "flex gap-2"
342
382
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
343
383
  Link: Link,
344
- href: "/account"
384
+ href: "/dang-nhap"
345
385
  }, /*#__PURE__*/React__default.createElement(Button, {
346
386
  label: "Đăng nhập",
347
387
  shopConfigStyle: shopConfigStyle
@@ -384,42 +424,102 @@ var NavBar7 = function NavBar7(props) {
384
424
  }
385
425
  }, /*#__PURE__*/React__default.createElement("div", {
386
426
  className: "flex justify-between"
387
- }, /*#__PURE__*/React__default.createElement("div", {
388
- className: "flex gap-2 items-center"
389
427
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
390
428
  Link: Link,
391
429
  href: "/",
392
430
  onClick: function onClick() {
393
431
  return setIsOpen(false);
394
432
  }
433
+ }, /*#__PURE__*/React__default.createElement("div", {
434
+ className: "flex gap-2 items-center"
395
435
  }, /*#__PURE__*/React__default.createElement("img", {
396
436
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
397
437
  className: "h-14 w-14 bg-cover bg-no-repeat"
398
- })), /*#__PURE__*/React__default.createElement("div", {
438
+ }), /*#__PURE__*/React__default.createElement("h3", {
399
439
  className: "text-xl font-semibold line-clamp-1"
400
- }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
440
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName))), /*#__PURE__*/React__default.createElement("button", {
401
441
  className: "text-gray4",
402
442
  onClick: function onClick() {
403
443
  setIsOpen(false);
404
444
  }
405
445
  }, /*#__PURE__*/React__default.createElement(RxCross2, {
406
446
  size: 24
407
- }))), /*#__PURE__*/React__default.createElement("div", null, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
447
+ }))), /*#__PURE__*/React__default.createElement("div", {
448
+ className: "flex flex-col justify-start"
449
+ }, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
408
450
  return e === null || e === void 0 ? void 0 : e.isShow;
409
451
  })) === null || _shopConfigStyle$navB4 === void 0 ? void 0 : _shopConfigStyle$navB4.map(function (item, index) {
410
452
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
411
453
  Link: Link,
412
- href: item === null || item === void 0 ? void 0 : item.route,
413
- key: index,
454
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
455
+ key: "ieytg-" + index,
414
456
  onClick: function onClick() {
415
457
  return setIsOpen(false);
416
458
  }
417
459
  }, /*#__PURE__*/React__default.createElement("div", {
418
- className: "py-2 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
419
- }, item === null || item === void 0 ? void 0 : item.label));
420
- })))) : null));
460
+ className: "py-2 px-4 flex items-center gap-4 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
461
+ }, /*#__PURE__*/React__default.createElement("div", null, (listIconRoute === null || listIconRoute === void 0 ? void 0 : listIconRoute[item === null || item === void 0 ? void 0 : item.name]) || ""), item === null || item === void 0 ? void 0 : item.label));
462
+ }), /*#__PURE__*/React__default.createElement("hr", {
463
+ className: "border-black"
464
+ }), userInfo ? profileOptions === null || profileOptions === void 0 ? void 0 : profileOptions.map(function (option, index) {
465
+ return option !== null && option !== void 0 && option.href ? /*#__PURE__*/React__default.createElement(LinkToPage, {
466
+ onClick: function onClick() {
467
+ return setIsOpen(false);
468
+ },
469
+ key: "hkfdfh-" + index,
470
+ Link: Link,
471
+ href: option === null || option === void 0 ? void 0 : option.href,
472
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
473
+ role: "menuitem"
474
+ }, /*#__PURE__*/React__default.createElement(IoPersonCircleOutline, {
475
+ size: 24
476
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label)) : /*#__PURE__*/React__default.createElement("div", {
477
+ key: "hkfdfh-" + index,
478
+ onClick: function onClick() {
479
+ setIsOpen(false);
480
+ logout();
481
+ },
482
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
483
+ role: "menuitem"
484
+ }, /*#__PURE__*/React__default.createElement(IoLogOutOutline, {
485
+ size: 24
486
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label));
487
+ }) : /*#__PURE__*/React__default.createElement(LinkToPage, {
488
+ Link: Link,
489
+ href: "/dang-nhap",
490
+ onClick: function onClick() {
491
+ return setIsOpen(false);
492
+ }
493
+ }, /*#__PURE__*/React__default.createElement("div", {
494
+ className: "py-2 px-4 flex items-center gap-4"
495
+ }, /*#__PURE__*/React__default.createElement(FiLogIn, {
496
+ size: 20
497
+ }), "\u0110\u0103ng nh\u1EADp"))))) : null));
498
+ };
499
+
500
+ var listIconRoute$1 = {
501
+ home: /*#__PURE__*/React__default.createElement(FiHome, {
502
+ size: 20
503
+ }),
504
+ products: /*#__PURE__*/React__default.createElement(FiBox, {
505
+ size: 20
506
+ }),
507
+ services: /*#__PURE__*/React__default.createElement(FiPhoneCall, {
508
+ size: 20
509
+ }),
510
+ booking: /*#__PURE__*/React__default.createElement(PiHandHeartBold, {
511
+ size: 20
512
+ }),
513
+ news: /*#__PURE__*/React__default.createElement(FaRegNewspaper, {
514
+ size: 20
515
+ }),
516
+ news_by_category: /*#__PURE__*/React__default.createElement(TbCategory, {
517
+ size: 20
518
+ }),
519
+ about: /*#__PURE__*/React__default.createElement(IoInformationCircleOutline, {
520
+ size: 24
521
+ })
421
522
  };
422
-
423
523
  var NavBar1 = function NavBar1(props) {
424
524
  var _routes$find, _shopConfigStyle$navB, _shopConfigStyle$navB2, _shopConfigStyle$navB3, _shopConfigStyle$navB4;
425
525
  var _useState = useState(false),
@@ -437,7 +537,8 @@ var NavBar1 = function NavBar1(props) {
437
537
  _props$useSelector = props.useSelector,
438
538
  useSelector = _props$useSelector === void 0 ? null : _props$useSelector,
439
539
  _props$logout = props.logout,
440
- logout = _props$logout === void 0 ? function () {} : _props$logout;
540
+ logout = _props$logout === void 0 ? function () {} : _props$logout,
541
+ data = props.data;
441
542
  var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
442
543
  var _state$cart;
443
544
  return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
@@ -479,7 +580,7 @@ var NavBar1 = function NavBar1(props) {
479
580
  var cart = function cart() {
480
581
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
481
582
  Link: Link,
482
- href: "/carts"
583
+ href: "/gio-hang"
483
584
  }, /*#__PURE__*/React__default.createElement("div", {
484
585
  className: "relative cursor-pointer"
485
586
  }, /*#__PURE__*/React__default.createElement(IoBagOutline, {
@@ -489,28 +590,40 @@ var NavBar1 = function NavBar1(props) {
489
590
  className: "absolute aspect-square flex items-center justify-center bg-danger w-5 text-xs rounded-full text-white -top-1 -right-1 pb-px ps-px"
490
591
  }, totalItem) : null));
491
592
  };
492
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
493
- className: "hidden lg:flex justify-end items-center gap-6 px-20 py-2 bg-primary"
593
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("h1", {
594
+ style: {
595
+ position: "fixed",
596
+ top: "-100px"
597
+ }
598
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.defaultDomain, " | ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName), /*#__PURE__*/React__default.createElement("div", {
599
+ className: "hidden lg:flex justify-between items-center px-20 py-2 bg-primary"
600
+ }, /*#__PURE__*/React__default.createElement("div", {
601
+ className: "text-background text-xl"
602
+ }, data === null || data === void 0 ? void 0 : data.title), /*#__PURE__*/React__default.createElement("div", {
603
+ className: "flex gap-6 "
494
604
  }, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
495
605
  className: "font-medium border-r pr-6 text-background"
496
606
  }, "Hotline: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone) : null, /*#__PURE__*/React__default.createElement("div", {
497
607
  className: "flex justify-start items-center gap-2"
498
608
  }, /*#__PURE__*/React__default.createElement("a", {
499
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
609
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#",
610
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? "_blank" : "_self"
500
611
  }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
501
612
  size: 24,
502
613
  className: "p-1 rounded bg-background text-primary"
503
614
  })), /*#__PURE__*/React__default.createElement("a", {
504
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
615
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#",
616
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? "_blank" : "_self"
505
617
  }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
506
618
  size: 24,
507
619
  className: "p-1 rounded bg-background text-primary"
508
620
  })), /*#__PURE__*/React__default.createElement("a", {
509
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
621
+ href: "https://zalo.me/" + (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#",
622
+ target: "_blank"
510
623
  }, /*#__PURE__*/React__default.createElement(SiZalo, {
511
624
  size: 24,
512
625
  className: "p-1 rounded bg-background text-primary"
513
- })))), /*#__PURE__*/React__default.createElement("div", {
626
+ }))))), /*#__PURE__*/React__default.createElement("div", {
514
627
  className: "hidden lg:flex gap-6 justify-between items-center py-2 px-4 xl:px-20 sticky top-0 z-50 bg-background shadow "
515
628
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
516
629
  Link: Link,
@@ -529,7 +642,7 @@ var NavBar1 = function NavBar1(props) {
529
642
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (item, index) {
530
643
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
531
644
  Link: Link,
532
- href: item === null || item === void 0 ? void 0 : item.route,
645
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
533
646
  key: index
534
647
  }, /*#__PURE__*/React__default.createElement("div", {
535
648
  className: "py-1 whitespace-nowrap " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "border-b text-primary border-primary" : "text-textBody") + " "
@@ -559,7 +672,7 @@ var NavBar1 = function NavBar1(props) {
559
672
  className: "flex gap-2"
560
673
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
561
674
  Link: Link,
562
- href: "/account"
675
+ href: "/dang-nhap"
563
676
  }, /*#__PURE__*/React__default.createElement(Button, {
564
677
  label: "Đăng nhập",
565
678
  shopConfigStyle: shopConfigStyle
@@ -602,40 +715,77 @@ var NavBar1 = function NavBar1(props) {
602
715
  }
603
716
  }, /*#__PURE__*/React__default.createElement("div", {
604
717
  className: "flex justify-between"
605
- }, /*#__PURE__*/React__default.createElement("div", {
606
- className: "flex gap-2 items-center"
607
718
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
608
719
  Link: Link,
609
720
  href: "/",
610
721
  onClick: function onClick() {
611
722
  return setIsOpen(false);
612
723
  }
724
+ }, /*#__PURE__*/React__default.createElement("div", {
725
+ className: "flex gap-2 items-center"
613
726
  }, /*#__PURE__*/React__default.createElement("img", {
614
727
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
615
728
  className: "h-14 w-14 bg-cover bg-no-repeat"
616
- })), /*#__PURE__*/React__default.createElement("div", {
729
+ }), /*#__PURE__*/React__default.createElement("div", {
617
730
  className: "text-xl font-semibold line-clamp-1"
618
- }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName)), /*#__PURE__*/React__default.createElement("button", {
731
+ }, shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName))), /*#__PURE__*/React__default.createElement("button", {
619
732
  className: "text-gray4",
620
733
  onClick: function onClick() {
621
734
  setIsOpen(false);
622
735
  }
623
736
  }, /*#__PURE__*/React__default.createElement(RxCross2, {
624
737
  size: 24
625
- }))), /*#__PURE__*/React__default.createElement("div", null, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
738
+ }))), /*#__PURE__*/React__default.createElement("div", {
739
+ className: "flex flex-col justify-start"
740
+ }, shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : (_shopConfigStyle$navB3 = shopConfigStyle.navBarMenus) === null || _shopConfigStyle$navB3 === void 0 ? void 0 : (_shopConfigStyle$navB4 = _shopConfigStyle$navB3.filter(function (e) {
626
741
  return e === null || e === void 0 ? void 0 : e.isShow;
627
742
  })) === null || _shopConfigStyle$navB4 === void 0 ? void 0 : _shopConfigStyle$navB4.map(function (item, index) {
628
743
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
629
744
  Link: Link,
630
- href: item === null || item === void 0 ? void 0 : item.route,
745
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route),
631
746
  key: index,
632
747
  onClick: function onClick() {
633
748
  return setIsOpen(false);
634
749
  }
635
750
  }, /*#__PURE__*/React__default.createElement("div", {
636
- className: "py-2 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
637
- }, item === null || item === void 0 ? void 0 : item.label));
638
- })))) : null));
751
+ className: "py-2 px-4 flex items-center gap-4 " + ((item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? "text-textHeading" : "")
752
+ }, /*#__PURE__*/React__default.createElement("div", null, (listIconRoute$1 === null || listIconRoute$1 === void 0 ? void 0 : listIconRoute$1[item === null || item === void 0 ? void 0 : item.name]) || ""), item === null || item === void 0 ? void 0 : item.label));
753
+ }), /*#__PURE__*/React__default.createElement("hr", {
754
+ className: "border-black"
755
+ }), userInfo ? profileOptions === null || profileOptions === void 0 ? void 0 : profileOptions.map(function (option, index) {
756
+ return option !== null && option !== void 0 && option.href ? /*#__PURE__*/React__default.createElement(LinkToPage, {
757
+ onClick: function onClick() {
758
+ return setIsOpen(false);
759
+ },
760
+ key: "hkfdfh-" + index,
761
+ Link: Link,
762
+ href: option === null || option === void 0 ? void 0 : option.href,
763
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
764
+ role: "menuitem"
765
+ }, /*#__PURE__*/React__default.createElement(IoPersonCircleOutline, {
766
+ size: 24
767
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label)) : /*#__PURE__*/React__default.createElement("div", {
768
+ key: "hkfdfh-" + index,
769
+ onClick: function onClick() {
770
+ setIsOpen(false);
771
+ logout();
772
+ },
773
+ className: "flex gap-2 px-4 py-2 text-black hover:bg-gray-100 rounded cursor-pointer",
774
+ role: "menuitem"
775
+ }, /*#__PURE__*/React__default.createElement(IoLogOutOutline, {
776
+ size: 24
777
+ }), /*#__PURE__*/React__default.createElement("p", null, option === null || option === void 0 ? void 0 : option.label));
778
+ }) : /*#__PURE__*/React__default.createElement(LinkToPage, {
779
+ Link: Link,
780
+ href: "/dang-nhap",
781
+ onClick: function onClick() {
782
+ return setIsOpen(false);
783
+ }
784
+ }, /*#__PURE__*/React__default.createElement("div", {
785
+ className: "py-2 px-4 flex items-center gap-4"
786
+ }, /*#__PURE__*/React__default.createElement(FiLogIn, {
787
+ size: 20
788
+ }), "\u0110\u0103ng nh\u1EADp"))))) : null));
639
789
  };
640
790
 
641
791
  var SvgIcon = function SvgIcon(_ref) {
@@ -663,7 +813,7 @@ var SvgIcon = function SvgIcon(_ref) {
663
813
  var SectionTitle1 = function SectionTitle1(props) {
664
814
  var _props$data = props.data,
665
815
  data = _props$data === void 0 ? {} : _props$data;
666
- return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
816
+ return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("h2", {
667
817
  className: "text-center text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
668
818
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
669
819
  className: "flex items-center justify-center"
@@ -687,7 +837,7 @@ var SectionTitle2 = function SectionTitle2(props) {
687
837
  className: "flex gap-4 justify-center items-center"
688
838
  }, /*#__PURE__*/React__default.createElement("div", {
689
839
  className: " w-32 h-0.5 rounded-full bg-stroke"
690
- }), /*#__PURE__*/React__default.createElement("div", {
840
+ }), /*#__PURE__*/React__default.createElement("h2", {
691
841
  className: "text-center whitespace-nowrap text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
692
842
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
693
843
  className: " w-32 h-0.5 rounded-full bg-stroke"
@@ -706,7 +856,7 @@ var SectionTitle2 = function SectionTitle2(props) {
706
856
 
707
857
  var SectionTitle3 = function SectionTitle3(props) {
708
858
  var data = props.data;
709
- return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h3", {
859
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("h2", {
710
860
  className: "font-headingFont leading-relaxed text-textHeading text-2xl md:text-4xl font-semibold"
711
861
  }, data === null || data === void 0 ? void 0 : data.sectionTitle), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("p", {
712
862
  className: "text-xl font-medium leading-relaxed text-textSecondary mt-4 lg:mt-6"
@@ -732,6 +882,8 @@ var Input = forwardRef(function (props, ref) {
732
882
  style = _props$style === void 0 ? {} : _props$style,
733
883
  _props$onChange = props.onChange,
734
884
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
885
+ _props$disabled = props.disabled,
886
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
735
887
  _props$defaultValue = props.defaultValue,
736
888
  defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
737
889
  _props$type = props.type,
@@ -779,15 +931,15 @@ var Input = forwardRef(function (props, ref) {
779
931
  for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
780
932
  var _e$pattern, _e$validate;
781
933
  var e = _step.value;
782
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && (value === '' || value === null)) {
934
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && !value) {
783
935
  _setError(e === null || e === void 0 ? void 0 : e.message);
784
936
  count++;
785
937
  break;
786
- } else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
938
+ } else if (value && (e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
787
939
  _setError(e === null || e === void 0 ? void 0 : e.message);
788
940
  count++;
789
941
  break;
790
- } else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
942
+ } else if (value && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
791
943
  _setError(e === null || e === void 0 ? void 0 : e.message);
792
944
  count++;
793
945
  break;
@@ -810,7 +962,7 @@ var Input = forwardRef(function (props, ref) {
810
962
  };
811
963
  var changeQuantity = function changeQuantity(quantity) {
812
964
  var newValue = parseInt(value) + quantity;
813
- if (newValue > min && (max === null || newValue <= max)) {
965
+ if (!disabled && newValue > min && (max === null || newValue <= max)) {
814
966
  _setValue(newValue);
815
967
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
816
968
  }
@@ -833,7 +985,7 @@ var Input = forwardRef(function (props, ref) {
833
985
  }, label ? /*#__PURE__*/React__default.createElement("div", {
834
986
  className: "mb-1 " + labelClassName
835
987
  }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
836
- className: "flex gap-2 items-center bg-white " + _className,
988
+ className: "bg-white " + (disabled ? "!bg-gray6" : "") + " flex gap-2 items-center " + _className,
837
989
  style: style
838
990
  }, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
839
991
  onClick: function onClick() {
@@ -844,6 +996,7 @@ var Input = forwardRef(function (props, ref) {
844
996
  name: name,
845
997
  value: value,
846
998
  placeholder: placeholder,
999
+ disabled: disabled,
847
1000
  onChange: handleOnChange,
848
1001
  required: required,
849
1002
  className: _inputClassName,
@@ -877,7 +1030,7 @@ var Hero1 = function Hero1(props) {
877
1030
  style: {
878
1031
  backgroundImage: "url(" + (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$srcImag = _sectionData$.srcImages) === null || _sectionData$$srcImag === void 0 ? void 0 : _sectionData$$srcImag[0]) + ")"
879
1032
  },
880
- className: "relative w-full h-[200px] md:h-[320px] lg:h-[400px] xl:h-[480px] bg-cover bg-center bg-no-repeat z-0 flex flex-col items-center justify-center mb-24"
1033
+ className: "relative w-full min-h-[200px] md:min-h-[320px] lg:min-h-[400px] xl:min-h-[480px] h-full bg-cover bg-center bg-no-repeat z-0 flex flex-col items-center justify-center mb-24"
881
1034
  }, /*#__PURE__*/React__default.createElement("div", {
882
1035
  className: "w-[80%] md:w-2/3 xl:w-1/2 md:h-2/3 flex flex-col gap-2 md:gap-8 justify-center items-center bg-background opacity-90 absolute top-5 md:top-10 px-6 py-4 rounded-tr-[40px] rounded-bl-[40px] md:rounded-tr-[80px] md:rounded-bl-[80px]"
883
1036
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -889,7 +1042,7 @@ var Hero1 = function Hero1(props) {
889
1042
  className: "text-center md:text-2xl lg:text-3xl font-medium"
890
1043
  }, sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$3 = sectionData[0]) === null || _sectionData$3 === void 0 ? void 0 : _sectionData$3.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
891
1044
  Link: Link,
892
- href: (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$4 = sectionData[0]) === null || _sectionData$4 === void 0 ? void 0 : (_sectionData$4$button = _sectionData$4.buttons) === null || _sectionData$4$button === void 0 ? void 0 : (_sectionData$4$button2 = _sectionData$4$button[0]) === null || _sectionData$4$button2 === void 0 ? void 0 : _sectionData$4$button2.route) || (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$5 = sectionData[0]) === null || _sectionData$5 === void 0 ? void 0 : (_sectionData$5$button = _sectionData$5.buttons) === null || _sectionData$5$button === void 0 ? void 0 : (_sectionData$5$button2 = _sectionData$5$button[0]) === null || _sectionData$5$button2 === void 0 ? void 0 : _sectionData$5$button2.link) || "#"
1045
+ href: convertURL(sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$4 = sectionData[0]) === null || _sectionData$4 === void 0 ? void 0 : (_sectionData$4$button = _sectionData$4.buttons) === null || _sectionData$4$button === void 0 ? void 0 : (_sectionData$4$button2 = _sectionData$4$button[0]) === null || _sectionData$4$button2 === void 0 ? void 0 : _sectionData$4$button2.route) || (sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$5 = sectionData[0]) === null || _sectionData$5 === void 0 ? void 0 : (_sectionData$5$button = _sectionData$5.buttons) === null || _sectionData$5$button === void 0 ? void 0 : (_sectionData$5$button2 = _sectionData$5$button[0]) === null || _sectionData$5$button2 === void 0 ? void 0 : _sectionData$5$button2.link) || "#"
893
1046
  }, /*#__PURE__*/React__default.createElement(Button, {
894
1047
  label: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$6 = sectionData[0]) === null || _sectionData$6 === void 0 ? void 0 : (_sectionData$6$button = _sectionData$6.buttons) === null || _sectionData$6$button === void 0 ? void 0 : (_sectionData$6$button2 = _sectionData$6$button[0]) === null || _sectionData$6$button2 === void 0 ? void 0 : _sectionData$6$button2.label,
895
1048
  shopConfigStyle: shopConfigStyle
@@ -916,45 +1069,48 @@ var Hero1 = function Hero1(props) {
916
1069
  };
917
1070
 
918
1071
  var Hero2 = function Hero2(props) {
919
- var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
1072
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _data$data4, _data$data4$;
920
1073
  var shopConfig = props.shopConfig,
921
1074
  data = props.data;
922
1075
  return /*#__PURE__*/React__default.createElement("div", {
923
1076
  className: "relative"
924
1077
  }, /*#__PURE__*/React__default.createElement("img", {
925
1078
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
1079
+ alt: data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title,
926
1080
  className: "w-full object-cover min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
927
1081
  }), /*#__PURE__*/React__default.createElement("div", {
928
1082
  className: "absolute flex flex-col gap-1 md:gap-4 absolute w-1/2 lg:w-1/3 top-2 sm:top-[20%] xl:top-1/4 right-[2%] lg:right-[15%]"
929
1083
  }, /*#__PURE__*/React__default.createElement("img", {
930
1084
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
1085
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName,
931
1086
  className: "h-6 w-6 md:h-16 md:w-16 lg:h-20 lg:w-20"
932
1087
  }), /*#__PURE__*/React__default.createElement("div", {
933
1088
  className: "text-lg md:text-3xl lg:text-4xl font-medium"
934
- }, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title), /*#__PURE__*/React__default.createElement("div", {
1089
+ }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.title), /*#__PURE__*/React__default.createElement("div", {
935
1090
  className: "text-sm md:text-xl lg:text-2xl "
936
- }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.description)));
1091
+ }, data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$ = _data$data4[0]) === null || _data$data4$ === void 0 ? void 0 : _data$data4$.description)));
937
1092
  };
938
1093
 
939
1094
  var Hero5 = function Hero5(props) {
940
- var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
1095
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _data$data4, _data$data4$;
941
1096
  var data = props.data;
942
1097
  return /*#__PURE__*/React__default.createElement("div", {
943
1098
  className: "relative"
944
1099
  }, /*#__PURE__*/React__default.createElement("img", {
945
1100
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
946
- className: "w-full min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
1101
+ alt: data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title,
1102
+ className: "w-full min-h-[30vh] md:min-h-[50vh] max-h-[100vh] object-cover"
947
1103
  }), /*#__PURE__*/React__default.createElement("div", {
948
1104
  className: "flex flex-col gap-2 md:gap-4 absolute top-5 md:top-[20%] w-1/2 lg:w-1/3 left-4 xl:left-20"
949
1105
  }, /*#__PURE__*/React__default.createElement("div", {
950
1106
  className: "text-xl md:text-3xl lg:text-4xl text-textHeading font-medium"
951
- }, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title), /*#__PURE__*/React__default.createElement("div", {
1107
+ }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.title), /*#__PURE__*/React__default.createElement("div", {
952
1108
  className: "md:text-xl lg:text-2xl text-primary line-clamp-3 md:line-clamp-none"
953
- }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.description)));
1109
+ }, data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$ = _data$data4[0]) === null || _data$data4$ === void 0 ? void 0 : _data$data4$.description)));
954
1110
  };
955
1111
 
956
1112
  var Hero6 = function Hero6(props) {
957
- var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _sectionData$, _sectionData$$buttons;
1113
+ var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$, _data$data4, _data$data4$, _sectionData$, _sectionData$$buttons;
958
1114
  var shopConfigStyle = props.shopConfigStyle,
959
1115
  data = props.data,
960
1116
  _props$Link = props.Link,
@@ -964,17 +1120,18 @@ var Hero6 = function Hero6(props) {
964
1120
  className: "relative"
965
1121
  }, /*#__PURE__*/React__default.createElement("img", {
966
1122
  src: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : (_data$data$$srcImages = _data$data$.srcImages) === null || _data$data$$srcImages === void 0 ? void 0 : _data$data$$srcImages[0],
967
- className: "w-full h-auto min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
1123
+ alt: data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title,
1124
+ className: "object-cover w-full h-auto min-h-[30vh] md:min-h-[50vh] max-h-[100vh]"
968
1125
  }), /*#__PURE__*/React__default.createElement("div", {
969
1126
  className: "absolute top-0 md:top-14 lg:top-20 w-full p-3 md:p-6 lg:p-12 z-10 flex flex-col gap-2 md:gap-4 lg:gap-6 items-center justify-center"
970
1127
  }, /*#__PURE__*/React__default.createElement("div", {
971
1128
  className: "text-primary text-xl md:text-3xl lg:text-5xl leading-[1.6] md:leading-[1.6] text-center font-headingFont"
972
- }, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.title), /*#__PURE__*/React__default.createElement("div", {
1129
+ }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.title), /*#__PURE__*/React__default.createElement("div", {
973
1130
  className: "md:text-xl"
974
- }, data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : (_data$data3$ = _data$data3[0]) === null || _data$data3$ === void 0 ? void 0 : _data$data3$.description), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$buttons = _sectionData$.buttons) === null || _sectionData$$buttons === void 0 ? void 0 : _sectionData$$buttons.map(function (button) {
1131
+ }, data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : (_data$data4$ = _data$data4[0]) === null || _data$data4$ === void 0 ? void 0 : _data$data4$.description), sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$buttons = _sectionData$.buttons) === null || _sectionData$$buttons === void 0 ? void 0 : _sectionData$$buttons.map(function (button) {
975
1132
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
976
1133
  Link: Link,
977
- href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
1134
+ href: convertURL(button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
978
1135
  }, /*#__PURE__*/React__default.createElement(Button, {
979
1136
  label: button === null || button === void 0 ? void 0 : button.label,
980
1137
  shopConfigStyle: shopConfigStyle
@@ -1004,7 +1161,7 @@ var Hero10 = function Hero10(props) {
1004
1161
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
1005
1162
  Link: Link,
1006
1163
  key: "gdf-" + index,
1007
- href: (button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
1164
+ href: convertURL(button === null || button === void 0 ? void 0 : button.route) || (button === null || button === void 0 ? void 0 : button.link) || "#"
1008
1165
  }, /*#__PURE__*/React__default.createElement(Button, {
1009
1166
  label: button === null || button === void 0 ? void 0 : button.label,
1010
1167
  shopConfigStyle: shopConfigStyle
@@ -7299,7 +7456,7 @@ var CategoryController = function CategoryController(props) {
7299
7456
  };
7300
7457
 
7301
7458
  var Hero13 = function Hero13(props) {
7302
- var _sectionData$, _sectionData$$srcImag;
7459
+ var _sectionData$, _sectionData$$srcImag, _data$data, _data$data$;
7303
7460
  var listRef = useRef(null);
7304
7461
  var _useState = useState(false);
7305
7462
  var data = props.data;
@@ -7307,7 +7464,8 @@ var Hero13 = function Hero13(props) {
7307
7464
  var _CategoryController = CategoryController(props);
7308
7465
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("img", {
7309
7466
  src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : (_sectionData$$srcImag = _sectionData$.srcImages) === null || _sectionData$$srcImag === void 0 ? void 0 : _sectionData$$srcImag[0],
7310
- className: "w-full"
7467
+ alt: data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.title,
7468
+ className: "w-full object-cover"
7311
7469
  }));
7312
7470
  };
7313
7471
 
@@ -7370,7 +7528,7 @@ var Features3 = function Features3(props) {
7370
7528
  }, sectionData && sectionData.length > 0 && sectionData.map(function (item, index) {
7371
7529
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
7372
7530
  Link: Link,
7373
- href: (item === null || item === void 0 ? void 0 : item.link) || (item === null || item === void 0 ? void 0 : item.route) || "#"
7531
+ href: (item === null || item === void 0 ? void 0 : item.link) || convertURL(item === null || item === void 0 ? void 0 : item.route) || "#"
7374
7532
  }, /*#__PURE__*/React__default.createElement("div", {
7375
7533
  className: "grid grid-cols-2 p-3 rounded-lg font-semibold",
7376
7534
  key: "dfsdfj-" + index,
@@ -7428,6 +7586,11 @@ var ProductController = function ProductController(props) {
7428
7586
  var _res$data2, _res$data3;
7429
7587
  setProducts(res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data);
7430
7588
  setPage(res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.page);
7589
+ var url = new URL(window.location.href);
7590
+ if (/^(\/(danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
7591
+ url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
7592
+ window.history.replaceState({}, '', url.pathname + url.search);
7593
+ }
7431
7594
  }
7432
7595
  setLoading(false);
7433
7596
  });
@@ -7466,6 +7629,7 @@ var ProductController = function ProductController(props) {
7466
7629
  };
7467
7630
  return {
7468
7631
  products: products,
7632
+ setProducts: setProducts,
7469
7633
  loading: loading,
7470
7634
  page: page,
7471
7635
  getProductListSearch: getProductListSearch
@@ -7615,13 +7779,16 @@ function SvgImageGallery(props) {
7615
7779
  }
7616
7780
 
7617
7781
  var DefaultImage = function DefaultImage(props) {
7618
- var _props$className = props.className,
7782
+ var _props$size = props.size,
7783
+ size = _props$size === void 0 ? 0 : _props$size,
7784
+ _props$className = props.className,
7619
7785
  className = _props$className === void 0 ? "" : _props$className;
7620
7786
  return /*#__PURE__*/React__default.createElement("div", {
7621
- className: "flex justify-center items-center w-full aspect-square " + className,
7622
- style: {
7623
- backgroundColor: "#FAFAFA"
7624
- }
7787
+ className: "flex justify-center items-center w-full aspect-square " + className + " bg-[#FAFAFA]",
7788
+ style: size ? {
7789
+ width: size,
7790
+ height: size
7791
+ } : null
7625
7792
  }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
7626
7793
  width: "25%",
7627
7794
  height: "25%",
@@ -7642,12 +7809,20 @@ var ProductImage = function ProductImage(props) {
7642
7809
  }, [product]);
7643
7810
  var getProductImage = function getProductImage() {
7644
7811
  var _JSON$parse, _JSON$parse$;
7645
- var src = (_JSON$parse = JSON.parse((product === null || product === void 0 ? void 0 : product.imagesUrl) || "[]")) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$ = _JSON$parse[0]) === null || _JSON$parse$ === void 0 ? void 0 : _JSON$parse$.imageUrl;
7646
- setSrc(src);
7812
+ var src = (_JSON$parse = JSON.parse((product === null || product === void 0 ? void 0 : product.imagesUrl) || "[]")) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$ = _JSON$parse[0]) === null || _JSON$parse$ === void 0 ? void 0 : _JSON$parse$.src;
7813
+ if (src !== null && src !== void 0 && src.startsWith("http")) {
7814
+ setSrc(src);
7815
+ } else if (src) {
7816
+ var urlImage = "https://test-apigateway.sfin.vn/assets/images/sshop/shops/" + (product === null || product === void 0 ? void 0 : product.shopId) + "/" + (product === null || product === void 0 ? void 0 : product.productId) + "/" + src;
7817
+ setSrc(urlImage);
7818
+ } else {
7819
+ setSrc(src);
7820
+ }
7647
7821
  };
7648
7822
  return src ? /*#__PURE__*/React__default.createElement("img", {
7649
7823
  src: src,
7650
- className: "w-full aspect-square " + className,
7824
+ alt: product === null || product === void 0 ? void 0 : product.productName,
7825
+ className: "w-full aspect-square object-cover " + className,
7651
7826
  style: size ? {
7652
7827
  width: size,
7653
7828
  height: size
@@ -7675,6 +7850,7 @@ var getYoutubeVideoIdByUrl = function getYoutubeVideoIdByUrl(url) {
7675
7850
  var match = url === null || url === void 0 ? void 0 : url.match(regex);
7676
7851
  return match ? match[1] : null;
7677
7852
  };
7853
+ var linkPagePolicy = "https://sites.google.com/view/sodofin-landing-page-policy";
7678
7854
 
7679
7855
  function getMinMax(array, field) {
7680
7856
  if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
@@ -8090,6 +8266,8 @@ var Select = forwardRef(function (props, ref) {
8090
8266
  wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
8091
8267
  _props$selectClassNam = props.selectClassName,
8092
8268
  selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
8269
+ _props$disabled = props.disabled,
8270
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
8093
8271
  _props$rules = props.rules,
8094
8272
  rules = _props$rules === void 0 ? [] : _props$rules,
8095
8273
  options = props.options,
@@ -8269,10 +8447,11 @@ var Select = forwardRef(function (props, ref) {
8269
8447
  }, label ? /*#__PURE__*/React__default.createElement("div", {
8270
8448
  className: "mb-1 " + labelClassName
8271
8449
  }, label, " ", labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
8272
- className: "flex flex-col gap-2 rounded-lg w-full bg-white border " + className
8450
+ className: "flex flex-col gap-2 rounded-lg w-full bg-white " + (disabled ? "!bg-gray6" : "") + " border " + className
8273
8451
  }, /*#__PURE__*/React__default.createElement("button", {
8274
- className: "w-full h-10 bg-transparent flex justify-between items-center px-3 py-2 " + selectClassName,
8275
- onClick: handleToggleSelect
8452
+ className: " w-full h-10 bg-transparent flex justify-between items-center px-3 py-2 " + selectClassName,
8453
+ onClick: handleToggleSelect,
8454
+ disabled: disabled
8276
8455
  }, /*#__PURE__*/React__default.createElement("div", {
8277
8456
  className: "flex justify-between items-center w-full"
8278
8457
  }, isEmpty(value) || isMulti ? /*#__PURE__*/React__default.createElement("div", {
@@ -8340,6 +8519,8 @@ var DateTimePicker = forwardRef(function (props, ref) {
8340
8519
  labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
8341
8520
  _props$defaultValue = props.defaultValue,
8342
8521
  defaultValue = _props$defaultValue === void 0 ? new Date() : _props$defaultValue,
8522
+ _props$time = props.time,
8523
+ time = _props$time === void 0 ? false : _props$time,
8343
8524
  rules = props.rules;
8344
8525
  var _useState = useState(defaultValue),
8345
8526
  value = _useState[0],
@@ -8377,7 +8558,7 @@ var DateTimePicker = forwardRef(function (props, ref) {
8377
8558
  var _validateData = function _validateData() {
8378
8559
  var count = 0;
8379
8560
  rules === null || rules === void 0 ? void 0 : rules.forEach(function (e) {
8380
- var _e$pattern;
8561
+ var _e$pattern, _e$validate;
8381
8562
  if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
8382
8563
  _setError(e === null || e === void 0 ? void 0 : e.message);
8383
8564
  count++;
@@ -8386,6 +8567,10 @@ var DateTimePicker = forwardRef(function (props, ref) {
8386
8567
  _setError(e === null || e === void 0 ? void 0 : e.message);
8387
8568
  count++;
8388
8569
  return false;
8570
+ } else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === "validate" && e !== null && e !== void 0 && e.validate && !(e !== null && e !== void 0 && (_e$validate = e.validate) !== null && _e$validate !== void 0 && _e$validate.call(e))) {
8571
+ _setError(e === null || e === void 0 ? void 0 : e.message);
8572
+ count++;
8573
+ return false;
8389
8574
  }
8390
8575
  });
8391
8576
  if (count) {
@@ -8409,13 +8594,17 @@ var DateTimePicker = forwardRef(function (props, ref) {
8409
8594
  selected: value,
8410
8595
  onChange: function onChange(date) {
8411
8596
  _setValue(date);
8412
- console.log("check date: ", date);
8413
8597
  },
8414
8598
  customInput: /*#__PURE__*/React__default.createElement(CustomInput, {
8415
8599
  className: _className
8416
8600
  }),
8601
+ dateFormat: time ? "dd/MM/yyyy HH:mm" : "dd/MM/yyyy",
8602
+ showTimeSelect: time,
8603
+ timeIntervals: 15,
8417
8604
  wrapperClassName: "w-full"
8418
- }), error ? /*#__PURE__*/React__default.createElement("div", null, error) : null);
8605
+ }), error ? /*#__PURE__*/React__default.createElement("div", {
8606
+ className: "text-danger"
8607
+ }, error) : null);
8419
8608
  });
8420
8609
 
8421
8610
  var InputPhoneNumber = forwardRef(function (props, ref) {
@@ -8429,6 +8618,8 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
8429
8618
  name = _props$name === void 0 ? "" : _props$name,
8430
8619
  _props$onChange = props.onChange,
8431
8620
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
8621
+ _props$disabled = props.disabled,
8622
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
8432
8623
  _props$defaultValue = props.defaultValue,
8433
8624
  defaultValue = _props$defaultValue === void 0 ? "" : _props$defaultValue,
8434
8625
  _props$type = props.type,
@@ -8494,11 +8685,11 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
8494
8685
  for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
8495
8686
  var _e$pattern;
8496
8687
  var e = _step.value;
8497
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
8688
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && !value) {
8498
8689
  _setError(e === null || e === void 0 ? void 0 : e.message);
8499
8690
  count++;
8500
8691
  break;
8501
- } else if (value !== "" && (e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
8692
+ } else if (value && (e === null || e === void 0 ? void 0 : e.type) === 'pattern' && !(e !== null && e !== void 0 && (_e$pattern = e.pattern) !== null && _e$pattern !== void 0 && _e$pattern.test(value))) {
8502
8693
  _setError(e === null || e === void 0 ? void 0 : e.message);
8503
8694
  count++;
8504
8695
  break;
@@ -8530,6 +8721,7 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
8530
8721
  className: 'w-max border-0 !rounded-none !rounded-l-lg',
8531
8722
  defaultValue: countryCode,
8532
8723
  options: options,
8724
+ disabled: disabled,
8533
8725
  optionClassName: "w-max",
8534
8726
  placeholder: "+84",
8535
8727
  onClick: setCountryCode,
@@ -8551,11 +8743,12 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
8551
8743
  })), /*#__PURE__*/React__default.createElement("input", {
8552
8744
  type: type,
8553
8745
  name: name,
8746
+ disabled: disabled,
8554
8747
  value: value,
8555
8748
  placeholder: placeholder,
8556
8749
  onChange: handleOnChange,
8557
8750
  required: required,
8558
- className: "bg-white rounded-r-lg " + _inputClassName
8751
+ className: "bg-white " + (disabled ? "!bg-gray6" : "") + " rounded-r-lg " + _inputClassName
8559
8752
  })), error ? /*#__PURE__*/React__default.createElement("div", {
8560
8753
  className: "text-danger"
8561
8754
  }, error) : null);
@@ -8716,7 +8909,9 @@ var BookingForm = function BookingForm(props) {
8716
8909
  _props$defaultValue = props.defaultValue,
8717
8910
  defaultValue = _props$defaultValue === void 0 ? [] : _props$defaultValue,
8718
8911
  _props$className = props.className,
8719
- className = _props$className === void 0 ? "" : _props$className;
8912
+ className = _props$className === void 0 ? "" : _props$className,
8913
+ _props$isModalBooking = props.isModalBooking,
8914
+ isModalBooking = _props$isModalBooking === void 0 ? false : _props$isModalBooking;
8720
8915
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8721
8916
  _shopConfigStyle$colo5 = _shopConfigStyle$colo.background,
8722
8917
  background = _shopConfigStyle$colo5 === void 0 ? "#fff" : _shopConfigStyle$colo5;
@@ -8743,9 +8938,9 @@ var BookingForm = function BookingForm(props) {
8743
8938
  var _useState7 = useState(false),
8744
8939
  isOpenPopup = _useState7[0],
8745
8940
  setIsOpenPopup = _useState7[1];
8746
- var _useState8 = useState({}),
8747
- dataBooking = _useState8[0],
8748
- setDataBooking = _useState8[1];
8941
+ var _useState8 = useState(false),
8942
+ isHiddenForm = _useState8[0],
8943
+ setIsHiddenForm = _useState8[1];
8749
8944
  var _EmployeeController = EmployeeController(_extends({}, props)),
8750
8945
  _EmployeeController$l = _EmployeeController.listEmployment,
8751
8946
  listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
@@ -8840,19 +9035,24 @@ var BookingForm = function BookingForm(props) {
8840
9035
  });
8841
9036
  });
8842
9037
  };
9038
+ var checkDateBooking = function checkDateBooking() {
9039
+ var _inputDateRef$current;
9040
+ var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current = inputDateRef.current) === null || _inputDateRef$current === void 0 ? void 0 : _inputDateRef$current.getValue();
9041
+ return scheduleDate && scheduleDate >= Date.now();
9042
+ };
8843
9043
  var handleSubmit = function handleSubmit() {
8844
9044
  try {
8845
- var _inputNameRef$current, _inputPhoneNumberRef$, _inputDateRef$current, _inputSelectedRef$cur;
9045
+ var _inputNameRef$current, _inputPhoneNumberRef$, _inputDateRef$current2, _inputSelectedRef$cur;
8846
9046
  var validateName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current = inputNameRef.current) === null || _inputNameRef$current === void 0 ? void 0 : _inputNameRef$current.validateData();
8847
9047
  var validatePhoneNumber = inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$ = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$ === void 0 ? void 0 : _inputPhoneNumberRef$.validateData();
8848
- var validateDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current = inputDateRef.current) === null || _inputDateRef$current === void 0 ? void 0 : _inputDateRef$current.validateData();
9048
+ var validateDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current2 = inputDateRef.current) === null || _inputDateRef$current2 === void 0 ? void 0 : _inputDateRef$current2.validateData();
8849
9049
  var validateService = inputSelectedRef === null || inputSelectedRef === void 0 ? void 0 : (_inputSelectedRef$cur = inputSelectedRef.current) === null || _inputSelectedRef$cur === void 0 ? void 0 : _inputSelectedRef$cur.validateData();
8850
9050
  var _temp = function () {
8851
9051
  if (validateName && validatePhoneNumber && validateDate && validateService) {
8852
- var _inputPhoneNumberRef$2, _inputNameRef$current2, _inputDateRef$current2;
9052
+ var _inputPhoneNumberRef$2, _inputNameRef$current2, _inputDateRef$current3;
8853
9053
  var customerPhone = inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$2 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$2 === void 0 ? void 0 : _inputPhoneNumberRef$2.getValue();
8854
9054
  var customerName = inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current2 = inputNameRef.current) === null || _inputNameRef$current2 === void 0 ? void 0 : _inputNameRef$current2.getValue();
8855
- var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current2 = inputDateRef.current) === null || _inputDateRef$current2 === void 0 ? void 0 : _inputDateRef$current2.getValue();
9055
+ var scheduleDate = inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current3 = inputDateRef.current) === null || _inputDateRef$current3 === void 0 ? void 0 : _inputDateRef$current3.getValue();
8856
9056
  var services = listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.map(function (item) {
8857
9057
  var _item$technical;
8858
9058
  return {
@@ -8867,11 +9067,14 @@ var BookingForm = function BookingForm(props) {
8867
9067
  return Promise.resolve(createSchedule(customerName, customerPhone, scheduleDate, services, shopId)).then(function (response) {
8868
9068
  var _response$data, _response$data$status;
8869
9069
  if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$status = _response$data.status) === null || _response$data$status === void 0 ? void 0 : _response$data$status.code) === '200') {
8870
- var _response$data2, _inputPhoneNumberRef$3, _inputNameRef$current3;
8871
- setDataBooking(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.data);
9070
+ var _inputPhoneNumberRef$3, _inputNameRef$current3, _inputDateRef$current4;
9071
+ if (isModalBooking) {
9072
+ setIsHiddenForm(true);
9073
+ }
8872
9074
  setIsOpenPopup(true);
8873
9075
  inputPhoneNumberRef === null || inputPhoneNumberRef === void 0 ? void 0 : (_inputPhoneNumberRef$3 = inputPhoneNumberRef.current) === null || _inputPhoneNumberRef$3 === void 0 ? void 0 : _inputPhoneNumberRef$3.setValue("");
8874
9076
  inputNameRef === null || inputNameRef === void 0 ? void 0 : (_inputNameRef$current3 = inputNameRef.current) === null || _inputNameRef$current3 === void 0 ? void 0 : _inputNameRef$current3.setValue("");
9077
+ inputDateRef === null || inputDateRef === void 0 ? void 0 : (_inputDateRef$current4 = inputDateRef.current) === null || _inputDateRef$current4 === void 0 ? void 0 : _inputDateRef$current4.setValue(new Date());
8875
9078
  setListProductSelected([]);
8876
9079
  }
8877
9080
  });
@@ -8884,7 +9087,7 @@ var BookingForm = function BookingForm(props) {
8884
9087
  };
8885
9088
  var handleClosePopup = function handleClosePopup() {
8886
9089
  setIsOpenPopup(false);
8887
- setDataBooking({});
9090
+ setIsHiddenForm(false);
8888
9091
  };
8889
9092
  var handleSearchProducts = function handleSearchProducts(value) {
8890
9093
  setProductsParams(function (prev) {
@@ -8893,7 +9096,7 @@ var BookingForm = function BookingForm(props) {
8893
9096
  });
8894
9097
  });
8895
9098
  };
8896
- return /*#__PURE__*/React__default.createElement("div", {
9099
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !isHiddenForm ? /*#__PURE__*/React__default.createElement("div", {
8897
9100
  className: "grid gap-4 rounded-2xl p-6 border " + className,
8898
9101
  style: {
8899
9102
  backgroundColor: background
@@ -8946,9 +9149,14 @@ var BookingForm = function BookingForm(props) {
8946
9149
  label: "Thời gian",
8947
9150
  className: "w-full rounded-lg",
8948
9151
  placeholder: "Chọn thời gian",
9152
+ time: true,
8949
9153
  rules: [{
8950
9154
  type: "required",
8951
9155
  message: "Bắt buộc chọn ngày đặt"
9156
+ }, {
9157
+ type: "validate",
9158
+ message: "Thời gian không hợp lệ",
9159
+ validate: checkDateBooking
8952
9160
  }]
8953
9161
  })), (listProductSelected === null || listProductSelected === void 0 ? void 0 : listProductSelected.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
8954
9162
  className: "grid grid-cols-1"
@@ -9020,32 +9228,23 @@ var BookingForm = function BookingForm(props) {
9020
9228
  label: "Đặt lịch ngay",
9021
9229
  shopConfigStyle: shopConfigStyle,
9022
9230
  onClick: handleSubmit
9023
- })), isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
9231
+ }))) : null, isOpenPopup && /*#__PURE__*/React__default.createElement(ModalNotification, {
9024
9232
  onCloseFormBooking: onCloseFormBooking,
9025
9233
  onClose: handleClosePopup
9026
9234
  }, /*#__PURE__*/React__default.createElement("div", {
9027
- className: "bg-white rounded-lg shadow-lg p-6 max-w-sm flex flex-col items-center justify-center min-w-[320px] md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
9235
+ className: "bg-white rounded-lg shadow-lg p-6 lg:px-16 lg:pb-10 max-w-sm flex gap-4 flex-col items-center justify-center"
9028
9236
  }, /*#__PURE__*/React__default.createElement("div", {
9029
- className: "h-20 mb-4 flex items-center justify-center"
9237
+ className: "flex items-center justify-center"
9030
9238
  }, /*#__PURE__*/React__default.createElement(FaCheckCircle, {
9031
9239
  className: "h-full text-green-500",
9032
9240
  style: {
9033
- fontSize: "150px"
9241
+ fontSize: "56px"
9034
9242
  }
9035
9243
  })), /*#__PURE__*/React__default.createElement("div", {
9036
- className: "mb-2"
9037
- }, "Kh\xE1ch h\xE0ng: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerName), /*#__PURE__*/React__default.createElement("div", {
9038
- className: "mb-2"
9039
- }, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerPhone), /*#__PURE__*/React__default.createElement("div", {
9040
- className: "mb-4"
9041
- }, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), token ? /*#__PURE__*/React__default.createElement("div", null) : /*#__PURE__*/React__default.createElement("div", {
9042
- className: "flex flex-col items-center"
9043
- }, /*#__PURE__*/React__default.createElement("p", {
9044
- className: "mb-4 text-center"
9045
- }, "B\u1EA1n \u0111\xE3 c\xF3 t\xE0i kho\u1EA3n, vui l\xF2ng \u0111\u0103ng nh\u1EADp \u0111\u1EC3 xem chi ti\u1EBFt c\xE1c s\u1EA3n ph\u1EA9m, d\u1ECBch v\u1EE5 li\u1EC7u tr\xECnh m\xE0 b\u1EA1n \u0111ang s\u1EDF h\u1EEFu"), /*#__PURE__*/React__default.createElement(Button, {
9046
- label: "Đăng nhập",
9047
- shopConfigStyle: shopConfigStyle
9048
- })))));
9244
+ className: "font-medium text-2xl"
9245
+ }, "\u0110\u1EB7t l\u1ECBch th\xE0nh c\xF4ng"), /*#__PURE__*/React__default.createElement("div", {
9246
+ className: "text-center"
9247
+ }, "Ch\xFAng t\xF4i \u0111\xE3 ghi nh\u1EADn th\xF4ng tin c\u1EE7a b\u1EA1n v\xE0 s\u1EBD li\xEAn h\u1EC7 l\u1EA1i ngay"))));
9049
9248
  };
9050
9249
 
9051
9250
  var TreatmentsList7 = function TreatmentsList7(props) {
@@ -9170,7 +9369,8 @@ var TreatmentsList7 = function TreatmentsList7(props) {
9170
9369
  onCloseFormBooking: handleCloseModal,
9171
9370
  defaultValue: dataBooking,
9172
9371
  shopConfig: shopConfig,
9173
- shopConfigStyle: shopConfigStyle
9372
+ shopConfigStyle: shopConfigStyle,
9373
+ isModalBooking: isOpenModal
9174
9374
  })) : null);
9175
9375
  };
9176
9376
 
@@ -9334,10 +9534,10 @@ var TreatmentDetail1 = function TreatmentDetail1(props) {
9334
9534
  className: "flex flex-col gap-4 col-span-2"
9335
9535
  }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
9336
9536
  src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
9337
- className: "w-full aspect-square rounded-2xl"
9537
+ className: "w-full aspect-square object-cover rounded-2xl"
9338
9538
  }) : /*#__PURE__*/React__default.createElement(ProductImage, {
9339
9539
  product: product,
9340
- className: "w-full aspect-square rounded-2xl"
9540
+ className: "w-full aspect-square object-contain rounded-2xl"
9341
9541
  }), /*#__PURE__*/React__default.createElement("div", {
9342
9542
  className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
9343
9543
  }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
@@ -9414,7 +9614,7 @@ var ProductItem2 = function ProductItem2(props) {
9414
9614
  className: "text-center relative group " + className
9415
9615
  }, /*#__PURE__*/React__default.createElement(ProductImage, {
9416
9616
  product: product,
9417
- className: "max-w-[240px] rounded-full mx-auto"
9617
+ className: "max-w-[240px] rounded-full mx-auto !object-cover"
9418
9618
  }), /*#__PURE__*/React__default.createElement(ProductPrice, {
9419
9619
  product: product,
9420
9620
  className: "text-lg mt-4"
@@ -9639,7 +9839,7 @@ var ProductList7 = function ProductList7(props) {
9639
9839
  product: product === null || product === void 0 ? void 0 : product.productInfo
9640
9840
  });
9641
9841
  })), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(LinkToPage, {
9642
- href: "/products",
9842
+ href: "/san-pham",
9643
9843
  Link: Link
9644
9844
  }, /*#__PURE__*/React__default.createElement(Button, {
9645
9845
  label: "Xem tất cả",
@@ -9650,68 +9850,6 @@ var ProductList7 = function ProductList7(props) {
9650
9850
  }));
9651
9851
  };
9652
9852
 
9653
- var Carousel = function Carousel(props) {
9654
- var carouselRef = useRef(null);
9655
- var _useState = useState(false),
9656
- isScrolledToLeft = _useState[0],
9657
- setIsScrolledToLeft = _useState[1];
9658
- var _useState2 = useState(0);
9659
- var _props$data = props.data,
9660
- data = _props$data === void 0 ? [] : _props$data,
9661
- _props$className = props.className,
9662
- className = _props$className === void 0 ? "" : _props$className,
9663
- _props$style = props.style,
9664
- style = _props$style === void 0 ? {} : _props$style,
9665
- _props$primaryColor = props.primaryColor,
9666
- primaryColor = _props$primaryColor === void 0 ? "" : _props$primaryColor,
9667
- _props$renderItem = props.renderItem,
9668
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
9669
- var handleClickPrevImg = function handleClickPrevImg() {
9670
- if (carouselRef !== null && carouselRef !== void 0 && carouselRef.current) {
9671
- setIsScrolledToLeft(true);
9672
- carouselRef.current.scrollBy({
9673
- left: -carouselRef.current.offsetWidth / 4,
9674
- behavior: "smooth"
9675
- });
9676
- }
9677
- };
9678
- var handleClickNextImg = function handleClickNextImg() {
9679
- setIsScrolledToLeft(false);
9680
- if (carouselRef !== null && carouselRef !== void 0 && carouselRef.current) {
9681
- var _carouselRef$current, _carouselRef$current2;
9682
- carouselRef === null || carouselRef === void 0 ? void 0 : (_carouselRef$current = carouselRef.current) === null || _carouselRef$current === void 0 ? void 0 : _carouselRef$current.scrollBy({
9683
- left: (carouselRef === null || carouselRef === void 0 ? void 0 : (_carouselRef$current2 = carouselRef.current) === null || _carouselRef$current2 === void 0 ? void 0 : _carouselRef$current2.offsetWidth) / 4,
9684
- behavior: "smooth"
9685
- });
9686
- }
9687
- };
9688
- return /*#__PURE__*/React__default.createElement("div", {
9689
- className: "relative " + className + " ",
9690
- style: style
9691
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
9692
- className: " w-full pe-2 h-full flex gap-2 md:gap-4 xl:gap-6 overflow-x-auto no-scrollbar",
9693
- ref: carouselRef
9694
- }, data && (data === null || data === void 0 ? void 0 : data.length) > 0 ? data === null || data === void 0 ? void 0 : data.map(function (item, index) {
9695
- return renderItem(item, index);
9696
- }) : null)), data && (data === null || data === void 0 ? void 0 : data.length) > 4 ? /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("button", {
9697
- className: " hidden lg:block bg-gray3 p-3 rounded-full absolute top-[45%] left-[-8px] lg:left-[-2%]",
9698
- style: {
9699
- backgroundColor: isScrolledToLeft ? primaryColor : "#BDBDBD"
9700
- },
9701
- onClick: handleClickPrevImg
9702
- }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
9703
- className: "text-sm lg:text-lg text-white"
9704
- })), /*#__PURE__*/React__default.createElement("button", {
9705
- className: " hidden lg:block p-3 rounded-full absolute top-[45%] right-[-2%] ",
9706
- style: {
9707
- backgroundColor: !isScrolledToLeft ? primaryColor : "#BDBDBD"
9708
- },
9709
- onClick: handleClickNextImg
9710
- }, /*#__PURE__*/React__default.createElement(FaArrowRight, {
9711
- className: "text-sm lg:text-lg text-white"
9712
- }))) : null);
9713
- };
9714
-
9715
9853
  var Products2 = function Products2(props) {
9716
9854
  var shopConfigStyle = props.shopConfigStyle,
9717
9855
  data = props.data,
@@ -9720,8 +9858,6 @@ var Products2 = function Products2(props) {
9720
9858
  _props$Link = props.Link,
9721
9859
  Link = _props$Link === void 0 ? null : _props$Link;
9722
9860
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9723
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.primary,
9724
- primary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2,
9725
9861
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9726
9862
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3,
9727
9863
  _shopConfigStyle$colo4 = _shopConfigStyle$colo.textBody,
@@ -9732,8 +9868,53 @@ var Products2 = function Products2(props) {
9732
9868
  textButton = _shopConfigStyle$colo6 === void 0 ? "#fff" : _shopConfigStyle$colo6;
9733
9869
  var _ProductController = ProductController(props),
9734
9870
  _ProductController$pr = _ProductController.products,
9735
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9871
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
9872
+ _ProductController$lo = _ProductController.loading,
9873
+ loading = _ProductController$lo === void 0 ? true : _ProductController$lo;
9874
+ var sliderRef = useRef(null);
9736
9875
  console.log("Products2 products");
9876
+ var settings = {
9877
+ infinite: false,
9878
+ slidesToShow: 4,
9879
+ slidesToScroll: 1,
9880
+ speed: 500,
9881
+ autoplay: false,
9882
+ autoplaySpeed: 4000,
9883
+ pauseOnHover: true,
9884
+ dots: false,
9885
+ swipe: true,
9886
+ touchMove: true,
9887
+ arrows: false,
9888
+ responsive: [{
9889
+ breakpoint: 1024,
9890
+ settings: {
9891
+ slidesToShow: 4,
9892
+ slidesToScroll: 4
9893
+ }
9894
+ }, {
9895
+ breakpoint: 1023,
9896
+ settings: {
9897
+ slidesToShow: 3,
9898
+ slidesToScroll: 3
9899
+ }
9900
+ }, {
9901
+ breakpoint: 635,
9902
+ settings: {
9903
+ slidesToShow: 2,
9904
+ slidesToScroll: 2
9905
+ }
9906
+ }]
9907
+ };
9908
+ var goToNext = function goToNext() {
9909
+ if (sliderRef.current) {
9910
+ sliderRef.current.slickNext();
9911
+ }
9912
+ };
9913
+ var goToPrev = function goToPrev() {
9914
+ if (sliderRef.current) {
9915
+ sliderRef.current.slickPrev();
9916
+ }
9917
+ };
9737
9918
  return /*#__PURE__*/React__default.createElement("div", {
9738
9919
  className: "pt-10 px-4 xl:px-20",
9739
9920
  style: {
@@ -9741,29 +9922,43 @@ var Products2 = function Products2(props) {
9741
9922
  color: textBody
9742
9923
  }
9743
9924
  }, /*#__PURE__*/React__default.createElement("div", {
9744
- className: "rounded-3xl w-full py-10 md:px-10 sm:px-6 px-4",
9925
+ className: "relative rounded-3xl w-full py-10 md:px-10 sm:px-6 px-4",
9745
9926
  style: {
9746
9927
  background: secondary
9747
9928
  }
9748
9929
  }, /*#__PURE__*/React__default.createElement("h2", {
9749
- className: "font-semibold text-2xl md:text-3xl lg:text-4xl ps-5 pb-4",
9930
+ className: "font-semibold text-2xl md:text-4xl lg:text-4xl ps-5 pb-4",
9750
9931
  style: {
9751
9932
  color: textButton
9752
9933
  }
9753
- }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement(Carousel, {
9754
- data: products,
9755
- primaryColor: primary,
9756
- renderItem: function renderItem(item, index) {
9757
- return /*#__PURE__*/React__default.createElement("div", {
9758
- className: "border-0 flex-shrink-0 w-[calc(50%-2px)] md:w-[calc(34%-16px)] lg:w-[calc(25%-12px)] xl:w-[calc(25%-19px)]"
9759
- }, /*#__PURE__*/React__default.createElement(ProductItem, {
9760
- product: item.productInfo,
9761
- key: "carousel-" + index,
9762
- Link: Link,
9763
- shopConfigStyle: shopConfigStyle
9764
- }));
9765
- }
9766
- })));
9934
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", null, loading ? /*#__PURE__*/React__default.createElement("div", {
9935
+ className: "flex justify-center mt-20 w-full min-h-32"
9936
+ }, /*#__PURE__*/React__default.createElement("div", {
9937
+ className: "mx-auto"
9938
+ }, /*#__PURE__*/React__default.createElement(Loading, null))) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(Slider, _extends({
9939
+ ref: sliderRef
9940
+ }, settings), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9941
+ return /*#__PURE__*/React__default.createElement("div", {
9942
+ className: "px-2 lg:px-3",
9943
+ key: "dfg-" + index
9944
+ }, /*#__PURE__*/React__default.createElement(ProductItem, {
9945
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
9946
+ Link: Link,
9947
+ shopConfigStyle: shopConfigStyle
9948
+ }));
9949
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null)), /*#__PURE__*/React__default.createElement("div", {
9950
+ className: "absolute left-0 top-1/2 w-full flex justify-between px-2 md:px-4 lg:px-6"
9951
+ }, /*#__PURE__*/React__default.createElement("button", {
9952
+ onClick: goToPrev,
9953
+ className: "bg-primary p-2 rounded-full"
9954
+ }, /*#__PURE__*/React__default.createElement(FaArrowLeft, {
9955
+ className: "text-white text-lg md:text-2xl"
9956
+ }), " "), /*#__PURE__*/React__default.createElement("button", {
9957
+ onClick: goToNext,
9958
+ className: "bg-primary p-2 rounded-full"
9959
+ }, /*#__PURE__*/React__default.createElement(FaArrowRight, {
9960
+ className: "text-white text-lg md:text-2xl"
9961
+ }), " "))));
9767
9962
  };
9768
9963
 
9769
9964
  var Pagination = function Pagination(props) {
@@ -9787,8 +9982,11 @@ var Pagination = function Pagination(props) {
9787
9982
  return /*#__PURE__*/React__default.createElement("div", {
9788
9983
  className: "flex gap-4 items-center justify-self-center " + className
9789
9984
  }, /*#__PURE__*/React__default.createElement(IoChevronBackOutline, {
9790
- className: has_previous ? "text-primary" : "text-gray3",
9791
- size: size
9985
+ className: has_previous ? "text-primary cursor-pointer" : "text-gray3",
9986
+ size: size,
9987
+ onClick: function onClick() {
9988
+ if (has_previous) handlePageChange(current_page - 1);
9989
+ }
9792
9990
  }), /*#__PURE__*/React__default.createElement("div", {
9793
9991
  className: "flex items-center space-x-1"
9794
9992
  }, Array(total_pages).fill().map(function (_, index) {
@@ -9800,8 +9998,11 @@ var Pagination = function Pagination(props) {
9800
9998
  className: "px-4 py-1 rounded-md " + (index === current_page ? 'bg-primary text-textButton' : 'bg-transparent text-primary') + " hover:opacity-80"
9801
9999
  }, index + 1);
9802
10000
  })), /*#__PURE__*/React__default.createElement(IoChevronForwardOutline, {
9803
- className: has_next ? "text-primary" : "text-gray3",
9804
- size: size
10001
+ className: has_next ? "text-primary cursor-pointer" : "text-gray3",
10002
+ size: size,
10003
+ onClick: function onClick() {
10004
+ if (has_next) handlePageChange(current_page + 1);
10005
+ }
9805
10006
  }));
9806
10007
  };
9807
10008
 
@@ -9911,6 +10112,77 @@ var Products3 = function Products3(props) {
9911
10112
  }));
9912
10113
  };
9913
10114
 
10115
+ var Products9 = function Products9(props) {
10116
+ var _props$Link = props.Link,
10117
+ Link = _props$Link === void 0 ? null : _props$Link,
10118
+ shopConfigStyle = props.shopConfigStyle,
10119
+ _props$ProductItem = props.ProductItem,
10120
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
10121
+ var _useState = useState({
10122
+ size: 12
10123
+ }),
10124
+ params = _useState[0],
10125
+ setParams = _useState[1];
10126
+ var _CategoryController = CategoryController(_extends({}, props)),
10127
+ _CategoryController$c = _CategoryController.categories,
10128
+ categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
10129
+ var _ProductController = ProductController(_extends({}, props, {
10130
+ params: params
10131
+ })),
10132
+ _ProductController$pr = _ProductController.products,
10133
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10134
+ loading = _ProductController.loading;
10135
+ var handleChooseCategory = function handleChooseCategory(item) {
10136
+ setParams(_extends({}, params, {
10137
+ categoryId: item === null || item === void 0 ? void 0 : item.categoryId,
10138
+ size: 12
10139
+ }));
10140
+ };
10141
+ var groupedProducts = products === null || products === void 0 ? void 0 : products.reduce(function (acc, product) {
10142
+ var _product$productInfo = product === null || product === void 0 ? void 0 : product.productInfo,
10143
+ categoryName = _product$productInfo.categoryName;
10144
+ if (!acc[categoryName]) {
10145
+ acc[categoryName] = [];
10146
+ }
10147
+ acc[categoryName].push(product);
10148
+ return acc;
10149
+ }, {});
10150
+ console.log(groupedProducts);
10151
+ return /*#__PURE__*/React__default.createElement("div", {
10152
+ className: SECTION_CLASS + " flex flex-col gap-4 mt-0 md:gap-6 "
10153
+ }, /*#__PURE__*/React__default.createElement(CarouselItem, {
10154
+ data: categories,
10155
+ onClick: handleChooseCategory
10156
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
10157
+ className: "m-auto mt-20 min-h-32"
10158
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : groupedProducts ? Object.entries(groupedProducts).map(function (_ref, index) {
10159
+ var _products$;
10160
+ var categoryName = _ref[0],
10161
+ products = _ref[1];
10162
+ return /*#__PURE__*/React__default.createElement("div", {
10163
+ key: "wds-" + index,
10164
+ id: categoryName
10165
+ }, (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10166
+ className: "flex justify-between items-center"
10167
+ }, /*#__PURE__*/React__default.createElement("h2", {
10168
+ className: "text-2xl md:text-4xl font-semibold mb-4"
10169
+ }, categoryName), /*#__PURE__*/React__default.createElement(LinkToPage, {
10170
+ Link: Link,
10171
+ href: getLinkProductsByCategory(products === null || products === void 0 ? void 0 : (_products$ = products[0]) === null || _products$ === void 0 ? void 0 : _products$.productInfo),
10172
+ className: "font-semibold text-primary cursor-pointer"
10173
+ }, "Xem t\u1EA5t c\u1EA3")) : null, /*#__PURE__*/React__default.createElement("div", {
10174
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-2 md:gap-4 lg:gap-8"
10175
+ }, (products === null || products === void 0 ? void 0 : products.length) > 0 ? products === null || products === void 0 ? void 0 : products.map(function (product) {
10176
+ return /*#__PURE__*/React__default.createElement(ProductItem, {
10177
+ Link: Link,
10178
+ shopConfigStyle: shopConfigStyle,
10179
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10180
+ key: product === null || product === void 0 ? void 0 : product.landingShopProductId
10181
+ });
10182
+ }) : null));
10183
+ }) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
10184
+ };
10185
+
9914
10186
  var Products10 = function Products10(props) {
9915
10187
  var _useState = useState({
9916
10188
  size: 8
@@ -9950,7 +10222,7 @@ var Products10 = function Products10(props) {
9950
10222
  }), loading ? /*#__PURE__*/React__default.createElement("div", {
9951
10223
  className: "m-auto mt-20 min-h-32"
9952
10224
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9953
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10225
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
9954
10226
  }, products === null || products === void 0 ? void 0 : products.map(function (product, idx) {
9955
10227
  return /*#__PURE__*/React__default.createElement(ProductItem, {
9956
10228
  Link: Link,
@@ -9962,12 +10234,173 @@ var Products10 = function Products10(props) {
9962
10234
  })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null));
9963
10235
  };
9964
10236
 
9965
- var ProductCategory2 = function ProductCategory2(props) {
9966
- var _products$slice;
9967
- var _props$Link = props.Link,
9968
- Link = _props$Link === void 0 ? null : _props$Link,
9969
- data = props.data,
9970
- shopConfigStyle = props.shopConfigStyle,
10237
+ var listFilter = [{
10238
+ label: "Khuyến mãi",
10239
+ value: "discount",
10240
+ filter: {
10241
+ isDiscount: true
10242
+ }
10243
+ }, {
10244
+ label: "Nổi bật",
10245
+ value: "isHighlight",
10246
+ filter: {
10247
+ isHighlight: true
10248
+ }
10249
+ }, {
10250
+ label: "Giá thấp đến cao",
10251
+ value: "sortPriceDESC",
10252
+ filter: {
10253
+ isHighlight: true
10254
+ }
10255
+ }];
10256
+ var Products11 = function Products11(props) {
10257
+ var _productsFilter$slice;
10258
+ var _props$shopConfigStyl = props.shopConfigStyle,
10259
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10260
+ _props$Link = props.Link,
10261
+ Link = _props$Link === void 0 ? null : _props$Link,
10262
+ _props$categoryId = props.categoryId,
10263
+ categoryId = _props$categoryId === void 0 ? 0 : _props$categoryId,
10264
+ _props$ProductItem = props.ProductItem,
10265
+ ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem;
10266
+ var _useState = useState({
10267
+ page: 0,
10268
+ size: 12,
10269
+ categoryId: categoryId
10270
+ }),
10271
+ params = _useState[0],
10272
+ setParams = _useState[1];
10273
+ var _useState2 = useState(true),
10274
+ firstLoading = _useState2[0],
10275
+ setFirstLoading = _useState2[1];
10276
+ var _useState3 = useState({}),
10277
+ categorySelected = _useState3[0],
10278
+ setCategorySelected = _useState3[1];
10279
+ var _useState4 = useState([]),
10280
+ productsFilter = _useState4[0],
10281
+ setProductsFilter = _useState4[1];
10282
+ var _CategoryController = CategoryController(_extends({}, props, {
10283
+ params: params
10284
+ })),
10285
+ _CategoryController$c = _CategoryController.categories,
10286
+ categories = _CategoryController$c === void 0 ? [] : _CategoryController$c;
10287
+ var _ProductController = ProductController(_extends({}, props, {
10288
+ params: params
10289
+ })),
10290
+ _ProductController$pr = _ProductController.products,
10291
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10292
+ loading = _ProductController.loading,
10293
+ page = _ProductController.page;
10294
+ var handleOnChangePage = function handleOnChangePage(pageIndex) {
10295
+ setFirstLoading(false);
10296
+ setParams(function (prev) {
10297
+ return _extends({}, prev, {
10298
+ page: pageIndex
10299
+ });
10300
+ });
10301
+ };
10302
+ var handleChooseCategory = function handleChooseCategory(category) {
10303
+ setCategorySelected(category);
10304
+ setFirstLoading(true);
10305
+ setParams(function (prev) {
10306
+ return _extends({}, prev, {
10307
+ categoryId: category === null || category === void 0 ? void 0 : category.categoryId,
10308
+ size: 12
10309
+ });
10310
+ });
10311
+ };
10312
+ useEffect(function () {
10313
+ if ((categories === null || categories === void 0 ? void 0 : categories.length) > 0 && params !== null && params !== void 0 && params.categoryId) {
10314
+ var category = categories === null || categories === void 0 ? void 0 : categories.find(function (item) {
10315
+ return (item === null || item === void 0 ? void 0 : item.categoryId) == (params === null || params === void 0 ? void 0 : params.categoryId);
10316
+ });
10317
+ setCategorySelected(category);
10318
+ }
10319
+ }, [categories]);
10320
+ useEffect(function () {
10321
+ if ((products === null || products === void 0 ? void 0 : products.length) > 0) {
10322
+ setProductsFilter(products);
10323
+ }
10324
+ }, [products]);
10325
+ var handleFilter = function handleFilter(item) {
10326
+ if ((item === null || item === void 0 ? void 0 : item.value) === "sortPriceDESC") {
10327
+ var productsCopy = [].concat(products);
10328
+ productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.sort(function (a, b) {
10329
+ var _b$productInfo, _a$productInfo;
10330
+ return +(b === null || b === void 0 ? void 0 : (_b$productInfo = b.productInfo) === null || _b$productInfo === void 0 ? void 0 : _b$productInfo.price) - (a === null || a === void 0 ? void 0 : (_a$productInfo = a.productInfo) === null || _a$productInfo === void 0 ? void 0 : _a$productInfo.price);
10331
+ });
10332
+ setProductsFilter(productsCopy);
10333
+ } else if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
10334
+ var _productsCopy = [].concat(products);
10335
+ _productsCopy === null || _productsCopy === void 0 ? void 0 : _productsCopy.filter(function (product) {
10336
+ return (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price);
10337
+ });
10338
+ setProductsFilter(_productsCopy);
10339
+ } else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
10340
+ var _productsCopy3;
10341
+ var _productsCopy2 = [].concat(products);
10342
+ _productsCopy2 = (_productsCopy3 = _productsCopy2) === null || _productsCopy3 === void 0 ? void 0 : _productsCopy3.filter(function (product) {
10343
+ return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
10344
+ });
10345
+ setProductsFilter(_productsCopy2);
10346
+ } else {
10347
+ setProductsFilter(products);
10348
+ }
10349
+ };
10350
+ return /*#__PURE__*/React__default.createElement("div", {
10351
+ className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-4 gap-6"
10352
+ }, /*#__PURE__*/React__default.createElement("div", {
10353
+ className: "md:sticky top-20 self-start"
10354
+ }, /*#__PURE__*/React__default.createElement("div", {
10355
+ className: " flex flex-col gap-2 rounded-3xl bg-bgSecondary p-4"
10356
+ }, categories === null || categories === void 0 ? void 0 : categories.map(function (item, index) {
10357
+ return /*#__PURE__*/React__default.createElement("div", {
10358
+ className: "px-6 py-2 hover:bg-gray-100 hover:text-primary cursor-pointer rounded-lg " + ((categorySelected === null || categorySelected === void 0 ? void 0 : categorySelected.categoryId) === (item === null || item === void 0 ? void 0 : item.categoryId) ? " bg-primary text-textButton" : ""),
10359
+ onClick: function onClick() {
10360
+ handleChooseCategory(item);
10361
+ },
10362
+ key: "sdjfdh-" + index
10363
+ }, item === null || item === void 0 ? void 0 : item.cateName);
10364
+ }))), /*#__PURE__*/React__default.createElement("div", {
10365
+ className: "md:col-span-3 flex flex-col gap-8"
10366
+ }, /*#__PURE__*/React__default.createElement(CarouselItem, {
10367
+ data: listFilter,
10368
+ isNavigateButton: false,
10369
+ onClick: handleFilter
10370
+ }), loading && firstLoading ? /*#__PURE__*/React__default.createElement("div", {
10371
+ className: "w-full h-96 mb-1 flex justify-center items-center"
10372
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
10373
+ className: "grid grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-6 lg:gap-8"
10374
+ }, (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? productsFilter === null || productsFilter === void 0 ? void 0 : (_productsFilter$slice = productsFilter.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _productsFilter$slice === void 0 ? void 0 : _productsFilter$slice.map(function (product, index) {
10375
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
10376
+ href: getLinkProductDetail(product === null || product === void 0 ? void 0 : product.productInfo),
10377
+ Link: Link,
10378
+ key: "kghf-" + index
10379
+ }, /*#__PURE__*/React__default.createElement(ProductItem, {
10380
+ Link: Link,
10381
+ shopConfigStyle: shopConfigStyle,
10382
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
10383
+ key: product === null || product === void 0 ? void 0 : product.landingShopProductId
10384
+ }));
10385
+ }) : /*#__PURE__*/React__default.createElement("div", {
10386
+ className: "md:col-span-2 lg:col-span-3 mt-20 m-auto"
10387
+ }, /*#__PURE__*/React__default.createElement(NotFoundProduct, null)))), /*#__PURE__*/React__default.createElement("div", {
10388
+ className: "w-full m-auto"
10389
+ }, (page === null || page === void 0 ? void 0 : page.total_pages) > 1 ? /*#__PURE__*/React__default.createElement(Pagination, {
10390
+ total_pages: page === null || page === void 0 ? void 0 : page.total_pages,
10391
+ has_next: page === null || page === void 0 ? void 0 : page.has_next,
10392
+ has_previous: page === null || page === void 0 ? void 0 : page.has_previous,
10393
+ current_page: page === null || page === void 0 ? void 0 : page.current_page,
10394
+ onPageChange: handleOnChangePage
10395
+ }) : null)));
10396
+ };
10397
+
10398
+ var ProductCategory2 = function ProductCategory2(props) {
10399
+ var _products$slice;
10400
+ var _props$Link = props.Link,
10401
+ Link = _props$Link === void 0 ? null : _props$Link,
10402
+ data = props.data,
10403
+ shopConfigStyle = props.shopConfigStyle,
9971
10404
  _props$SectionTitle = props.SectionTitle,
9972
10405
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9973
10406
  _props$ProductItem = props.ProductItem,
@@ -10013,7 +10446,7 @@ var ProductCategory2 = function ProductCategory2(props) {
10013
10446
  }), loading && isFilter ? /*#__PURE__*/React__default.createElement("div", {
10014
10447
  className: "m-auto mt-20 min-h-32"
10015
10448
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10016
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10449
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10017
10450
  }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
10018
10451
  return /*#__PURE__*/React__default.createElement(ProductItem, {
10019
10452
  Link: Link,
@@ -10067,8 +10500,21 @@ var ProductSale2 = function ProductSale2(props) {
10067
10500
  })) : null;
10068
10501
  };
10069
10502
 
10503
+ var listFilter$1 = [{
10504
+ label: "Khuyến mãi",
10505
+ value: "discount",
10506
+ filter: {
10507
+ isDiscount: true
10508
+ }
10509
+ }, {
10510
+ label: "Nổi bật",
10511
+ value: "isHighlight",
10512
+ filter: {
10513
+ isHighlight: true
10514
+ }
10515
+ }];
10070
10516
  var ProductSearch1 = function ProductSearch1(props) {
10071
- var _window, _window$location;
10517
+ var _window, _window$location, _productsFilter$slice;
10072
10518
  var _props$Link = props.Link,
10073
10519
  Link = _props$Link === void 0 ? null : _props$Link,
10074
10520
  _props$SectionTitle = props.SectionTitle,
@@ -10077,13 +10523,13 @@ var ProductSearch1 = function ProductSearch1(props) {
10077
10523
  ProductItem = _props$ProductItem === void 0 ? null : _props$ProductItem,
10078
10524
  shopConfigStyle = props.shopConfigStyle;
10079
10525
  var queryParams = new URLSearchParams((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.search);
10080
- var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('keyword');
10081
- var _useState = useState(0),
10082
- length = _useState[0],
10083
- setLength = _useState[1];
10526
+ var keywordValue = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('tu-khoa');
10527
+ var _useState = useState([]),
10528
+ productsFilter = _useState[0],
10529
+ setProductsFilter = _useState[1];
10084
10530
  var _useState2 = useState({
10085
10531
  productName: keywordValue,
10086
- size: 24
10532
+ size: 12
10087
10533
  }),
10088
10534
  params = _useState2[0],
10089
10535
  setParams = _useState2[1];
@@ -10102,36 +10548,34 @@ var ProductSearch1 = function ProductSearch1(props) {
10102
10548
  });
10103
10549
  });
10104
10550
  }, [keywordValue]);
10551
+ useEffect(function () {
10552
+ if ((products === null || products === void 0 ? void 0 : products.length) > 0) setProductsFilter(products);
10553
+ }, [products]);
10105
10554
  var handleGetMoreProducts = function handleGetMoreProducts() {
10106
10555
  setIsGetMore(false);
10107
- setLength(function (prev) {
10108
- return prev + 4;
10556
+ setParams(function (prev) {
10557
+ return _extends({}, prev, {
10558
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
10559
+ });
10109
10560
  });
10110
10561
  };
10111
- var listFilter = [{
10112
- label: "Khuyến mãi",
10113
- value: "discount",
10114
- filter: {
10115
- isDiscount: true
10116
- }
10117
- }, {
10118
- label: "Nổi bật",
10119
- value: "highlight",
10120
- filter: {
10121
- isHighlight: true
10122
- }
10123
- }];
10124
10562
  var handleFilter = function handleFilter(item) {
10125
- setParams(function (prev) {
10126
- var _Object$keys;
10127
- var newParams = _extends({}, prev);
10128
- Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(newParams)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (key) {
10129
- if (key !== 'productName' && key !== 'size') {
10130
- delete newParams[key];
10131
- }
10563
+ if ((item === null || item === void 0 ? void 0 : item.value) === "discount") {
10564
+ var productsCopy = [].concat(products);
10565
+ productsCopy === null || productsCopy === void 0 ? void 0 : productsCopy.filter(function (product) {
10566
+ return (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) && (product === null || product === void 0 ? void 0 : product.priceBeforeDiscount) !== (product === null || product === void 0 ? void 0 : product.price);
10132
10567
  });
10133
- return _extends({}, newParams, item === null || item === void 0 ? void 0 : item.filter);
10134
- });
10568
+ setProductsFilter(productsCopy);
10569
+ } else if ((item === null || item === void 0 ? void 0 : item.value) === "isHighlight") {
10570
+ var _productsCopy2;
10571
+ var _productsCopy = [].concat(products);
10572
+ _productsCopy = (_productsCopy2 = _productsCopy) === null || _productsCopy2 === void 0 ? void 0 : _productsCopy2.filter(function (product) {
10573
+ return (product === null || product === void 0 ? void 0 : product[item === null || item === void 0 ? void 0 : item.value]) === true;
10574
+ });
10575
+ setProductsFilter(_productsCopy);
10576
+ } else {
10577
+ setProductsFilter(products);
10578
+ }
10135
10579
  };
10136
10580
  return /*#__PURE__*/React__default.createElement("div", {
10137
10581
  className: SECTION_CLASS + " flex flex-col gap-4 md:gap-6 "
@@ -10143,20 +10587,20 @@ var ProductSearch1 = function ProductSearch1(props) {
10143
10587
  }), /*#__PURE__*/React__default.createElement("div", {
10144
10588
  className: "text-lg"
10145
10589
  }, "T\u1EEB kh\xF3a \"", keywordValue, "\" (", products === null || products === void 0 ? void 0 : products.length, " s\u1EA3n ph\u1EA9m)"), /*#__PURE__*/React__default.createElement(CarouselItem, {
10146
- data: listFilter,
10590
+ data: listFilter$1,
10147
10591
  isNavigateButton: false,
10148
10592
  onClick: handleFilter
10149
10593
  }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10150
10594
  className: "m-auto mt-20 min-h-32"
10151
- }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10595
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10152
10596
  className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10153
- }, products.slice(0, 8 + length).map(function (product, idx) {
10597
+ }, productsFilter === null || productsFilter === void 0 ? void 0 : (_productsFilter$slice = productsFilter.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _productsFilter$slice === void 0 ? void 0 : _productsFilter$slice.map(function (product, idx) {
10154
10598
  return /*#__PURE__*/React__default.createElement(ProductItem, {
10155
10599
  Link: Link,
10156
10600
  product: product === null || product === void 0 ? void 0 : product.productInfo,
10157
10601
  key: "htrhr-" + idx
10158
10602
  });
10159
- })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > 8 + length ? /*#__PURE__*/React__default.createElement(Button, {
10603
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (productsFilter === null || productsFilter === void 0 ? void 0 : productsFilter.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
10160
10604
  label: "Xem thêm",
10161
10605
  onClick: handleGetMoreProducts,
10162
10606
  className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
@@ -10276,6 +10720,7 @@ var ProductsTop1 = function ProductsTop1(props) {
10276
10720
  _props$Link = props.Link,
10277
10721
  Link = _props$Link === void 0 ? null : _props$Link;
10278
10722
  var _useState = useState({
10723
+ sort: "ranked,DESC",
10279
10724
  size: 8
10280
10725
  }),
10281
10726
  params = _useState[0];
@@ -10286,6 +10731,7 @@ var ProductsTop1 = function ProductsTop1(props) {
10286
10731
  products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
10287
10732
  loading = _ProductController.loading;
10288
10733
  console.log("ProductsTop1 products");
10734
+ console.log(products);
10289
10735
  return /*#__PURE__*/React__default.createElement("div", {
10290
10736
  className: SECTION_DEFAULT_CLASS + " flex flex-col gap-8 "
10291
10737
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
@@ -10376,7 +10822,7 @@ var ProductHighlight1 = function ProductHighlight1(props) {
10376
10822
  isGetMore = _useState[0],
10377
10823
  setIsGetMore = _useState[1];
10378
10824
  var _useState2 = useState({
10379
- size: 8,
10825
+ size: 12,
10380
10826
  isHighlight: true
10381
10827
  }),
10382
10828
  params = _useState2[0],
@@ -10401,7 +10847,7 @@ var ProductHighlight1 = function ProductHighlight1(props) {
10401
10847
  }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
10402
10848
  className: "m-auto mt-20 min-h-32"
10403
10849
  }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
10404
- className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10850
+ className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-2 gap-y-4 md:gap-4 xl:gap-6"
10405
10851
  }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, (params === null || params === void 0 ? void 0 : params.size) - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
10406
10852
  return /*#__PURE__*/React__default.createElement(ProductItem, {
10407
10853
  Link: Link,
@@ -10419,7 +10865,7 @@ var ProductHighlight1 = function ProductHighlight1(props) {
10419
10865
  };
10420
10866
 
10421
10867
  var ProductDetail10 = function ProductDetail10(props) {
10422
- var _product$images;
10868
+ var _product$images2;
10423
10869
  var shopConfigStyle = props.shopConfigStyle,
10424
10870
  shopConfig = props.shopConfig,
10425
10871
  _props$handleRedirect = props.handleRedirect,
@@ -10447,6 +10893,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10447
10893
  var descriptionRef = useRef();
10448
10894
  useEffect(function () {
10449
10895
  if (product) {
10896
+ var _product$images;
10450
10897
  initVariant();
10451
10898
  if (descriptionRef.current) {
10452
10899
  var descriptionHeight = descriptionRef.current.offsetHeight;
@@ -10454,6 +10901,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10454
10901
  setHiddenButton(false);
10455
10902
  }
10456
10903
  }
10904
+ setDisplayImage(product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images[0]);
10457
10905
  }
10458
10906
  }, [product]);
10459
10907
  var initVariant = function initVariant() {
@@ -10519,7 +10967,7 @@ var ProductDetail10 = function ProductDetail10(props) {
10519
10967
  var _refInputQuantity$cur3;
10520
10968
  var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
10521
10969
  return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
10522
- handleRedirect("/carts");
10970
+ handleRedirect("/gio-hang");
10523
10971
  });
10524
10972
  }
10525
10973
  }();
@@ -10536,21 +10984,27 @@ var ProductDetail10 = function ProductDetail10(props) {
10536
10984
  }, /*#__PURE__*/React__default.createElement("div", {
10537
10985
  className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-5 gap-6 bg-bgSecondary"
10538
10986
  }, /*#__PURE__*/React__default.createElement("div", {
10539
- className: "flex flex-col gap-4 col-span-2"
10987
+ className: "flex flex-col gap-4 col-span-2 "
10540
10988
  }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
10541
10989
  src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
10542
- className: "w-full aspect-square rounded-2xl "
10543
- }) : /*#__PURE__*/React__default.createElement(ProductImage, {
10544
- product: product,
10545
- className: "w-full aspect-square rounded-2xl"
10546
- }), /*#__PURE__*/React__default.createElement("div", {
10990
+ className: "w-full border rounded-2xl p-2 bg-background aspect-square object-contain rounded-2xl "
10991
+ }) : /*#__PURE__*/React__default.createElement("div", {
10992
+ className: "flex justify-center items-center w-full rounded-2xl aspect-square",
10993
+ style: {
10994
+ backgroundColor: "#FAFAFA"
10995
+ }
10996
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
10997
+ width: "25%",
10998
+ height: "25%",
10999
+ fill: "#D9D9D9"
11000
+ })), /*#__PURE__*/React__default.createElement("div", {
10547
11001
  className: "flex gap-1 w-[80vw] overflow-x-auto md:w-full md:gap-2 md:flex-wrap"
10548
- }, product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images.map(function (item) {
11002
+ }, product === null || product === void 0 ? void 0 : (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2.map(function (item) {
10549
11003
  return /*#__PURE__*/React__default.createElement("img", {
10550
11004
  src: item === null || item === void 0 ? void 0 : item.imageUrl,
10551
11005
  key: item === null || item === void 0 ? void 0 : item.imageId,
10552
11006
  alt: "",
10553
- className: (displayImage ? "" : "first:border first:opacity-100 first:brightness-100") + " cursor-pointer h-16 w-16 rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 bg-background"),
11007
+ className: "cursor-pointer h-16 w-16 rounded-lg bg-background\n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border" : "opacity-50 brightness-75 "),
10554
11008
  onClick: function onClick() {
10555
11009
  handleDisplayImage(item);
10556
11010
  }
@@ -10639,6 +11093,274 @@ var ProductDetail10 = function ProductDetail10(props) {
10639
11093
  }, "Kh\xF4ng c\xF3 th\xF4ng tin"))));
10640
11094
  };
10641
11095
 
11096
+ var ProductDetail11 = function ProductDetail11(props) {
11097
+ var _product$images2, _product$images3, _product$images4, _product$images5, _product$attributes, _product$attributes2;
11098
+ var shopConfigStyle = props.shopConfigStyle,
11099
+ shopConfig = props.shopConfig,
11100
+ _props$handleRedirect = props.handleRedirect,
11101
+ handleRedirect = _props$handleRedirect === void 0 ? function () {} : _props$handleRedirect;
11102
+ var _ProductDetailControl = ProductDetailController(props),
11103
+ product = _ProductDetailControl.product;
11104
+ var _useState = useState(),
11105
+ variant = _useState[0],
11106
+ setVariant = _useState[1];
11107
+ var _useState2 = useState([]),
11108
+ options = _useState2[0],
11109
+ setOptions = _useState2[1];
11110
+ var _useState3 = useState(),
11111
+ displayImage = _useState3[0],
11112
+ setDisplayImage = _useState3[1];
11113
+ var _useState4 = useState(false),
11114
+ isSeeMore = _useState4[0],
11115
+ setIsSeeMore = _useState4[1];
11116
+ var _useState5 = useState(true),
11117
+ hiddenButton = _useState5[0],
11118
+ setHiddenButton = _useState5[1];
11119
+ var _CartController = CartController(props),
11120
+ addProductToCart = _CartController.addProductToCart;
11121
+ var refInputQuantity = useRef();
11122
+ var descriptionRef = useRef();
11123
+ useEffect(function () {
11124
+ if (product) {
11125
+ var _product$images;
11126
+ initVariant();
11127
+ if (descriptionRef.current) {
11128
+ var descriptionHeight = descriptionRef.current.offsetHeight;
11129
+ if (descriptionHeight >= 700) {
11130
+ setHiddenButton(false);
11131
+ }
11132
+ }
11133
+ setDisplayImage(product === null || product === void 0 ? void 0 : (_product$images = product.images) === null || _product$images === void 0 ? void 0 : _product$images[0]);
11134
+ }
11135
+ }, [product]);
11136
+ var initVariant = function initVariant() {
11137
+ var _product$variants, _variant$index;
11138
+ var variant = product === null || product === void 0 ? void 0 : (_product$variants = product.variants) === null || _product$variants === void 0 ? void 0 : _product$variants[0];
11139
+ var indexOptions = variant === null || variant === void 0 ? void 0 : (_variant$index = variant.index) === null || _variant$index === void 0 ? void 0 : _variant$index.split(",");
11140
+ setVariant(variant);
11141
+ var options = (product === null || product === void 0 ? void 0 : product.optionValues) || [];
11142
+ options = options.map(function (e, i) {
11143
+ return _extends({}, e, {
11144
+ valueIndex: (indexOptions === null || indexOptions === void 0 ? void 0 : indexOptions[i]) || 0
11145
+ });
11146
+ });
11147
+ setOptions(options);
11148
+ };
11149
+ var selectOption = function selectOption(optionIndex, valueIndex) {
11150
+ console.log("selectOption optionIndex valueIndex", optionIndex, valueIndex);
11151
+ var newOption = _extends({}, options[optionIndex], {
11152
+ valueIndex: valueIndex
11153
+ });
11154
+ options.splice(optionIndex, 1, newOption);
11155
+ var newOptions = [].concat(options);
11156
+ setOptions(newOptions);
11157
+ console.log("newOptions", newOptions);
11158
+ var variant = getVariantFromOption(newOptions);
11159
+ console.log("getVariantFromOption variant", variant);
11160
+ setVariant(variant);
11161
+ };
11162
+ var getVariantFromOption = function getVariantFromOption(_options) {
11163
+ console.log("getVariantFromOption options", _options);
11164
+ var listOptionIndexSelected = _options.map(function (e) {
11165
+ return e.valueIndex;
11166
+ }).filter(function (e) {
11167
+ return e !== undefined;
11168
+ });
11169
+ var variantIndex = listOptionIndexSelected.join(",");
11170
+ return ((product === null || product === void 0 ? void 0 : product.variants) || []).find(function (e) {
11171
+ return e.index === variantIndex;
11172
+ });
11173
+ };
11174
+ var validateData = function validateData() {
11175
+ var _refInputQuantity$cur;
11176
+ return (refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur = refInputQuantity.current) === null || _refInputQuantity$cur === void 0 ? void 0 : _refInputQuantity$cur.validateData()) && variant;
11177
+ };
11178
+ var addToCart = function addToCart() {
11179
+ try {
11180
+ var _temp = function () {
11181
+ if (validateData()) {
11182
+ var _refInputQuantity$cur2;
11183
+ var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur2 = refInputQuantity.current) === null || _refInputQuantity$cur2 === void 0 ? void 0 : _refInputQuantity$cur2.getValue();
11184
+ return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {});
11185
+ }
11186
+ }();
11187
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
11188
+ } catch (e) {
11189
+ return Promise.reject(e);
11190
+ }
11191
+ };
11192
+ var buyNow = function buyNow() {
11193
+ try {
11194
+ var _temp2 = function () {
11195
+ if (validateData()) {
11196
+ var _refInputQuantity$cur3;
11197
+ var quantity = refInputQuantity === null || refInputQuantity === void 0 ? void 0 : (_refInputQuantity$cur3 = refInputQuantity.current) === null || _refInputQuantity$cur3 === void 0 ? void 0 : _refInputQuantity$cur3.getValue();
11198
+ return Promise.resolve(addProductToCart(product, variant, quantity)).then(function () {
11199
+ handleRedirect("/gio-hang");
11200
+ });
11201
+ }
11202
+ }();
11203
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
11204
+ } catch (e) {
11205
+ return Promise.reject(e);
11206
+ }
11207
+ };
11208
+ var handleDisplayImage = function handleDisplayImage(item) {
11209
+ setDisplayImage(item);
11210
+ };
11211
+ return /*#__PURE__*/React__default.createElement("div", {
11212
+ className: SECTION_CLASS + " mt-6 md:mt-6 mb-0 " + ((shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.landingTemplateCode) === 'fashion_1' ? "bg-bgSecondary pb-8" : "bg-background")
11213
+ }, /*#__PURE__*/React__default.createElement("div", {
11214
+ className: "p-6 rounded-2xl grid grid-cols-1 md:grid-cols-2 bg-bgSecondary"
11215
+ }, /*#__PURE__*/React__default.createElement("div", {
11216
+ className: "grid grid-cols-5 gap-6"
11217
+ }, /*#__PURE__*/React__default.createElement("div", {
11218
+ className: "hidden lg:block col-span-1 lg:min-h-[240px] lg:max-h-[400px] xl:min-h-[400px] xl:max-h-[480px] overflow-y-auto overflow-hidden no-scrollbar"
11219
+ }, (product === null || product === void 0 ? void 0 : (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2.length) > 0 ? product === null || product === void 0 ? void 0 : (_product$images3 = product.images) === null || _product$images3 === void 0 ? void 0 : _product$images3.map(function (item) {
11220
+ return /*#__PURE__*/React__default.createElement("img", {
11221
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
11222
+ key: item === null || item === void 0 ? void 0 : item.imageId,
11223
+ alt: "",
11224
+ className: "cursor-pointer px-3 py-2 !h-24 !w-24 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border border-primary" : ""),
11225
+ onClick: function onClick() {
11226
+ handleDisplayImage(item);
11227
+ }
11228
+ });
11229
+ }) : /*#__PURE__*/React__default.createElement("div", {
11230
+ className: "p-2 border rounded-lg"
11231
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
11232
+ width: "100%",
11233
+ height: "25%",
11234
+ fill: "#D9D9D9"
11235
+ }))), /*#__PURE__*/React__default.createElement("div", {
11236
+ className: "flex flex-col gap-4 col-span-5 lg:col-span-4 p-4 border border-stroke rounded-2xl"
11237
+ }, displayImage ? /*#__PURE__*/React__default.createElement("img", {
11238
+ src: displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageUrl,
11239
+ className: "w-full aspect-square object-contain rounded-2xl "
11240
+ }) : /*#__PURE__*/React__default.createElement("div", {
11241
+ className: "flex justify-center items-center rounded-2xl w-full aspect-square",
11242
+ style: {
11243
+ backgroundColor: "#FAFAFA"
11244
+ }
11245
+ }, /*#__PURE__*/React__default.createElement(SvgImageGallery, {
11246
+ width: "25%",
11247
+ height: "25%",
11248
+ fill: "#D9D9D9"
11249
+ }))), /*#__PURE__*/React__default.createElement("div", {
11250
+ className: " block lg:hidden w-full flex gap-4 col-span-5 overflow-x-auto overflow-hidden no-scrollbar"
11251
+ }, (product === null || product === void 0 ? void 0 : (_product$images4 = product.images) === null || _product$images4 === void 0 ? void 0 : _product$images4.length) > 0 ? product === null || product === void 0 ? void 0 : (_product$images5 = product.images) === null || _product$images5 === void 0 ? void 0 : _product$images5.map(function (item) {
11252
+ return /*#__PURE__*/React__default.createElement("img", {
11253
+ src: item === null || item === void 0 ? void 0 : item.imageUrl,
11254
+ key: item === null || item === void 0 ? void 0 : item.imageId,
11255
+ alt: "",
11256
+ className: "cursor-pointer px-2 py-1 !h-24 !w-24 object-cover rounded-lg \n " + ((displayImage === null || displayImage === void 0 ? void 0 : displayImage.imageId) === (item === null || item === void 0 ? void 0 : item.imageId) ? "border border-primary" : ""),
11257
+ onClick: function onClick() {
11258
+ handleDisplayImage(item);
11259
+ }
11260
+ });
11261
+ }) : null)), /*#__PURE__*/React__default.createElement("div", {
11262
+ className: "mt-2 md:ms-10"
11263
+ }, /*#__PURE__*/React__default.createElement("p", {
11264
+ className: "font-semibold text-2xl"
11265
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement(ProductPrice, {
11266
+ product: product,
11267
+ variant: variant,
11268
+ className: "mt-4 md:mt-6 text-[22px]"
11269
+ }), options.map(function (option, index) {
11270
+ return /*#__PURE__*/React__default.createElement("div", {
11271
+ className: "flex gap-2 mt-4 md:mt-6",
11272
+ key: index
11273
+ }, /*#__PURE__*/React__default.createElement("div", {
11274
+ className: "min-w-24 my-auto"
11275
+ }, option === null || option === void 0 ? void 0 : option.name, ":"), /*#__PURE__*/React__default.createElement("div", {
11276
+ className: "flex gap-2"
11277
+ }, ((option === null || option === void 0 ? void 0 : option.value) || []).map(function (v, i) {
11278
+ return /*#__PURE__*/React__default.createElement("button", {
11279
+ key: i,
11280
+ onClick: function onClick() {
11281
+ return selectOption(index, i);
11282
+ },
11283
+ className: "rounded py-1 px-2 " + (i == option.valueIndex ? "bg-primary text-textButton" : "border bg-gray6")
11284
+ }, v);
11285
+ })));
11286
+ }), /*#__PURE__*/React__default.createElement(Input, {
11287
+ label: "Số lượng",
11288
+ wrapClassName: "flex items-center gap-6 mt-4 md:mt-6 ",
11289
+ rules: [{
11290
+ type: "required",
11291
+ message: "Bắt buộc nhập số lượng"
11292
+ }, {
11293
+ type: "pattern",
11294
+ pattern: numberPattern,
11295
+ message: "Số lượng không đúng"
11296
+ }],
11297
+ defaultValue: 1,
11298
+ isQuantity: true,
11299
+ min: 0,
11300
+ className: "bg-background",
11301
+ ref: refInputQuantity
11302
+ }), /*#__PURE__*/React__default.createElement("div", {
11303
+ className: "flex gap-4 mt-6"
11304
+ }, /*#__PURE__*/React__default.createElement(Button, {
11305
+ label: "THÊM VÀO GIỎ",
11306
+ shopConfigStyle: shopConfigStyle,
11307
+ type: "outline",
11308
+ onClick: function onClick() {
11309
+ return addToCart();
11310
+ }
11311
+ }), /*#__PURE__*/React__default.createElement(Button, {
11312
+ label: "MUA NGAY",
11313
+ shopConfigStyle: shopConfigStyle,
11314
+ onClick: function onClick() {
11315
+ return buyNow();
11316
+ }
11317
+ })))), /*#__PURE__*/React__default.createElement("div", {
11318
+ className: "grid grid-cols-1 lg:grid-cols-5 mt-8 lg:gap-8"
11319
+ }, /*#__PURE__*/React__default.createElement("div", {
11320
+ className: "lg:col-span-3 "
11321
+ }, /*#__PURE__*/React__default.createElement("h2", {
11322
+ className: "mb-8 font-semibold text-3xl"
11323
+ }, "M\xF4 t\u1EA3 s\u1EA3n ph\u1EA9m"), product !== null && product !== void 0 && product.description ? /*#__PURE__*/React__default.createElement("div", {
11324
+ className: "h-max relative p-2 p-6 pb-0 rounded-2xl bg-bgSecondary"
11325
+ }, /*#__PURE__*/React__default.createElement("div", {
11326
+ ref: descriptionRef,
11327
+ className: "" + (isSeeMore && !hiddenButton ? "h-full mb-4" : "max-h-[700px] overflow-hidden"),
11328
+ dangerouslySetInnerHTML: {
11329
+ __html: product === null || product === void 0 ? void 0 : product.description
11330
+ }
11331
+ }), !isSeeMore && !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
11332
+ className: "absolute bottom-0 rounded-b-2xl left-0 w-full h-24 bg-gradient-to-t from-black/40 to-transparent"
11333
+ }) : null, !hiddenButton ? /*#__PURE__*/React__default.createElement("div", {
11334
+ className: "w-full " + (!isSeeMore ? "absolute bottom-4" : "mt-2 pb-2") + " flex justify-center "
11335
+ }, /*#__PURE__*/React__default.createElement(Button, {
11336
+ label: isSeeMore ? /*#__PURE__*/React__default.createElement("div", {
11337
+ className: "flex items-center gap-2"
11338
+ }, "Thu nh\u1ECF ", /*#__PURE__*/React__default.createElement(FaMinus, null)) : /*#__PURE__*/React__default.createElement("div", {
11339
+ className: "flex items-center gap-2"
11340
+ }, "Xem th\xEAm ", /*#__PURE__*/React__default.createElement(FaPlus, null)),
11341
+ className: " bottom-0 z-50",
11342
+ onClick: function onClick() {
11343
+ setIsSeeMore(!isSeeMore);
11344
+ }
11345
+ })) : null) : /*#__PURE__*/React__default.createElement("div", {
11346
+ className: "text-lg text-gray3 rounded-lg p-2"
11347
+ }, "Kh\xF4ng c\xF3 th\xF4ng tin s\u1EA3n ph\u1EA9m")), (product === null || product === void 0 ? void 0 : (_product$attributes = product.attributes) === null || _product$attributes === void 0 ? void 0 : _product$attributes.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
11348
+ className: "lg:col-span-2"
11349
+ }, /*#__PURE__*/React__default.createElement("h2", {
11350
+ className: "text-3xl mb-8 font-semibold"
11351
+ }, "Th\xF4ng tin s\u1EA3n ph\u1EA9m"), /*#__PURE__*/React__default.createElement("div", {
11352
+ className: "bg-bgSecondary rounded-2xl py-2 px-2 md:px-6"
11353
+ }, product === null || product === void 0 ? void 0 : (_product$attributes2 = product.attributes) === null || _product$attributes2 === void 0 ? void 0 : _product$attributes2.map(function (item, index) {
11354
+ var _item$value;
11355
+ return /*#__PURE__*/React__default.createElement("div", {
11356
+ className: "p-4 flex gap-4 rounded-lg even:bg-background",
11357
+ key: "ptyh-" + index
11358
+ }, /*#__PURE__*/React__default.createElement("div", {
11359
+ className: "min-w-32 max-w-32 text-wrap"
11360
+ }, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : (_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value[0]));
11361
+ }))) : null));
11362
+ };
11363
+
10642
11364
  var Booking1 = function Booking1(props) {
10643
11365
  var _data$data, _data$data$, _data$data2, _data$data2$;
10644
11366
  var _props$shopConfigStyl = props.shopConfigStyle,
@@ -10693,7 +11415,7 @@ var BookingForm6 = function BookingForm6(props) {
10693
11415
  }), /*#__PURE__*/React__default.createElement("div", {
10694
11416
  className: "mt-12 grid grid-cols-1 gap-6 md:grid-cols-3 md:gap-12"
10695
11417
  }, /*#__PURE__*/React__default.createElement(LinkToPage, {
10696
- href: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.route) || (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.link) || "#"
11418
+ href: convertURL(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$ = _data$data[0]) === null || _data$data$ === void 0 ? void 0 : _data$data$.route) || (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : (_data$data2$ = _data$data2[0]) === null || _data$data2$ === void 0 ? void 0 : _data$data2$.link) || "#"
10697
11419
  }, data !== null && data !== void 0 && (_data$data3 = data.data) !== null && _data$data3 !== void 0 && (_data$data3$ = _data$data3[0]) !== null && _data$data3$ !== void 0 && _data$data3$.svgImage ? /*#__PURE__*/React__default.createElement("div", {
10698
11420
  className: "text-primary w-full h-auto"
10699
11421
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -10811,7 +11533,7 @@ var Banner3 = function Banner3(props) {
10811
11533
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10812
11534
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
10813
11535
  Link: Link,
10814
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
11536
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
10815
11537
  key: "djsd-" + index
10816
11538
  }, /*#__PURE__*/React__default.createElement("img", {
10817
11539
  src: item === null || item === void 0 ? void 0 : item.srcImage,
@@ -10967,11 +11689,12 @@ var Address1 = function Address1(props) {
10967
11689
  className: "sm:flex justify-between mt-3"
10968
11690
  }, /*#__PURE__*/React__default.createElement("small", null, "M\u1EDF c\u1EEDa 08:00-21:00"), /*#__PURE__*/React__default.createElement(LinkToPage, {
10969
11691
  Link: Link,
10970
- href: "#"
11692
+ href: "https://www.google.com/maps/search/?q=" + encodeURIComponent(item === null || item === void 0 ? void 0 : item.address),
11693
+ target: "_black"
10971
11694
  }, /*#__PURE__*/React__default.createElement("small", {
10972
11695
  className: "text-primary block"
10973
11696
  }, "Ch\u1EC9 \u0111\u01B0\u1EDDng ", /*#__PURE__*/React__default.createElement(FaArrowRight, {
10974
- className: "inline-block\t text-primary"
11697
+ className: "inline-block text-primary"
10975
11698
  }), " "))));
10976
11699
  }))));
10977
11700
  };
@@ -10992,8 +11715,8 @@ var Links1 = function Links1(props) {
10992
11715
  }, [1, 2, 3].map(function (item, index) {
10993
11716
  return /*#__PURE__*/React__default.createElement("div", {
10994
11717
  key: "qwikf-" + index + " "
10995
- }, /*#__PURE__*/React__default.createElement("h4", {
10996
- className: "text-lg md:text-xl lg:text-2xl font-semibold mb-4"
11718
+ }, /*#__PURE__*/React__default.createElement("h3", {
11719
+ className: "text-lg md:text-2xl font-semibold mb-4"
10997
11720
  }, "\u0110a d\u1EA1ng thanh to\xE1n"), /*#__PURE__*/React__default.createElement("div", {
10998
11721
  className: "leading-10 flex flex-col bg-background2 p-4 rounded-xl bg-bgSecondary "
10999
11722
  }, /*#__PURE__*/React__default.createElement("label", null, /*#__PURE__*/React__default.createElement(FaArrowsRotate, {
@@ -11028,7 +11751,7 @@ var Footer1 = function Footer1(props) {
11028
11751
  var genShopAddress = function genShopAddress() {
11029
11752
  try {
11030
11753
  var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
11031
- if (addressJson) {
11754
+ if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
11032
11755
  setShopAddressList(addressJson);
11033
11756
  } else {
11034
11757
  setShopAddressList([{
@@ -11052,7 +11775,7 @@ var Footer1 = function Footer1(props) {
11052
11775
  }, /*#__PURE__*/React__default.createElement("img", {
11053
11776
  className: "object-cover w-16 h-16",
11054
11777
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
11055
- alt: ""
11778
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
11056
11779
  }), /*#__PURE__*/React__default.createElement("h3", {
11057
11780
  className: " text-2xl md:text-3xl font-semibold ms-2",
11058
11781
  style: {
@@ -11064,10 +11787,10 @@ var Footer1 = function Footer1(props) {
11064
11787
  className: " col-span-2 flex flex-col mb-10 leading-8 sm:mb-0 "
11065
11788
  }, /*#__PURE__*/React__default.createElement("div", {
11066
11789
  className: "mb-3 font-semibold text-md md:text-lg"
11067
- }, "Th\xF4ng tin li\xEAn h\u1EC7"), shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
11790
+ }, "Th\xF4ng tin li\xEAn h\u1EC7"), Array.isArray(shopAddressList) ? shopAddressList === null || shopAddressList === void 0 ? void 0 : shopAddressList.map(function (item, index) {
11068
11791
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
11069
- className: "flex gap-1 items-center"
11070
- }, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
11792
+ className: "flex gap-2 items-center"
11793
+ }, /*#__PURE__*/React__default.createElement(HiOutlineLocationMarker, {
11071
11794
  size: 24,
11072
11795
  className: "inline-block",
11073
11796
  style: {
@@ -11075,14 +11798,14 @@ var Footer1 = function Footer1(props) {
11075
11798
  }
11076
11799
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address)), /*#__PURE__*/React__default.createElement("div", {
11077
11800
  className: "flex gap-2 items-center"
11078
- }, /*#__PURE__*/React__default.createElement(IoCallOutline, {
11801
+ }, /*#__PURE__*/React__default.createElement(AiOutlinePhone, {
11079
11802
  size: 24,
11080
11803
  className: "inline-block",
11081
11804
  style: {
11082
11805
  color: primary
11083
11806
  }
11084
11807
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.phone)));
11085
- })), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
11808
+ }) : null), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
11086
11809
  className: "mb-3 font-semibold text-lg"
11087
11810
  }, "Li\xEAn k\u1EBFt"), /*#__PURE__*/React__default.createElement("div", {
11088
11811
  className: "leading-10 flex flex-col "
@@ -11091,7 +11814,7 @@ var Footer1 = function Footer1(props) {
11091
11814
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (route, index) {
11092
11815
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
11093
11816
  Link: Link,
11094
- href: (route === null || route === void 0 ? void 0 : route.route) || "#",
11817
+ href: convertURL(route === null || route === void 0 ? void 0 : route.route) || "#",
11095
11818
  key: "dfjg-" + index
11096
11819
  }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
11097
11820
  }))), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
@@ -11099,7 +11822,8 @@ var Footer1 = function Footer1(props) {
11099
11822
  }, "H\u1ED7 tr\u1EE3"), /*#__PURE__*/React__default.createElement("div", {
11100
11823
  className: "flex justify-start items-center gap-4"
11101
11824
  }, /*#__PURE__*/React__default.createElement("a", {
11102
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
11825
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#",
11826
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? "_blank" : "_self"
11103
11827
  }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
11104
11828
  size: 40,
11105
11829
  color: textButton,
@@ -11108,7 +11832,8 @@ var Footer1 = function Footer1(props) {
11108
11832
  background: primary
11109
11833
  }
11110
11834
  })), /*#__PURE__*/React__default.createElement("a", {
11111
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
11835
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#",
11836
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? "_blank" : "_self"
11112
11837
  }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
11113
11838
  size: 40,
11114
11839
  color: textButton,
@@ -11117,7 +11842,8 @@ var Footer1 = function Footer1(props) {
11117
11842
  background: primary
11118
11843
  }
11119
11844
  })), /*#__PURE__*/React__default.createElement("a", {
11120
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
11845
+ href: "https://zalo.me/" + (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#",
11846
+ target: "_blank"
11121
11847
  }, /*#__PURE__*/React__default.createElement(SiZalo, {
11122
11848
  size: 40,
11123
11849
  color: textButton,
@@ -11130,7 +11856,8 @@ var Footer1 = function Footer1(props) {
11130
11856
  }, /*#__PURE__*/React__default.createElement("small", {
11131
11857
  className: "me-5"
11132
11858
  }, "B\u1EA3n quy\u1EC1n thu\u1ED9c c\xF4ng ty c\u1ED5 ph\u1EA7n c\xF4ng ngh\u1EC7 th\xF4ng minh SFIN."), /*#__PURE__*/React__default.createElement("a", {
11133
- href: "#"
11859
+ href: linkPagePolicy,
11860
+ target: "_blank"
11134
11861
  }, /*#__PURE__*/React__default.createElement("small", {
11135
11862
  className: "underline decoration-solid",
11136
11863
  style: {
@@ -11164,7 +11891,7 @@ var Footer7 = function Footer7(props) {
11164
11891
  var genShopAddress = function genShopAddress() {
11165
11892
  try {
11166
11893
  var addressJson = JSON.parse(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAddress);
11167
- if (addressJson) {
11894
+ if (Array.isArray(addressJson) && addressJson && (addressJson === null || addressJson === void 0 ? void 0 : addressJson.length) > 0) {
11168
11895
  setShopAddressList(addressJson);
11169
11896
  } else {
11170
11897
  setShopAddressList([{
@@ -11192,7 +11919,7 @@ var Footer7 = function Footer7(props) {
11192
11919
  }, /*#__PURE__*/React__default.createElement("img", {
11193
11920
  className: "object-cover w-14",
11194
11921
  src: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.logoUrl,
11195
- alt: ""
11922
+ alt: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopName
11196
11923
  }), /*#__PURE__*/React__default.createElement("h3", {
11197
11924
  className: " text-2xl md:text-3xl font-semibold ms-2",
11198
11925
  style: {
@@ -11208,16 +11935,16 @@ var Footer7 = function Footer7(props) {
11208
11935
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
11209
11936
  key: "dlkhg-" + index
11210
11937
  }, /*#__PURE__*/React__default.createElement("div", null, "C\u01A1 s\u1EDF ", index + 1), /*#__PURE__*/React__default.createElement("div", {
11211
- className: "flex gap-1"
11212
- }, /*#__PURE__*/React__default.createElement(IoLocationOutline, {
11938
+ className: "flex gap-2"
11939
+ }, /*#__PURE__*/React__default.createElement(HiOutlineLocationMarker, {
11213
11940
  size: 24,
11214
11941
  className: "inline-block mt-1",
11215
11942
  style: {
11216
11943
  color: primary
11217
11944
  }
11218
11945
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.address)), /*#__PURE__*/React__default.createElement("div", {
11219
- className: "flex gap-1"
11220
- }, /*#__PURE__*/React__default.createElement(IoCallOutline, {
11946
+ className: "flex gap-2"
11947
+ }, /*#__PURE__*/React__default.createElement(AiOutlinePhone, {
11221
11948
  size: 24,
11222
11949
  className: "inline-block mt-1",
11223
11950
  style: {
@@ -11232,7 +11959,7 @@ var Footer7 = function Footer7(props) {
11232
11959
  return e === null || e === void 0 ? void 0 : e.isShow;
11233
11960
  })) === null || _shopConfigStyle$navB2 === void 0 ? void 0 : _shopConfigStyle$navB2.map(function (route, index) {
11234
11961
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
11235
- href: (route === null || route === void 0 ? void 0 : route.route) || "#",
11962
+ href: convertURL(route === null || route === void 0 ? void 0 : route.route) || "#",
11236
11963
  Link: Link,
11237
11964
  key: "fiddf-" + index
11238
11965
  }, /*#__PURE__*/React__default.createElement("div", null, route === null || route === void 0 ? void 0 : route.label));
@@ -11241,7 +11968,8 @@ var Footer7 = function Footer7(props) {
11241
11968
  }, "H\u1ED7 tr\u1EE3"), /*#__PURE__*/React__default.createElement("div", {
11242
11969
  className: "flex justify-start items-center gap-4"
11243
11970
  }, /*#__PURE__*/React__default.createElement("a", {
11244
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#"
11971
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopFacebookPage) || "#",
11972
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopFacebookPage ? "_blank" : "_self"
11245
11973
  }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
11246
11974
  size: 40,
11247
11975
  color: textButton,
@@ -11250,7 +11978,8 @@ var Footer7 = function Footer7(props) {
11250
11978
  background: primary
11251
11979
  }
11252
11980
  })), /*#__PURE__*/React__default.createElement("a", {
11253
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#"
11981
+ href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopMessenger) || "#",
11982
+ target: shopConfig !== null && shopConfig !== void 0 && shopConfig.shopMessenger ? "_blank" : "_self"
11254
11983
  }, /*#__PURE__*/React__default.createElement(FaFacebookMessenger, {
11255
11984
  size: 40,
11256
11985
  color: textButton,
@@ -11259,7 +11988,8 @@ var Footer7 = function Footer7(props) {
11259
11988
  background: primary
11260
11989
  }
11261
11990
  })), /*#__PURE__*/React__default.createElement("a", {
11262
- href: (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#"
11991
+ href: "https://zalo.me/" + (shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopZalo) || "#",
11992
+ target: "_blank"
11263
11993
  }, /*#__PURE__*/React__default.createElement(SiZalo, {
11264
11994
  size: 40,
11265
11995
  color: textButton,
@@ -11272,7 +12002,8 @@ var Footer7 = function Footer7(props) {
11272
12002
  }, /*#__PURE__*/React__default.createElement("small", {
11273
12003
  className: "me-5"
11274
12004
  }, "B\u1EA3n quy\u1EC1n thu\u1ED9c c\xF4ng ty c\u1ED5 ph\u1EA7n c\xF4ng ngh\u1EC7 th\xF4ng minh SFIN."), /*#__PURE__*/React__default.createElement("a", {
11275
- href: "#"
12005
+ href: linkPagePolicy,
12006
+ target: "_blank"
11276
12007
  }, /*#__PURE__*/React__default.createElement("small", {
11277
12008
  className: "underline decoration-solid",
11278
12009
  style: {
@@ -11409,7 +12140,7 @@ var CustomerRating6 = function CustomerRating6(props) {
11409
12140
  _props$SectionTitle = props.SectionTitle,
11410
12141
  SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
11411
12142
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11412
- className: SECTION_CLASS + " !my-0 py-12 bg-bgSecondary"
12143
+ className: SECTION_CLASS + " !my-0 py-12 bg-"
11413
12144
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
11414
12145
  data: data,
11415
12146
  shopConfigStyle: shopConfigStyle
@@ -11419,9 +12150,9 @@ var CustomerRating6 = function CustomerRating6(props) {
11419
12150
  return /*#__PURE__*/React__default.createElement("div", {
11420
12151
  key: index,
11421
12152
  className: "relative bg-primary rounded-lg text-textButton px-6 py-4"
11422
- }, /*#__PURE__*/React__default.createElement(IoMdQuote, {
11423
- size: 30,
11424
- className: "absolute text-textButton top-[-15px] right-8"
12153
+ }, /*#__PURE__*/React__default.createElement(MdOutlineFormatQuote, {
12154
+ size: 43,
12155
+ className: "absolute text-black top-[-20px] right-8"
11425
12156
  }), /*#__PURE__*/React__default.createElement("div", {
11426
12157
  className: "flex items-end gap-2"
11427
12158
  }, /*#__PURE__*/React__default.createElement("img", {
@@ -11559,7 +12290,7 @@ var PageTitle1 = function PageTitle1(props) {
11559
12290
  className: "absolute top-0 w-full h-full bg-black opacity-40 z-0"
11560
12291
  }), /*#__PURE__*/React__default.createElement("div", {
11561
12292
  className: "relative w-full p-20 z-10 flex flex-col gap-6 items-center justify-center"
11562
- }, /*#__PURE__*/React__default.createElement("div", {
12293
+ }, /*#__PURE__*/React__default.createElement("h2", {
11563
12294
  className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
11564
12295
  }, sectionData !== null && sectionData !== void 0 && sectionData.sectionTitle ? sectionData === null || sectionData === void 0 ? void 0 : sectionData.sectionTitle : route === null || route === void 0 ? void 0 : route.label)));
11565
12296
  };
@@ -11574,6 +12305,7 @@ var About1 = function About1(props) {
11574
12305
  }, data === null || data === void 0 ? void 0 : data.sectionTitle) : null, data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
11575
12306
  className: "text-xl"
11576
12307
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null, /*#__PURE__*/React__default.createElement("div", {
12308
+ className: "text-wrap",
11577
12309
  dangerouslySetInnerHTML: {
11578
12310
  __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
11579
12311
  }
@@ -11592,7 +12324,7 @@ var About5 = function About5(props) {
11592
12324
  src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage,
11593
12325
  className: "w-full hidden lg:block rounded-xl"
11594
12326
  }), /*#__PURE__*/React__default.createElement("div", {
11595
- className: "ck-content",
12327
+ className: "ck-content text-wrap",
11596
12328
  dangerouslySetInnerHTML: {
11597
12329
  __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
11598
12330
  }
@@ -11602,6 +12334,32 @@ var About5 = function About5(props) {
11602
12334
  }));
11603
12335
  };
11604
12336
 
12337
+ var About6 = function About6(props) {
12338
+ var _sectionData$, _sectionData$2;
12339
+ var shopConfig = props.shopConfig,
12340
+ data = props.data;
12341
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
12342
+ console.log("About5 sectionData", sectionData);
12343
+ return /*#__PURE__*/React__default.createElement("div", {
12344
+ className: SECTION_DEFAULT_CLASS + " mt-0"
12345
+ }, /*#__PURE__*/React__default.createElement("h2", {
12346
+ className: "text-2xl md:text-4xl text-textHeading font-semibold mb-6 lg:mb-8"
12347
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle) , /*#__PURE__*/React__default.createElement("div", {
12348
+ className: "grid grid-cols-1 lg:grid-cols-5 gap-6 lg:gap-10"
12349
+ }, /*#__PURE__*/React__default.createElement("img", {
12350
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$ = sectionData[0]) === null || _sectionData$ === void 0 ? void 0 : _sectionData$.srcImage,
12351
+ className: "w-full h-auto object-cover lg:hidden block rounded-xl"
12352
+ }), /*#__PURE__*/React__default.createElement("div", {
12353
+ className: "ck-content text-wrap lg:col-span-3 bg-bgSecondary p-4 lg:p-6 rounded-2xl",
12354
+ dangerouslySetInnerHTML: {
12355
+ __html: shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopAbout
12356
+ }
12357
+ }), /*#__PURE__*/React__default.createElement("img", {
12358
+ src: sectionData === null || sectionData === void 0 ? void 0 : (_sectionData$2 = sectionData[0]) === null || _sectionData$2 === void 0 ? void 0 : _sectionData$2.srcImage,
12359
+ className: "w-full h-auto object-cover lg:col-span-2 lg:block hidden rounded-xl"
12360
+ })));
12361
+ };
12362
+
11605
12363
  var Contact1 = function Contact1(props) {
11606
12364
  var _sectionData$;
11607
12365
  var shopConfigStyle = props.shopConfigStyle,
@@ -11619,7 +12377,7 @@ var Contact1 = function Contact1(props) {
11619
12377
  className: "grid grid-cols-1 lg:grid-cols-2 gap-12 mt-6"
11620
12378
  }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", null, "Trong qu\xE1 tr\xECnh gh\xE9 th\u0103m website, n\u1EBFu qu\xFD kh\xE1ch c\xF3 b\u1EA5t k\u1EF3 th\u1EAFc m\u1EAFc hay c\u1EA7n s\u1EF1 h\u1ED7 tr\u1EE3 n\xE0o, h\xE3y li\xEAn h\u1EC7 v\u1EDBi ch\xFAng t\xF4i theo c\xE1c k\xEAnh sau: "), shopConfig !== null && shopConfig !== void 0 && shopConfig.shopPhone ? /*#__PURE__*/React__default.createElement("div", {
11621
12379
  className: "flex items-center gap-2 rounded-lg overflow-hidden bg-white mt-6"
11622
- }, /*#__PURE__*/React__default.createElement(FaFacebookF, {
12380
+ }, /*#__PURE__*/React__default.createElement(FaPhoneAlt, {
11623
12381
  size: 40,
11624
12382
  className: "p-2 text-textButton bg-primary"
11625
12383
  }), /*#__PURE__*/React__default.createElement("div", null, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopPhone)) : null, shopConfig !== null && shopConfig !== void 0 && shopConfig.shopZalo ? /*#__PURE__*/React__default.createElement("div", {
@@ -11665,11 +12423,12 @@ var Breadcrumb1 = function Breadcrumb1(props) {
11665
12423
  return e === null || e === void 0 ? void 0 : e.length;
11666
12424
  })) === null || _route$route$split$fi === void 0 ? void 0 : _route$route$split$fi.slice(0, 2);
11667
12425
  items = (_items = items) === null || _items === void 0 ? void 0 : _items.map(function (e) {
12426
+ var _e, _e$replace, _e$replace$replace, _e$replace$replace$re;
11668
12427
  if (e === "product") e = "products";else if (e === "service") e = "services";
11669
12428
  return (routes === null || routes === void 0 ? void 0 : routes.find(function (r) {
11670
12429
  return (r === null || r === void 0 ? void 0 : r.name) === e;
11671
12430
  })) || {
11672
- label: e
12431
+ label: (_e = e) === null || _e === void 0 ? void 0 : (_e$replace = _e.replace(/-{3}/g, "###")) === null || _e$replace === void 0 ? void 0 : (_e$replace$replace = _e$replace.replace(/-/g, " ")) === null || _e$replace$replace === void 0 ? void 0 : (_e$replace$replace$re = _e$replace$replace.replace(/###/g, "-")) === null || _e$replace$replace$re === void 0 ? void 0 : _e$replace$replace$re.replace(/~/g, "/")
11673
12432
  };
11674
12433
  });
11675
12434
  (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2.unshift({
@@ -11690,7 +12449,7 @@ var Breadcrumb1 = function Breadcrumb1(props) {
11690
12449
  className: "text-gray4"
11691
12450
  }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(LinkToPage, {
11692
12451
  Link: Link,
11693
- href: (item === null || item === void 0 ? void 0 : item.route) || "#",
12452
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || "#",
11694
12453
  style: {
11695
12454
  color: textHeading
11696
12455
  }
@@ -12807,7 +13566,7 @@ var ShopHighlights2 = function ShopHighlights2(props) {
12807
13566
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12808
13567
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12809
13568
  Link: Link,
12810
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
13569
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
12811
13570
  }, /*#__PURE__*/React__default.createElement("div", {
12812
13571
  className: "flex flex-col items-center text-center lg:px-3 gap-3",
12813
13572
  key: "kdf-" + index
@@ -12835,7 +13594,7 @@ var ShopHighlights5 = function ShopHighlights5(props) {
12835
13594
  className: SECTION_CLASS + " grid md:grid-cols-3 py-6 gap-4 lg:gap-6 bg-bgSecondary"
12836
13595
  }, sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
12837
13596
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12838
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
13597
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#",
12839
13598
  Link: Link
12840
13599
  }, /*#__PURE__*/React__default.createElement("div", {
12841
13600
  className: "flex flex-col items-center text-center md:px-3 lg:px-6 gap-3",
@@ -12881,7 +13640,7 @@ var ShopHighlights6 = function ShopHighlights6(props) {
12881
13640
  className: " w-44 h-0.5 rounded-full bg-primary"
12882
13641
  }), /*#__PURE__*/React__default.createElement("div", null, item === null || item === void 0 ? void 0 : item.description), /*#__PURE__*/React__default.createElement(LinkToPage, {
12883
13642
  Link: Link,
12884
- href: (item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
13643
+ href: convertURL(item === null || item === void 0 ? void 0 : item.route) || (item === null || item === void 0 ? void 0 : item.link) || "#"
12885
13644
  }, /*#__PURE__*/React__default.createElement(Button, {
12886
13645
  shopConfigStyle: shopConfigStyle,
12887
13646
  label: item === null || item === void 0 ? void 0 : item.title
@@ -12911,7 +13670,7 @@ var ShopHighlights7 = function ShopHighlights7(props) {
12911
13670
  }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
12912
13671
  return /*#__PURE__*/React__default.createElement(LinkToPage, {
12913
13672
  Link: Link,
12914
- href: (it === null || it === void 0 ? void 0 : it.route) || (it === null || it === void 0 ? void 0 : it.link) || "#",
13673
+ href: convertURL(it === null || it === void 0 ? void 0 : it.route) || (it === null || it === void 0 ? void 0 : it.link) || "#",
12915
13674
  key: index,
12916
13675
  className: "pt-6 col-span-3 md:col-span-1"
12917
13676
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -13030,6 +13789,11 @@ var NewsController = function NewsController(props) {
13030
13789
  var _response$data2, _response$data2$data, _response$data3, _response$data3$data;
13031
13790
  setNewsArticles(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$data = _response$data2.data) === null || _response$data2$data === void 0 ? void 0 : _response$data2$data.content);
13032
13791
  setPage(response === null || response === void 0 ? void 0 : (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : (_response$data3$data = _response$data3.data) === null || _response$data3$data === void 0 ? void 0 : _response$data3$data.totalElements);
13792
+ var url = new URL(window.location.href);
13793
+ if (/^(\/(tin-tuc-theo-danh-muc))\/[^/]+-\d+$/.test(url.pathname)) {
13794
+ url.pathname = url.pathname.replace(/\/[^/]+-\d+$/, "");
13795
+ window.history.replaceState({}, '', url.pathname + url.search);
13796
+ }
13033
13797
  }
13034
13798
  setLoading(false);
13035
13799
  });
@@ -13225,13 +13989,12 @@ var News1 = function News1(props) {
13225
13989
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
13226
13990
  _props$Link = props.Link,
13227
13991
  Link = _props$Link === void 0 ? null : _props$Link,
13228
- _props$catId = props.catId,
13229
- catId = _props$catId === void 0 ? "" : _props$catId;
13992
+ catId = props.catId;
13230
13993
  var _useState = useState({
13231
13994
  page: 0,
13232
13995
  sort: "timeUpdate,DESC",
13233
- size: 10,
13234
- catId: catId
13996
+ catId: catId,
13997
+ size: 10
13235
13998
  }),
13236
13999
  params = _useState[0],
13237
14000
  setParams = _useState[1];
@@ -13261,11 +14024,11 @@ var News1 = function News1(props) {
13261
14024
  useEffect(function () {
13262
14025
  if ((newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.length) > 0 && params !== null && params !== void 0 && params.catId) {
13263
14026
  var category = newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.find(function (item) {
13264
- return (item === null || item === void 0 ? void 0 : item.catId) == catId;
14027
+ return (item === null || item === void 0 ? void 0 : item.catId) == (params === null || params === void 0 ? void 0 : params.catId);
13265
14028
  });
13266
14029
  setCategorySelected(category);
13267
14030
  }
13268
- }, [params === null || params === void 0 ? void 0 : params.catId, newsCategories]);
14031
+ }, [newsCategories]);
13269
14032
  return /*#__PURE__*/React__default.createElement("div", {
13270
14033
  className: SECTION_CLASS + " grid grid-cols-1 md:grid-cols-3 gap-6"
13271
14034
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -13310,18 +14073,29 @@ var News1 = function News1(props) {
13310
14073
  }) : null)), /*#__PURE__*/React__default.createElement("div", {
13311
14074
  className: "sticky top-20 self-start"
13312
14075
  }, /*#__PURE__*/React__default.createElement("div", {
13313
- className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center"
14076
+ className: "px-6 py-3 bg-primary rounded-t-lg text-lg text-textButton text-center ",
14077
+ onClick: function onClick() {
14078
+ setParams({
14079
+ page: 0,
14080
+ sort: "timeUpdate,DESC",
14081
+ size: 10
14082
+ });
14083
+ }
13314
14084
  }, "Chuy\xEAn m\u1EE5c"), /*#__PURE__*/React__default.createElement("div", {
13315
14085
  className: "rounded-b-lg bg-bgSecondary"
13316
14086
  }, newsCategories === null || newsCategories === void 0 ? void 0 : newsCategories.map(function (item, index) {
13317
- return /*#__PURE__*/React__default.createElement(LinkToPage, {
13318
- href: getLinkNewsByCategory(item),
13319
- Link: Link,
13320
- key: "fjhnfg-" + index
13321
- }, /*#__PURE__*/React__default.createElement("div", {
14087
+ return /*#__PURE__*/React__default.createElement("div", {
13322
14088
  className: "px-6 py-3 hover:bg-gray-100 hover:text-primary cursor-pointer",
13323
- key: "sdjfdh-" + index
13324
- }, item === null || item === void 0 ? void 0 : item.catName));
14089
+ key: "sdjfdh-" + index,
14090
+ onClick: function onClick() {
14091
+ setCategorySelected(item);
14092
+ setParams(function (prev) {
14093
+ return _extends({}, prev, {
14094
+ catId: item === null || item === void 0 ? void 0 : item.catId
14095
+ });
14096
+ });
14097
+ }
14098
+ }, item === null || item === void 0 ? void 0 : item.catName);
13325
14099
  }))));
13326
14100
  };
13327
14101
 
@@ -13447,5 +14221,5 @@ var NewsDetail1 = function NewsDetail1(props) {
13447
14221
  }))));
13448
14222
  };
13449
14223
 
13450
- export { About1, About5, Address1, Banner1, Banner2, Banner3, Banner7, BannerFull1, BannerFull2, Booking1, BookingForm6, Breadcrumb1, Button, Carts1, Contact1, CustomerRating1, CustomerRating10, CustomerRating5, CustomerRating6, DateTimePicker, Employees1, Features2, Features3, Footer1, Footer7, Gallery1, Hero1, Hero10, Hero11 as Hero12, Hero13, Hero2, Hero5, Hero6, Input, InputPhoneNumber, Links1, ModalNotification, NavBar1, NavBar7, News1, NewsDetail1, NewsHighlight1, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductHighlight1, ProductHot1, ProductHot3, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductItem7, ProductList5, ProductList7, ProductSale2, ProductSearch1, Products10, Products2, Products3, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, ShopHighlights7, TextArea, TreatmentDetail1, TreatmentItem1, TreatmentsCategory7, TreatmentsList6, TreatmentsList7, VideoFull1 };
14224
+ export { About1, About5, About6, Address1, Banner1, Banner2, Banner3, Banner7, BannerFull1, BannerFull2, Booking1, BookingForm6, Breadcrumb1, Button, Carts1, Contact1, CustomerRating1, CustomerRating10, CustomerRating5, CustomerRating6, DateTimePicker, Employees1, Features2, Features3, Footer1, Footer7, Gallery1, Hero1, Hero10, Hero11 as Hero12, Hero13, Hero2, Hero5, Hero6, Input, InputPhoneNumber, Links1, ModalNotification, NavBar1, NavBar7, News1, NewsDetail1, NewsHighlight1, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductDetail11, ProductHighlight1, ProductHot1, ProductHot3, ProductImage, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductItem7, ProductList5, ProductList7, ProductSale2, ProductSearch1, Products10, Products11, Products2, Products3, Products9, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, ShopHighlights7, TextArea, TreatmentDetail1, TreatmentItem1, TreatmentsCategory7, TreatmentsList6, TreatmentsList7, VideoFull1 };
13451
14225
  //# sourceMappingURL=index.modern.js.map