favesalon-embed 0.0.4 → 0.1.0

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.
Files changed (241) hide show
  1. package/LICENSE +21 -0
  2. package/{cjs → dist/cjs}/_commonjsHelpers-5cfcba41.js +0 -0
  3. package/dist/cjs/colors-38421769.js +69 -0
  4. package/dist/cjs/favesalon-embed.cjs.js +20 -0
  5. package/{cjs → dist/cjs}/global-9073d10e.js +0 -0
  6. package/dist/cjs/google-map_5.cjs.entry.js +291 -0
  7. package/{cjs/index-48ac68d0.js → dist/cjs/index-7f190886.js} +1924 -0
  8. package/{cjs/index-d5de0b9d.js → dist/cjs/index-e6bea8f5.js} +10 -0
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/{cjs → dist/cjs}/salon-booking-modal.cjs.entry.js +5 -5
  12. package/{cjs → dist/cjs}/salon-booking.cjs.entry.js +6 -7
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/{cjs → dist/cjs}/salon-gift-card.cjs.entry.js +7 -7
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/{cjs/salon-lookbook_2.cjs.entry.js → dist/cjs/salon-lookbook.cjs.entry.js} +23 -57
  17. package/{cjs → dist/cjs}/salon-ranking.cjs.entry.js +7 -7
  18. package/dist/cjs/salon-reviews.cjs.entry.js +186 -0
  19. package/dist/cjs/salon-services.cjs.entry.js +78 -0
  20. package/dist/cjs/salon-stylists.cjs.entry.js +112 -0
  21. package/{cjs/services-f1102d4a.js → dist/cjs/services-eee8f251.js} +265 -393
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/dist/cjs/user-avatar.cjs.entry.js +41 -0
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -3
  26. package/dist/collection/components/google-map/assets/map--placeholder.jpeg +0 -0
  27. package/{collection → dist/collection}/components/google-map/index.css +0 -1
  28. package/dist/collection/components/google-map/index.js +86 -0
  29. package/{collection → dist/collection}/components/salon-booking/index.css +10 -24
  30. package/{collection → dist/collection}/components/salon-booking/index.js +3 -3
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +4 -4
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +4 -3
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +24 -3
  35. package/{collection/components/salon-locations → dist/collection/components/salon-info}/index.css +0 -0
  36. package/{collection → dist/collection}/components/salon-info/index.js +6 -32
  37. package/{collection → dist/collection}/components/salon-latest-reviews/index.css +0 -3
  38. package/dist/collection/components/salon-latest-reviews/index.js +176 -0
  39. package/dist/collection/components/salon-latest-styles/index.css +10 -0
  40. package/dist/collection/components/salon-latest-styles/index.js +178 -0
  41. package/{collection/components/salon-contact → dist/collection/components/salon-locations}/index.css +6 -6
  42. package/dist/collection/components/salon-locations/index.js +151 -0
  43. package/{collection → dist/collection}/components/salon-lookbook/index.css +0 -9
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +19 -19
  45. package/{collection → dist/collection}/components/salon-ranking/index.css +0 -0
  46. package/{collection → dist/collection}/components/salon-ranking/index.js +5 -5
  47. package/{collection → dist/collection}/components/salon-reviews/index.css +0 -0
  48. package/dist/collection/components/salon-reviews/index.js +286 -0
  49. package/dist/collection/components/salon-schedules/index.css +15 -0
  50. package/dist/collection/components/salon-schedules/index.js +189 -0
  51. package/{collection → dist/collection}/components/salon-services/index.css +0 -0
  52. package/{collection → dist/collection}/components/salon-services/index.js +51 -8
  53. package/{collection → dist/collection}/components/salon-stylists/index.css +0 -8
  54. package/dist/collection/components/salon-stylists/index.js +183 -0
  55. package/dist/collection/components/style-detail/index.css +62 -0
  56. package/dist/collection/components/style-detail/index.js +461 -0
  57. package/{collection → dist/collection}/components/user-avatar/index.css +0 -0
  58. package/{collection → dist/collection}/components/user-avatar/index.js +2 -2
  59. package/dist/collection/constants/colors.js +65 -0
  60. package/{collection → dist/collection}/global/global.js +0 -0
  61. package/{collection → dist/collection}/index.js +0 -0
  62. package/dist/collection/services/services.js +174 -0
  63. package/dist/collection/types/common.js +11 -0
  64. package/{collection → dist/collection}/types/review.js +9 -5
  65. package/dist/collection/types/salon.js +58 -0
  66. package/{collection → dist/collection}/types/service.js +0 -0
  67. package/dist/collection/types/style.js +128 -0
  68. package/{collection → dist/collection}/types/stylist.js +12 -9
  69. package/{favesalon-embed/index.esm.js → dist/collection/types/tmp.js} +0 -0
  70. package/{collection → dist/collection}/types/user.js +2 -2
  71. package/{collection → dist/collection}/utils/utils.js +0 -0
  72. package/{custom-elements → dist/custom-elements}/index.d.ts +12 -18
  73. package/{custom-elements → dist/custom-elements}/index.js +1227 -1035
  74. package/{esm → dist/esm}/_commonjsHelpers-098d5b27.js +0 -0
  75. package/dist/esm/colors-ea36347a.js +67 -0
  76. package/dist/esm/favesalon-embed.js +18 -0
  77. package/{esm → dist/esm}/global-e1089ffd.js +0 -0
  78. package/dist/esm/google-map_5.entry.js +283 -0
  79. package/{esm/index-0f8eed73.js → dist/esm/index-6af0a03d.js} +10 -1
  80. package/{esm/index-67d677ba.js → dist/esm/index-80523fec.js} +1924 -1
  81. package/{esm → dist/esm}/index.js +0 -0
  82. package/dist/esm/loader.js +18 -0
  83. package/{esm → dist/esm}/polyfills/core-js.js +0 -0
  84. package/{esm → dist/esm}/polyfills/css-shim.js +0 -0
  85. package/{esm → dist/esm}/polyfills/dom.js +0 -0
  86. package/{esm → dist/esm}/polyfills/es5-html-element.js +0 -0
  87. package/{esm → dist/esm}/polyfills/index.js +0 -0
  88. package/{esm → dist/esm}/polyfills/system.js +0 -0
  89. package/{esm → dist/esm}/salon-booking-modal.entry.js +5 -5
  90. package/{esm → dist/esm}/salon-booking.entry.js +5 -6
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/{esm → dist/esm}/salon-gift-card.entry.js +6 -6
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/{esm/salon-lookbook_2.entry.js → dist/esm/salon-lookbook.entry.js} +24 -57
  95. package/{esm → dist/esm}/salon-ranking.entry.js +7 -7
  96. package/dist/esm/salon-reviews.entry.js +182 -0
  97. package/dist/esm/salon-services.entry.js +74 -0
  98. package/dist/esm/salon-stylists.entry.js +108 -0
  99. package/{esm/services-74d84ca9.js → dist/esm/services-295247b1.js} +263 -392
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/dist/esm/user-avatar.entry.js +37 -0
  102. package/{esm → dist/esm}/utils-e97485e0.js +0 -0
  103. package/dist/favesalon-embed/assets/map--placeholder.jpeg +0 -0
  104. package/{favesalon-embed → dist/favesalon-embed}/favesalon-embed.css +1 -1
  105. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -0
  106. package/dist/favesalon-embed/index.esm.js +0 -0
  107. package/dist/favesalon-embed/p-292b97ba.entry.js +1 -0
  108. package/{favesalon-embed → dist/favesalon-embed}/p-47e646f8.js +0 -0
  109. package/dist/favesalon-embed/p-4869dfed.entry.js +1 -0
  110. package/{favesalon-embed → dist/favesalon-embed}/p-4a5eca9a.js +0 -0
  111. package/dist/favesalon-embed/p-4aee4fd9.entry.js +1 -0
  112. package/dist/favesalon-embed/p-5528c705.entry.js +1 -0
  113. package/dist/favesalon-embed/p-612ad685.entry.js +1 -0
  114. package/dist/favesalon-embed/p-75aef7e0.entry.js +1 -0
  115. package/dist/favesalon-embed/p-8c780874.entry.js +1 -0
  116. package/dist/favesalon-embed/p-8dbf04c5.js +1 -0
  117. package/dist/favesalon-embed/p-9f31061a.entry.js +1 -0
  118. package/dist/favesalon-embed/p-a33331cc.js +1 -0
  119. package/dist/favesalon-embed/p-a60d78e9.entry.js +1 -0
  120. package/dist/favesalon-embed/p-a6debdae.entry.js +1 -0
  121. package/dist/favesalon-embed/p-bad1e9a7.entry.js +1 -0
  122. package/dist/favesalon-embed/p-c2ecb365.js +1 -0
  123. package/dist/favesalon-embed/p-c7dea70c.entry.js +1 -0
  124. package/{favesalon-embed → dist/favesalon-embed}/p-d6083940.js +0 -0
  125. package/dist/favesalon-embed/p-f0e14641.entry.js +1 -0
  126. package/dist/favesalon-embed/p-fc9a5551.js +6 -0
  127. package/{index.cjs.js → dist/index.cjs.js} +0 -0
  128. package/{index.js → dist/index.js} +0 -0
  129. package/dist/types/components/google-map/index.d.ts +5 -0
  130. package/{types → dist/types}/components/salon-booking/index.d.ts +0 -0
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +0 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +0 -0
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +1 -0
  134. package/{types → dist/types}/components/salon-info/index.d.ts +0 -1
  135. package/{types → dist/types}/components/salon-latest-reviews/index.d.ts +2 -0
  136. package/dist/types/components/salon-latest-styles/index.d.ts +12 -0
  137. package/{types → dist/types}/components/salon-locations/index.d.ts +2 -0
  138. package/{types → dist/types}/components/salon-lookbook/index.d.ts +3 -3
  139. package/{types → dist/types}/components/salon-ranking/index.d.ts +0 -0
  140. package/dist/types/components/salon-reviews/index.d.ts +24 -0
  141. package/{types → dist/types}/components/salon-schedules/index.d.ts +2 -0
  142. package/{types → dist/types}/components/salon-services/index.d.ts +1 -0
  143. package/{types → dist/types}/components/salon-stylists/index.d.ts +6 -0
  144. package/dist/types/components/style-detail/index.d.ts +24 -0
  145. package/{types → dist/types}/components/user-avatar/index.d.ts +0 -0
  146. package/{types → dist/types}/components.d.ts +54 -59
  147. package/dist/types/constants/colors.d.ts +65 -0
  148. package/{types → dist/types}/index.d.ts +0 -0
  149. package/dist/types/services/services.d.ts +60 -0
  150. package/{types → dist/types}/stencil-public-runtime.d.ts +0 -0
  151. package/dist/types/types/common.d.ts +11 -0
  152. package/{types → dist/types}/types/review.d.ts +4 -0
  153. package/{types → dist/types}/types/salon.d.ts +3 -1
  154. package/{types → dist/types}/types/service.d.ts +0 -0
  155. package/dist/types/types/style.d.ts +88 -0
  156. package/{types → dist/types}/types/stylist.d.ts +1 -1
  157. package/dist/types/types/tmp.d.ts +0 -0
  158. package/{types → dist/types}/types/user.d.ts +2 -2
  159. package/{types → dist/types}/utils/utils.d.ts +0 -0
  160. package/loader/cdn.js +3 -0
  161. package/loader/index.cjs.js +3 -0
  162. package/loader/index.d.ts +12 -0
  163. package/loader/index.es2017.js +3 -0
  164. package/loader/index.js +4 -0
  165. package/loader/package.json +10 -0
  166. package/package.json +18 -13
  167. package/readme.md +24 -7
  168. package/cjs/colors-7f354880.js +0 -95
  169. package/cjs/favesalon-embed.cjs.js +0 -20
  170. package/cjs/google-map.cjs.entry.js +0 -47
  171. package/cjs/index-95daad08.js +0 -1928
  172. package/cjs/loader.cjs.js +0 -22
  173. package/cjs/salon-contact_4.cjs.entry.js +0 -155
  174. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -25
  175. package/cjs/salon-info.cjs.entry.js +0 -35
  176. package/cjs/salon-latest-reviews.cjs.entry.js +0 -58
  177. package/cjs/salon-lookbook-modal.cjs.entry.js +0 -141
  178. package/cjs/salon-reviews.cjs.entry.js +0 -205
  179. package/cjs/salon-services.cjs.entry.js +0 -47
  180. package/cjs/salon-stylists.cjs.entry.js +0 -54
  181. package/collection/components/google-map/index.js +0 -97
  182. package/collection/components/salon-contact/index.js +0 -88
  183. package/collection/components/salon-gift-card/index.css +0 -25
  184. package/collection/components/salon-info/index.css +0 -3
  185. package/collection/components/salon-latest-reviews/index.js +0 -108
  186. package/collection/components/salon-locations/index.js +0 -80
  187. package/collection/components/salon-lookbook/lookbook-modal.css +0 -72
  188. package/collection/components/salon-lookbook/salon-lookbook-modal.js +0 -248
  189. package/collection/components/salon-reviews/index.js +0 -317
  190. package/collection/components/salon-schedules/index.css +0 -14
  191. package/collection/components/salon-schedules/index.js +0 -103
  192. package/collection/components/salon-styles/index.css +0 -23
  193. package/collection/components/salon-styles/index.js +0 -100
  194. package/collection/components/salon-stylists/index.js +0 -96
  195. package/collection/constants/colors.js +0 -91
  196. package/collection/services/services.js +0 -225
  197. package/collection/types/common.js +0 -2
  198. package/collection/types/salon.js +0 -52
  199. package/collection/types/style.js +0 -103
  200. package/esm/colors-1ec90c5f.js +0 -93
  201. package/esm/favesalon-embed.js +0 -18
  202. package/esm/google-map.entry.js +0 -43
  203. package/esm/index-09d43e3e.js +0 -1926
  204. package/esm/loader.js +0 -18
  205. package/esm/salon-contact_4.entry.js +0 -148
  206. package/esm/salon-gift-card-modal.entry.js +0 -21
  207. package/esm/salon-info.entry.js +0 -31
  208. package/esm/salon-latest-reviews.entry.js +0 -54
  209. package/esm/salon-lookbook-modal.entry.js +0 -137
  210. package/esm/salon-reviews.entry.js +0 -201
  211. package/esm/salon-services.entry.js +0 -43
  212. package/esm/salon-stylists.entry.js +0 -50
  213. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  214. package/favesalon-embed/p-0188d4dc.entry.js +0 -1
  215. package/favesalon-embed/p-0318501e.js +0 -1
  216. package/favesalon-embed/p-078f242d.entry.js +0 -1
  217. package/favesalon-embed/p-13e23c61.entry.js +0 -1
  218. package/favesalon-embed/p-17df13ad.js +0 -1
  219. package/favesalon-embed/p-1a3179c8.entry.js +0 -1
  220. package/favesalon-embed/p-20aa75de.js +0 -6
  221. package/favesalon-embed/p-2901a6d6.entry.js +0 -1
  222. package/favesalon-embed/p-2b861430.entry.js +0 -1
  223. package/favesalon-embed/p-44d810a0.js +0 -1
  224. package/favesalon-embed/p-4c68700f.entry.js +0 -1
  225. package/favesalon-embed/p-4e2d7b29.js +0 -1
  226. package/favesalon-embed/p-6b845bf1.entry.js +0 -1
  227. package/favesalon-embed/p-7350f6b5.entry.js +0 -1
  228. package/favesalon-embed/p-897c2b1c.entry.js +0 -1
  229. package/favesalon-embed/p-8e60f56f.entry.js +0 -1
  230. package/favesalon-embed/p-a49afdc1.entry.js +0 -1
  231. package/favesalon-embed/p-c93867c4.entry.js +0 -1
  232. package/favesalon-embed/p-ea6a097f.entry.js +0 -1
  233. package/types/components/google-map/index.d.ts +0 -10
  234. package/types/components/salon-contact/index.d.ts +0 -9
  235. package/types/components/salon-lookbook/salon-lookbook-modal.d.ts +0 -13
  236. package/types/components/salon-reviews/index.d.ts +0 -24
  237. package/types/components/salon-styles/index.d.ts +0 -9
  238. package/types/constants/colors.d.ts +0 -88
  239. package/types/services/services.d.ts +0 -26
  240. package/types/types/common.d.ts +0 -2
  241. package/types/types/style.d.ts +0 -59
@@ -1,4 +1,5 @@
1
1
  import { c as commonjsGlobal, a as createCommonjsModule } from './_commonjsHelpers-098d5b27.js';
2
+ import { C as Colors } from './colors-ea36347a.js';
2
3
 
3
4
  /**
4
5
  * Appends the elements of `values` to `array`.
@@ -40,17 +41,17 @@ var Symbol = _root.Symbol;
40
41
  var _Symbol = Symbol;
41
42
 
42
43
  /** Used for built-in method references. */
43
- var objectProto$c = Object.prototype;
44
+ var objectProto$b = Object.prototype;
44
45
 
45
46
  /** Used to check objects for own properties. */
46
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
47
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
47
48
 
48
49
  /**
49
50
  * Used to resolve the
50
51
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
51
52
  * of values.
52
53
  */
53
- var nativeObjectToString$1 = objectProto$c.toString;
54
+ var nativeObjectToString$1 = objectProto$b.toString;
54
55
 
55
56
  /** Built-in value references. */
56
57
  var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
@@ -63,7 +64,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
63
64
  * @returns {string} Returns the raw `toStringTag`.
64
65
  */
65
66
  function getRawTag(value) {
66
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
67
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
67
68
  tag = value[symToStringTag$1];
68
69
 
69
70
  try {
@@ -85,14 +86,14 @@ function getRawTag(value) {
85
86
  var _getRawTag = getRawTag;
86
87
 
87
88
  /** Used for built-in method references. */
88
- var objectProto$b = Object.prototype;
89
+ var objectProto$a = Object.prototype;
89
90
 
90
91
  /**
91
92
  * Used to resolve the
92
93
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
93
94
  * of values.
94
95
  */
95
- var nativeObjectToString = objectProto$b.toString;
96
+ var nativeObjectToString = objectProto$a.toString;
96
97
 
97
98
  /**
98
99
  * Converts `value` to a string using `Object.prototype.toString`.
@@ -179,13 +180,13 @@ function baseIsArguments(value) {
179
180
  var _baseIsArguments = baseIsArguments;
180
181
 
181
182
  /** Used for built-in method references. */
182
- var objectProto$a = Object.prototype;
183
+ var objectProto$9 = Object.prototype;
183
184
 
184
185
  /** Used to check objects for own properties. */
185
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
186
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
186
187
 
187
188
  /** Built-in value references. */
188
- var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
189
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
189
190
 
190
191
  /**
191
192
  * Checks if `value` is likely an `arguments` object.
@@ -206,7 +207,7 @@ var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
206
207
  * // => false
207
208
  */
208
209
  var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
209
- return isObjectLike_1(value) && hasOwnProperty$8.call(value, 'callee') &&
210
+ return isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
210
211
  !propertyIsEnumerable$1.call(value, 'callee');
211
212
  };
212
213
 
@@ -497,17 +498,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
497
498
 
498
499
  /** Used for built-in method references. */
499
500
  var funcProto = Function.prototype,
500
- objectProto$9 = Object.prototype;
501
+ objectProto$8 = Object.prototype;
501
502
 
502
503
  /** Used to resolve the decompiled source of functions. */
503
504
  var funcToString = funcProto.toString;
504
505
 
505
506
  /** Used to check objects for own properties. */
506
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
507
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
507
508
 
508
509
  /** Used to detect if a method is native. */
509
510
  var reIsNative = RegExp('^' +
510
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
511
+ funcToString.call(hasOwnProperty$6).replace(reRegExpChar, '\\$&')
511
512
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
512
513
  );
513
514
 
@@ -599,10 +600,10 @@ var _hashDelete = hashDelete;
599
600
  var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
600
601
 
601
602
  /** Used for built-in method references. */
602
- var objectProto$8 = Object.prototype;
603
+ var objectProto$7 = Object.prototype;
603
604
 
604
605
  /** Used to check objects for own properties. */
605
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
606
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
606
607
 
607
608
  /**
608
609
  * Gets the hash value for `key`.
@@ -619,16 +620,16 @@ function hashGet(key) {
619
620
  var result = data[key];
620
621
  return result === HASH_UNDEFINED$2 ? undefined : result;
621
622
  }
622
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
623
+ return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
623
624
  }
624
625
 
625
626
  var _hashGet = hashGet;
626
627
 
627
628
  /** Used for built-in method references. */
628
- var objectProto$7 = Object.prototype;
629
+ var objectProto$6 = Object.prototype;
629
630
 
630
631
  /** Used to check objects for own properties. */
631
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
632
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
632
633
 
633
634
  /**
634
635
  * Checks if a hash value for `key` exists.
@@ -641,7 +642,7 @@ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
641
642
  */
642
643
  function hashHas(key) {
643
644
  var data = this.__data__;
644
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
645
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
645
646
  }
646
647
 
647
648
  var _hashHas = hashHas;
@@ -1790,10 +1791,10 @@ function stubArray() {
1790
1791
  var stubArray_1 = stubArray;
1791
1792
 
1792
1793
  /** Used for built-in method references. */
1793
- var objectProto$6 = Object.prototype;
1794
+ var objectProto$5 = Object.prototype;
1794
1795
 
1795
1796
  /** Built-in value references. */
1796
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
1797
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
1797
1798
 
1798
1799
  /* Built-in method references for those with the same name as other `lodash` methods. */
1799
1800
  var nativeGetSymbols = Object.getOwnPropertySymbols;
@@ -2085,10 +2086,10 @@ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsType
2085
2086
  var isTypedArray_1 = isTypedArray;
2086
2087
 
2087
2088
  /** Used for built-in method references. */
2088
- var objectProto$5 = Object.prototype;
2089
+ var objectProto$4 = Object.prototype;
2089
2090
 
2090
2091
  /** Used to check objects for own properties. */
2091
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
2092
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
2092
2093
 
2093
2094
  /**
2094
2095
  * Creates an array of the enumerable property names of the array-like `value`.
@@ -2108,7 +2109,7 @@ function arrayLikeKeys(value, inherited) {
2108
2109
  length = result.length;
2109
2110
 
2110
2111
  for (var key in value) {
2111
- if ((inherited || hasOwnProperty$4.call(value, key)) &&
2112
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
2112
2113
  !(skipIndexes && (
2113
2114
  // Safari 9 has enumerable `arguments.length` in strict mode.
2114
2115
  key == 'length' ||
@@ -2128,7 +2129,7 @@ function arrayLikeKeys(value, inherited) {
2128
2129
  var _arrayLikeKeys = arrayLikeKeys;
2129
2130
 
2130
2131
  /** Used for built-in method references. */
2131
- var objectProto$4 = Object.prototype;
2132
+ var objectProto$3 = Object.prototype;
2132
2133
 
2133
2134
  /**
2134
2135
  * Checks if `value` is likely a prototype object.
@@ -2139,7 +2140,7 @@ var objectProto$4 = Object.prototype;
2139
2140
  */
2140
2141
  function isPrototype(value) {
2141
2142
  var Ctor = value && value.constructor,
2142
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
2143
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
2143
2144
 
2144
2145
  return value === proto;
2145
2146
  }
@@ -2168,10 +2169,10 @@ var nativeKeys = _overArg(Object.keys, Object);
2168
2169
  var _nativeKeys = nativeKeys;
2169
2170
 
2170
2171
  /** Used for built-in method references. */
2171
- var objectProto$3 = Object.prototype;
2172
+ var objectProto$2 = Object.prototype;
2172
2173
 
2173
2174
  /** Used to check objects for own properties. */
2174
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
2175
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2175
2176
 
2176
2177
  /**
2177
2178
  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
@@ -2186,7 +2187,7 @@ function baseKeys(object) {
2186
2187
  }
2187
2188
  var result = [];
2188
2189
  for (var key in Object(object)) {
2189
- if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
2190
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
2190
2191
  result.push(key);
2191
2192
  }
2192
2193
  }
@@ -2277,10 +2278,10 @@ var _getAllKeys = getAllKeys;
2277
2278
  var COMPARE_PARTIAL_FLAG$3 = 1;
2278
2279
 
2279
2280
  /** Used for built-in method references. */
2280
- var objectProto$2 = Object.prototype;
2281
+ var objectProto$1 = Object.prototype;
2281
2282
 
2282
2283
  /** Used to check objects for own properties. */
2283
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2284
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2284
2285
 
2285
2286
  /**
2286
2287
  * A specialized version of `baseIsEqualDeep` for objects with support for
@@ -2308,7 +2309,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2308
2309
  var index = objLength;
2309
2310
  while (index--) {
2310
2311
  var key = objProps[index];
2311
- if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
2312
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2312
2313
  return false;
2313
2314
  }
2314
2315
  }
@@ -2442,10 +2443,10 @@ var argsTag = '[object Arguments]',
2442
2443
  objectTag = '[object Object]';
2443
2444
 
2444
2445
  /** Used for built-in method references. */
2445
- var objectProto$1 = Object.prototype;
2446
+ var objectProto = Object.prototype;
2446
2447
 
2447
2448
  /** Used to check objects for own properties. */
2448
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2449
+ var hasOwnProperty = objectProto.hasOwnProperty;
2449
2450
 
2450
2451
  /**
2451
2452
  * A specialized version of `baseIsEqual` for arrays and objects which performs
@@ -2488,8 +2489,8 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2488
2489
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2489
2490
  }
2490
2491
  if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2491
- var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),
2492
- othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');
2492
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2493
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2493
2494
 
2494
2495
  if (objIsWrapped || othIsWrapped) {
2495
2496
  var objUnwrapped = objIsWrapped ? object.value() : object,
@@ -3423,131 +3424,6 @@ var sortBy = _baseRest(function(collection, iteratees) {
3423
3424
 
3424
3425
  var sortBy_1 = sortBy;
3425
3426
 
3426
- /**
3427
- * The base implementation of `assignValue` and `assignMergeValue` without
3428
- * value checks.
3429
- *
3430
- * @private
3431
- * @param {Object} object The object to modify.
3432
- * @param {string} key The key of the property to assign.
3433
- * @param {*} value The value to assign.
3434
- */
3435
- function baseAssignValue(object, key, value) {
3436
- if (key == '__proto__' && _defineProperty) {
3437
- _defineProperty(object, key, {
3438
- 'configurable': true,
3439
- 'enumerable': true,
3440
- 'value': value,
3441
- 'writable': true
3442
- });
3443
- } else {
3444
- object[key] = value;
3445
- }
3446
- }
3447
-
3448
- var _baseAssignValue = baseAssignValue;
3449
-
3450
- /**
3451
- * A specialized version of `baseAggregator` for arrays.
3452
- *
3453
- * @private
3454
- * @param {Array} [array] The array to iterate over.
3455
- * @param {Function} setter The function to set `accumulator` values.
3456
- * @param {Function} iteratee The iteratee to transform keys.
3457
- * @param {Object} accumulator The initial aggregated object.
3458
- * @returns {Function} Returns `accumulator`.
3459
- */
3460
- function arrayAggregator(array, setter, iteratee, accumulator) {
3461
- var index = -1,
3462
- length = array == null ? 0 : array.length;
3463
-
3464
- while (++index < length) {
3465
- var value = array[index];
3466
- setter(accumulator, value, iteratee(value), array);
3467
- }
3468
- return accumulator;
3469
- }
3470
-
3471
- var _arrayAggregator = arrayAggregator;
3472
-
3473
- /**
3474
- * Aggregates elements of `collection` on `accumulator` with keys transformed
3475
- * by `iteratee` and values set by `setter`.
3476
- *
3477
- * @private
3478
- * @param {Array|Object} collection The collection to iterate over.
3479
- * @param {Function} setter The function to set `accumulator` values.
3480
- * @param {Function} iteratee The iteratee to transform keys.
3481
- * @param {Object} accumulator The initial aggregated object.
3482
- * @returns {Function} Returns `accumulator`.
3483
- */
3484
- function baseAggregator(collection, setter, iteratee, accumulator) {
3485
- _baseEach(collection, function(value, key, collection) {
3486
- setter(accumulator, value, iteratee(value), collection);
3487
- });
3488
- return accumulator;
3489
- }
3490
-
3491
- var _baseAggregator = baseAggregator;
3492
-
3493
- /**
3494
- * Creates a function like `_.groupBy`.
3495
- *
3496
- * @private
3497
- * @param {Function} setter The function to set accumulator values.
3498
- * @param {Function} [initializer] The accumulator object initializer.
3499
- * @returns {Function} Returns the new aggregator function.
3500
- */
3501
- function createAggregator(setter, initializer) {
3502
- return function(collection, iteratee) {
3503
- var func = isArray_1(collection) ? _arrayAggregator : _baseAggregator,
3504
- accumulator = initializer ? initializer() : {};
3505
-
3506
- return func(collection, setter, _baseIteratee(iteratee), accumulator);
3507
- };
3508
- }
3509
-
3510
- var _createAggregator = createAggregator;
3511
-
3512
- /** Used for built-in method references. */
3513
- var objectProto = Object.prototype;
3514
-
3515
- /** Used to check objects for own properties. */
3516
- var hasOwnProperty = objectProto.hasOwnProperty;
3517
-
3518
- /**
3519
- * Creates an object composed of keys generated from the results of running
3520
- * each element of `collection` thru `iteratee`. The order of grouped values
3521
- * is determined by the order they occur in `collection`. The corresponding
3522
- * value of each key is an array of elements responsible for generating the
3523
- * key. The iteratee is invoked with one argument: (value).
3524
- *
3525
- * @static
3526
- * @memberOf _
3527
- * @since 0.1.0
3528
- * @category Collection
3529
- * @param {Array|Object} collection The collection to iterate over.
3530
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
3531
- * @returns {Object} Returns the composed aggregate object.
3532
- * @example
3533
- *
3534
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
3535
- * // => { '4': [4.2], '6': [6.1, 6.3] }
3536
- *
3537
- * // The `_.property` iteratee shorthand.
3538
- * _.groupBy(['one', 'two', 'three'], 'length');
3539
- * // => { '3': ['one', 'two'], '5': ['three'] }
3540
- */
3541
- var groupBy = _createAggregator(function(result, value, key) {
3542
- if (hasOwnProperty.call(result, key)) {
3543
- result[key].push(value);
3544
- } else {
3545
- _baseAssignValue(result, key, [value]);
3546
- }
3547
- });
3548
-
3549
- var groupBy_1 = groupBy;
3550
-
3551
3427
  var bind = function bind(fn, thisArg) {
3552
3428
  return function wrap() {
3553
3429
  var args = new Array(arguments.length);
@@ -5292,6 +5168,11 @@ axios_1.default = _default;
5292
5168
 
5293
5169
  var axios = axios_1;
5294
5170
 
5171
+ const dateTimeFormat = 'YYYY-MM-DD HH:mm:ss';
5172
+ const shortDateYearFormat = 'ddd, MMM DD YYYY';
5173
+ const apiV1Prefix = 'api';
5174
+ const defaultImage = 'https://res.cloudinary.com/reckon-mini-sites/image/upload/v1636477599/FaveSalon%20Social%20Website/default/default--picture_w3jvfh.png';
5175
+
5295
5176
  var BusinessHourStatus;
5296
5177
  (function (BusinessHourStatus) {
5297
5178
  BusinessHourStatus[BusinessHourStatus["Open"] = 0] = "Open";
@@ -5299,40 +5180,34 @@ var BusinessHourStatus;
5299
5180
  BusinessHourStatus[BusinessHourStatus["ByAppointment"] = 2] = "ByAppointment";
5300
5181
  })(BusinessHourStatus || (BusinessHourStatus = {}));
5301
5182
  function createSalon(blob) {
5302
- const salonGeoLocations = blob.salon_geolocation || [];
5303
- const themeColors = {
5304
- 'allure24-blue': '89c8d2',
5305
- 'allure24-pink': 'ff7fa2',
5306
- 'the-shave': 'af8c45',
5307
- 'theme2-dark-green': '90c245',
5308
- 'theme2-green': 'bed451',
5309
- 'theme2-light-pink': 'd47b99',
5310
- 'theme2-purple': 'ab345c',
5311
- 'theme3-blue': '076dec',
5312
- 'theme3-layout1': 'd59b76',
5313
- 'theme3-layout2': 'b02858',
5314
- 'theme4-green': '5da826',
5315
- 'theme4': '08b89d',
5316
- 'theme5': 'f64c4d',
5317
- };
5183
+ const geoLocations = blob.salon_geolocation || [];
5184
+ let salonImages = [];
5185
+ if (blob.salon_miniwebsite) {
5186
+ const activeSite = Array.isArray(blob.salon_miniwebsite) ? blob.salon_miniwebsite[0] : (blob.salon_miniwebsite || {});
5187
+ salonImages = [
5188
+ activeSite.full_small_slider_img1,
5189
+ activeSite.full_small_slider_img2,
5190
+ activeSite.full_small_slider_img3,
5191
+ ].filter(image => !!image);
5192
+ }
5318
5193
  return {
5319
5194
  id: blob.id,
5320
5195
  about: blob.about,
5321
5196
  email: blob.email,
5197
+ ownerName: blob.owner_name,
5322
5198
  fullProfileImage: blob.full_profile_image,
5323
5199
  fullCoverImage: blob.full_cover_image,
5324
- ownerName: blob.owner_name,
5325
5200
  subdomain: blob.subdomain,
5326
5201
  website: blob.website,
5327
5202
  businessName: blob.business_name,
5328
5203
  businessPhone: blob.business_phone,
5329
5204
  businessAddress: blob.business_address,
5330
- businessLocationLat: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lat : null,
5331
- businessLocationLng: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lng : null,
5205
+ businessLocationLat: geoLocations.length > 0 ? geoLocations[0].location_lat : null,
5206
+ businessLocationLng: geoLocations.length > 0 ? geoLocations[0].location_lng : null,
5332
5207
  city: blob.city,
5333
5208
  state: blob.state,
5334
5209
  zipcode: blob.zipcode ? Number(blob.zipcode) : null,
5335
- businessHours: (blob.business_hours || blob.salon_workingtime || []).map(bh => {
5210
+ businessHours: (blob.business_hours || blob.salon_working_time || []).map(bh => {
5336
5211
  return {
5337
5212
  dayName: bh.day_name,
5338
5213
  openTime: bh.open_time,
@@ -5341,17 +5216,24 @@ function createSalon(blob) {
5341
5216
  };
5342
5217
  }),
5343
5218
  rating: Number(blob.rating_point),
5344
- primaryColor: themeColors[blob.default_mini_site_template] || themeColors['allure24-blue'],
5219
+ primaryColor: blob.primary_color || Colors.Primary,
5220
+ salonImages,
5345
5221
  };
5346
5222
  }
5223
+ function getSalonImage({ salonImages, fullProfileImage }) {
5224
+ if (salonImages && salonImages.length > 0) {
5225
+ return salonImages[0];
5226
+ }
5227
+ if (fullProfileImage) {
5228
+ return fullProfileImage;
5229
+ }
5230
+ return defaultImage;
5231
+ }
5347
5232
 
5348
5233
  var dayjs_min = createCommonjsModule(function (module, exports) {
5349
5234
  !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",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\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("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={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,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);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:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},D="en",v={};v[D]=M;var p=function(t){return t instanceof _},S=function(t,e,n){var r;if(!t)return D;if("string"==typeof t)v[t]&&(r=t),e&&(v[t]=e,r=t);else {var i=t.name;v[i]=t,r=i;}return !n&&r&&(D=r),r||!n&&D},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}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(O.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(l);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.$x=t.x||{},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 O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.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=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.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,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var D=this.$locale().weekStart||0,v=(y<D?y+7:y)-D;return $(r?m-v:m+(6-v),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){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 $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.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||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].substr(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,D=O.m(this,M);return D=(l={},l[c]=D/12,l[f]=D,l[h]=D/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?D:O.a(D)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return v[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.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}(),b=_.prototype;return w.prototype=b,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){b[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=v[D],w.Ls=v,w.p={},w}));
5350
5235
  });
5351
5236
 
5352
- const shortDate = 'DD MMM YYYY';
5353
- const apiDateFormat = 'YYYY-MM-DD HH:mm:ss';
5354
-
5355
5237
  function createService(blob) {
5356
5238
  const photos = (blob.photo_link || []).map(photo => {
5357
5239
  return {
@@ -5379,13 +5261,15 @@ function createService(blob) {
5379
5261
 
5380
5262
  function createStylist(blob) {
5381
5263
  const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
5264
+ const { first_name, last_name, mobile_phone, avatar, full_profile_image, } = blob.user || {};
5265
+ const userNames = [first_name, last_name].filter(name => !!name);
5382
5266
  return {
5383
- id: Number(blob.stylist_id),
5384
- name: blob.title || [blob.first_name, blob.last_name].filter(field => !!field).join(' '),
5385
- firstName: blob.first_name,
5386
- lastName: blob.last_name,
5387
- avatar: blob.avatar,
5388
- phone: blob.mobile_phone,
5267
+ id: Number(blob.id),
5268
+ firstName: first_name,
5269
+ lastName: last_name,
5270
+ fullName: userNames.length > 0 ? userNames.join(' ') : blob.email,
5271
+ avatar: avatar || full_profile_image,
5272
+ phone: mobile_phone,
5389
5273
  expertise: Boolean(blob.expertise),
5390
5274
  rating: Math.ceil((ratingPercentage * 5) / 100),
5391
5275
  };
@@ -5393,15 +5277,16 @@ function createStylist(blob) {
5393
5277
  function createStylistFromLookbook(blob) {
5394
5278
  const { user } = blob;
5395
5279
  const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
5280
+ const userNames = [user.first_name, user.last_name].filter(name => !!name);
5396
5281
  return {
5397
5282
  id: Number(blob.id),
5398
- expertise: Boolean(blob.expertise),
5399
- rating: Math.ceil((ratingPercentage * 5) / 100),
5400
- name: [user.first_name, user.last_name].filter(field => !!field).join(' '),
5401
5283
  firstName: user.first_name,
5402
5284
  lastName: user.last_name,
5285
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.title),
5403
5286
  avatar: user.full_avatar || user.full_profile_image_thumb,
5404
5287
  phone: user.mobile_phone,
5288
+ expertise: Boolean(blob.expertise),
5289
+ rating: Math.ceil((ratingPercentage * 5) / 100),
5405
5290
  };
5406
5291
  }
5407
5292
 
@@ -5409,99 +5294,134 @@ function createUser(blob) {
5409
5294
  const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
5410
5295
  return {
5411
5296
  id: blob.user_id,
5412
- name: userNames.length > 0 ? userNames.join(' ') : blob.username,
5413
5297
  firstName: blob.first_name,
5414
5298
  lastName: blob.last_name,
5415
- avatar: blob.full_profile_image_thumb,
5299
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
5300
+ avatar: blob.avatar || blob.full_profile_image_thumb,
5416
5301
  };
5417
5302
  }
5418
5303
 
5419
- function createFaveStyleComent(blob) {
5420
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
5421
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5422
- return {
5304
+ var MediaType;
5305
+ (function (MediaType) {
5306
+ MediaType[MediaType["Photo"] = 0] = "Photo";
5307
+ MediaType[MediaType["Video"] = 1] = "Video";
5308
+ })(MediaType || (MediaType = {}));
5309
+ class AlbumMedia {
5310
+ constructor(fields) {
5311
+ Object.assign(this, fields);
5312
+ }
5313
+ }
5314
+ function createAlbumMedia(blob) {
5315
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
5316
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
5317
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
5318
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
5319
+ const isVideo = blob.media_type === MediaType.Video || blob.full_image_url.indexOf('.mp4') > -1;
5320
+ return new AlbumMedia({
5423
5321
  id: blob.id,
5424
- type: blob.type,
5425
- content: blob.content,
5426
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5427
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5428
- parentCommentId: blob.parentCommentId,
5429
- childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComent) : [],
5430
- owner: createUser(blob.user),
5431
- };
5322
+ caption: blob.caption,
5323
+ description: blob.description,
5324
+ createdDate: createdDateTime,
5325
+ updatedDate: updatedDateTime,
5326
+ mediaUrl: blob.full_image_url,
5327
+ imageThumb: !isVideo ? blob.full_image_url_thumb : null,
5328
+ imageThumbMedium: !isVideo ? blob.full_image_url_medium : null,
5329
+ imageWidth: !isVideo ? blob.img_w : 400,
5330
+ imageHeight: !isVideo ? blob.img_h : 300,
5331
+ mediaType: isVideo ? MediaType.Video : blob.media_type,
5332
+ totalLike: blob.total_like,
5333
+ totalDislike: blob.total_dislike,
5334
+ totalShare: blob.total_shared,
5335
+ totalView: blob.view_count,
5336
+ totalBooking: blob.total_booking,
5337
+ });
5432
5338
  }
5433
- function createFavesalonAlbum(blob) {
5434
- return {
5339
+ class Album {
5340
+ constructor(fields) {
5341
+ Object.assign(this, fields);
5342
+ }
5343
+ }
5344
+ function createAlbum(blob) {
5345
+ return new Album({
5435
5346
  id: blob.id,
5436
5347
  name: blob.name,
5437
5348
  caption: blob.caption,
5438
5349
  description: blob.description,
5439
5350
  tags: blob.tags ? blob.tags.filter(tag => !!tag) : [],
5440
5351
  salonId: blob.salon_id,
5441
- stylistId: blob.beautician_id,
5352
+ stylistId: blob.stylist_id,
5442
5353
  totalMedias: blob.total_medias || 0,
5443
5354
  service: blob.service ? createService(blob.service) : null,
5444
5355
  isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
5445
- };
5356
+ });
5446
5357
  }
5447
- function createFavesalonStyle(blob) {
5448
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
5449
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5450
- return {
5358
+ class FaveStyleComment {
5359
+ constructor(fields) {
5360
+ Object.assign(this, fields);
5361
+ }
5362
+ }
5363
+ function createFaveStyleComment(blob) {
5364
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
5365
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
5366
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
5367
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
5368
+ return new FaveStyleComment({
5451
5369
  id: blob.id,
5452
- caption: blob.caption,
5370
+ type: blob.type,
5371
+ title: blob.content,
5453
5372
  description: blob.description,
5454
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5455
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5456
- mediaType: blob.media_type,
5457
- fullImageUrl: blob.full_image_url,
5458
- fullImageUrlThumb: blob.full_image_url_thumb,
5459
- fullImageUrlMedium: blob.full_image_url_medium,
5460
- imgWidth: blob.img_w,
5461
- imgHeight: blob.img_h,
5462
- s3ImgWidth: blob.s3_img_w,
5463
- s3ImgHeight: blob.s3_img_h,
5464
- totalLike: blob.total_like,
5465
- totalDislike: blob.total_dislike,
5466
- totalShare: blob.total_shared,
5467
- totalView: blob.view_count,
5468
- totalBooking: blob.total_booking,
5469
- owner: blob.user ? createUser(blob.user) : null,
5470
- };
5373
+ createdDate: createdDateTime,
5374
+ updatedDate: updatedDateTime,
5375
+ parentCommentId: blob.parentCommentId,
5376
+ childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComment) : [],
5377
+ user: createUser(blob.user),
5378
+ });
5471
5379
  }
5472
- function createFavesalonLookbook(blob) {
5473
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
5474
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5475
- let albumPhotos = blob.style_in_album ? blob.style_in_album.map(createFavesalonStyle) : [];
5476
- if (!albumPhotos.find(ap => ap.id === blob.id)) {
5477
- const currentPhoto = createFavesalonStyle(blob);
5478
- albumPhotos = [currentPhoto].concat(albumPhotos);
5380
+ class FaveStyle {
5381
+ constructor(fields) {
5382
+ Object.assign(this, fields);
5479
5383
  }
5480
- return {
5384
+ }
5385
+ function createFaveStyle(blob) {
5386
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
5387
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
5388
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
5389
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
5390
+ const albumMedias = [createAlbumMedia(blob)].concat(blob.album_medias ? blob.album_medias.map(createAlbumMedia).filter(ap => ap.id !== blob.id) : []);
5391
+ const { total_booked: totalBooked, total_like: totalLike, total_share: totalShare, total_view: totalView, } = blob.style_activity || {};
5392
+ return new FaveStyle({
5481
5393
  id: blob.id,
5482
5394
  caption: blob.caption,
5483
5395
  description: blob.description,
5484
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5485
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5396
+ createdDate: createdDateTime,
5397
+ updatedDate: updatedDateTime,
5398
+ imageUrl: blob.full_image_url,
5399
+ imageThumb: blob.full_image_url_thumb,
5400
+ imageThumbMedium: blob.full_image_url_medium,
5401
+ imageWidth: blob.img_w,
5402
+ imageHeight: blob.img_h,
5486
5403
  mediaType: blob.media_type,
5487
- fullImageUrl: blob.full_image_url,
5488
- fullImageUrlThumb: blob.full_image_url_thumb,
5489
- fullImageUrlMedium: blob.full_image_url_medium,
5490
- imgWidth: blob.img_w,
5491
- imgHeight: blob.img_h,
5492
- s3ImgWidth: blob.s3_img_w,
5493
- s3ImgHeight: blob.s3_img_h,
5494
- totalLike: blob.total_like,
5495
- totalDislike: blob.total_dislike,
5496
- totalShare: blob.total_shared,
5497
- totalView: blob.view_count,
5498
- totalBooking: blob.total_booking,
5404
+ isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
5405
+ totalBooking: totalBooked || 0,
5406
+ totalLike: totalLike || 0,
5407
+ totalDislike: blob.total_dislike || 0,
5408
+ totalShare: totalShare || 0,
5409
+ totalView: totalView || 0,
5410
+ albumMedias,
5411
+ album: blob.album ? createAlbum(blob.album) : null,
5499
5412
  owner: blob.user ? createUser(blob.user) : null,
5413
+ salonId: blob.salon_id ? Number(blob.salon_id) : null,
5500
5414
  salon: blob.salon ? createSalon(blob.salon) : null,
5501
- stylist: blob.beautician && blob.beautician.user ? createStylistFromLookbook(blob.beautician) : null,
5502
- album: blob.album ? createFavesalonAlbum(blob.album) : null,
5503
- albumPhotos,
5504
- };
5415
+ stylistId: blob.stylist_id ? Number(blob.stylist_id) : null,
5416
+ stylist: blob.stylist ? createStylistFromLookbook(blob.stylist) : null,
5417
+ isLiked: blob.my_activity && blob.my_activity.liked,
5418
+ serviceId: blob.service_id ? Number(blob.service_id) : null,
5419
+ salonServiceId: blob.category_service_id ? Number(blob.category_service_id) : null,
5420
+ productBrand: blob.product_brand_used || '',
5421
+ });
5422
+ }
5423
+ function isVideoMedia({ mediaType }) {
5424
+ return mediaType === MediaType.Video;
5505
5425
  }
5506
5426
 
5507
5427
  function createReviewPhoto(blob) {
@@ -5513,15 +5433,15 @@ function createReviewPhoto(blob) {
5513
5433
  };
5514
5434
  }
5515
5435
  function createReview(blob) {
5516
- const reviewPhotos = blob.salon_review_photo || blob.beautician_review_photo || [];
5436
+ const reviewPhotos = blob.review_photo || [];
5517
5437
  const [createdDay, createdTime] = String(blob.create_date).split(' ');
5518
5438
  const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5519
5439
  return {
5520
5440
  title: blob.title,
5521
- point: Math.ceil(Number(blob.avg_point)),
5522
5441
  description: blob.comment,
5523
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5524
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5442
+ createdDate: dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf(),
5443
+ updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf(),
5444
+ point: Math.ceil(Number(blob.avg_point)),
5525
5445
  pointView: blob.view_point,
5526
5446
  pointPrice: blob.price_point,
5527
5447
  pointProduct: blob.product_point,
@@ -5531,69 +5451,58 @@ function createReview(blob) {
5531
5451
  helpful: blob.helpful,
5532
5452
  recommend: blob.recommend,
5533
5453
  user: blob.user ? createUser(blob.user) : null,
5454
+ salon: blob.salon ? createSalon(blob.salon) : null,
5455
+ stylist: blob.stylist && blob.stylist.user ? createStylist(blob.stylist) : null,
5534
5456
  photos: reviewPhotos.map(createReviewPhoto),
5535
5457
  };
5536
5458
  }
5537
5459
 
5538
- var __rest = (undefined && undefined.__rest) || function (s, e) {
5539
- var t = {};
5540
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5541
- t[p] = s[p];
5542
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
5543
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5544
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
5545
- t[p[i]] = s[p[i]];
5546
- }
5547
- return t;
5548
- };
5460
+ const apiV2Prefix = 'api-ver2';
5549
5461
  class HttpService {
5550
5462
  constructor() {
5551
5463
  this.http = null;
5552
5464
  this.http = axios.create({
5553
5465
  baseURL: 'https://favesalon.com',
5466
+ // baseURL: 'http://13.57.216.170',
5554
5467
  headers: {},
5555
5468
  });
5556
5469
  }
5557
- fetchSalonInfo(salonId) {
5558
- const url = 'api/salon/settings-public';
5559
- return this.http.post(url, { salon_id: salonId })
5560
- .then((response) => {
5561
- const { status, data } = response.data;
5562
- return status && data ? createSalon(data.Salon) : null;
5563
- })
5564
- .catch(() => (null));
5565
- }
5566
- fetchReviews(url, options, allReviews) {
5567
- const { noLoop } = options, restOptions = __rest(options, ["noLoop"]);
5568
- return this.http.post(url, restOptions)
5470
+ fetchStyleDetail(styleId) {
5471
+ return this.http.get(`${apiV2Prefix}/style/${styleId}/detail`)
5569
5472
  .then((response) => {
5570
5473
  const { status, data } = response.data;
5571
5474
  if (status) {
5572
- const reviews = (data || []).filter(blob => Math.ceil(Number(blob.avg_point)) > 0).map(createReview);
5573
- // fetch next page's reviews
5574
- if (!noLoop && reviews.length >= options.limit) {
5575
- return this.fetchReviews(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allReviews.concat(reviews));
5475
+ let styleInfo = null, similarStyles = [];
5476
+ try {
5477
+ styleInfo = createFaveStyle(data);
5478
+ similarStyles = (data.style_similars || []).map(createFaveStyle);
5576
5479
  }
5577
- const finalReviews = options.page === 1 ? reviews : allReviews.concat(reviews);
5578
- return {
5579
- totalReviews: finalReviews.length || 0,
5580
- allReviews: finalReviews,
5581
- };
5480
+ catch (e) { }
5481
+ return { styleInfo, similarStyles };
5582
5482
  }
5583
- return { totalReviews: 0, allReviews: [] };
5483
+ return { styleInfo: null, similarStyles: [] };
5484
+ })
5485
+ .catch(() => {
5486
+ return { styleInfo: null, similarStyles: [] };
5584
5487
  });
5585
5488
  }
5586
- fetchSalonReviews(salonId, options) {
5587
- const url = '/api/salon/reviews';
5588
- return this.fetchReviews(url, Object.assign({ page: 1, limit: 5, salon_id: salonId, avg_point_greater_than: 0 }, options), [])
5489
+ fetchSalonInfo(salonId) {
5490
+ const url = `${apiV2Prefix}/salon/${salonId}/detail`;
5491
+ return this.http.get(url)
5492
+ .then((response) => {
5493
+ const { status, data } = response.data;
5494
+ return status && data ? createSalon(data) : null;
5495
+ })
5496
+ .catch(() => (null));
5497
+ }
5498
+ fetchSalonLatestStyles(salonId, options) {
5499
+ const url = `${apiV2Prefix}/salon/${salonId}/styles`;
5500
+ return this.http.post(url, Object.assign(Object.assign({}, options), { sort: 'newest' }))
5589
5501
  .then(response => {
5590
- const { totalReviews, allReviews } = response;
5591
- return {
5592
- total: totalReviews,
5593
- allItems: allReviews,
5594
- };
5502
+ const { data } = response.data;
5503
+ return (data || []).slice(0, options.limit).map(createFaveStyle);
5595
5504
  })
5596
- .catch(() => ({ total: 0, allItems: [] }));
5505
+ .catch(() => ([]));
5597
5506
  }
5598
5507
  decorateServiceGroups(groups) {
5599
5508
  return groups.map((cate, index) => {
@@ -5620,7 +5529,7 @@ class HttpService {
5620
5529
  });
5621
5530
  }
5622
5531
  fetchSalonServices(salonId) {
5623
- const url = `api/salon/services?v=2&id=${salonId}`;
5532
+ const url = `${apiV1Prefix}/salon/services?v=2&id=${salonId}`;
5624
5533
  return this.http.get(url)
5625
5534
  .then(response => {
5626
5535
  const { status, data } = response.data;
@@ -5631,34 +5540,42 @@ class HttpService {
5631
5540
  })
5632
5541
  .catch(() => ([]));
5633
5542
  }
5634
- fetchSalonStylists(salonId) {
5635
- const fetchStylistSchedules = this.http.get(`api/calendar/resource/stylists?salon_id=${salonId}`)
5636
- .then((response) => {
5637
- const { status, data } = response.data;
5638
- return status ? (data || []) : [];
5639
- })
5640
- .catch(() => ([]));
5641
- const fetchStylistSkills = this.http.get(`api/salon/skill-stylists/${salonId}`)
5642
- .then((response) => {
5643
- const { status, data } = response.data;
5644
- return status ? (data || []).map(blob => (Object.assign(Object.assign({}, blob), { id: blob.stylist_id }))) : [];
5543
+ fetchSalonStylists(salonId, options = { page: 1, limit: 12 }) {
5544
+ const url = `${apiV2Prefix}/salon/${salonId}/stylists?page=${options.page}&limit=${options.limit}`;
5545
+ return this.http.get(url)
5546
+ .then(response => {
5547
+ const { paging, data } = response.data;
5548
+ return {
5549
+ total: paging.total_item || data.length,
5550
+ data: data.map(createStylist),
5551
+ };
5645
5552
  })
5646
- .catch(() => ([]));
5647
- return Promise.all([fetchStylistSchedules, fetchStylistSkills])
5648
- .then(results => {
5649
- const [stylistSchedules, stylistSkills] = results;
5650
- const allStylistGroups = groupBy_1(stylistSchedules.concat(stylistSkills), stylist => stylist.id);
5651
- return Object.keys(allStylistGroups)
5652
- .filter(stylistId => Number(stylistId) > 0)
5653
- .map(stylistId => {
5654
- const [schedule, skills] = allStylistGroups[stylistId];
5655
- return createStylist(Object.assign(Object.assign({}, schedule), skills));
5656
- });
5553
+ .catch(() => ({ total: 0, data: [] }));
5554
+ }
5555
+ fetchSalonReviews(salonId, options) {
5556
+ const url = `${apiV2Prefix}/salon/${salonId}/reviews`;
5557
+ return this.http.post(url, Object.assign({ avg_point_greater_than: 0 }, options))
5558
+ .then(response => {
5559
+ const { data, paging } = response.data || {};
5560
+ const { total_1star: onestar, total_2star: twoStar, total_3star: threeStar, total_4star: fourStar, total_5star: fiveStar, total_review: totalReviews, avg_point: reviewPoint, } = paging.review_detail || {};
5561
+ return {
5562
+ total: paging.total_item || 0,
5563
+ stats: {
5564
+ totalReviews,
5565
+ reviewPoint: reviewPoint ? Math.ceil(reviewPoint) : 0,
5566
+ '1': onestar ? Math.ceil(onestar) : 0,
5567
+ '2': twoStar ? Math.ceil(twoStar) : 0,
5568
+ '3': threeStar ? Math.ceil(threeStar) : 0,
5569
+ '4': fourStar ? Math.ceil(fourStar) : 0,
5570
+ '5': fiveStar ? Math.ceil(fiveStar) : 0,
5571
+ },
5572
+ data: data.map(createReview),
5573
+ };
5657
5574
  })
5658
- .catch(() => []);
5575
+ .catch(() => ({ total: 0, stats: {}, data: [] }));
5659
5576
  }
5660
5577
  fetchSalonCategories() {
5661
- return this.http.post('api/home/get-service', { limit: 50 })
5578
+ return this.http.post(`${apiV2Prefix}/search/get-services`, { limit: 50 })
5662
5579
  .then((response) => {
5663
5580
  const { status, data } = response.data;
5664
5581
  if (status) {
@@ -5677,80 +5594,34 @@ class HttpService {
5677
5594
  }
5678
5595
  fetchSalonLookbooks(salonId, options) {
5679
5596
  const noResult = { total: 0, allLookbooks: [] };
5680
- return this.http.post('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options))
5681
- .then((response) => {
5597
+ const url = `${apiV2Prefix}/salon/${salonId}/styles`;
5598
+ const postData = Object.assign({ page: 1, limit: 20 }, options);
5599
+ return this.http.post(url, postData)
5600
+ .then(response => {
5682
5601
  const { status, data, paging } = response.data;
5683
5602
  if (status) {
5684
5603
  return {
5685
5604
  total: paging.total_item || 0,
5686
- allLookbooks: (data || []).map(createFavesalonStyle),
5605
+ allLookbooks: (data || []).map(createFaveStyle),
5687
5606
  };
5688
5607
  }
5689
5608
  return noResult;
5690
5609
  })
5691
5610
  .catch(() => (noResult));
5692
5611
  }
5693
- fetchSalonPhotos(salonId) {
5694
- return this.http
5695
- .post('api/style/filter', {
5696
- page: 1,
5697
- limit: 20,
5698
- salon_id: salonId,
5699
- })
5700
- .then((response) => {
5701
- const { status, data } = response.data;
5702
- if (status) {
5703
- return (data || []).map(createFavesalonStyle);
5704
- }
5705
- return [];
5706
- })
5707
- .catch(() => {
5708
- return [];
5709
- });
5710
- }
5711
- fetchAllStyles(url, options, allStyles) {
5712
- return this.http.post(url, options)
5713
- .then((response) => {
5714
- const { status, data } = response.data;
5715
- if (status) {
5716
- const styles = (data || []).map(createFavesalonStyle);
5717
- // fetch next page styles
5718
- if (styles.length >= options.limit) {
5719
- return this.fetchAllStyles(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allStyles.concat(styles));
5720
- }
5721
- return options.page === 1 ? styles : allStyles;
5722
- }
5723
- return allStyles;
5724
- });
5725
- }
5726
- fetchAllSalonPhotos(salonId, options) {
5727
- return this.fetchAllStyles('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options), []).catch(() => {
5728
- return [];
5729
- });
5730
- }
5731
- fetchStyleDetail(styleId) {
5732
- return this.http.post('api/home/style-info', { photo_id: styleId })
5733
- .then((response) => {
5734
- const { status, data } = response.data;
5735
- if (status) {
5736
- return createFavesalonLookbook(data);
5737
- }
5738
- return null;
5739
- })
5740
- .catch(() => (null));
5741
- }
5742
- fetchStyleComments(options) {
5743
- return this.http.post('api/comment/filter', options)
5612
+ fetchStyleComments(styleId) {
5613
+ const url = `${apiV2Prefix}/style/comment?photo_id=${styleId}`;
5614
+ return this.http.get(url)
5744
5615
  .then(response => {
5745
- const { status, data } = response.data;
5746
- if (status) {
5747
- return (data || []).map(createFaveStyleComent);
5748
- }
5749
- return [];
5616
+ const { paging, data } = response.data;
5617
+ return {
5618
+ total: paging.total_item || 0,
5619
+ data: data.map(createFaveStyleComment),
5620
+ };
5750
5621
  })
5751
- .catch(() => ([]));
5622
+ .catch(() => ({ total: 0, data: [] }));
5752
5623
  }
5753
5624
  }
5754
5625
  const HttpService$1 = () => new HttpService();
5755
5626
 
5756
- export { BusinessHourStatus as B, HttpService$1 as H, sortBy_1 as a, dayjs_min as d, groupBy_1 as g, shortDate as s };
5627
+ export { BusinessHourStatus as B, HttpService$1 as H, sortBy_1 as a, dayjs_min as d, getSalonImage as g, isVideoMedia as i, shortDateYearFormat as s };