s-platform-landing-section 0.1.12 → 0.1.15

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,6 +1,6 @@
1
1
  import React__default, { useState, useRef, useEffect, forwardRef, useImperativeHandle, createElement, memo } from 'react';
2
2
  import { IoCartOutline, IoChevronDownOutline, IoInformationCircleOutline, IoLogOutOutline, IoBagOutline, IoSearchOutline, IoChevronBackOutline, IoChevronForwardOutline, IoLocationOutline, IoCallOutline } from 'react-icons/io5';
3
- import { FaUserCircle, FaFacebookF, FaFacebookMessenger, FaAngleUp, FaAngleDown, FaCheckCircle, FaBoxOpen, FaArrowLeft, FaArrowRight } from 'react-icons/fa';
3
+ import { FaUserCircle, FaFacebookF, FaFacebookMessenger, FaBoxOpen, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight } from 'react-icons/fa';
4
4
  import { FiMenu, FiShoppingCart, FiSearch } from 'react-icons/fi';
5
5
  import { RxCross2 } from 'react-icons/rx';
6
6
  import { SiZalo, SiVisa } from 'react-icons/si';
@@ -12,6 +12,9 @@ import { BsCurrencyDollar } from 'react-icons/bs';
12
12
  import { LuSearch } from 'react-icons/lu';
13
13
  import DatePicker from 'react-datepicker';
14
14
  import 'react-datepicker/dist/react-datepicker.css';
15
+ import Slider from 'react-slick';
16
+ import 'slick-carousel/slick/slick.css';
17
+ import 'slick-carousel/slick/slick-theme.css';
15
18
  import { AiOutlineShoppingCart } from 'react-icons/ai';
16
19
  import { GoCreditCard } from 'react-icons/go';
17
20
  import { RiDeleteBin7Line } from 'react-icons/ri';
@@ -646,9 +649,9 @@ var SvgIcon = function SvgIcon(_ref) {
646
649
  var SectionTitle1 = function SectionTitle1(props) {
647
650
  var _props$data = props.data,
648
651
  data = _props$data === void 0 ? {} : _props$data;
649
- return /*#__PURE__*/React__default.createElement("div", null, data !== null && data !== void 0 && data.sectionTitle ? /*#__PURE__*/React__default.createElement("div", {
652
+ 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", {
650
653
  className: "text-center text-2xl md:text-4xl font-headingFont font-semibold leading-relaxed text-textHeading"
651
- }, data === null || data === void 0 ? void 0 : data.sectionTitle) : null, /*#__PURE__*/React__default.createElement("div", {
654
+ }, data === null || data === void 0 ? void 0 : data.sectionTitle), /*#__PURE__*/React__default.createElement("div", {
652
655
  className: "flex items-center justify-center"
653
656
  }, /*#__PURE__*/React__default.createElement("div", {
654
657
  className: "w-32 h-0.5 rounded-full bg-secondary"
@@ -656,7 +659,7 @@ var SectionTitle1 = function SectionTitle1(props) {
656
659
  className: "w-9 h-9 text-secondary"
657
660
  }), /*#__PURE__*/React__default.createElement("div", {
658
661
  className: " w-32 h-0.5 rounded-full bg-secondary"
659
- })), data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
662
+ }))) : null, data !== null && data !== void 0 && data.sectionDescription ? /*#__PURE__*/React__default.createElement("div", {
660
663
  className: "text-xl font-medium text-center leading-relaxed text-textSecondary"
661
664
  }, data === null || data === void 0 ? void 0 : data.sectionDescription) : null);
662
665
  };
@@ -985,54 +988,7 @@ var Hero10 = function Hero10(props) {
985
988
  })));
986
989
  };
987
990
 
988
- var Dash = function Dash(props) {
989
- var _props$color = props.color,
990
- color = _props$color === void 0 ? "#ccc" : _props$color,
991
- _props$className = props.className,
992
- className = _props$className === void 0 ? "" : _props$className;
993
- return /*#__PURE__*/React__default.createElement("div", {
994
- className: "mx-auto w-full max-w-[240px] md:max-w-[720px] border-b-0 " + className,
995
- style: {
996
- backgroundImage: "repeating-linear-gradient(to right, " + color + " 0, " + color + " 10px, transparent 10px, transparent 20px)",
997
- height: "1px"
998
- }
999
- });
1000
- };
1001
-
1002
- var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
1003
- var SECTION_CLASS = "my-6 md:my-12 px-4 xl:px-20 bg-background";
1004
-
1005
991
  var Hero11 = function Hero11(props) {
1006
- var _data$data;
1007
- var _props$shopConfigStyl = props.shopConfigStyle,
1008
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
1009
- _props$data = props.data,
1010
- data = _props$data === void 0 ? {} : _props$data,
1011
- _props$SectionTitle = props.SectionTitle,
1012
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
1013
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
1014
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
1015
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
1016
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
1017
- className: "" + SECTION_DEFAULT_CLASS
1018
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
1019
- data: data,
1020
- shopConfigStyle: shopConfigStyle
1021
- }), /*#__PURE__*/React__default.createElement("div", {
1022
- className: "mt-6 grid grid-cols-2 md:grid-cols-4 gap-1 md:gap-2"
1023
- }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
1024
- var _it$srcImages;
1025
- return /*#__PURE__*/React__default.createElement("div", {
1026
- key: index
1027
- }, /*#__PURE__*/React__default.createElement("img", {
1028
- src: it === null || it === void 0 ? void 0 : (_it$srcImages = it.srcImages) === null || _it$srcImages === void 0 ? void 0 : _it$srcImages[0]
1029
- }));
1030
- }))), /*#__PURE__*/React__default.createElement(Dash, {
1031
- color: secondary
1032
- }));
1033
- };
1034
-
1035
- var Hero11$1 = function Hero11(props) {
1036
992
  var _data$data, _data$data$, _data$data$$srcImages, _data$data2, _data$data2$, _data$data3, _data$data3$;
1037
993
  var _props$data = props.data,
1038
994
  data = _props$data === void 0 ? {} : _props$data;
@@ -7331,55 +7287,8 @@ var Hero13 = function Hero13(props) {
7331
7287
  }));
7332
7288
  };
7333
7289
 
7334
- var Features1 = function Features1(props) {
7335
- var _data$data;
7336
- var _props$shopConfigStyl = props.shopConfigStyle,
7337
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
7338
- _props$data = props.data,
7339
- data = _props$data === void 0 ? {} : _props$data,
7340
- _props$SectionTitle = props.SectionTitle,
7341
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7342
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7343
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
7344
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
7345
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7346
- className: SECTION_DEFAULT_CLASS + " relative"
7347
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7348
- data: data
7349
- }), /*#__PURE__*/React__default.createElement("div", {
7350
- className: "mt-6 grid grid-cols-3 gap-4 md:gap-8"
7351
- }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
7352
- return /*#__PURE__*/React__default.createElement("div", {
7353
- key: index,
7354
- className: "pt-6 col-span-3 md:col-span-1"
7355
- }, /*#__PURE__*/React__default.createElement("div", {
7356
- className: "relative w-40 h-24 flex items-center justify-center m-auto md:m-0"
7357
- }, /*#__PURE__*/React__default.createElement("div", {
7358
- className: "absolute w-40 h-24 rounded-2xl z-10 bg-primary"
7359
- }), /*#__PURE__*/React__default.createElement("div", {
7360
- className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0 bg-secondary"
7361
- }), it !== null && it !== void 0 && it.svgImage ? /*#__PURE__*/React__default.createElement("div", {
7362
- className: "w-12 text-primary h-16 w-16 z-20 m-auto"
7363
- }, /*#__PURE__*/React__default.createElement("div", {
7364
- dangerouslySetInnerHTML: {
7365
- __html: configSvg(it === null || it === void 0 ? void 0 : it.svgImage)
7366
- }
7367
- })) : /*#__PURE__*/React__default.createElement("div", {
7368
- className: "h-16 m-auto bg-center w-16 bg-cover bg-no-repeat z-20",
7369
- style: {
7370
- backgroundImage: "url(" + it.srcImage + ")"
7371
- }
7372
- })), /*#__PURE__*/React__default.createElement("p", {
7373
- className: "mx-auto md:mt-3 md:mx-0 text-xl py-2 font-medium w-fit rounded-lg"
7374
- }, it.title), /*#__PURE__*/React__default.createElement("div", {
7375
- className: "mx-auto md:mx-0 mb-2 w-28 h-2px rounded-full bg-secondary"
7376
- }), /*#__PURE__*/React__default.createElement("p", {
7377
- className: "text-base mx-auto md:mx-0 text-center md:text-start"
7378
- }, it.description));
7379
- }))), /*#__PURE__*/React__default.createElement(Dash, {
7380
- color: secondary
7381
- }));
7382
- };
7290
+ var SECTION_DEFAULT_CLASS = "my-12 mx-4 xl:mx-20 bg-background";
7291
+ var SECTION_CLASS = "my-6 md:my-12 px-4 xl:px-20 bg-background";
7383
7292
 
7384
7293
  var Features2 = function Features2(props) {
7385
7294
  var data = props.data;
@@ -7539,7 +7448,7 @@ var ProductController = function ProductController(props) {
7539
7448
  };
7540
7449
  };
7541
7450
 
7542
- var _path, _path2, _path3;
7451
+ var _path;
7543
7452
  function _extends$1() {
7544
7453
  return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
7545
7454
  for (var e = 1; e < arguments.length; e++) {
@@ -7549,13 +7458,130 @@ function _extends$1() {
7549
7458
  return n;
7550
7459
  }, _extends$1.apply(null, arguments);
7551
7460
  }
7552
- function SvgImageGallery(props) {
7461
+ function SvgAngleSmallLeft(props) {
7553
7462
  return /*#__PURE__*/createElement("svg", _extends$1({
7463
+ xmlns: "http://www.w3.org/2000/svg",
7464
+ viewBox: "0 0 24 24",
7465
+ width: 512,
7466
+ height: 512
7467
+ }, props), _path || (_path = /*#__PURE__*/createElement("path", {
7468
+ d: "M10.6 12.71a1 1 0 010-1.42l4.59-4.58a1 1 0 000-1.42 1 1 0 00-1.41 0L9.19 9.88a3 3 0 000 4.24l4.59 4.59a1 1 0 00.7.29 1 1 0 00.71-.29 1 1 0 000-1.42z"
7469
+ })));
7470
+ }
7471
+
7472
+ var _path$1;
7473
+ function _extends$2() {
7474
+ return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
7475
+ for (var e = 1; e < arguments.length; e++) {
7476
+ var t = arguments[e];
7477
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7478
+ }
7479
+ return n;
7480
+ }, _extends$2.apply(null, arguments);
7481
+ }
7482
+ function SvgAngleSmallRight(props) {
7483
+ return /*#__PURE__*/createElement("svg", _extends$2({
7484
+ xmlns: "http://www.w3.org/2000/svg",
7485
+ viewBox: "0 0 24 24",
7486
+ width: 512,
7487
+ height: 512
7488
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/createElement("path", {
7489
+ d: "M15.4 9.88l-4.59-4.59a1 1 0 00-1.41 0 1 1 0 000 1.42l4.6 4.58a1 1 0 010 1.42l-4.6 4.58a1 1 0 001.41 1.42l4.59-4.59a3 3 0 000-4.24z"
7490
+ })));
7491
+ }
7492
+
7493
+ var ScrollHorizontal = function ScrollHorizontal(props) {
7494
+ var _props$datas = props.datas,
7495
+ datas = _props$datas === void 0 ? [] : _props$datas,
7496
+ _props$className = props.className,
7497
+ className = _props$className === void 0 ? "" : _props$className,
7498
+ _props$style = props.style,
7499
+ style = _props$style === void 0 ? {} : _props$style,
7500
+ _props$renderItem = props.renderItem,
7501
+ renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
7502
+ var scrollContainerRef = useRef(null);
7503
+ var _useState = useState(true),
7504
+ isScrolledToLeft = _useState[0],
7505
+ setIsScrolledToLeft = _useState[1];
7506
+ var _useState2 = useState(false),
7507
+ isScrolledToRight = _useState2[0],
7508
+ setIsScrolledToRight = _useState2[1];
7509
+ var checkScrollPosition = function checkScrollPosition() {
7510
+ if (scrollContainerRef.current) {
7511
+ var _scrollContainerRef$c = scrollContainerRef.current,
7512
+ _scrollLeft = _scrollContainerRef$c.scrollLeft,
7513
+ scrollWidth = _scrollContainerRef$c.scrollWidth,
7514
+ clientWidth = _scrollContainerRef$c.clientWidth;
7515
+ setIsScrolledToLeft(_scrollLeft === 0);
7516
+ setIsScrolledToRight(_scrollLeft + clientWidth >= scrollWidth);
7517
+ }
7518
+ };
7519
+ var scrollLeft = function scrollLeft() {
7520
+ if (scrollContainerRef.current) {
7521
+ scrollContainerRef.current.scrollBy({
7522
+ left: -200,
7523
+ behavior: "smooth"
7524
+ });
7525
+ setTimeout(checkScrollPosition, 300);
7526
+ }
7527
+ };
7528
+ var scrollRight = function scrollRight() {
7529
+ if (scrollContainerRef.current) {
7530
+ scrollContainerRef.current.scrollBy({
7531
+ left: 200,
7532
+ behavior: "smooth"
7533
+ });
7534
+ setTimeout(checkScrollPosition, 300);
7535
+ }
7536
+ };
7537
+ useEffect(function () {
7538
+ checkScrollPosition();
7539
+ }, [datas]);
7540
+ return /*#__PURE__*/React__default.createElement("div", {
7541
+ className: "flex " + className,
7542
+ style: style
7543
+ }, /*#__PURE__*/React__default.createElement("div", {
7544
+ className: "flex w-full overflow-x-hidden",
7545
+ ref: scrollContainerRef,
7546
+ onScroll: checkScrollPosition
7547
+ }, datas === null || datas === void 0 ? void 0 : datas.map(function (item, index) {
7548
+ return renderItem(item, index);
7549
+ })), /*#__PURE__*/React__default.createElement("div", {
7550
+ className: "flex gap-2 items-center px-4"
7551
+ }, /*#__PURE__*/React__default.createElement("div", {
7552
+ onClick: scrollLeft,
7553
+ className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToLeft ? "bg-gray4" : "bg-primary")
7554
+ }, /*#__PURE__*/React__default.createElement(SvgAngleSmallLeft, {
7555
+ width: 24,
7556
+ height: 24,
7557
+ fill: "#fff"
7558
+ })), /*#__PURE__*/React__default.createElement("div", {
7559
+ onClick: scrollRight,
7560
+ className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToRight ? "bg-gray4" : "bg-primary")
7561
+ }, /*#__PURE__*/React__default.createElement(SvgAngleSmallRight, {
7562
+ width: 24,
7563
+ height: 24,
7564
+ fill: "#fff"
7565
+ }))));
7566
+ };
7567
+
7568
+ var _path$2, _path2, _path3;
7569
+ function _extends$3() {
7570
+ return _extends$3 = Object.assign ? Object.assign.bind() : function (n) {
7571
+ for (var e = 1; e < arguments.length; e++) {
7572
+ var t = arguments[e];
7573
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
7574
+ }
7575
+ return n;
7576
+ }, _extends$3.apply(null, arguments);
7577
+ }
7578
+ function SvgImageGallery(props) {
7579
+ return /*#__PURE__*/createElement("svg", _extends$3({
7554
7580
  height: 512,
7555
7581
  viewBox: "0 0 24 24",
7556
7582
  width: 512,
7557
7583
  xmlns: "http://www.w3.org/2000/svg"
7558
- }, props), _path || (_path = /*#__PURE__*/createElement("path", {
7584
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/createElement("path", {
7559
7585
  d: "M17.453 24c-.168 0-.34-.021-.51-.066L1.48 19.793a2.018 2.018 0 01-1.414-2.45l1.951-7.272a.5.5 0 01.966.258l-1.95 7.27c-.139.53.179 1.082.71 1.229L17.2 22.967a.995.995 0 001.217-.704l.781-2.894a.499.499 0 11.966.26l-.78 2.89A1.997 1.997 0 0117.453 24z"
7560
7586
  })), _path2 || (_path2 = /*#__PURE__*/createElement("path", {
7561
7587
  d: "M22 18H6c-1.103 0-2-.897-2-2V4c0-1.103.897-2 2-2h16c1.103 0 2 .897 2 2v12c0 1.103-.897 2-2 2zM6 3c-.551 0-1 .449-1 1v12c0 .551.449 1 1 1h16c.551 0 1-.449 1-1V4c0-.551-.449-1-1-1z"
@@ -7608,233 +7634,290 @@ var ProductImage = function ProductImage(props) {
7608
7634
  });
7609
7635
  };
7610
7636
 
7611
- var ModalNotification = function ModalNotification(props) {
7612
- var modalRef = useRef(null);
7613
- var onClose = props.onClose,
7614
- onCloseFormBooking = props.onCloseFormBooking,
7615
- _props$isButtonClose = props.isButtonClose,
7616
- isButtonClose = _props$isButtonClose === void 0 ? true : _props$isButtonClose;
7617
- var handleClickOutside = function handleClickOutside(event) {
7618
- if (modalRef.current && !modalRef.current.contains(event.target)) {
7619
- if (onClose) onClose();
7620
- if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7621
- onCloseFormBooking();
7622
- }
7623
- }
7624
- };
7625
- useEffect(function () {
7626
- document.addEventListener('click', handleClickOutside);
7627
- return function () {
7628
- document.removeEventListener('click', handleClickOutside);
7629
- };
7630
- }, []);
7631
- return /*#__PURE__*/React__default.createElement("div", {
7632
- className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 "
7633
- }, /*#__PURE__*/React__default.createElement("div", {
7634
- className: " flex items-center justify-center relative bg-red",
7635
- ref: modalRef
7636
- }, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
7637
- className: "absolute top-4 right-4",
7638
- onClick: onClose
7639
- }, /*#__PURE__*/React__default.createElement(RxCross2, null))));
7637
+ var formatCurrency = function formatCurrency(amount) {
7638
+ if (isNaN(amount)) {
7639
+ return '0 ₫';
7640
+ }
7641
+ var roundedAmount = Math.round(amount);
7642
+ var formattedAmount = roundedAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
7643
+ return formattedAmount + " \u20AB";
7640
7644
  };
7641
-
7642
- var getEmployeeListApi = function getEmployeeListApi(shopId) {
7643
- return api({
7644
- method: "get",
7645
- url: "/chain-employment-profile/filter-employ-by-customer",
7646
- params: {
7647
- shopIds: shopId
7648
- },
7649
- headers: {
7650
- shopId: shopId
7651
- }
7652
- });
7645
+ var pattern = {
7646
+ phoneNumberPattern: /^(?:\+84|0)\d{9}$/
7647
+ };
7648
+ var numberPattern = /^\d+$/;
7649
+ var getYoutubeVideoIdByUrl = function getYoutubeVideoIdByUrl(url) {
7650
+ var regex = /(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/|youtube\.com\/shorts\/)([a-zA-Z0-9_-]{11})/;
7651
+ var match = url === null || url === void 0 ? void 0 : url.match(regex);
7652
+ return match ? match[1] : null;
7653
7653
  };
7654
7654
 
7655
- var EmployeeController = function EmployeeController(props) {
7656
- var _props$isAutoGetList = props.isAutoGetList,
7657
- isAutoGetList = _props$isAutoGetList === void 0 ? true : _props$isAutoGetList,
7658
- shopConfig = props.shopConfig;
7659
- var _useState = useState([]),
7660
- listEmployment = _useState[0],
7661
- setListEmployment = _useState[1];
7655
+ function getMinMax(array, field) {
7656
+ if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
7657
+ return null;
7658
+ }
7659
+ var _array$reduce = array.reduce(function (acc, obj) {
7660
+ var value = obj[field];
7661
+ return {
7662
+ min: value < acc.min ? value : acc.min,
7663
+ max: value > acc.max ? value : acc.max
7664
+ };
7665
+ }, {
7666
+ min: array[0][field],
7667
+ max: array[0][field]
7668
+ }),
7669
+ min = _array$reduce.min,
7670
+ max = _array$reduce.max;
7671
+ return {
7672
+ min: min,
7673
+ max: max
7674
+ };
7675
+ }
7676
+ var ProductPrice = function ProductPrice(props) {
7677
+ var product = props.product,
7678
+ variant = props.variant,
7679
+ _props$className = props.className,
7680
+ className = _props$className === void 0 ? "" : _props$className,
7681
+ _props$style = props.style,
7682
+ style = _props$style === void 0 ? {} : _props$style;
7683
+ var _useState = useState(),
7684
+ displayPrice = _useState[0],
7685
+ setDisplayPrice = _useState[1];
7686
+ var _useState2 = useState(),
7687
+ displayPriceBeforeDiscount = _useState2[0],
7688
+ setDisplayPriceBeforeDiscount = _useState2[1];
7662
7689
  useEffect(function () {
7663
- if (isAutoGetList) {
7664
- getListEmployee();
7690
+ if (variant) {
7691
+ genProductPrice([variant]);
7692
+ } else if (product) {
7693
+ genProductPrice(product.variants);
7665
7694
  }
7666
- }, [isAutoGetList]);
7667
- var getListEmployee = function getListEmployee() {
7668
- try {
7669
- return Promise.resolve(_catch(function () {
7670
- return Promise.resolve(getEmployeeListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId)).then(function (res) {
7671
- var _res$data, _res$data$status;
7672
- if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7673
- var _res$data2;
7674
- setListEmployment((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);
7675
- }
7676
- return res;
7677
- });
7678
- }, function (e) {
7679
- console.log(e);
7680
- }));
7681
- } catch (e) {
7682
- return Promise.reject(e);
7695
+ }, [product, variant]);
7696
+ var genProductPrice = function genProductPrice(variants) {
7697
+ var mPrice = getMinMax(variants, 'price');
7698
+ var mPriceBeforeDiscount = getMinMax(variants, 'priceBeforeDiscount');
7699
+ if (mPrice && mPriceBeforeDiscount) {
7700
+ var _displayPriceBeforeDiscount = formatCurrency(mPriceBeforeDiscount.min);
7701
+ var _displayPrice = formatCurrency(mPrice.min);
7702
+ if (mPrice.min !== mPrice.max) {
7703
+ _displayPrice += " - " + formatCurrency(mPrice.max);
7704
+ }
7705
+ if (mPriceBeforeDiscount.min !== mPriceBeforeDiscount.max) {
7706
+ _displayPriceBeforeDiscount += " - " + formatCurrency(mPriceBeforeDiscount.max);
7707
+ }
7708
+ setDisplayPrice(_displayPrice);
7709
+ setDisplayPriceBeforeDiscount(_displayPriceBeforeDiscount);
7710
+ } else {
7711
+ var _displayPrice2 = formatCurrency(product === null || product === void 0 ? void 0 : product.price);
7712
+ setDisplayPrice(_displayPrice2);
7683
7713
  }
7684
7714
  };
7685
- return {
7686
- listEmployment: listEmployment,
7687
- getListEmployee: getListEmployee
7688
- };
7715
+ return /*#__PURE__*/React__default.createElement("div", {
7716
+ className: className
7717
+ }, displayPriceBeforeDiscount !== displayPrice && displayPriceBeforeDiscount != null ? /*#__PURE__*/React__default.createElement("span", {
7718
+ className: "text-gray3 line-through mr-2"
7719
+ }, displayPriceBeforeDiscount) : null, /*#__PURE__*/React__default.createElement("span", {
7720
+ className: "text-primary font-semibold",
7721
+ style: style
7722
+ }, displayPrice));
7689
7723
  };
7690
7724
 
7691
- var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
7692
- return api({
7693
- method: "post",
7694
- url: "/spa-schedule/customer/create",
7695
- data: data,
7696
- headers: {
7697
- shopId: shopId
7698
- }
7699
- });
7725
+ var ProductItem1 = function ProductItem1(props) {
7726
+ var product = props.product;
7727
+ return /*#__PURE__*/React__default.createElement("div", {
7728
+ className: "flex"
7729
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
7730
+ product: product,
7731
+ className: "!w-20 rounded-lg"
7732
+ }), /*#__PURE__*/React__default.createElement("div", {
7733
+ className: "ml-4 border-b border-stroke flex-1"
7734
+ }, /*#__PURE__*/React__default.createElement("div", {
7735
+ className: "text-lg"
7736
+ }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
7737
+ className: "flex mt-2"
7738
+ }, /*#__PURE__*/React__default.createElement("div", {
7739
+ className: "flex-1 text-gray3"
7740
+ }, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(ProductPrice, {
7741
+ product: product
7742
+ }))));
7700
7743
  };
7701
- var draftOrderWithoutLoginApi = function draftOrderWithoutLoginApi(shopId, data) {
7702
- return api({
7703
- method: "post",
7704
- url: "/spa/orders/draft-online-without-login",
7705
- params: {
7706
- shopId: shopId
7707
- },
7708
- data: data,
7709
- headers: {
7710
- shopId: shopId
7744
+
7745
+ var Dash = function Dash(props) {
7746
+ var _props$color = props.color,
7747
+ color = _props$color === void 0 ? "#ccc" : _props$color,
7748
+ _props$className = props.className,
7749
+ className = _props$className === void 0 ? "" : _props$className;
7750
+ return /*#__PURE__*/React__default.createElement("div", {
7751
+ className: "mx-auto w-full max-w-[240px] md:max-w-[720px] border-b-0 " + className,
7752
+ style: {
7753
+ backgroundImage: "repeating-linear-gradient(to right, " + color + " 0, " + color + " 10px, transparent 10px, transparent 20px)",
7754
+ height: "1px"
7711
7755
  }
7712
7756
  });
7713
7757
  };
7714
7758
 
7715
- var _excluded$1 = ["productName"];
7716
- var BookingController = function BookingController(props) {
7717
- _objectDestructuringEmpty(props);
7718
- var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
7719
- try {
7720
- return Promise.resolve(_catch(function () {
7721
- var _Date;
7722
- var data = {
7723
- appId: "SSPA",
7724
- customerName: customerName,
7725
- customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
7726
- isSellService: true,
7727
- scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
7728
- services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
7729
- var productName = _ref.productName,
7730
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
7731
- return rest;
7732
- }),
7733
- shopId: shopId
7734
- };
7735
- return Promise.resolve(createSpaScheduleApi(shopId, data));
7736
- }, function (e) {
7737
- console.log(e);
7738
- }));
7739
- } catch (e) {
7740
- return Promise.reject(e);
7759
+ var Loading = function Loading(props) {
7760
+ var _props$size = props.size,
7761
+ size = _props$size === void 0 ? 24 : _props$size;
7762
+ return /*#__PURE__*/React__default.createElement("div", {
7763
+ className: "border-4 boder-[rgba(255, 255, 255, 0.2)] rounded-full border-t-4 border-t-primary animate-spin",
7764
+ style: {
7765
+ width: size,
7766
+ height: size
7741
7767
  }
7742
- };
7743
- return {
7744
- createSchedule: createSchedule
7745
- };
7768
+ });
7746
7769
  };
7747
7770
 
7748
- var Select = forwardRef(function (props, ref) {
7749
- var _props$label = props.label,
7750
- label = _props$label === void 0 ? "" : _props$label,
7751
- _props$labelClassName = props.labelClassName,
7752
- labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
7753
- _props$placeholder = props.placeholder,
7754
- placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
7755
- _props$className = props.className,
7756
- className = _props$className === void 0 ? "" : _props$className,
7757
- _props$optionClassNam = props.optionClassName,
7758
- optionClassName = _props$optionClassNam === void 0 ? "" : _props$optionClassNam,
7759
- _props$wrapClassName = props.wrapClassName,
7760
- wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
7761
- _props$selectClassNam = props.selectClassName,
7762
- selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
7763
- _props$rules = props.rules,
7764
- rules = _props$rules === void 0 ? [] : _props$rules,
7765
- options = props.options,
7766
- _props$defaultValue = props.defaultValue,
7767
- defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
7768
- handleSearchOption = props.handleSearchOption,
7769
- _props$isMulti = props.isMulti,
7770
- isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
7771
- _props$onClick = props.onClick,
7772
- onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
7773
- _props$isButtonDelete = props.isButtonDelete,
7774
- isButtonDelete = _props$isButtonDelete === void 0 ? false : _props$isButtonDelete,
7775
- _props$funcDelete = props.funcDelete,
7776
- funcDelete = _props$funcDelete === void 0 ? function () {} : _props$funcDelete,
7777
- _props$isSearch = props.isSearch,
7778
- isSearch = _props$isSearch === void 0 ? true : _props$isSearch,
7779
- renderItem = props.renderItem;
7780
- var _useState = useState(false),
7781
- isOpen = _useState[0],
7782
- setIsOpen = _useState[1];
7783
- var selectRef = useRef(null);
7784
- var _useState2 = useState(""),
7785
- error = _useState2[0],
7786
- _setError = _useState2[1];
7787
- var _useState3 = useState(""),
7788
- inputSearch = _useState3[0],
7789
- setInputSearch = _useState3[1];
7790
- var _useState4 = useState(defaultValue),
7791
- value = _useState4[0],
7792
- setValue = _useState4[1];
7793
- var _useState5 = useState(options),
7794
- listOptions = _useState5[0],
7795
- setListOptions = _useState5[1];
7796
- var dropdownRef = useRef(null);
7797
- var _useState6 = useState('bottom'),
7798
- dropdownPosition = _useState6[0],
7799
- setDropdownPosition = _useState6[1];
7800
- var inputRef = useRef(null);
7801
- useEffect(function () {
7802
- if (isMulti) setValue(defaultValue);
7803
- }, [defaultValue]);
7804
- useEffect(function () {
7805
- setListOptions(options);
7806
- if (!isMulti) setValue(defaultValue);
7807
- }, [options]);
7808
- useEffect(function () {
7809
- var _inputRef$current;
7810
- inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
7811
- var updateDropdownPosition = function updateDropdownPosition() {
7812
- if (selectRef.current && dropdownRef.current) {
7813
- var _selectRef$current, _window;
7814
- var selectRect = selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect();
7815
- var spaceBelow = ((_window = window) === null || _window === void 0 ? void 0 : _window.innerHeight) - (selectRect === null || selectRect === void 0 ? void 0 : selectRect.bottom);
7816
- var spaceAbove = selectRect === null || selectRect === void 0 ? void 0 : selectRect.top;
7817
- if (spaceBelow < spaceAbove) {
7818
- setDropdownPosition('top');
7819
- } else {
7820
- setDropdownPosition('bottom');
7771
+ var TreatmentsCategory7 = function TreatmentsCategory7(props) {
7772
+ var _props$shopConfigStyl = props.shopConfigStyle,
7773
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
7774
+ _props$data = props.data,
7775
+ data = _props$data === void 0 ? {} : _props$data,
7776
+ _props$SectionTitle = props.SectionTitle,
7777
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
7778
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
7779
+ _shopConfigStyle$colo2 = _shopConfigStyle$colo.secondary,
7780
+ secondary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2;
7781
+ var _useState = useState({
7782
+ types: "1"
7783
+ }),
7784
+ params = _useState[0],
7785
+ setParams = _useState[1];
7786
+ var _CategoryController = CategoryController(_extends({}, props, {
7787
+ types: "1"
7788
+ })),
7789
+ categories = _CategoryController.categories;
7790
+ var _ProductController = ProductController(_extends({}, props, {
7791
+ params: params
7792
+ })),
7793
+ _ProductController$pr = _ProductController.products,
7794
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
7795
+ loading = _ProductController.loading;
7796
+ var _useState2 = useState(0),
7797
+ selectedCategory = _useState2[0],
7798
+ setSelectedCategory = _useState2[1];
7799
+ useEffect(function () {
7800
+ var newParams = _extends({}, params, {
7801
+ categoryId: selectedCategory
7802
+ });
7803
+ if (!selectedCategory) {
7804
+ delete newParams.categoryId;
7805
+ }
7806
+ setParams(newParams);
7807
+ }, [selectedCategory]);
7808
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7809
+ className: SECTION_DEFAULT_CLASS + " relative"
7810
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7811
+ data: data,
7812
+ shopConfigStyle: shopConfigStyle
7813
+ }), /*#__PURE__*/React__default.createElement(ScrollHorizontal, {
7814
+ datas: [{
7815
+ categoryId: 0,
7816
+ cateName: "Tất cả"
7817
+ }].concat(categories),
7818
+ className: "mt-6 rounded-lg overflow-hidden bg-bgSecondary",
7819
+ renderItem: function renderItem(item, index) {
7820
+ return /*#__PURE__*/React__default.createElement("div", {
7821
+ key: index,
7822
+ className: "p-3 flex gap-3 shrink-0 cursor-pointer text-base " + (selectedCategory === item.categoryId ? "bg-primary text-textButton" : ""),
7823
+ onClick: function onClick() {
7824
+ return setSelectedCategory(item.categoryId);
7821
7825
  }
7822
- }
7823
- };
7824
- if (isOpen) {
7825
- updateDropdownPosition();
7826
- window.addEventListener('resize', updateDropdownPosition);
7826
+ }, item === null || item === void 0 ? void 0 : item.cateName);
7827
7827
  }
7828
- return function () {
7829
- window.removeEventListener('resize', updateDropdownPosition);
7830
- };
7831
- }, [isOpen]);
7828
+ }), loading ? /*#__PURE__*/React__default.createElement("div", {
7829
+ className: "flex w-full justify-center p-12"
7830
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
7831
+ className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
7832
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
7833
+ return /*#__PURE__*/React__default.createElement(ProductItem1, {
7834
+ key: index,
7835
+ product: product === null || product === void 0 ? void 0 : product.productInfo
7836
+ });
7837
+ })) : /*#__PURE__*/React__default.createElement("div", {
7838
+ className: "text-gray3 text-center p-12"
7839
+ }, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
7840
+ color: secondary
7841
+ }));
7842
+ };
7843
+
7844
+ var NotFoundProduct = function NotFoundProduct() {
7845
+ return /*#__PURE__*/React__default.createElement("div", {
7846
+ className: "h-60 flex flex-col justify-center items-center text-xl text-gray3"
7847
+ }, /*#__PURE__*/React__default.createElement(FaBoxOpen, {
7848
+ size: 80
7849
+ }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 s\u1EA3n ph\u1EA9m"));
7850
+ };
7851
+
7852
+ var TreatmentsList6 = function TreatmentsList6(props) {
7853
+ var _products$slice;
7854
+ var data = props.data,
7855
+ _props$Link = props.Link,
7856
+ Link = _props$Link === void 0 ? null : _props$Link,
7857
+ _props$SectionTitle = props.SectionTitle,
7858
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
7859
+ _props$TreatmentItem = props.TreatmentItem,
7860
+ TreatmentItem = _props$TreatmentItem === void 0 ? null : _props$TreatmentItem,
7861
+ _props$shopConfigStyl = props.shopConfigStyle,
7862
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
7863
+ var _useState = useState({
7864
+ size: 12,
7865
+ types: "1"
7866
+ }),
7867
+ params = _useState[0],
7868
+ setParams = _useState[1];
7869
+ var _useState2 = useState(true),
7870
+ isGetMore = _useState2[0],
7871
+ setIsGetMore = _useState2[1];
7872
+ var _ProductController = ProductController(_extends({}, props, {
7873
+ params: params
7874
+ })),
7875
+ products = _ProductController.products,
7876
+ loading = _ProductController.loading;
7877
+ var handleGetMoreProducts = function handleGetMoreProducts() {
7878
+ setIsGetMore(false);
7879
+ setParams(function (prev) {
7880
+ return _extends({}, prev, {
7881
+ size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
7882
+ });
7883
+ });
7884
+ };
7885
+ return /*#__PURE__*/React__default.createElement("div", {
7886
+ className: SECTION_CLASS + " flex flex-col gap-8 "
7887
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
7888
+ data: data,
7889
+ shopConfigStyle: shopConfigStyle
7890
+ }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
7891
+ className: "m-auto mt-20 min-h-32"
7892
+ }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
7893
+ 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"
7894
+ }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, params.size - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
7895
+ return /*#__PURE__*/React__default.createElement(TreatmentItem, {
7896
+ Link: Link,
7897
+ shopConfigStyle: shopConfigStyle,
7898
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
7899
+ key: "htrhr-" + idx
7900
+ });
7901
+ })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
7902
+ label: "Xem thêm",
7903
+ onClick: handleGetMoreProducts,
7904
+ className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
7905
+ type: "outline"
7906
+ }) : null);
7907
+ };
7908
+
7909
+ var ModalNotification = function ModalNotification(props) {
7910
+ var modalRef = useRef(null);
7911
+ var onClose = props.onClose,
7912
+ onCloseFormBooking = props.onCloseFormBooking,
7913
+ _props$isButtonClose = props.isButtonClose,
7914
+ isButtonClose = _props$isButtonClose === void 0 ? true : _props$isButtonClose;
7832
7915
  var handleClickOutside = function handleClickOutside(event) {
7833
- var _selectRef$current2;
7834
- if (selectRef !== null && selectRef !== void 0 && selectRef.current && !(selectRef !== null && selectRef !== void 0 && (_selectRef$current2 = selectRef.current) !== null && _selectRef$current2 !== void 0 && _selectRef$current2.contains(event.target))) {
7835
- setIsOpen(false);
7836
- setInputSearch("");
7837
- setListOptions(options);
7916
+ if (modalRef.current && !modalRef.current.contains(event.target)) {
7917
+ if (onClose) onClose();
7918
+ if (onCloseFormBooking && typeof onCloseFormBooking === 'function') {
7919
+ onCloseFormBooking();
7920
+ }
7838
7921
  }
7839
7922
  };
7840
7923
  useEffect(function () {
@@ -7843,42 +7926,257 @@ var Select = forwardRef(function (props, ref) {
7843
7926
  document.removeEventListener('click', handleClickOutside);
7844
7927
  };
7845
7928
  }, []);
7846
- useImperativeHandle(ref, function () {
7847
- return {
7848
- validateData: function validateData() {
7849
- return _validateData();
7850
- },
7851
- setError: function setError(err) {
7852
- return _setError(err);
7853
- }
7854
- };
7929
+ return /*#__PURE__*/React__default.createElement("div", {
7930
+ className: "fixed inset-0 bg-black flex items-center justify-center bg-opacity-50 z-50 "
7931
+ }, /*#__PURE__*/React__default.createElement("div", {
7932
+ className: " flex items-center justify-center relative bg-red",
7933
+ ref: modalRef
7934
+ }, props === null || props === void 0 ? void 0 : props.children, isButtonClose && /*#__PURE__*/React__default.createElement("button", {
7935
+ className: "absolute top-4 right-4",
7936
+ onClick: onClose
7937
+ }, /*#__PURE__*/React__default.createElement(RxCross2, null))));
7938
+ };
7939
+
7940
+ var getEmployeeListApi = function getEmployeeListApi(shopId) {
7941
+ return api({
7942
+ method: "get",
7943
+ url: "/chain-employment-profile/filter-employ-by-customer",
7944
+ params: {
7945
+ shopIds: shopId
7946
+ },
7947
+ headers: {
7948
+ shopId: shopId
7949
+ }
7855
7950
  });
7856
- var isEmpty = function isEmpty(value) {
7857
- var _Object$keys;
7858
- if (Array !== null && Array !== void 0 && Array.isArray(value)) return (value === null || value === void 0 ? void 0 : value.length) <= 0;
7859
- if (typeof value === 'object') return (Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0;
7860
- return false;
7861
- };
7862
- var _validateData = function _validateData() {
7863
- var count = 0;
7864
- for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
7865
- var _e$pattern;
7866
- var e = _step.value;
7867
- if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && isEmpty(value)) {
7868
- _setError(e === null || e === void 0 ? void 0 : e.message);
7869
- count++;
7870
- break;
7871
- } else if ((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))) {
7872
- _setError(e === null || e === void 0 ? void 0 : e.message);
7873
- count++;
7874
- break;
7875
- }
7951
+ };
7952
+
7953
+ var EmployeeController = function EmployeeController(props) {
7954
+ var _props$isAutoGetList = props.isAutoGetList,
7955
+ isAutoGetList = _props$isAutoGetList === void 0 ? true : _props$isAutoGetList,
7956
+ shopConfig = props.shopConfig;
7957
+ var _useState = useState([]),
7958
+ listEmployment = _useState[0],
7959
+ setListEmployment = _useState[1];
7960
+ useEffect(function () {
7961
+ if (isAutoGetList) {
7962
+ getListEmployee();
7876
7963
  }
7877
- if (count) {
7878
- return false;
7879
- } else {
7880
- _setError('');
7881
- return true;
7964
+ }, [isAutoGetList]);
7965
+ var getListEmployee = function getListEmployee() {
7966
+ try {
7967
+ return Promise.resolve(_catch(function () {
7968
+ return Promise.resolve(getEmployeeListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId)).then(function (res) {
7969
+ var _res$data, _res$data$status;
7970
+ if ((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$status = _res$data.status) === null || _res$data$status === void 0 ? void 0 : _res$data$status.code) == 200) {
7971
+ var _res$data2;
7972
+ setListEmployment((res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data) || []);
7973
+ }
7974
+ return res;
7975
+ });
7976
+ }, function (e) {
7977
+ console.log(e);
7978
+ }));
7979
+ } catch (e) {
7980
+ return Promise.reject(e);
7981
+ }
7982
+ };
7983
+ return {
7984
+ listEmployment: listEmployment,
7985
+ getListEmployee: getListEmployee
7986
+ };
7987
+ };
7988
+
7989
+ var createSpaScheduleApi = function createSpaScheduleApi(shopId, data) {
7990
+ return api({
7991
+ method: "post",
7992
+ url: "/spa-schedule/customer/create",
7993
+ data: data,
7994
+ headers: {
7995
+ shopId: shopId
7996
+ }
7997
+ });
7998
+ };
7999
+ var draftOrderWithoutLoginApi = function draftOrderWithoutLoginApi(shopId, data) {
8000
+ return api({
8001
+ method: "post",
8002
+ url: "/spa/orders/draft-online-without-login",
8003
+ params: {
8004
+ shopId: shopId
8005
+ },
8006
+ data: data,
8007
+ headers: {
8008
+ shopId: shopId
8009
+ }
8010
+ });
8011
+ };
8012
+
8013
+ var _excluded$1 = ["productName"];
8014
+ var BookingController = function BookingController(props) {
8015
+ _objectDestructuringEmpty(props);
8016
+ var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
8017
+ try {
8018
+ return Promise.resolve(_catch(function () {
8019
+ var _Date;
8020
+ var data = {
8021
+ appId: "SSPA",
8022
+ customerName: customerName,
8023
+ customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
8024
+ isSellService: true,
8025
+ scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
8026
+ services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
8027
+ var productName = _ref.productName,
8028
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
8029
+ return rest;
8030
+ }),
8031
+ shopId: shopId
8032
+ };
8033
+ return Promise.resolve(createSpaScheduleApi(shopId, data));
8034
+ }, function (e) {
8035
+ console.log(e);
8036
+ }));
8037
+ } catch (e) {
8038
+ return Promise.reject(e);
8039
+ }
8040
+ };
8041
+ return {
8042
+ createSchedule: createSchedule
8043
+ };
8044
+ };
8045
+
8046
+ var Select = forwardRef(function (props, ref) {
8047
+ var _props$label = props.label,
8048
+ label = _props$label === void 0 ? "" : _props$label,
8049
+ _props$labelClassName = props.labelClassName,
8050
+ labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
8051
+ _props$placeholder = props.placeholder,
8052
+ placeholder = _props$placeholder === void 0 ? "" : _props$placeholder,
8053
+ _props$className = props.className,
8054
+ className = _props$className === void 0 ? "" : _props$className,
8055
+ _props$optionClassNam = props.optionClassName,
8056
+ optionClassName = _props$optionClassNam === void 0 ? "" : _props$optionClassNam,
8057
+ _props$wrapClassName = props.wrapClassName,
8058
+ wrapClassName = _props$wrapClassName === void 0 ? "" : _props$wrapClassName,
8059
+ _props$selectClassNam = props.selectClassName,
8060
+ selectClassName = _props$selectClassNam === void 0 ? "" : _props$selectClassNam,
8061
+ _props$rules = props.rules,
8062
+ rules = _props$rules === void 0 ? [] : _props$rules,
8063
+ options = props.options,
8064
+ _props$defaultValue = props.defaultValue,
8065
+ defaultValue = _props$defaultValue === void 0 ? {} : _props$defaultValue,
8066
+ handleSearchOption = props.handleSearchOption,
8067
+ _props$isMulti = props.isMulti,
8068
+ isMulti = _props$isMulti === void 0 ? false : _props$isMulti,
8069
+ _props$onClick = props.onClick,
8070
+ onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
8071
+ _props$isButtonDelete = props.isButtonDelete,
8072
+ isButtonDelete = _props$isButtonDelete === void 0 ? false : _props$isButtonDelete,
8073
+ _props$funcDelete = props.funcDelete,
8074
+ funcDelete = _props$funcDelete === void 0 ? function () {} : _props$funcDelete,
8075
+ _props$isSearch = props.isSearch,
8076
+ isSearch = _props$isSearch === void 0 ? true : _props$isSearch,
8077
+ renderItem = props.renderItem;
8078
+ var _useState = useState(false),
8079
+ isOpen = _useState[0],
8080
+ setIsOpen = _useState[1];
8081
+ var selectRef = useRef(null);
8082
+ var _useState2 = useState(""),
8083
+ error = _useState2[0],
8084
+ _setError = _useState2[1];
8085
+ var _useState3 = useState(""),
8086
+ inputSearch = _useState3[0],
8087
+ setInputSearch = _useState3[1];
8088
+ var _useState4 = useState(defaultValue),
8089
+ value = _useState4[0],
8090
+ setValue = _useState4[1];
8091
+ var _useState5 = useState(options),
8092
+ listOptions = _useState5[0],
8093
+ setListOptions = _useState5[1];
8094
+ var dropdownRef = useRef(null);
8095
+ var _useState6 = useState('bottom'),
8096
+ dropdownPosition = _useState6[0],
8097
+ setDropdownPosition = _useState6[1];
8098
+ var inputRef = useRef(null);
8099
+ useEffect(function () {
8100
+ if (isMulti) setValue(defaultValue);
8101
+ }, [defaultValue]);
8102
+ useEffect(function () {
8103
+ setListOptions(options);
8104
+ if (!isMulti) setValue(defaultValue);
8105
+ }, [options]);
8106
+ useEffect(function () {
8107
+ var _inputRef$current;
8108
+ inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
8109
+ var updateDropdownPosition = function updateDropdownPosition() {
8110
+ if (selectRef.current && dropdownRef.current) {
8111
+ var _selectRef$current, _window;
8112
+ var selectRect = selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect();
8113
+ var spaceBelow = ((_window = window) === null || _window === void 0 ? void 0 : _window.innerHeight) - (selectRect === null || selectRect === void 0 ? void 0 : selectRect.bottom);
8114
+ var spaceAbove = selectRect === null || selectRect === void 0 ? void 0 : selectRect.top;
8115
+ if (spaceBelow < spaceAbove) {
8116
+ setDropdownPosition('top');
8117
+ } else {
8118
+ setDropdownPosition('bottom');
8119
+ }
8120
+ }
8121
+ };
8122
+ if (isOpen) {
8123
+ updateDropdownPosition();
8124
+ window.addEventListener('resize', updateDropdownPosition);
8125
+ }
8126
+ return function () {
8127
+ window.removeEventListener('resize', updateDropdownPosition);
8128
+ };
8129
+ }, [isOpen]);
8130
+ var handleClickOutside = function handleClickOutside(event) {
8131
+ var _selectRef$current2;
8132
+ if (selectRef !== null && selectRef !== void 0 && selectRef.current && !(selectRef !== null && selectRef !== void 0 && (_selectRef$current2 = selectRef.current) !== null && _selectRef$current2 !== void 0 && _selectRef$current2.contains(event.target))) {
8133
+ setIsOpen(false);
8134
+ setInputSearch("");
8135
+ setListOptions(options);
8136
+ }
8137
+ };
8138
+ useEffect(function () {
8139
+ document.addEventListener('click', handleClickOutside);
8140
+ return function () {
8141
+ document.removeEventListener('click', handleClickOutside);
8142
+ };
8143
+ }, []);
8144
+ useImperativeHandle(ref, function () {
8145
+ return {
8146
+ validateData: function validateData() {
8147
+ return _validateData();
8148
+ },
8149
+ setError: function setError(err) {
8150
+ return _setError(err);
8151
+ }
8152
+ };
8153
+ });
8154
+ var isEmpty = function isEmpty(value) {
8155
+ var _Object$keys;
8156
+ if (Array !== null && Array !== void 0 && Array.isArray(value)) return (value === null || value === void 0 ? void 0 : value.length) <= 0;
8157
+ if (typeof value === 'object') return (Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(value)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) <= 0;
8158
+ return false;
8159
+ };
8160
+ var _validateData = function _validateData() {
8161
+ var count = 0;
8162
+ for (var _iterator = _createForOfIteratorHelperLoose(rules), _step; !(_step = _iterator()).done;) {
8163
+ var _e$pattern;
8164
+ var e = _step.value;
8165
+ if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && isEmpty(value)) {
8166
+ _setError(e === null || e === void 0 ? void 0 : e.message);
8167
+ count++;
8168
+ break;
8169
+ } else if ((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))) {
8170
+ _setError(e === null || e === void 0 ? void 0 : e.message);
8171
+ count++;
8172
+ break;
8173
+ }
8174
+ }
8175
+ if (count) {
8176
+ return false;
8177
+ } else {
8178
+ _setError('');
8179
+ return true;
7882
8180
  }
7883
8181
  };
7884
8182
  var handleSearch = function handleSearch(e) {
@@ -8225,19 +8523,6 @@ var InputPhoneNumber = forwardRef(function (props, ref) {
8225
8523
  }, error) : null);
8226
8524
  });
8227
8525
 
8228
- var formatCurrency = function formatCurrency(amount) {
8229
- if (isNaN(amount)) {
8230
- return '0 ₫';
8231
- }
8232
- var roundedAmount = Math.round(amount);
8233
- var formattedAmount = roundedAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
8234
- return formattedAmount + " \u20AB";
8235
- };
8236
- var pattern = {
8237
- phoneNumberPattern: /^(?:\+84|0)\d{9}$/
8238
- };
8239
- var numberPattern = /^\d+$/;
8240
-
8241
8526
  var dayjs_min = createCommonjsModule(function (module, exports) {
8242
8527
  !function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
8243
8528
  });
@@ -8721,465 +9006,142 @@ var BookingForm = function BookingForm(props) {
8721
9006
  className: "mb-4 text-center"
8722
9007
  }, "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, {
8723
9008
  label: "Đăng nhập",
8724
- shopConfigStyle: shopConfigStyle
8725
- })))));
8726
- };
8727
-
8728
- var Treatments1 = function Treatments1(props) {
8729
- var _props$shopConfigStyl = props.shopConfigStyle,
8730
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
8731
- _props$shopConfig = props.shopConfig,
8732
- shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
8733
- _props$data = props.data,
8734
- data = _props$data === void 0 ? {} : _props$data,
8735
- _props$SectionTitle = props.SectionTitle,
8736
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8737
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8738
- _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8739
- secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
8740
- var _useState = useState({
8741
- size: 10,
8742
- types: "1,10",
8743
- isHighlight: true
8744
- }),
8745
- params = _useState[0];
8746
- var _useState2 = useState(false),
8747
- isOpenModal = _useState2[0],
8748
- setIsOpenModal = _useState2[1];
8749
- var _useState3 = useState([]),
8750
- dataBooking = _useState3[0],
8751
- setDataBooking = _useState3[1];
8752
- var _ProductController = ProductController(_extends({}, props, {
8753
- params: params
8754
- })),
8755
- _ProductController$pr = _ProductController.products,
8756
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
8757
- console.log("treatment1:", products);
8758
- var handleOpenModalBooking = function handleOpenModalBooking(event, data) {
8759
- try {
8760
- var _data$productInfo, _data$productInfo2;
8761
- event.stopPropagation();
8762
- setDataBooking([_extends({}, data, {
8763
- quantity: 1,
8764
- technical: {},
8765
- oldService: false,
8766
- label: data === null || data === void 0 ? void 0 : (_data$productInfo = data.productInfo) === null || _data$productInfo === void 0 ? void 0 : _data$productInfo.productName,
8767
- value: data === null || data === void 0 ? void 0 : (_data$productInfo2 = data.productInfo) === null || _data$productInfo2 === void 0 ? void 0 : _data$productInfo2.productId
8768
- })]);
8769
- setIsOpenModal(true);
8770
- } catch (error) {
8771
- console.log("::::::::::errrorrrrr::::::", error);
8772
- }
8773
- };
8774
- var handleCloseModal = function handleCloseModal() {
8775
- setIsOpenModal(false);
8776
- setDataBooking([]);
8777
- };
8778
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
8779
- className: "" + SECTION_DEFAULT_CLASS
8780
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
8781
- data: data,
8782
- shopConfigStyle: shopConfigStyle
8783
- }), products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8784
- var _product$productInfo, _product$productInfo2;
8785
- return /*#__PURE__*/React__default.createElement("div", {
8786
- className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
8787
- key: "rthirr-" + index
8788
- }, /*#__PURE__*/React__default.createElement("div", {
8789
- className: "block " + (index % 2 ? "md:hidden" : "")
8790
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
8791
- product: product === null || product === void 0 ? void 0 : product.productInfo,
8792
- className: "aspect-video rounded-2xl"
8793
- })), /*#__PURE__*/React__default.createElement("div", {
8794
- className: "text-left " + (index % 2 ? "md:text-right" : "")
8795
- }, /*#__PURE__*/React__default.createElement("div", {
8796
- className: "font-medium text-2xl"
8797
- }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
8798
- className: "mt-4 text-textBody",
8799
- dangerouslySetInnerHTML: {
8800
- __html: product === null || product === void 0 ? void 0 : (_product$productInfo2 = product.productInfo) === null || _product$productInfo2 === void 0 ? void 0 : _product$productInfo2.description
8801
- }
8802
- }), /*#__PURE__*/React__default.createElement(Button, {
8803
- label: "Đặt lịch ngay",
8804
- shopConfigStyle: shopConfigStyle,
8805
- className: "mt-4",
8806
- onClick: function onClick(event) {
8807
- handleOpenModalBooking(event, product);
8808
- }
8809
- })), /*#__PURE__*/React__default.createElement("div", {
8810
- className: "hidden " + (index % 2 ? "md:block" : "")
8811
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
8812
- product: product === null || product === void 0 ? void 0 : product.productInfo,
8813
- className: "aspect-video rounded-2xl"
8814
- })));
8815
- })), /*#__PURE__*/React__default.createElement(Dash, {
8816
- color: secondary
8817
- }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
8818
- onClose: handleCloseModal
8819
- }, /*#__PURE__*/React__default.createElement(BookingForm, {
8820
- className: "overflow-y-auto hide-scrollbar max-h-[80vh] !bg-bgSecondary",
8821
- onCloseFormBooking: handleCloseModal,
8822
- defaultValue: dataBooking,
8823
- shopConfig: shopConfig,
8824
- shopConfigStyle: shopConfigStyle
8825
- })) : null);
8826
- };
8827
-
8828
- var _path$1;
8829
- function _extends$2() {
8830
- return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
8831
- for (var e = 1; e < arguments.length; e++) {
8832
- var t = arguments[e];
8833
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
8834
- }
8835
- return n;
8836
- }, _extends$2.apply(null, arguments);
8837
- }
8838
- function SvgAngleSmallLeft(props) {
8839
- return /*#__PURE__*/createElement("svg", _extends$2({
8840
- xmlns: "http://www.w3.org/2000/svg",
8841
- viewBox: "0 0 24 24",
8842
- width: 512,
8843
- height: 512
8844
- }, props), _path$1 || (_path$1 = /*#__PURE__*/createElement("path", {
8845
- d: "M10.6 12.71a1 1 0 010-1.42l4.59-4.58a1 1 0 000-1.42 1 1 0 00-1.41 0L9.19 9.88a3 3 0 000 4.24l4.59 4.59a1 1 0 00.7.29 1 1 0 00.71-.29 1 1 0 000-1.42z"
8846
- })));
8847
- }
8848
-
8849
- var _path$2;
8850
- function _extends$3() {
8851
- return _extends$3 = Object.assign ? Object.assign.bind() : function (n) {
8852
- for (var e = 1; e < arguments.length; e++) {
8853
- var t = arguments[e];
8854
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
8855
- }
8856
- return n;
8857
- }, _extends$3.apply(null, arguments);
8858
- }
8859
- function SvgAngleSmallRight(props) {
8860
- return /*#__PURE__*/createElement("svg", _extends$3({
8861
- xmlns: "http://www.w3.org/2000/svg",
8862
- viewBox: "0 0 24 24",
8863
- width: 512,
8864
- height: 512
8865
- }, props), _path$2 || (_path$2 = /*#__PURE__*/createElement("path", {
8866
- d: "M15.4 9.88l-4.59-4.59a1 1 0 00-1.41 0 1 1 0 000 1.42l4.6 4.58a1 1 0 010 1.42l-4.6 4.58a1 1 0 001.41 1.42l4.59-4.59a3 3 0 000-4.24z"
8867
- })));
8868
- }
8869
-
8870
- var ScrollHorizontal = function ScrollHorizontal(props) {
8871
- var _props$datas = props.datas,
8872
- datas = _props$datas === void 0 ? [] : _props$datas,
8873
- _props$className = props.className,
8874
- className = _props$className === void 0 ? "" : _props$className,
8875
- _props$style = props.style,
8876
- style = _props$style === void 0 ? {} : _props$style,
8877
- _props$renderItem = props.renderItem,
8878
- renderItem = _props$renderItem === void 0 ? function () {} : _props$renderItem;
8879
- var scrollContainerRef = useRef(null);
8880
- var _useState = useState(true),
8881
- isScrolledToLeft = _useState[0],
8882
- setIsScrolledToLeft = _useState[1];
8883
- var _useState2 = useState(false),
8884
- isScrolledToRight = _useState2[0],
8885
- setIsScrolledToRight = _useState2[1];
8886
- var checkScrollPosition = function checkScrollPosition() {
8887
- if (scrollContainerRef.current) {
8888
- var _scrollContainerRef$c = scrollContainerRef.current,
8889
- _scrollLeft = _scrollContainerRef$c.scrollLeft,
8890
- scrollWidth = _scrollContainerRef$c.scrollWidth,
8891
- clientWidth = _scrollContainerRef$c.clientWidth;
8892
- setIsScrolledToLeft(_scrollLeft === 0);
8893
- setIsScrolledToRight(_scrollLeft + clientWidth >= scrollWidth);
8894
- }
8895
- };
8896
- var scrollLeft = function scrollLeft() {
8897
- if (scrollContainerRef.current) {
8898
- scrollContainerRef.current.scrollBy({
8899
- left: -200,
8900
- behavior: "smooth"
8901
- });
8902
- setTimeout(checkScrollPosition, 300);
8903
- }
8904
- };
8905
- var scrollRight = function scrollRight() {
8906
- if (scrollContainerRef.current) {
8907
- scrollContainerRef.current.scrollBy({
8908
- left: 200,
8909
- behavior: "smooth"
8910
- });
8911
- setTimeout(checkScrollPosition, 300);
8912
- }
8913
- };
8914
- useEffect(function () {
8915
- checkScrollPosition();
8916
- }, [datas]);
8917
- return /*#__PURE__*/React__default.createElement("div", {
8918
- className: "flex " + className,
8919
- style: style
8920
- }, /*#__PURE__*/React__default.createElement("div", {
8921
- className: "flex w-full overflow-x-hidden",
8922
- ref: scrollContainerRef,
8923
- onScroll: checkScrollPosition
8924
- }, datas === null || datas === void 0 ? void 0 : datas.map(function (item, index) {
8925
- return renderItem(item, index);
8926
- })), /*#__PURE__*/React__default.createElement("div", {
8927
- className: "flex gap-2 items-center px-4"
8928
- }, /*#__PURE__*/React__default.createElement("div", {
8929
- onClick: scrollLeft,
8930
- className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToLeft ? "bg-gray4" : "bg-primary")
8931
- }, /*#__PURE__*/React__default.createElement(SvgAngleSmallLeft, {
8932
- width: 24,
8933
- height: 24,
8934
- fill: "#fff"
8935
- })), /*#__PURE__*/React__default.createElement("div", {
8936
- onClick: scrollRight,
8937
- className: "cursor-pointer w-8 h-8 rounded-full flex justify-center items-center " + (isScrolledToRight ? "bg-gray4" : "bg-primary")
8938
- }, /*#__PURE__*/React__default.createElement(SvgAngleSmallRight, {
8939
- width: 24,
8940
- height: 24,
8941
- fill: "#fff"
8942
- }))));
8943
- };
8944
-
8945
- function getMinMax(array, field) {
8946
- if (!(array !== null && array !== void 0 && array.length) || !array[0].hasOwnProperty(field)) {
8947
- return null;
8948
- }
8949
- var _array$reduce = array.reduce(function (acc, obj) {
8950
- var value = obj[field];
8951
- return {
8952
- min: value < acc.min ? value : acc.min,
8953
- max: value > acc.max ? value : acc.max
8954
- };
8955
- }, {
8956
- min: array[0][field],
8957
- max: array[0][field]
8958
- }),
8959
- min = _array$reduce.min,
8960
- max = _array$reduce.max;
8961
- return {
8962
- min: min,
8963
- max: max
8964
- };
8965
- }
8966
- var ProductPrice = function ProductPrice(props) {
8967
- var product = props.product,
8968
- variant = props.variant,
8969
- _props$className = props.className,
8970
- className = _props$className === void 0 ? "" : _props$className,
8971
- _props$style = props.style,
8972
- style = _props$style === void 0 ? {} : _props$style;
8973
- var _useState = useState(),
8974
- displayPrice = _useState[0],
8975
- setDisplayPrice = _useState[1];
8976
- var _useState2 = useState(),
8977
- displayPriceBeforeDiscount = _useState2[0],
8978
- setDisplayPriceBeforeDiscount = _useState2[1];
8979
- useEffect(function () {
8980
- if (variant) {
8981
- genProductPrice([variant]);
8982
- } else if (product) {
8983
- genProductPrice(product.variants);
8984
- }
8985
- }, [product, variant]);
8986
- var genProductPrice = function genProductPrice(variants) {
8987
- var mPrice = getMinMax(variants, 'price');
8988
- var mPriceBeforeDiscount = getMinMax(variants, 'priceBeforeDiscount');
8989
- if (mPrice && mPriceBeforeDiscount) {
8990
- var _displayPriceBeforeDiscount = formatCurrency(mPriceBeforeDiscount.min);
8991
- var _displayPrice = formatCurrency(mPrice.min);
8992
- if (mPrice.min !== mPrice.max) {
8993
- _displayPrice += " - " + formatCurrency(mPrice.max);
8994
- }
8995
- if (mPriceBeforeDiscount.min !== mPriceBeforeDiscount.max) {
8996
- _displayPriceBeforeDiscount += " - " + formatCurrency(mPriceBeforeDiscount.max);
8997
- }
8998
- setDisplayPrice(_displayPrice);
8999
- setDisplayPriceBeforeDiscount(_displayPriceBeforeDiscount);
9000
- } else {
9001
- var _displayPrice2 = formatCurrency(product === null || product === void 0 ? void 0 : product.price);
9002
- setDisplayPrice(_displayPrice2);
9003
- }
9004
- };
9005
- return /*#__PURE__*/React__default.createElement("div", {
9006
- className: className
9007
- }, displayPriceBeforeDiscount !== displayPrice && displayPriceBeforeDiscount != null ? /*#__PURE__*/React__default.createElement("span", {
9008
- className: "text-gray3 line-through mr-2"
9009
- }, displayPriceBeforeDiscount) : null, /*#__PURE__*/React__default.createElement("span", {
9010
- className: "text-primary font-semibold",
9011
- style: style
9012
- }, displayPrice));
9013
- };
9014
-
9015
- var ProductItem1 = function ProductItem1(props) {
9016
- var product = props.product;
9017
- return /*#__PURE__*/React__default.createElement("div", {
9018
- className: "flex"
9019
- }, /*#__PURE__*/React__default.createElement(ProductImage, {
9020
- product: product,
9021
- className: "!w-20 rounded-lg"
9022
- }), /*#__PURE__*/React__default.createElement("div", {
9023
- className: "ml-4 border-b border-stroke flex-1"
9024
- }, /*#__PURE__*/React__default.createElement("div", {
9025
- className: "text-lg"
9026
- }, product === null || product === void 0 ? void 0 : product.productName), /*#__PURE__*/React__default.createElement("div", {
9027
- className: "flex mt-2"
9028
- }, /*#__PURE__*/React__default.createElement("div", {
9029
- className: "flex-1 text-gray3"
9030
- }, getDurationValue(product === null || product === void 0 ? void 0 : product.attributes)), /*#__PURE__*/React__default.createElement(ProductPrice, {
9031
- product: product
9032
- }))));
9033
- };
9034
-
9035
- var Loading = function Loading(props) {
9036
- var _props$size = props.size,
9037
- size = _props$size === void 0 ? 24 : _props$size;
9038
- return /*#__PURE__*/React__default.createElement("div", {
9039
- className: "border-4 boder-[rgba(255, 255, 255, 0.2)] rounded-full border-t-4 border-t-primary animate-spin",
9040
- style: {
9041
- width: size,
9042
- height: size
9043
- }
9044
- });
9045
- };
9046
-
9047
- var Treatments1$1 = function Treatments1(props) {
9048
- var _props$shopConfigStyl = props.shopConfigStyle,
9049
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9050
- _props$data = props.data,
9051
- data = _props$data === void 0 ? {} : _props$data,
9052
- _props$SectionTitle = props.SectionTitle,
9053
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9054
- var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9055
- _shopConfigStyle$colo2 = _shopConfigStyle$colo.secondary,
9056
- secondary = _shopConfigStyle$colo2 === void 0 ? "#000" : _shopConfigStyle$colo2;
9057
- var _useState = useState({
9058
- types: "1"
9059
- }),
9060
- params = _useState[0],
9061
- setParams = _useState[1];
9062
- var _CategoryController = CategoryController(_extends({}, props, {
9063
- types: "1"
9064
- })),
9065
- categories = _CategoryController.categories;
9066
- var _ProductController = ProductController(_extends({}, props, {
9067
- params: params
9068
- })),
9069
- _ProductController$pr = _ProductController.products,
9070
- products = _ProductController$pr === void 0 ? [] : _ProductController$pr,
9071
- loading = _ProductController.loading;
9072
- var _useState2 = useState(0),
9073
- selectedCategory = _useState2[0],
9074
- setSelectedCategory = _useState2[1];
9075
- useEffect(function () {
9076
- var newParams = _extends({}, params, {
9077
- categoryId: selectedCategory
9078
- });
9079
- if (!selectedCategory) {
9080
- delete newParams.categoryId;
9081
- }
9082
- setParams(newParams);
9083
- }, [selectedCategory]);
9084
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9085
- className: SECTION_DEFAULT_CLASS + " relative"
9086
- }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9087
- data: data,
9088
- shopConfigStyle: shopConfigStyle
9089
- }), /*#__PURE__*/React__default.createElement(ScrollHorizontal, {
9090
- datas: [{
9091
- categoryId: 0,
9092
- cateName: "Tất cả"
9093
- }].concat(categories),
9094
- className: "mt-6 rounded-lg overflow-hidden bg-bgSecondary",
9095
- renderItem: function renderItem(item, index) {
9096
- return /*#__PURE__*/React__default.createElement("div", {
9097
- key: index,
9098
- className: "p-3 flex gap-3 shrink-0 cursor-pointer text-base " + (selectedCategory === item.categoryId ? "bg-primary text-textButton" : ""),
9099
- onClick: function onClick() {
9100
- return setSelectedCategory(item.categoryId);
9101
- }
9102
- }, item === null || item === void 0 ? void 0 : item.cateName);
9103
- }
9104
- }), loading ? /*#__PURE__*/React__default.createElement("div", {
9105
- className: "flex w-full justify-center p-12"
9106
- }, /*#__PURE__*/React__default.createElement(Loading, null)) : products !== null && products !== void 0 && products.length ? /*#__PURE__*/React__default.createElement("div", {
9107
- className: "grid grid-cols-1 md:grid-cols-2 gap-10 mt-6"
9108
- }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9109
- return /*#__PURE__*/React__default.createElement(ProductItem1, {
9110
- key: index,
9111
- product: product === null || product === void 0 ? void 0 : product.productInfo
9112
- });
9113
- })) : /*#__PURE__*/React__default.createElement("div", {
9114
- className: "text-gray3 text-center p-12"
9115
- }, "Kh\xF4ng c\xF3 d\u1ECBch v\u1EE5")), /*#__PURE__*/React__default.createElement(Dash, {
9116
- color: secondary
9117
- }));
9118
- };
9119
-
9120
- var NotFoundProduct = function NotFoundProduct() {
9121
- return /*#__PURE__*/React__default.createElement("div", {
9122
- className: "h-60 flex flex-col justify-center items-center text-xl text-gray3"
9123
- }, /*#__PURE__*/React__default.createElement(FaBoxOpen, {
9124
- size: 80
9125
- }), /*#__PURE__*/React__default.createElement("div", null, "Kh\xF4ng c\xF3 s\u1EA3n ph\u1EA9m"));
9009
+ shopConfigStyle: shopConfigStyle
9010
+ })))));
9126
9011
  };
9127
9012
 
9128
- var TreatmentsList6 = function TreatmentsList6(props) {
9129
- var _products$slice;
9130
- var data = props.data,
9131
- _props$Link = props.Link,
9132
- Link = _props$Link === void 0 ? null : _props$Link,
9013
+ var TreatmentsList7 = function TreatmentsList7(props) {
9014
+ var _props$shopConfigStyl = props.shopConfigStyle,
9015
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9016
+ _props$shopConfig = props.shopConfig,
9017
+ shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
9018
+ _props$data = props.data,
9019
+ data = _props$data === void 0 ? {} : _props$data,
9133
9020
  _props$SectionTitle = props.SectionTitle,
9134
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9135
- _props$TreatmentItem = props.TreatmentItem,
9136
- TreatmentItem = _props$TreatmentItem === void 0 ? null : _props$TreatmentItem,
9137
- _props$shopConfigStyl = props.shopConfigStyle,
9138
- shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl;
9021
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9022
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9023
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9024
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
9139
9025
  var _useState = useState({
9140
- size: 12,
9141
- types: "1"
9026
+ size: 10,
9027
+ types: "1,10",
9028
+ isHighlight: true
9142
9029
  }),
9143
- params = _useState[0],
9144
- setParams = _useState[1];
9145
- var _useState2 = useState(true),
9146
- isGetMore = _useState2[0],
9147
- setIsGetMore = _useState2[1];
9030
+ params = _useState[0];
9031
+ var _useState2 = useState(false),
9032
+ isOpenModal = _useState2[0],
9033
+ setIsOpenModal = _useState2[1];
9034
+ var _useState3 = useState([]),
9035
+ dataBooking = _useState3[0],
9036
+ setDataBooking = _useState3[1];
9037
+ var _useState4 = useState(0),
9038
+ currentSlide = _useState4[0],
9039
+ setCurrentSlide = _useState4[1];
9148
9040
  var _ProductController = ProductController(_extends({}, props, {
9149
9041
  params: params
9150
9042
  })),
9151
- products = _ProductController.products,
9152
- loading = _ProductController.loading;
9153
- var handleGetMoreProducts = function handleGetMoreProducts() {
9154
- setIsGetMore(false);
9155
- setParams(function (prev) {
9156
- return _extends({}, prev, {
9157
- size: (prev === null || prev === void 0 ? void 0 : prev.size) + 4
9158
- });
9159
- });
9043
+ _ProductController$pr = _ProductController.products,
9044
+ products = _ProductController$pr === void 0 ? [] : _ProductController$pr;
9045
+ console.log("treatment1:", products);
9046
+ var handleOpenModalBooking = function handleOpenModalBooking(event, data) {
9047
+ try {
9048
+ var _data$productInfo, _data$productInfo2;
9049
+ event.stopPropagation();
9050
+ setDataBooking([_extends({}, data, {
9051
+ quantity: 1,
9052
+ technical: {},
9053
+ oldService: false,
9054
+ label: data === null || data === void 0 ? void 0 : (_data$productInfo = data.productInfo) === null || _data$productInfo === void 0 ? void 0 : _data$productInfo.productName,
9055
+ value: data === null || data === void 0 ? void 0 : (_data$productInfo2 = data.productInfo) === null || _data$productInfo2 === void 0 ? void 0 : _data$productInfo2.productId
9056
+ })]);
9057
+ setIsOpenModal(true);
9058
+ } catch (error) {
9059
+ console.log("::::::::::errrorrrrr::::::", error);
9060
+ }
9160
9061
  };
9161
- return /*#__PURE__*/React__default.createElement("div", {
9162
- className: SECTION_CLASS + " flex flex-col gap-8 "
9062
+ var handleCloseModal = function handleCloseModal() {
9063
+ setIsOpenModal(false);
9064
+ setDataBooking([]);
9065
+ };
9066
+ var renderItemSlide = function renderItemSlide(product, index) {
9067
+ var _product$productInfo, _product$productInfo2;
9068
+ return /*#__PURE__*/React__default.createElement("div", {
9069
+ className: "w-full"
9070
+ }, /*#__PURE__*/React__default.createElement("div", {
9071
+ className: "grid grid-cols-1 md:grid-cols-2 gap-6 mt-12",
9072
+ key: index
9073
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
9074
+ product: product === null || product === void 0 ? void 0 : product.productInfo,
9075
+ className: "aspect-video rounded-2xl"
9076
+ }), /*#__PURE__*/React__default.createElement("div", {
9077
+ className: ''
9078
+ }, /*#__PURE__*/React__default.createElement("div", {
9079
+ className: "font-medium text-2xl"
9080
+ }, product === null || product === void 0 ? void 0 : (_product$productInfo = product.productInfo) === null || _product$productInfo === void 0 ? void 0 : _product$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
9081
+ className: "mt-4 text-textBody",
9082
+ dangerouslySetInnerHTML: {
9083
+ __html: product === null || product === void 0 ? void 0 : (_product$productInfo2 = product.productInfo) === null || _product$productInfo2 === void 0 ? void 0 : _product$productInfo2.description
9084
+ }
9085
+ }), /*#__PURE__*/React__default.createElement(Button, {
9086
+ label: "Đặt lịch ngay",
9087
+ shopConfigStyle: shopConfigStyle,
9088
+ className: "mt-4",
9089
+ onClick: function onClick(event) {
9090
+ handleOpenModalBooking(event, product);
9091
+ }
9092
+ }))));
9093
+ };
9094
+ function RenderArrow(props) {
9095
+ var className = props.className,
9096
+ style = props.style,
9097
+ onClick = props.onClick;
9098
+ return /*#__PURE__*/React__default.createElement("div", {
9099
+ className: className,
9100
+ style: _extends({}, style, {
9101
+ display: "none"
9102
+ }),
9103
+ onClick: onClick
9104
+ });
9105
+ }
9106
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9107
+ className: "" + SECTION_DEFAULT_CLASS
9163
9108
  }, /*#__PURE__*/React__default.createElement(SectionTitle, {
9164
9109
  data: data,
9165
9110
  shopConfigStyle: shopConfigStyle
9166
- }), loading && isGetMore ? /*#__PURE__*/React__default.createElement("div", {
9167
- className: "m-auto mt-20 min-h-32"
9168
- }, /*#__PURE__*/React__default.createElement(Loading, null)) : (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
9169
- 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"
9170
- }, products === null || products === void 0 ? void 0 : (_products$slice = products.slice(0, params.size - 4)) === null || _products$slice === void 0 ? void 0 : _products$slice.map(function (product, idx) {
9171
- return /*#__PURE__*/React__default.createElement(TreatmentItem, {
9172
- Link: Link,
9173
- shopConfigStyle: shopConfigStyle,
9174
- product: product === null || product === void 0 ? void 0 : product.productInfo,
9175
- key: "htrhr-" + idx
9176
- });
9177
- })) : /*#__PURE__*/React__default.createElement(NotFoundProduct, null), !loading && (products === null || products === void 0 ? void 0 : products.length) > (params === null || params === void 0 ? void 0 : params.size) - 4 ? /*#__PURE__*/React__default.createElement(Button, {
9178
- label: "Xem thêm",
9179
- onClick: handleGetMoreProducts,
9180
- className: "mx-auto " + (shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.buttonClass),
9181
- type: "outline"
9182
- }) : null);
9111
+ }), /*#__PURE__*/React__default.createElement(Slider, {
9112
+ className: "center",
9113
+ infinite: true,
9114
+ slidesToShow: 1,
9115
+ speed: 500,
9116
+ autoplay: true,
9117
+ autoplaySpeed: 4000,
9118
+ pauseOnHover: true,
9119
+ nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9120
+ prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
9121
+ beforeChange: function beforeChange(oldIndex, newIndex) {
9122
+ return setCurrentSlide(newIndex);
9123
+ },
9124
+ dots: true,
9125
+ customPaging: function customPaging(i) {
9126
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
9127
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
9128
+ }) : /*#__PURE__*/React__default.createElement("div", {
9129
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
9130
+ });
9131
+ }
9132
+ }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9133
+ return renderItemSlide(product, index);
9134
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
9135
+ color: secondary
9136
+ }), isOpenModal ? /*#__PURE__*/React__default.createElement(ModalNotification, {
9137
+ onClose: handleCloseModal
9138
+ }, /*#__PURE__*/React__default.createElement(BookingForm, {
9139
+ className: "overflow-y-auto hide-scrollbar max-h-[80vh] !bg-bgSecondary",
9140
+ onCloseFormBooking: handleCloseModal,
9141
+ defaultValue: dataBooking,
9142
+ shopConfig: shopConfig,
9143
+ shopConfigStyle: shopConfigStyle
9144
+ })) : null);
9183
9145
  };
9184
9146
 
9185
9147
  var ProductDetailController = function ProductDetailController(props) {
@@ -9610,7 +9572,7 @@ var TreatmentItem1 = function TreatmentItem1(props) {
9610
9572
  }))));
9611
9573
  };
9612
9574
 
9613
- var Products1 = function Products1(props) {
9575
+ var ProductsList7 = function ProductsList7(props) {
9614
9576
  var _props$shopConfigStyl = props.shopConfigStyle,
9615
9577
  shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
9616
9578
  _props$data = props.data,
@@ -10733,6 +10695,72 @@ var Banner1 = function Banner1(props) {
10733
10695
  })));
10734
10696
  };
10735
10697
 
10698
+ var Banner2 = function Banner2(props) {
10699
+ var data = props.data,
10700
+ shopConfigStyle = props.shopConfigStyle,
10701
+ _props$SectionTitle = props.SectionTitle,
10702
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10703
+ var sectionData = data === null || data === void 0 ? void 0 : data.data;
10704
+ var _useState = useState(0),
10705
+ currentSlide = _useState[0],
10706
+ setCurrentSlide = _useState[1];
10707
+ function RenderArrow(props) {
10708
+ var className = props.className,
10709
+ style = props.style,
10710
+ onClick = props.onClick;
10711
+ return /*#__PURE__*/React__default.createElement("div", {
10712
+ className: className,
10713
+ style: _extends({}, style, {
10714
+ display: "none"
10715
+ }),
10716
+ onClick: onClick
10717
+ });
10718
+ }
10719
+ return /*#__PURE__*/React__default.createElement("div", {
10720
+ className: "" + SECTION_DEFAULT_CLASS
10721
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10722
+ data: data,
10723
+ shopConfigStyle: shopConfigStyle
10724
+ }), /*#__PURE__*/React__default.createElement(Slider, {
10725
+ className: "center",
10726
+ infinite: false,
10727
+ slidesToShow: 2,
10728
+ speed: 500,
10729
+ autoplay: true,
10730
+ autoplaySpeed: 4000,
10731
+ pauseOnHover: true,
10732
+ nextArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
10733
+ prevArrow: /*#__PURE__*/React__default.createElement(RenderArrow, null),
10734
+ beforeChange: function beforeChange(oldIndex, newIndex) {
10735
+ return setCurrentSlide(newIndex);
10736
+ },
10737
+ dots: true,
10738
+ customPaging: function customPaging(i) {
10739
+ return i === currentSlide ? /*#__PURE__*/React__default.createElement("div", {
10740
+ className: "w-4 h-1 rounded-full bg-primary mt-4"
10741
+ }) : /*#__PURE__*/React__default.createElement("div", {
10742
+ className: "w-4 h-1 rounded-full bg-gray-300 mt-4"
10743
+ });
10744
+ },
10745
+ centerPadding: "20px",
10746
+ responsive: [{
10747
+ breakpoint: 600,
10748
+ settings: {
10749
+ slidesToShow: 1
10750
+ }
10751
+ }]
10752
+ }, (sectionData === null || sectionData === void 0 ? void 0 : sectionData.length) > 0 && (sectionData === null || sectionData === void 0 ? void 0 : sectionData.map(function (item, index) {
10753
+ return /*#__PURE__*/React__default.createElement("div", {
10754
+ className: 'px-2'
10755
+ }, /*#__PURE__*/React__default.createElement("img", {
10756
+ src: item === null || item === void 0 ? void 0 : item.srcImage,
10757
+ alt: "",
10758
+ className: "rounded-2xl",
10759
+ key: index
10760
+ }));
10761
+ }))));
10762
+ };
10763
+
10736
10764
  var Banner3 = function Banner3(props) {
10737
10765
  var data = props.data;
10738
10766
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
@@ -10746,6 +10774,36 @@ var Banner3 = function Banner3(props) {
10746
10774
  }));
10747
10775
  };
10748
10776
 
10777
+ var Banner7 = function Banner7(props) {
10778
+ var _data$data;
10779
+ var _props$shopConfigStyl = props.shopConfigStyle,
10780
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
10781
+ _props$data = props.data,
10782
+ data = _props$data === void 0 ? {} : _props$data,
10783
+ _props$SectionTitle = props.SectionTitle,
10784
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
10785
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
10786
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
10787
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
10788
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
10789
+ className: "" + SECTION_DEFAULT_CLASS
10790
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
10791
+ data: data,
10792
+ shopConfigStyle: shopConfigStyle
10793
+ }), /*#__PURE__*/React__default.createElement("div", {
10794
+ className: "mt-6 grid grid-cols-2 md:grid-cols-4 gap-1 md:gap-2"
10795
+ }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
10796
+ var _it$srcImages;
10797
+ return /*#__PURE__*/React__default.createElement("div", {
10798
+ key: index
10799
+ }, /*#__PURE__*/React__default.createElement("img", {
10800
+ src: it === null || it === void 0 ? void 0 : (_it$srcImages = it.srcImages) === null || _it$srcImages === void 0 ? void 0 : _it$srcImages[0]
10801
+ }));
10802
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
10803
+ color: secondary
10804
+ }));
10805
+ };
10806
+
10749
10807
  var BannerFull1 = function BannerFull1(props) {
10750
10808
  var data = props.data;
10751
10809
  var sectionData = data === null || data === void 0 ? void 0 : data.data;
@@ -12747,5 +12805,81 @@ var ShopHighlights6 = function ShopHighlights6(props) {
12747
12805
  }));
12748
12806
  };
12749
12807
 
12750
- export { About1, About5, Address1, Banner1, Banner3, BannerFull1, BannerFull2, Booking1, BookingForm6, Breadcrumb1, Button, Carts1, Contact1, CustomerRating1, CustomerRating10, CustomerRating5, CustomerRating6, DateTimePicker, Employees1, Features1, Features2, Features3, Footer1, Footer7, Gallery1, Hero1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Hero2, Hero5, Hero6, Input, InputPhoneNumber, Links1, ModalNotification, NavBar1, NavBar7, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductHighlight1, ProductHot1, ProductHot3, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductItem7, ProductList5, ProductSale2, ProductSearch1, Products1, Products10, Products2, Products3, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, TextArea, TreatmentDetail1, TreatmentItem1, Treatments1, Treatments1$1 as Treatments2, TreatmentsList6 };
12808
+ var ShopHighlights7 = function ShopHighlights7(props) {
12809
+ var _data$data;
12810
+ var _props$shopConfigStyl = props.shopConfigStyle,
12811
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
12812
+ _props$data = props.data,
12813
+ data = _props$data === void 0 ? {} : _props$data,
12814
+ _props$SectionTitle = props.SectionTitle,
12815
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
12816
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
12817
+ _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
12818
+ secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
12819
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
12820
+ className: SECTION_DEFAULT_CLASS + " relative"
12821
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
12822
+ data: data
12823
+ }), /*#__PURE__*/React__default.createElement("div", {
12824
+ className: "mt-6 grid grid-cols-3 gap-4 md:gap-8"
12825
+ }, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (it, index) {
12826
+ return /*#__PURE__*/React__default.createElement("div", {
12827
+ key: index,
12828
+ className: "pt-6 col-span-3 md:col-span-1"
12829
+ }, /*#__PURE__*/React__default.createElement("div", {
12830
+ className: "relative w-40 h-24 flex items-center justify-center m-auto md:m-0"
12831
+ }, /*#__PURE__*/React__default.createElement("div", {
12832
+ className: "absolute w-40 h-24 rounded-2xl z-10 bg-primary"
12833
+ }), /*#__PURE__*/React__default.createElement("div", {
12834
+ className: "absolute w-24 h-16 rounded-2xl -right-2 -top-2 z-0 bg-secondary"
12835
+ }), it !== null && it !== void 0 && it.svgImage ? /*#__PURE__*/React__default.createElement("div", {
12836
+ className: "w-12 text-primary h-16 w-16 z-20 m-auto"
12837
+ }, /*#__PURE__*/React__default.createElement("div", {
12838
+ dangerouslySetInnerHTML: {
12839
+ __html: configSvg(it === null || it === void 0 ? void 0 : it.svgImage)
12840
+ }
12841
+ })) : /*#__PURE__*/React__default.createElement("div", {
12842
+ className: "h-16 m-auto bg-center w-16 bg-cover bg-no-repeat z-20",
12843
+ style: {
12844
+ backgroundImage: "url(" + it.srcImage + ")"
12845
+ }
12846
+ })), /*#__PURE__*/React__default.createElement("p", {
12847
+ className: "mx-auto md:mt-3 md:mx-0 text-xl py-2 font-medium w-fit rounded-lg"
12848
+ }, it.title), /*#__PURE__*/React__default.createElement("div", {
12849
+ className: "mx-auto md:mx-0 mb-2 w-28 h-2px rounded-full bg-secondary"
12850
+ }), /*#__PURE__*/React__default.createElement("p", {
12851
+ className: "text-base mx-auto md:mx-0 text-center md:text-start"
12852
+ }, it.description));
12853
+ }))), /*#__PURE__*/React__default.createElement(Dash, {
12854
+ color: secondary
12855
+ }));
12856
+ };
12857
+
12858
+ var VideoFull1 = function VideoFull1(props) {
12859
+ var _data$data, _data$data$;
12860
+ var shopConfigStyle = props.shopConfigStyle,
12861
+ data = props.data,
12862
+ _props$SectionTitle = props.SectionTitle,
12863
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
12864
+ console.log("VideoFull1 data", data);
12865
+ var youtubeVideoId = getYoutubeVideoIdByUrl(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$.link);
12866
+ console.log("VideoFull1 youtubeVideoId", youtubeVideoId);
12867
+ return /*#__PURE__*/React__default.createElement("div", {
12868
+ className: "" + SECTION_DEFAULT_CLASS
12869
+ }, /*#__PURE__*/React__default.createElement(SectionTitle, {
12870
+ data: data,
12871
+ shopConfigStyle: shopConfigStyle
12872
+ }), youtubeVideoId ? /*#__PURE__*/React__default.createElement("div", {
12873
+ className: "w-full aspect-video"
12874
+ }, /*#__PURE__*/React__default.createElement("iframe", {
12875
+ className: "w-full h-full",
12876
+ src: "https://www.youtube.com/embed/" + youtubeVideoId,
12877
+ title: "YouTube video player",
12878
+ frameBorder: "0",
12879
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
12880
+ allowFullScreen: true
12881
+ })) : null);
12882
+ };
12883
+
12884
+ 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, PageTitle1, Partner1, ProductCategory2, ProductDetail10, ProductHighlight1, ProductHot1, ProductHot3, ProductItem2, ProductItem3, ProductItem4, ProductItem5, ProductItem6, ProductItem7, ProductList5, ProductSale2, ProductSearch1, Products10, Products2, Products3, ProductsList7, ProductsTop1, SearchBar2, SearchBar5, SearchBar6, SearchProduct1, SectionTitle1, SectionTitle2, SectionTitle3, Select$1 as Select, ServiceDetail1, ShopHighlights2, ShopHighlights5, ShopHighlights6, ShopHighlights7, TextArea, TreatmentDetail1, TreatmentItem1, TreatmentsCategory7, TreatmentsList6, TreatmentsList7, VideoFull1 };
12751
12885
  //# sourceMappingURL=index.modern.js.map