@hhgtech/hhg-components 1.28.67 → 1.28.69

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 (521) hide show
  1. package/build/BMI_BOYS.percentile.monthly-48c9471d.js +688 -0
  2. package/build/BMI_BOYS.percentile.weekly-4965852e.js +182 -0
  3. package/build/BMI_BOYS.percentile.yearly-0f7cc8f4.js +83 -0
  4. package/build/BMI_BOYS.zscore.monthly-5bb8a433.js +440 -0
  5. package/build/BMI_BOYS.zscore.weekly-3d56f80f.js +118 -0
  6. package/build/BMI_BOYS.zscore.yearly-57081f24.js +55 -0
  7. package/build/BMI_GIRLS.percentile.monthly-95859cd9.js +688 -0
  8. package/build/BMI_GIRLS.percentile.weekly-009cf4df.js +182 -0
  9. package/build/BMI_GIRLS.percentile.yearly-4436947b.js +83 -0
  10. package/build/BMI_GIRLS.zscore.monthly-689b4eee.js +440 -0
  11. package/build/BMI_GIRLS.zscore.weekly-dff693df.js +118 -0
  12. package/build/BMI_GIRLS.zscore.yearly-05ef5f4f.js +55 -0
  13. package/build/ChevronDown-275f1ab5.js +29 -0
  14. package/build/HEAD CIRCUM_BOYS.percentile.monthly-55c580a7.js +688 -0
  15. package/build/HEAD CIRCUM_BOYS.percentile.weekly-e30f4a42.js +182 -0
  16. package/build/HEAD CIRCUM_BOYS.percentile.yearly-2378a5f0.js +83 -0
  17. package/build/HEAD CIRCUM_BOYS.zscore.monthly-102d5559.js +440 -0
  18. package/build/HEAD CIRCUM_BOYS.zscore.weekly-7b0f1ba8.js +118 -0
  19. package/build/HEAD CIRCUM_BOYS.zscore.yearly-e9237d31.js +55 -0
  20. package/build/HEAD CIRCUM_GIRLS.percentile.monthly-1ddda8b3.js +688 -0
  21. package/build/HEAD CIRCUM_GIRLS.percentile.weekly-843147ea.js +182 -0
  22. package/build/HEAD CIRCUM_GIRLS.percentile.yearly-9b51c237.js +83 -0
  23. package/build/HEAD CIRCUM_GIRLS.zscore.monthly-3f1b233c.js +440 -0
  24. package/build/HEAD CIRCUM_GIRLS.zscore.weekly-9e14d3fe.js +118 -0
  25. package/build/HEAD CIRCUM_GIRLS.zscore.yearly-d924f5ae.js +55 -0
  26. package/build/HEIGHT_BOYS.percentile.monthly-15538920.js +688 -0
  27. package/build/HEIGHT_BOYS.percentile.weekly-10bd0277.js +182 -0
  28. package/build/HEIGHT_BOYS.percentile.yearly-8e678d38.js +237 -0
  29. package/build/HEIGHT_BOYS.zscore.monthly-2c110da9.js +440 -0
  30. package/build/HEIGHT_BOYS.zscore.weekly-288b7733.js +118 -0
  31. package/build/HEIGHT_BOYS.zscore.yearly-42f6f9f7.js +153 -0
  32. package/build/HEIGHT_GIRLS.percentile.monthly-04abe7d2.js +688 -0
  33. package/build/HEIGHT_GIRLS.percentile.weekly-9653b16c.js +182 -0
  34. package/build/HEIGHT_GIRLS.percentile.yearly-9efacd67.js +237 -0
  35. package/build/HEIGHT_GIRLS.zscore.monthly-c64a97b2.js +440 -0
  36. package/build/HEIGHT_GIRLS.zscore.weekly-3302dd83.js +118 -0
  37. package/build/HEIGHT_GIRLS.zscore.yearly-ebe5114f.js +153 -0
  38. package/build/Subot-5fc40fb5.js +217 -0
  39. package/build/Visible-5c5d57cf.js +29 -0
  40. package/build/WEIGHT_BOYS.percentile.monthly-5e11e7a0.js +688 -0
  41. package/build/WEIGHT_BOYS.percentile.weekly-68ae2578.js +182 -0
  42. package/build/WEIGHT_BOYS.percentile.yearly-030c06a4.js +138 -0
  43. package/build/WEIGHT_BOYS.zscore.monthly-d22c7b57.js +440 -0
  44. package/build/WEIGHT_BOYS.zscore.weekly-d8d901e6.js +118 -0
  45. package/build/WEIGHT_BOYS.zscore.yearly-c311a084.js +90 -0
  46. package/build/WEIGHT_GIRLS.percentile.monthly-5c44f8eb.js +688 -0
  47. package/build/WEIGHT_GIRLS.percentile.weekly-faa98671.js +182 -0
  48. package/build/WEIGHT_GIRLS.percentile.yearly-560b862e.js +138 -0
  49. package/build/WEIGHT_GIRLS.zscore.monthly-5365ba1a.js +440 -0
  50. package/build/WEIGHT_GIRLS.zscore.weekly-0d9dc521.js +118 -0
  51. package/build/WEIGHT_GIRLS.zscore.yearly-5a3c4e43.js +90 -0
  52. package/build/adapters.js +36 -1
  53. package/build/{esm/animation-0340efb3.js → animation-eb4e500b.js} +32 -10
  54. package/build/babyGrowth.js +913 -47
  55. package/build/cache.js +13 -1
  56. package/build/care.js +38 -1
  57. package/build/components/navigationV2/hooks/useNavConfig.d.ts +1 -3
  58. package/build/components.js +186 -1
  59. package/build/constants-8b8bc19f.js +255 -0
  60. package/build/constants-ae18ce18.js +935 -0
  61. package/build/constants.js +43 -1
  62. package/build/cookieHelper-5c9f4bb8.js +43 -0
  63. package/build/core-2aa8d86c.js +51 -0
  64. package/build/dataTransform-089f414c.js +66 -0
  65. package/build/ecom.js +745 -1
  66. package/build/esm/BMI_BOYS.percentile.monthly-de5dce68.js +686 -0
  67. package/build/esm/BMI_BOYS.percentile.weekly-9d3990b6.js +180 -0
  68. package/build/esm/BMI_BOYS.percentile.yearly-98b9114a.js +81 -0
  69. package/build/esm/BMI_BOYS.zscore.monthly-394646f0.js +438 -0
  70. package/build/esm/BMI_BOYS.zscore.weekly-c669ea51.js +116 -0
  71. package/build/esm/BMI_BOYS.zscore.yearly-771ef6b6.js +53 -0
  72. package/build/esm/BMI_GIRLS.percentile.monthly-1ff3d499.js +686 -0
  73. package/build/esm/BMI_GIRLS.percentile.weekly-211d2f27.js +180 -0
  74. package/build/esm/BMI_GIRLS.percentile.yearly-206fdcff.js +81 -0
  75. package/build/esm/BMI_GIRLS.zscore.monthly-b1137e36.js +438 -0
  76. package/build/esm/BMI_GIRLS.zscore.weekly-63ed3cd6.js +116 -0
  77. package/build/esm/BMI_GIRLS.zscore.yearly-221d187c.js +53 -0
  78. package/build/esm/ChevronDown-9a8ece61.js +7 -0
  79. package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-4c37847c.js +686 -0
  80. package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-8f6ea38a.js +180 -0
  81. package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-6c12a99a.js +81 -0
  82. package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-c531b497.js +438 -0
  83. package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-6cafba00.js +116 -0
  84. package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-fe8114a0.js +53 -0
  85. package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-25ce0d36.js +686 -0
  86. package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-5d3f2862.js +180 -0
  87. package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-2b709ca5.js +81 -0
  88. package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-e8617bae.js +438 -0
  89. package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-f3252d67.js +116 -0
  90. package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-5b62d41f.js +53 -0
  91. package/build/esm/HEIGHT_BOYS.percentile.monthly-63d2cf96.js +686 -0
  92. package/build/esm/HEIGHT_BOYS.percentile.weekly-8ea5102d.js +180 -0
  93. package/build/esm/HEIGHT_BOYS.percentile.yearly-8107b77b.js +235 -0
  94. package/build/esm/HEIGHT_BOYS.zscore.monthly-641cdfa3.js +438 -0
  95. package/build/esm/HEIGHT_BOYS.zscore.weekly-86da0362.js +116 -0
  96. package/build/esm/HEIGHT_BOYS.zscore.yearly-060f6e79.js +151 -0
  97. package/build/esm/HEIGHT_GIRLS.percentile.monthly-fb987d37.js +686 -0
  98. package/build/esm/HEIGHT_GIRLS.percentile.weekly-82655dc0.js +180 -0
  99. package/build/esm/HEIGHT_GIRLS.percentile.yearly-a63b8456.js +235 -0
  100. package/build/esm/HEIGHT_GIRLS.zscore.monthly-77d676a3.js +438 -0
  101. package/build/esm/HEIGHT_GIRLS.zscore.weekly-c0387a4e.js +116 -0
  102. package/build/esm/HEIGHT_GIRLS.zscore.yearly-41203c20.js +151 -0
  103. package/build/esm/Subot-3289bd8e.js +212 -0
  104. package/build/esm/Visible-a3d436dd.js +7 -0
  105. package/build/esm/WEIGHT_BOYS.percentile.monthly-50802d8b.js +686 -0
  106. package/build/esm/WEIGHT_BOYS.percentile.weekly-4d72ddd6.js +180 -0
  107. package/build/esm/WEIGHT_BOYS.percentile.yearly-20a29844.js +136 -0
  108. package/build/esm/WEIGHT_BOYS.zscore.monthly-729e6614.js +438 -0
  109. package/build/esm/WEIGHT_BOYS.zscore.weekly-90352f48.js +116 -0
  110. package/build/esm/WEIGHT_BOYS.zscore.yearly-fe1871cc.js +88 -0
  111. package/build/esm/WEIGHT_GIRLS.percentile.monthly-e6afb2e0.js +686 -0
  112. package/build/esm/WEIGHT_GIRLS.percentile.weekly-b66d3016.js +180 -0
  113. package/build/esm/WEIGHT_GIRLS.percentile.yearly-a55622c5.js +136 -0
  114. package/build/esm/WEIGHT_GIRLS.zscore.monthly-2cdcbe75.js +438 -0
  115. package/build/esm/WEIGHT_GIRLS.zscore.weekly-d5be31d5.js +116 -0
  116. package/build/esm/WEIGHT_GIRLS.zscore.yearly-99e8d3a7.js +88 -0
  117. package/build/esm/adapters.js +26 -1
  118. package/build/{animation-d5d9ef32.js → esm/animation-3d5edc39.js} +22 -10
  119. package/build/esm/babyGrowth.js +883 -47
  120. package/build/esm/cache.js +3 -1
  121. package/build/esm/care.js +26 -1
  122. package/build/esm/components/navigationV2/hooks/useNavConfig.d.ts +1 -3
  123. package/build/esm/components.js +88 -1
  124. package/build/esm/constants-2a6d2434.js +932 -0
  125. package/build/esm/constants-b77ffe3d.js +238 -0
  126. package/build/esm/constants.js +4 -1
  127. package/build/esm/cookieHelper-d314282c.js +39 -0
  128. package/build/esm/core-8c73d133.js +47 -0
  129. package/build/esm/dataTransform-8ecfc046.js +56 -0
  130. package/build/esm/ecom.js +737 -1
  131. package/build/esm/footer.js +31 -1
  132. package/build/esm/gAssets.js +5 -1
  133. package/build/esm/getDynamicHealthTool-f4497aa5.js +44 -0
  134. package/build/esm/getSocialList-a5b8462e.js +66 -0
  135. package/build/esm/hooks.js +21 -1
  136. package/build/esm/i18n-values/en-PH.js +600 -1
  137. package/build/esm/i18n-values/hi-IN.js +600 -1
  138. package/build/esm/i18n-values/id-ID.js +600 -1
  139. package/build/esm/i18n-values/km-KH.js +600 -1
  140. package/build/esm/i18n-values/ms-MY.js +602 -1
  141. package/build/esm/i18n-values/my-MM.js +600 -1
  142. package/build/esm/i18n-values/th-TH.js +600 -1
  143. package/build/esm/i18n-values/tl-PH.js +600 -1
  144. package/build/esm/i18n-values/vi-VN.js +607 -1
  145. package/build/esm/i18n-values/vi-VN_MB.js +607 -1
  146. package/build/esm/i18n-values/zh-TW.js +600 -1
  147. package/build/esm/i18n.js +55 -1
  148. package/build/esm/i18nV2.js +18 -1
  149. package/build/esm/index-12fa4985.js +8 -0
  150. package/build/esm/index-1e59f99a.js +152 -0
  151. package/build/esm/index-32e53dac.js +1936 -0
  152. package/build/esm/index-3474401a.js +149 -0
  153. package/build/esm/index-34899aa3.js +17 -0
  154. package/build/esm/index-350e8f5b.js +124 -0
  155. package/build/esm/index-41bf860a.js +151 -0
  156. package/build/esm/index-4aa8e518.js +116 -0
  157. package/build/esm/index-4fe2b03f.js +32 -0
  158. package/build/esm/index-6ea6484e.js +29 -0
  159. package/build/esm/index-717401ee.js +184 -0
  160. package/build/esm/index-7af5242a.js +24 -0
  161. package/build/esm/index-7b8c85cd.js +8302 -0
  162. package/build/esm/index-81f295b7.js +23 -0
  163. package/build/esm/index-8858383e.js +52 -0
  164. package/build/esm/index-8f52dcf3.js +33 -0
  165. package/build/esm/index-9ea7e838.js +33 -0
  166. package/build/esm/index-aabac2aa.js +3241 -0
  167. package/build/esm/index-b9b2c417.js +837 -0
  168. package/build/esm/index-c2da5293.js +12 -0
  169. package/build/esm/index-c56d60db.js +370 -0
  170. package/build/esm/index-c5d7f692.js +24 -0
  171. package/build/esm/index-cc93e010.js +53 -0
  172. package/build/esm/index-d7f046db.js +5 -0
  173. package/build/esm/index-d8177667.js +14 -0
  174. package/build/esm/index-da139dda.js +615 -0
  175. package/build/esm/index-e612be9c.js +905 -0
  176. package/build/esm/index-f3d0592b.js +71 -0
  177. package/build/esm/index.js +190 -1
  178. package/build/{index.styled-0a1fb891.js → esm/index.styled-9c9db9cc.js} +17 -5
  179. package/build/esm/index.styles-5add27c5.js +1303 -0
  180. package/build/esm/isProduction-0ea904dd.js +27 -0
  181. package/build/esm/lead.js +2140 -1
  182. package/build/esm/localizeNumberFormat-2ac3773e.js +23 -0
  183. package/build/esm/mantine.js +113 -1
  184. package/build/esm/misc.js +22 -1
  185. package/build/esm/navigation.js +51 -1
  186. package/build/esm/normalizeLink-d1c9617e.js +12 -0
  187. package/build/esm/number-0c126a39.js +38 -0
  188. package/build/esm/onboardingV2.js +860 -34
  189. package/build/esm/paths-a8204db4.js +14 -0
  190. package/build/esm/pwg.js +208 -7
  191. package/build/esm/routing-2474f896.js +40 -0
  192. package/build/esm/subot.js +4553 -134
  193. package/build/esm/theme-e74db08c.js +186 -0
  194. package/build/esm/together.js +52 -1
  195. package/build/esm/translationsContext-ad3e25de.js +5 -0
  196. package/build/esm/tslib.es6-1b1533a9.js +38 -0
  197. package/build/esm/types-06f00b3d.js +8015 -0
  198. package/build/esm/types-15e34418.js +3432 -0
  199. package/build/esm/types-ba190c26.js +21 -0
  200. package/build/esm/types.js +1 -1
  201. package/build/esm/unifyEnv.js +42 -1
  202. package/build/esm/useCategory-2c87152d.js +292 -0
  203. package/build/esm/useHealthToolCache-29d22ddb.js +17 -0
  204. package/build/esm/useIsInit-8a2fc8e5.js +11 -0
  205. package/build/esm/useOutsideClick-c8a7ff20.js +45 -0
  206. package/build/esm/usePlacesAutocomplete-63e04e8e.js +80 -0
  207. package/build/esm/useScrollbarSize-51ce1374.js +57 -0
  208. package/build/esm/useTranslations-4f1db486.js +26 -0
  209. package/build/esm/useUniqueId-3638402f.js +41 -0
  210. package/build/esm/utils-2c484c05.js +132 -0
  211. package/build/esm/utils-3a2a47d9.js +22 -0
  212. package/build/esm/utils-6d7b88da.js +367 -0
  213. package/build/esm/utils-70718e9c.js +1124 -0
  214. package/build/esm/vaccination.js +868 -40
  215. package/build/footer.js +39 -1
  216. package/build/gAssets.js +14 -1
  217. package/build/getDynamicHealthTool-114a1e27.js +48 -0
  218. package/build/getSocialList-4713441d.js +72 -0
  219. package/build/hooks.js +44 -1
  220. package/build/i18n-values/en-PH.js +611 -1
  221. package/build/i18n-values/hi-IN.js +611 -1
  222. package/build/i18n-values/id-ID.js +611 -1
  223. package/build/i18n-values/km-KH.js +611 -1
  224. package/build/i18n-values/ms-MY.js +613 -1
  225. package/build/i18n-values/my-MM.js +611 -1
  226. package/build/i18n-values/th-TH.js +611 -1
  227. package/build/i18n-values/tl-PH.js +611 -1
  228. package/build/i18n-values/vi-VN.js +618 -1
  229. package/build/i18n-values/vi-VN_MB.js +618 -1
  230. package/build/i18n-values/zh-TW.js +611 -1
  231. package/build/i18n.js +64 -1
  232. package/build/i18nV2.js +26 -1
  233. package/build/index-020e6908.js +39 -0
  234. package/build/index-0da9b2e8.js +59 -0
  235. package/build/index-11468c00.js +157 -0
  236. package/build/index-117448a5.js +133 -0
  237. package/build/index-12c07f71.js +18 -0
  238. package/build/index-1a105e87.js +123 -0
  239. package/build/index-1baaedb0.js +55 -0
  240. package/build/index-32d38318.js +7 -0
  241. package/build/index-38582ee0.js +8373 -0
  242. package/build/index-3e5fc2d6.js +1994 -0
  243. package/build/index-3eef6bed.js +853 -0
  244. package/build/index-4035e658.js +159 -0
  245. package/build/index-488d71ae.js +30 -0
  246. package/build/index-5553f9e1.js +930 -0
  247. package/build/index-5fa68e45.js +380 -0
  248. package/build/index-7b467209.js +39 -0
  249. package/build/index-81cb1142.js +77 -0
  250. package/build/index-84ab5b89.js +38 -0
  251. package/build/index-8a95d709.js +30 -0
  252. package/build/index-9da9f0c3.js +35 -0
  253. package/build/index-af91c83e.js +20 -0
  254. package/build/index-b6aea85e.js +191 -0
  255. package/build/index-bc4f4c33.js +156 -0
  256. package/build/index-c604d6bb.js +624 -0
  257. package/build/index-d330735e.js +30 -0
  258. package/build/index-d8a7efaf.js +14 -0
  259. package/build/index-e2e81fa2.js +23 -0
  260. package/build/index-e3d896b3.js +3261 -0
  261. package/build/index.js +436 -1
  262. package/build/{esm/index.styled-14b65c9e.js → index.styled-5628b3e7.js} +25 -5
  263. package/build/index.styles-b822bf42.js +1342 -0
  264. package/build/isProduction-5ce3a388.js +29 -0
  265. package/build/lead.js +2168 -1
  266. package/build/localizeNumberFormat-f5f50987.js +31 -0
  267. package/build/mantine.js +154 -1
  268. package/build/misc.js +70 -1
  269. package/build/navigation.js +61 -1
  270. package/build/normalizeLink-6f7b85d8.js +15 -0
  271. package/build/number-79fe92e1.js +40 -0
  272. package/build/onboardingV2.js +892 -34
  273. package/build/paths-a5643d9e.js +16 -0
  274. package/build/pwg.js +217 -7
  275. package/build/routing-191a9a00.js +46 -0
  276. package/build/subot.js +4592 -134
  277. package/build/theme-fa910869.js +189 -0
  278. package/build/together.js +112 -1
  279. package/build/translationsContext-950334bf.js +7 -0
  280. package/build/tslib.es6-65e312a5.js +41 -0
  281. package/build/types-0f117a9f.js +8084 -0
  282. package/build/types-1fedb3d1.js +3446 -0
  283. package/build/types-52a4e888.js +24 -0
  284. package/build/types.js +56 -1
  285. package/build/unifyEnv.js +46 -1
  286. package/build/useCategory-cfc702f5.js +299 -0
  287. package/build/useHealthToolCache-43a7014d.js +19 -0
  288. package/build/useIsInit-89535012.js +13 -0
  289. package/build/useOutsideClick-c6813964.js +49 -0
  290. package/build/usePlacesAutocomplete-297de092.js +84 -0
  291. package/build/useScrollbarSize-0fa31aa7.js +64 -0
  292. package/build/useTranslations-e1853417.js +32 -0
  293. package/build/useUniqueId-11369116.js +44 -0
  294. package/build/utils-52113753.js +384 -0
  295. package/build/utils-64bd0c42.js +143 -0
  296. package/build/utils-661411f6.js +1171 -0
  297. package/build/utils-e1513cbc.js +25 -0
  298. package/build/vaccination.js +891 -40
  299. package/package.json +4 -5
  300. package/build/BMI_BOYS.percentile.monthly-c56b0165.js +0 -1
  301. package/build/BMI_BOYS.percentile.weekly-64287e04.js +0 -1
  302. package/build/BMI_BOYS.percentile.yearly-8db65d54.js +0 -1
  303. package/build/BMI_BOYS.zscore.monthly-f12389cd.js +0 -1
  304. package/build/BMI_BOYS.zscore.weekly-fff37a57.js +0 -1
  305. package/build/BMI_BOYS.zscore.yearly-a19b57eb.js +0 -1
  306. package/build/BMI_GIRLS.percentile.monthly-a4b36d7d.js +0 -1
  307. package/build/BMI_GIRLS.percentile.weekly-b6089202.js +0 -1
  308. package/build/BMI_GIRLS.percentile.yearly-0d340818.js +0 -1
  309. package/build/BMI_GIRLS.zscore.monthly-fd5b57c0.js +0 -1
  310. package/build/BMI_GIRLS.zscore.weekly-d4577f50.js +0 -1
  311. package/build/BMI_GIRLS.zscore.yearly-e40b8a7d.js +0 -1
  312. package/build/ChevronDown-602ce39e.js +0 -1
  313. package/build/HEAD CIRCUM_BOYS.percentile.monthly-2e4c5776.js +0 -1
  314. package/build/HEAD CIRCUM_BOYS.percentile.weekly-fc5728a5.js +0 -1
  315. package/build/HEAD CIRCUM_BOYS.percentile.yearly-6bfab277.js +0 -1
  316. package/build/HEAD CIRCUM_BOYS.zscore.monthly-6af7ce44.js +0 -1
  317. package/build/HEAD CIRCUM_BOYS.zscore.weekly-9adb819b.js +0 -1
  318. package/build/HEAD CIRCUM_BOYS.zscore.yearly-9a6cdbcf.js +0 -1
  319. package/build/HEAD CIRCUM_GIRLS.percentile.monthly-e7bfe9c6.js +0 -1
  320. package/build/HEAD CIRCUM_GIRLS.percentile.weekly-9f17e019.js +0 -1
  321. package/build/HEAD CIRCUM_GIRLS.percentile.yearly-8a59f541.js +0 -1
  322. package/build/HEAD CIRCUM_GIRLS.zscore.monthly-b7ddb16c.js +0 -1
  323. package/build/HEAD CIRCUM_GIRLS.zscore.weekly-72701c55.js +0 -1
  324. package/build/HEAD CIRCUM_GIRLS.zscore.yearly-dd94bded.js +0 -1
  325. package/build/HEIGHT_BOYS.percentile.monthly-b890068c.js +0 -1
  326. package/build/HEIGHT_BOYS.percentile.weekly-a1aa5130.js +0 -1
  327. package/build/HEIGHT_BOYS.percentile.yearly-5727d920.js +0 -1
  328. package/build/HEIGHT_BOYS.zscore.monthly-13b70aa6.js +0 -1
  329. package/build/HEIGHT_BOYS.zscore.weekly-3e1d7f23.js +0 -1
  330. package/build/HEIGHT_BOYS.zscore.yearly-a956102d.js +0 -1
  331. package/build/HEIGHT_GIRLS.percentile.monthly-da5ec01b.js +0 -1
  332. package/build/HEIGHT_GIRLS.percentile.weekly-e6205d32.js +0 -1
  333. package/build/HEIGHT_GIRLS.percentile.yearly-caefa502.js +0 -1
  334. package/build/HEIGHT_GIRLS.zscore.monthly-102ba473.js +0 -1
  335. package/build/HEIGHT_GIRLS.zscore.weekly-db4f710b.js +0 -1
  336. package/build/HEIGHT_GIRLS.zscore.yearly-36465920.js +0 -1
  337. package/build/Subot-4751194d.js +0 -1
  338. package/build/Visible-9497c463.js +0 -1
  339. package/build/WEIGHT_BOYS.percentile.monthly-554d0361.js +0 -1
  340. package/build/WEIGHT_BOYS.percentile.weekly-8e5334b8.js +0 -1
  341. package/build/WEIGHT_BOYS.percentile.yearly-536e1ccb.js +0 -1
  342. package/build/WEIGHT_BOYS.zscore.monthly-01eccee1.js +0 -1
  343. package/build/WEIGHT_BOYS.zscore.weekly-ee8f2c6b.js +0 -1
  344. package/build/WEIGHT_BOYS.zscore.yearly-0aea2749.js +0 -1
  345. package/build/WEIGHT_GIRLS.percentile.monthly-7abf9d06.js +0 -1
  346. package/build/WEIGHT_GIRLS.percentile.weekly-f9b6e963.js +0 -1
  347. package/build/WEIGHT_GIRLS.percentile.yearly-254865a5.js +0 -1
  348. package/build/WEIGHT_GIRLS.zscore.monthly-909f7417.js +0 -1
  349. package/build/WEIGHT_GIRLS.zscore.weekly-e62cd084.js +0 -1
  350. package/build/WEIGHT_GIRLS.zscore.yearly-8d6e5405.js +0 -1
  351. package/build/constants-00e06f68.js +0 -108
  352. package/build/constants-51251306.js +0 -1
  353. package/build/cookieHelper-7d519a72.js +0 -1
  354. package/build/core-ba3af3e2.js +0 -1
  355. package/build/dataTransform-1805eae3.js +0 -1
  356. package/build/esm/BMI_BOYS.percentile.monthly-6272f835.js +0 -1
  357. package/build/esm/BMI_BOYS.percentile.weekly-80d18f47.js +0 -1
  358. package/build/esm/BMI_BOYS.percentile.yearly-a7e5b5f6.js +0 -1
  359. package/build/esm/BMI_BOYS.zscore.monthly-d3658f97.js +0 -1
  360. package/build/esm/BMI_BOYS.zscore.weekly-6e6708dc.js +0 -1
  361. package/build/esm/BMI_BOYS.zscore.yearly-b8400c9d.js +0 -1
  362. package/build/esm/BMI_GIRLS.percentile.monthly-98586b46.js +0 -1
  363. package/build/esm/BMI_GIRLS.percentile.weekly-7c1511b0.js +0 -1
  364. package/build/esm/BMI_GIRLS.percentile.yearly-ea667f90.js +0 -1
  365. package/build/esm/BMI_GIRLS.zscore.monthly-3a4fd1a6.js +0 -1
  366. package/build/esm/BMI_GIRLS.zscore.weekly-cc1de097.js +0 -1
  367. package/build/esm/BMI_GIRLS.zscore.yearly-6dd1a364.js +0 -1
  368. package/build/esm/ChevronDown-4e59cac6.js +0 -1
  369. package/build/esm/HEAD CIRCUM_BOYS.percentile.monthly-bd0965ae.js +0 -1
  370. package/build/esm/HEAD CIRCUM_BOYS.percentile.weekly-db1053f7.js +0 -1
  371. package/build/esm/HEAD CIRCUM_BOYS.percentile.yearly-cd38b622.js +0 -1
  372. package/build/esm/HEAD CIRCUM_BOYS.zscore.monthly-d7f88a95.js +0 -1
  373. package/build/esm/HEAD CIRCUM_BOYS.zscore.weekly-76f7db79.js +0 -1
  374. package/build/esm/HEAD CIRCUM_BOYS.zscore.yearly-3ce70f8e.js +0 -1
  375. package/build/esm/HEAD CIRCUM_GIRLS.percentile.monthly-b2e678ae.js +0 -1
  376. package/build/esm/HEAD CIRCUM_GIRLS.percentile.weekly-8e2664bb.js +0 -1
  377. package/build/esm/HEAD CIRCUM_GIRLS.percentile.yearly-f5c075a9.js +0 -1
  378. package/build/esm/HEAD CIRCUM_GIRLS.zscore.monthly-6f87849e.js +0 -1
  379. package/build/esm/HEAD CIRCUM_GIRLS.zscore.weekly-48da0aaa.js +0 -1
  380. package/build/esm/HEAD CIRCUM_GIRLS.zscore.yearly-4eea437b.js +0 -1
  381. package/build/esm/HEIGHT_BOYS.percentile.monthly-d1a8cc8e.js +0 -1
  382. package/build/esm/HEIGHT_BOYS.percentile.weekly-2b6cfe6c.js +0 -1
  383. package/build/esm/HEIGHT_BOYS.percentile.yearly-9e78afc3.js +0 -1
  384. package/build/esm/HEIGHT_BOYS.zscore.monthly-5292d78a.js +0 -1
  385. package/build/esm/HEIGHT_BOYS.zscore.weekly-fbdee645.js +0 -1
  386. package/build/esm/HEIGHT_BOYS.zscore.yearly-c11a8f1b.js +0 -1
  387. package/build/esm/HEIGHT_GIRLS.percentile.monthly-8e11e2dc.js +0 -1
  388. package/build/esm/HEIGHT_GIRLS.percentile.weekly-dc3965cb.js +0 -1
  389. package/build/esm/HEIGHT_GIRLS.percentile.yearly-490f7b4e.js +0 -1
  390. package/build/esm/HEIGHT_GIRLS.zscore.monthly-e3531c32.js +0 -1
  391. package/build/esm/HEIGHT_GIRLS.zscore.weekly-36a16a66.js +0 -1
  392. package/build/esm/HEIGHT_GIRLS.zscore.yearly-61736bba.js +0 -1
  393. package/build/esm/Subot-4642c5bf.js +0 -1
  394. package/build/esm/Visible-ff7d225c.js +0 -1
  395. package/build/esm/WEIGHT_BOYS.percentile.monthly-0cfe7ecd.js +0 -1
  396. package/build/esm/WEIGHT_BOYS.percentile.weekly-89802113.js +0 -1
  397. package/build/esm/WEIGHT_BOYS.percentile.yearly-0eb40972.js +0 -1
  398. package/build/esm/WEIGHT_BOYS.zscore.monthly-7f8c5a15.js +0 -1
  399. package/build/esm/WEIGHT_BOYS.zscore.weekly-3dcfa8ce.js +0 -1
  400. package/build/esm/WEIGHT_BOYS.zscore.yearly-98ce1ea0.js +0 -1
  401. package/build/esm/WEIGHT_GIRLS.percentile.monthly-df98e335.js +0 -1
  402. package/build/esm/WEIGHT_GIRLS.percentile.weekly-63fff42a.js +0 -1
  403. package/build/esm/WEIGHT_GIRLS.percentile.yearly-8db8cdd0.js +0 -1
  404. package/build/esm/WEIGHT_GIRLS.zscore.monthly-15c83c6d.js +0 -1
  405. package/build/esm/WEIGHT_GIRLS.zscore.weekly-747a55ec.js +0 -1
  406. package/build/esm/WEIGHT_GIRLS.zscore.yearly-197dc52d.js +0 -1
  407. package/build/esm/constants-6ecfa77c.js +0 -1
  408. package/build/esm/constants-f7c80032.js +0 -108
  409. package/build/esm/cookieHelper-4f089e3c.js +0 -1
  410. package/build/esm/core-80112758.js +0 -1
  411. package/build/esm/dataTransform-0fa341bb.js +0 -1
  412. package/build/esm/getDynamicHealthTool-a4c9d6dd.js +0 -1
  413. package/build/esm/getSocialList-4e48deba.js +0 -1
  414. package/build/esm/index-13dc1f44.js +0 -1
  415. package/build/esm/index-13e62563.js +0 -137
  416. package/build/esm/index-1e7ad007.js +0 -1
  417. package/build/esm/index-24557f2b.js +0 -1
  418. package/build/esm/index-252cb964.js +0 -1
  419. package/build/esm/index-2e99f941.js +0 -1
  420. package/build/esm/index-3452fed2.js +0 -1
  421. package/build/esm/index-3aff939b.js +0 -1
  422. package/build/esm/index-459e0362.js +0 -1
  423. package/build/esm/index-45dcd965.js +0 -1
  424. package/build/esm/index-486b71cd.js +0 -1
  425. package/build/esm/index-5408f5a4.js +0 -113
  426. package/build/esm/index-5e1af23a.js +0 -1
  427. package/build/esm/index-79ef3a30.js +0 -1
  428. package/build/esm/index-7c77273a.js +0 -1
  429. package/build/esm/index-823fd7c0.js +0 -117
  430. package/build/esm/index-8c77d7e0.js +0 -1
  431. package/build/esm/index-93e5b4f3.js +0 -1
  432. package/build/esm/index-9c7b9011.js +0 -2748
  433. package/build/esm/index-9e5956c2.js +0 -1
  434. package/build/esm/index-a83aad1c.js +0 -375
  435. package/build/esm/index-b7cc3ca2.js +0 -1
  436. package/build/esm/index-bf11f9e9.js +0 -50
  437. package/build/esm/index-ce3d38fd.js +0 -1
  438. package/build/esm/index-d27a0e25.js +0 -1
  439. package/build/esm/index-e21276e3.js +0 -1
  440. package/build/esm/index-f9514788.js +0 -177
  441. package/build/esm/index-fd04ccb7.js +0 -1430
  442. package/build/esm/index.styles-94af560f.js +0 -817
  443. package/build/esm/isProduction-00695d80.js +0 -1
  444. package/build/esm/localizeNumberFormat-8355a44f.js +0 -1
  445. package/build/esm/normalizeLink-1c194268.js +0 -1
  446. package/build/esm/number-1347eb7b.js +0 -1
  447. package/build/esm/paths-749b4b53.js +0 -1
  448. package/build/esm/routing-2b284b30.js +0 -1
  449. package/build/esm/theme-3db3c9a8.js +0 -1
  450. package/build/esm/translationsContext-6d2efd65.js +0 -1
  451. package/build/esm/tslib.es6-266309d1.js +0 -1
  452. package/build/esm/types-6d397125.js +0 -3004
  453. package/build/esm/types-850814a7.js +0 -785
  454. package/build/esm/types-d3da37d2.js +0 -1
  455. package/build/esm/useCategory-f5f74749.js +0 -1
  456. package/build/esm/useHealthToolCache-f1488032.js +0 -1
  457. package/build/esm/useIsInit-9661c5f5.js +0 -1
  458. package/build/esm/useOutsideClick-0704b383.js +0 -1
  459. package/build/esm/usePlacesAutocomplete-0733ec49.js +0 -1
  460. package/build/esm/useScrollbarSize-90b179a5.js +0 -1
  461. package/build/esm/useTranslations-df1b3bb8.js +0 -1
  462. package/build/esm/useUniqueId-03fbaecd.js +0 -1
  463. package/build/esm/utils-3d2e3f0f.js +0 -141
  464. package/build/esm/utils-5b4e60da.js +0 -1
  465. package/build/esm/utils-970ce0c0.js +0 -8
  466. package/build/esm/utils-b87ec473.js +0 -1
  467. package/build/getDynamicHealthTool-31f44ca1.js +0 -1
  468. package/build/getSocialList-29c0a6e8.js +0 -1
  469. package/build/index-1714c81c.js +0 -2748
  470. package/build/index-238813a4.js +0 -375
  471. package/build/index-2438163d.js +0 -1430
  472. package/build/index-29d302f4.js +0 -137
  473. package/build/index-3184ae4e.js +0 -1
  474. package/build/index-34b6bd24.js +0 -1
  475. package/build/index-35192783.js +0 -1
  476. package/build/index-41d684a8.js +0 -50
  477. package/build/index-4a8c8ce6.js +0 -1
  478. package/build/index-58e0d49f.js +0 -1
  479. package/build/index-64d2f812.js +0 -1
  480. package/build/index-85c621a2.js +0 -113
  481. package/build/index-90f4bc02.js +0 -1
  482. package/build/index-9a845847.js +0 -117
  483. package/build/index-9ed509d1.js +0 -1
  484. package/build/index-aa495d24.js +0 -1
  485. package/build/index-ad5cf64d.js +0 -1
  486. package/build/index-b21a1d96.js +0 -1
  487. package/build/index-b320255d.js +0 -1
  488. package/build/index-b9af15da.js +0 -1
  489. package/build/index-bd4b31bf.js +0 -1
  490. package/build/index-bf81cb71.js +0 -1
  491. package/build/index-c3cbb8f3.js +0 -1
  492. package/build/index-d25afe2f.js +0 -1
  493. package/build/index-e7c1ff53.js +0 -177
  494. package/build/index-ed8656f9.js +0 -1
  495. package/build/index-f6217f73.js +0 -1
  496. package/build/index-f7088d57.js +0 -1
  497. package/build/index.styles-2ecb9c85.js +0 -817
  498. package/build/isProduction-28d96804.js +0 -1
  499. package/build/localizeNumberFormat-22b2d7aa.js +0 -1
  500. package/build/normalizeLink-594ccff1.js +0 -1
  501. package/build/number-cf06dcc0.js +0 -1
  502. package/build/paths-ed72ecb8.js +0 -1
  503. package/build/routing-f2edd0d0.js +0 -1
  504. package/build/theme-f2b8aad7.js +0 -1
  505. package/build/translationsContext-4c4c33c4.js +0 -1
  506. package/build/tslib.es6-ceb091fd.js +0 -1
  507. package/build/types-49f0543a.js +0 -785
  508. package/build/types-5b303b71.js +0 -1
  509. package/build/types-bfd12e24.js +0 -3004
  510. package/build/useCategory-94d60dab.js +0 -1
  511. package/build/useHealthToolCache-7307d240.js +0 -1
  512. package/build/useIsInit-c3cf1925.js +0 -1
  513. package/build/useOutsideClick-15fef824.js +0 -1
  514. package/build/usePlacesAutocomplete-6ab0181b.js +0 -1
  515. package/build/useScrollbarSize-ab332673.js +0 -1
  516. package/build/useTranslations-233c68bc.js +0 -1
  517. package/build/useUniqueId-46834e18.js +0 -1
  518. package/build/utils-13ea4f2f.js +0 -8
  519. package/build/utils-45e691a3.js +0 -1
  520. package/build/utils-bee8be92.js +0 -141
  521. package/build/utils-d5766c73.js +0 -1
package/build/esm/ecom.js CHANGED
@@ -1 +1,737 @@
1
- import{t as o}from"./theme-3db3c9a8.js";export{c as Constants}from"./constants-6ecfa77c.js";export{t as Types}from"./types-d3da37d2.js";import"./index-9e5956c2.js";import"date-fns/locale";import"./Subot-4642c5bf.js";import"./isProduction-00695d80.js";var e=Object.freeze({__proto__:null}),i=Object.freeze({__proto__:null});function l(t){return null!=t}const a={formatAutoCompleteAddress:t=>t&&t.place_id?{placeId:t.place_id,description:t.description||""}:null,formatPrice:(t,o)=>{const e="string"==typeof t?parseInt(t):t;return new Intl.NumberFormat(o||"vi-VN").format(e)},formatHotSearchKeyword:t=>({text:(null==t?void 0:t.name)||""}),formatHelpfulUrl:t=>({name:(null==t?void 0:t.name)||"",featuredImage:(null==t?void 0:t.featured_image)||"",url:(null==t?void 0:t.url)||""}),formatCategory:function(t,e,i){var l,r,n;const d=i?i+"/"+t.slug:t.slug,u=(null===(r=null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.map)||void 0===r?void 0:r.call(l,(o=>a.formatCategory(o,t.id,d))))||[];return{id:null==t?void 0:t.id,name:(null==t?void 0:t.name)||"",logo:(null==t?void 0:t.logo)||"",slug:(null==t?void 0:t.slug)||"",fullSlug:d||"",children:u,backgroundColor:t.color||o.colors.teal50,parentId:e||0,products:(null===(n=t.products)||void 0===n?void 0:n.map(a.formatProduct))||[]}},formatFooterInfo:t=>{var o,e,i,l,a,r,n,d,u,s,m,c,v,p,_,g,f,b,h;const y=(null===(i=null===(e=null===(o=null==t?void 0:t.branch)||void 0===o?void 0:o.branch)||void 0===e?void 0:e.map)||void 0===i?void 0:i.call(e,(t=>({flag:t.flag||"",name:t.name||"",url:t.url||""}))))||[],x=(null===(r=null===(a=null===(l=null==t?void 0:t.general)||void 0===l?void 0:l.verified)||void 0===a?void 0:a.map)||void 0===r?void 0:r.call(a,(t=>({image:t.image||"",url:t.url||""}))))||[],P=(null===(d=null===(n=null==t?void 0:t.menu)||void 0===n?void 0:n.map)||void 0===d?void 0:d.call(n,(t=>{var o,e;return{menu_title:t.menu_title,items:null===(e=null===(o=t.items)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,(t=>({title:t.title,url:t.url})))}})))||[],C=(null===(m=null===(s=null===(u=null==t?void 0:t.social)||void 0===u?void 0:u.socials)||void 0===s?void 0:s.map)||void 0===m?void 0:m.call(s,(t=>({icon:t.icon||"",name:t.name||"",url:t.url||""}))))||[];return{branch:{title:(null===(c=null==t?void 0:t.branch)||void 0===c?void 0:c.title)||"",branch:y},general:{logo:null!==(p=null===(v=null==t?void 0:t.general)||void 0===v?void 0:v.logo)&&void 0!==p?p:"",content:null!==(g=null===(_=null==t?void 0:t.general)||void 0===_?void 0:_.content)&&void 0!==g?g:"",copyright:null!==(b=null===(f=null==t?void 0:t.general)||void 0===f?void 0:f.copyright)&&void 0!==b?b:"",verified:x},menu:P,social:{title:(null===(h=null==t?void 0:t.social)||void 0===h?void 0:h.title)||"",socials:C}}},formatNavigation:function(t){var o,e,i,l,r,n;return{hotSearchKeywords:(null===(e=null===(o=null==t?void 0:t.hot_search_keywords)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatHotSearchKeyword))||[],helpfulUrls:(null===(l=null===(i=null==t?void 0:t.helpful_urls)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,a.formatHelpfulUrl))||[],categories:(null===(n=null===(r=null==t?void 0:t.categories)||void 0===r?void 0:r.map)||void 0===n?void 0:n.call(r,(t=>a.formatCategory(t))))||[],footer:a.formatFooterInfo(null==t?void 0:t.footer),storeId:(null==t?void 0:t.store_id)||0,customerId:(null==t?void 0:t.customer_id)||0,cartItemsQty:"number"==typeof(null==t?void 0:t.cart_items_qty)?t.cart_items_qty:null}},formatPriceInfo:t=>t?{final:t.final||0,regular:t.regular||0,discountPercent:t.discount_percent||0}:null,formatProduct:function(t){var o,e,i,r;if(!t)return null;const n={final:0,regular:0,discountPercent:0};return{id:t.id||0,price:t.price&&a.formatPriceInfo(t.price)||n,thumbnail:t.thumbnail||"",name:t.name||"",averageRating:Number((t.average_rating||0).toFixed(2)),reviewsCount:t.reviews_count||0,tag:t.tag||null,sku:t.sku||"",slug:t.slug||"",images:t.images||[],tags:t.tags||[],unit:t.unit||"",brand:t.brand?{name:t.brand.name||"",image:t.brand.image||"",slug:t.brand.slug||"",productsCount:t.brand.products_count||0}:null,description:t.description||"",productPromotions:(null===(e=null===(o=t.product_promotions)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatProductPromotion).filter(l))||[],categories:(null===(r=null===(i=t.categories)||void 0===i?void 0:i.map)||void 0===r?void 0:r.call(i,(t=>a.formatCategory(t))).filter(l))||[],isInStock:(null==t?void 0:t.is_in_stock)||!1}},formatBanner:t=>t?{name:t.name||"",url:t.url||"",featuredImage:t.featured_image||"",alt:t.image_alt}:null,formatBlogPost:t=>{var o,e;return t?{title:t.title||"",image:t.image||"",link:t.link||"",postData:t.post_data?{reviewed:t.post_data.reviewed?{author:a.formatBlogPostDataReviewedUser(t.post_data.reviewed.author||void 0),editor:a.formatBlogPostDataReviewedUser(t.post_data.reviewed.editor||void 0),expert:a.formatBlogPostDataReviewedUser(t.post_data.reviewed.expert||void 0),factCheck:a.formatBlogPostDataReviewedUser(t.post_data.reviewed.fact_check||void 0),isAuthor:Boolean(t.post_data.reviewed.is_author)}:null,categories:t.post_data.categories?null===(e=(o=t.post_data.categories).map)||void 0===e?void 0:e.call(o,(t=>({termId:t.term_id||0,name:t.name||"",permalink:t.permalink||"",textColor:t.text_color||""}))):[],postDate:t.post_data.post_date||"",postModified:t.post_data.post_modified||"",modifiedTime:t.post_data.modified_time||""}:null}:null},formatBlogPostDataReviewedUser:t=>t?{id:t.ID||0,userId:t.user_id||0,formerRole:t.former_role||"",role:t.role||"",slug:t.slug||"",displayName:t.display_name||"",description:t.description||"",profileUrl:t.profile_url||"",avatar:t.avatar||"",avatarThumbnail:t.avatar_thumbnail||"",turnOffProfile:Boolean(t.turn_off_profile)}:null,formatBrand:function(t){var o,e,i,r;return t?{id:t.id||0,image:t.image||"",position:t.position||"",isPopular:t.is_popular||!1,summary:t.summary||"",name:t.name||"",slug:t.slug||"",description:t.description||null,banners:(null===(e=null===(o=t.banners)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatBanner).filter(l))||[],bestsellerProducts:(null===(r=null===(i=t.bestseller_products)||void 0===i?void 0:i.map)||void 0===r?void 0:r.call(i,a.formatProduct).filter(l))||[]}:null},formatHomePage:t=>{var o,e,i,r,n,d,u,s,m,c,v,p,_,g,f,b,h,y,x,P;return t?{brands:t.brands?null===(e=(o=t.brands).map)||void 0===e?void 0:e.call(o,a.formatBrand).filter(l):[],hotDeals:t.hot_deals?null===(r=(i=t.hot_deals).map)||void 0===r?void 0:r.call(i,a.formatProduct).filter(l):[],newProducts:t.new_products?null===(d=(n=t.new_products).map)||void 0===d?void 0:d.call(n,a.formatProduct).filter(l):[],slideBanners:t.slide_banners?null===(s=(u=t.slide_banners).map)||void 0===s?void 0:s.call(u,a.formatBanner).filter(l):[],subBanners:t.sub_banners?null===(c=(m=t.sub_banners).map)||void 0===c?void 0:c.call(m,a.formatBanner).filter(l):[],footerBanners:t.footer_banners?null===(p=(v=t.footer_banners).map)||void 0===p?void 0:p.call(v,a.formatBanner).filter(l):[],blogPosts:t.blog_posts?null===(g=(_=t.blog_posts).map)||void 0===g?void 0:g.call(_,a.formatBlogPost).filter(l):[],popularCategories:t.popular_categories?null===(b=(f=t.popular_categories).map)||void 0===b?void 0:b.call(f,(t=>a.formatCategory(t))).filter(l):[],suggestProducts:t.suggest_products?null===(y=(h=t.suggest_products).map)||void 0===y?void 0:y.call(h,(t=>a.formatCategory(t))).filter(l):[],promotions:t.promotions?null===(P=(x=t.promotions).map)||void 0===P?void 0:P.call(x,(t=>a.formatPromotion(t))).filter(l):[]}:null},formatCategoryPage:function(t){var o,e,i,r;return t?{id:t.id||0,name:t.name||"",slug:t.slug||"",description:t.description||null,banners:(null===(e=null===(o=t.banners)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatBanner).filter(l))||[],bestsellerProducts:(null===(r=null===(i=t.bestseller_products)||void 0===i?void 0:i.map)||void 0===r?void 0:r.call(i,a.formatProduct).filter(l))||[]}:null},formatBrandPage:function(t){return t?a.formatBrand(t):null},formatPagination:t=>t?{current:t.current||0,first:t.first||0,itemsPerPage:t.items_per_page||0,last:t.last||0,next:t.next||0,prev:t.prev||0,totalItems:t.total_items||0}:null,formatProductDetailPage:function(t){var o,e,i,r,n,d,u,s;return t?Object.assign(Object.assign({},a.formatProduct(t)),{relatedProducts:(null===(e=null===(o=t.related_products)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatProduct).filter(l))||[],bestsellerProducts:(null===(r=null===(i=t.bestseller_products)||void 0===i?void 0:i.map)||void 0===r?void 0:r.call(i,a.formatProduct).filter(l))||[],viewedProducts:(null===(d=null===(n=t.viewed_products)||void 0===n?void 0:n.map)||void 0===d?void 0:d.call(n,a.formatProduct).filter(l))||[],promotions:(null===(s=null===(u=t.promotions)||void 0===u?void 0:u.map)||void 0===s?void 0:s.call(u,a.formatPromotion).filter(l))||[]}):null},formatProductReview:t=>{var o,e;return t?{reviewId:t.review_id||"",createdAt:t.created_at||"",title:t.title||"",detail:t.detail||"",nickname:t.nick_name||"",avatar:t.avatar||"",ratingVotes:(null===(e=null===(o=t.rating_votes)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,(t=>({ratingCode:t.rating_code||"",value:Number(t.value)||0,percent:Number(t.percent)||0}))))||[],images:t.images||[]}:null},formatProductPromotion:t=>t?{id:t.id||0,name:t.name||"",thumbnail:t.thumbnail||"",expirationDate:t.expiration_date||""}:null,formatPromotion:t=>t?{id:t.id||0,name:t.name||"",slug:t.slug||"",thumbnail:t.thumbnail||"",expiredDate:t.expired_date||"",banners:t.banners||[],points:0,description:t.description||"",metaTitle:t.meta_title||"",metaKeywords:t.meta_keywords||"",metaDescription:t.meta_description||""}:null,formatCustomAttributes:(t,o)=>{var e;return(null==t?void 0:t.length)&&(null===(e=null==t?void 0:t.find((t=>t.attribute_code===o)))||void 0===e?void 0:e.value)||""},formatAddress:t=>{var o,e,i,l;return t?{id:t.id||0,fullName:t.firstname||"",telephone:t.telephone||"",province:{value:null===(o=t.region)||void 0===o?void 0:o.region_id,label:null===(e=t.region)||void 0===e?void 0:e.region}||null,district:{value:a.formatCustomAttributes(t.custom_attributes,"district_id"),label:a.formatCustomAttributes(t.custom_attributes,"district")},commune:{value:a.formatCustomAttributes(t.custom_attributes,"ward_id"),label:a.formatCustomAttributes(t.custom_attributes,"ward")},street:(null===(i=null==t?void 0:t.street)||void 0===i?void 0:i.length)?null==t?void 0:t.street[0]:"",isDefault:t.default_billing&&t.default_shipping||!1,fullAddress:(null===(l=null==t?void 0:t.extension_attributes)||void 0===l?void 0:l.full_address)||""}:null},formatProvince:t=>(null==t?void 0:t.available_regions)?t.available_regions.map((t=>({value:t.id||"",label:t.name||""}))):[],formatDistrict:t=>(null==t?void 0:t.districts)?t.districts.map((t=>({value:t.id||"",label:t.name||""}))):[],formatCommune:t=>(null==t?void 0:t.communes)?t.communes.map((t=>({value:t.id||"",label:t.name||""}))):[],formatOrder:t=>{var o,e;return t?{orderNumber:(null==t?void 0:t.order_number)||"",shippingData:(null==t?void 0:t.shipping_data)?{shippingMethod:t.shipping_data.shipping_method||"",shippingDescription:t.shipping_data.shipping_description||"",shippingAddress:t.shipping_data.shipping_address?{fullName:t.shipping_data.shipping_address.firstname||"",fullAddress:t.shipping_data.shipping_address.full_address||"",telephone:t.shipping_data.shipping_address.telephone||""}:null,storeAddress:null}:null,orderedDate:(null==t?void 0:t.ordered_date)||"",status:(null==t?void 0:t.status)||null,totals:(null==t?void 0:t.totals)?{subtotal:t.totals.subtotal||0,shippingAmount:t.totals.shipping_amount||0,discountAmount:t.totals.discount_amount||0,grandTotal:t.totals.grand_total||0}:null,products:(null===(e=null===(o=null==t?void 0:t.products)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,(t=>({sku:t.sku||"",name:t.name||"",price:t.price||0,rowTotal:t.row_total||0,image:t.image||"",qty:t.qty||0}))))||[],paymentMethod:(null==t?void 0:t.payment_method)||""}:null},formatStatistic:t=>{var o,e,i,l,a;return t?{pending:Number(null===(o=null==t?void 0:t.find((t=>"pending"===t.status)))||void 0===o?void 0:o.amount)||0,processing:Number(null===(e=null==t?void 0:t.find((t=>"processing"===t.status)))||void 0===e?void 0:e.amount)||0,delivering:Number(null===(i=null==t?void 0:t.find((t=>"delivering"===t.status)))||void 0===i?void 0:i.amount)||0,complete:Number(null===(l=null==t?void 0:t.find((t=>"complete"===t.status)))||void 0===l?void 0:l.amount)||0,canceled:Number(null===(a=null==t?void 0:t.find((t=>"canceled"===t.status)))||void 0===a?void 0:a.amount)||0}:{}},formatCartItem:t=>{var o,e,i,l,r,n,d,u;return t?{itemId:t.item_id||0,sku:t.sku||"",qty:t.qty||0,name:t.name||"",price:t.price||0,basePrice:(null===(o=t.extension_attributes)||void 0===o?void 0:o.base_price)||0,productType:t.product_type||"",quoteId:t.quote_id||"",thumbnail:(null===(e=t.extension_attributes)||void 0===e?void 0:e.thumbnail)||"",rowTotal:(null===(i=t.extension_attributes)||void 0===i?void 0:i.row_total)||0,promotions:(null===(n=null===(r=null===(l=t.extension_attributes)||void 0===l?void 0:l.promotions)||void 0===r?void 0:r.map)||void 0===n?void 0:n.call(r,a.formatProductPromotion))||[],isInStock:(null===(d=t.extension_attributes)||void 0===d?void 0:d.is_in_stock)||!1,urlProduct:(null===(u=t.extension_attributes)||void 0===u?void 0:u.url_key)||""}:null},formatCartAddress:t=>{var o;return t?{customerAddressId:(null==t?void 0:t.customer_address_id)||0,id:t.id||0,region:t.region||"",regionId:t.region_id||0,regionCode:t.region_code||"",countryId:t.country_id||"",street:t.street||[],postcode:t.postcode||"",city:t.city||"",firstname:t.firstname||"",lastname:t.lastname||"",customerId:t.customer_id||0,email:t.email||"",telephone:t.telephone||"",sameAsBilling:t.same_as_billing||0,saveInAddressBook:t.save_in_address_book||0,fullAddress:(null===(o=t.extension_attributes)||void 0===o?void 0:o.full_address)||""}:null},formatEstimatedShipping:t=>t?{carrierCode:t.carrier_code||"",methodCode:t.method_code||"",carrierTitle:t.carrier_title||"",methodTitle:t.method_title||"",amount:t.amount||0,baseAmount:t.base_amount||0,available:t.available||!1,errorMessage:t.error_message||"",priceExclTax:t.price_excl_tax||0,priceInclTax:t.price_incl_tax||0}:null,formatCartLoggedInCustomer:t=>{var o,e,i;return t?{email:t.email||"",firstname:t.firstname||"",lastname:t.lastname||"",id:t.id||0,groupId:t.group_id||0,createdAt:t.created_at||"",updatedAt:t.updated_at||"",createdIn:t.created_in||"",storeId:t.store_id||0,websiteId:t.website_id||0,addresses:(null===(e=null===(o=t.addresses)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatCartAddress))||[],disableAutoGroupChange:t.disable_auto_group_change||0,isSubscribed:(null===(i=t.extension_attributes)||void 0===i?void 0:i.is_subscribed)||!1}:null},formatCart:t=>{var o,e,i,l,r,n,d,u,s,m,c,v,p,_;return t?{id:t.id||0,createdAt:t.created_at||"",updatedAt:t.updated_at||"",isActive:t.is_active||!1,isVirtual:t.is_virtual||!1,items:(null===(i=null===(e=null===(o=t.items)||void 0===o?void 0:o.map)||void 0===e?void 0:e.call(o,a.formatCartItem))||void 0===i?void 0:i.sort(((t,o)=>Number(null==o?void 0:o.isInStock)-Number(null==t?void 0:t.isInStock))))||[],itemsCount:t.items_count||0,itemsQty:t.items_qty||0,customer:t.customer?a.formatCartLoggedInCustomer(t.customer):null,billingAddress:t.billing_address?a.formatCartAddress(t.billing_address):null,origOrderId:t.orig_order_id||0,currency:{globalCurrencyCode:(null===(l=t.currency)||void 0===l?void 0:l.global_currency_code)||"",baseCurrencyCode:(null===(r=t.currency)||void 0===r?void 0:r.base_currency_code)||"",storeCurrencyCode:(null===(n=t.currency)||void 0===n?void 0:n.store_currency_code)||"",quoteCurrencyCode:(null===(d=t.currency)||void 0===d?void 0:d.quote_currency_code)||"",storeToBaseRate:(null===(u=t.currency)||void 0===u?void 0:u.store_to_base_rate)||0,storeToQuoteRate:(null===(s=t.currency)||void 0===s?void 0:s.store_to_quote_rate)||0,baseToGlobalRate:(null===(m=t.currency)||void 0===m?void 0:m.base_to_global_rate)||0,baseToQuoteRate:(null===(c=t.currency)||void 0===c?void 0:c.base_to_quote_rate)||0},customerIsGuest:t.customer_is_guest||!1,customerNoteNotify:t.customer_note_notify||!1,customerTaxClassId:t.customer_tax_class_id||0,storeId:t.store_id||0,shippingAssignments:null===(_=null===(p=null===(v=t.extension_attributes)||void 0===v?void 0:v.shipping_assignments)||void 0===p?void 0:p.map)||void 0===_?void 0:_.call(p,(t=>{var o,e,i;return{shipping:{address:t.shipping.address?a.formatCartAddress(t.shipping.address):null,method:(null===(o=t.shipping)||void 0===o?void 0:o.method)||""},items:(null===(i=(e=t.items).map)||void 0===i?void 0:i.call(e,a.formatCartItem))||[]}}))}:null},formatCartTotal:t=>{var o,e,i;return t?{grandTotal:t.grand_total||0,baseGrandTotal:t.base_grand_total||0,subtotal:t.subtotal||0,baseSubtotal:t.base_subtotal||0,discountAmount:t.discount_amount||0,baseDiscountAmount:t.base_discount_amount||0,subtotalWithDiscount:t.subtotal_with_discount||0,baseSubtotalWithDiscount:t.base_subtotal_with_discount||0,shippingAmount:t.shipping_amount||0,baseShippingAmount:t.base_shipping_amount||0,shippingDiscountAmount:t.shipping_discount_amount||0,baseShippingDiscountAmount:t.base_shipping_discount_amount||0,taxAmount:t.tax_amount||0,baseTaxAmount:t.base_tax_amount||0,weeeTaxAppliedAmount:t.weee_tax_applied_amount||0,shippingTaxAmount:t.shipping_tax_amount||0,baseShippingTaxAmount:t.base_shipping_tax_amount||0,subtotalInclTax:t.subtotal_incl_tax||0,shippingInclTax:t.shipping_incl_tax||0,baseShippingInclTax:t.base_shipping_incl_tax||0,baseCurrencyCode:t.base_currency_code||"",quoteCurrencyCode:t.quote_currency_code||"",itemsQty:t.items_qty||0,coupon:{couponCode:t.coupon_code||"",couponDescription:(null===(o=null==t?void 0:t.extension_attributes)||void 0===o?void 0:o.coupon_description_text)||""},items:(null===(i=null===(e=t.items)||void 0===e?void 0:e.map)||void 0===i?void 0:i.call(e,(t=>({itemId:t.item_id||0,price:t.price||0,basePrice:t.base_price||0,qty:t.qty||0,rowTotal:t.row_total||0,baseRowTotal:t.base_row_total||0,rowTotalWithDiscount:t.row_total_with_discount||0,taxAmount:t.tax_amount||0,baseTaxAmount:t.base_tax_amount||0,taxPercent:t.tax_percent||0,discountAmount:t.discount_amount||0,baseDiscountAmount:t.base_discount_amount||0,discountPercent:t.discount_percent||0,priceInclTax:t.price_incl_tax||0,basePriceInclTax:t.base_price_incl_tax||0,rowTotalInclTax:t.row_total_incl_tax||0,baseRowTotalInclTax:t.base_row_total_incl_tax||0,options:t.options||"",weeeTaxAppliedAmount:t.weee_tax_applied_amount||0,weeeTaxApplied:t.weee_tax_applied||0,name:t.name||""}))))||[],totalSegments:t.total_segments||[]}:null},formatPaymentMethod:t=>t?null==t?void 0:t.map((t=>({code:(null==t?void 0:t.payment_code)||"",title:(null==t?void 0:t.payment_title)||"",thumbnail:(null==t?void 0:t.payment_thumbnail)||""}))):null,formatPaymentInformation:t=>{var o;return t?{paymentMethods:a.formatPaymentMethod(null===(o=null==t?void 0:t.extension_attributes)||void 0===o?void 0:o.payment_detail_info)||[],totals:a.formatCartTotal(t.totals)}:null},formatOrderConfirmation:t=>t?{isSuccess:t.is_success||!1,orderInfo:a.formatOrder(t.order_info)}:null,formatCoupons:t=>{var o;return(null===(o=null==t?void 0:t.items)||void 0===o?void 0:o.length)?t.items.map((t=>({code:(null==t?void 0:t.code)||"",name:(null==t?void 0:t.name)||"",thumbnail:(null==t?void 0:t.thumbnail)||"",description:(null==t?void 0:t.expired_date)||""}))):null},formatShippings:t=>t?t.map((t=>{var o;return{carrierCode:t.carrier_code||"",methodCode:t.method_code||"",title:t.carrier_title||"",description:t.method_title||"",price:(null==t?void 0:t.base_amount)||0,thumbnail:(null===(o=null==t?void 0:t.extension_attributes)||void 0===o?void 0:o.thumbnail)||""}})):[]};var r=Object.freeze({__proto__:null,dataFormatter:a});export{e as ApiTypes,r as DataFormatter,i as DataTypes};
1
+ import { t as theme } from './theme-e74db08c.js';
2
+ export { c as Constants } from './constants-2a6d2434.js';
3
+ export { t as Types } from './types-ba190c26.js';
4
+ import './index-e612be9c.js';
5
+ import 'date-fns/locale';
6
+ import './Subot-3289bd8e.js';
7
+ import './isProduction-0ea904dd.js';
8
+
9
+ // ===== CART END =====
10
+
11
+ var apiTypes = /*#__PURE__*/Object.freeze({
12
+ __proto__: null
13
+ });
14
+
15
+ var dataTypes = /*#__PURE__*/Object.freeze({
16
+ __proto__: null
17
+ });
18
+
19
+ function isDefined(argument) {
20
+ return argument !== undefined && argument !== null;
21
+ }
22
+
23
+ const dataFormatter = {
24
+ formatAutoCompleteAddress: (address) => {
25
+ if (!address || !address.place_id)
26
+ return null;
27
+ return {
28
+ placeId: address.place_id,
29
+ description: address.description || '',
30
+ };
31
+ },
32
+ formatPrice: (price, locale) => {
33
+ const formattedPrice = typeof price === 'string' ? parseInt(price) : price;
34
+ return new Intl.NumberFormat(locale || 'vi-VN').format(formattedPrice);
35
+ },
36
+ formatHotSearchKeyword: (data) => {
37
+ return {
38
+ text: (data === null || data === void 0 ? void 0 : data.name) || '',
39
+ };
40
+ },
41
+ formatHelpfulUrl: (data) => {
42
+ return {
43
+ name: (data === null || data === void 0 ? void 0 : data.name) || '',
44
+ featuredImage: (data === null || data === void 0 ? void 0 : data.featured_image) || '',
45
+ url: (data === null || data === void 0 ? void 0 : data.url) || '',
46
+ };
47
+ },
48
+ formatCategory: function (data, parentId, parentFullSlug) {
49
+ var _a, _b, _c;
50
+ const currentFullSlug = parentFullSlug
51
+ ? parentFullSlug + '/' + data.slug
52
+ : data.slug;
53
+ const children = ((_b = (_a = data === null || data === void 0 ? void 0 : data.children) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (childCategory) => {
54
+ return dataFormatter.formatCategory(childCategory, data.id, currentFullSlug);
55
+ })) || [];
56
+ return {
57
+ id: data === null || data === void 0 ? void 0 : data.id,
58
+ name: (data === null || data === void 0 ? void 0 : data.name) || '',
59
+ logo: (data === null || data === void 0 ? void 0 : data.logo) || '',
60
+ slug: (data === null || data === void 0 ? void 0 : data.slug) || '',
61
+ fullSlug: currentFullSlug || '',
62
+ children,
63
+ backgroundColor: data.color || theme.colors.teal50,
64
+ parentId: parentId || 0,
65
+ products: ((_c = data.products) === null || _c === void 0 ? void 0 : _c.map(dataFormatter.formatProduct)) || [],
66
+ };
67
+ },
68
+ formatFooterInfo: (data) => {
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
70
+ const branches = ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.branch) === null || _a === void 0 ? void 0 : _a.branch) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, (branch) => {
71
+ return {
72
+ flag: branch.flag || '',
73
+ name: branch.name || '',
74
+ url: branch.url || '',
75
+ };
76
+ })) || [];
77
+ const verified = ((_f = (_e = (_d = data === null || data === void 0 ? void 0 : data.general) === null || _d === void 0 ? void 0 : _d.verified) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, (verifiedItem) => {
78
+ return {
79
+ image: verifiedItem.image || '',
80
+ url: verifiedItem.url || '',
81
+ };
82
+ })) || [];
83
+ const menu = ((_h = (_g = data === null || data === void 0 ? void 0 : data.menu) === null || _g === void 0 ? void 0 : _g.map) === null || _h === void 0 ? void 0 : _h.call(_g, (menuItem) => {
84
+ var _a, _b;
85
+ return {
86
+ menu_title: menuItem.menu_title,
87
+ items: (_b = (_a = menuItem.items) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => {
88
+ return {
89
+ title: item.title,
90
+ url: item.url,
91
+ };
92
+ }),
93
+ };
94
+ })) || [];
95
+ const socials = ((_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.social) === null || _j === void 0 ? void 0 : _j.socials) === null || _k === void 0 ? void 0 : _k.map) === null || _l === void 0 ? void 0 : _l.call(_k, (social) => {
96
+ return {
97
+ icon: social.icon || '',
98
+ name: social.name || '',
99
+ url: social.url || '',
100
+ };
101
+ })) || [];
102
+ return {
103
+ branch: {
104
+ title: ((_m = data === null || data === void 0 ? void 0 : data.branch) === null || _m === void 0 ? void 0 : _m.title) || '',
105
+ branch: branches,
106
+ },
107
+ general: {
108
+ logo: (_p = (_o = data === null || data === void 0 ? void 0 : data.general) === null || _o === void 0 ? void 0 : _o.logo) !== null && _p !== void 0 ? _p : '',
109
+ content: (_r = (_q = data === null || data === void 0 ? void 0 : data.general) === null || _q === void 0 ? void 0 : _q.content) !== null && _r !== void 0 ? _r : '',
110
+ copyright: (_t = (_s = data === null || data === void 0 ? void 0 : data.general) === null || _s === void 0 ? void 0 : _s.copyright) !== null && _t !== void 0 ? _t : '',
111
+ verified,
112
+ },
113
+ menu,
114
+ social: {
115
+ title: ((_u = data === null || data === void 0 ? void 0 : data.social) === null || _u === void 0 ? void 0 : _u.title) || '',
116
+ socials,
117
+ },
118
+ };
119
+ },
120
+ formatNavigation: function (data) {
121
+ var _a, _b, _c, _d, _e, _f;
122
+ return {
123
+ hotSearchKeywords: ((_b = (_a = data === null || data === void 0 ? void 0 : data.hot_search_keywords) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatHotSearchKeyword)) || [],
124
+ helpfulUrls: ((_d = (_c = data === null || data === void 0 ? void 0 : data.helpful_urls) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatHelpfulUrl)) || [],
125
+ categories: ((_f = (_e = data === null || data === void 0 ? void 0 : data.categories) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, (category) => dataFormatter.formatCategory(category))) || [],
126
+ footer: dataFormatter.formatFooterInfo(data === null || data === void 0 ? void 0 : data.footer),
127
+ storeId: (data === null || data === void 0 ? void 0 : data.store_id) || 0,
128
+ customerId: (data === null || data === void 0 ? void 0 : data.customer_id) || 0,
129
+ cartItemsQty: typeof (data === null || data === void 0 ? void 0 : data.cart_items_qty) === 'number' ? data.cart_items_qty : null,
130
+ };
131
+ },
132
+ // === ECOM TYPES FORMAT ===
133
+ formatPriceInfo: (priceInfoApi) => {
134
+ if (!priceInfoApi)
135
+ return null;
136
+ return {
137
+ final: priceInfoApi.final || 0,
138
+ regular: priceInfoApi.regular || 0,
139
+ discountPercent: priceInfoApi.discount_percent || 0,
140
+ };
141
+ },
142
+ formatProduct: function (productApi) {
143
+ var _a, _b, _c, _d;
144
+ if (!productApi)
145
+ return null;
146
+ const defaultPriceInfo = {
147
+ final: 0,
148
+ regular: 0,
149
+ discountPercent: 0,
150
+ };
151
+ return {
152
+ id: productApi.id || 0,
153
+ price: productApi.price
154
+ ? dataFormatter.formatPriceInfo(productApi.price) || defaultPriceInfo
155
+ : defaultPriceInfo,
156
+ thumbnail: productApi.thumbnail || '',
157
+ name: productApi.name || '',
158
+ averageRating: Number((productApi.average_rating || 0).toFixed(2)),
159
+ reviewsCount: productApi.reviews_count || 0,
160
+ tag: productApi.tag || null,
161
+ sku: productApi.sku || '',
162
+ slug: productApi.slug || '',
163
+ images: productApi.images || [],
164
+ tags: productApi.tags || [],
165
+ unit: productApi.unit || '',
166
+ brand: productApi.brand
167
+ ? {
168
+ name: productApi.brand.name || '',
169
+ image: productApi.brand.image || '',
170
+ slug: productApi.brand.slug || '',
171
+ productsCount: productApi.brand.products_count || 0,
172
+ }
173
+ : null,
174
+ description: productApi.description || '',
175
+ productPromotions: ((_b = (_a = productApi.product_promotions) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatProductPromotion).filter(isDefined)) || [],
176
+ categories: ((_d = (_c = productApi.categories) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, (c) => dataFormatter.formatCategory(c)).filter(isDefined)) || [],
177
+ isInStock: (productApi === null || productApi === void 0 ? void 0 : productApi.is_in_stock) || false,
178
+ };
179
+ },
180
+ formatBanner: (bannerApi) => {
181
+ if (!bannerApi)
182
+ return null;
183
+ return {
184
+ name: bannerApi.name || '',
185
+ url: bannerApi.url || '',
186
+ featuredImage: bannerApi.featured_image || '',
187
+ alt: bannerApi.image_alt,
188
+ };
189
+ },
190
+ formatBlogPost: (blogPostApi) => {
191
+ var _a, _b;
192
+ if (!blogPostApi)
193
+ return null;
194
+ return {
195
+ title: blogPostApi.title || '',
196
+ image: blogPostApi.image || '',
197
+ link: blogPostApi.link || '',
198
+ postData: blogPostApi.post_data
199
+ ? {
200
+ reviewed: blogPostApi.post_data.reviewed
201
+ ? {
202
+ author: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.author || undefined),
203
+ editor: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.editor || undefined),
204
+ expert: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.expert || undefined),
205
+ factCheck: dataFormatter.formatBlogPostDataReviewedUser(blogPostApi.post_data.reviewed.fact_check || undefined),
206
+ isAuthor: Boolean(blogPostApi.post_data.reviewed.is_author),
207
+ }
208
+ : null,
209
+ categories: blogPostApi.post_data.categories
210
+ ? (_b = (_a = blogPostApi.post_data.categories).map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => ({
211
+ termId: item.term_id || 0,
212
+ name: item.name || '',
213
+ permalink: item.permalink || '',
214
+ textColor: item.text_color || '',
215
+ }))
216
+ : [],
217
+ postDate: blogPostApi.post_data.post_date || '',
218
+ postModified: blogPostApi.post_data.post_modified || '',
219
+ modifiedTime: blogPostApi.post_data.modified_time || '',
220
+ }
221
+ : null,
222
+ };
223
+ },
224
+ formatBlogPostDataReviewedUser: (blogPostDataReviewedUserApi) => {
225
+ if (!blogPostDataReviewedUserApi)
226
+ return null;
227
+ return {
228
+ id: blogPostDataReviewedUserApi.ID || 0,
229
+ userId: blogPostDataReviewedUserApi.user_id || 0,
230
+ formerRole: blogPostDataReviewedUserApi.former_role || '',
231
+ role: blogPostDataReviewedUserApi.role || '',
232
+ slug: blogPostDataReviewedUserApi.slug || '',
233
+ displayName: blogPostDataReviewedUserApi.display_name || '',
234
+ description: blogPostDataReviewedUserApi.description || '',
235
+ profileUrl: blogPostDataReviewedUserApi.profile_url || '',
236
+ avatar: blogPostDataReviewedUserApi.avatar || '',
237
+ avatarThumbnail: blogPostDataReviewedUserApi.avatar_thumbnail || '',
238
+ turnOffProfile: Boolean(blogPostDataReviewedUserApi.turn_off_profile),
239
+ };
240
+ },
241
+ formatBrand: function (brandApi) {
242
+ var _a, _b, _c, _d;
243
+ if (!brandApi)
244
+ return null;
245
+ return {
246
+ id: brandApi.id || 0,
247
+ image: brandApi.image || '',
248
+ position: brandApi.position || '',
249
+ isPopular: brandApi.is_popular || false,
250
+ summary: brandApi.summary || '',
251
+ name: brandApi.name || '',
252
+ slug: brandApi.slug || '',
253
+ description: brandApi.description || null,
254
+ banners: ((_b = (_a = brandApi.banners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatBanner).filter(isDefined)) ||
255
+ [],
256
+ bestsellerProducts: ((_d = (_c = brandApi.bestseller_products) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)) || [],
257
+ };
258
+ },
259
+ formatHomePage: (homePageApi) => {
260
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
261
+ if (!homePageApi)
262
+ return null;
263
+ return {
264
+ brands: homePageApi.brands
265
+ ? (_b = (_a = homePageApi.brands).map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatBrand).filter(isDefined)
266
+ : [],
267
+ hotDeals: homePageApi.hot_deals
268
+ ? (_d = (_c = homePageApi.hot_deals).map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)
269
+ : [],
270
+ newProducts: homePageApi.new_products
271
+ ? (_f = (_e = homePageApi.new_products).map) === null || _f === void 0 ? void 0 : _f.call(_e, dataFormatter.formatProduct).filter(isDefined)
272
+ : [],
273
+ slideBanners: homePageApi.slide_banners
274
+ ? (_h = (_g = homePageApi.slide_banners).map) === null || _h === void 0 ? void 0 : _h.call(_g, dataFormatter.formatBanner).filter(isDefined)
275
+ : [],
276
+ subBanners: homePageApi.sub_banners
277
+ ? (_k = (_j = homePageApi.sub_banners).map) === null || _k === void 0 ? void 0 : _k.call(_j, dataFormatter.formatBanner).filter(isDefined)
278
+ : [],
279
+ footerBanners: homePageApi.footer_banners
280
+ ? (_m = (_l = homePageApi.footer_banners).map) === null || _m === void 0 ? void 0 : _m.call(_l, dataFormatter.formatBanner).filter(isDefined)
281
+ : [],
282
+ blogPosts: homePageApi.blog_posts
283
+ ? (_p = (_o = homePageApi.blog_posts).map) === null || _p === void 0 ? void 0 : _p.call(_o, dataFormatter.formatBlogPost).filter(isDefined)
284
+ : [],
285
+ popularCategories: homePageApi.popular_categories
286
+ ? (_r = (_q = homePageApi.popular_categories).map) === null || _r === void 0 ? void 0 : _r.call(_q, (c) => dataFormatter.formatCategory(c)).filter(isDefined)
287
+ : [],
288
+ suggestProducts: homePageApi.suggest_products
289
+ ? (_t = (_s = homePageApi.suggest_products).map) === null || _t === void 0 ? void 0 : _t.call(_s, (c) => dataFormatter.formatCategory(c)).filter(isDefined)
290
+ : [],
291
+ promotions: homePageApi.promotions
292
+ ? (_v = (_u = homePageApi.promotions).map) === null || _v === void 0 ? void 0 : _v.call(_u, (c) => dataFormatter.formatPromotion(c)).filter(isDefined)
293
+ : [],
294
+ };
295
+ },
296
+ formatCategoryPage: function (categoryPageApi) {
297
+ var _a, _b, _c, _d;
298
+ if (!categoryPageApi)
299
+ return null;
300
+ return {
301
+ id: categoryPageApi.id || 0,
302
+ name: categoryPageApi.name || '',
303
+ slug: categoryPageApi.slug || '',
304
+ description: categoryPageApi.description || null,
305
+ banners: ((_b = (_a = categoryPageApi.banners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatBanner).filter(isDefined)) || [],
306
+ bestsellerProducts: ((_d = (_c = categoryPageApi.bestseller_products) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)) || [],
307
+ };
308
+ },
309
+ formatBrandPage: function (brandPageApi) {
310
+ if (!brandPageApi)
311
+ return null;
312
+ return dataFormatter.formatBrand(brandPageApi);
313
+ },
314
+ formatPagination: (paginationApi) => {
315
+ if (!paginationApi)
316
+ return null;
317
+ return {
318
+ current: paginationApi.current || 0,
319
+ first: paginationApi.first || 0,
320
+ itemsPerPage: paginationApi.items_per_page || 0,
321
+ last: paginationApi.last || 0,
322
+ next: paginationApi.next || 0,
323
+ prev: paginationApi.prev || 0,
324
+ totalItems: paginationApi.total_items || 0,
325
+ };
326
+ },
327
+ formatProductDetailPage: function (productDetailPageApi) {
328
+ var _a, _b, _c, _d, _e, _f, _g, _h;
329
+ if (!productDetailPageApi)
330
+ return null;
331
+ return Object.assign(Object.assign({}, dataFormatter.formatProduct(productDetailPageApi)), { relatedProducts: ((_b = (_a = productDetailPageApi.related_products) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatProduct).filter(isDefined)) || [], bestsellerProducts: ((_d = (_c = productDetailPageApi.bestseller_products) === null || _c === void 0 ? void 0 : _c.map) === null || _d === void 0 ? void 0 : _d.call(_c, dataFormatter.formatProduct).filter(isDefined)) || [], viewedProducts: ((_f = (_e = productDetailPageApi.viewed_products) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, dataFormatter.formatProduct).filter(isDefined)) || [], promotions: ((_h = (_g = productDetailPageApi.promotions) === null || _g === void 0 ? void 0 : _g.map) === null || _h === void 0 ? void 0 : _h.call(_g, dataFormatter.formatPromotion).filter(isDefined)) || [] });
332
+ },
333
+ formatProductReview: (productReview) => {
334
+ var _a, _b;
335
+ if (!productReview)
336
+ return null;
337
+ // TODO: avatar, images
338
+ return {
339
+ reviewId: productReview.review_id || '',
340
+ createdAt: productReview.created_at || '',
341
+ title: productReview.title || '',
342
+ detail: productReview.detail || '',
343
+ nickname: productReview.nick_name || '',
344
+ avatar: productReview.avatar || '',
345
+ ratingVotes: ((_b = (_a = productReview.rating_votes) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (vote) => {
346
+ return {
347
+ ratingCode: vote.rating_code || '',
348
+ value: Number(vote.value) || 0,
349
+ percent: Number(vote.percent) || 0,
350
+ };
351
+ })) || [],
352
+ images: productReview.images || [],
353
+ };
354
+ },
355
+ formatProductPromotion: (productPromotionApi) => {
356
+ if (!productPromotionApi)
357
+ return null;
358
+ return {
359
+ id: productPromotionApi.id || 0,
360
+ name: productPromotionApi.name || '',
361
+ thumbnail: productPromotionApi.thumbnail || '',
362
+ expirationDate: productPromotionApi.expiration_date || '',
363
+ };
364
+ },
365
+ formatPromotion: (promotionApi) => {
366
+ if (!promotionApi)
367
+ return null;
368
+ return {
369
+ id: promotionApi.id || 0,
370
+ name: promotionApi.name || '',
371
+ slug: promotionApi.slug || '',
372
+ thumbnail: promotionApi.thumbnail || '',
373
+ expiredDate: promotionApi.expired_date || '',
374
+ banners: promotionApi.banners || [],
375
+ points: 0,
376
+ description: promotionApi.description || '',
377
+ metaTitle: promotionApi.meta_title || '',
378
+ metaKeywords: promotionApi.meta_keywords || '',
379
+ metaDescription: promotionApi.meta_description || '',
380
+ };
381
+ },
382
+ formatCustomAttributes: (customAttributesApi, type) => {
383
+ var _a;
384
+ if (!(customAttributesApi === null || customAttributesApi === void 0 ? void 0 : customAttributesApi.length))
385
+ return '';
386
+ return (((_a = customAttributesApi === null || customAttributesApi === void 0 ? void 0 : customAttributesApi.find((item) => item.attribute_code === type)) === null || _a === void 0 ? void 0 : _a.value) || '');
387
+ },
388
+ formatAddress: (addressApi) => {
389
+ var _a, _b, _c, _d;
390
+ if (!addressApi)
391
+ return null;
392
+ return {
393
+ id: addressApi.id || 0,
394
+ fullName: addressApi.firstname || '',
395
+ telephone: addressApi.telephone || '',
396
+ province: {
397
+ value: (_a = addressApi.region) === null || _a === void 0 ? void 0 : _a.region_id,
398
+ label: (_b = addressApi.region) === null || _b === void 0 ? void 0 : _b.region,
399
+ } || null,
400
+ district: {
401
+ value: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'district_id'),
402
+ label: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'district'),
403
+ },
404
+ commune: {
405
+ value: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'ward_id'),
406
+ label: dataFormatter.formatCustomAttributes(addressApi.custom_attributes, 'ward'),
407
+ },
408
+ street: ((_c = addressApi === null || addressApi === void 0 ? void 0 : addressApi.street) === null || _c === void 0 ? void 0 : _c.length) ? addressApi === null || addressApi === void 0 ? void 0 : addressApi.street[0] : '',
409
+ isDefault: (addressApi.default_billing && addressApi.default_shipping) || false,
410
+ fullAddress: ((_d = addressApi === null || addressApi === void 0 ? void 0 : addressApi.extension_attributes) === null || _d === void 0 ? void 0 : _d.full_address) || '',
411
+ };
412
+ },
413
+ formatProvince: (provinceApi) => {
414
+ if (!(provinceApi === null || provinceApi === void 0 ? void 0 : provinceApi.available_regions))
415
+ return [];
416
+ return provinceApi.available_regions.map((province) => ({
417
+ value: province.id || '',
418
+ label: province.name || '',
419
+ }));
420
+ },
421
+ formatDistrict: (districtApi) => {
422
+ if (!(districtApi === null || districtApi === void 0 ? void 0 : districtApi.districts))
423
+ return [];
424
+ return districtApi.districts.map((district) => ({
425
+ value: district.id || '',
426
+ label: district.name || '',
427
+ }));
428
+ },
429
+ formatCommune: (communeApi) => {
430
+ if (!(communeApi === null || communeApi === void 0 ? void 0 : communeApi.communes))
431
+ return [];
432
+ return communeApi.communes.map((commune) => ({
433
+ value: commune.id || '',
434
+ label: commune.name || '',
435
+ }));
436
+ },
437
+ formatOrder: (orderApi) => {
438
+ var _a, _b;
439
+ if (!orderApi)
440
+ return null;
441
+ return {
442
+ orderNumber: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.order_number) || '',
443
+ shippingData: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.shipping_data)
444
+ ? {
445
+ shippingMethod: orderApi.shipping_data.shipping_method || '',
446
+ shippingDescription: orderApi.shipping_data.shipping_description || '',
447
+ shippingAddress: orderApi.shipping_data.shipping_address
448
+ ? {
449
+ fullName: orderApi.shipping_data.shipping_address.firstname || '',
450
+ fullAddress: orderApi.shipping_data.shipping_address.full_address || '',
451
+ telephone: orderApi.shipping_data.shipping_address.telephone || '',
452
+ }
453
+ : null,
454
+ storeAddress: null,
455
+ }
456
+ : null,
457
+ orderedDate: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.ordered_date) || '',
458
+ status: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.status) || null,
459
+ totals: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.totals)
460
+ ? {
461
+ subtotal: orderApi.totals.subtotal || 0,
462
+ shippingAmount: orderApi.totals.shipping_amount || 0,
463
+ discountAmount: orderApi.totals.discount_amount || 0,
464
+ grandTotal: orderApi.totals.grand_total || 0,
465
+ }
466
+ : null,
467
+ products: ((_b = (_a = orderApi === null || orderApi === void 0 ? void 0 : orderApi.products) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (p) => ({
468
+ sku: p.sku || '',
469
+ name: p.name || '',
470
+ price: p.price || 0,
471
+ rowTotal: p.row_total || 0,
472
+ image: p.image || '',
473
+ qty: p.qty || 0,
474
+ }))) || [],
475
+ paymentMethod: (orderApi === null || orderApi === void 0 ? void 0 : orderApi.payment_method) || '',
476
+ };
477
+ },
478
+ formatStatistic: (statistic) => {
479
+ var _a, _b, _c, _d, _e;
480
+ if (!statistic)
481
+ return {};
482
+ return {
483
+ pending: Number((_a = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'pending')) === null || _a === void 0 ? void 0 : _a.amount) || 0,
484
+ processing: Number((_b = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'processing')) === null || _b === void 0 ? void 0 : _b.amount) || 0,
485
+ delivering: Number((_c = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'delivering')) === null || _c === void 0 ? void 0 : _c.amount) || 0,
486
+ complete: Number((_d = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'complete')) === null || _d === void 0 ? void 0 : _d.amount) || 0,
487
+ canceled: Number((_e = statistic === null || statistic === void 0 ? void 0 : statistic.find((stt) => stt.status === 'canceled')) === null || _e === void 0 ? void 0 : _e.amount) || 0,
488
+ };
489
+ },
490
+ formatCartItem: (cartItemApi) => {
491
+ var _a, _b, _c, _d, _e, _f, _g, _h;
492
+ if (!cartItemApi)
493
+ return null;
494
+ return {
495
+ itemId: cartItemApi.item_id || 0,
496
+ sku: cartItemApi.sku || '',
497
+ qty: cartItemApi.qty || 0,
498
+ name: cartItemApi.name || '',
499
+ price: cartItemApi.price || 0,
500
+ basePrice: ((_a = cartItemApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.base_price) || 0,
501
+ productType: cartItemApi.product_type || '',
502
+ quoteId: cartItemApi.quote_id || '',
503
+ thumbnail: ((_b = cartItemApi.extension_attributes) === null || _b === void 0 ? void 0 : _b.thumbnail) || '',
504
+ rowTotal: ((_c = cartItemApi.extension_attributes) === null || _c === void 0 ? void 0 : _c.row_total) || 0,
505
+ promotions: (((_f = (_e = (_d = cartItemApi.extension_attributes) === null || _d === void 0 ? void 0 : _d.promotions) === null || _e === void 0 ? void 0 : _e.map) === null || _f === void 0 ? void 0 : _f.call(_e, dataFormatter.formatProductPromotion)) || []),
506
+ isInStock: ((_g = cartItemApi.extension_attributes) === null || _g === void 0 ? void 0 : _g.is_in_stock) || false,
507
+ urlProduct: ((_h = cartItemApi.extension_attributes) === null || _h === void 0 ? void 0 : _h.url_key) || '',
508
+ };
509
+ },
510
+ formatCartAddress: (cartAddressApi) => {
511
+ var _a;
512
+ if (!cartAddressApi)
513
+ return null;
514
+ return {
515
+ customerAddressId: (cartAddressApi === null || cartAddressApi === void 0 ? void 0 : cartAddressApi.customer_address_id) || 0,
516
+ id: cartAddressApi.id || 0,
517
+ region: cartAddressApi.region || '',
518
+ regionId: cartAddressApi.region_id || 0,
519
+ regionCode: cartAddressApi.region_code || '',
520
+ countryId: cartAddressApi.country_id || '',
521
+ street: cartAddressApi.street || [],
522
+ postcode: cartAddressApi.postcode || '',
523
+ city: cartAddressApi.city || '',
524
+ firstname: cartAddressApi.firstname || '',
525
+ lastname: cartAddressApi.lastname || '',
526
+ customerId: cartAddressApi.customer_id || 0,
527
+ email: cartAddressApi.email || '',
528
+ telephone: cartAddressApi.telephone || '',
529
+ sameAsBilling: cartAddressApi.same_as_billing || 0,
530
+ saveInAddressBook: cartAddressApi.save_in_address_book || 0,
531
+ fullAddress: ((_a = cartAddressApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.full_address) || '',
532
+ };
533
+ },
534
+ formatEstimatedShipping: (estimatedShippingApi) => {
535
+ if (!estimatedShippingApi)
536
+ return null;
537
+ return {
538
+ carrierCode: estimatedShippingApi.carrier_code || '',
539
+ methodCode: estimatedShippingApi.method_code || '',
540
+ carrierTitle: estimatedShippingApi.carrier_title || '',
541
+ methodTitle: estimatedShippingApi.method_title || '',
542
+ amount: estimatedShippingApi.amount || 0,
543
+ baseAmount: estimatedShippingApi.base_amount || 0,
544
+ available: estimatedShippingApi.available || false,
545
+ errorMessage: estimatedShippingApi.error_message || '',
546
+ priceExclTax: estimatedShippingApi.price_excl_tax || 0,
547
+ priceInclTax: estimatedShippingApi.price_incl_tax || 0,
548
+ };
549
+ },
550
+ formatCartLoggedInCustomer: (cartLoggedInCustomerApi) => {
551
+ var _a, _b, _c;
552
+ if (!cartLoggedInCustomerApi)
553
+ return null;
554
+ return {
555
+ email: cartLoggedInCustomerApi.email || '',
556
+ firstname: cartLoggedInCustomerApi.firstname || '',
557
+ lastname: cartLoggedInCustomerApi.lastname || '',
558
+ id: cartLoggedInCustomerApi.id || 0,
559
+ groupId: cartLoggedInCustomerApi.group_id || 0,
560
+ createdAt: cartLoggedInCustomerApi.created_at || '',
561
+ updatedAt: cartLoggedInCustomerApi.updated_at || '',
562
+ createdIn: cartLoggedInCustomerApi.created_in || '',
563
+ storeId: cartLoggedInCustomerApi.store_id || 0,
564
+ websiteId: cartLoggedInCustomerApi.website_id || 0,
565
+ addresses: (((_b = (_a = cartLoggedInCustomerApi.addresses) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatCartAddress)) || []),
566
+ disableAutoGroupChange: cartLoggedInCustomerApi.disable_auto_group_change || 0,
567
+ isSubscribed: ((_c = cartLoggedInCustomerApi.extension_attributes) === null || _c === void 0 ? void 0 : _c.is_subscribed) || false,
568
+ };
569
+ },
570
+ formatCart: (cartApi) => {
571
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
572
+ if (!cartApi)
573
+ return null;
574
+ return {
575
+ id: cartApi.id || 0,
576
+ createdAt: cartApi.created_at || '',
577
+ updatedAt: cartApi.updated_at || '',
578
+ isActive: cartApi.is_active || false,
579
+ isVirtual: cartApi.is_virtual || false,
580
+ items: (((_c = (_b = (_a = cartApi.items) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, dataFormatter.formatCartItem)) === null || _c === void 0 ? void 0 : _c.sort((a, b) => Number(b === null || b === void 0 ? void 0 : b.isInStock) - Number(a === null || a === void 0 ? void 0 : a.isInStock))) ||
581
+ []),
582
+ itemsCount: cartApi.items_count || 0,
583
+ itemsQty: cartApi.items_qty || 0,
584
+ customer: cartApi.customer
585
+ ? dataFormatter.formatCartLoggedInCustomer(cartApi.customer)
586
+ : null,
587
+ billingAddress: cartApi.billing_address
588
+ ? dataFormatter.formatCartAddress(cartApi.billing_address)
589
+ : null,
590
+ origOrderId: cartApi.orig_order_id || 0,
591
+ currency: {
592
+ globalCurrencyCode: ((_d = cartApi.currency) === null || _d === void 0 ? void 0 : _d.global_currency_code) || '',
593
+ baseCurrencyCode: ((_e = cartApi.currency) === null || _e === void 0 ? void 0 : _e.base_currency_code) || '',
594
+ storeCurrencyCode: ((_f = cartApi.currency) === null || _f === void 0 ? void 0 : _f.store_currency_code) || '',
595
+ quoteCurrencyCode: ((_g = cartApi.currency) === null || _g === void 0 ? void 0 : _g.quote_currency_code) || '',
596
+ storeToBaseRate: ((_h = cartApi.currency) === null || _h === void 0 ? void 0 : _h.store_to_base_rate) || 0,
597
+ storeToQuoteRate: ((_j = cartApi.currency) === null || _j === void 0 ? void 0 : _j.store_to_quote_rate) || 0,
598
+ baseToGlobalRate: ((_k = cartApi.currency) === null || _k === void 0 ? void 0 : _k.base_to_global_rate) || 0,
599
+ baseToQuoteRate: ((_l = cartApi.currency) === null || _l === void 0 ? void 0 : _l.base_to_quote_rate) || 0,
600
+ },
601
+ customerIsGuest: cartApi.customer_is_guest || false,
602
+ customerNoteNotify: cartApi.customer_note_notify || false,
603
+ customerTaxClassId: cartApi.customer_tax_class_id || 0,
604
+ storeId: cartApi.store_id || 0,
605
+ shippingAssignments: (_p = (_o = (_m = cartApi.extension_attributes) === null || _m === void 0 ? void 0 : _m.shipping_assignments) === null || _o === void 0 ? void 0 : _o.map) === null || _p === void 0 ? void 0 : _p.call(_o, (s) => {
606
+ var _a, _b, _c;
607
+ return ({
608
+ shipping: {
609
+ address: s.shipping.address
610
+ ? dataFormatter.formatCartAddress(s.shipping.address)
611
+ : null,
612
+ method: ((_a = s.shipping) === null || _a === void 0 ? void 0 : _a.method) || '',
613
+ },
614
+ items: (((_c = (_b = s.items).map) === null || _c === void 0 ? void 0 : _c.call(_b, dataFormatter.formatCartItem)) ||
615
+ []),
616
+ });
617
+ }),
618
+ };
619
+ },
620
+ formatCartTotal: (cartTotalApi) => {
621
+ var _a, _b, _c;
622
+ if (!cartTotalApi)
623
+ return null;
624
+ return {
625
+ grandTotal: cartTotalApi.grand_total || 0,
626
+ baseGrandTotal: cartTotalApi.base_grand_total || 0,
627
+ subtotal: cartTotalApi.subtotal || 0,
628
+ baseSubtotal: cartTotalApi.base_subtotal || 0,
629
+ discountAmount: cartTotalApi.discount_amount || 0,
630
+ baseDiscountAmount: cartTotalApi.base_discount_amount || 0,
631
+ subtotalWithDiscount: cartTotalApi.subtotal_with_discount || 0,
632
+ baseSubtotalWithDiscount: cartTotalApi.base_subtotal_with_discount || 0,
633
+ shippingAmount: cartTotalApi.shipping_amount || 0,
634
+ baseShippingAmount: cartTotalApi.base_shipping_amount || 0,
635
+ shippingDiscountAmount: cartTotalApi.shipping_discount_amount || 0,
636
+ baseShippingDiscountAmount: cartTotalApi.base_shipping_discount_amount || 0,
637
+ taxAmount: cartTotalApi.tax_amount || 0,
638
+ baseTaxAmount: cartTotalApi.base_tax_amount || 0,
639
+ weeeTaxAppliedAmount: cartTotalApi.weee_tax_applied_amount || 0,
640
+ shippingTaxAmount: cartTotalApi.shipping_tax_amount || 0,
641
+ baseShippingTaxAmount: cartTotalApi.base_shipping_tax_amount || 0,
642
+ subtotalInclTax: cartTotalApi.subtotal_incl_tax || 0,
643
+ shippingInclTax: cartTotalApi.shipping_incl_tax || 0,
644
+ baseShippingInclTax: cartTotalApi.base_shipping_incl_tax || 0,
645
+ baseCurrencyCode: cartTotalApi.base_currency_code || '',
646
+ quoteCurrencyCode: cartTotalApi.quote_currency_code || '',
647
+ itemsQty: cartTotalApi.items_qty || 0,
648
+ coupon: {
649
+ couponCode: cartTotalApi.coupon_code || '',
650
+ couponDescription: ((_a = cartTotalApi === null || cartTotalApi === void 0 ? void 0 : cartTotalApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.coupon_description_text) || '',
651
+ },
652
+ items: ((_c = (_b = cartTotalApi.items) === null || _b === void 0 ? void 0 : _b.map) === null || _c === void 0 ? void 0 : _c.call(_b, (item) => ({
653
+ itemId: item.item_id || 0,
654
+ price: item.price || 0,
655
+ basePrice: item.base_price || 0,
656
+ qty: item.qty || 0,
657
+ rowTotal: item.row_total || 0,
658
+ baseRowTotal: item.base_row_total || 0,
659
+ rowTotalWithDiscount: item.row_total_with_discount || 0,
660
+ taxAmount: item.tax_amount || 0,
661
+ baseTaxAmount: item.base_tax_amount || 0,
662
+ taxPercent: item.tax_percent || 0,
663
+ discountAmount: item.discount_amount || 0,
664
+ baseDiscountAmount: item.base_discount_amount || 0,
665
+ discountPercent: item.discount_percent || 0,
666
+ priceInclTax: item.price_incl_tax || 0,
667
+ basePriceInclTax: item.base_price_incl_tax || 0,
668
+ rowTotalInclTax: item.row_total_incl_tax || 0,
669
+ baseRowTotalInclTax: item.base_row_total_incl_tax || 0,
670
+ options: item.options || '',
671
+ weeeTaxAppliedAmount: item.weee_tax_applied_amount || 0,
672
+ weeeTaxApplied: item.weee_tax_applied || 0,
673
+ name: item.name || '',
674
+ }))) || [],
675
+ totalSegments: cartTotalApi.total_segments || [],
676
+ };
677
+ },
678
+ formatPaymentMethod: (methods) => {
679
+ if (!methods)
680
+ return null;
681
+ return methods === null || methods === void 0 ? void 0 : methods.map((method) => ({
682
+ code: (method === null || method === void 0 ? void 0 : method.payment_code) || '',
683
+ title: (method === null || method === void 0 ? void 0 : method.payment_title) || '',
684
+ thumbnail: (method === null || method === void 0 ? void 0 : method.payment_thumbnail) || '',
685
+ }));
686
+ },
687
+ formatPaymentInformation: (paymentInformationApi) => {
688
+ var _a;
689
+ if (!paymentInformationApi)
690
+ return null;
691
+ return {
692
+ paymentMethods: dataFormatter.formatPaymentMethod((_a = paymentInformationApi === null || paymentInformationApi === void 0 ? void 0 : paymentInformationApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.payment_detail_info) || [],
693
+ totals: dataFormatter.formatCartTotal(paymentInformationApi.totals),
694
+ };
695
+ },
696
+ formatOrderConfirmation: (orderConfirmationApi) => {
697
+ if (!orderConfirmationApi)
698
+ return null;
699
+ return {
700
+ isSuccess: orderConfirmationApi.is_success || false,
701
+ orderInfo: dataFormatter.formatOrder(orderConfirmationApi.order_info),
702
+ };
703
+ },
704
+ formatCoupons: (couponListApi) => {
705
+ var _a;
706
+ if (!((_a = couponListApi === null || couponListApi === void 0 ? void 0 : couponListApi.items) === null || _a === void 0 ? void 0 : _a.length))
707
+ return null;
708
+ return couponListApi.items.map((couponApi) => ({
709
+ code: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.code) || '',
710
+ name: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.name) || '',
711
+ thumbnail: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.thumbnail) || '',
712
+ description: (couponApi === null || couponApi === void 0 ? void 0 : couponApi.expired_date) || '',
713
+ }));
714
+ },
715
+ formatShippings: (shippingsApi) => {
716
+ if (!shippingsApi)
717
+ return [];
718
+ return shippingsApi.map((shippingApi) => {
719
+ var _a;
720
+ return ({
721
+ carrierCode: shippingApi.carrier_code || '',
722
+ methodCode: shippingApi.method_code || '',
723
+ title: shippingApi.carrier_title || '',
724
+ description: shippingApi.method_title || '',
725
+ price: (shippingApi === null || shippingApi === void 0 ? void 0 : shippingApi.base_amount) || 0,
726
+ thumbnail: ((_a = shippingApi === null || shippingApi === void 0 ? void 0 : shippingApi.extension_attributes) === null || _a === void 0 ? void 0 : _a.thumbnail) || '',
727
+ });
728
+ });
729
+ },
730
+ };
731
+
732
+ var index = /*#__PURE__*/Object.freeze({
733
+ __proto__: null,
734
+ dataFormatter: dataFormatter
735
+ });
736
+
737
+ export { apiTypes as ApiTypes, index as DataFormatter, dataTypes as DataTypes };