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,4 @@
1
- import { h, proxyCustomElement } from '@stencil/core/internal/client';
1
+ import { getAssetPath, h, proxyCustomElement } from '@stencil/core/internal/client';
2
2
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
3
3
 
4
4
  /*!
@@ -705,44 +705,112 @@ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client'
705
705
  return R(Mn), g(Mn), { Alert: W, Button: z, Carousel: st, Collapse: pt, Dropdown: hi, Modal: Hi, Offcanvas: Fi, Popover: gn, ScrollSpy: An, Tab: xn, Toast: Mn, Tooltip: un };
706
706
  }));
707
707
 
708
- const indexCss$g = "#google-map-container,google-map{display:block;width:100%;height:100%}";
708
+ const Colors = {
709
+ TextColor: '#141414',
710
+ Black: '#000000',
711
+ White: '#ffffff',
712
+ Primary: '#F05A61',
713
+ Secondary: '#001529',
714
+ Black01: '#262626',
715
+ Black02: '#1f1f1f',
716
+ Black03: '#141414',
717
+ Gray01: '#F5F5F5',
718
+ Gray02: '#EFEFEF',
719
+ Gray03: '#DBDBDB',
720
+ Gray04: '#999999',
721
+ Gray05: '#666666',
722
+ Red01: '#FEEFEF',
723
+ Red02: '#F9BDC0',
724
+ Red03: '#F05A61',
725
+ Red04: '#C0484E',
726
+ Red05: '#90363A',
727
+ Orange01: '#FFF4F0',
728
+ Orange02: '#FFD1C3',
729
+ Orange03: '#FF8D69',
730
+ Orange04: '#CC7154',
731
+ Orange05: '#99553F',
732
+ Yellow01: '#FDFBF4',
733
+ Yellow02: '#F8EDD3',
734
+ Yellow03: '#EED291',
735
+ Yellow04: '#BEA874',
736
+ Yellow05: '#8F7E57',
737
+ Lilac01: '#F3F0F4',
738
+ Lilac02: '#CFC1D4',
739
+ Lilac03: '#886594',
740
+ Lilac04: '#6D5176',
741
+ Lilac05: '#523D59',
742
+ Blue01: '#EAECEE',
743
+ Blue02: '#AAB1BD',
744
+ Blue03: '#2B3C59',
745
+ Blue04: '#223047',
746
+ Blue05: '#1A2435',
747
+ Green01: '#ECF7ED',
748
+ Green02: '#B2E1B9',
749
+ Green03: '#3FB34F',
750
+ Green04: '#328F3F',
751
+ Green05: '#266B2F',
752
+ Success01: '#EEF9E8',
753
+ Success02: '#BAE7A3',
754
+ Success03: '#52C41A',
755
+ Success04: '#429D15',
756
+ Success05: '#317610',
757
+ Error01: '#FFEDED',
758
+ Error02: '#FFB8B9',
759
+ Error03: '#FF4D4F',
760
+ Error04: '#CC3E3F',
761
+ Error05: '#992E2F',
762
+ Warning01: '#FFF7E8',
763
+ Warning02: '#FDDEA1',
764
+ Warning03: '#FAAD14',
765
+ Warning04: '#C88A10',
766
+ Warning05: '#96680C',
767
+ Info01: '#E8F4FF',
768
+ Info02: '#A3D3FF',
769
+ Info03: '#1890FF',
770
+ Info04: '#1373CC',
771
+ Info05: '#0E5699',
772
+ };
773
+
774
+ const indexCss$g = "google-map{display:block;width:100%;height:100%}";
709
775
 
710
776
  let GoogleMap$1 = class extends HTMLElement {
711
777
  constructor() {
712
778
  super();
713
779
  this.__registerHost();
714
- this.apiKey = 'AIzaSyBW4PbW9aM2FXZl83Gs7jeRmekEWSzC1sY';
715
- }
716
- componentDidLoad() {
717
- this.injectSDK().then(() => {
718
- setTimeout(() => this.initMap(), 300);
719
- });
720
- }
721
- injectSDK() {
722
- return new Promise((resolve) => {
723
- window['mapInit'] = () => resolve(true);
724
- const script = document.createElement('script');
725
- script.id = 'googleMaps';
726
- if (this.apiKey) {
727
- script.src = 'https://maps.googleapis.com/maps/api/js?key=' + this.apiKey + '&callback=mapInit';
728
- }
729
- else {
730
- script.src = 'https://maps.googleapis.com/maps/api/js?callback=mapInit';
731
- }
732
- document.body.appendChild(script);
733
- return resolve(true);
734
- });
735
- }
736
- initMap() {
737
- const mapOptions = {
738
- center: { lat: this.lat, lng: this.lng },
739
- zoom: 8,
740
- };
741
- this.map = new window.google.maps.Map(document.getElementById('google-map-container'), mapOptions);
742
780
  }
743
781
  render() {
744
- return h("div", { id: 'google-map-container' });
745
- }
782
+ const mapPlaceholder = getAssetPath('./assets/map--placeholder.jpeg');
783
+ return (h("div", { style: {
784
+ backgroundImage: `url("${mapPlaceholder}")`,
785
+ backgroundColor: Colors.Gray01,
786
+ backgroundPosition: 'center center',
787
+ backgroundRepeat: 'no-repeat',
788
+ backgroundSize: 'cover',
789
+ borderRadius: '8px',
790
+ position: 'relative',
791
+ height: '296px',
792
+ } }, h("div", { style: {
793
+ position: 'absolute',
794
+ left: '50%',
795
+ top: '50%',
796
+ transform: 'translate(-50%, -50%)',
797
+ } }, h("a", { target: "_blank", rel: "noopener noreferrer", href: `https://www.google.com/maps/search/?api=1&query=${this.locationAddress}`, style: {
798
+ backgroundColor: Colors.Red01,
799
+ border: `1px solid ${Colors.Red02}`,
800
+ borderRadius: '4px',
801
+ color: Colors.TextColor,
802
+ padding: '12px',
803
+ display: 'flex',
804
+ flexWrap: 'wrap',
805
+ height: 'auto',
806
+ width: 'auto',
807
+ whiteSpace: 'normal',
808
+ textAlign: 'left',
809
+ maxWidth: '320px',
810
+ textDecoration: 'none',
811
+ } }, this.locationName && h("span", { style: { fontSize: '16px', marginBottom: '4px' } }, this.locationName), this.locationAddress && h("span", { style: { fontSize: '12px' } }, this.locationAddress)), h("div", { style: { marginTop: '8px', textAlign: 'center' } }, h("i", { class: "ri-map-pin-fill", style: { fontSize: '24px' } })))));
812
+ }
813
+ static get assetsDirs() { return ["assets"]; }
746
814
  static get style() { return indexCss$g; }
747
815
  };
748
816
 
@@ -2707,7 +2775,7 @@ object-assign
2707
2775
  */
2708
2776
  /* eslint-disable no-unused-vars */
2709
2777
  var getOwnPropertySymbols = Object.getOwnPropertySymbols;
2710
- var hasOwnProperty$a = Object.prototype.hasOwnProperty;
2778
+ var hasOwnProperty$9 = Object.prototype.hasOwnProperty;
2711
2779
  var propIsEnumerable = Object.prototype.propertyIsEnumerable;
2712
2780
 
2713
2781
  function toObject(val) {
@@ -2771,7 +2839,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
2771
2839
  from = Object(arguments[s]);
2772
2840
 
2773
2841
  for (var key in from) {
2774
- if (hasOwnProperty$a.call(from, key)) {
2842
+ if (hasOwnProperty$9.call(from, key)) {
2775
2843
  to[key] = from[key];
2776
2844
  }
2777
2845
  }
@@ -5167,99 +5235,7 @@ function attribsFor() {
5167
5235
  }
5168
5236
  });
5169
5237
 
5170
- const Colors = {
5171
- // Neutral Color
5172
- Black: '#000000',
5173
- White: '#ffffff',
5174
- Primary: '#5C1973',
5175
- Danger: '#E92626',
5176
- Success: '#3FB34F',
5177
- Warning: '#F17714',
5178
- Info: '#013385',
5179
- Black01: '#141414',
5180
- Black02: '#1f1f1f',
5181
- Black03: '#262626',
5182
- Gray01: '#333333',
5183
- Gray02: '#666666',
5184
- Gray03: '#999999',
5185
- Gray04: '#DBDBDB',
5186
- Gray05: '#EFEFEF',
5187
- Gray06: '#F5F5F5',
5188
- // Accent Colors
5189
- DarkBlue01: '#E8E8EF',
5190
- DarkBlue02: '#7674A0',
5191
- DarkBlue03: '#1B1761',
5192
- DarkBlue04: '#100E3A',
5193
- DarkBlue05: '#08071D',
5194
- Violet01: '#EFE8F1',
5195
- Violet02: '#9D75AB',
5196
- Violet03: '#5C1973',
5197
- Violet04: '#370F45',
5198
- Violet05: '#1C0722',
5199
- Pink01: '#FDE9F2',
5200
- Pink02: '#F27DAF',
5201
- Pink03: '#E9267A',
5202
- Pink04: '#8C1749',
5203
- Pink05: '#2F0818',
5204
- Blue01: '#E6EBF3',
5205
- Blue02: '#6785B6',
5206
- Blue03: '#013385',
5207
- Blue04: '#011F50',
5208
- Blue05: '#000F28',
5209
- Green01: '#ECF7ED',
5210
- Green02: '#8CD195',
5211
- Green03: '#3FB34F',
5212
- Green04: '#266B2F',
5213
- Green05: '#0D2410',
5214
- Orange01: '#FEF1E8',
5215
- Orange02: '#F7AD72',
5216
- Orange03: '#F17714',
5217
- Orange04: '#91470C',
5218
- Orange05: '#301804',
5219
- Yellow01: '#FFFAED',
5220
- Yellow02: '#FDE392',
5221
- Yellow03: '#FCD14A',
5222
- Yellow04: '#977D2C',
5223
- Yellow05: '#322A0F',
5224
- Red01: '#FD2727',
5225
- Red02: '#FF4D4F',
5226
- Red03: '#FFA39E',
5227
- Red04: '#FFCCC7',
5228
- Red05: '#FFF1F0',
5229
- // deprecated
5230
- BluePurple01: '#2D3B8A',
5231
- BluePurple02: '#36459D',
5232
- BluePurple03: '#5760A1',
5233
- BluePurple04: '#828AB9',
5234
- BluePurple05: '#ABB0D0',
5235
- Coral01: '#F16B68',
5236
- Coral02: '#F68A87',
5237
- Coral03: '#F7A6A3',
5238
- Coral04: '#FAC4C2',
5239
- Coral05: '#FCE0DF',
5240
- YellowLight01: '#F0E902',
5241
- YellowLight02: '#F5ED33',
5242
- YellowLight03: '#F8F266',
5243
- YellowLight04: '#FAF599',
5244
- YellowLight05: '#FCF9CC',
5245
- YellowCyber01: '#FDCF00',
5246
- YellowCyber02: '#FCD932',
5247
- YellowCyber03: '#FFE365',
5248
- YellowCyber04: '#FFED99',
5249
- YellowCyber05: '#FFF5CC',
5250
- Turquoise01: '#00E4CB',
5251
- Turquoise02: '#33E8D6',
5252
- Turquoise03: '#67F0DF',
5253
- Turquoise04: '#99F4EB',
5254
- Turquoise05: '#CCFAF5',
5255
- Purple01: '#8A5BED',
5256
- Purple02: '#9970F0',
5257
- Purple03: '#B394F2',
5258
- Purple04: '#CCB8F7',
5259
- Purple05: '#E6DBFA',
5260
- };
5261
-
5262
- const indexCss$f = ".salon-modal.salon-modal--booking:before{display:none}.salon-modal.salon-modal--booking .salon-modal--inner,.salon-modal.salon-modal--booking .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--booking .salon-modal--close{width:48px;height:48px;right:10px;top:12px}@media (min-width: 576px){.salon-modal.salon-modal--booking .salon-modal--close{right:16px}}@media (min-width: 768px){.salon-modal.salon-modal--booking .salon-modal--close{right:24px}}@media (min-width: 1200px){.salon-modal.salon-modal--booking .salon-modal--close{right:50%;margin-right:-585px}}";
5238
+ const indexCss$f = ".salon-modal.salon-modal--booking:before{display:none}.salon-modal.salon-modal--booking .salon-modal--inner,.salon-modal.salon-modal--booking .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--booking .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--booking .salon-modal--close{right:20px;top:20px}}";
5263
5239
 
5264
5240
  let SalonBooking$1 = class extends HTMLElement {
5265
5241
  constructor() {
@@ -5267,7 +5243,7 @@ let SalonBooking$1 = class extends HTMLElement {
5267
5243
  this.__registerHost();
5268
5244
  this.buttonClass = '';
5269
5245
  this.buttonText = 'Book now';
5270
- this.primaryColor = Colors.Coral03;
5246
+ this.primaryColor = Colors.Primary;
5271
5247
  }
5272
5248
  openModal() {
5273
5249
  const elBookingModal = document.createElement('div');
@@ -5300,13 +5276,13 @@ let SalonBooking$1 = class extends HTMLElement {
5300
5276
  static get style() { return indexCss$f; }
5301
5277
  };
5302
5278
 
5303
- const indexCss$e = ".salon-modal.salon-modal--booking:before{display:none}.salon-modal.salon-modal--booking .salon-modal--inner,.salon-modal.salon-modal--booking .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--booking .salon-modal--close{width:48px;height:48px;right:10px;top:12px}@media (min-width: 576px){.salon-modal.salon-modal--booking .salon-modal--close{right:16px}}@media (min-width: 768px){.salon-modal.salon-modal--booking .salon-modal--close{right:24px}}@media (min-width: 1200px){.salon-modal.salon-modal--booking .salon-modal--close{right:50%;margin-right:-585px}}";
5279
+ const indexCss$e = ".salon-modal.salon-modal--booking:before{display:none}.salon-modal.salon-modal--booking .salon-modal--inner,.salon-modal.salon-modal--booking .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--booking .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--booking .salon-modal--close{right:20px;top:20px}}";
5304
5280
 
5305
- let SalonBookingModal$2 = class extends HTMLElement {
5281
+ let SalonBookingModal$1 = class extends HTMLElement {
5306
5282
  constructor() {
5307
5283
  super();
5308
5284
  this.__registerHost();
5309
- this.primaryColor = Colors.Coral03;
5285
+ this.primaryColor = Colors.Primary;
5310
5286
  this.redirectUrl = window.btoa(window.location.href);
5311
5287
  this.isModalOpen = true;
5312
5288
  }
@@ -5317,28 +5293,72 @@ let SalonBookingModal$2 = class extends HTMLElement {
5317
5293
  }
5318
5294
  render() {
5319
5295
  const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
5320
- return (h("div", { class: "salon-booking--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--booking" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/booking?salonId=${this.salonId}&primaryColor=${primaryColor}&redirectUrl=${this.redirectUrl}` })))))));
5296
+ return (h("div", { class: "salon-booking--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--booking" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/booking?salonId=${this.salonId}&primaryColor=${primaryColor}&closeAble=false` })))))));
5321
5297
  }
5322
5298
  static get style() { return indexCss$e; }
5323
5299
  };
5324
5300
 
5325
- function formatWebsiteUrl(website) {
5326
- return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
5327
- }
5328
- function formatFullAddress(salon) {
5329
- const { businessAddress, city, state, zipcode, } = salon || {};
5330
- const stateFields = [state, zipcode].filter(field => !!field);
5331
- if (businessAddress) {
5332
- return [businessAddress, city]
5333
- .filter(field => !!field)
5334
- .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
5335
- .join(', ');
5301
+ const indexCss$d = ".salon-modal.salon-modal--gift-card:before{display:none}.salon-modal.salon-modal--gift-card .salon-modal--inner,.salon-modal.salon-modal--gift-card .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--gift-card .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--gift-card .salon-modal--close{right:20px;top:20px}}";
5302
+
5303
+ let SalonGiftCard$1 = class extends HTMLElement {
5304
+ constructor() {
5305
+ super();
5306
+ this.__registerHost();
5307
+ this.buttonClass = '';
5308
+ this.buttonText = 'Buy Gift card';
5309
+ this.primaryColor = Colors.Primary;
5336
5310
  }
5337
- return null;
5338
- }
5339
- function getRatingText() {
5340
- return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
5341
- }
5311
+ openModal() {
5312
+ const elBookingModal = document.createElement('div');
5313
+ elBookingModal.innerHTML = `
5314
+ <salon-gift-card-modal
5315
+ salon-id=${this.salonId}
5316
+ primary-color=${this.primaryColor}
5317
+ ></salon-gift-card-modal>
5318
+ `;
5319
+ document.body.appendChild(elBookingModal);
5320
+ }
5321
+ render() {
5322
+ const buttonClass = this.buttonClass || 'btn btn-primary';
5323
+ let buttonStyle = {};
5324
+ if (!this.buttonClass) {
5325
+ const primaryColor = color(this.primaryColor);
5326
+ const primaryColorHover = primaryColor.darken(0.05);
5327
+ buttonStyle = lib.css({
5328
+ backgroundColor: this.primaryColor,
5329
+ borderColor: this.primaryColor,
5330
+ color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
5331
+ ':hover': {
5332
+ backgroundColor: primaryColorHover,
5333
+ borderColor: primaryColorHover,
5334
+ },
5335
+ });
5336
+ }
5337
+ return (h("div", { class: "salon-gift-card" }, h("div", { class: "salon-gift-card--button" }, h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
5338
+ }
5339
+ static get style() { return indexCss$d; }
5340
+ };
5341
+
5342
+ const indexCss$c = ".salon-modal.salon-modal--gift-card:before{display:none}.salon-modal.salon-modal--gift-card .salon-modal--inner,.salon-modal.salon-modal--gift-card .salon-modal--content{max-width:none;width:100%;height:100%}.salon-modal.salon-modal--gift-card .salon-modal--close{background-color:#EFEFEF;width:40px;height:40px;right:16px;top:16px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px}@media (min-width: 768px){.salon-modal.salon-modal--gift-card .salon-modal--close{right:20px;top:20px}}";
5343
+
5344
+ let SalonGiftCardModal$1 = class extends HTMLElement {
5345
+ constructor() {
5346
+ super();
5347
+ this.__registerHost();
5348
+ this.primaryColor = Colors.Primary;
5349
+ this.isModalOpen = true;
5350
+ }
5351
+ closeModal() {
5352
+ this.isModalOpen = false;
5353
+ const el = document.querySelector('salon-gift-card-modal');
5354
+ el.remove();
5355
+ }
5356
+ render() {
5357
+ const primaryColor = this.primaryColor.split('#')[1] || 'd47b99';
5358
+ return (h("div", { class: "salon-gift-card--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--gift-card" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/r/buy-gift-card?salonId=${this.salonId}&primaryColor=${primaryColor}&closeAble=false` })))))));
5359
+ }
5360
+ static get style() { return indexCss$c; }
5361
+ };
5342
5362
 
5343
5363
  /**
5344
5364
  * Appends the elements of `values` to `array`.
@@ -5380,17 +5400,17 @@ var Symbol$1 = _root.Symbol;
5380
5400
  var _Symbol = Symbol$1;
5381
5401
 
5382
5402
  /** Used for built-in method references. */
5383
- var objectProto$c = Object.prototype;
5403
+ var objectProto$b = Object.prototype;
5384
5404
 
5385
5405
  /** Used to check objects for own properties. */
5386
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
5406
+ var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
5387
5407
 
5388
5408
  /**
5389
5409
  * Used to resolve the
5390
5410
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
5391
5411
  * of values.
5392
5412
  */
5393
- var nativeObjectToString$1 = objectProto$c.toString;
5413
+ var nativeObjectToString$1 = objectProto$b.toString;
5394
5414
 
5395
5415
  /** Built-in value references. */
5396
5416
  var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
@@ -5403,7 +5423,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
5403
5423
  * @returns {string} Returns the raw `toStringTag`.
5404
5424
  */
5405
5425
  function getRawTag(value) {
5406
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
5426
+ var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
5407
5427
  tag = value[symToStringTag$1];
5408
5428
 
5409
5429
  try {
@@ -5425,14 +5445,14 @@ function getRawTag(value) {
5425
5445
  var _getRawTag = getRawTag;
5426
5446
 
5427
5447
  /** Used for built-in method references. */
5428
- var objectProto$b = Object.prototype;
5448
+ var objectProto$a = Object.prototype;
5429
5449
 
5430
5450
  /**
5431
5451
  * Used to resolve the
5432
5452
  * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
5433
5453
  * of values.
5434
5454
  */
5435
- var nativeObjectToString = objectProto$b.toString;
5455
+ var nativeObjectToString = objectProto$a.toString;
5436
5456
 
5437
5457
  /**
5438
5458
  * Converts `value` to a string using `Object.prototype.toString`.
@@ -5519,13 +5539,13 @@ function baseIsArguments(value) {
5519
5539
  var _baseIsArguments = baseIsArguments;
5520
5540
 
5521
5541
  /** Used for built-in method references. */
5522
- var objectProto$a = Object.prototype;
5542
+ var objectProto$9 = Object.prototype;
5523
5543
 
5524
5544
  /** Used to check objects for own properties. */
5525
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
5545
+ var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
5526
5546
 
5527
5547
  /** Built-in value references. */
5528
- var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
5548
+ var propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable;
5529
5549
 
5530
5550
  /**
5531
5551
  * Checks if `value` is likely an `arguments` object.
@@ -5546,7 +5566,7 @@ var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
5546
5566
  * // => false
5547
5567
  */
5548
5568
  var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
5549
- return isObjectLike_1(value) && hasOwnProperty$8.call(value, 'callee') &&
5569
+ return isObjectLike_1(value) && hasOwnProperty$7.call(value, 'callee') &&
5550
5570
  !propertyIsEnumerable$1.call(value, 'callee');
5551
5571
  };
5552
5572
 
@@ -5837,17 +5857,17 @@ var reIsHostCtor = /^\[object .+?Constructor\]$/;
5837
5857
 
5838
5858
  /** Used for built-in method references. */
5839
5859
  var funcProto = Function.prototype,
5840
- objectProto$9 = Object.prototype;
5860
+ objectProto$8 = Object.prototype;
5841
5861
 
5842
5862
  /** Used to resolve the decompiled source of functions. */
5843
5863
  var funcToString = funcProto.toString;
5844
5864
 
5845
5865
  /** Used to check objects for own properties. */
5846
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
5866
+ var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
5847
5867
 
5848
5868
  /** Used to detect if a method is native. */
5849
5869
  var reIsNative = RegExp('^' +
5850
- funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
5870
+ funcToString.call(hasOwnProperty$6).replace(reRegExpChar, '\\$&')
5851
5871
  .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
5852
5872
  );
5853
5873
 
@@ -5939,10 +5959,10 @@ var _hashDelete = hashDelete;
5939
5959
  var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
5940
5960
 
5941
5961
  /** Used for built-in method references. */
5942
- var objectProto$8 = Object.prototype;
5962
+ var objectProto$7 = Object.prototype;
5943
5963
 
5944
5964
  /** Used to check objects for own properties. */
5945
- var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
5965
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
5946
5966
 
5947
5967
  /**
5948
5968
  * Gets the hash value for `key`.
@@ -5959,16 +5979,16 @@ function hashGet(key) {
5959
5979
  var result = data[key];
5960
5980
  return result === HASH_UNDEFINED$2 ? undefined : result;
5961
5981
  }
5962
- return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
5982
+ return hasOwnProperty$5.call(data, key) ? data[key] : undefined;
5963
5983
  }
5964
5984
 
5965
5985
  var _hashGet = hashGet;
5966
5986
 
5967
5987
  /** Used for built-in method references. */
5968
- var objectProto$7 = Object.prototype;
5988
+ var objectProto$6 = Object.prototype;
5969
5989
 
5970
5990
  /** Used to check objects for own properties. */
5971
- var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
5991
+ var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
5972
5992
 
5973
5993
  /**
5974
5994
  * Checks if a hash value for `key` exists.
@@ -5981,7 +6001,7 @@ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
5981
6001
  */
5982
6002
  function hashHas(key) {
5983
6003
  var data = this.__data__;
5984
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
6004
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$4.call(data, key);
5985
6005
  }
5986
6006
 
5987
6007
  var _hashHas = hashHas;
@@ -7130,10 +7150,10 @@ function stubArray() {
7130
7150
  var stubArray_1 = stubArray;
7131
7151
 
7132
7152
  /** Used for built-in method references. */
7133
- var objectProto$6 = Object.prototype;
7153
+ var objectProto$5 = Object.prototype;
7134
7154
 
7135
7155
  /** Built-in value references. */
7136
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
7156
+ var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
7137
7157
 
7138
7158
  /* Built-in method references for those with the same name as other `lodash` methods. */
7139
7159
  var nativeGetSymbols = Object.getOwnPropertySymbols;
@@ -7425,10 +7445,10 @@ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsType
7425
7445
  var isTypedArray_1 = isTypedArray;
7426
7446
 
7427
7447
  /** Used for built-in method references. */
7428
- var objectProto$5 = Object.prototype;
7448
+ var objectProto$4 = Object.prototype;
7429
7449
 
7430
7450
  /** Used to check objects for own properties. */
7431
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
7451
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
7432
7452
 
7433
7453
  /**
7434
7454
  * Creates an array of the enumerable property names of the array-like `value`.
@@ -7448,7 +7468,7 @@ function arrayLikeKeys(value, inherited) {
7448
7468
  length = result.length;
7449
7469
 
7450
7470
  for (var key in value) {
7451
- if ((inherited || hasOwnProperty$4.call(value, key)) &&
7471
+ if ((inherited || hasOwnProperty$3.call(value, key)) &&
7452
7472
  !(skipIndexes && (
7453
7473
  // Safari 9 has enumerable `arguments.length` in strict mode.
7454
7474
  key == 'length' ||
@@ -7468,7 +7488,7 @@ function arrayLikeKeys(value, inherited) {
7468
7488
  var _arrayLikeKeys = arrayLikeKeys;
7469
7489
 
7470
7490
  /** Used for built-in method references. */
7471
- var objectProto$4 = Object.prototype;
7491
+ var objectProto$3 = Object.prototype;
7472
7492
 
7473
7493
  /**
7474
7494
  * Checks if `value` is likely a prototype object.
@@ -7479,7 +7499,7 @@ var objectProto$4 = Object.prototype;
7479
7499
  */
7480
7500
  function isPrototype(value) {
7481
7501
  var Ctor = value && value.constructor,
7482
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
7502
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
7483
7503
 
7484
7504
  return value === proto;
7485
7505
  }
@@ -7508,10 +7528,10 @@ var nativeKeys = _overArg(Object.keys, Object);
7508
7528
  var _nativeKeys = nativeKeys;
7509
7529
 
7510
7530
  /** Used for built-in method references. */
7511
- var objectProto$3 = Object.prototype;
7531
+ var objectProto$2 = Object.prototype;
7512
7532
 
7513
7533
  /** Used to check objects for own properties. */
7514
- var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
7534
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
7515
7535
 
7516
7536
  /**
7517
7537
  * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
@@ -7526,7 +7546,7 @@ function baseKeys(object) {
7526
7546
  }
7527
7547
  var result = [];
7528
7548
  for (var key in Object(object)) {
7529
- if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
7549
+ if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
7530
7550
  result.push(key);
7531
7551
  }
7532
7552
  }
@@ -7617,10 +7637,10 @@ var _getAllKeys = getAllKeys;
7617
7637
  var COMPARE_PARTIAL_FLAG$3 = 1;
7618
7638
 
7619
7639
  /** Used for built-in method references. */
7620
- var objectProto$2 = Object.prototype;
7640
+ var objectProto$1 = Object.prototype;
7621
7641
 
7622
7642
  /** Used to check objects for own properties. */
7623
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
7643
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
7624
7644
 
7625
7645
  /**
7626
7646
  * A specialized version of `baseIsEqualDeep` for objects with support for
@@ -7648,7 +7668,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
7648
7668
  var index = objLength;
7649
7669
  while (index--) {
7650
7670
  var key = objProps[index];
7651
- if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
7671
+ if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
7652
7672
  return false;
7653
7673
  }
7654
7674
  }
@@ -7782,10 +7802,10 @@ var argsTag = '[object Arguments]',
7782
7802
  objectTag = '[object Object]';
7783
7803
 
7784
7804
  /** Used for built-in method references. */
7785
- var objectProto$1 = Object.prototype;
7805
+ var objectProto = Object.prototype;
7786
7806
 
7787
7807
  /** Used to check objects for own properties. */
7788
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
7808
+ var hasOwnProperty = objectProto.hasOwnProperty;
7789
7809
 
7790
7810
  /**
7791
7811
  * A specialized version of `baseIsEqual` for arrays and objects which performs
@@ -7828,8 +7848,8 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
7828
7848
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
7829
7849
  }
7830
7850
  if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
7831
- var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, '__wrapped__'),
7832
- othIsWrapped = othIsObj && hasOwnProperty$1.call(other, '__wrapped__');
7851
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
7852
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
7833
7853
 
7834
7854
  if (objIsWrapped || othIsWrapped) {
7835
7855
  var objUnwrapped = objIsWrapped ? object.value() : object,
@@ -8763,131 +8783,6 @@ var sortBy = _baseRest(function(collection, iteratees) {
8763
8783
 
8764
8784
  var sortBy_1 = sortBy;
8765
8785
 
8766
- /**
8767
- * The base implementation of `assignValue` and `assignMergeValue` without
8768
- * value checks.
8769
- *
8770
- * @private
8771
- * @param {Object} object The object to modify.
8772
- * @param {string} key The key of the property to assign.
8773
- * @param {*} value The value to assign.
8774
- */
8775
- function baseAssignValue(object, key, value) {
8776
- if (key == '__proto__' && _defineProperty) {
8777
- _defineProperty(object, key, {
8778
- 'configurable': true,
8779
- 'enumerable': true,
8780
- 'value': value,
8781
- 'writable': true
8782
- });
8783
- } else {
8784
- object[key] = value;
8785
- }
8786
- }
8787
-
8788
- var _baseAssignValue = baseAssignValue;
8789
-
8790
- /**
8791
- * A specialized version of `baseAggregator` for arrays.
8792
- *
8793
- * @private
8794
- * @param {Array} [array] The array to iterate over.
8795
- * @param {Function} setter The function to set `accumulator` values.
8796
- * @param {Function} iteratee The iteratee to transform keys.
8797
- * @param {Object} accumulator The initial aggregated object.
8798
- * @returns {Function} Returns `accumulator`.
8799
- */
8800
- function arrayAggregator(array, setter, iteratee, accumulator) {
8801
- var index = -1,
8802
- length = array == null ? 0 : array.length;
8803
-
8804
- while (++index < length) {
8805
- var value = array[index];
8806
- setter(accumulator, value, iteratee(value), array);
8807
- }
8808
- return accumulator;
8809
- }
8810
-
8811
- var _arrayAggregator = arrayAggregator;
8812
-
8813
- /**
8814
- * Aggregates elements of `collection` on `accumulator` with keys transformed
8815
- * by `iteratee` and values set by `setter`.
8816
- *
8817
- * @private
8818
- * @param {Array|Object} collection The collection to iterate over.
8819
- * @param {Function} setter The function to set `accumulator` values.
8820
- * @param {Function} iteratee The iteratee to transform keys.
8821
- * @param {Object} accumulator The initial aggregated object.
8822
- * @returns {Function} Returns `accumulator`.
8823
- */
8824
- function baseAggregator(collection, setter, iteratee, accumulator) {
8825
- _baseEach(collection, function(value, key, collection) {
8826
- setter(accumulator, value, iteratee(value), collection);
8827
- });
8828
- return accumulator;
8829
- }
8830
-
8831
- var _baseAggregator = baseAggregator;
8832
-
8833
- /**
8834
- * Creates a function like `_.groupBy`.
8835
- *
8836
- * @private
8837
- * @param {Function} setter The function to set accumulator values.
8838
- * @param {Function} [initializer] The accumulator object initializer.
8839
- * @returns {Function} Returns the new aggregator function.
8840
- */
8841
- function createAggregator(setter, initializer) {
8842
- return function(collection, iteratee) {
8843
- var func = isArray_1(collection) ? _arrayAggregator : _baseAggregator,
8844
- accumulator = initializer ? initializer() : {};
8845
-
8846
- return func(collection, setter, _baseIteratee(iteratee), accumulator);
8847
- };
8848
- }
8849
-
8850
- var _createAggregator = createAggregator;
8851
-
8852
- /** Used for built-in method references. */
8853
- var objectProto = Object.prototype;
8854
-
8855
- /** Used to check objects for own properties. */
8856
- var hasOwnProperty = objectProto.hasOwnProperty;
8857
-
8858
- /**
8859
- * Creates an object composed of keys generated from the results of running
8860
- * each element of `collection` thru `iteratee`. The order of grouped values
8861
- * is determined by the order they occur in `collection`. The corresponding
8862
- * value of each key is an array of elements responsible for generating the
8863
- * key. The iteratee is invoked with one argument: (value).
8864
- *
8865
- * @static
8866
- * @memberOf _
8867
- * @since 0.1.0
8868
- * @category Collection
8869
- * @param {Array|Object} collection The collection to iterate over.
8870
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
8871
- * @returns {Object} Returns the composed aggregate object.
8872
- * @example
8873
- *
8874
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
8875
- * // => { '4': [4.2], '6': [6.1, 6.3] }
8876
- *
8877
- * // The `_.property` iteratee shorthand.
8878
- * _.groupBy(['one', 'two', 'three'], 'length');
8879
- * // => { '3': ['one', 'two'], '5': ['three'] }
8880
- */
8881
- var groupBy = _createAggregator(function(result, value, key) {
8882
- if (hasOwnProperty.call(result, key)) {
8883
- result[key].push(value);
8884
- } else {
8885
- _baseAssignValue(result, key, [value]);
8886
- }
8887
- });
8888
-
8889
- var groupBy_1 = groupBy;
8890
-
8891
8786
  var bind = function bind(fn, thisArg) {
8892
8787
  return function wrap() {
8893
8788
  var args = new Array(arguments.length);
@@ -10632,6 +10527,11 @@ axios_1.default = _default;
10632
10527
 
10633
10528
  var axios = axios_1;
10634
10529
 
10530
+ const dateTimeFormat = 'YYYY-MM-DD HH:mm:ss';
10531
+ const shortDateYearFormat = 'ddd, MMM DD YYYY';
10532
+ const apiV1Prefix = 'api';
10533
+ const defaultImage = 'https://res.cloudinary.com/reckon-mini-sites/image/upload/v1636477599/FaveSalon%20Social%20Website/default/default--picture_w3jvfh.png';
10534
+
10635
10535
  var BusinessHourStatus;
10636
10536
  (function (BusinessHourStatus) {
10637
10537
  BusinessHourStatus[BusinessHourStatus["Open"] = 0] = "Open";
@@ -10639,40 +10539,34 @@ var BusinessHourStatus;
10639
10539
  BusinessHourStatus[BusinessHourStatus["ByAppointment"] = 2] = "ByAppointment";
10640
10540
  })(BusinessHourStatus || (BusinessHourStatus = {}));
10641
10541
  function createSalon(blob) {
10642
- const salonGeoLocations = blob.salon_geolocation || [];
10643
- const themeColors = {
10644
- 'allure24-blue': '89c8d2',
10645
- 'allure24-pink': 'ff7fa2',
10646
- 'the-shave': 'af8c45',
10647
- 'theme2-dark-green': '90c245',
10648
- 'theme2-green': 'bed451',
10649
- 'theme2-light-pink': 'd47b99',
10650
- 'theme2-purple': 'ab345c',
10651
- 'theme3-blue': '076dec',
10652
- 'theme3-layout1': 'd59b76',
10653
- 'theme3-layout2': 'b02858',
10654
- 'theme4-green': '5da826',
10655
- 'theme4': '08b89d',
10656
- 'theme5': 'f64c4d',
10657
- };
10542
+ const geoLocations = blob.salon_geolocation || [];
10543
+ let salonImages = [];
10544
+ if (blob.salon_miniwebsite) {
10545
+ const activeSite = Array.isArray(blob.salon_miniwebsite) ? blob.salon_miniwebsite[0] : (blob.salon_miniwebsite || {});
10546
+ salonImages = [
10547
+ activeSite.full_small_slider_img1,
10548
+ activeSite.full_small_slider_img2,
10549
+ activeSite.full_small_slider_img3,
10550
+ ].filter(image => !!image);
10551
+ }
10658
10552
  return {
10659
10553
  id: blob.id,
10660
10554
  about: blob.about,
10661
10555
  email: blob.email,
10556
+ ownerName: blob.owner_name,
10662
10557
  fullProfileImage: blob.full_profile_image,
10663
10558
  fullCoverImage: blob.full_cover_image,
10664
- ownerName: blob.owner_name,
10665
10559
  subdomain: blob.subdomain,
10666
10560
  website: blob.website,
10667
10561
  businessName: blob.business_name,
10668
10562
  businessPhone: blob.business_phone,
10669
10563
  businessAddress: blob.business_address,
10670
- businessLocationLat: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lat : null,
10671
- businessLocationLng: salonGeoLocations.length > 0 ? salonGeoLocations[0].location_lng : null,
10564
+ businessLocationLat: geoLocations.length > 0 ? geoLocations[0].location_lat : null,
10565
+ businessLocationLng: geoLocations.length > 0 ? geoLocations[0].location_lng : null,
10672
10566
  city: blob.city,
10673
10567
  state: blob.state,
10674
10568
  zipcode: blob.zipcode ? Number(blob.zipcode) : null,
10675
- businessHours: (blob.business_hours || blob.salon_workingtime || []).map(bh => {
10569
+ businessHours: (blob.business_hours || blob.salon_working_time || []).map(bh => {
10676
10570
  return {
10677
10571
  dayName: bh.day_name,
10678
10572
  openTime: bh.open_time,
@@ -10681,17 +10575,24 @@ function createSalon(blob) {
10681
10575
  };
10682
10576
  }),
10683
10577
  rating: Number(blob.rating_point),
10684
- primaryColor: themeColors[blob.default_mini_site_template] || themeColors['allure24-blue'],
10578
+ primaryColor: blob.primary_color || Colors.Primary,
10579
+ salonImages,
10685
10580
  };
10686
10581
  }
10582
+ function getSalonImage({ salonImages, fullProfileImage }) {
10583
+ if (salonImages && salonImages.length > 0) {
10584
+ return salonImages[0];
10585
+ }
10586
+ if (fullProfileImage) {
10587
+ return fullProfileImage;
10588
+ }
10589
+ return defaultImage;
10590
+ }
10687
10591
 
10688
10592
  var dayjs_min = createCommonjsModule(function (module, exports) {
10689
10593
  !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}));
10690
10594
  });
10691
10595
 
10692
- const shortDate = 'DD MMM YYYY';
10693
- const apiDateFormat = 'YYYY-MM-DD HH:mm:ss';
10694
-
10695
10596
  function createService(blob) {
10696
10597
  const photos = (blob.photo_link || []).map(photo => {
10697
10598
  return {
@@ -10719,13 +10620,15 @@ function createService(blob) {
10719
10620
 
10720
10621
  function createStylist(blob) {
10721
10622
  const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
10623
+ const { first_name, last_name, mobile_phone, avatar, full_profile_image, } = blob.user || {};
10624
+ const userNames = [first_name, last_name].filter(name => !!name);
10722
10625
  return {
10723
- id: Number(blob.stylist_id),
10724
- name: blob.title || [blob.first_name, blob.last_name].filter(field => !!field).join(' '),
10725
- firstName: blob.first_name,
10726
- lastName: blob.last_name,
10727
- avatar: blob.avatar,
10728
- phone: blob.mobile_phone,
10626
+ id: Number(blob.id),
10627
+ firstName: first_name,
10628
+ lastName: last_name,
10629
+ fullName: userNames.length > 0 ? userNames.join(' ') : blob.email,
10630
+ avatar: avatar || full_profile_image,
10631
+ phone: mobile_phone,
10729
10632
  expertise: Boolean(blob.expertise),
10730
10633
  rating: Math.ceil((ratingPercentage * 5) / 100),
10731
10634
  };
@@ -10733,15 +10636,16 @@ function createStylist(blob) {
10733
10636
  function createStylistFromLookbook(blob) {
10734
10637
  const { user } = blob;
10735
10638
  const ratingPercentage = blob.rating_percent ? Number(blob.rating_percent) : 0;
10639
+ const userNames = [user.first_name, user.last_name].filter(name => !!name);
10736
10640
  return {
10737
10641
  id: Number(blob.id),
10738
- expertise: Boolean(blob.expertise),
10739
- rating: Math.ceil((ratingPercentage * 5) / 100),
10740
- name: [user.first_name, user.last_name].filter(field => !!field).join(' '),
10741
10642
  firstName: user.first_name,
10742
10643
  lastName: user.last_name,
10644
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.title),
10743
10645
  avatar: user.full_avatar || user.full_profile_image_thumb,
10744
10646
  phone: user.mobile_phone,
10647
+ expertise: Boolean(blob.expertise),
10648
+ rating: Math.ceil((ratingPercentage * 5) / 100),
10745
10649
  };
10746
10650
  }
10747
10651
 
@@ -10749,99 +10653,134 @@ function createUser(blob) {
10749
10653
  const userNames = [blob.first_name, blob.last_name].filter(name => !!name);
10750
10654
  return {
10751
10655
  id: blob.user_id,
10752
- name: userNames.length > 0 ? userNames.join(' ') : blob.username,
10753
10656
  firstName: blob.first_name,
10754
10657
  lastName: blob.last_name,
10755
- avatar: blob.full_profile_image_thumb,
10658
+ fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
10659
+ avatar: blob.avatar || blob.full_profile_image_thumb,
10756
10660
  };
10757
10661
  }
10758
10662
 
10759
- function createFaveStyleComent(blob) {
10760
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
10761
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
10762
- return {
10663
+ var MediaType;
10664
+ (function (MediaType) {
10665
+ MediaType[MediaType["Photo"] = 0] = "Photo";
10666
+ MediaType[MediaType["Video"] = 1] = "Video";
10667
+ })(MediaType || (MediaType = {}));
10668
+ class AlbumMedia {
10669
+ constructor(fields) {
10670
+ Object.assign(this, fields);
10671
+ }
10672
+ }
10673
+ function createAlbumMedia(blob) {
10674
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
10675
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
10676
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
10677
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
10678
+ const isVideo = blob.media_type === MediaType.Video || blob.full_image_url.indexOf('.mp4') > -1;
10679
+ return new AlbumMedia({
10763
10680
  id: blob.id,
10764
- type: blob.type,
10765
- content: blob.content,
10766
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
10767
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
10768
- parentCommentId: blob.parentCommentId,
10769
- childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComent) : [],
10770
- owner: createUser(blob.user),
10771
- };
10681
+ caption: blob.caption,
10682
+ description: blob.description,
10683
+ createdDate: createdDateTime,
10684
+ updatedDate: updatedDateTime,
10685
+ mediaUrl: blob.full_image_url,
10686
+ imageThumb: !isVideo ? blob.full_image_url_thumb : null,
10687
+ imageThumbMedium: !isVideo ? blob.full_image_url_medium : null,
10688
+ imageWidth: !isVideo ? blob.img_w : 400,
10689
+ imageHeight: !isVideo ? blob.img_h : 300,
10690
+ mediaType: isVideo ? MediaType.Video : blob.media_type,
10691
+ totalLike: blob.total_like,
10692
+ totalDislike: blob.total_dislike,
10693
+ totalShare: blob.total_shared,
10694
+ totalView: blob.view_count,
10695
+ totalBooking: blob.total_booking,
10696
+ });
10772
10697
  }
10773
- function createFavesalonAlbum(blob) {
10774
- return {
10698
+ class Album {
10699
+ constructor(fields) {
10700
+ Object.assign(this, fields);
10701
+ }
10702
+ }
10703
+ function createAlbum(blob) {
10704
+ return new Album({
10775
10705
  id: blob.id,
10776
10706
  name: blob.name,
10777
10707
  caption: blob.caption,
10778
10708
  description: blob.description,
10779
10709
  tags: blob.tags ? blob.tags.filter(tag => !!tag) : [],
10780
10710
  salonId: blob.salon_id,
10781
- stylistId: blob.beautician_id,
10711
+ stylistId: blob.stylist_id,
10782
10712
  totalMedias: blob.total_medias || 0,
10783
10713
  service: blob.service ? createService(blob.service) : null,
10784
10714
  isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
10785
- };
10715
+ });
10786
10716
  }
10787
- function createFavesalonStyle(blob) {
10788
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
10789
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
10790
- return {
10717
+ class FaveStyleComment {
10718
+ constructor(fields) {
10719
+ Object.assign(this, fields);
10720
+ }
10721
+ }
10722
+ function createFaveStyleComment(blob) {
10723
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
10724
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
10725
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
10726
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
10727
+ return new FaveStyleComment({
10728
+ id: blob.id,
10729
+ type: blob.type,
10730
+ title: blob.content,
10731
+ description: blob.description,
10732
+ createdDate: createdDateTime,
10733
+ updatedDate: updatedDateTime,
10734
+ parentCommentId: blob.parentCommentId,
10735
+ childComments: blob.child_comment ? blob.child_comment.map(createFaveStyleComment) : [],
10736
+ user: createUser(blob.user),
10737
+ });
10738
+ }
10739
+ class FaveStyle {
10740
+ constructor(fields) {
10741
+ Object.assign(this, fields);
10742
+ }
10743
+ }
10744
+ function createFaveStyle(blob) {
10745
+ const [createdDay, createdTime] = blob.create_date ? String(blob.create_date).split(' ') : [];
10746
+ const createdDateTime = createdDay && createdTime ? dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf() : null;
10747
+ const [updatedDay, updatedTime] = blob.update_date ? String(blob.update_date).split(' ') : [];
10748
+ const updatedDateTime = updatedDay && updatedTime ? dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf() : null;
10749
+ const albumMedias = [createAlbumMedia(blob)].concat(blob.album_medias ? blob.album_medias.map(createAlbumMedia).filter(ap => ap.id !== blob.id) : []);
10750
+ const { total_booked: totalBooked, total_like: totalLike, total_share: totalShare, total_view: totalView, } = blob.style_activity || {};
10751
+ return new FaveStyle({
10791
10752
  id: blob.id,
10792
10753
  caption: blob.caption,
10793
10754
  description: blob.description,
10794
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
10795
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
10755
+ createdDate: createdDateTime,
10756
+ updatedDate: updatedDateTime,
10757
+ imageUrl: blob.full_image_url,
10758
+ imageThumb: blob.full_image_url_thumb,
10759
+ imageThumbMedium: blob.full_image_url_medium,
10760
+ imageWidth: blob.img_w,
10761
+ imageHeight: blob.img_h,
10796
10762
  mediaType: blob.media_type,
10797
- fullImageUrl: blob.full_image_url,
10798
- fullImageUrlThumb: blob.full_image_url_thumb,
10799
- fullImageUrlMedium: blob.full_image_url_medium,
10800
- imgWidth: blob.img_w,
10801
- imgHeight: blob.img_h,
10802
- s3ImgWidth: blob.s3_img_w,
10803
- s3ImgHeight: blob.s3_img_h,
10804
- totalLike: blob.total_like,
10805
- totalDislike: blob.total_dislike,
10806
- totalShare: blob.total_shared,
10807
- totalView: blob.view_count,
10808
- totalBooking: blob.total_booking,
10809
- owner: blob.user ? createUser(blob.user) : null,
10810
- };
10811
- }
10812
- function createFavesalonLookbook(blob) {
10813
- const [createdDay, createdTime] = String(blob.create_date).split(' ');
10814
- const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
10815
- let albumPhotos = blob.style_in_album ? blob.style_in_album.map(createFavesalonStyle) : [];
10816
- if (!albumPhotos.find(ap => ap.id === blob.id)) {
10817
- const currentPhoto = createFavesalonStyle(blob);
10818
- albumPhotos = [currentPhoto].concat(albumPhotos);
10819
- }
10820
- return {
10821
- id: blob.id,
10822
- caption: blob.caption,
10823
- description: blob.description,
10824
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
10825
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
10826
- mediaType: blob.media_type,
10827
- fullImageUrl: blob.full_image_url,
10828
- fullImageUrlThumb: blob.full_image_url_thumb,
10829
- fullImageUrlMedium: blob.full_image_url_medium,
10830
- imgWidth: blob.img_w,
10831
- imgHeight: blob.img_h,
10832
- s3ImgWidth: blob.s3_img_w,
10833
- s3ImgHeight: blob.s3_img_h,
10834
- totalLike: blob.total_like,
10835
- totalDislike: blob.total_dislike,
10836
- totalShare: blob.total_shared,
10837
- totalView: blob.view_count,
10838
- totalBooking: blob.total_booking,
10763
+ isPublic: (typeof blob.is_public !== 'undefined') ? Boolean(blob.is_public) : true,
10764
+ totalBooking: totalBooked || 0,
10765
+ totalLike: totalLike || 0,
10766
+ totalDislike: blob.total_dislike || 0,
10767
+ totalShare: totalShare || 0,
10768
+ totalView: totalView || 0,
10769
+ albumMedias,
10770
+ album: blob.album ? createAlbum(blob.album) : null,
10839
10771
  owner: blob.user ? createUser(blob.user) : null,
10772
+ salonId: blob.salon_id ? Number(blob.salon_id) : null,
10840
10773
  salon: blob.salon ? createSalon(blob.salon) : null,
10841
- stylist: blob.beautician && blob.beautician.user ? createStylistFromLookbook(blob.beautician) : null,
10842
- album: blob.album ? createFavesalonAlbum(blob.album) : null,
10843
- albumPhotos,
10844
- };
10774
+ stylistId: blob.stylist_id ? Number(blob.stylist_id) : null,
10775
+ stylist: blob.stylist ? createStylistFromLookbook(blob.stylist) : null,
10776
+ isLiked: blob.my_activity && blob.my_activity.liked,
10777
+ serviceId: blob.service_id ? Number(blob.service_id) : null,
10778
+ salonServiceId: blob.category_service_id ? Number(blob.category_service_id) : null,
10779
+ productBrand: blob.product_brand_used || '',
10780
+ });
10781
+ }
10782
+ function isVideoMedia({ mediaType }) {
10783
+ return mediaType === MediaType.Video;
10845
10784
  }
10846
10785
 
10847
10786
  function createReviewPhoto(blob) {
@@ -10853,15 +10792,15 @@ function createReviewPhoto(blob) {
10853
10792
  };
10854
10793
  }
10855
10794
  function createReview(blob) {
10856
- const reviewPhotos = blob.salon_review_photo || blob.beautician_review_photo || [];
10795
+ const reviewPhotos = blob.review_photo || [];
10857
10796
  const [createdDay, createdTime] = String(blob.create_date).split(' ');
10858
10797
  const [updatedDay, updatedTime] = String(blob.update_date).split(' ');
10859
10798
  return {
10860
10799
  title: blob.title,
10861
- point: Math.ceil(Number(blob.avg_point)),
10862
10800
  description: blob.comment,
10863
- createdDate: dayjs_min(`${createdDay} ${createdTime}`, apiDateFormat).valueOf(),
10864
- updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, apiDateFormat).valueOf(),
10801
+ createdDate: dayjs_min(`${createdDay} ${createdTime}`, dateTimeFormat).valueOf(),
10802
+ updatedDate: dayjs_min(`${updatedDay} ${updatedTime}`, dateTimeFormat).valueOf(),
10803
+ point: Math.ceil(Number(blob.avg_point)),
10865
10804
  pointView: blob.view_point,
10866
10805
  pointPrice: blob.price_point,
10867
10806
  pointProduct: blob.product_point,
@@ -10871,69 +10810,58 @@ function createReview(blob) {
10871
10810
  helpful: blob.helpful,
10872
10811
  recommend: blob.recommend,
10873
10812
  user: blob.user ? createUser(blob.user) : null,
10813
+ salon: blob.salon ? createSalon(blob.salon) : null,
10814
+ stylist: blob.stylist && blob.stylist.user ? createStylist(blob.stylist) : null,
10874
10815
  photos: reviewPhotos.map(createReviewPhoto),
10875
10816
  };
10876
10817
  }
10877
10818
 
10878
- var __rest = (undefined && undefined.__rest) || function (s, e) {
10879
- var t = {};
10880
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
10881
- t[p] = s[p];
10882
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
10883
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
10884
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
10885
- t[p[i]] = s[p[i]];
10886
- }
10887
- return t;
10888
- };
10819
+ const apiV2Prefix = 'api-ver2';
10889
10820
  class HttpService {
10890
10821
  constructor() {
10891
10822
  this.http = null;
10892
10823
  this.http = axios.create({
10893
10824
  baseURL: 'https://favesalon.com',
10825
+ // baseURL: 'http://13.57.216.170',
10894
10826
  headers: {},
10895
10827
  });
10896
10828
  }
10897
- fetchSalonInfo(salonId) {
10898
- const url = 'api/salon/settings-public';
10899
- return this.http.post(url, { salon_id: salonId })
10900
- .then((response) => {
10901
- const { status, data } = response.data;
10902
- return status && data ? createSalon(data.Salon) : null;
10903
- })
10904
- .catch(() => (null));
10905
- }
10906
- fetchReviews(url, options, allReviews) {
10907
- const { noLoop } = options, restOptions = __rest(options, ["noLoop"]);
10908
- return this.http.post(url, restOptions)
10829
+ fetchStyleDetail(styleId) {
10830
+ return this.http.get(`${apiV2Prefix}/style/${styleId}/detail`)
10909
10831
  .then((response) => {
10910
10832
  const { status, data } = response.data;
10911
10833
  if (status) {
10912
- const reviews = (data || []).filter(blob => Math.ceil(Number(blob.avg_point)) > 0).map(createReview);
10913
- // fetch next page's reviews
10914
- if (!noLoop && reviews.length >= options.limit) {
10915
- return this.fetchReviews(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allReviews.concat(reviews));
10834
+ let styleInfo = null, similarStyles = [];
10835
+ try {
10836
+ styleInfo = createFaveStyle(data);
10837
+ similarStyles = (data.style_similars || []).map(createFaveStyle);
10916
10838
  }
10917
- const finalReviews = options.page === 1 ? reviews : allReviews.concat(reviews);
10918
- return {
10919
- totalReviews: finalReviews.length || 0,
10920
- allReviews: finalReviews,
10921
- };
10839
+ catch (e) { }
10840
+ return { styleInfo, similarStyles };
10922
10841
  }
10923
- return { totalReviews: 0, allReviews: [] };
10842
+ return { styleInfo: null, similarStyles: [] };
10843
+ })
10844
+ .catch(() => {
10845
+ return { styleInfo: null, similarStyles: [] };
10924
10846
  });
10925
10847
  }
10926
- fetchSalonReviews(salonId, options) {
10927
- const url = '/api/salon/reviews';
10928
- return this.fetchReviews(url, Object.assign({ page: 1, limit: 5, salon_id: salonId, avg_point_greater_than: 0 }, options), [])
10848
+ fetchSalonInfo(salonId) {
10849
+ const url = `${apiV2Prefix}/salon/${salonId}/detail`;
10850
+ return this.http.get(url)
10851
+ .then((response) => {
10852
+ const { status, data } = response.data;
10853
+ return status && data ? createSalon(data) : null;
10854
+ })
10855
+ .catch(() => (null));
10856
+ }
10857
+ fetchSalonLatestStyles(salonId, options) {
10858
+ const url = `${apiV2Prefix}/salon/${salonId}/styles`;
10859
+ return this.http.post(url, Object.assign(Object.assign({}, options), { sort: 'newest' }))
10929
10860
  .then(response => {
10930
- const { totalReviews, allReviews } = response;
10931
- return {
10932
- total: totalReviews,
10933
- allItems: allReviews,
10934
- };
10861
+ const { data } = response.data;
10862
+ return (data || []).slice(0, options.limit).map(createFaveStyle);
10935
10863
  })
10936
- .catch(() => ({ total: 0, allItems: [] }));
10864
+ .catch(() => ([]));
10937
10865
  }
10938
10866
  decorateServiceGroups(groups) {
10939
10867
  return groups.map((cate, index) => {
@@ -10960,7 +10888,7 @@ class HttpService {
10960
10888
  });
10961
10889
  }
10962
10890
  fetchSalonServices(salonId) {
10963
- const url = `api/salon/services?v=2&id=${salonId}`;
10891
+ const url = `${apiV1Prefix}/salon/services?v=2&id=${salonId}`;
10964
10892
  return this.http.get(url)
10965
10893
  .then(response => {
10966
10894
  const { status, data } = response.data;
@@ -10971,34 +10899,42 @@ class HttpService {
10971
10899
  })
10972
10900
  .catch(() => ([]));
10973
10901
  }
10974
- fetchSalonStylists(salonId) {
10975
- const fetchStylistSchedules = this.http.get(`api/calendar/resource/stylists?salon_id=${salonId}`)
10976
- .then((response) => {
10977
- const { status, data } = response.data;
10978
- return status ? (data || []) : [];
10979
- })
10980
- .catch(() => ([]));
10981
- const fetchStylistSkills = this.http.get(`api/salon/skill-stylists/${salonId}`)
10982
- .then((response) => {
10983
- const { status, data } = response.data;
10984
- return status ? (data || []).map(blob => (Object.assign(Object.assign({}, blob), { id: blob.stylist_id }))) : [];
10902
+ fetchSalonStylists(salonId, options = { page: 1, limit: 12 }) {
10903
+ const url = `${apiV2Prefix}/salon/${salonId}/stylists?page=${options.page}&limit=${options.limit}`;
10904
+ return this.http.get(url)
10905
+ .then(response => {
10906
+ const { paging, data } = response.data;
10907
+ return {
10908
+ total: paging.total_item || data.length,
10909
+ data: data.map(createStylist),
10910
+ };
10985
10911
  })
10986
- .catch(() => ([]));
10987
- return Promise.all([fetchStylistSchedules, fetchStylistSkills])
10988
- .then(results => {
10989
- const [stylistSchedules, stylistSkills] = results;
10990
- const allStylistGroups = groupBy_1(stylistSchedules.concat(stylistSkills), stylist => stylist.id);
10991
- return Object.keys(allStylistGroups)
10992
- .filter(stylistId => Number(stylistId) > 0)
10993
- .map(stylistId => {
10994
- const [schedule, skills] = allStylistGroups[stylistId];
10995
- return createStylist(Object.assign(Object.assign({}, schedule), skills));
10996
- });
10912
+ .catch(() => ({ total: 0, data: [] }));
10913
+ }
10914
+ fetchSalonReviews(salonId, options) {
10915
+ const url = `${apiV2Prefix}/salon/${salonId}/reviews`;
10916
+ return this.http.post(url, Object.assign({ avg_point_greater_than: 0 }, options))
10917
+ .then(response => {
10918
+ const { data, paging } = response.data || {};
10919
+ 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 || {};
10920
+ return {
10921
+ total: paging.total_item || 0,
10922
+ stats: {
10923
+ totalReviews,
10924
+ reviewPoint: reviewPoint ? Math.ceil(reviewPoint) : 0,
10925
+ '1': onestar ? Math.ceil(onestar) : 0,
10926
+ '2': twoStar ? Math.ceil(twoStar) : 0,
10927
+ '3': threeStar ? Math.ceil(threeStar) : 0,
10928
+ '4': fourStar ? Math.ceil(fourStar) : 0,
10929
+ '5': fiveStar ? Math.ceil(fiveStar) : 0,
10930
+ },
10931
+ data: data.map(createReview),
10932
+ };
10997
10933
  })
10998
- .catch(() => []);
10934
+ .catch(() => ({ total: 0, stats: {}, data: [] }));
10999
10935
  }
11000
10936
  fetchSalonCategories() {
11001
- return this.http.post('api/home/get-service', { limit: 50 })
10937
+ return this.http.post(`${apiV2Prefix}/search/get-services`, { limit: 50 })
11002
10938
  .then((response) => {
11003
10939
  const { status, data } = response.data;
11004
10940
  if (status) {
@@ -11017,178 +10953,42 @@ class HttpService {
11017
10953
  }
11018
10954
  fetchSalonLookbooks(salonId, options) {
11019
10955
  const noResult = { total: 0, allLookbooks: [] };
11020
- return this.http.post('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options))
11021
- .then((response) => {
10956
+ const url = `${apiV2Prefix}/salon/${salonId}/styles`;
10957
+ const postData = Object.assign({ page: 1, limit: 20 }, options);
10958
+ return this.http.post(url, postData)
10959
+ .then(response => {
11022
10960
  const { status, data, paging } = response.data;
11023
10961
  if (status) {
11024
10962
  return {
11025
10963
  total: paging.total_item || 0,
11026
- allLookbooks: (data || []).map(createFavesalonStyle),
10964
+ allLookbooks: (data || []).map(createFaveStyle),
11027
10965
  };
11028
10966
  }
11029
10967
  return noResult;
11030
10968
  })
11031
10969
  .catch(() => (noResult));
11032
10970
  }
11033
- fetchSalonPhotos(salonId) {
11034
- return this.http
11035
- .post('api/style/filter', {
11036
- page: 1,
11037
- limit: 20,
11038
- salon_id: salonId,
11039
- })
11040
- .then((response) => {
11041
- const { status, data } = response.data;
11042
- if (status) {
11043
- return (data || []).map(createFavesalonStyle);
11044
- }
11045
- return [];
11046
- })
11047
- .catch(() => {
11048
- return [];
11049
- });
11050
- }
11051
- fetchAllStyles(url, options, allStyles) {
11052
- return this.http.post(url, options)
11053
- .then((response) => {
11054
- const { status, data } = response.data;
11055
- if (status) {
11056
- const styles = (data || []).map(createFavesalonStyle);
11057
- // fetch next page styles
11058
- if (styles.length >= options.limit) {
11059
- return this.fetchAllStyles(url, Object.assign(Object.assign({}, options), { page: options.page + 1 }), allStyles.concat(styles));
11060
- }
11061
- return options.page === 1 ? styles : allStyles;
11062
- }
11063
- return allStyles;
11064
- });
11065
- }
11066
- fetchAllSalonPhotos(salonId, options) {
11067
- return this.fetchAllStyles('api/style/filter', Object.assign({ page: 1, limit: 20, salon_id: salonId }, options), []).catch(() => {
11068
- return [];
11069
- });
11070
- }
11071
- fetchStyleDetail(styleId) {
11072
- return this.http.post('api/home/style-info', { photo_id: styleId })
11073
- .then((response) => {
11074
- const { status, data } = response.data;
11075
- if (status) {
11076
- return createFavesalonLookbook(data);
11077
- }
11078
- return null;
11079
- })
11080
- .catch(() => (null));
11081
- }
11082
- fetchStyleComments(options) {
11083
- return this.http.post('api/comment/filter', options)
10971
+ fetchStyleComments(styleId) {
10972
+ const url = `${apiV2Prefix}/style/comment?photo_id=${styleId}`;
10973
+ return this.http.get(url)
11084
10974
  .then(response => {
11085
- const { status, data } = response.data;
11086
- if (status) {
11087
- return (data || []).map(createFaveStyleComent);
11088
- }
11089
- return [];
10975
+ const { paging, data } = response.data;
10976
+ return {
10977
+ total: paging.total_item || 0,
10978
+ data: data.map(createFaveStyleComment),
10979
+ };
11090
10980
  })
11091
- .catch(() => ([]));
10981
+ .catch(() => ({ total: 0, data: [] }));
11092
10982
  }
11093
10983
  }
11094
10984
  const HttpService$1 = () => new HttpService();
11095
10985
 
11096
- const indexCss$d = "@media (min-width: 768px){.salon-contact--links{overflow:hidden;margin-left:-32px}.salon-contact--links .salon-contact--links-item{float:left;display:flex;flex-direction:row;align-items:center;font-size:16px;min-width:300px;padding-left:32px;margin-top:8px}.salon-contact--links .salon-contact--links-item:nth-child(2n+1){clear:left}}";
11097
-
11098
- let SalonContact$1 = class extends HTMLElement {
11099
- constructor() {
11100
- super();
11101
- this.__registerHost();
11102
- }
11103
- componentWillLoad() {
11104
- if (this.salonInfo) {
11105
- this.salonInfoState = JSON.parse(this.salonInfo);
11106
- }
11107
- else {
11108
- this.fetchData();
11109
- }
11110
- }
11111
- fetchData() {
11112
- try {
11113
- HttpService$1().fetchSalonInfo(this.salonId)
11114
- .then(salonInfo => this.salonInfoState = salonInfo);
11115
- }
11116
- catch (e) { }
11117
- }
11118
- render() {
11119
- const { about, email, website, businessPhone, } = (this.salonInfoState || {});
11120
- const websiteUrl = formatWebsiteUrl(website);
11121
- return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content" }, h("div", { style: { fontSize: '16px', fontWeight: 'bold' } }, "Contact info"), h("div", { class: "salon-contact--links" }, businessPhone && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-phone-line", style: { color: Colors.Gray03, fontSize: '18px', marginRight: '6px' } }), " ", businessPhone)), websiteUrl && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-links-line", style: { color: Colors.Gray03, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { target: websiteUrl && websiteUrl.indexOf(window.location.hostname) === -1 ? '_blank' : undefined, href: websiteUrl, style: { color: Colors.Gray01, textDecoration: 'none' } }, websiteUrl))), email && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-mail-line", style: { color: Colors.Gray03, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { href: `mailto:${email}`, style: { color: Colors.Gray01, textDecoration: 'none' } }, email)))), h("div", { class: "salon-contact--info--desc", style: { fontSize: '16px', marginTop: '16px' }, innerHTML: about }))));
11122
- }
11123
- static get style() { return indexCss$d; }
11124
- };
11125
-
11126
- const indexCss$c = ".salon-modal.salon-modal--gift-card .salon-modal--title{margin:0}.salon-modal.salon-modal--gift-card .salon-modal--close{width:40px;height:40px;right:16px;top:16px}.salon-modal.salon-modal--gift-card .salon-modal--header{height:72px;padding:16px}.salon-modal.salon-modal--gift-card .salon-modal--inner{height:90vh}.salon-modal.salon-modal--gift-card .salon-modal--content{height:90vh;padding:0 16px;overflow-y:auto}";
11127
-
11128
- let SalonGiftCard$1 = class extends HTMLElement {
11129
- constructor() {
11130
- super();
11131
- this.__registerHost();
11132
- this.buttonClass = '';
11133
- this.buttonText = 'Buy Gift card';
11134
- this.primaryColor = Colors.Coral03;
11135
- }
11136
- openModal() {
11137
- const elBookingModal = document.createElement('div');
11138
- elBookingModal.innerHTML = `
11139
- <salon-gift-card-modal
11140
- salon-id=${this.salonId}
11141
- ></salon-gift-card-modal>
11142
- `;
11143
- document.body.appendChild(elBookingModal);
11144
- }
11145
- render() {
11146
- const buttonClass = this.buttonClass || 'btn btn-primary';
11147
- let buttonStyle = {};
11148
- if (!this.buttonClass) {
11149
- const primaryColor = color(this.primaryColor);
11150
- const primaryColorHover = primaryColor.darken(0.05);
11151
- buttonStyle = lib.css({
11152
- backgroundColor: this.primaryColor,
11153
- borderColor: this.primaryColor,
11154
- color: primaryColor.isLight() ? Colors.Black01 : Colors.White,
11155
- ':hover': {
11156
- backgroundColor: primaryColorHover,
11157
- borderColor: primaryColorHover,
11158
- },
11159
- });
11160
- }
11161
- return (h("div", { class: "salon-gift-card" }, h("div", { class: "salon-gift-card--button" }, h("button", Object.assign({ type: "button", class: buttonClass, onClick: () => this.openModal() }, buttonStyle), this.buttonText))));
11162
- }
11163
- static get style() { return indexCss$c; }
11164
- };
11165
-
11166
- const indexCss$b = ".salon-modal.salon-modal--gift-card .salon-modal--title{margin:0}.salon-modal.salon-modal--gift-card .salon-modal--close{width:40px;height:40px;right:16px;top:16px}.salon-modal.salon-modal--gift-card .salon-modal--header{height:72px;padding:16px}.salon-modal.salon-modal--gift-card .salon-modal--inner{height:90vh}.salon-modal.salon-modal--gift-card .salon-modal--content{height:90vh;padding:0 16px;overflow-y:auto}";
11167
-
11168
- let SalonGiftCardModal$1 = class extends HTMLElement {
11169
- constructor() {
11170
- super();
11171
- this.__registerHost();
11172
- this.isModalOpen = true;
11173
- }
11174
- closeModal() {
11175
- this.isModalOpen = false;
11176
- const el = document.querySelector('salon-gift-card-modal');
11177
- el.remove();
11178
- }
11179
- render() {
11180
- return (h("div", { class: "salon-gift-card--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--gift-card" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--content" }, h("iframe", { height: "100%", width: "100%", style: { border: 'none', display: 'block', height: '100%' }, src: `https://www.favesalon.com/salon/detail/${this.salonId}/gift-cards.html` })))))));
11181
- }
11182
- static get style() { return indexCss$b; }
11183
- };
11184
-
11185
- const indexCss$a = ".salon-info .view--salon-styles .view-content{padding:0}";
10986
+ const indexCss$b = "";
11186
10987
 
11187
10988
  let SalonInfo$1 = class extends HTMLElement {
11188
10989
  constructor() {
11189
10990
  super();
11190
10991
  this.__registerHost();
11191
- this.backgroundColor = Colors.Gray06;
11192
10992
  }
11193
10993
  componentWillLoad() {
11194
10994
  this.fetchData();
@@ -11200,40 +11000,92 @@ let SalonInfo$1 = class extends HTMLElement {
11200
11000
  catch (e) { }
11201
11001
  }
11202
11002
  render() {
11203
- if (this.salonInfo) {
11204
- return (h("div", { class: "salon-info", style: { background: this.backgroundColor } }, h("div", { class: "row" }, h("div", { class: "col-md-5", style: { marginBottom: '24px' } }, h("salon-locations", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "col-md-7", style: { marginBottom: '24px' } }, h("salon-styles", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))), h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } }, h("salon-schedules", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "salon-info--contact" }, h("salon-contact", { "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))));
11205
- }
11206
- return (h("div", { class: "salon-info", style: { padding: '24px', textAlign: 'center' } }, "Loading..."));
11003
+ return (h("div", { class: "salon-info" }, h("div", { class: "container" }, h("div", { class: "salon-info--schedules", style: { marginBottom: '24px' } }, h("salon-schedules", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "row" }, h("div", { class: "col-md-5", style: { marginBottom: '24px' } }, h("salon-locations", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) })), h("div", { class: "col-md-7", style: { marginBottom: '24px' } }, h("salon-latest-styles", { "with-border": true, "is-loading": !this.salonInfo, "salon-id": 49989, "salon-info": JSON.stringify(this.salonInfo) }))))));
11207
11004
  }
11208
- static get style() { return indexCss$a; }
11005
+ static get style() { return indexCss$b; }
11209
11006
  };
11210
11007
 
11211
- const indexCss$9 = ".salon-latest-reviews .salon-review{min-width:280px}@media (min-width: 768px){.salon-latest-reviews .salon-review{min-width:300px}}";
11008
+ function formatWebsiteUrl(website) {
11009
+ return !!website ? website.indexOf('http') > -1 ? website : `http://${website}` : null;
11010
+ }
11011
+ function formatFullAddress(salon) {
11012
+ const { businessAddress, city, state, zipcode, } = salon || {};
11013
+ const stateFields = [state, zipcode].filter(field => !!field);
11014
+ if (businessAddress) {
11015
+ return [businessAddress, city]
11016
+ .filter(field => !!field)
11017
+ .concat(stateFields.length > 0 ? [stateFields.join(' ')] : [])
11018
+ .join(', ');
11019
+ }
11020
+ return null;
11021
+ }
11022
+ function getRatingText() {
11023
+ return ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
11024
+ }
11025
+
11026
+ const indexCss$a = ".salon-latest-reviews .salon-review{min-width:280px}@media (min-width: 768px){.salon-latest-reviews .salon-review{min-width:300px}}";
11212
11027
 
11213
11028
  let SalonLatestReviews$1 = class extends HTMLElement {
11214
11029
  constructor() {
11215
11030
  super();
11216
11031
  this.__registerHost();
11032
+ this.primaryColor = Colors.Primary;
11217
11033
  this.salonReviews = [];
11218
11034
  }
11219
11035
  componentWillLoad() {
11220
11036
  this.fetchData();
11221
11037
  }
11222
11038
  async fetchData() {
11039
+ this.isLoading = true;
11223
11040
  try {
11224
- const { allItems } = await HttpService$1().fetchSalonReviews(this.salonId, { noLoop: true });
11225
- this.salonReviews = [...allItems];
11041
+ const { data: allReviews } = await HttpService$1().fetchSalonReviews(this.salonId, { limit: 5 });
11042
+ this.salonReviews = [...allReviews];
11226
11043
  }
11227
11044
  catch (e) { }
11045
+ this.isLoading = false;
11228
11046
  }
11229
11047
  render() {
11048
+ if (this.isLoading) {
11049
+ return (h("div", { class: "salon-latest-reviews", style: { overflow: 'hidden' } }, h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, [1, 2, 3, 4, 5].map((fakeId, index) => {
11050
+ return (h("div", { key: `salon-latest-review--${fakeId}`, class: "salon-review", style: Object.assign({ border: `1px solid ${Colors.Gray02}`, background: Colors.White, borderRadius: '8px', overflow: 'hidden' }, index > 0 ? { marginLeft: '16px' } : {}) }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("div", { style: {
11051
+ backgroundColor: Colors.Gray02,
11052
+ borderRadius: '50px',
11053
+ height: '48px',
11054
+ width: '48px',
11055
+ float: 'left',
11056
+ } }), h("div", { style: {
11057
+ backgroundColor: Colors.Gray01,
11058
+ height: '16px',
11059
+ width: '120px',
11060
+ marginLeft: '16px',
11061
+ marginTop: '14px',
11062
+ float: 'left',
11063
+ } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(() => (h("div", { style: {
11064
+ backgroundColor: Colors.Gray01,
11065
+ height: '20px',
11066
+ width: '20px',
11067
+ marginRight: '8px',
11068
+ float: 'left',
11069
+ } })))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold', marginTop: '16px' } }, h("div", { style: {
11070
+ backgroundColor: Colors.Gray01,
11071
+ height: '16px',
11072
+ width: '132px',
11073
+ } })), h("div", { class: "salon-review--detail", style: { marginTop: '8px' } }, h("div", { class: "salon-review--description", style: {
11074
+ fontSize: '16px',
11075
+ lineHeight: '26px',
11076
+ overflow: 'hidden',
11077
+ } }, h("div", { style: {
11078
+ backgroundColor: Colors.Gray01,
11079
+ height: '16px',
11080
+ width: '240px',
11081
+ float: 'left',
11082
+ } })))))));
11083
+ }))));
11084
+ }
11230
11085
  const ratingTexts = getRatingText();
11231
11086
  return (h("div", { class: "salon-latest-reviews", style: { overflowX: 'auto' } }, h("div", { style: { display: 'flex', whiteSpace: 'nowrap' } }, (this.salonReviews || []).map((review, index) => {
11232
11087
  const { user } = review;
11233
- return (h("div", { class: "salon-review", style: Object.assign({ border: `1px solid ${Colors.Gray05}`, background: Colors.White, borderRadius: '8px', overflow: 'hidden' }, index > 0 ? { marginLeft: '16px' } : {}) }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px' } }, h("user-avatar", { size: 48, name: user.name, shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, avatar: user.avatar, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
11234
- fontSize: '16px',
11235
- marginRight: '4px',
11236
- } }))), h("div", { class: "salon-review--rating--date", style: { color: Colors.Gray03, marginLeft: '16px' } }, dayjs_min(review.createdDate).format(shortDate))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--description", style: {
11088
+ return (h("div", { class: "salon-review", style: Object.assign({ border: `1px solid ${Colors.Gray02}`, background: Colors.White, borderRadius: '8px', overflow: 'hidden' }, index > 0 ? { marginLeft: '16px' } : {}) }, h("div", { class: "card", style: { border: 'none' } }, h("div", { class: "card-body" }, h("div", { class: "salon-review--user", style: { marginBottom: '16px' } }, h("user-avatar", { size: 48, name: h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, avatar: user.avatar, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (h("i", { class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '16px', marginRight: '4px' }, score <= review.point ? { color: this.primaryColor } : { color: Colors.Gray04 }) }))), h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs_min(review.createdDate).format(shortDateYearFormat))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--description", style: {
11237
11089
  fontSize: '16px',
11238
11090
  lineHeight: '26px',
11239
11091
  overflow: 'hidden',
@@ -11248,15 +11100,103 @@ let SalonLatestReviews$1 = class extends HTMLElement {
11248
11100
  cursor: 'pointer',
11249
11101
  borderRadius: '2px',
11250
11102
  height: '66px',
11251
- marginTop: '16px',
11252
- marginRight: '16px',
11103
+ marginTop: '12px',
11104
+ marginRight: '12px',
11253
11105
  } }, h("img", { alt: "", src: photo.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))))));
11254
11106
  }))));
11255
11107
  }
11108
+ static get style() { return indexCss$a; }
11109
+ };
11110
+
11111
+ const indexCss$9 = "salon-latest-styles .view--salon-styles--item{width:120px;height:120px}@media (min-width: 1024px){salon-latest-styles .view--salon-styles--item{width:200px;height:200px}}";
11112
+
11113
+ let SalonLatestStyles$1 = class extends HTMLElement {
11114
+ constructor() {
11115
+ super();
11116
+ this.__registerHost();
11117
+ }
11118
+ componentDidLoad() {
11119
+ this.fetchData();
11120
+ }
11121
+ async fetchData() {
11122
+ this.isLoadingState = true;
11123
+ try {
11124
+ const promises = [
11125
+ HttpService$1().fetchSalonLatestStyles(this.salonId, { limit: 6 })
11126
+ .then(salonStyles => this.latestStyles = salonStyles),
11127
+ ];
11128
+ return Promise.all(promises)
11129
+ .then(() => this.isLoadingState = false)
11130
+ .catch(() => this.isLoadingState = false);
11131
+ }
11132
+ catch (e) { }
11133
+ }
11134
+ onClickLookbook(style) {
11135
+ const elLookbookModal = document.createElement('div');
11136
+ elLookbookModal.innerHTML = `
11137
+ <style-detail
11138
+ salon-id=${this.salonId}
11139
+ salon-lookbook='${JSON.stringify(style)}'
11140
+ ></style-detail>
11141
+ `;
11142
+ document.body.appendChild(elLookbookModal);
11143
+ }
11144
+ render() {
11145
+ if (this.isLoading || this.isLoadingState) {
11146
+ return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
11147
+ backgroundColor: Colors.Gray02,
11148
+ height: '20px',
11149
+ width: '120px',
11150
+ } }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
11151
+ overflow: 'hidden',
11152
+ marginLeft: '-16px',
11153
+ marginBottom: '-16px',
11154
+ } }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
11155
+ float: 'left',
11156
+ paddingLeft: '16px',
11157
+ marginBottom: '16px',
11158
+ } }, h("div", { style: {
11159
+ backgroundColor: Colors.Gray01,
11160
+ borderRadius: '8px',
11161
+ width: '120px',
11162
+ height: '120px',
11163
+ overflow: 'hidden',
11164
+ position: 'relative',
11165
+ cursor: 'pointer',
11166
+ } })))))))));
11167
+ }
11168
+ return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Photos"), h("div", { style: {
11169
+ overflow: 'hidden',
11170
+ marginLeft: '-16px',
11171
+ marginBottom: '-16px',
11172
+ marginTop: '16px',
11173
+ } }, (this.latestStyles || []).map((faveStyle, idx) => {
11174
+ const { imageThumb, albumMedias } = faveStyle;
11175
+ const firstMedia = albumMedias.length > 0 ? albumMedias[0] : null;
11176
+ const isVideo = firstMedia ? isVideoMedia(firstMedia) : false;
11177
+ return (h("div", { key: `style-listing--item-${faveStyle.id}-${idx}`, style: {
11178
+ float: 'left',
11179
+ paddingLeft: '16px',
11180
+ marginBottom: '16px',
11181
+ } }, h("div", { class: "view--salon-styles--item", style: Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '8px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, !isVideo && firstMedia ? {
11182
+ backgroundImage: `url("${firstMedia.imageThumb || firstMedia.imageThumbMedium}")`,
11183
+ backgroundRepeat: 'no-repeat',
11184
+ backgroundPosition: 'center center',
11185
+ backgroundSize: 'cover',
11186
+ } : {}), onClick: () => this.onClickLookbook(faveStyle) }, isVideo && firstMedia && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: imageThumb }, h("source", { src: firstMedia.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
11187
+ fontSize: '48px',
11188
+ color: Colors.TextColor,
11189
+ position: 'absolute',
11190
+ left: '50%',
11191
+ top: '50%',
11192
+ transform: 'translate(-50%, -50%)',
11193
+ } }))))));
11194
+ })))));
11195
+ }
11256
11196
  static get style() { return indexCss$9; }
11257
11197
  };
11258
11198
 
11259
- const indexCss$8 = "";
11199
+ const indexCss$8 = "@media (min-width: 768px){salon-locations .salon-contact--links{overflow:hidden;margin-left:-32px}salon-locations .salon-contact--links-item{float:left;display:flex;flex-direction:row;align-items:center;font-size:16px;min-width:300px;padding-left:32px}salon-locations .salon-contact--links-item:nth-child(2n+1){clear:left}salon-locations .salon-contact--links-item+.salon-contact--links-item{margin-top:8px}}";
11260
11200
 
11261
11201
  let SalonLocations$1 = class extends HTMLElement {
11262
11202
  constructor() {
@@ -11279,20 +11219,36 @@ let SalonLocations$1 = class extends HTMLElement {
11279
11219
  catch (e) { }
11280
11220
  }
11281
11221
  render() {
11282
- const { businessLocationLat: lat, businessLocationLng: lng } = this.salonInfoState || {};
11283
- return (h("div", { class: "view view--salon-locations" }, h("div", { class: "view-content", style: { height: '380px' } }, h("div", { style: {
11284
- fontSize: '16px',
11285
- lineHeight: '26px',
11286
- maxHeight: '52px',
11287
- marginBottom: '16px',
11288
- overflow: 'hidden',
11289
- textOverflow: 'ellipsis',
11290
- } }, formatFullAddress(this.salonInfoState)), h("div", { class: "view--salon-info--map", style: { height: '264px' } }, lat && lng && h("google-map", { lat: lat, lng: lng })))));
11222
+ if (this.isLoading) {
11223
+ return (h("div", { class: "view view--salon-locations" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
11224
+ backgroundColor: Colors.Gray02,
11225
+ height: '20px',
11226
+ width: '120px',
11227
+ } }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
11228
+ backgroundColor: Colors.Gray01,
11229
+ height: '16px',
11230
+ width: '50%',
11231
+ } }), h("div", { style: {
11232
+ backgroundColor: Colors.Gray01,
11233
+ height: '16px',
11234
+ width: '50%',
11235
+ marginTop: '8px',
11236
+ } }), h("div", { style: {
11237
+ backgroundColor: Colors.Gray01,
11238
+ height: '192px',
11239
+ width: '100%',
11240
+ marginTop: '24px',
11241
+ } })))));
11242
+ }
11243
+ const { businessPhone, businessName, website, email, } = this.salonInfoState || {};
11244
+ const websiteUrl = formatWebsiteUrl(website);
11245
+ const fullAddress = formatFullAddress(this.salonInfoState);
11246
+ return (h("div", { class: "view view--salon-locations" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "Contact"), h("div", { class: "salon-contact--links", style: { marginTop: '16px' } }, businessPhone && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-phone-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { href: `tel:${businessPhone}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, businessPhone))), websiteUrl && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-links-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { target: websiteUrl && websiteUrl.indexOf(window.location.hostname) === -1 ? '_blank' : undefined, href: websiteUrl, style: { color: Colors.TextColor, textDecoration: 'none' } }, websiteUrl))), email && (h("div", { class: "salon-contact--links-item" }, h("i", { class: "ri-mail-line", style: { color: Colors.Gray04, fontSize: '18px', marginRight: '6px' } }), " ", h("a", { href: `mailto:${email}`, style: { color: Colors.TextColor, textDecoration: 'none' } }, email)))), h("div", { class: "view--salon-info--map", style: { marginTop: '24px' } }, h("google-map", { "location-name": businessName, "location-address": fullAddress })))));
11291
11247
  }
11292
11248
  static get style() { return indexCss$8; }
11293
11249
  };
11294
11250
 
11295
- const indexCss$7 = ".salon-loobooks--grid-item{float:left;max-width:150px}@media (max-width: 768px){salon-lookbook .view-header{display:block !important}salon-lookbook .salon-loobook--serch-result{margin-bottom:16px}salon-lookbook .salon-loobook--filter-wrapper>label,salon-lookbook .salon-loobook--sort-wrapper>label{display:none !important}}@media (min-width: 768px){.salon-loobooks--grid-item{max-width:200px}}";
11251
+ const indexCss$7 = "@media (max-width: 768px){salon-lookbook .view-header{display:block !important}salon-lookbook .salon-loobook--serch-result{margin-bottom:16px}salon-lookbook .salon-loobook--filter-wrapper>label,salon-lookbook .salon-loobook--sort-wrapper>label{display:none !important}}";
11296
11252
 
11297
11253
  const lookbookSortOptions = [{
11298
11254
  value: 'like',
@@ -11344,19 +11300,13 @@ let SalonLookbook$1 = class extends HTMLElement {
11344
11300
  var masonry = new Macy({
11345
11301
  container: '#salon-loobooks--grid',
11346
11302
  useContainerForBreakpoints: true,
11347
- margin: 12,
11348
- columns: 7,
11303
+ margin: 16,
11304
+ columns: 5,
11349
11305
  breakAt: {
11350
- 1200: {
11351
- margin: 16,
11352
- columns: 6,
11353
- },
11354
- 992: {
11355
- margin: 16,
11356
- columns: 5,
11306
+ 1024: {
11307
+ columns: 4,
11357
11308
  },
11358
11309
  768: {
11359
- margin: 16,
11360
11310
  columns: 3,
11361
11311
  },
11362
11312
  576: {
@@ -11408,7 +11358,7 @@ let SalonLookbook$1 = class extends HTMLElement {
11408
11358
  this.salonLookbooks = [];
11409
11359
  this.hideLoadMore = true;
11410
11360
  this.filterBy = filterBy;
11411
- await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [this.filterBy] } : {}));
11361
+ await this.fetchLookbooks(Object.assign({ page: this.currentPage, sort: this.sortBy }, this.filterBy !== 'all' ? { services: [Number(this.filterBy)] } : {}));
11412
11362
  if (window.masonry) {
11413
11363
  this.isLayoutSetup = false;
11414
11364
  }
@@ -11448,10 +11398,10 @@ let SalonLookbook$1 = class extends HTMLElement {
11448
11398
  onClickLookbook(style) {
11449
11399
  const elLookbookModal = document.createElement('div');
11450
11400
  elLookbookModal.innerHTML = `
11451
- <salon-lookbook-modal
11401
+ <style-detail
11452
11402
  salon-id=${this.salonId}
11453
11403
  salon-lookbook='${JSON.stringify(style)}'
11454
- ></salon-lookbook-modal>
11404
+ ></style-detail>
11455
11405
  `;
11456
11406
  document.body.appendChild(elLookbookModal);
11457
11407
  }
@@ -11485,154 +11435,28 @@ let SalonLookbook$1 = class extends HTMLElement {
11485
11435
  }
11486
11436
  render() {
11487
11437
  return (h("div", { class: "salon-loobooks" }, h("div", null, h("div", { class: "view-content" }, this.renderHeader(), this.salonLookbooks.length > 0 && (h("div", { class: "salon-loobooks--grid", id: "salon-loobooks--grid" }, this.salonLookbooks.map(style => {
11488
- const { caption, fullImageUrlThumb, owner } = style;
11438
+ const { caption, imageThumbMedium, owner } = style;
11489
11439
  return (h("div", { class: "salon-lookbook salon-loobooks--grid-item", onClick: () => this.onClickLookbook(style) }, h("div", { class: "card", style: {
11490
11440
  background: 'none',
11491
11441
  border: 'none',
11492
- maxWidth: '200px',
11442
+ // maxWidth: '200px',
11493
11443
  } }, h("div", { class: "salon-lookbook--image", style: {
11494
11444
  borderRadius: '8px',
11495
11445
  overflow: 'hidden',
11496
11446
  minHeight: '80px',
11497
- background: Colors.Gray06,
11498
- } }, h("img", { src: fullImageUrlThumb, alt: caption })), owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } }, h("user-avatar", { name: owner.name, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
11499
- })))), this.salonLookbooks.length > 0 && !this.hideLoadMore && (h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } }, h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more'))))));
11447
+ background: Colors.Gray01,
11448
+ } }, h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } }, h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
11449
+ })))), this.salonLookbooks.length > 0 && !this.hideLoadMore && (h("div", { class: "view-footer", style: { paddingTop: '16px', textAlign: 'center' } }, h("button", { type: "button", class: "btn btn-light btn-lg", onClick: () => this.onLoadMore(), style: {
11450
+ background: Colors.White,
11451
+ border: `1px solid ${Colors.Gray02}`,
11452
+ borderRadius: '4px',
11453
+ paddingLeft: '24px',
11454
+ paddingRight: '24px',
11455
+ } }, this.isLoadingMore ? 'Loading' : 'Load more'))))));
11500
11456
  }
11501
11457
  static get style() { return indexCss$7; }
11502
11458
  };
11503
11459
 
11504
- var relativeTime = createCommonjsModule(function (module, exports) {
11505
- !function(r,e){module.exports=e();}(commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
11506
- });
11507
-
11508
- const lookbookModalCss = "salon-lookbook-modal .salon-modal--close{right:8px;top:8px}salon-lookbook-modal .salon-modal--inner{height:100%;width:100%;max-width:none}salon-lookbook-modal .salon-styles--item-background{-moz-filter:blur(32px);-webkit-filter:blur(32px);filter:blur(32px)}salon-lookbook-modal .salon-styles--item .salon-styles--item-background{z-index:1}salon-lookbook-modal .salon-styles--item .salon-styles--item-image{position:relative;z-index:2}salon-lookbook-modal .salon-styles--item .carousel-caption{padding-bottom:0;z-index:2}salon-lookbook-modal .salon-styles--slides .carousel-control-prev{z-index:2}@media (min-width: 576px){salon-lookbook-modal .salon-styles--item{height:380px !important}}@media (min-width: 992px){salon-lookbook-modal .salon-modal--inner{height:90%;width:90%;max-width:900px;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;overflow:hidden !important}salon-lookbook-modal .carousel,salon-lookbook-modal .carousel-inner,salon-lookbook-modal .carousel-item,salon-lookbook-modal .salon-styles--item,salon-lookbook-modal .salon-modal--content,salon-lookbook-modal .style-detail--metadata-detail,salon-lookbook-modal .style-detail--container{height:100% !important}salon-lookbook-modal .style-detail--container{display:flex}salon-lookbook-modal .carousel-inner{z-index:1 !important}salon-lookbook-modal .carousel-control-next,salon-lookbook-modal .carousel-control-prev{z-index:2 !important}salon-lookbook-modal .style-detail--photos,salon-lookbook-modal .style-detail--metadata{width:50%}salon-lookbook-modal .salon-styles--item{-moz-border-radius:0 !important;-webkit-border-radius:0 !important;border-radius:0 !important}}";
11509
-
11510
- dayjs_min.extend(relativeTime);
11511
- let SalonBookingModal$1 = class extends HTMLElement {
11512
- constructor() {
11513
- super();
11514
- this.__registerHost();
11515
- this.salonLookbook = '';
11516
- this.lookbookComments = [];
11517
- this.isModalOpen = true;
11518
- }
11519
- componentWillLoad() {
11520
- if (!!this.salonLookbook) {
11521
- this.lookbookInfo = JSON.parse(this.salonLookbook);
11522
- this.fetchData();
11523
- }
11524
- }
11525
- fetchData() {
11526
- try {
11527
- const promises = [
11528
- HttpService$1().fetchStyleDetail(this.lookbookInfo.id).then(lookbookInfo => {
11529
- if (lookbookInfo) {
11530
- this.lookbookInfo = lookbookInfo;
11531
- }
11532
- }),
11533
- HttpService$1().fetchStyleComments({ photo_id: [this.lookbookInfo.id] }).then(lookbookComments => this.lookbookComments = lookbookComments),
11534
- ];
11535
- return Promise.all(promises);
11536
- }
11537
- catch (e) { }
11538
- }
11539
- orderedStylePhotos(albumPhotos, activeId) {
11540
- let selectedStyles = [];
11541
- let restStyles = [];
11542
- (albumPhotos || []).forEach(s => {
11543
- if (s.id === activeId) {
11544
- selectedStyles = selectedStyles.concat(s);
11545
- }
11546
- else {
11547
- restStyles = restStyles.concat(s);
11548
- }
11549
- });
11550
- return selectedStyles.concat(restStyles);
11551
- }
11552
- closeModal() {
11553
- this.isModalOpen = false;
11554
- const el = document.querySelector('salon-lookbook-modal');
11555
- el.remove();
11556
- }
11557
- render() {
11558
- const { id, caption, createdDate, albumPhotos, totalView, totalLike, totalBooking, owner, stylist, album, } = this.lookbookInfo;
11559
- const oderedStyles = albumPhotos ? this.orderedStylePhotos(albumPhotos, id) : [];
11560
- return (h("div", { class: "salon-lookbook--modal" }, this.isModalOpen && (h("div", { class: "salon-modal salon-modal--lookbook-detail" }, h("div", { class: "salon-modal--backdrop", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--close", onClick: () => this.closeModal() }), h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("div", { class: "style-detail--container", style: {
11561
- backgroundColor: Colors.White,
11562
- marginRight: 'auto',
11563
- marginLeft: 'auto',
11564
- maxWidth: '990',
11565
- } }, oderedStyles.length > 0 && (h("div", { class: "style-detail--photos" }, h("div", { id: "style-detail-carousel", class: "carousel slide", "data-bs-ride": "carousel" }, h("div", { class: "carousel-inner" }, oderedStyles.map((photo, index) => {
11566
- const { caption, description,
11567
- // mediaType,
11568
- fullImageUrl, fullImageUrlThumb, fullImageUrlMedium, imgWidth, imgHeight, } = photo;
11569
- const isLandscape = imgWidth >= imgHeight;
11570
- return (h("div", { class: `carousel-item ${index === 0 ? 'active' : ''}` }, h("div", { class: "salon-styles--item", style: {
11571
- flexDirection: isLandscape ? 'column' : 'row',
11572
- justifyContent: 'center',
11573
- alignItems: 'center',
11574
- overflow: 'hidden',
11575
- position: 'relative',
11576
- display: 'flex',
11577
- height: '240px',
11578
- borderRadius: '8px 8px 0 0',
11579
- } }, h("div", { class: "salon-styles--item-background", style: Object.assign(Object.assign({}, fullImageUrlThumb ? { backgroundImage: `url(${fullImageUrlThumb})` } : {}), { backgroundColor: Colors.Gray06, backgroundPosition: 'center', backgroundRepeat: 'no-repeat', backgroundSize: 'cover', position: 'absolute', bottom: '0px', right: '0px', left: '0px', top: '0px', zIndex: '1' }) }), h("img", { alt: caption, class: "salon-styles--item-image", src: fullImageUrlThumb || fullImageUrlMedium || fullImageUrl, style: Object.assign({ display: 'inline-block', position: 'relative', zIndex: '2' }, isLandscape ? { width: '100%' } : { height: '100%' }) }), h("div", { class: "carousel-caption d-none d-md-block" }, caption && h("h5", null, caption), description && h("p", null, description)))));
11580
- })), h("button", { type: "button", "data-bs-slide": "prev", class: "carousel-control-prev", "data-bs-target": "#style-detail-carousel" }, h("span", { class: "carousel-control-prev-icon", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, "Previous")), h("button", { type: "button", "data-bs-slide": "next", class: "carousel-control-next", "data-bs-target": "#style-detail-carousel" }, h("span", { class: "carousel-control-next-icon", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, "Next"))))), h("div", { class: "style-detail--metadata" }, h("div", { class: "style-detail--metadata-detail", style: {
11581
- position: 'relative',
11582
- overflowY: 'auto',
11583
- padding: '16px 24px',
11584
- height: '100%',
11585
- } }, h("div", { class: "style-detail--info--field style-detail--metadata-stats", style: {
11586
- display: 'flex',
11587
- flexDirection: 'row',
11588
- justifyContent: 'flex-start',
11589
- marginBottom: '16px',
11590
- } }, h("div", { style: { display: 'flex', alignItems: 'center' } }, h("i", { class: "ri-eye-line", style: {
11591
- color: Colors.Gray03,
11592
- fontSize: '16px',
11593
- marginRight: '4px',
11594
- position: 'relative',
11595
- top: '1px',
11596
- } }), " ", totalView, " ", totalView === 1 ? 'view' : 'views'), h("div", { style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, h("i", { class: "ri-heart-fill", style: {
11597
- color: Colors.Gray03,
11598
- fontSize: '16px',
11599
- marginRight: '4px',
11600
- position: 'relative',
11601
- top: '1px',
11602
- } }), " ", totalLike, " ", totalLike === 1 ? 'fave' : 'faves'), h("div", { style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, h("i", { class: "ri-calendar-check-line", style: {
11603
- color: Colors.Gray03,
11604
- fontSize: '16px',
11605
- marginRight: '4px',
11606
- position: 'relative',
11607
- top: '1px',
11608
- } }), " ", totalBooking, " booked")), h("div", { style: {
11609
- display: 'flex',
11610
- flexDirection: 'row',
11611
- justifyContent: 'space-between',
11612
- } }, owner && (h("div", { class: "style-detail--info--field" }, h("span", { style: {
11613
- fontSize: '14px',
11614
- color: Colors.Gray03,
11615
- } }, "Posted by"), " ", h("span", { style: {
11616
- fontSize: '16px',
11617
- fontWeight: 'bold',
11618
- color: Colors.Gray01,
11619
- } }, owner.name))), h("div", { class: "style-detail--info--field", style: {
11620
- fontSize: '14px',
11621
- color: Colors.Gray03,
11622
- } }, dayjs_min(createdDate).fromNow())), caption && (h("div", { class: "style-detail--info--field", style: {
11623
- color: Colors.Gray01,
11624
- marginTop: '12px',
11625
- fontSize: '24px',
11626
- } }, caption)), stylist && (h("div", { class: "style-detail--info--field", style: { marginTop: '24px' } }, h("div", { style: { fontSize: '14px', color: Colors.Gray03, marginBottom: '8px' } }, "Stylist"), h("div", { style: {
11627
- display: 'flex',
11628
- flexDirection: 'row',
11629
- justifyContent: 'space-between',
11630
- alignItems: 'center',
11631
- } }, h("user-avatar", { size: 32, name: stylist.name, shortName: `${(stylist.firstName || '').charAt(0)}${(stylist.lastName || '').charAt(0)}`, avatar: stylist.avatar, nameStyle: { fontSize: 16, fontWeight: 'bold' } })))), album && album.service && (h("div", { class: "style-detail--info--field", style: { marginTop: '24px' } }, h("div", { style: { fontSize: '14px', color: Colors.Gray03, marginBottom: '8px' } }, "Services"), h("div", { style: { fontSize: '16px', color: Colors.Gray01 } }, album.service.name))))))))))));
11632
- }
11633
- static get style() { return lookbookModalCss; }
11634
- };
11635
-
11636
11460
  const indexCss$6 = "salon-ranking{display:block}";
11637
11461
 
11638
11462
  let SalonRanking$1 = class extends HTMLElement {
@@ -11645,30 +11469,30 @@ let SalonRanking$1 = class extends HTMLElement {
11645
11469
  getRankingData(ranking) {
11646
11470
  if (ranking === 5) {
11647
11471
  return {
11648
- color: Colors.Danger,
11472
+ color: Colors.Primary,
11649
11473
  text: 'Viral',
11650
11474
  };
11651
11475
  }
11652
11476
  if (ranking === 4) {
11653
11477
  return {
11654
- color: Colors.Pink03,
11478
+ color: Colors.Orange03,
11655
11479
  text: 'Advancing',
11656
11480
  };
11657
11481
  }
11658
11482
  if (ranking === 3) {
11659
11483
  return {
11660
- color: Colors.Orange03,
11484
+ color: Colors.Lilac03,
11661
11485
  text: 'Progressing',
11662
11486
  };
11663
11487
  }
11664
11488
  if (ranking === 2) {
11665
11489
  return {
11666
- color: Colors.DarkBlue03,
11490
+ color: Colors.Blue03,
11667
11491
  text: 'Building',
11668
11492
  };
11669
11493
  }
11670
11494
  return {
11671
- color: Colors.Gray01,
11495
+ color: Colors.Gray05,
11672
11496
  text: 'Starting',
11673
11497
  };
11674
11498
  }
@@ -11701,185 +11525,168 @@ const sortOptions = [{
11701
11525
  value: 'rating_asc',
11702
11526
  label: 'Low rating first',
11703
11527
  }];
11704
- const scoreValuesMapping = {
11705
- all: 'all',
11706
- star1: 1,
11707
- star2: 2,
11708
- star3: 3,
11709
- star4: 4,
11710
- star5: 5,
11711
- };
11712
11528
  let SalonReviews$1 = class extends HTMLElement {
11713
11529
  constructor() {
11714
11530
  super();
11715
11531
  this.__registerHost();
11716
- this.primaryColor = Colors.Coral03;
11532
+ this.primaryColor = Colors.Primary;
11533
+ this.stats = {};
11717
11534
  this.totalReviews = 0;
11718
- this.salonReviews = [];
11719
- this.pageOffset = pageLimited;
11720
- this.ratings = [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5'];
11721
- this.sorting = sortOptions[0].value;
11722
- this.renderReviewsList = () => {
11723
- const ratingTexts = getRatingText();
11724
- const filteredReviews = this.getFilteredReviews(this.pageOffset);
11725
- const filteredReviewsCount = this.ratings.indexOf(scoreValuesMapping.all) > -1
11726
- ? this.totalReviews : filteredReviews.length;
11727
- return (h("div", { class: "reviews-list" }, h("div", { class: "reviews-list--header", style: {
11728
- display: 'flex',
11729
- flexDirection: 'row',
11730
- justifyContent: 'space-between',
11731
- alignItems: 'center',
11732
- marginBottom: '24px',
11733
- } }, h("div", { class: "reviews-list--couter", style: { fontWeight: 'bold' } }, filteredReviewsCount, " ", filteredReviewsCount === 1 ? `review` : `reviews`), h("div", { class: "reviews-list--sorting", style: {
11734
- display: 'flex',
11735
- flexDirection: 'row',
11736
- alignItems: 'center',
11737
- } }, h("label", { style: { marginRight: '8px', marginBottom: '0' } }, "Sort by"), h("select", { class: "form-select", style: { width: '160px' }, onChange: (evt) => this.onChangeSorting(evt.target.value) }, sortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sorting }, sortOption.label)))))), h("div", { class: "view-content" }, filteredReviewsCount > 0 && filteredReviews.map(review => {
11738
- const { user } = review;
11739
- return (h("div", { class: "salon-review", style: {
11740
- marginBottom: '24px',
11741
- paddingBottom: '24px',
11742
- borderBottom: `1px solid ${Colors.Gray05}`,
11743
- } }, h("div", { class: "salon-review--user", style: { marginBottom: '24px' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: user.name, shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => {
11744
- const isHightlight = score <= review.point;
11745
- return (h("i", { class: isHightlight ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '16px', marginRight: '4px' }, isHightlight ? { color: this.primaryColor } : { color: Colors.Gray03 }) }));
11746
- }), review.createdDate && (h("div", { class: "salon-review--rating--date", style: { color: Colors.Gray03, marginLeft: '16px' } }, dayjs_min(review.createdDate).format(shortDate)))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: 'bold' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '24px' } }, h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (h("div", { style: {
11747
- display: 'flex',
11748
- flexDirection: 'row',
11749
- overflowX: 'auto',
11750
- } }, review.photos.map(fileObj => (h("div", { style: {
11751
- border: '1px solid #d9d9d9',
11752
- position: 'relative',
11753
- cursor: 'pointer',
11754
- borderRadius: '2px',
11755
- height: '66px',
11756
- marginTop: '16px',
11757
- marginRight: '16px',
11758
- } }, h("img", { alt: "", src: fileObj.imageUrlThumb, height: "64", style: { width: 'auto' } }))))))));
11759
- })), this.canLoadMore && (h("div", { class: "view-footer", style: { textAlign: 'center' } }, h("button", { type: "button", class: "btn btn-light", onClick: () => this.onLoadMore() }, this.isLoadingMore ? 'Loading' : 'Load more')))));
11760
- };
11535
+ this.allReviews = [];
11536
+ this.page = 1;
11537
+ this.filterBy = [];
11538
+ this.sortBy = sortOptions[0].value;
11761
11539
  }
11762
11540
  componentWillLoad() {
11763
11541
  this.fetchData();
11764
11542
  }
11765
11543
  fetchData() {
11544
+ this.isLoading = true;
11766
11545
  try {
11767
- const promises = [
11768
- HttpService$1().fetchSalonInfo(this.salonId).then(salonInfo => this.salonInfo = salonInfo),
11769
- HttpService$1().fetchSalonReviews(this.salonId, { limit: pageLimited }).then(response => {
11770
- const { total, allItems } = response;
11771
- this.totalReviews = total;
11772
- this.salonReviews = allItems;
11773
- if (total > pageLimited) {
11774
- this.canLoadMore = true;
11775
- }
11776
- }),
11777
- ];
11778
- return Promise.all(promises);
11546
+ HttpService$1().fetchSalonReviews(this.salonId, {
11547
+ page: 1,
11548
+ sort: this.sortBy,
11549
+ limit: pageLimited,
11550
+ }).then(response => {
11551
+ const { total, stats, data: allReviews } = response;
11552
+ this.stats = stats;
11553
+ this.totalReviews = total;
11554
+ this.allReviews = allReviews;
11555
+ this.canLoadMore = total > pageLimited;
11556
+ });
11779
11557
  }
11780
11558
  catch (e) { }
11781
- }
11782
- sortReviews(filteredReviews) {
11783
- return sortBy_1(filteredReviews, [review => {
11784
- if (this.sorting === 'rating_desc') {
11785
- return -review.point;
11786
- }
11787
- if (this.sorting === 'rating_asc') {
11788
- return review.point;
11789
- }
11790
- const createdTime = dayjs_min(review.createdDate).unix();
11791
- return this.sorting === 'oldest' ? createdTime : -createdTime;
11792
- }]);
11793
- }
11794
- getFilteredReviews(pageOffset) {
11795
- let filteredReviews = [...this.salonReviews];
11796
- if (this.ratings.indexOf(scoreValuesMapping.all) === -1) {
11797
- const reviewRatingScores = this.ratings.map(r => scoreValuesMapping[r]);
11798
- filteredReviews = [...filteredReviews].filter(review => reviewRatingScores.indexOf(review.point) > -1);
11799
- }
11800
- const sortedReviews = this.sortReviews(filteredReviews);
11801
- return pageOffset ? sortedReviews.slice(0, pageOffset) : sortedReviews;
11559
+ this.isLoading = false;
11802
11560
  }
11803
11561
  onLoadMore() {
11804
11562
  this.isLoadingMore = true;
11805
11563
  try {
11806
- this.pageOffset += pageLimited;
11807
- const totalResults = this.getFilteredReviews(this.pageOffset).length;
11808
- if (this.pageOffset > totalResults) {
11809
- this.canLoadMore = false;
11810
- }
11564
+ HttpService$1().fetchSalonReviews(this.salonId, {
11565
+ page: this.page + 1,
11566
+ sort: this.sortBy,
11567
+ limit: pageLimited,
11568
+ }).then(response => {
11569
+ const { total, data: allReviews } = response;
11570
+ this.page = this.page + 1;
11571
+ this.totalReviews = total;
11572
+ this.allReviews = this.allReviews.concat(allReviews);
11573
+ this.canLoadMore = (allReviews || []).length === pageLimited;
11574
+ });
11811
11575
  }
11812
- catch (error) { }
11576
+ catch (e) { }
11813
11577
  this.isLoadingMore = false;
11814
11578
  }
11815
- onChangeSorting(sorting) {
11816
- this.sorting = sorting;
11817
- this.pageOffset = pageLimited;
11818
- this.canLoadMore = this.getFilteredReviews(pageLimited).length >= pageLimited;
11819
- }
11820
- ;
11821
- onChangeFilterRating(rating) {
11822
- if (rating === scoreValuesMapping.all) {
11823
- this.ratings = [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5'];
11579
+ onChangeFilter(filterBy) {
11580
+ this.isFiltering = true;
11581
+ try {
11582
+ HttpService$1().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: this.sortBy, limit: pageLimited }, filterBy.length > 0 ? { avg_point: filterBy } : {})).then(response => {
11583
+ const { total, data: allReviews } = response;
11584
+ this.page = 1;
11585
+ this.totalReviews = total;
11586
+ this.allReviews = allReviews;
11587
+ this.canLoadMore = (allReviews || []).length === pageLimited;
11588
+ });
11824
11589
  }
11825
- else if (this.ratings.indexOf(rating) > -1) {
11826
- this.ratings = this.ratings.filter(r => r !== scoreValuesMapping.all && r !== rating);
11590
+ catch (e) { }
11591
+ this.isFiltering = false;
11592
+ }
11593
+ onChangeSorting(sortBy) {
11594
+ this.isSorting = true;
11595
+ try {
11596
+ HttpService$1().fetchSalonReviews(this.salonId, Object.assign({ page: 1, sort: sortBy, limit: pageLimited }, this.filterBy.length > 0 ? { avg_point: this.filterBy } : {})).then(response => {
11597
+ const { total, data: allReviews } = response;
11598
+ this.page = 1;
11599
+ this.totalReviews = total;
11600
+ this.allReviews = allReviews;
11601
+ this.canLoadMore = (allReviews || []).length === pageLimited;
11602
+ });
11827
11603
  }
11828
- else {
11829
- const needFilterByAll = this.ratings.concat([rating]).filter(r => r !== scoreValuesMapping.all).length === 5;
11830
- this.ratings = needFilterByAll
11831
- ? [scoreValuesMapping.all, 'star1', 'star2', 'star3', 'star4', 'star5']
11832
- : this.ratings.concat([rating]);
11833
- }
11834
- this.pageOffset = pageLimited;
11835
- this.canLoadMore = this.getFilteredReviews(pageLimited).length >= pageLimited;
11836
- }
11837
- ;
11838
- renderReviewsFilters() {
11839
- const reviewsByScore = groupBy_1(this.salonReviews, review => review.point);
11840
- const isAllChecked = this.ratings.indexOf(scoreValuesMapping.all) > -1;
11841
- const inputCheckedStyle = lib.css({
11842
- outline: 'none !important',
11843
- backgroundColor: `${this.primaryColor} !important`,
11844
- borderColor: `${this.primaryColor} !important`,
11845
- });
11846
- return (h("div", { class: "salon-reviews--filters-by-ratings" }, h("div", { style: {
11847
- fontWeight: 'bold',
11848
- marginBottom: '12px',
11849
- marginTop: '32px',
11850
- } }, "Filter by ratings"), h("div", { class: "salon-reviews--filters-by-ratings--options" }, h("div", { class: "checkbox--wrapper", style: { marginBottom: '12px' } }, h("div", { class: "checkbox--box" }, h("div", { class: "form-check" }, h("input", Object.assign({ type: "checkbox", class: "form-check-input", value: scoreValuesMapping.all, onChange: () => this.onChangeFilterRating(scoreValuesMapping.all), checked: isAllChecked }, isAllChecked ? inputCheckedStyle : {})), h("label", { class: "form-check-label" }, "All ratings")))), [5, 4, 3, 2, 1].filter(score => reviewsByScore[score]).map(score => {
11851
- const scoreReviewCount = reviewsByScore[score].length;
11852
- const isChecked = this.ratings.indexOf(scoreValuesMapping.all) > -1 || this.ratings.indexOf(`star${score}`) > -1;
11853
- return (h("div", { style: {
11854
- display: 'flex',
11855
- flexDirection: 'row',
11856
- justifyContent: 'space-between',
11857
- marginBottom: '12px',
11858
- } }, h("div", { class: "form-check" }, h("input", Object.assign({ value: "", type: "checkbox", class: "form-check-input", onChange: () => this.onChangeFilterRating(`star${score}`), checked: isChecked }, isChecked ? inputCheckedStyle : {})), h("label", { class: "form-check-label" }, [1, 2, 3, 4, 5].map(point => {
11859
- const isHightlight = point <= score;
11860
- return (h("i", { class: isHightlight ? 'ri-heart-fill' : 'ri-heart-line', style: { fontSize: '16px', marginRight: '4px' } }));
11861
- }))), h("div", { style: { color: Colors.Gray01 } }, scoreReviewCount)));
11862
- }))));
11604
+ catch (e) { }
11605
+ this.isSorting = false;
11863
11606
  }
11864
11607
  render() {
11865
- const { rating } = this.salonInfo || {};
11866
- return (h("div", { class: "salon-reviews", style: { display: 'flex', flexDirection: 'row' } }, h("div", { class: "salon-reviews--filters", style: { width: '264px' } }, h("div", { class: "salon-reviews--score" }, h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
11867
- return (h("i", { class: score <= rating ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '32px', marginRight: '4px' }, score <= rating ? { color: this.primaryColor } : { color: Colors.Gray03 }) }));
11608
+ const ratingTexts = ['', 'Poor', 'Sufficient', 'Average', 'Well', 'Very good'];
11609
+ return (h("div", { class: "view view--salon-reviews" }, h("div", { class: "salon-reviews--filters" }, h("div", { class: "salon-reviews--score" }, h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row' } }, [1, 2, 3, 4, 5].map(score => {
11610
+ return (h("i", { class: score <= this.stats.reviewPoint ? 'ri-heart-fill' : 'ri-heart-line', style: Object.assign({ fontSize: '32px', marginRight: '4px' }, score <= this.stats.reviewPoint ? { color: this.primaryColor } : { color: Colors.Gray04 }) }));
11868
11611
  })), h("div", { class: "salon-review--rating--date", style: {
11869
11612
  display: 'flex',
11870
11613
  flexDirection: 'row',
11871
11614
  alignItems: 'center',
11872
11615
  marginTop: '-8px',
11873
- } }, h("span", { style: { fontSize: '24px' } }, rating, "/5"), " ", h("span", { style: { color: Colors.Gray02, marginLeft: '8px' } }, "(", this.totalReviews, " reviews)"))), h("div", { class: "salon-reviews--filters--options" }, this.renderReviewsFilters())), h("div", { class: "salon-reviews--list", style: {
11874
- flexGrow: '1',
11875
- flexShrink: '1',
11876
- paddingLeft: '64px',
11877
- } }, this.renderReviewsList())));
11616
+ } }, h("span", { style: { fontSize: '24px' } }, this.stats.reviewPoint, "/5"), " ", h("span", { style: { color: Colors.Gray04, marginLeft: '8px' } }, "(", this.stats.totalReviews, " reviews)"))), h("div", { class: "salon-reviews--filters--options", style: { marginTop: '24px' } }, h("div", { style: {
11617
+ background: Colors.Gray01,
11618
+ display: 'flex',
11619
+ alignItems: 'center',
11620
+ borderRadius: '4px',
11621
+ padding: '16px',
11622
+ } }, h("div", null, h("input", { type: "checkbox", checked: this.filterBy.length === 0, onChange: () => {
11623
+ this.filterBy = [];
11624
+ this.onChangeFilter([]);
11625
+ } }), " ", h("span", { style: { marginLeft: '4px' } }, "All reviews")), [5, 4, 3, 2, 1].map(score => {
11626
+ const isChecked = this.filterBy.indexOf(score) > -1;
11627
+ return (h("div", { key: `salon-reviews--filters-score--${score}`, style: { display: 'flex', alignItems: 'center', marginLeft: '16px' } }, h("input", { type: "checkbox", checked: isChecked, onChange: () => {
11628
+ const newFilter = isChecked ? this.filterBy.filter(fs => fs !== score) : this.filterBy.concat([score]);
11629
+ this.filterBy = newFilter;
11630
+ this.onChangeFilter(newFilter);
11631
+ } }), " ", h("span", { style: { display: 'flex', alignItems: 'center', marginLeft: '4px' } }, score, " ", h("i", { class: "ri-heart-line", style: {
11632
+ fontSize: '16px',
11633
+ marginLeft: '4px',
11634
+ marginRight: '4px',
11635
+ lineHeight: '1',
11636
+ } }), " ", h("span", { style: { color: Colors.Gray04, fontSize: '12px' } }, "(", this.stats[String(score)] || 0, ")"))));
11637
+ })))), h("div", { class: "salon-reviews--list-header", style: {
11638
+ display: 'flex',
11639
+ flexDirection: 'row',
11640
+ justifyContent: 'space-between',
11641
+ alignItems: 'center',
11642
+ marginTop: '24px',
11643
+ } }, h("div", { class: "view--salon-reviews--counter" }, this.totalReviews, " ", this.totalReviews === 1 ? `review` : `reviews`), h("div", { style: { display: 'flex', alignItems: 'center' } }, h("label", { style: { marginRight: '8px', color: Colors.Gray04 } }, "Sort by"), h("select", { class: "search-filter--select", "place-holder": "Most popular", disabled: this.isLoading, onChange: (evt) => {
11644
+ this.sortBy = evt.target.value;
11645
+ this.onChangeSorting(evt.target.value);
11646
+ }, style: {
11647
+ display: 'flex',
11648
+ alignItems: 'center',
11649
+ backgroundColor: Colors.Gray01,
11650
+ borderColor: Colors.Gray01,
11651
+ borderRadius: '4px',
11652
+ height: '40px',
11653
+ width: '130px',
11654
+ } }, sortOptions.map(sortOption => (h("option", { value: sortOption.value, selected: sortOption.value === this.sortBy, key: `search-filter--select-option--${sortOption.value}` }, sortOption.label)))))), h("div", { class: "salon-reviews--list-content", style: { marginTop: '24px' } }, this.allReviews.map((review, idx) => {
11655
+ const user = review.user || {};
11656
+ return (h("div", { class: "salon-review", key: `salon-review--${idx}`, style: {
11657
+ borderBottom: `1px solid ${Colors.Gray02}`,
11658
+ marginBottom: '24px',
11659
+ paddingBottom: '24px',
11660
+ } }, h("div", { class: "salon-review--user", style: { marginBottom: '16px', overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("span", { style: { fontSize: '18px', fontWeight: '600', color: Colors.TextColor } }, (user.firstName || user.lastName) ? `${user.firstName || ''} ${user.lastName || ''}` : ''), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { class: "salon-review--rating", style: { display: 'flex', flexDirection: 'row', marginBottom: '4px' } }, [1, 2, 3, 4, 5].map(score => (h("i", { key: `salon-review--rating--item--score--${score}`, class: score <= review.point ? 'ri-heart-fill' : 'ri-heart-line', style: {
11661
+ color: score <= review.point ? this.primaryColor : Colors.Gray04,
11662
+ fontSize: '16px',
11663
+ marginRight: '4px',
11664
+ } }))), review.createdDate && (h("div", { class: "salon-review--rating--date", style: { fontSize: '14px', color: Colors.Gray04, marginLeft: '16px', position: 'relative', top: '2px' } }, dayjs_min(review.createdDate).format(shortDateYearFormat)))), h("div", { class: "salon-review--rating-text", style: { fontSize: '16px', fontWeight: '600' } }, ratingTexts[review.point]), (review.title || review.description) && (h("div", { class: "salon-review--detail", style: { marginTop: '16px' } }, h("div", { class: "salon-review--title", style: { fontSize: '18px', fontWeight: 'bold' }, innerHTML: review.title }), h("div", { class: "salon-review--description", style: { fontSize: '16px' }, innerHTML: review.description }))), review.photos.length > 0 && (h("div", { style: {
11665
+ display: 'flex',
11666
+ flexDirection: 'row',
11667
+ overflowX: 'auto',
11668
+ } }, review.photos.map(fileObj => (h("div", { key: `upload-file--${fileObj.id}`, class: "review--photo", style: {
11669
+ position: 'relative',
11670
+ cursor: 'pointer',
11671
+ marginTop: '16px',
11672
+ marginRight: '12px',
11673
+ } }, h("img", { width: 72, src: fileObj.imageUrlThumb, style: { display: 'block' } }))))))));
11674
+ })), h("div", { class: "salon-reviews--list-footer", style: {
11675
+ textAlign: 'center',
11676
+ paddingTop: '16px',
11677
+ paddingBottom: '16px',
11678
+ } }, h("button", { class: "btn btn-light btn-lg", style: {
11679
+ background: Colors.White,
11680
+ border: `1px solid ${Colors.Gray02}`,
11681
+ borderRadius: '4px',
11682
+ paddingLeft: '24px',
11683
+ paddingRight: '24px',
11684
+ }, onClick: () => this.onLoadMore() }, "Load more"))));
11878
11685
  }
11879
11686
  static get style() { return indexCss$5; }
11880
11687
  };
11881
11688
 
11882
- const indexCss$4 = "@media (min-width: 768px){.salon-schedules--dates{overflow:hidden;margin-left:-32px}.salon-schedules--dates .salon-schedules--day{float:left;display:flex;flex-direction:row;min-width:240px;padding-left:32px}}";
11689
+ const indexCss$4 = "salon-schedules .salon-schedules--day{display:flex;flex-direction:row;min-width:240px}@media (min-width: 768px){salon-schedules .salon-schedules--dates{overflow:hidden;margin-left:-32px}salon-schedules .salon-schedules--day{float:left;padding-left:32px}}";
11883
11690
 
11884
11691
  let SalonSchedules$1 = class extends HTMLElement {
11885
11692
  constructor() {
@@ -11911,8 +11718,46 @@ let SalonSchedules$1 = class extends HTMLElement {
11911
11718
  return `${businessHour.openTime} - ${businessHour.closeTime}`;
11912
11719
  }
11913
11720
  render() {
11914
- const businessHours = (this.salonInfoState && this.salonInfoState.businessHours) || [];
11915
- return (h("div", { class: "view view--salon-schedules" }, h("div", { class: "view-content" }, businessHours.length > 0 && (h("div", { class: "salon-schedules" }, h("div", { class: "salon-schedules--title", style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"), h("div", { class: "salon-schedules--dates" }, h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
11721
+ if (this.isLoading) {
11722
+ return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: {
11723
+ backgroundColor: Colors.Gray02,
11724
+ height: '20px',
11725
+ width: '120px',
11726
+ } }), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
11727
+ backgroundColor: Colors.Gray01,
11728
+ height: '16px',
11729
+ width: '30%',
11730
+ } }), h("div", { style: {
11731
+ backgroundColor: Colors.Gray01,
11732
+ height: '16px',
11733
+ width: '40%',
11734
+ marginTop: '8px',
11735
+ } }), h("div", { style: {
11736
+ backgroundColor: Colors.Gray01,
11737
+ height: '16px',
11738
+ width: '75%',
11739
+ marginTop: '12px',
11740
+ } }), h("div", { style: {
11741
+ backgroundColor: Colors.Gray01,
11742
+ height: '16px',
11743
+ width: '75%',
11744
+ marginTop: '8px',
11745
+ } })), h("div", { style: { marginTop: '24px' } }, h("div", { style: {
11746
+ overflow: 'hidden',
11747
+ marginLeft: '-16px',
11748
+ marginBottom: '-16px',
11749
+ } }, [1, 2, 3, 4, 5, 6, 7].map((fakeId, idx) => (h("div", { key: `style-listing--item-${fakeId}-${idx}`, style: {
11750
+ float: 'left',
11751
+ paddingLeft: '16px',
11752
+ marginBottom: '16px',
11753
+ } }, h("div", { style: {
11754
+ backgroundColor: Colors.Gray01,
11755
+ width: '120px',
11756
+ height: '20px',
11757
+ } })))))))));
11758
+ }
11759
+ const { about, businessHours, } = (this.salonInfoState || {});
11760
+ return (h("div", { class: "view view--salon-contact" }, h("div", { class: "view-content", style: this.withBorder ? { border: `1px solid ${Colors.Gray02}`, borderRadius: '4px' } : { padding: '0px' } }, h("div", { style: { fontSize: '18px', fontWeight: 'bold' } }, "About"), about && (h("div", { class: "salon-contact--info--desc", style: { fontSize: '16px', marginTop: '16px' }, innerHTML: about })), businessHours && businessHours.length > 0 && (h("div", { class: "salon-schedules", style: { marginTop: '24px' } }, h("div", { class: "salon-schedules--title", style: { fontSize: '16px', fontWeight: 'bold' } }, "Working hours"), h("div", { class: "salon-schedules--dates" }, h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Mon"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[0]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Tue"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[1]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Wed"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[2]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Thur"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[3]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Fri"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[4]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sat"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[5]))), h("div", { class: "salon-schedules--day", style: { marginTop: '8px' } }, h("div", { class: "salon-schedules--day-name", style: { fontWeight: 'bold', minWidth: '40px' } }, "Sun"), h("div", { class: "salon-schedules--day-time" }, this.renderBusinessHour(businessHours[6])))))))));
11916
11761
  }
11917
11762
  static get style() { return indexCss$4; }
11918
11763
  };
@@ -11929,23 +11774,54 @@ let SalonServices$1 = class extends HTMLElement {
11929
11774
  this.fetchData();
11930
11775
  }
11931
11776
  async fetchData() {
11777
+ this.isLoading = true;
11932
11778
  try {
11933
11779
  this.salonServices = await HttpService$1().fetchSalonServices(this.salonId);
11934
11780
  }
11935
- catch (e) { }
11781
+ catch (e) {
11782
+ this.salonServices = [];
11783
+ }
11784
+ this.isLoading = false;
11936
11785
  }
11937
11786
  render() {
11938
- return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray05}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap' } }, sortBy_1(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("a", { href: `#service-group--${serviceGroup.id}` }, h("button", { type: "button", class: this.buttonClass, style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), sortBy_1(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
11787
+ if (this.isLoading) {
11788
+ return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray01}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden' } }, [1, 2, 3, 4, 5, 6].map((fakeId, index) => (h("div", { key: `service-group--${fakeId}--${index}`, style: {
11789
+ backgroundColor: Colors.Gray02,
11790
+ float: 'left',
11791
+ marginRight: '12px',
11792
+ height: '30px',
11793
+ width: '120px',
11794
+ } })))))), [1, 2, 3, 4, 5, 6].map((fakeId, index) => {
11795
+ return (h("div", { id: `service-group--${fakeId}`, style: { marginTop: '32px' } }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
11796
+ backgroundColor: Colors.Gray03,
11797
+ height: '20px',
11798
+ width: '120px',
11799
+ } }), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray01}`, marginTop: '12px' } }, h("div", { class: "view-content" }, [1, 2, 3].map((fakeGroupId, fakeGroupIndex) => (h("div", { key: `service-group--${fakeId}--service-${fakeGroupId}--${fakeGroupIndex}`, class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({}, fakeGroupIndex > 0 ? {
11800
+ marginTop: '12px',
11801
+ paddingTop: '12px',
11802
+ borderTop: `1px solid ${Colors.Gray01}`,
11803
+ } : {}) }, h("div", { key: `service-group--${fakeId}--${index}`, style: {
11804
+ backgroundColor: Colors.Gray01,
11805
+ height: '16px',
11806
+ width: '120px',
11807
+ } })), h("div", { style: { marginTop: '4px' } }, h("div", { style: {
11808
+ backgroundColor: Colors.Gray01,
11809
+ height: '16px',
11810
+ width: '240px',
11811
+ } })))))))));
11812
+ })));
11813
+ }
11814
+ return (h("div", { class: "salon-services--container" }, h("div", { class: "view view--salon-services--header", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content", style: { overflowX: 'auto' } }, h("div", { style: { whiteSpace: 'nowrap' } }, sortBy_1(this.salonServices || [], (['order', 'name'])).map((serviceGroup, index) => (h("a", { href: `#service-group--${serviceGroup.id}` }, h("button", { type: "button", class: this.buttonClass, style: index > 0 ? { marginLeft: '12px' } : {} }, serviceGroup.name))))))), sortBy_1(this.salonServices || [], (['order', 'name'])).map(serviceGroup => {
11939
11815
  const hasMultipleCates = (serviceGroup.data || []).length > 1;
11940
- return (h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray05}` } }, h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" }, hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray06}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
11816
+ return (h("div", { id: `service-group--${serviceGroup.id}`, style: { marginTop: '32px' } }, h("h3", { style: { fontSize: '24px', marginBottom: '12px' } }, serviceGroup.name), h("div", { class: "view view--salon-service-type", style: { border: `1px solid ${Colors.Gray02}` } }, h("div", { class: "view-content" }, (serviceGroup.data || []).map((subGroup, subGroupIndex) => (h("div", { class: "salon-service-category" }, hasMultipleCates && (h("h4", { style: Object.assign({ fontSize: '20px', marginBottom: '12px', paddingBottom: '12px', borderBottom: `1px solid ${Colors.Gray02}` }, subGroupIndex > 0 ? { marginTop: '32px' } : {}) }, subGroup.name)), (subGroup.data || []).map((service, serviceIndex) => (h("div", { class: "salon-service" }, h("div", { class: "salon-service--name", style: Object.assign({ fontSize: '16px', fontWeight: '500' }, serviceIndex > 0 ? {
11941
11817
  marginTop: '12px',
11942
11818
  paddingTop: '12px',
11943
- borderTop: `1px solid ${Colors.Gray06}`,
11819
+ borderTop: `1px solid ${Colors.Gray01}`,
11944
11820
  } : {}) }, service.name), (!service.hideDuration || !service.hidePrice) && (h("div", { style: {
11945
11821
  display: 'block',
11946
11822
  marginTop: '4px',
11947
11823
  fontSize: '90%',
11948
- color: Colors.Gray03,
11824
+ color: Colors.Gray05,
11949
11825
  } }, [
11950
11826
  !service.hideDuration ? `${service.duration} mins` : '',
11951
11827
  !service.hidePrice ? `$${service.price}` : '',
@@ -11955,74 +11831,81 @@ let SalonServices$1 = class extends HTMLElement {
11955
11831
  static get style() { return indexCss$3; }
11956
11832
  };
11957
11833
 
11958
- const indexCss$2 = ".salon-styles--item-background{-moz-filter:blur(32px);-webkit-filter:blur(32px);filter:blur(32px)}.salon-styles--item .salon-styles--item-background{z-index:1}.salon-styles--item .salon-styles--item-image{position:relative;z-index:2}.salon-styles--item .carousel-caption{padding-bottom:0;z-index:2}.salon-styles--slides .carousel-control-prev{z-index:2}";
11834
+ const indexCss$2 = ".view--salon-stylists{overflow:hidden;margin-left:-12px;margin-top:-12px}.view--salon-stylists .salon-stylist{float:left;padding-left:12px;padding-top:12px;width:50%}.view--salon-stylists .salon-stylist--avatar{height:180px}@media (min-width: 576px){.view--salon-stylists .salon-stylist{width:33.33%;max-width:240px}}@media (min-width: 768px){.view--salon-stylists{margin-left:-24px;margin-top:-24px}.view--salon-stylists .salon-stylist{padding-left:24px;padding-top:24px;width:264px;max-width:none}.view--salon-stylists .salon-stylist--avatar{height:240px}}";
11959
11835
 
11960
- let SalonStyles$1 = class extends HTMLElement {
11836
+ const pageLimit = 20;
11837
+ let SalonStylists$1 = class extends HTMLElement {
11961
11838
  constructor() {
11962
11839
  super();
11963
11840
  this.__registerHost();
11841
+ this.page = 1;
11964
11842
  }
11965
- componentDidLoad() {
11843
+ componentWillLoad() {
11966
11844
  this.fetchData();
11967
11845
  }
11968
11846
  async fetchData() {
11847
+ this.isLoading = true;
11969
11848
  try {
11970
- const promises = [
11971
- HttpService$1().fetchSalonPhotos(this.salonId).then(salonStyles => this.firstPageStyles = salonStyles),
11972
- HttpService$1().fetchAllSalonPhotos(this.salonId, { page: 2 }).then(nestPageStyles => this.nestPageStyles = nestPageStyles),
11973
- ];
11974
- return Promise.all(promises);
11849
+ const { total, data } = await HttpService$1().fetchSalonStylists(this.salonId, { page: 1, limit: pageLimit });
11850
+ this.totalStylists = total;
11851
+ this.salonStylists = data;
11852
+ this.canLoadMore = data.length === pageLimit;
11975
11853
  }
11976
- catch (e) { }
11977
- }
11978
- render() {
11979
- return (h("div", { class: "view view--salon-styles" }, h("div", { class: "view-content" }, h("div", { class: "salon-styles--slides" }, h("div", { id: "salon-styles-carousel", class: "carousel slide", "data-bs-ride": "carousel" }, h("div", { class: "carousel-inner" }, (this.firstPageStyles || []).concat(this.nestPageStyles || []).map((photo, index) => {
11980
- const { caption, description,
11981
- // mediaType,
11982
- fullImageUrl, fullImageUrlThumb, fullImageUrlMedium, imgWidth, imgHeight, } = photo;
11983
- const isLandscape = imgWidth >= imgHeight;
11984
- return (h("div", { class: `carousel-item ${index === 0 ? 'active' : ''}` }, h("div", { class: "salon-styles--item", style: {
11985
- flexDirection: isLandscape ? 'column' : 'row',
11986
- justifyContent: 'center',
11987
- alignItems: 'center',
11988
- overflow: 'hidden',
11989
- position: 'relative',
11990
- display: 'flex',
11991
- height: '380px',
11992
- borderRadius: '8px',
11993
- } }, h("div", { class: "salon-styles--item-background", style: Object.assign(Object.assign({}, fullImageUrlThumb ? { backgroundImage: `url(${fullImageUrlThumb})` } : {}), { backgroundColor: Colors.Gray06, backgroundPosition: 'center', backgroundRepeat: 'no-repeat', backgroundSize: 'cover', position: 'absolute', bottom: '0px', right: '0px', left: '0px', top: '0px' }) }), h("img", { alt: caption, class: "salon-styles--item-image", src: fullImageUrlMedium || fullImageUrl, style: Object.assign({ display: 'inline-block' }, isLandscape ? { width: '100%' } : { height: '100%' }) }), h("div", { class: "carousel-caption d-none d-md-block" }, caption && h("h5", null, caption), description && h("p", null, description)))));
11994
- })), h("button", { type: "button", "data-bs-slide": "prev", class: "carousel-control-prev", "data-bs-target": "#salon-styles-carousel" }, h("span", { class: "carousel-control-prev-icon", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, "Previous")), h("button", { type: "button", "data-bs-slide": "next", class: "carousel-control-next", "data-bs-target": "#salon-styles-carousel" }, h("span", { class: "carousel-control-next-icon", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, "Next")))))));
11995
- }
11996
- static get style() { return indexCss$2; }
11997
- };
11998
-
11999
- const indexCss$1 = ".view--salon-stylists{overflow:hidden;margin-left:-12px;margin-top:-12px}.view--salon-stylists .salon-stylist{float:left;padding-left:12px;padding-top:12px;width:50%}.view--salon-stylists .salon-stylist--avatar{height:180px}@media (min-width: 576px){.view--salon-stylists .salon-stylist{width:33.33%;max-width:240px}}@media (min-width: 768px){.view--salon-stylists{margin-left:-24px;margin-top:-24px}.view--salon-stylists .salon-stylist{padding-left:24px;padding-top:24px;width:264px;max-width:none}.view--salon-stylists .salon-stylist--avatar{height:240px}}";
12000
-
12001
- let SalonStylists$1 = class extends HTMLElement {
12002
- constructor() {
12003
- super();
12004
- this.__registerHost();
12005
- }
12006
- componentWillLoad() {
12007
- this.fetchData();
11854
+ catch (e) {
11855
+ this.totalStylists = 0;
11856
+ this.salonStylists = [];
11857
+ this.canLoadMore = false;
11858
+ }
11859
+ this.isLoading = false;
12008
11860
  }
12009
- async fetchData() {
11861
+ async onLoadMore() {
11862
+ this.isLoadingMore = true;
12010
11863
  try {
12011
- this.salonStylists = await HttpService$1().fetchSalonStylists(this.salonId);
11864
+ const { data } = await HttpService$1().fetchSalonStylists(this.salonId, { page: this.page + 1, limit: pageLimit });
11865
+ this.salonStylists = this.salonStylists.concat(data || []);
11866
+ this.canLoadMore = data.length === pageLimit;
11867
+ this.page += 1;
12012
11868
  }
12013
11869
  catch (e) { }
11870
+ this.isLoadingMore = false;
12014
11871
  }
12015
11872
  render() {
12016
- return (h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
12017
- border: `1px solid ${Colors.Gray05}`,
12018
- borderRadius: '8px',
11873
+ if (this.isLoading) {
11874
+ return (h("div", null, h("div", { class: "view--salon-stylists" }, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((fakeId, index) => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
11875
+ background: 'none',
11876
+ border: 'none',
11877
+ overflow: 'hidden',
11878
+ } }, h("div", { class: "salon-stylist--avatar", style: {
11879
+ backgroundColor: Colors.Gray01,
11880
+ backgroundRepeat: 'no-repeat',
11881
+ backgroundPosition: 'center top',
11882
+ backgroundSize: 'cover',
11883
+ border: `1px solid ${Colors.Gray01}`,
11884
+ borderRadius: '8px',
11885
+ position: 'relative',
11886
+ display: 'flex',
11887
+ width: '100%',
11888
+ alignItems: 'center',
11889
+ justifyContent: 'center',
11890
+ } }), h("div", { class: "card-body" }, h("div", { key: `stylist--${fakeId}--${index}`, style: {
11891
+ backgroundColor: Colors.Gray01,
11892
+ height: '16px',
11893
+ width: '120px',
11894
+ margin: 'auto',
11895
+ } })))))))));
11896
+ }
11897
+ return (h("div", null, h("div", { class: "view--salon-stylists" }, (this.salonStylists || []).map(stylist => (h("div", { class: "salon-stylist" }, h("div", { class: "card", style: {
11898
+ background: 'none',
11899
+ border: 'none',
12019
11900
  overflow: 'hidden',
12020
11901
  } }, h("div", { class: "salon-stylist--avatar", style: {
12021
11902
  backgroundImage: `url("${stylist.avatar}")`,
12022
- backgroundColor: Colors.Gray06,
11903
+ backgroundColor: Colors.Gray01,
12023
11904
  backgroundRepeat: 'no-repeat',
12024
11905
  backgroundPosition: 'center top',
12025
11906
  backgroundSize: 'cover',
11907
+ border: `1px solid ${Colors.Gray01}`,
11908
+ borderRadius: '8px',
12026
11909
  position: 'relative',
12027
11910
  display: 'flex',
12028
11911
  width: '100%',
@@ -12033,10 +11916,321 @@ let SalonStylists$1 = class extends HTMLElement {
12033
11916
  fontWeight: 'bold',
12034
11917
  textTransform: 'uppercase',
12035
11918
  } }, (stylist.firstName || '').charAt(0), " ", (stylist.lastName || '').charAt(0)))), h("div", { class: "card-body" }, h("div", { style: {
12036
- fontSize: '16px',
12037
- fontWeight: 'bold',
11919
+ fontSize: '18px',
11920
+ fontWeight: '600',
12038
11921
  textAlign: 'center',
12039
- } }, stylist.name), h("div", { style: { marginTop: '4px' } }, h("salon-ranking", { ranking: stylist.rating })))))))));
11922
+ } }, stylist.fullName))))))), this.canLoadMore && (h("div", { class: "view-footer", style: {
11923
+ textAlign: 'center',
11924
+ paddingTop: '32px',
11925
+ paddingBottom: '16px',
11926
+ } }, h("button", { type: "button", class: "btn btn-lg", disabled: this.isLoadingMore, style: {
11927
+ background: Colors.White,
11928
+ border: `1px solid ${Colors.Gray02}`,
11929
+ borderRadius: '4px',
11930
+ paddingLeft: '24px',
11931
+ paddingRight: '24px',
11932
+ }, onClick: () => this.onLoadMore() }, "Load more")))));
11933
+ }
11934
+ static get style() { return indexCss$2; }
11935
+ };
11936
+
11937
+ var relativeTime = createCommonjsModule(function (module, exports) {
11938
+ !function(r,e){module.exports=e();}(commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
11939
+ });
11940
+
11941
+ const indexCss$1 = ".salon-modal.salon-modal--lookbook-detail .salon-modal--close{display:none !important}.salon-modal.salon-modal--lookbook-detail .salon-modal--content{background-color:#fff;position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:1000;overflow-y:auto}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:240px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnails{text-align:center}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{display:inline-block;margin-top:12px;margin-right:12px;height:40px;width:60px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--button{border:none;position:absolute;top:50%;z-index:20;height:40px;width:40px;-moz-border-radius:50px;-webkit-border-radius:50px;border-radius:50px;-moz-transform:translate(0, -50%);-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--prev{left:24px}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--next{right:24px}@media (min-width: 768px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:360px !important}}@media (min-width: 992px){.salon-modal.salon-modal--lookbook-detail .style-detail--slides--image{height:480px !important}.salon-modal.salon-modal--lookbook-detail .style-detail--slides--thumbnail{height:56px;width:72px}}";
11942
+
11943
+ dayjs_min.extend(relativeTime);
11944
+ let StyleDetail$1 = class extends HTMLElement {
11945
+ constructor() {
11946
+ super();
11947
+ this.__registerHost();
11948
+ this.isModalOpen = true;
11949
+ this.currentMediaIdx = 0;
11950
+ this.albumMedias = [];
11951
+ this.similarStyles = [];
11952
+ this.totalComments = 0;
11953
+ this.lookbookComments = [];
11954
+ }
11955
+ componentWillLoad() {
11956
+ this.injectSDK();
11957
+ if (!!this.salonLookbook) {
11958
+ this.lookbookInfo = JSON.parse(this.salonLookbook);
11959
+ this.fetchData();
11960
+ }
11961
+ }
11962
+ componentDidRender() {
11963
+ this.setupGridLayout();
11964
+ }
11965
+ injectSDK() {
11966
+ return new Promise((resolve) => {
11967
+ const script = document.createElement('script');
11968
+ script.type = 'text/javascript';
11969
+ script.src = 'https://cdn.jsdelivr.net/npm/macy@2';
11970
+ document.body.appendChild(script);
11971
+ return resolve(true);
11972
+ });
11973
+ }
11974
+ setupGridLayout() {
11975
+ if (!this.isLayoutSetup && this.similarStyles.length > 0 && document.querySelector('#similar-styles--grid')) {
11976
+ const script = document.createElement('script');
11977
+ script.type = 'text/javascript';
11978
+ script.innerHTML = `
11979
+ var masonry = new Macy({
11980
+ container: '#similar-styles--grid',
11981
+ useContainerForBreakpoints: true,
11982
+ margin: 16,
11983
+ columns: 2,
11984
+ });
11985
+ `;
11986
+ document.body.appendChild(script);
11987
+ this.isLayoutSetup = true;
11988
+ }
11989
+ }
11990
+ fetchData() {
11991
+ try {
11992
+ const promises = [
11993
+ HttpService$1().fetchStyleDetail(this.lookbookInfo.id).then(response => {
11994
+ const { styleInfo, similarStyles } = response;
11995
+ this.similarStyles = similarStyles;
11996
+ if (styleInfo) {
11997
+ this.lookbookInfo = styleInfo;
11998
+ this.albumMedias = styleInfo.albumMedias || [];
11999
+ this.currentMedia = (styleInfo.albumMedias || [])[0];
12000
+ }
12001
+ }),
12002
+ HttpService$1().fetchStyleComments(this.lookbookInfo.id).then(response => {
12003
+ this.totalComments = response.total;
12004
+ this.lookbookComments = response.data;
12005
+ }),
12006
+ ];
12007
+ return Promise.all(promises);
12008
+ }
12009
+ catch (e) { }
12010
+ }
12011
+ closeModal() {
12012
+ this.isModalOpen = false;
12013
+ const el = document.querySelector('style-detail');
12014
+ el.remove();
12015
+ }
12016
+ onClickLookbook(style) {
12017
+ const elLookbookModal = document.createElement('div');
12018
+ elLookbookModal.innerHTML = `
12019
+ <style-detail
12020
+ salon-id=${this.salonId}
12021
+ salon-lookbook='${JSON.stringify(style)}'
12022
+ ></style-detail>
12023
+ `;
12024
+ document.body.appendChild(elLookbookModal);
12025
+ }
12026
+ onClickPrev() {
12027
+ if (this.currentMediaIdx === 0) {
12028
+ this.currentMediaIdx = this.albumMedias.length - 1;
12029
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
12030
+ }
12031
+ else {
12032
+ this.currentMediaIdx = this.currentMediaIdx - 1;
12033
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
12034
+ }
12035
+ }
12036
+ onClickNext() {
12037
+ if (this.currentMediaIdx === this.albumMedias.length - 1) {
12038
+ this.currentMediaIdx = 0;
12039
+ this.currentMedia = this.albumMedias[0];
12040
+ }
12041
+ else {
12042
+ this.currentMediaIdx = this.currentMediaIdx + 1;
12043
+ this.currentMedia = this.albumMedias[this.currentMediaIdx];
12044
+ }
12045
+ }
12046
+ render() {
12047
+ const { createdDate, totalView, totalLike, totalBooking, album, salon, stylist, } = this.lookbookInfo;
12048
+ if (this.isModalOpen) {
12049
+ const { caption, description, mediaUrl } = this.currentMedia || {};
12050
+ const isVideo = isVideoMedia((this.currentMedia || {}));
12051
+ return (h("div", { class: "salon-modal salon-modal--lookbook-detail" }, h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("div", { class: "style-detail" }, h("div", { class: "style-detail--header" }, h("div", { style: {
12052
+ position: 'relative',
12053
+ overflow: 'hidden',
12054
+ } }, h("div", { style: Object.assign({ backgroundColor: Colors.Gray01, backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: '0 0', filter: 'blur(30px)', position: 'absolute', inset: '0', zIndex: '1' }, this.currentMedia && !isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {}) }), h("div", { style: {
12055
+ zIndex: '2',
12056
+ position: 'relative',
12057
+ width: '100%',
12058
+ backgroundColor: 'rgba(0, 0, 0, 0.25)',
12059
+ padding: '12px 16px',
12060
+ overflow: 'hidden',
12061
+ } }, h("span", { style: {
12062
+ color: Colors.White,
12063
+ border: 'none',
12064
+ display: 'flex',
12065
+ alignItems: 'center',
12066
+ justifyContent: 'center',
12067
+ height: '32px',
12068
+ } }, h("span", null, this.currentMediaIdx + 1, " / ", this.albumMedias.length)), h("div", { style: {
12069
+ display: 'flex',
12070
+ alignItems: 'center',
12071
+ position: 'absolute',
12072
+ right: '16px',
12073
+ top: '50%',
12074
+ transform: 'translate(0, -50%)',
12075
+ } }, h("button", { type: "text", class: "btn btn-light", style: {
12076
+ backgroundColor: Colors.White,
12077
+ borderColor: Colors.White,
12078
+ border: 'none',
12079
+ borderRadius: '50px',
12080
+ display: 'flex',
12081
+ alignItems: 'center',
12082
+ justifyContent: 'center',
12083
+ height: '32px',
12084
+ width: '32px',
12085
+ marginLeft: '12px',
12086
+ }, onClick: () => this.closeModal() }, h("i", { class: "ri-close-fill", style: { fontSize: '16px', lineHeight: '1' } })))), h("div", { style: { position: 'relative', zIndex: "3" } }, h("div", { class: "style-detail--slides", style: {
12087
+ marginTop: '16px',
12088
+ marginBottom: '12px',
12089
+ } }, h("div", { class: "style-detail--slides--image", style: {
12090
+ width: '100%',
12091
+ position: 'relative',
12092
+ height: '360px',
12093
+ } }, isVideo && (h("video", { muted: true, controls: true, width: "100%", height: "100%" }, h("source", { src: mediaUrl, type: "video/mp4" }))), !isVideo && (h("div", { style: {
12094
+ position: 'absolute',
12095
+ inset: '0',
12096
+ zIndex: '2',
12097
+ display: 'flex',
12098
+ alignItems: 'center',
12099
+ justifyContent: 'center',
12100
+ } }, h("img", { src: mediaUrl, alt: caption, style: {
12101
+ objectFit: 'contain',
12102
+ maxHeight: '100%',
12103
+ maxWidth: '100%',
12104
+ } })))), h("div", { class: "style-detail--slides--thumbnails", style: {
12105
+ width: '100%',
12106
+ position: 'relative',
12107
+ } }, this.albumMedias.map((media, idx) => {
12108
+ const isStyleVideo = isVideoMedia(media);
12109
+ return (h("div", { class: "style-detail--slides--thumbnail", style: Object.assign(Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '4px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, this.currentMediaIdx !== idx ? { opacity: '0.75' } : {}), !isStyleVideo ? {
12110
+ backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
12111
+ backgroundRepeat: 'no-repeat',
12112
+ backgroundPosition: 'center center',
12113
+ backgroundSize: 'cover',
12114
+ } : {}), onClick: () => {
12115
+ this.currentMedia = media;
12116
+ this.currentMediaIdx = idx;
12117
+ } }, isStyleVideo && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: media.imageThumb }, h("source", { src: media.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
12118
+ fontSize: '48px',
12119
+ color: Colors.TextColor,
12120
+ position: 'absolute',
12121
+ left: '50%',
12122
+ top: '50%',
12123
+ transform: 'translate(-50%, -50%)',
12124
+ } })))));
12125
+ }))), this.albumMedias.length > 1 && (h("div", null, h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--prev", onClick: () => this.onClickPrev() }, h("i", { class: "ri-arrow-left-line", style: { color: Colors.TextColor, fontSize: '18px' } })), h("button", { type: "button btn-light", class: "style-detail--slides--button style-detail--slides--next", onClick: () => this.onClickNext() }, h("i", { class: "ri-arrow-right-line", style: { color: Colors.TextColor, fontSize: '18px' } }))))))), h("div", { class: "style-detail--content" }, h("div", { class: "container" }, h("div", { style: {
12126
+ paddingBottom: '24px',
12127
+ paddingTop: '24px',
12128
+ } }, h("div", { class: "row" }, h("div", { class: this.similarStyles.length > 0 ? 'col-md-8' : 'col-md-12', style: { marginBottom: '24px' } }, h("div", { class: "row" }, salon && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, h("div", { style: {
12129
+ backgroundColor: Colors.Red01,
12130
+ borderRadius: '4px',
12131
+ padding: '8px',
12132
+ display: 'flex',
12133
+ alignItems: 'center',
12134
+ justifyContent: 'space-between',
12135
+ } }, h("div", { style: { paddingLeft: '8px' } }, h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "At salon"), h("div", { style: {
12136
+ color: Colors.Secondary,
12137
+ fontSize: '20px',
12138
+ lineHeight: '24px',
12139
+ } }, salon.businessName)), h("div", { style: {
12140
+ backgroundImage: `url("${getSalonImage(salon)}")`,
12141
+ backgroundColor: Colors.Red02,
12142
+ backgroundSize: 'cover',
12143
+ backgroundRepeat: 'no-repeat',
12144
+ backgroundPosition: '0 0',
12145
+ borderRadius: '4px',
12146
+ height: '48px',
12147
+ width: '48px',
12148
+ } })))), stylist && stylist.id && (h("div", { class: "col-sm-6 col-md-5", style: { marginBottom: '24px' } }, h("div", { style: {
12149
+ backgroundColor: Colors.Yellow01,
12150
+ borderRadius: '4px',
12151
+ padding: '8px',
12152
+ display: 'flex',
12153
+ alignItems: 'center',
12154
+ justifyContent: 'space-between',
12155
+ } }, h("div", { style: { paddingLeft: '8px' } }, h("div", { style: { color: Colors.Gray05, fontSize: '12px' } }, "By stylist"), h("div", { style: {
12156
+ color: Colors.Secondary,
12157
+ fontSize: '20px',
12158
+ lineHeight: '24px',
12159
+ } }, stylist.fullName)), h("div", { style: {
12160
+ backgroundImage: `url("${stylist.avatar}")`,
12161
+ backgroundColor: Colors.Yellow02,
12162
+ backgroundSize: 'cover',
12163
+ backgroundRepeat: 'no-repeat',
12164
+ backgroundPosition: '0 0',
12165
+ borderRadius: '4px',
12166
+ height: '48px',
12167
+ width: '48px',
12168
+ } }))))), h("div", { style: {
12169
+ borderBottom: `1px solid ${Colors.Gray02}`,
12170
+ borderTop: `1px solid ${Colors.Gray02}`,
12171
+ display: 'flex',
12172
+ alignItems: 'center',
12173
+ justifyContent: 'space-between',
12174
+ paddingBottom: '16px',
12175
+ paddingTop: '16px',
12176
+ } }, h("div", { style: {
12177
+ display: 'flex',
12178
+ alignItems: 'center',
12179
+ justifyContent: 'space-around',
12180
+ flexShrink: '1',
12181
+ flexGrow: '1',
12182
+ } }, h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalLike), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "faves")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalBooking), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "booked")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, totalView), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "views")), h("div", { style: { width: '25%', textAlign: 'center', maxWidth: '120px' } }, h("div", { style: { fontSize: '24px', fontWeight: '600', lineHeight: '1' } }, this.totalComments), h("div", { style: { fontSize: '14px', marginTop: '4px' } }, "comments")))), (caption || description) && (h("div", { style: { paddingTop: '24px' } }, h("div", { style: { color: Colors.Gray04, fontSize: '14px' } }, createdDate && dayjs_min(createdDate).format(shortDateYearFormat)), h("div", { style: { fontSize: '24px' } }, caption), h("div", { style: {
12183
+ fontSize: '16px',
12184
+ paddingTop: caption ? '16px' : '0',
12185
+ } }, description))), album && album.tags.length > 0 && (h("div", { style: {
12186
+ paddingTop: '24px',
12187
+ marginBottom: '-12px',
12188
+ } }, album.tags.map((tag, idx) => (h("button", { class: "btn btn-light", key: `album--tag-${idx}`, style: {
12189
+ backgroundColor: Colors.Gray01,
12190
+ borderColor: Colors.Gray01,
12191
+ borderRadius: '4px',
12192
+ marginRight: '12px',
12193
+ marginBottom: '12px',
12194
+ } }, tag))))), h("div", { style: { marginTop: '32px' } }, this.lookbookComments && this.lookbookComments.length > 0 && (h("div", null, h("div", { style: { fontWeight: '600', marginBottom: '8px' } }, this.totalComments, " ", this.totalComments === 1 ? 'comment' : 'comments'), h("div", { class: "view view--style-comments", style: {
12195
+ borderTop: `1px solid ${Colors.Gray02}`,
12196
+ paddingTop: '24px',
12197
+ paddingBottom: '24px',
12198
+ } }, this.lookbookComments.map((comment, idx) => {
12199
+ const { user, title, description, createdDate } = comment;
12200
+ return (h("div", { key: `style-info--comment-${idx}`, style: idx > 0 ? {
12201
+ borderTop: `1px solid ${Colors.Gray02}`,
12202
+ marginTop: '24px',
12203
+ paddingTop: '24px',
12204
+ } : {} }, h("div", { style: { overflow: 'hidden' } }, h("user-avatar", { size: 48, avatar: user.avatar, name: h("div", null, h("div", { style: { color: Colors.Gray04, lineHeight: '1', fontSize: '12px', fontWeight: '400' } }, dayjs_min(createdDate).fromNow()), h("div", { style: { fontSize: '18px', fontWeight: '600' } }, user.fullName)), shortName: `${(user.firstName || '').charAt(0)}${(user.lastName || '').charAt(0)}`, nameStyle: { fontWeight: 'bold' } })), h("div", { style: {
12205
+ color: Colors.Black,
12206
+ fontSize: '16px',
12207
+ paddingTop: '16px',
12208
+ } }, title), description && (h("div", { style: {
12209
+ color: Colors.Gray05,
12210
+ paddingTop: '8px',
12211
+ } }, description))));
12212
+ })))))), h("div", { class: "col-md-4", style: { marginBottom: '24px' } }, h("div", { class: "block block--similar-styles" }, this.similarStyles.length > 0 && (h("div", { class: "block--content" }, h("h3", { style: {
12213
+ lineHeight: '1.2',
12214
+ fontSize: '24px',
12215
+ color: Colors.Secondary,
12216
+ } }, "More like this"), h("div", { style: { marginTop: '16px' } }, h("div", { class: "similar-styles--grid", id: "similar-styles--grid" }, this.similarStyles.slice(0, 6).map(style => {
12217
+ const { caption, imageThumbMedium, owner } = style;
12218
+ return (h("div", { class: "similar-styles--grid-item", onClick: () => {
12219
+ this.closeModal();
12220
+ this.onClickLookbook(style);
12221
+ } }, h("div", { class: "card", style: {
12222
+ background: 'none',
12223
+ border: 'none',
12224
+ cursor: 'pointer',
12225
+ } }, h("div", { class: "similar-styles--grid-item--image", style: {
12226
+ borderRadius: '8px',
12227
+ overflow: 'hidden',
12228
+ minHeight: '80px',
12229
+ background: Colors.Gray01,
12230
+ } }, h("img", { src: imageThumbMedium, alt: caption, style: { maxWidth: '100%' } })), owner && (h("div", { class: "card-body", style: { paddingLeft: '0' } }, h("user-avatar", { name: owner.fullName, shortName: `${(owner.firstName || '').charAt(0)}${(owner.lastName || '').charAt(0)}`, avatar: owner.avatar }))))));
12231
+ }))))))))))))))));
12232
+ }
12233
+ return null;
12040
12234
  }
12041
12235
  static get style() { return indexCss$1; }
12042
12236
  };
@@ -12052,7 +12246,7 @@ let UserAvatar$1 = class extends HTMLElement {
12052
12246
  render() {
12053
12247
  return (h("div", { style: { display: "flex", alignItems: "center" } }, this.avatar && (h("div", { style: {
12054
12248
  backgroundImage: `url("${this.avatar}")`,
12055
- backgroundColor: Colors.Gray06,
12249
+ backgroundColor: Colors.Gray01,
12056
12250
  backgroundPosition: 'center center',
12057
12251
  backgroundSize: 'cover',
12058
12252
  borderRadius: '50%',
@@ -12060,7 +12254,7 @@ let UserAvatar$1 = class extends HTMLElement {
12060
12254
  width: `${this.size}px`,
12061
12255
  minWidth: `${this.size}px`,
12062
12256
  } })), !this.avatar && (h("div", { style: {
12063
- backgroundColor: Colors.Gray06,
12257
+ backgroundColor: Colors.Gray01,
12064
12258
  backgroundPosition: 'center center',
12065
12259
  backgroundSize: 'cover',
12066
12260
  borderRadius: '50%',
@@ -12075,23 +12269,22 @@ let UserAvatar$1 = class extends HTMLElement {
12075
12269
  static get style() { return indexCss; }
12076
12270
  };
12077
12271
 
12078
- const GoogleMap = /*@__PURE__*/proxyCustomElement(GoogleMap$1, [0,"google-map",{"apiKey":[1,"api-key"],"lat":[2],"lng":[2]}]);
12272
+ const GoogleMap = /*@__PURE__*/proxyCustomElement(GoogleMap$1, [0,"google-map",{"locationName":[1,"location-name"],"locationAddress":[1,"location-address"]}]);
12079
12273
  const SalonBooking = /*@__PURE__*/proxyCustomElement(SalonBooking$1, [0,"salon-booking",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"buttonText":[1,"button-text"],"primaryColor":[1,"primary-color"]}]);
12080
- const SalonBookingModal = /*@__PURE__*/proxyCustomElement(SalonBookingModal$2, [0,"salon-booking-modal",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"redirectUrl":[1,"redirect-url"],"isModalOpen":[32]}]);
12081
- const SalonContact = /*@__PURE__*/proxyCustomElement(SalonContact$1, [0,"salon-contact",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"salonInfoState":[32]}]);
12274
+ const SalonBookingModal = /*@__PURE__*/proxyCustomElement(SalonBookingModal$1, [0,"salon-booking-modal",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"redirectUrl":[1,"redirect-url"],"isModalOpen":[32]}]);
12082
12275
  const SalonGiftCard = /*@__PURE__*/proxyCustomElement(SalonGiftCard$1, [0,"salon-gift-card",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"buttonText":[1,"button-text"],"primaryColor":[1,"primary-color"]}]);
12083
- const SalonGiftCardModal = /*@__PURE__*/proxyCustomElement(SalonGiftCardModal$1, [0,"salon-gift-card-modal",{"salonId":[2,"salon-id"],"isModalOpen":[32]}]);
12084
- const SalonInfo = /*@__PURE__*/proxyCustomElement(SalonInfo$1, [0,"salon-info",{"salonId":[2,"salon-id"],"backgroundColor":[1,"background-color"],"salonInfo":[32]}]);
12085
- const SalonLatestReviews = /*@__PURE__*/proxyCustomElement(SalonLatestReviews$1, [0,"salon-latest-reviews",{"salonId":[2,"salon-id"],"salonReviews":[32]}]);
12086
- const SalonLocations = /*@__PURE__*/proxyCustomElement(SalonLocations$1, [0,"salon-locations",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"salonInfoState":[32]}]);
12276
+ const SalonGiftCardModal = /*@__PURE__*/proxyCustomElement(SalonGiftCardModal$1, [0,"salon-gift-card-modal",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"isModalOpen":[32]}]);
12277
+ const SalonInfo = /*@__PURE__*/proxyCustomElement(SalonInfo$1, [0,"salon-info",{"salonId":[2,"salon-id"],"salonInfo":[32]}]);
12278
+ const SalonLatestReviews = /*@__PURE__*/proxyCustomElement(SalonLatestReviews$1, [0,"salon-latest-reviews",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"salonReviews":[32],"isLoading":[32]}]);
12279
+ const SalonLatestStyles = /*@__PURE__*/proxyCustomElement(SalonLatestStyles$1, [0,"salon-latest-styles",{"salonId":[2,"salon-id"],"isLoading":[4,"is-loading"],"withBorder":[4,"with-border"],"isLoadingState":[32],"latestStyles":[32]}]);
12280
+ const SalonLocations = /*@__PURE__*/proxyCustomElement(SalonLocations$1, [0,"salon-locations",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"isLoading":[4,"is-loading"],"withBorder":[4,"with-border"],"salonInfoState":[32]}]);
12087
12281
  const SalonLookbook = /*@__PURE__*/proxyCustomElement(SalonLookbook$1, [0,"salon-lookbook",{"salonId":[2,"salon-id"],"isLoading":[32],"isLoadingMore":[32],"hideLoadMore":[32],"currentPage":[32],"totalLookbooks":[32],"salonCategories":[32],"salonLookbooks":[32],"sortBy":[32],"filterBy":[32],"isLayoutSetup":[32]}]);
12088
- const SalonLookbookModal = /*@__PURE__*/proxyCustomElement(SalonBookingModal$1, [0,"salon-lookbook-modal",{"salonId":[2,"salon-id"],"salonLookbook":[1,"salon-lookbook"],"lookbookInfo":[32],"lookbookComments":[32],"isModalOpen":[32]}]);
12089
12282
  const SalonRanking = /*@__PURE__*/proxyCustomElement(SalonRanking$1, [0,"salon-ranking",{"ranking":[2],"height":[2],"width":[2]}]);
12090
- const SalonReviews = /*@__PURE__*/proxyCustomElement(SalonReviews$1, [0,"salon-reviews",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"salonInfo":[32],"totalReviews":[32],"salonReviews":[32],"canLoadMore":[32],"isLoadingMore":[32],"pageOffset":[32],"ratings":[32],"sorting":[32]}]);
12091
- const SalonSchedules = /*@__PURE__*/proxyCustomElement(SalonSchedules$1, [0,"salon-schedules",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"salonInfoState":[32]}]);
12092
- const SalonServices = /*@__PURE__*/proxyCustomElement(SalonServices$1, [0,"salon-services",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"salonServices":[32]}]);
12093
- const SalonStyles = /*@__PURE__*/proxyCustomElement(SalonStyles$1, [0,"salon-styles",{"salonId":[2,"salon-id"],"firstPageStyles":[32],"nestPageStyles":[32]}]);
12094
- const SalonStylists = /*@__PURE__*/proxyCustomElement(SalonStylists$1, [0,"salon-stylists",{"salonId":[2,"salon-id"],"salonStylists":[32]}]);
12283
+ const SalonReviews = /*@__PURE__*/proxyCustomElement(SalonReviews$1, [0,"salon-reviews",{"salonId":[2,"salon-id"],"primaryColor":[1,"primary-color"],"salonInfo":[32],"stats":[32],"totalReviews":[32],"allReviews":[32],"isLoading":[32],"isSorting":[32],"isFiltering":[32],"isLoadingMore":[32],"canLoadMore":[32],"page":[32],"filterBy":[32],"sortBy":[32]}]);
12284
+ const SalonSchedules = /*@__PURE__*/proxyCustomElement(SalonSchedules$1, [0,"salon-schedules",{"salonId":[2,"salon-id"],"salonInfo":[1,"salon-info"],"isLoading":[4,"is-loading"],"withBorder":[4,"with-border"],"salonInfoState":[32]}]);
12285
+ const SalonServices = /*@__PURE__*/proxyCustomElement(SalonServices$1, [0,"salon-services",{"salonId":[2,"salon-id"],"buttonClass":[1,"button-class"],"salonServices":[32],"isLoading":[32]}]);
12286
+ const SalonStylists = /*@__PURE__*/proxyCustomElement(SalonStylists$1, [0,"salon-stylists",{"salonId":[2,"salon-id"],"salonStylists":[32],"totalStylists":[32],"page":[32],"isLoading":[32],"isLoadingMore":[32],"canLoadMore":[32]}]);
12287
+ const StyleDetail = /*@__PURE__*/proxyCustomElement(StyleDetail$1, [0,"style-detail",{"salonId":[2,"salon-id"],"salonLookbook":[1,"salon-lookbook"],"lookbookInfo":[32],"isModalOpen":[32],"currentMediaIdx":[32],"currentMedia":[32],"albumMedias":[32],"similarStyles":[32],"totalComments":[32],"lookbookComments":[32],"isLayoutSetup":[32]}]);
12095
12288
  const UserAvatar = /*@__PURE__*/proxyCustomElement(UserAvatar$1, [0,"user-avatar",{"size":[2],"name":[1],"nameStyle":[16],"shortName":[1,"short-name"],"avatar":[1]}]);
12096
12289
  const defineCustomElements = (opts) => {
12097
12290
  if (typeof customElements !== 'undefined') {
@@ -12099,20 +12292,19 @@ const defineCustomElements = (opts) => {
12099
12292
  GoogleMap,
12100
12293
  SalonBooking,
12101
12294
  SalonBookingModal,
12102
- SalonContact,
12103
12295
  SalonGiftCard,
12104
12296
  SalonGiftCardModal,
12105
12297
  SalonInfo,
12106
12298
  SalonLatestReviews,
12299
+ SalonLatestStyles,
12107
12300
  SalonLocations,
12108
12301
  SalonLookbook,
12109
- SalonLookbookModal,
12110
12302
  SalonRanking,
12111
12303
  SalonReviews,
12112
12304
  SalonSchedules,
12113
12305
  SalonServices,
12114
- SalonStyles,
12115
12306
  SalonStylists,
12307
+ StyleDetail,
12116
12308
  UserAvatar
12117
12309
  ].forEach(cmp => {
12118
12310
  if (!customElements.get(cmp.is)) {
@@ -12122,4 +12314,4 @@ const defineCustomElements = (opts) => {
12122
12314
  }
12123
12315
  };
12124
12316
 
12125
- export { GoogleMap, SalonBooking, SalonBookingModal, SalonContact, SalonGiftCard, SalonGiftCardModal, SalonInfo, SalonLatestReviews, SalonLocations, SalonLookbook, SalonLookbookModal, SalonRanking, SalonReviews, SalonSchedules, SalonServices, SalonStyles, SalonStylists, UserAvatar, defineCustomElements };
12317
+ export { GoogleMap, SalonBooking, SalonBookingModal, SalonGiftCard, SalonGiftCardModal, SalonInfo, SalonLatestReviews, SalonLatestStyles, SalonLocations, SalonLookbook, SalonRanking, SalonReviews, SalonSchedules, SalonServices, SalonStylists, StyleDetail, UserAvatar, defineCustomElements };