favesalon-embed 0.0.2 → 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 (240) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-5cfcba41.js +36 -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/dist/cjs/index-7f190886.js +4396 -0
  8. package/{cjs/index-7d179a70.js → dist/cjs/index-e6bea8f5.js} +87 -3
  9. package/{cjs → dist/cjs}/index.cjs.js +0 -0
  10. package/dist/cjs/loader.cjs.js +22 -0
  11. package/dist/cjs/salon-booking-modal.cjs.entry.js +29 -0
  12. package/dist/cjs/salon-booking.cjs.entry.js +50 -0
  13. package/dist/cjs/salon-gift-card-modal.cjs.entry.js +28 -0
  14. package/dist/cjs/salon-gift-card.cjs.entry.js +50 -0
  15. package/dist/cjs/salon-latest-reviews.cjs.entry.js +95 -0
  16. package/dist/cjs/salon-lookbook.cjs.entry.js +218 -0
  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-d6f8214c.js → dist/cjs/services-eee8f251.js} +317 -361
  22. package/dist/cjs/style-detail.cjs.entry.js +310 -0
  23. package/{cjs → dist/cjs}/user-avatar.cjs.entry.js +4 -4
  24. package/{cjs → dist/cjs}/utils-c5a33b3c.js +0 -0
  25. package/{collection → dist/collection}/collection-manifest.json +2 -2
  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 +29 -11
  31. package/{collection → dist/collection}/components/salon-booking/salon-booking-modal.js +12 -6
  32. package/dist/collection/components/salon-gift-card/index.css +25 -0
  33. package/{collection → dist/collection}/components/salon-gift-card/index.js +44 -6
  34. package/{collection → dist/collection}/components/salon-gift-card/salon-gift-card-modal.js +30 -4
  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/dist/collection/components/salon-lookbook/index.css +12 -0
  44. package/{collection → dist/collection}/components/salon-lookbook/index.js +122 -49
  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/dist/collection/components/salon-reviews/index.css +15 -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/components/salon-reviews → dist/collection/components/salon-services}/index.css +0 -0
  52. package/dist/collection/components/salon-services/index.js +156 -0
  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/components/salon-services → 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/dist/collection/types/stylist.js +30 -0
  69. package/{collection/components/user-avatar/index.css → 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 -12
  73. package/{custom-elements → dist/custom-elements}/index.js +5783 -870
  74. package/dist/esm/_commonjsHelpers-098d5b27.js +32 -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-2160b80b.js → dist/esm/index-6af0a03d.js} +87 -4
  80. package/dist/esm/index-80523fec.js +4393 -0
  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/dist/esm/salon-booking-modal.entry.js +25 -0
  90. package/dist/esm/salon-booking.entry.js +46 -0
  91. package/dist/esm/salon-gift-card-modal.entry.js +24 -0
  92. package/dist/esm/salon-gift-card.entry.js +46 -0
  93. package/dist/esm/salon-latest-reviews.entry.js +91 -0
  94. package/dist/esm/salon-lookbook.entry.js +214 -0
  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-57fadd0a.js → dist/esm/services-295247b1.js} +310 -355
  100. package/dist/esm/style-detail.entry.js +306 -0
  101. package/{esm → dist/esm}/user-avatar.entry.js +4 -4
  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/{favesalon-embed → 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/dist/favesalon-embed/p-d6083940.js +1 -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 +1 -1
  131. package/{types → dist/types}/components/salon-booking/salon-booking-modal.d.ts +1 -0
  132. package/{types → dist/types}/components/salon-gift-card/index.d.ts +2 -1
  133. package/{types → dist/types}/components/salon-gift-card/salon-gift-card-modal.d.ts +2 -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 +7 -2
  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 +2 -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 +62 -41
  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 +2 -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 +23 -2
  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/loader.cjs.js +0 -22
  172. package/cjs/salon-booking-modal.cjs.entry.js +0 -23
  173. package/cjs/salon-booking_2.cjs.entry.js +0 -56
  174. package/cjs/salon-contact_4.cjs.entry.js +0 -154
  175. package/cjs/salon-gift-card-modal.cjs.entry.js +0 -20
  176. package/cjs/salon-info.cjs.entry.js +0 -34
  177. package/cjs/salon-latest-reviews.cjs.entry.js +0 -57
  178. package/cjs/salon-lookbook.cjs.entry.js +0 -187
  179. package/cjs/salon-reviews.cjs.entry.js +0 -196
  180. package/cjs/salon-services.cjs.entry.js +0 -40
  181. package/cjs/salon-stylists.cjs.entry.js +0 -53
  182. package/collection/components/google-map/index.js +0 -97
  183. package/collection/components/salon-contact/index.js +0 -88
  184. package/collection/components/salon-gift-card/index.css +0 -25
  185. package/collection/components/salon-info/index.css +0 -3
  186. package/collection/components/salon-latest-reviews/index.js +0 -108
  187. package/collection/components/salon-locations/index.js +0 -80
  188. package/collection/components/salon-lookbook/index.css +0 -12
  189. package/collection/components/salon-reviews/index.js +0 -291
  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-services/index.js +0 -86
  193. package/collection/components/salon-styles/index.css +0 -23
  194. package/collection/components/salon-styles/index.js +0 -100
  195. package/collection/components/salon-stylists/index.js +0 -96
  196. package/collection/constants/colors.js +0 -91
  197. package/collection/services/services.js +0 -203
  198. package/collection/types/common.js +0 -2
  199. package/collection/types/salon.js +0 -52
  200. package/collection/types/style.js +0 -28
  201. package/collection/types/stylist.js +0 -13
  202. package/esm/colors-1ec90c5f.js +0 -93
  203. package/esm/favesalon-embed.js +0 -18
  204. package/esm/google-map.entry.js +0 -43
  205. package/esm/loader.js +0 -18
  206. package/esm/salon-booking-modal.entry.js +0 -19
  207. package/esm/salon-booking_2.entry.js +0 -51
  208. package/esm/salon-contact_4.entry.js +0 -147
  209. package/esm/salon-gift-card-modal.entry.js +0 -16
  210. package/esm/salon-info.entry.js +0 -30
  211. package/esm/salon-latest-reviews.entry.js +0 -53
  212. package/esm/salon-lookbook.entry.js +0 -183
  213. package/esm/salon-reviews.entry.js +0 -192
  214. package/esm/salon-services.entry.js +0 -36
  215. package/esm/salon-stylists.entry.js +0 -49
  216. package/favesalon-embed/favesalon-embed.esm.js +0 -1
  217. package/favesalon-embed/p-14a46adf.entry.js +0 -1
  218. package/favesalon-embed/p-2da2ed75.js +0 -1
  219. package/favesalon-embed/p-3712d9ab.entry.js +0 -1
  220. package/favesalon-embed/p-38066f9f.entry.js +0 -1
  221. package/favesalon-embed/p-4e2d7b29.js +0 -1
  222. package/favesalon-embed/p-520c8ffb.entry.js +0 -1
  223. package/favesalon-embed/p-54a1c294.entry.js +0 -1
  224. package/favesalon-embed/p-762520f2.js +0 -1
  225. package/favesalon-embed/p-94a0991e.entry.js +0 -1
  226. package/favesalon-embed/p-94b179eb.entry.js +0 -1
  227. package/favesalon-embed/p-977bd8bc.entry.js +0 -1
  228. package/favesalon-embed/p-bc363938.entry.js +0 -1
  229. package/favesalon-embed/p-bf9c83a3.entry.js +0 -1
  230. package/favesalon-embed/p-c5ebd3c9.entry.js +0 -1
  231. package/favesalon-embed/p-d84b61b0.entry.js +0 -1
  232. package/favesalon-embed/p-f15bcb43.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-reviews/index.d.ts +0 -23
  236. package/types/components/salon-styles/index.d.ts +0 -9
  237. package/types/constants/colors.d.ts +0 -88
  238. package/types/services/services.d.ts +0 -24
  239. package/types/types/common.d.ts +0 -2
  240. package/types/types/style.d.ts +0 -49
@@ -1,3 +1,6 @@
1
+ import { c as commonjsGlobal, a as createCommonjsModule } from './_commonjsHelpers-098d5b27.js';
2
+ import { C as Colors } from './colors-ea36347a.js';
3
+
1
4
  /**
2
5
  * Appends the elements of `values` to `array`.
3
6
  *
@@ -19,22 +22,6 @@ function arrayPush(array, values) {
19
22
 
20
23
  var _arrayPush = arrayPush;
21
24
 
22
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
23
-
24
- function createCommonjsModule(fn, basedir, module) {
25
- return module = {
26
- path: basedir,
27
- exports: {},
28
- require: function (path, base) {
29
- return commonjsRequire();
30
- }
31
- }, fn(module, module.exports), module.exports;
32
- }
33
-
34
- function commonjsRequire () {
35
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
36
- }
37
-
38
25
  /** Detect free variable `global` from Node.js. */
39
26
  var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
40
27
 
@@ -54,17 +41,17 @@ var Symbol = _root.Symbol;
54
41
  var _Symbol = Symbol;
55
42
 
56
43
  /** Used for built-in method references. */
57
- var objectProto$c = Object.prototype;
44
+ var objectProto$b = Object.prototype;
58
45
 
59
46
  /** Used to check objects for own properties. */
60
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
47
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
61
48
 
62
49
  /**
63
50
  * Used to resolve the
64
51
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
65
52
  * of values.
66
53
  */
67
- var nativeObjectToString$1 = objectProto$c.toString;
54
+ var nativeObjectToString$1 = objectProto$b.toString;
68
55
 
69
56
  /** Built-in value references. */
70
57
  var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
@@ -77,7 +64,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
77
64
  * @returns {string} Returns the raw `toStringTag`.
78
65
  */
79
66
  function getRawTag(value) {
80
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
67
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
81
68
  tag = value[symToStringTag$1];
82
69
 
83
70
  try {
@@ -99,14 +86,14 @@ function getRawTag(value) {
99
86
  var _getRawTag = getRawTag;
100
87
 
101
88
  /** Used for built-in method references. */
102
- var objectProto$b = Object.prototype;
89
+ var objectProto$a = Object.prototype;
103
90
 
104
91
  /**
105
92
  * Used to resolve the
106
93
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
107
94
  * of values.
108
95
  */
109
- var nativeObjectToString = objectProto$b.toString;
96
+ var nativeObjectToString = objectProto$a.toString;
110
97
 
111
98
  /**
112
99
  * Converts `value` to a string using `Object.prototype.toString`.
@@ -193,13 +180,13 @@ function baseIsArguments(value) {
193
180
  var _baseIsArguments = baseIsArguments;
194
181
 
195
182
  /** Used for built-in method references. */
196
- var objectProto$a = Object.prototype;
183
+ var objectProto$9 = Object.prototype;
197
184
 
198
185
  /** Used to check objects for own properties. */
199
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
186
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
200
187
 
201
188
  /** Built-in value references. */
202
- var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
189
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
203
190
 
204
191
  /**
205
192
  * Checks if `value` is likely an `arguments` object.
@@ -220,7 +207,7 @@ var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
220
207
  * // => false
221
208
  */
222
209
  var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
223
- return isObjectLike_1(value) && hasOwnProperty$8.call(value, 'callee') &&
210
+ return isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
224
211
  !propertyIsEnumerable$1.call(value, 'callee');
225
212
  };
226
213
 
@@ -511,17 +498,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
511
498
 
512
499
  /** Used for built-in method references. */
513
500
  var funcProto = Function.prototype,
514
- objectProto$9 = Object.prototype;
501
+ objectProto$8 = Object.prototype;
515
502
 
516
503
  /** Used to resolve the decompiled source of functions. */
517
504
  var funcToString = funcProto.toString;
518
505
 
519
506
  /** Used to check objects for own properties. */
520
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
507
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
521
508
 
522
509
  /** Used to detect if a method is native. */
523
510
  var reIsNative = RegExp('^' +
524
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
511
+ funcToString.call(hasOwnProperty$6).replace(reRegExpChar, '\\$&')
525
512
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
526
513
  );
527
514
 
@@ -613,10 +600,10 @@ var _hashDelete = hashDelete;
613
600
  var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
614
601
 
615
602
  /** Used for built-in method references. */
616
- var objectProto$8 = Object.prototype;
603
+ var objectProto$7 = Object.prototype;
617
604
 
618
605
  /** Used to check objects for own properties. */
619
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
606
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
620
607
 
621
608
  /**
622
609
  * Gets the hash value for `key`.
@@ -633,16 +620,16 @@ function hashGet(key) {
633
620
  var result = data[key];
634
621
  return result === HASH_UNDEFINED$2 ? undefined : result;
635
622
  }
636
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
623
+ return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
637
624
  }
638
625
 
639
626
  var _hashGet = hashGet;
640
627
 
641
628
  /** Used for built-in method references. */
642
- var objectProto$7 = Object.prototype;
629
+ var objectProto$6 = Object.prototype;
643
630
 
644
631
  /** Used to check objects for own properties. */
645
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
632
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
646
633
 
647
634
  /**
648
635
  * Checks if a hash value for `key` exists.
@@ -655,7 +642,7 @@ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
655
642
  */
656
643
  function hashHas(key) {
657
644
  var data = this.__data__;
658
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
645
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
659
646
  }
660
647
 
661
648
  var _hashHas = hashHas;
@@ -1804,10 +1791,10 @@ function stubArray() {
1804
1791
  var stubArray_1 = stubArray;
1805
1792
 
1806
1793
  /** Used for built-in method references. */
1807
- var objectProto$6 = Object.prototype;
1794
+ var objectProto$5 = Object.prototype;
1808
1795
 
1809
1796
  /** Built-in value references. */
1810
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
1797
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
1811
1798
 
1812
1799
  /* Built-in method references for those with the same name as other `lodash` methods. */
1813
1800
  var nativeGetSymbols = Object.getOwnPropertySymbols;
@@ -2099,10 +2086,10 @@ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsType
2099
2086
  var isTypedArray_1 = isTypedArray;
2100
2087
 
2101
2088
  /** Used for built-in method references. */
2102
- var objectProto$5 = Object.prototype;
2089
+ var objectProto$4 = Object.prototype;
2103
2090
 
2104
2091
  /** Used to check objects for own properties. */
2105
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
2092
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
2106
2093
 
2107
2094
  /**
2108
2095
  * Creates an array of the enumerable property names of the array-like `value`.
@@ -2122,7 +2109,7 @@ function arrayLikeKeys(value, inherited) {
2122
2109
  length = result.length;
2123
2110
 
2124
2111
  for (var key in value) {
2125
- if ((inherited || hasOwnProperty$4.call(value, key)) &&
2112
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
2126
2113
  !(skipIndexes && (
2127
2114
  // Safari 9 has enumerable `arguments.length` in strict mode.
2128
2115
  key == 'length' ||
@@ -2142,7 +2129,7 @@ function arrayLikeKeys(value, inherited) {
2142
2129
  var _arrayLikeKeys = arrayLikeKeys;
2143
2130
 
2144
2131
  /** Used for built-in method references. */
2145
- var objectProto$4 = Object.prototype;
2132
+ var objectProto$3 = Object.prototype;
2146
2133
 
2147
2134
  /**
2148
2135
  * Checks if `value` is likely a prototype object.
@@ -2153,7 +2140,7 @@ var objectProto$4 = Object.prototype;
2153
2140
  */
2154
2141
  function isPrototype(value) {
2155
2142
  var Ctor = value && value.constructor,
2156
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
2143
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
2157
2144
 
2158
2145
  return value === proto;
2159
2146
  }
@@ -2182,10 +2169,10 @@ var nativeKeys = _overArg(Object.keys, Object);
2182
2169
  var _nativeKeys = nativeKeys;
2183
2170
 
2184
2171
  /** Used for built-in method references. */
2185
- var objectProto$3 = Object.prototype;
2172
+ var objectProto$2 = Object.prototype;
2186
2173
 
2187
2174
  /** Used to check objects for own properties. */
2188
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
2175
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2189
2176
 
2190
2177
  /**
2191
2178
  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
@@ -2200,7 +2187,7 @@ function baseKeys(object) {
2200
2187
  }
2201
2188
  var result = [];
2202
2189
  for (var key in Object(object)) {
2203
- if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
2190
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
2204
2191
  result.push(key);
2205
2192
  }
2206
2193
  }
@@ -2291,10 +2278,10 @@ var _getAllKeys = getAllKeys;
2291
2278
  var COMPARE_PARTIAL_FLAG$3 = 1;
2292
2279
 
2293
2280
  /** Used for built-in method references. */
2294
- var objectProto$2 = Object.prototype;
2281
+ var objectProto$1 = Object.prototype;
2295
2282
 
2296
2283
  /** Used to check objects for own properties. */
2297
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
2284
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2298
2285
 
2299
2286
  /**
2300
2287
  * A specialized version of `baseIsEqualDeep` for objects with support for
@@ -2322,7 +2309,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2322
2309
  var index = objLength;
2323
2310
  while (index--) {
2324
2311
  var key = objProps[index];
2325
- if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
2312
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
2326
2313
  return false;
2327
2314
  }
2328
2315
  }
@@ -2456,10 +2443,10 @@ var argsTag = '[object Arguments]',
2456
2443
  objectTag = '[object Object]';
2457
2444
 
2458
2445
  /** Used for built-in method references. */
2459
- var objectProto$1 = Object.prototype;
2446
+ var objectProto = Object.prototype;
2460
2447
 
2461
2448
  /** Used to check objects for own properties. */
2462
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
2449
+ var hasOwnProperty = objectProto.hasOwnProperty;
2463
2450
 
2464
2451
  /**
2465
2452
  * A specialized version of `baseIsEqual` for arrays and objects which performs
@@ -2502,8 +2489,8 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
2502
2489
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
2503
2490
  }
2504
2491
  if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
2505
- var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),
2506
- othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');
2492
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
2493
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
2507
2494
 
2508
2495
  if (objIsWrapped || othIsWrapped) {
2509
2496
  var objUnwrapped = objIsWrapped ? object.value() : object,
@@ -3437,131 +3424,6 @@ var sortBy = _baseRest(function(collection, iteratees) {
3437
3424
 
3438
3425
  var sortBy_1 = sortBy;
3439
3426
 
3440
- /**
3441
- * The base implementation of `assignValue` and `assignMergeValue` without
3442
- * value checks.
3443
- *
3444
- * @private
3445
- * @param {Object} object The object to modify.
3446
- * @param {string} key The key of the property to assign.
3447
- * @param {*} value The value to assign.
3448
- */
3449
- function baseAssignValue(object, key, value) {
3450
- if (key == '__proto__' && _defineProperty) {
3451
- _defineProperty(object, key, {
3452
- 'configurable': true,
3453
- 'enumerable': true,
3454
- 'value': value,
3455
- 'writable': true
3456
- });
3457
- } else {
3458
- object[key] = value;
3459
- }
3460
- }
3461
-
3462
- var _baseAssignValue = baseAssignValue;
3463
-
3464
- /**
3465
- * A specialized version of `baseAggregator` for arrays.
3466
- *
3467
- * @private
3468
- * @param {Array} [array] The array to iterate over.
3469
- * @param {Function} setter The function to set `accumulator` values.
3470
- * @param {Function} iteratee The iteratee to transform keys.
3471
- * @param {Object} accumulator The initial aggregated object.
3472
- * @returns {Function} Returns `accumulator`.
3473
- */
3474
- function arrayAggregator(array, setter, iteratee, accumulator) {
3475
- var index = -1,
3476
- length = array == null ? 0 : array.length;
3477
-
3478
- while (++index < length) {
3479
- var value = array[index];
3480
- setter(accumulator, value, iteratee(value), array);
3481
- }
3482
- return accumulator;
3483
- }
3484
-
3485
- var _arrayAggregator = arrayAggregator;
3486
-
3487
- /**
3488
- * Aggregates elements of `collection` on `accumulator` with keys transformed
3489
- * by `iteratee` and values set by `setter`.
3490
- *
3491
- * @private
3492
- * @param {Array|Object} collection The collection to iterate over.
3493
- * @param {Function} setter The function to set `accumulator` values.
3494
- * @param {Function} iteratee The iteratee to transform keys.
3495
- * @param {Object} accumulator The initial aggregated object.
3496
- * @returns {Function} Returns `accumulator`.
3497
- */
3498
- function baseAggregator(collection, setter, iteratee, accumulator) {
3499
- _baseEach(collection, function(value, key, collection) {
3500
- setter(accumulator, value, iteratee(value), collection);
3501
- });
3502
- return accumulator;
3503
- }
3504
-
3505
- var _baseAggregator = baseAggregator;
3506
-
3507
- /**
3508
- * Creates a function like `_.groupBy`.
3509
- *
3510
- * @private
3511
- * @param {Function} setter The function to set accumulator values.
3512
- * @param {Function} [initializer] The accumulator object initializer.
3513
- * @returns {Function} Returns the new aggregator function.
3514
- */
3515
- function createAggregator(setter, initializer) {
3516
- return function(collection, iteratee) {
3517
- var func = isArray_1(collection) ? _arrayAggregator : _baseAggregator,
3518
- accumulator = initializer ? initializer() : {};
3519
-
3520
- return func(collection, setter, _baseIteratee(iteratee), accumulator);
3521
- };
3522
- }
3523
-
3524
- var _createAggregator = createAggregator;
3525
-
3526
- /** Used for built-in method references. */
3527
- var objectProto = Object.prototype;
3528
-
3529
- /** Used to check objects for own properties. */
3530
- var hasOwnProperty = objectProto.hasOwnProperty;
3531
-
3532
- /**
3533
- * Creates an object composed of keys generated from the results of running
3534
- * each element of `collection` thru `iteratee`. The order of grouped values
3535
- * is determined by the order they occur in `collection`. The corresponding
3536
- * value of each key is an array of elements responsible for generating the
3537
- * key. The iteratee is invoked with one argument: (value).
3538
- *
3539
- * @static
3540
- * @memberOf _
3541
- * @since 0.1.0
3542
- * @category Collection
3543
- * @param {Array|Object} collection The collection to iterate over.
3544
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
3545
- * @returns {Object} Returns the composed aggregate object.
3546
- * @example
3547
- *
3548
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
3549
- * // => { '4': [4.2], '6': [6.1, 6.3] }
3550
- *
3551
- * // The `_.property` iteratee shorthand.
3552
- * _.groupBy(['one', 'two', 'three'], 'length');
3553
- * // => { '3': ['one', 'two'], '5': ['three'] }
3554
- */
3555
- var groupBy = _createAggregator(function(result, value, key) {
3556
- if (hasOwnProperty.call(result, key)) {
3557
- result[key].push(value);
3558
- } else {
3559
- _baseAssignValue(result, key, [value]);
3560
- }
3561
- });
3562
-
3563
- var groupBy_1 = groupBy;
3564
-
3565
3427
  var bind = function bind(fn, thisArg) {
3566
3428
  return function wrap() {
3567
3429
  var args = new Array(arguments.length);
@@ -5306,6 +5168,11 @@ axios_1.default = _default;
5306
5168
 
5307
5169
  var axios = axios_1;
5308
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
+
5309
5176
  var BusinessHourStatus;
5310
5177
  (function (BusinessHourStatus) {
5311
5178
  BusinessHourStatus[BusinessHourStatus["Open"] = 0] = "Open";
@@ -5313,40 +5180,34 @@ var BusinessHourStatus;
5313
5180
  BusinessHourStatus[BusinessHourStatus["ByAppointment"] = 2] = "ByAppointment";
5314
5181
  })(BusinessHourStatus || (BusinessHourStatus = {}));
5315
5182
  function createSalon(blob) {
5316
- const salonGeoLocations = blob.salon_geolocation || [];
5317
- const themeColors = {
5318
- 'allure24-blue': '89c8d2',
5319
- 'allure24-pink': 'ff7fa2',
5320
- 'the-shave': 'af8c45',
5321
- 'theme2-dark-green': '90c245',
5322
- 'theme2-green': 'bed451',
5323
- 'theme2-light-pink': 'd47b99',
5324
- 'theme2-purple': 'ab345c',
5325
- 'theme3-blue': '076dec',
5326
- 'theme3-layout1': 'd59b76',
5327
- 'theme3-layout2': 'b02858',
5328
- 'theme4-green': '5da826',
5329
- 'theme4': '08b89d',
5330
- 'theme5': 'f64c4d',
5331
- };
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
+ }
5332
5193
  return {
5333
5194
  id: blob.id,
5334
5195
  about: blob.about,
5335
5196
  email: blob.email,
5197
+ ownerName: blob.owner_name,
5336
5198
  fullProfileImage: blob.full_profile_image,
5337
5199
  fullCoverImage: blob.full_cover_image,
5338
- ownerName: blob.owner_name,
5339
5200
  subdomain: blob.subdomain,
5340
5201
  website: blob.website,
5341
5202
  businessName: blob.business_name,
5342
5203
  businessPhone: blob.business_phone,
5343
5204
  businessAddress: blob.business_address,
5344
- businessLocationLat: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lat : null,
5345
- 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,
5346
5207
  city: blob.city,
5347
5208
  state: blob.state,
5348
5209
  zipcode: blob.zipcode ? Number(blob.zipcode) : null,
5349
- businessHours: (blob.business_hours || blob.salon_workingtime || []).map(bh => {
5210
+ businessHours: (blob.business_hours || blob.salon_working_time || []).map(bh => {
5350
5211
  return {
5351
5212
  dayName: bh.day_name,
5352
5213
  openTime: bh.open_time,
@@ -5355,54 +5216,24 @@ function createSalon(blob) {
5355
5216
  };
5356
5217
  }),
5357
5218
  rating: Number(blob.rating_point),
5358
- primaryColor: themeColors[blob.default_mini_site_template] || themeColors['allure24-blue'],
5219
+ primaryColor: blob.primary_color || Colors.Primary,
5220
+ salonImages,
5359
5221
  };
5360
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
+ }
5361
5232
 
5362
5233
  var dayjs_min = createCommonjsModule(function (module, exports) {
5363
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}));
5364
5235
  });
5365
5236
 
5366
- const shortDate = 'DD MMM YYYY';
5367
- const apiDateFormat = 'YYYY-MM-DD HH:mm:ss';
5368
-
5369
- function createUser(blob) {
5370
- const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
5371
- return {
5372
- id: blob.user_id,
5373
- name: userNames.length > 0 ? userNames.join(' ') : blob.username,
5374
- firstName: blob.first_name,
5375
- lastName: blob.last_name,
5376
- avatar: blob.full_profile_image_thumb,
5377
- };
5378
- }
5379
-
5380
- function createFavesalonStyle(blob) {
5381
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
5382
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5383
- return {
5384
- id: blob.id,
5385
- caption: blob.caption,
5386
- description: blob.description,
5387
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5388
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
5389
- mediaType: blob.media_type,
5390
- fullImageUrl: blob.full_image_url,
5391
- fullImageUrlThumb: blob.full_image_url_thumb,
5392
- fullImageUrlMedium: blob.full_image_url_medium,
5393
- imgWidth: blob.img_w,
5394
- imgHeight: blob.img_h,
5395
- s3ImgWidth: blob.s3_img_w,
5396
- s3ImgHeight: blob.s3_img_h,
5397
- totalLike: blob.total_like,
5398
- totalDislike: blob.total_dislike,
5399
- totalShare: blob.total_shared,
5400
- totalView: blob.view_count,
5401
- totalBooking: blob.total_booking,
5402
- owner: blob.user ? createUser(blob.user) : null,
5403
- };
5404
- }
5405
-
5406
5237
  function createService(blob) {
5407
5238
  const photos = (blob.photo_link || []).map(photo => {
5408
5239
  return {
@@ -5430,18 +5261,169 @@ function createService(blob) {
5430
5261
 
5431
5262
  function createStylist(blob) {
5432
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);
5433
5266
  return {
5434
- id: Number(blob.stylist_id),
5435
- name: blob.title || [blob.first_name, blob.last_name].filter(field => !!field).join(' '),
5436
- firstName: blob.first_name,
5437
- lastName: blob.last_name,
5438
- avatar: blob.avatar,
5439
- 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,
5273
+ expertise: Boolean(blob.expertise),
5274
+ rating: Math.ceil((ratingPercentage * 5) / 100),
5275
+ };
5276
+ }
5277
+ function createStylistFromLookbook(blob) {
5278
+ const { user } = blob;
5279
+ const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
5280
+ const userNames = [user.first_name, user.last_name].filter(name => !!name);
5281
+ return {
5282
+ id: Number(blob.id),
5283
+ firstName: user.first_name,
5284
+ lastName: user.last_name,
5285
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.title),
5286
+ avatar: user.full_avatar || user.full_profile_image_thumb,
5287
+ phone: user.mobile_phone,
5440
5288
  expertise: Boolean(blob.expertise),
5441
5289
  rating: Math.ceil((ratingPercentage * 5) / 100),
5442
5290
  };
5443
5291
  }
5444
5292
 
5293
+ function createUser(blob) {
5294
+ const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
5295
+ return {
5296
+ id: blob.user_id,
5297
+ firstName: blob.first_name,
5298
+ lastName: blob.last_name,
5299
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
5300
+ avatar: blob.avatar || blob.full_profile_image_thumb,
5301
+ };
5302
+ }
5303
+
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({
5321
+ id: blob.id,
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
+ });
5338
+ }
5339
+ class Album {
5340
+ constructor(fields) {
5341
+ Object.assign(this, fields);
5342
+ }
5343
+ }
5344
+ function createAlbum(blob) {
5345
+ return new Album({
5346
+ id: blob.id,
5347
+ name: blob.name,
5348
+ caption: blob.caption,
5349
+ description: blob.description,
5350
+ tags: blob.tags ? blob.tags.filter(tag => !!tag) : [],
5351
+ salonId: blob.salon_id,
5352
+ stylistId: blob.stylist_id,
5353
+ totalMedias: blob.total_medias || 0,
5354
+ service: blob.service ? createService(blob.service) : null,
5355
+ isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
5356
+ });
5357
+ }
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({
5369
+ id: blob.id,
5370
+ type: blob.type,
5371
+ title: blob.content,
5372
+ description: blob.description,
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
+ });
5379
+ }
5380
+ class FaveStyle {
5381
+ constructor(fields) {
5382
+ Object.assign(this, fields);
5383
+ }
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({
5393
+ id: blob.id,
5394
+ caption: blob.caption,
5395
+ description: blob.description,
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,
5403
+ mediaType: blob.media_type,
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,
5412
+ owner: blob.user ? createUser(blob.user) : null,
5413
+ salonId: blob.salon_id ? Number(blob.salon_id) : null,
5414
+ salon: blob.salon ? createSalon(blob.salon) : null,
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;
5425
+ }
5426
+
5445
5427
  function createReviewPhoto(blob) {
5446
5428
  return {
5447
5429
  id: blob.id,
@@ -5451,15 +5433,15 @@ function createReviewPhoto(blob) {
5451
5433
  };
5452
5434
  }
5453
5435
  function createReview(blob) {
5454
- const reviewPhotos = blob.salon_review_photo || blob.beautician_review_photo || [];
5436
+ const reviewPhotos = blob.review_photo || [];
5455
5437
  const [createdDay, createdTime] = String(blob.create_date).split(' ');
5456
5438
  const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
5457
5439
  return {
5458
5440
  title: blob.title,
5459
- point: Math.ceil(Number(blob.avg_point)),
5460
5441
  description: blob.comment,
5461
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
5462
- 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)),
5463
5445
  pointView: blob.view_point,
5464
5446
  pointPrice: blob.price_point,
5465
5447
  pointProduct: blob.product_point,
@@ -5469,69 +5451,58 @@ function createReview(blob) {
5469
5451
  helpful: blob.helpful,
5470
5452
  recommend: blob.recommend,
5471
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,
5472
5456
  photos: reviewPhotos.map(createReviewPhoto),
5473
5457
  };
5474
5458
  }
5475
5459
 
5476
- var __rest = (undefined && undefined.__rest) || function (s, e) {
5477
- var t = {};
5478
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5479
- t[p] = s[p];
5480
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
5481
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5482
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
5483
- t[p[i]] = s[p[i]];
5484
- }
5485
- return t;
5486
- };
5460
+ const apiV2Prefix = 'api-ver2';
5487
5461
  class HttpService {
5488
5462
  constructor() {
5489
5463
  this.http = null;
5490
5464
  this.http = axios.create({
5491
5465
  baseURL: 'https://favesalon.com',
5466
+ // baseURL: 'http://13.57.216.170',
5492
5467
  headers: {},
5493
5468
  });
5494
5469
  }
5495
- fetchSalonInfo(salonId) {
5496
- const url = 'api/salon/settings-public';
5497
- return this.http.post(url, { salon_id: salonId })
5498
- .then((response) => {
5499
- const { status, data } = response.data;
5500
- return status && data ? createSalon(data.Salon) : null;
5501
- })
5502
- .catch(() => (null));
5503
- }
5504
- fetchReviews(url, options, allReviews) {
5505
- const { noLoop } = options, restOptions = __rest(options, ["noLoop"]);
5506
- return this.http.post(url, restOptions)
5470
+ fetchStyleDetail(styleId) {
5471
+ return this.http.get(`${apiV2Prefix}/style/${styleId}/detail`)
5507
5472
  .then((response) => {
5508
5473
  const { status, data } = response.data;
5509
5474
  if (status) {
5510
- const reviews = (data || []).filter(blob => Math.ceil(Number(blob.avg_point)) > 0).map(createReview);
5511
- // fetch next page's reviews
5512
- if (!noLoop && reviews.length >= options.limit) {
5513
- 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);
5514
5479
  }
5515
- const finalReviews = options.page === 1 ? reviews : allReviews.concat(reviews);
5516
- return {
5517
- totalReviews: finalReviews.length || 0,
5518
- allReviews: finalReviews,
5519
- };
5480
+ catch (e) { }
5481
+ return { styleInfo, similarStyles };
5520
5482
  }
5521
- return { totalReviews: 0, allReviews: [] };
5483
+ return { styleInfo: null, similarStyles: [] };
5484
+ })
5485
+ .catch(() => {
5486
+ return { styleInfo: null, similarStyles: [] };
5522
5487
  });
5523
5488
  }
5524
- fetchSalonReviews(salonId, options) {
5525
- const url = '/api/salon/reviews';
5526
- 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' }))
5527
5501
  .then(response => {
5528
- const { totalReviews, allReviews } = response;
5529
- return {
5530
- total: totalReviews,
5531
- allItems: allReviews,
5532
- };
5502
+ const { data } = response.data;
5503
+ return (data || []).slice(0, options.limit).map(createFaveStyle);
5533
5504
  })
5534
- .catch(() => ({ total: 0, allItems: [] }));
5505
+ .catch(() => ([]));
5535
5506
  }
5536
5507
  decorateServiceGroups(groups) {
5537
5508
  return groups.map((cate, index) => {
@@ -5558,7 +5529,7 @@ class HttpService {
5558
5529
  });
5559
5530
  }
5560
5531
  fetchSalonServices(salonId) {
5561
- const url = `api/salon/services?v=2&id=${salonId}`;
5532
+ const url = `${apiV1Prefix}/salon/services?v=2&id=${salonId}`;
5562
5533
  return this.http.get(url)
5563
5534
  .then(response => {
5564
5535
  const { status, data } = response.data;
@@ -5569,34 +5540,42 @@ class HttpService {
5569
5540
  })
5570
5541
  .catch(() => ([]));
5571
5542
  }
5572
- fetchSalonStylists(salonId) {
5573
- const fetchStylistSchedules = this.http.get(`api/calendar/resource/stylists?salon_id=${salonId}`)
5574
- .then((response) => {
5575
- const { status, data } = response.data;
5576
- return status ? (data || []) : [];
5577
- })
5578
- .catch(() => ([]));
5579
- const fetchStylistSkills = this.http.get(`api/salon/skill-stylists/${salonId}`)
5580
- .then((response) => {
5581
- const { status, data } = response.data;
5582
- 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
+ };
5583
5552
  })
5584
- .catch(() => ([]));
5585
- return Promise.all([fetchStylistSchedules, fetchStylistSkills])
5586
- .then(results => {
5587
- const [stylistSchedules, stylistSkills] = results;
5588
- const allStylistGroups = groupBy_1(stylistSchedules.concat(stylistSkills), stylist => stylist.id);
5589
- return Object.keys(allStylistGroups)
5590
- .filter(stylistId => Number(stylistId) > 0)
5591
- .map(stylistId => {
5592
- const [schedule, skills] = allStylistGroups[stylistId];
5593
- return createStylist(Object.assign(Object.assign({}, schedule), skills));
5594
- });
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
+ };
5595
5574
  })
5596
- .catch(() => []);
5575
+ .catch(() => ({ total: 0, stats: {}, data: [] }));
5597
5576
  }
5598
5577
  fetchSalonCategories() {
5599
- return this.http.post('api/home/get-service', { limit: 50 })
5578
+ return this.http.post(`${apiV2Prefix}/search/get-services`, { limit: 50 })
5600
5579
  .then((response) => {
5601
5580
  const { status, data } = response.data;
5602
5581
  if (status) {
@@ -5615,58 +5594,34 @@ class HttpService {
5615
5594
  }
5616
5595
  fetchSalonLookbooks(salonId, options) {
5617
5596
  const noResult = { total: 0, allLookbooks: [] };
5618
- return this.http.post('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options))
5619
- .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 => {
5620
5601
  const { status, data, paging } = response.data;
5621
5602
  if (status) {
5622
5603
  return {
5623
5604
  total: paging.total_item || 0,
5624
- allLookbooks: (data || []).map(createFavesalonStyle),
5605
+ allLookbooks: (data || []).map(createFaveStyle),
5625
5606
  };
5626
5607
  }
5627
5608
  return noResult;
5628
5609
  })
5629
5610
  .catch(() => (noResult));
5630
5611
  }
5631
- fetchSalonPhotos(salonId) {
5632
- return this.http
5633
- .post('api/style/filter', {
5634
- page: 1,
5635
- limit: 20,
5636
- salon_id: salonId,
5637
- })
5638
- .then((response) => {
5639
- const { status, data } = response.data;
5640
- if (status) {
5641
- return (data || []).map(createFavesalonStyle);
5642
- }
5643
- return [];
5612
+ fetchStyleComments(styleId) {
5613
+ const url = `${apiV2Prefix}/style/comment?photo_id=${styleId}`;
5614
+ return this.http.get(url)
5615
+ .then(response => {
5616
+ const { paging, data } = response.data;
5617
+ return {
5618
+ total: paging.total_item || 0,
5619
+ data: data.map(createFaveStyleComment),
5620
+ };
5644
5621
  })
5645
- .catch(() => {
5646
- return [];
5647
- });
5648
- }
5649
- fetchAllStyles(url, options, allStyles) {
5650
- return this.http.post(url, options)
5651
- .then((response) => {
5652
- const { status, data } = response.data;
5653
- if (status) {
5654
- const styles = (data || []).map(createFavesalonStyle);
5655
- // fetch next page styles
5656
- if (styles.length >= options.limit) {
5657
- return this.fetchAllStyles(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allStyles.concat(styles));
5658
- }
5659
- return options.page === 1 ? styles : allStyles;
5660
- }
5661
- return allStyles;
5662
- });
5663
- }
5664
- fetchAllSalonPhotos(salonId, options) {
5665
- return this.fetchAllStyles('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options), []).catch(() => {
5666
- return [];
5667
- });
5622
+ .catch(() => ({ total: 0, data: [] }));
5668
5623
  }
5669
5624
  }
5670
5625
  const HttpService$1 = () => new HttpService();
5671
5626
 
5672
- 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 };