s-platform-landing-section 0.1.10-alpha.16 → 0.1.10-alpha.17

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,7 +1,7 @@
1
1
  import React__default, { useState, useRef, useEffect, createElement, forwardRef, useImperativeHandle, memo } from 'react';
2
2
  import { IoCartOutline, IoChevronDownOutline, IoInformationCircleOutline, IoLogOutOutline, IoLocationOutline, IoChevronBackOutline, IoChevronForwardOutline, IoCallOutline } from 'react-icons/io5';
3
3
  import { FaUserCircle, FaPhone, FaChevronLeft, FaChevronRight, FaAngleUp, FaAngleDown, FaCheckCircle, FaArrowLeft, FaArrowRight as FaArrowRight$1, FaFacebookSquare, FaFacebookMessenger, FaFacebookF } from 'react-icons/fa';
4
- import { FiMenu } from 'react-icons/fi';
4
+ import { FiMenu, FiSearch } from 'react-icons/fi';
5
5
  import { RxCross2 } from 'react-icons/rx';
6
6
  import { PiHandbagSimpleLight } from 'react-icons/pi';
7
7
  import { CiSearch } from 'react-icons/ci';
@@ -128,6 +128,7 @@ var LinkToPage = function LinkToPage(props) {
128
128
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
129
129
  return Link ? /*#__PURE__*/React__default.createElement(Link, otherProps, props.children) : /*#__PURE__*/React__default.createElement("a", otherProps, props.children);
130
130
  };
131
+ var SSHOP_SPA_TOKEN = "sshop-spa-token";
131
132
 
132
133
  var Options = function Options(props) {
133
134
  var _props$className = props.className,
@@ -213,15 +214,17 @@ var NavBar7 = function NavBar7(props) {
213
214
  _props$logout = props.logout,
214
215
  logout = _props$logout === void 0 ? function () {} : _props$logout;
215
216
  var cartItems = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
216
- return state.cart.items;
217
+ var _state$cart;
218
+ return state === null || state === void 0 ? void 0 : (_state$cart = state.cart) === null || _state$cart === void 0 ? void 0 : _state$cart.items;
217
219
  });
218
220
  var userInfo = useSelector === null || useSelector === void 0 ? void 0 : useSelector(function (state) {
219
- return state.user.info;
221
+ var _state$user;
222
+ return state === null || state === void 0 ? void 0 : (_state$user = state.user) === null || _state$user === void 0 ? void 0 : _state$user.info;
220
223
  });
221
224
  var _useState2 = useState(""),
222
225
  totalItem = _useState2[0],
223
226
  setTotalItem = _useState2[1];
224
- var profileRoute = (_routes$find = routes.find(function (e) {
227
+ var profileRoute = routes === null || routes === void 0 ? void 0 : (_routes$find = routes.find(function (e) {
225
228
  return (e === null || e === void 0 ? void 0 : e.name) === "profile";
226
229
  })) === null || _routes$find === void 0 ? void 0 : _routes$find.route;
227
230
  var profileOptions = [{
@@ -241,8 +244,8 @@ var NavBar7 = function NavBar7(props) {
241
244
  }];
242
245
  useEffect(function () {
243
246
  console.log("NavBar7 cartItems", cartItems);
244
- var totalItem = cartItems.reduce(function (total, item) {
245
- return total + item.quantity;
247
+ var totalItem = cartItems === null || cartItems === void 0 ? void 0 : cartItems.reduce(function (total, item) {
248
+ return total + (item === null || item === void 0 ? void 0 : item.quantity);
246
249
  }, 0);
247
250
  if (totalItem > 9) {
248
251
  totalItem = "9+";
@@ -288,7 +291,7 @@ var NavBar7 = function NavBar7(props) {
288
291
  }, (item === null || item === void 0 ? void 0 : item.name) === (route === null || route === void 0 ? void 0 : route.name) ? /*#__PURE__*/React__default.createElement("div", {
289
292
  className: "py-1 border-b text-textHeading border-textHeading"
290
293
  }, item === null || item === void 0 ? void 0 : item.label) : /*#__PURE__*/React__default.createElement("div", {
291
- className: "py-1"
294
+ className: "py-1 text-textBody"
292
295
  }, item === null || item === void 0 ? void 0 : item.label));
293
296
  })), cart(), userInfo ?
294
297
  /*#__PURE__*/
@@ -7107,10 +7110,32 @@ var ProductController = function ProductController(props) {
7107
7110
  return Promise.reject(e);
7108
7111
  }
7109
7112
  };
7113
+ var getProductListSearch = function getProductListSearch(data) {
7114
+ try {
7115
+ return Promise.resolve(_catch(function () {
7116
+ setLoading(true);
7117
+ var filterParams = _extends({}, defaultParams, data);
7118
+ return Promise.resolve(getProductListApi(shopConfig === null || shopConfig === void 0 ? void 0 : shopConfig.shopId, filterParams)).then(function (res) {
7119
+ var _res$data4, _res$data4$status;
7120
+ if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$status = _res$data4.status) === null || _res$data4$status === void 0 ? void 0 : _res$data4$status.code) == 200) {
7121
+ var _res$data5;
7122
+ setLoading(false);
7123
+ return res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.data;
7124
+ }
7125
+ setLoading(false);
7126
+ });
7127
+ }, function (e) {
7128
+ console.log(e);
7129
+ }));
7130
+ } catch (e) {
7131
+ return Promise.reject(e);
7132
+ }
7133
+ };
7110
7134
  return {
7111
7135
  products: products,
7112
7136
  loading: loading,
7113
- page: page
7137
+ page: page,
7138
+ getProductListSearch: getProductListSearch
7114
7139
  };
7115
7140
  };
7116
7141
 
@@ -7293,12 +7318,13 @@ var BookingController = function BookingController(props) {
7293
7318
  var createSchedule = function createSchedule(customerName, customerPhone, scheduleDate, services, shopId) {
7294
7319
  try {
7295
7320
  return Promise.resolve(_catch(function () {
7321
+ var _Date;
7296
7322
  var data = {
7297
7323
  appId: "SSPA",
7298
7324
  customerName: customerName,
7299
- customerPhone: customerPhone.replace("+", ""),
7325
+ customerPhone: customerPhone === null || customerPhone === void 0 ? void 0 : customerPhone.replace("+", ""),
7300
7326
  isSellService: true,
7301
- scheduleDate: new Date(scheduleDate).getTime(),
7327
+ scheduleDate: (_Date = new Date(scheduleDate)) === null || _Date === void 0 ? void 0 : _Date.getTime(),
7302
7328
  services: services === null || services === void 0 ? void 0 : services.map(function (_ref) {
7303
7329
  var productName = _ref.productName,
7304
7330
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
@@ -7334,6 +7360,8 @@ var Input = forwardRef(function (props, ref) {
7334
7360
  labelClassName = _props$labelClassName === void 0 ? "" : _props$labelClassName,
7335
7361
  _props$name = props.name,
7336
7362
  name = _props$name === void 0 ? "" : _props$name,
7363
+ _props$style = props.style,
7364
+ style = _props$style === void 0 ? {} : _props$style,
7337
7365
  _props$onChange = props.onChange,
7338
7366
  onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
7339
7367
  _props$defaultValue = props.defaultValue,
@@ -7423,7 +7451,7 @@ var Input = forwardRef(function (props, ref) {
7423
7451
  setTypeInput("text");
7424
7452
  }
7425
7453
  };
7426
- var _className = "h-10 py-1 px-2 border border-stroke rounded " + className;
7454
+ var _className = "h-10 py-1 px-2 border border-stroke rounded-lg " + className;
7427
7455
  var _inputClassName = (isQuantity ? "text-center w-12" : "") + " focus:outline-none focus:ring-0 " + inputClassName;
7428
7456
  var required = !!(rules !== null && rules !== void 0 && rules.find(function (e) {
7429
7457
  return (e === null || e === void 0 ? void 0 : e.type) === "required";
@@ -7436,7 +7464,8 @@ var Input = forwardRef(function (props, ref) {
7436
7464
  }, label ? /*#__PURE__*/React__default.createElement("div", {
7437
7465
  className: "mb-1 " + labelClassName
7438
7466
  }, label, labelRequired) : null, /*#__PURE__*/React__default.createElement("div", {
7439
- className: "flex gap-2 " + _className
7467
+ className: "flex gap-2 " + _className,
7468
+ style: style
7440
7469
  }, isQuantity ? /*#__PURE__*/React__default.createElement("button", {
7441
7470
  onClick: function onClick() {
7442
7471
  return changeQuantity(-1);
@@ -7759,7 +7788,7 @@ var DateTimePicker = forwardRef(function (props, ref) {
7759
7788
  });
7760
7789
  var _validateData = function _validateData() {
7761
7790
  var count = 0;
7762
- rules.forEach(function (e) {
7791
+ rules === null || rules === void 0 ? void 0 : rules.forEach(function (e) {
7763
7792
  var _e$pattern;
7764
7793
  if ((e === null || e === void 0 ? void 0 : e.type) === 'required' && value === '') {
7765
7794
  _setError(e === null || e === void 0 ? void 0 : e.message);
@@ -7961,6 +7990,147 @@ var dayjs_min = createCommonjsModule(function (module, exports) {
7961
7990
  !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}));
7962
7991
  });
7963
7992
 
7993
+ var js_cookie = createCommonjsModule(function (module, exports) {
7994
+ (function (global, factory) {
7995
+ module.exports = factory() ;
7996
+ })(commonjsGlobal, (function () {
7997
+ /* eslint-disable no-var */
7998
+ function assign (target) {
7999
+ for (var i = 1; i < arguments.length; i++) {
8000
+ var source = arguments[i];
8001
+ for (var key in source) {
8002
+ target[key] = source[key];
8003
+ }
8004
+ }
8005
+ return target
8006
+ }
8007
+ /* eslint-enable no-var */
8008
+
8009
+ /* eslint-disable no-var */
8010
+ var defaultConverter = {
8011
+ read: function (value) {
8012
+ if (value[0] === '"') {
8013
+ value = value.slice(1, -1);
8014
+ }
8015
+ return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
8016
+ },
8017
+ write: function (value) {
8018
+ return encodeURIComponent(value).replace(
8019
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
8020
+ decodeURIComponent
8021
+ )
8022
+ }
8023
+ };
8024
+ /* eslint-enable no-var */
8025
+
8026
+ /* eslint-disable no-var */
8027
+
8028
+ function init (converter, defaultAttributes) {
8029
+ function set (name, value, attributes) {
8030
+ if (typeof document === 'undefined') {
8031
+ return
8032
+ }
8033
+
8034
+ attributes = assign({}, defaultAttributes, attributes);
8035
+
8036
+ if (typeof attributes.expires === 'number') {
8037
+ attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
8038
+ }
8039
+ if (attributes.expires) {
8040
+ attributes.expires = attributes.expires.toUTCString();
8041
+ }
8042
+
8043
+ name = encodeURIComponent(name)
8044
+ .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
8045
+ .replace(/[()]/g, escape);
8046
+
8047
+ var stringifiedAttributes = '';
8048
+ for (var attributeName in attributes) {
8049
+ if (!attributes[attributeName]) {
8050
+ continue
8051
+ }
8052
+
8053
+ stringifiedAttributes += '; ' + attributeName;
8054
+
8055
+ if (attributes[attributeName] === true) {
8056
+ continue
8057
+ }
8058
+
8059
+ // Considers RFC 6265 section 5.2:
8060
+ // ...
8061
+ // 3. If the remaining unparsed-attributes contains a %x3B (";")
8062
+ // character:
8063
+ // Consume the characters of the unparsed-attributes up to,
8064
+ // not including, the first %x3B (";") character.
8065
+ // ...
8066
+ stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
8067
+ }
8068
+
8069
+ return (document.cookie =
8070
+ name + '=' + converter.write(value, name) + stringifiedAttributes)
8071
+ }
8072
+
8073
+ function get (name) {
8074
+ if (typeof document === 'undefined' || (arguments.length && !name)) {
8075
+ return
8076
+ }
8077
+
8078
+ // To prevent the for loop in the first place assign an empty array
8079
+ // in case there are no cookies at all.
8080
+ var cookies = document.cookie ? document.cookie.split('; ') : [];
8081
+ var jar = {};
8082
+ for (var i = 0; i < cookies.length; i++) {
8083
+ var parts = cookies[i].split('=');
8084
+ var value = parts.slice(1).join('=');
8085
+
8086
+ try {
8087
+ var found = decodeURIComponent(parts[0]);
8088
+ jar[found] = converter.read(value, found);
8089
+
8090
+ if (name === found) {
8091
+ break
8092
+ }
8093
+ } catch (e) {}
8094
+ }
8095
+
8096
+ return name ? jar[name] : jar
8097
+ }
8098
+
8099
+ return Object.create(
8100
+ {
8101
+ set,
8102
+ get,
8103
+ remove: function (name, attributes) {
8104
+ set(
8105
+ name,
8106
+ '',
8107
+ assign({}, attributes, {
8108
+ expires: -1
8109
+ })
8110
+ );
8111
+ },
8112
+ withAttributes: function (attributes) {
8113
+ return init(this.converter, assign({}, this.attributes, attributes))
8114
+ },
8115
+ withConverter: function (converter) {
8116
+ return init(assign({}, this.converter, converter), this.attributes)
8117
+ }
8118
+ },
8119
+ {
8120
+ attributes: { value: Object.freeze(defaultAttributes) },
8121
+ converter: { value: Object.freeze(converter) }
8122
+ }
8123
+ )
8124
+ }
8125
+
8126
+ var api = init(defaultConverter, { path: '/' });
8127
+ /* eslint-enable no-var */
8128
+
8129
+ return api;
8130
+
8131
+ }));
8132
+ });
8133
+
7964
8134
  var BookingForm = function BookingForm(props) {
7965
8135
  var _props$shopConfig = props.shopConfig,
7966
8136
  shopConfig = _props$shopConfig === void 0 ? {} : _props$shopConfig,
@@ -8004,6 +8174,10 @@ var BookingForm = function BookingForm(props) {
8004
8174
  var _EmployeeController = EmployeeController(_extends({}, props)),
8005
8175
  _EmployeeController$l = _EmployeeController.listEmployment,
8006
8176
  listEmployment = _EmployeeController$l === void 0 ? [] : _EmployeeController$l;
8177
+ var token = js_cookie === null || js_cookie === void 0 ? void 0 : js_cookie.get(SSHOP_SPA_TOKEN);
8178
+ useEffect(function () {
8179
+ console.log("check kkkkk", token, token > 0);
8180
+ }, [token]);
8007
8181
  var _ProductController = ProductController(_extends({}, props, {
8008
8182
  params: productsParams
8009
8183
  })),
@@ -8280,7 +8454,7 @@ var BookingForm = function BookingForm(props) {
8280
8454
  onCloseFormBooking: onCloseFormBooking,
8281
8455
  onClose: handleClosePopup
8282
8456
  }, /*#__PURE__*/React__default.createElement("div", {
8283
- className: "bg-white rounded-lg shadow-lg p-6 max-w-sm text-center md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
8457
+ className: "bg-white rounded-lg shadow-lg p-6 max-w-sm flex flex-col items-center justify-center min-w-[320px] md:min-w-[650px] min-h-[420px] md:min-h-[380px] lg:h-auto "
8284
8458
  }, /*#__PURE__*/React__default.createElement("div", {
8285
8459
  className: "h-20 mb-4 flex items-center justify-center"
8286
8460
  }, /*#__PURE__*/React__default.createElement(FaCheckCircle, {
@@ -8294,12 +8468,14 @@ var BookingForm = function BookingForm(props) {
8294
8468
  className: "mb-2"
8295
8469
  }, "S\u1ED1 \u0111i\u1EC7n tho\u1EA1i: ", dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.customerPhone), /*#__PURE__*/React__default.createElement("div", {
8296
8470
  className: "mb-4"
8297
- }, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), /*#__PURE__*/React__default.createElement("p", {
8298
- className: "mb-4"
8471
+ }, "Th\u1EDDi gian: ", dayjs_min(dataBooking === null || dataBooking === void 0 ? void 0 : dataBooking.scheduleDate).format("DD/MM/YYYY")), token ? /*#__PURE__*/React__default.createElement("div", null) : /*#__PURE__*/React__default.createElement("div", {
8472
+ className: "flex flex-col items-center"
8473
+ }, /*#__PURE__*/React__default.createElement("p", {
8474
+ className: "mb-4 text-center"
8299
8475
  }, "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, {
8300
8476
  label: "Đăng nhập",
8301
8477
  shopConfigStyle: shopConfigStyle
8302
- }))));
8478
+ })))));
8303
8479
  };
8304
8480
 
8305
8481
  var Treatments1 = function Treatments1(props) {
@@ -8765,8 +8941,11 @@ var ServiceDetail1 = function ServiceDetail1(props) {
8765
8941
  };
8766
8942
 
8767
8943
  var ProductItem2 = function ProductItem2(props) {
8768
- var product = props.product;
8769
- return /*#__PURE__*/React__default.createElement("a", {
8944
+ var product = props.product,
8945
+ _props$Link = props.Link,
8946
+ Link = _props$Link === void 0 ? null : _props$Link;
8947
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
8948
+ Link: Link,
8770
8949
  href: getLinkProductDetail(product)
8771
8950
  }, /*#__PURE__*/React__default.createElement("div", {
8772
8951
  className: "text-center relative group"
@@ -8787,7 +8966,9 @@ var Products1 = function Products1(props) {
8787
8966
  _props$data = props.data,
8788
8967
  data = _props$data === void 0 ? {} : _props$data,
8789
8968
  _props$SectionTitle = props.SectionTitle,
8790
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
8969
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
8970
+ _props$Link = props.Link,
8971
+ Link = _props$Link === void 0 ? null : _props$Link;
8791
8972
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
8792
8973
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
8793
8974
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -8810,6 +8991,7 @@ var Products1 = function Products1(props) {
8810
8991
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
8811
8992
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
8812
8993
  return /*#__PURE__*/React__default.createElement(ProductItem2, {
8994
+ Link: Link,
8813
8995
  key: index,
8814
8996
  product: product === null || product === void 0 ? void 0 : product.productInfo
8815
8997
  });
@@ -9008,7 +9190,9 @@ var Products3 = function Products3(props) {
9008
9190
  _props$data = props.data,
9009
9191
  data = _props$data === void 0 ? {} : _props$data,
9010
9192
  _props$SectionTitle = props.SectionTitle,
9011
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9193
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9194
+ _props$Link = props.Link,
9195
+ Link = _props$Link === void 0 ? null : _props$Link;
9012
9196
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9013
9197
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9014
9198
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -9090,6 +9274,7 @@ var Products3 = function Products3(props) {
9090
9274
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-12 mt-12"
9091
9275
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9092
9276
  return /*#__PURE__*/React__default.createElement(ProductItem2, {
9277
+ Link: Link,
9093
9278
  key: index,
9094
9279
  product: product === null || product === void 0 ? void 0 : product.productInfo
9095
9280
  });
@@ -9302,7 +9487,9 @@ var ProductHot3 = function ProductHot3(props) {
9302
9487
  _props$data = props.data,
9303
9488
  data = _props$data === void 0 ? {} : _props$data,
9304
9489
  _props$SectionTitle = props.SectionTitle,
9305
- SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle;
9490
+ SectionTitle = _props$SectionTitle === void 0 ? null : _props$SectionTitle,
9491
+ _props$Link = props.Link,
9492
+ Link = _props$Link === void 0 ? null : _props$Link;
9306
9493
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
9307
9494
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.secondary,
9308
9495
  secondary = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -9326,6 +9513,7 @@ var ProductHot3 = function ProductHot3(props) {
9326
9513
  className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-10 mt-12"
9327
9514
  }, products === null || products === void 0 ? void 0 : products.map(function (product, index) {
9328
9515
  return /*#__PURE__*/React__default.createElement(ProductItem2, {
9516
+ Link: Link,
9329
9517
  key: index,
9330
9518
  product: product === null || product === void 0 ? void 0 : product.productInfo
9331
9519
  });
@@ -10073,7 +10261,7 @@ var PageTitle1 = function PageTitle1(props) {
10073
10261
  className: "relative w-full p-20 z-10 flex flex-col gap-6 items-center justify-center"
10074
10262
  }, /*#__PURE__*/React__default.createElement("div", {
10075
10263
  className: "text-3xl md:text-5xl text-white leading-[1.6] md:leading-[1.6] text-center font-headingFont"
10076
- }, route === null || route === void 0 ? void 0 : route.label)));
10264
+ }, sectionData !== null && sectionData !== void 0 && sectionData.sectionTitle ? sectionData === null || sectionData === void 0 ? void 0 : sectionData.sectionTitle : route === null || route === void 0 ? void 0 : route.label)));
10077
10265
  };
10078
10266
 
10079
10267
  var About5 = function About5(props) {
@@ -10143,7 +10331,9 @@ var Breadcrumb1 = function Breadcrumb1(props) {
10143
10331
  var shopConfigStyle = props.shopConfigStyle,
10144
10332
  route = props.route,
10145
10333
  _props$routes = props.routes,
10146
- routes = _props$routes === void 0 ? [] : _props$routes;
10334
+ routes = _props$routes === void 0 ? [] : _props$routes,
10335
+ _props$Link = props.Link,
10336
+ Link = _props$Link === void 0 ? null : _props$Link;
10147
10337
  var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
10148
10338
  _shopConfigStyle$colo3 = _shopConfigStyle$colo.textHeading,
10149
10339
  textHeading = _shopConfigStyle$colo3 === void 0 ? "#000" : _shopConfigStyle$colo3;
@@ -10154,18 +10344,21 @@ var Breadcrumb1 = function Breadcrumb1(props) {
10154
10344
  getItems();
10155
10345
  }, [route]);
10156
10346
  var getItems = function getItems() {
10157
- var _route$route, _route$route$split, _route$route$split$fi;
10347
+ var _route$route, _route$route$split, _route$route$split$fi, _items, _items2;
10158
10348
  var items = route === null || route === void 0 ? void 0 : (_route$route = route.route) === null || _route$route === void 0 ? void 0 : (_route$route$split = _route$route.split("/")) === null || _route$route$split === void 0 ? void 0 : (_route$route$split$fi = _route$route$split.filter(function (e) {
10159
10349
  return e === null || e === void 0 ? void 0 : e.length;
10160
10350
  })) === null || _route$route$split$fi === void 0 ? void 0 : _route$route$split$fi.slice(0, 2);
10161
- items = items.map(function (e) {
10351
+ items = (_items = items) === null || _items === void 0 ? void 0 : _items.map(function (e) {
10352
+ if (e === "product") {
10353
+ e = "products";
10354
+ }
10162
10355
  return (routes === null || routes === void 0 ? void 0 : routes.find(function (r) {
10163
10356
  return (r === null || r === void 0 ? void 0 : r.name) === e;
10164
10357
  })) || {
10165
10358
  label: e
10166
10359
  };
10167
10360
  });
10168
- items.unshift({
10361
+ (_items2 = items) === null || _items2 === void 0 ? void 0 : _items2.unshift({
10169
10362
  name: "home",
10170
10363
  label: "Trang chủ",
10171
10364
  route: "/"
@@ -10180,7 +10373,8 @@ var Breadcrumb1 = function Breadcrumb1(props) {
10180
10373
  className: "flex gap-2"
10181
10374
  }, index ? /*#__PURE__*/React__default.createElement("div", {
10182
10375
  className: "text-gray4"
10183
- }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement("a", {
10376
+ }, "/") : null, item !== null && item !== void 0 && item.route ? /*#__PURE__*/React__default.createElement(LinkToPage, {
10377
+ Link: Link,
10184
10378
  href: item === null || item === void 0 ? void 0 : item.route,
10185
10379
  style: {
10186
10380
  color: textHeading
@@ -11021,5 +11215,77 @@ var CartItem = function CartItem(props) {
11021
11215
  }, /*#__PURE__*/React__default.createElement(RiDeleteBin7Line, null), /*#__PURE__*/React__default.createElement("span", null, "X\xF3a"))));
11022
11216
  };
11023
11217
 
11024
- export { About5, Address1, Banner1, Booking1, Breadcrumb1, Button, Carts1, Contact1, CustomerRating10, DateTimePicker, Employees1, Features1, Features2, Features3, Footer1, Footer7, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Input, InputPhoneNumber, Links1, ModalNotification, NavBar7, PageTitle1, Partner1, ProductDetail10, ProductHot3, ProductSale2, Products1, Products10, Products2, Products3, ProductsTop1, SectionTitle1, Select$1 as Select, ServiceDetail1, TextArea, Treatments1, Treatments1$1 as Treatments2 };
11218
+ var SearchProduct1 = function SearchProduct1(props) {
11219
+ var _props$Link = props.Link,
11220
+ Link = _props$Link === void 0 ? null : _props$Link;
11221
+ var _props$shopConfigStyl = props.shopConfigStyle,
11222
+ shopConfigStyle = _props$shopConfigStyl === void 0 ? {} : _props$shopConfigStyl,
11223
+ data = props.data;
11224
+ var _shopConfigStyle$colo = shopConfigStyle === null || shopConfigStyle === void 0 ? void 0 : shopConfigStyle.color,
11225
+ _shopConfigStyle$colo6 = _shopConfigStyle$colo.bgSecondary,
11226
+ bgSecondary = _shopConfigStyle$colo6 === void 0 ? "#fffff" : _shopConfigStyle$colo6;
11227
+ var _useState = useState([]),
11228
+ listProducts = _useState[0],
11229
+ setListProducts = _useState[1];
11230
+ var _ProductController = ProductController(_extends({}, props)),
11231
+ getProductListSearch = _ProductController.getProductListSearch;
11232
+ var handleSearch = function handleSearch(productName) {
11233
+ try {
11234
+ var _temp = function () {
11235
+ if (productName) {
11236
+ return Promise.resolve(getProductListSearch({
11237
+ productName: productName
11238
+ })).then(function (data) {
11239
+ setListProducts(data);
11240
+ });
11241
+ } else {
11242
+ setListProducts([]);
11243
+ }
11244
+ }();
11245
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
11246
+ } catch (e) {
11247
+ return Promise.reject(e);
11248
+ }
11249
+ };
11250
+ return /*#__PURE__*/React__default.createElement("div", {
11251
+ className: "flex flex-col gap-2 w-[720px] rounded-lg mx-auto mt-12 "
11252
+ }, /*#__PURE__*/React__default.createElement(Input, {
11253
+ className: "flex items-center w-full h-14",
11254
+ style: {
11255
+ backgroundColor: bgSecondary
11256
+ },
11257
+ inputClassName: "w-full h-full p-2 text-lg",
11258
+ placeholder: (data === null || data === void 0 ? void 0 : data.sectionTitle) || "Tìm kiếm sản phẩm",
11259
+ onChange: handleSearch,
11260
+ icons: /*#__PURE__*/React__default.createElement("div", {
11261
+ className: "px-2"
11262
+ }, /*#__PURE__*/React__default.createElement(FiSearch, {
11263
+ style: {
11264
+ color: "#828282"
11265
+ }
11266
+ }))
11267
+ }), (listProducts === null || listProducts === void 0 ? void 0 : listProducts.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
11268
+ className: "max-h-64 overflow-y-auto flex flex-col gap-2 pr-3"
11269
+ }, listProducts === null || listProducts === void 0 ? void 0 : listProducts.map(function (item) {
11270
+ var _item$productInfo, _item$productInfo2;
11271
+ return /*#__PURE__*/React__default.createElement(LinkToPage, {
11272
+ Link: Link,
11273
+ href: getLinkProductDetail(item === null || item === void 0 ? void 0 : item.productInfo),
11274
+ className: "flex gap-2 text-Body"
11275
+ }, /*#__PURE__*/React__default.createElement(ProductImage, {
11276
+ product: item,
11277
+ className: "h-20 max-w-20 rounded-lg border"
11278
+ }), /*#__PURE__*/React__default.createElement("div", {
11279
+ className: "flex flex-col px-1 gap-2 border-b w-full"
11280
+ }, /*#__PURE__*/React__default.createElement("div", {
11281
+ className: "mt-1 text-lg font-medium\t"
11282
+ }, item === null || item === void 0 ? void 0 : (_item$productInfo = item.productInfo) === null || _item$productInfo === void 0 ? void 0 : _item$productInfo.productName), /*#__PURE__*/React__default.createElement("div", {
11283
+ className: " text-lg font-medium\t"
11284
+ }, formatCurrency(item === null || item === void 0 ? void 0 : (_item$productInfo2 = item.productInfo) === null || _item$productInfo2 === void 0 ? void 0 : _item$productInfo2.price))));
11285
+ })) : /*#__PURE__*/React__default.createElement("div", {
11286
+ className: "text-center"
11287
+ }, data === null || data === void 0 ? void 0 : data.sectionDescription));
11288
+ };
11289
+
11290
+ export { About5, Address1, Banner1, Booking1, Breadcrumb1, Button, Carts1, Contact1, CustomerRating10, DateTimePicker, Employees1, Features1, Features2, Features3, Footer1, Footer7, Gallery1, Hero10, Hero11, Hero11$1 as Hero12, Hero13, Input, InputPhoneNumber, Links1, ModalNotification, NavBar7, PageTitle1, Partner1, ProductDetail10, ProductHot3, ProductSale2, Products1, Products10, Products2, Products3, ProductsTop1, SearchProduct1, SectionTitle1, Select$1 as Select, ServiceDetail1, TextArea, Treatments1, Treatments1$1 as Treatments2 };
11025
11291
  //# sourceMappingURL=index.modern.js.map