@wix/himalaya-cli 0.1851.0 → 0.1853.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 (510) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +5 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +13 -3
  3. package/dist/browser-plane/assets.json +5 -5
  4. package/dist/browser-plane/preview-deferred/{166f7ee733ea8d0fe7bba8b796232efd4f5413e22af4a8aeee20cae1069b2fd6.bin → fb500748f6c4768468f2e7f985aa67c38633077c7a98caaa6b500c7b00eea8e9.bin} +1 -1
  5. package/dist/browser-plane/sw.js +7 -7
  6. package/dist/cli.mjs +10136 -9601
  7. package/dist/preview-assets.generated.bin +0 -0
  8. package/guides/component-index.md +1 -1
  9. package/guides/component-reference.json +2 -2
  10. package/guides/component-reference.md +8 -1
  11. package/guides/designing-himi-screens.md +5 -1
  12. package/guides/himi-json-output.md +13 -3
  13. package/guides/one-app-section-mappings.md +1 -1
  14. package/guides/one-app-to-himi-app.md +60 -10
  15. package/guides/sdk-reference.json +2 -2
  16. package/package.json +2 -2
  17. package/template-icons/bare-fashion.png +0 -0
  18. package/templates/bare-fashion/README.md +52 -0
  19. package/templates/bare-fashion/config.ts +474 -0
  20. package/templates/bare-fashion/dev/index.ts +16526 -0
  21. package/templates/bare-fashion/himalaya.content.json +70 -0
  22. package/templates/bare-fashion/himalaya.template.json +18 -0
  23. package/templates/bare-fashion/icon.png +0 -0
  24. package/templates/bare-fashion/platforms.json +3 -0
  25. package/templates/bare-fashion/tier5-src/_shared/app-locale.ts +70 -0
  26. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-address-book.ts +116 -0
  27. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-address-countries.ts +261 -0
  28. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-bag-count.ts +24 -0
  29. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-categories.ts +48 -0
  30. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-facets.ts +265 -0
  31. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-load-error.ts +38 -0
  32. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-product-card.ts +136 -0
  33. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-store-options.ts +129 -0
  34. package/templates/bare-fashion/tier5-src/_shared/branded-lite-hosted.ts +282 -0
  35. package/templates/bare-fashion/tier5-src/_shared/collection-contract.ts +228 -0
  36. package/templates/bare-fashion/tier5-src/_shared/collection-query.ts +201 -0
  37. package/templates/bare-fashion/tier5-src/_shared/collection-service.ts +429 -0
  38. package/templates/bare-fashion/tier5-src/_shared/engine-intl.ts +529 -0
  39. package/templates/bare-fashion/tier5-src/_shared/himi-account.ts +209 -0
  40. package/templates/bare-fashion/tier5-src/_shared/himi-copy.ts +123 -0
  41. package/templates/bare-fashion/tier5-src/_shared/himi-layouts.ts +142 -0
  42. package/templates/bare-fashion/tier5-src/_shared/himi-store-categories.ts +108 -0
  43. package/templates/bare-fashion/tier5-src/_shared/himi-store-saved.ts +57 -0
  44. package/templates/bare-fashion/tier5-src/_shared/himi-store.ts +7 -0
  45. package/templates/bare-fashion/tier5-src/_shared/himi-text.ts +24 -0
  46. package/templates/bare-fashion/tier5-src/_shared/hosted-checkout.ts +70 -0
  47. package/templates/bare-fashion/tier5-src/_shared/live-session.ts +172 -0
  48. package/templates/bare-fashion/tier5-src/_shared/local-preferences.ts +38 -0
  49. package/templates/bare-fashion/tier5-src/_shared/member-access.ts +63 -0
  50. package/templates/bare-fashion/tier5-src/_shared/member-avatar.ts +76 -0
  51. package/templates/bare-fashion/tier5-src/_shared/member-orders.ts +8 -0
  52. package/templates/bare-fashion/tier5-src/_shared/online-actions.ts +76 -0
  53. package/templates/bare-fashion/tier5-src/_shared/owner-load-error.ts +348 -0
  54. package/templates/bare-fashion/tier5-src/himi-bare-fashion-account/index.ts +127 -0
  55. package/templates/bare-fashion/tier5-src/himi-bare-fashion-address-form/index.ts +367 -0
  56. package/templates/bare-fashion/tier5-src/himi-bare-fashion-addresses/index.ts +202 -0
  57. package/templates/bare-fashion/tier5-src/himi-bare-fashion-appearance/index.ts +73 -0
  58. package/templates/bare-fashion/tier5-src/himi-bare-fashion-cart/index.ts +540 -0
  59. package/templates/bare-fashion/tier5-src/himi-bare-fashion-collection/index.ts +111 -0
  60. package/templates/bare-fashion/tier5-src/himi-bare-fashion-home/index.ts +241 -0
  61. package/templates/bare-fashion/tier5-src/himi-bare-fashion-nav/index.ts +56 -0
  62. package/templates/bare-fashion/tier5-src/himi-bare-fashion-order/index.ts +437 -0
  63. package/templates/bare-fashion/tier5-src/himi-bare-fashion-product/index.ts +650 -0
  64. package/templates/bare-fashion/tier5-src/himi-bare-fashion-products/index.ts +142 -0
  65. package/templates/bare-fashion/tier5-src/himi-bare-fashion-saved/index.ts +45 -0
  66. package/templates/bare-fashion/tier5-src/himi-bare-fashion-search/index.ts +199 -0
  67. package/templates/bare-fashion/tier5-src/himi-bare-fashion-shop/index.ts +79 -0
  68. package/templates/bare-fashion/tier5-src/himi-bare-fashion-sign-in/index.ts +269 -0
  69. package/templates/bare-fashion/tier5-src/himi-bare-fashion-wallet/index.ts +224 -0
  70. package/templates/bare-fashion/tier5-src/himi-branded-lite-info/index.ts +209 -0
  71. package/templates/bare-fashion/tier5-src/himi-branded-lite-orders/index.ts +327 -0
  72. package/templates/bare-fashion/tier5-src/wix-spaces-collections/index.ts +48 -0
  73. package/templates/bare-fashion/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  74. package/templates/bare-fashion/tier5-src/wix-spaces-view-profile/index.ts +119 -0
  75. package/templates/bare-fashion/tokens.json +348 -0
  76. package/templates/beauty-salon/dev/index.ts +223 -0
  77. package/templates/beauty-salon/l10n/ar.json +6 -0
  78. package/templates/beauty-salon/l10n/cs.json +6 -0
  79. package/templates/beauty-salon/l10n/da.json +6 -0
  80. package/templates/beauty-salon/l10n/de.json +6 -0
  81. package/templates/beauty-salon/l10n/el.json +6 -0
  82. package/templates/beauty-salon/l10n/en.json +9 -2
  83. package/templates/beauty-salon/l10n/es.json +6 -0
  84. package/templates/beauty-salon/l10n/fi.json +6 -0
  85. package/templates/beauty-salon/l10n/fr.json +6 -0
  86. package/templates/beauty-salon/l10n/he.json +5 -0
  87. package/templates/beauty-salon/l10n/hu.json +6 -0
  88. package/templates/beauty-salon/l10n/id.json +6 -0
  89. package/templates/beauty-salon/l10n/it.json +6 -0
  90. package/templates/beauty-salon/l10n/ja.json +6 -0
  91. package/templates/beauty-salon/l10n/ko.json +6 -0
  92. package/templates/beauty-salon/l10n/lt.json +6 -0
  93. package/templates/beauty-salon/l10n/nl.json +6 -0
  94. package/templates/beauty-salon/l10n/no.json +6 -0
  95. package/templates/beauty-salon/l10n/pl.json +6 -0
  96. package/templates/beauty-salon/l10n/pt.json +6 -0
  97. package/templates/beauty-salon/l10n/ru.json +6 -0
  98. package/templates/beauty-salon/l10n/sv.json +6 -0
  99. package/templates/beauty-salon/l10n/th.json +6 -0
  100. package/templates/beauty-salon/l10n/tr.json +6 -0
  101. package/templates/beauty-salon/l10n/uk.json +6 -0
  102. package/templates/beauty-salon/l10n/vi.json +6 -0
  103. package/templates/beauty-salon/l10n/zh.json +6 -0
  104. package/templates/beauty-salon/tier5-src/_shared/collection-query.ts +8 -0
  105. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +7 -1
  106. package/templates/beauty-salon/tier5-src/_shared/lifecycle.ts +15 -0
  107. package/templates/beauty-salon/tier5-src/_shared/nav-member-avatar.ts +92 -0
  108. package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  109. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +26 -1
  110. package/templates/beauty-salon-owner/tier5-src/_shared/collection-query.ts +8 -0
  111. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +7 -1
  112. package/templates/branded-lite/dev/index.ts +2167 -0
  113. package/templates/branded-lite/l10n/ar.json +6 -0
  114. package/templates/branded-lite/l10n/cs.json +6 -0
  115. package/templates/branded-lite/l10n/da.json +6 -0
  116. package/templates/branded-lite/l10n/de.json +6 -0
  117. package/templates/branded-lite/l10n/el.json +6 -0
  118. package/templates/branded-lite/l10n/en.json +12 -5
  119. package/templates/branded-lite/l10n/es.json +6 -0
  120. package/templates/branded-lite/l10n/fi.json +6 -0
  121. package/templates/branded-lite/l10n/fr.json +6 -0
  122. package/templates/branded-lite/l10n/he.json +5 -0
  123. package/templates/branded-lite/l10n/hu.json +6 -0
  124. package/templates/branded-lite/l10n/id.json +6 -0
  125. package/templates/branded-lite/l10n/it.json +6 -0
  126. package/templates/branded-lite/l10n/ja.json +6 -0
  127. package/templates/branded-lite/l10n/ko.json +6 -0
  128. package/templates/branded-lite/l10n/lt.json +6 -0
  129. package/templates/branded-lite/l10n/nl.json +6 -0
  130. package/templates/branded-lite/l10n/no.json +6 -0
  131. package/templates/branded-lite/l10n/pl.json +6 -0
  132. package/templates/branded-lite/l10n/pt.json +6 -0
  133. package/templates/branded-lite/l10n/ru.json +6 -0
  134. package/templates/branded-lite/l10n/sv.json +6 -0
  135. package/templates/branded-lite/l10n/th.json +6 -0
  136. package/templates/branded-lite/l10n/tr.json +6 -0
  137. package/templates/branded-lite/l10n/uk.json +6 -0
  138. package/templates/branded-lite/l10n/vi.json +6 -0
  139. package/templates/branded-lite/l10n/zh.json +6 -0
  140. package/templates/branded-lite/recipes/upcoming-bookings.json +118 -6
  141. package/templates/branded-lite/tier5-src/_shared/access-gates.ts +0 -13
  142. package/templates/branded-lite/tier5-src/_shared/collection-query-legacy.ts +7 -0
  143. package/templates/branded-lite/tier5-src/_shared/collection-query.ts +7 -0
  144. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +7 -1
  145. package/templates/branded-lite/tier5-src/_shared/events-inline-options.ts +55 -3
  146. package/templates/branded-lite/tier5-src/_shared/events-inline.ts +5 -3
  147. package/templates/branded-lite/tier5-src/_shared/guest-sign-in.ts +36 -0
  148. package/templates/branded-lite/tier5-src/_shared/lifecycle.ts +15 -0
  149. package/templates/branded-lite/tier5-src/_shared/nav-member-avatar.ts +92 -0
  150. package/templates/branded-lite/tier5-src/_shared/upcoming-bookings-section.ts +15 -4
  151. package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +14 -9
  152. package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +6 -1
  153. package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  154. package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  155. package/templates/branded-lite/tier5-src/himi-events-list/index.ts +17 -0
  156. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +26 -1
  157. package/templates/brandy/tier5-src/_shared/collection-query-legacy.ts +7 -0
  158. package/templates/brandy/tier5-src/_shared/collection-query.ts +7 -0
  159. package/templates/brandy/tier5-src/_shared/collection-service.ts +7 -1
  160. package/templates/brandy/tier5-src/_shared/guest-sign-in.ts +36 -0
  161. package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +6 -1
  162. package/templates/brandy/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  163. package/templates/brandy/tier5-src/himi-store-account/index.ts +26 -1
  164. package/templates/community-club/dev/index.ts +223 -0
  165. package/templates/community-club/l10n/ar.json +6 -0
  166. package/templates/community-club/l10n/cs.json +6 -0
  167. package/templates/community-club/l10n/da.json +6 -0
  168. package/templates/community-club/l10n/de.json +6 -0
  169. package/templates/community-club/l10n/el.json +6 -0
  170. package/templates/community-club/l10n/en.json +9 -2
  171. package/templates/community-club/l10n/es.json +6 -0
  172. package/templates/community-club/l10n/fi.json +6 -0
  173. package/templates/community-club/l10n/fr.json +6 -0
  174. package/templates/community-club/l10n/he.json +5 -0
  175. package/templates/community-club/l10n/hu.json +6 -0
  176. package/templates/community-club/l10n/id.json +6 -0
  177. package/templates/community-club/l10n/it.json +6 -0
  178. package/templates/community-club/l10n/ja.json +6 -0
  179. package/templates/community-club/l10n/ko.json +6 -0
  180. package/templates/community-club/l10n/lt.json +6 -0
  181. package/templates/community-club/l10n/nl.json +6 -0
  182. package/templates/community-club/l10n/no.json +6 -0
  183. package/templates/community-club/l10n/pl.json +6 -0
  184. package/templates/community-club/l10n/pt.json +6 -0
  185. package/templates/community-club/l10n/ru.json +6 -0
  186. package/templates/community-club/l10n/sv.json +6 -0
  187. package/templates/community-club/l10n/th.json +6 -0
  188. package/templates/community-club/l10n/tr.json +6 -0
  189. package/templates/community-club/l10n/uk.json +6 -0
  190. package/templates/community-club/l10n/vi.json +6 -0
  191. package/templates/community-club/l10n/zh.json +6 -0
  192. package/templates/community-club/tier5-src/_shared/collection-query.ts +8 -0
  193. package/templates/community-club/tier5-src/_shared/collection-service.ts +7 -1
  194. package/templates/community-club/tier5-src/_shared/events-inline-options.ts +77 -0
  195. package/templates/community-club/tier5-src/himi-events-list/index.ts +17 -0
  196. package/templates/community-club/tier5-src/himi-store-account/index.ts +26 -1
  197. package/templates/community-club-owner/tier5-src/_shared/collection-query.ts +8 -0
  198. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +7 -1
  199. package/templates/conference/tier5-src/_shared/collection-query.ts +8 -0
  200. package/templates/conference/tier5-src/_shared/collection-service.ts +7 -1
  201. package/templates/conference/tier5-src/_shared/events-inline-options.ts +77 -0
  202. package/templates/conference/tier5-src/himi-events-list/index.ts +17 -0
  203. package/templates/conference/tier5-src/himi-store-account/index.ts +26 -1
  204. package/templates/events-meetups/dev/index.ts +142 -0
  205. package/templates/events-meetups/l10n/ar.json +6 -0
  206. package/templates/events-meetups/l10n/cs.json +6 -0
  207. package/templates/events-meetups/l10n/da.json +6 -0
  208. package/templates/events-meetups/l10n/de.json +6 -0
  209. package/templates/events-meetups/l10n/el.json +6 -0
  210. package/templates/events-meetups/l10n/en.json +8 -1
  211. package/templates/events-meetups/l10n/es.json +6 -0
  212. package/templates/events-meetups/l10n/fi.json +6 -0
  213. package/templates/events-meetups/l10n/fr.json +6 -0
  214. package/templates/events-meetups/l10n/he.json +5 -0
  215. package/templates/events-meetups/l10n/hu.json +6 -0
  216. package/templates/events-meetups/l10n/id.json +6 -0
  217. package/templates/events-meetups/l10n/it.json +6 -0
  218. package/templates/events-meetups/l10n/ja.json +6 -0
  219. package/templates/events-meetups/l10n/ko.json +6 -0
  220. package/templates/events-meetups/l10n/lt.json +6 -0
  221. package/templates/events-meetups/l10n/nl.json +6 -0
  222. package/templates/events-meetups/l10n/no.json +6 -0
  223. package/templates/events-meetups/l10n/pl.json +6 -0
  224. package/templates/events-meetups/l10n/pt.json +6 -0
  225. package/templates/events-meetups/l10n/ru.json +6 -0
  226. package/templates/events-meetups/l10n/sv.json +6 -0
  227. package/templates/events-meetups/l10n/th.json +6 -0
  228. package/templates/events-meetups/l10n/tr.json +6 -0
  229. package/templates/events-meetups/l10n/uk.json +6 -0
  230. package/templates/events-meetups/l10n/vi.json +6 -0
  231. package/templates/events-meetups/l10n/zh.json +6 -0
  232. package/templates/events-meetups/tier5-src/_shared/collection-query.ts +8 -0
  233. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +7 -1
  234. package/templates/events-meetups/tier5-src/_shared/events-inline-options.ts +77 -0
  235. package/templates/events-meetups/tier5-src/himi-events-list/index.ts +17 -0
  236. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +26 -1
  237. package/templates/events-meetups-owner/tier5-src/_shared/collection-query.ts +8 -0
  238. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +7 -1
  239. package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +8 -0
  240. package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +7 -1
  241. package/templates/fitness-gym/tier5-src/_shared/guest-sign-in.ts +36 -0
  242. package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  243. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +26 -1
  244. package/templates/gym-fitness/dev/index.ts +385 -0
  245. package/templates/gym-fitness/l10n/ar.json +6 -0
  246. package/templates/gym-fitness/l10n/cs.json +6 -0
  247. package/templates/gym-fitness/l10n/da.json +6 -0
  248. package/templates/gym-fitness/l10n/de.json +6 -0
  249. package/templates/gym-fitness/l10n/el.json +6 -0
  250. package/templates/gym-fitness/l10n/en.json +9 -2
  251. package/templates/gym-fitness/l10n/es.json +6 -0
  252. package/templates/gym-fitness/l10n/fi.json +6 -0
  253. package/templates/gym-fitness/l10n/fr.json +6 -0
  254. package/templates/gym-fitness/l10n/he.json +5 -0
  255. package/templates/gym-fitness/l10n/hu.json +6 -0
  256. package/templates/gym-fitness/l10n/id.json +6 -0
  257. package/templates/gym-fitness/l10n/it.json +6 -0
  258. package/templates/gym-fitness/l10n/ja.json +6 -0
  259. package/templates/gym-fitness/l10n/ko.json +6 -0
  260. package/templates/gym-fitness/l10n/lt.json +6 -0
  261. package/templates/gym-fitness/l10n/nl.json +6 -0
  262. package/templates/gym-fitness/l10n/no.json +6 -0
  263. package/templates/gym-fitness/l10n/pl.json +6 -0
  264. package/templates/gym-fitness/l10n/pt.json +6 -0
  265. package/templates/gym-fitness/l10n/ru.json +6 -0
  266. package/templates/gym-fitness/l10n/sv.json +6 -0
  267. package/templates/gym-fitness/l10n/th.json +6 -0
  268. package/templates/gym-fitness/l10n/tr.json +6 -0
  269. package/templates/gym-fitness/l10n/uk.json +6 -0
  270. package/templates/gym-fitness/l10n/vi.json +6 -0
  271. package/templates/gym-fitness/l10n/zh.json +6 -0
  272. package/templates/gym-fitness/tier5-src/_shared/collection-query.ts +8 -0
  273. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +7 -1
  274. package/templates/gym-fitness/tier5-src/_shared/events-inline-options.ts +77 -0
  275. package/templates/gym-fitness/tier5-src/_shared/lifecycle.ts +15 -0
  276. package/templates/gym-fitness/tier5-src/_shared/nav-member-avatar.ts +92 -0
  277. package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  278. package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +17 -0
  279. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +26 -1
  280. package/templates/gym-fitness-owner/tier5-src/_shared/collection-query.ts +8 -0
  281. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +7 -1
  282. package/templates/medical-services/tier5-src/_shared/collection-query.ts +8 -0
  283. package/templates/medical-services/tier5-src/_shared/collection-service.ts +7 -1
  284. package/templates/medical-services/tier5-src/_shared/guest-sign-in.ts +36 -0
  285. package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  286. package/templates/medical-services/tier5-src/himi-store-account/index.ts +26 -1
  287. package/templates/nonprofit-cause/dev/index.ts +223 -0
  288. package/templates/nonprofit-cause/l10n/ar.json +6 -0
  289. package/templates/nonprofit-cause/l10n/cs.json +6 -0
  290. package/templates/nonprofit-cause/l10n/da.json +6 -0
  291. package/templates/nonprofit-cause/l10n/de.json +6 -0
  292. package/templates/nonprofit-cause/l10n/el.json +6 -0
  293. package/templates/nonprofit-cause/l10n/en.json +8 -1
  294. package/templates/nonprofit-cause/l10n/es.json +6 -0
  295. package/templates/nonprofit-cause/l10n/fi.json +6 -0
  296. package/templates/nonprofit-cause/l10n/fr.json +6 -0
  297. package/templates/nonprofit-cause/l10n/he.json +5 -0
  298. package/templates/nonprofit-cause/l10n/hu.json +6 -0
  299. package/templates/nonprofit-cause/l10n/id.json +6 -0
  300. package/templates/nonprofit-cause/l10n/it.json +6 -0
  301. package/templates/nonprofit-cause/l10n/ja.json +6 -0
  302. package/templates/nonprofit-cause/l10n/ko.json +6 -0
  303. package/templates/nonprofit-cause/l10n/lt.json +6 -0
  304. package/templates/nonprofit-cause/l10n/nl.json +6 -0
  305. package/templates/nonprofit-cause/l10n/no.json +6 -0
  306. package/templates/nonprofit-cause/l10n/pl.json +6 -0
  307. package/templates/nonprofit-cause/l10n/pt.json +6 -0
  308. package/templates/nonprofit-cause/l10n/ru.json +6 -0
  309. package/templates/nonprofit-cause/l10n/sv.json +6 -0
  310. package/templates/nonprofit-cause/l10n/th.json +6 -0
  311. package/templates/nonprofit-cause/l10n/tr.json +6 -0
  312. package/templates/nonprofit-cause/l10n/uk.json +6 -0
  313. package/templates/nonprofit-cause/l10n/vi.json +6 -0
  314. package/templates/nonprofit-cause/l10n/zh.json +6 -0
  315. package/templates/nonprofit-cause/tier5-src/_shared/collection-query.ts +8 -0
  316. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +7 -1
  317. package/templates/nonprofit-cause/tier5-src/_shared/events-inline-options.ts +77 -0
  318. package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +17 -0
  319. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +26 -1
  320. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-query.ts +8 -0
  321. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +7 -1
  322. package/templates/owner-lite/tier5-src/_shared/collection-query.ts +8 -0
  323. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +7 -1
  324. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +8 -0
  325. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +7 -1
  326. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +26 -1
  327. package/templates/podcast-creator/dev/index.ts +223 -0
  328. package/templates/podcast-creator/l10n/ar.json +6 -0
  329. package/templates/podcast-creator/l10n/cs.json +6 -0
  330. package/templates/podcast-creator/l10n/da.json +6 -0
  331. package/templates/podcast-creator/l10n/de.json +6 -0
  332. package/templates/podcast-creator/l10n/el.json +6 -0
  333. package/templates/podcast-creator/l10n/en.json +8 -1
  334. package/templates/podcast-creator/l10n/es.json +6 -0
  335. package/templates/podcast-creator/l10n/fi.json +6 -0
  336. package/templates/podcast-creator/l10n/fr.json +6 -0
  337. package/templates/podcast-creator/l10n/he.json +5 -0
  338. package/templates/podcast-creator/l10n/hu.json +6 -0
  339. package/templates/podcast-creator/l10n/id.json +6 -0
  340. package/templates/podcast-creator/l10n/it.json +6 -0
  341. package/templates/podcast-creator/l10n/ja.json +6 -0
  342. package/templates/podcast-creator/l10n/ko.json +6 -0
  343. package/templates/podcast-creator/l10n/lt.json +6 -0
  344. package/templates/podcast-creator/l10n/nl.json +6 -0
  345. package/templates/podcast-creator/l10n/no.json +6 -0
  346. package/templates/podcast-creator/l10n/pl.json +6 -0
  347. package/templates/podcast-creator/l10n/pt.json +6 -0
  348. package/templates/podcast-creator/l10n/ru.json +6 -0
  349. package/templates/podcast-creator/l10n/sv.json +6 -0
  350. package/templates/podcast-creator/l10n/th.json +6 -0
  351. package/templates/podcast-creator/l10n/tr.json +6 -0
  352. package/templates/podcast-creator/l10n/uk.json +6 -0
  353. package/templates/podcast-creator/l10n/vi.json +6 -0
  354. package/templates/podcast-creator/l10n/zh.json +6 -0
  355. package/templates/podcast-creator/tier5-src/_shared/collection-query.ts +8 -0
  356. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +7 -1
  357. package/templates/podcast-creator/tier5-src/_shared/events-inline-options.ts +77 -0
  358. package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +17 -0
  359. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +26 -1
  360. package/templates/podcast-creator-owner/tier5-src/_shared/collection-query.ts +8 -0
  361. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +7 -1
  362. package/templates/portfolio-creative/dev/index.ts +142 -0
  363. package/templates/portfolio-creative/l10n/ar.json +6 -0
  364. package/templates/portfolio-creative/l10n/cs.json +6 -0
  365. package/templates/portfolio-creative/l10n/da.json +6 -0
  366. package/templates/portfolio-creative/l10n/de.json +6 -0
  367. package/templates/portfolio-creative/l10n/el.json +6 -0
  368. package/templates/portfolio-creative/l10n/en.json +8 -1
  369. package/templates/portfolio-creative/l10n/es.json +6 -0
  370. package/templates/portfolio-creative/l10n/fi.json +6 -0
  371. package/templates/portfolio-creative/l10n/fr.json +6 -0
  372. package/templates/portfolio-creative/l10n/he.json +5 -0
  373. package/templates/portfolio-creative/l10n/hu.json +6 -0
  374. package/templates/portfolio-creative/l10n/id.json +6 -0
  375. package/templates/portfolio-creative/l10n/it.json +6 -0
  376. package/templates/portfolio-creative/l10n/ja.json +6 -0
  377. package/templates/portfolio-creative/l10n/ko.json +6 -0
  378. package/templates/portfolio-creative/l10n/lt.json +6 -0
  379. package/templates/portfolio-creative/l10n/nl.json +6 -0
  380. package/templates/portfolio-creative/l10n/no.json +6 -0
  381. package/templates/portfolio-creative/l10n/pl.json +6 -0
  382. package/templates/portfolio-creative/l10n/pt.json +6 -0
  383. package/templates/portfolio-creative/l10n/ru.json +6 -0
  384. package/templates/portfolio-creative/l10n/sv.json +6 -0
  385. package/templates/portfolio-creative/l10n/th.json +6 -0
  386. package/templates/portfolio-creative/l10n/tr.json +6 -0
  387. package/templates/portfolio-creative/l10n/uk.json +6 -0
  388. package/templates/portfolio-creative/l10n/vi.json +6 -0
  389. package/templates/portfolio-creative/l10n/zh.json +6 -0
  390. package/templates/portfolio-creative/tier5-src/_shared/collection-query.ts +8 -0
  391. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +7 -1
  392. package/templates/portfolio-creative/tier5-src/_shared/events-inline-options.ts +77 -0
  393. package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +17 -0
  394. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +26 -1
  395. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-query.ts +8 -0
  396. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +7 -1
  397. package/templates/restaurant/dev/index.ts +142 -0
  398. package/templates/restaurant/l10n/ar.json +6 -0
  399. package/templates/restaurant/l10n/cs.json +6 -0
  400. package/templates/restaurant/l10n/da.json +6 -0
  401. package/templates/restaurant/l10n/de.json +6 -0
  402. package/templates/restaurant/l10n/el.json +6 -0
  403. package/templates/restaurant/l10n/en.json +9 -2
  404. package/templates/restaurant/l10n/es.json +6 -0
  405. package/templates/restaurant/l10n/fi.json +6 -0
  406. package/templates/restaurant/l10n/fr.json +6 -0
  407. package/templates/restaurant/l10n/he.json +5 -0
  408. package/templates/restaurant/l10n/hu.json +6 -0
  409. package/templates/restaurant/l10n/id.json +6 -0
  410. package/templates/restaurant/l10n/it.json +6 -0
  411. package/templates/restaurant/l10n/ja.json +6 -0
  412. package/templates/restaurant/l10n/ko.json +6 -0
  413. package/templates/restaurant/l10n/lt.json +6 -0
  414. package/templates/restaurant/l10n/nl.json +6 -0
  415. package/templates/restaurant/l10n/no.json +6 -0
  416. package/templates/restaurant/l10n/pl.json +6 -0
  417. package/templates/restaurant/l10n/pt.json +6 -0
  418. package/templates/restaurant/l10n/ru.json +6 -0
  419. package/templates/restaurant/l10n/sv.json +6 -0
  420. package/templates/restaurant/l10n/th.json +6 -0
  421. package/templates/restaurant/l10n/tr.json +6 -0
  422. package/templates/restaurant/l10n/uk.json +6 -0
  423. package/templates/restaurant/l10n/vi.json +6 -0
  424. package/templates/restaurant/l10n/zh.json +6 -0
  425. package/templates/restaurant/tier5-src/_shared/collection-query.ts +8 -0
  426. package/templates/restaurant/tier5-src/_shared/collection-service.ts +7 -1
  427. package/templates/restaurant/tier5-src/_shared/events-inline-options.ts +77 -0
  428. package/templates/restaurant/tier5-src/himi-events-list/index.ts +17 -0
  429. package/templates/restaurant/tier5-src/himi-store-account/index.ts +26 -1
  430. package/templates/restaurant-owner/tier5-src/_shared/collection-query.ts +8 -0
  431. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +7 -1
  432. package/templates/retail-store/dev/index.ts +142 -0
  433. package/templates/retail-store/l10n/ar.json +6 -0
  434. package/templates/retail-store/l10n/cs.json +6 -0
  435. package/templates/retail-store/l10n/da.json +6 -0
  436. package/templates/retail-store/l10n/de.json +6 -0
  437. package/templates/retail-store/l10n/el.json +6 -0
  438. package/templates/retail-store/l10n/en.json +8 -1
  439. package/templates/retail-store/l10n/es.json +6 -0
  440. package/templates/retail-store/l10n/fi.json +6 -0
  441. package/templates/retail-store/l10n/fr.json +6 -0
  442. package/templates/retail-store/l10n/he.json +5 -0
  443. package/templates/retail-store/l10n/hu.json +6 -0
  444. package/templates/retail-store/l10n/id.json +6 -0
  445. package/templates/retail-store/l10n/it.json +6 -0
  446. package/templates/retail-store/l10n/ja.json +6 -0
  447. package/templates/retail-store/l10n/ko.json +6 -0
  448. package/templates/retail-store/l10n/lt.json +6 -0
  449. package/templates/retail-store/l10n/nl.json +6 -0
  450. package/templates/retail-store/l10n/no.json +6 -0
  451. package/templates/retail-store/l10n/pl.json +6 -0
  452. package/templates/retail-store/l10n/pt.json +6 -0
  453. package/templates/retail-store/l10n/ru.json +6 -0
  454. package/templates/retail-store/l10n/sv.json +6 -0
  455. package/templates/retail-store/l10n/th.json +6 -0
  456. package/templates/retail-store/l10n/tr.json +6 -0
  457. package/templates/retail-store/l10n/uk.json +6 -0
  458. package/templates/retail-store/l10n/vi.json +6 -0
  459. package/templates/retail-store/l10n/zh.json +6 -0
  460. package/templates/retail-store/tier5-src/_shared/collection-query-legacy.ts +7 -0
  461. package/templates/retail-store/tier5-src/_shared/collection-query.ts +7 -0
  462. package/templates/retail-store/tier5-src/_shared/collection-service.ts +7 -1
  463. package/templates/retail-store/tier5-src/himi-store-account/index.ts +26 -1
  464. package/templates/retail-store-owner/tier5-src/_shared/collection-query.ts +8 -0
  465. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +7 -1
  466. package/templates/salon-spa/tier5-src/_shared/collection-query.ts +8 -0
  467. package/templates/salon-spa/tier5-src/_shared/collection-service.ts +7 -1
  468. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +26 -1
  469. package/templates/wholesale-store/tier5-src/_shared/collection-query-legacy.ts +7 -0
  470. package/templates/wholesale-store/tier5-src/_shared/collection-query.ts +7 -0
  471. package/templates/wholesale-store/tier5-src/_shared/collection-service.ts +7 -1
  472. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +26 -1
  473. package/templates/yoga-studio/dev/index.ts +304 -0
  474. package/templates/yoga-studio/l10n/ar.json +6 -0
  475. package/templates/yoga-studio/l10n/cs.json +6 -0
  476. package/templates/yoga-studio/l10n/da.json +6 -0
  477. package/templates/yoga-studio/l10n/de.json +6 -0
  478. package/templates/yoga-studio/l10n/el.json +6 -0
  479. package/templates/yoga-studio/l10n/en.json +10 -3
  480. package/templates/yoga-studio/l10n/es.json +6 -0
  481. package/templates/yoga-studio/l10n/fi.json +6 -0
  482. package/templates/yoga-studio/l10n/fr.json +6 -0
  483. package/templates/yoga-studio/l10n/he.json +5 -0
  484. package/templates/yoga-studio/l10n/hu.json +6 -0
  485. package/templates/yoga-studio/l10n/id.json +6 -0
  486. package/templates/yoga-studio/l10n/it.json +6 -0
  487. package/templates/yoga-studio/l10n/ja.json +6 -0
  488. package/templates/yoga-studio/l10n/ko.json +6 -0
  489. package/templates/yoga-studio/l10n/lt.json +6 -0
  490. package/templates/yoga-studio/l10n/nl.json +6 -0
  491. package/templates/yoga-studio/l10n/no.json +6 -0
  492. package/templates/yoga-studio/l10n/pl.json +6 -0
  493. package/templates/yoga-studio/l10n/pt.json +6 -0
  494. package/templates/yoga-studio/l10n/ru.json +6 -0
  495. package/templates/yoga-studio/l10n/sv.json +6 -0
  496. package/templates/yoga-studio/l10n/th.json +6 -0
  497. package/templates/yoga-studio/l10n/tr.json +6 -0
  498. package/templates/yoga-studio/l10n/uk.json +6 -0
  499. package/templates/yoga-studio/l10n/vi.json +6 -0
  500. package/templates/yoga-studio/l10n/zh.json +6 -0
  501. package/templates/yoga-studio/tier5-src/_shared/collection-query.ts +8 -0
  502. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +7 -1
  503. package/templates/yoga-studio/tier5-src/_shared/events-inline-options.ts +77 -0
  504. package/templates/yoga-studio/tier5-src/_shared/lifecycle.ts +15 -0
  505. package/templates/yoga-studio/tier5-src/_shared/nav-member-avatar.ts +92 -0
  506. package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  507. package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +17 -0
  508. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +26 -1
  509. package/templates/yoga-studio-owner/tier5-src/_shared/collection-query.ts +8 -0
  510. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +7 -1
@@ -0,0 +1,540 @@
1
+ import { defineService } from "@himalaya/state";
2
+ import { createCheckoutFromCurrentCart, createOrder, getCurrentCart, removeLineItemsFromCurrentCart, updateLineItemsQuantity, wixCall, type WixCartLineItemDetail } from "@himalaya/wix-ecom";
3
+ import { createRedirectSession } from "@himalaya/wix-redirects";
4
+ import { session as wixPlatformSession } from "@himalaya/wix-platform";
5
+ import { payCashierOrder } from "@himalaya/checkout";
6
+
7
+ /** Wix Stores appDefId — the vertical that owns a cart/ecom order, and therefore the
8
+ * `appId` its cashier order is paid under. (Same constant Wix's own tooling uses.) */
9
+ const WIX_STORES_APP_ID = "1380b703-ce81-ff05-f115-39571d94dfcd";
10
+
11
+ /** The site's metaSiteId for the cashier payment config, or `ok: false` when the session cannot
12
+ * say. The native cashier can also resolve it from the app's signed Wix session, so the payment
13
+ * goes ahead without it. */
14
+ async function resolveMsid(): Promise<{ ok: true; msid: string } | { ok: false }> {
15
+ try {
16
+ const st = await wixPlatformSession.signedInstanceStatus();
17
+ return { ok: true, msid: st.msid ?? "" };
18
+ } catch {
19
+ return { ok: false };
20
+ }
21
+ }
22
+ /** Where the in-app cashier returns after payment: this app's own scheme, passed on load by the
23
+ * screen (`returnUrl`). Branded Lite's scheme is only the fallback for an older descriptor. */
24
+ let cashierReturnUrl = "himalaya-himi-branded-lite://screen/himi_cart";
25
+ function takeReturnUrl(arg: unknown): void {
26
+ const url = (arg as { returnUrl?: unknown } | undefined)?.returnUrl;
27
+ if (typeof url === "string" && /^[a-z][a-z0-9+.-]*:\/\/screen\/himi_cart$/.test(url)) cashierReturnUrl = url;
28
+ }
29
+ import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
30
+ import { getAll, upsert, remove as dbRemove, enqueue, type DbEntity } from "@himalaya/local-db";
31
+ import { isBridgeUnavailable } from "../_shared/owner-load-error.js";
32
+ import { publishBagCount } from "../_shared/bare-fashion-bag-count.js";
33
+ import { isProductSaved, toggleSavedProduct } from "../_shared/himi-store-saved.js";
34
+ import { errorFlags, errorKindOf, type ErrorKind } from "../_shared/bare-fashion-load-error.js";
35
+
36
+ // Offline-first (data-offline): the cart is READ-THROUGH — paint the last-synced line
37
+ // items from the on-device `cart` entity first (instant, works offline), then
38
+ // revalidate from Wix and refresh the cache. `remove` is WRITE-BEHIND — the line is
39
+ // dropped from the cache OPTIMISTICALLY, then the Wix write is attempted; if it can't
40
+ // reach the bridge/network the removal is ENQUEUED for replay on reconnect. The
41
+ // checkout redirect path is unchanged. Every local-db call is wrapped so a build
42
+ // without the `local_database` grant behaves exactly as before (online-only).
43
+ const ENTITY = "cart";
44
+ /** The cached lines, or `ok: false` when the cache cannot be read (no `local_database` grant):
45
+ * "no cache" is not "an empty cart". */
46
+ async function readCachedItems(): Promise<{ ok: true; rows: Row[] } | { ok: false }> {
47
+ try { return { ok: true, rows: (await getAll(ENTITY)) as unknown as Row[] }; } catch { return { ok: false }; }
48
+ }
49
+ /** Mirror the cart Wix answered: upsert its lines and drop every cached line it no longer has, so
50
+ * an offline load after a checkout or a removal never shows lines that are gone. */
51
+ async function writeCachedItems(rows: Row[]): Promise<void> {
52
+ try {
53
+ const keep = new Set(rows.map((r) => r.id));
54
+ for (const r of rows) await upsert(ENTITY, r as unknown as DbEntity);
55
+ for (const old of (await getAll(ENTITY)) as unknown as Row[]) if (!keep.has(old.id)) await dbRemove(ENTITY, old.id);
56
+ } catch { /* capability not granted → online-only */ }
57
+ }
58
+ async function cacheDrop(id: string): Promise<void> { try { await dbRemove(ENTITY, id); } catch { /* capability not granted */ } }
59
+ async function queueWrite(actionId: string, params: Record<string, string>): Promise<void> { try { await enqueue(actionId, params); } catch { /* capability not granted */ } }
60
+
61
+ interface Row {
62
+ id: string;
63
+ name: string;
64
+ title: string;
65
+ subtitle: string;
66
+ /** Numeric line quantity + its display string (the −/+ qty controls). */
67
+ quantity: number;
68
+ quantityLabel: string;
69
+ /** The "−" control at qty 1 removes the line, so it never dead-ends. */
70
+ atMinQuantity: boolean;
71
+ total: string;
72
+ image: string;
73
+ initial: string;
74
+ hasImage: boolean;
75
+ noImage: boolean;
76
+ /** Catalog product id — the wishlist key (same id the shop's hearts use). */
77
+ productId: string;
78
+ /** Up to three "Name: Value" option lines (Size: 38, Color: Brown); "" collapses. */
79
+ option1: string;
80
+ option2: string;
81
+ option3: string;
82
+ /** Stock line: "In Stock" (success) or "Out of stock" / "Only N left" (danger). */
83
+ stockLabel: string;
84
+ hideStockOk: boolean;
85
+ hideStockBad: boolean;
86
+ saved: boolean;
87
+ notSaved: boolean;
88
+ }
89
+ interface State {
90
+ status: "loading" | "ready" | "error";
91
+ items: Row[];
92
+ subtotal: string;
93
+ /** "Subtotal (3)" — the bag's total item quantity in brackets. */
94
+ subtotalLabel: string;
95
+ emptyText: string;
96
+ checkoutHint: string;
97
+ isLoading: boolean;
98
+ notLoading: boolean;
99
+ /** Standard error quad (the himi-store retryBlock contract): the descriptor
100
+ * gates its error card on notErrored and its content on hideContent, so a
101
+ * failed load shows the retry card instead of a blank list + blank subtotal. */
102
+ isErrored: boolean;
103
+ notErrored: boolean;
104
+ hideContent: boolean;
105
+ /** Why the last load failed: the error state shows the offline or the server variant. */
106
+ errorKind?: ErrorKind;
107
+ hideOfflineError?: boolean;
108
+ hideServerError?: boolean;
109
+ noEmpty: boolean;
110
+ noItems: boolean;
111
+ /** Banner visibility: hide the persistent-hint Banner while `checkoutHint` is "". */
112
+ hideCheckoutHint: boolean;
113
+ /** Promo code field text, the code Wix applied to the cart, and its discount. */
114
+ promoInput: string;
115
+ appliedCode: string;
116
+ appliedLabel: string;
117
+ discount: string;
118
+ promoError: string;
119
+ promoBusy: boolean;
120
+ /** The field + Apply show while no code is applied; the applied row shows after. */
121
+ hidePromoEntry: boolean;
122
+ hidePromoApplied: boolean;
123
+ hideDiscount: boolean;
124
+ /** The sticky promo + checkout footer shows only on a ready bag with items. */
125
+ hideFooter: boolean;
126
+ }
127
+
128
+ function itemId(arg: unknown): string {
129
+ if (typeof arg === "string") return arg;
130
+ return (arg as { id?: string } | undefined)?.id ?? "";
131
+ }
132
+
133
+ function mediaUrl(value: unknown): string {
134
+ if (!value || typeof value !== "object") return "";
135
+ const item = value as {
136
+ image?: { url?: string } | string;
137
+ media?: {
138
+ mainMedia?: { image?: { url?: string }; thumbnail?: { url?: string }; url?: string };
139
+ items?: Array<{ image?: { url?: string }; thumbnail?: { url?: string }; url?: string }>;
140
+ };
141
+ product?: {
142
+ image?: { url?: string } | string;
143
+ media?: {
144
+ mainMedia?: { image?: { url?: string }; thumbnail?: { url?: string }; url?: string };
145
+ items?: Array<{ image?: { url?: string }; thumbnail?: { url?: string }; url?: string }>;
146
+ };
147
+ };
148
+ };
149
+ const directImage = typeof item.image === "string" ? item.image : item.image?.url;
150
+ const productImage = typeof item.product?.image === "string" ? item.product.image : item.product?.image?.url;
151
+ return directImage
152
+ ?? item.media?.mainMedia?.image?.url
153
+ ?? item.media?.mainMedia?.thumbnail?.url
154
+ ?? item.media?.mainMedia?.url
155
+ ?? item.media?.items?.[0]?.image?.url
156
+ ?? item.media?.items?.[0]?.thumbnail?.url
157
+ ?? item.media?.items?.[0]?.url
158
+ ?? productImage
159
+ ?? item.product?.media?.mainMedia?.image?.url
160
+ ?? item.product?.media?.mainMedia?.thumbnail?.url
161
+ ?? item.product?.media?.mainMedia?.url
162
+ ?? item.product?.media?.items?.[0]?.image?.url
163
+ ?? item.product?.media?.items?.[0]?.thumbnail?.url
164
+ ?? item.product?.media?.items?.[0]?.url
165
+ ?? "";
166
+ }
167
+
168
+ /** The raw Wix line item carries more than the SDK type declares. */
169
+ interface LineExtras {
170
+ catalogReference?: { catalogItemId?: string };
171
+ descriptionLines?: Array<{
172
+ name?: { original?: string; translated?: string };
173
+ plainText?: { original?: string; translated?: string };
174
+ colorInfo?: { original?: string; translated?: string };
175
+ }>;
176
+ availability?: { status?: string; quantityAvailable?: number };
177
+ }
178
+
179
+ /** Option names can arrive in caps ("COLOR"); show the label as "Color". Values stay as the server sends them. */
180
+ function regularCaseLabel(label: string): string {
181
+ if (!label || label !== label.toUpperCase()) return label;
182
+ const lower = label.toLowerCase();
183
+ return lower.charAt(0).toUpperCase() + lower.slice(1);
184
+ }
185
+
186
+ function optionLines(item: LineExtras): string[] {
187
+ return (item.descriptionLines ?? [])
188
+ .map((line) => {
189
+ const label = line.name?.translated || line.name?.original || "";
190
+ const value = line.plainText?.translated || line.plainText?.original || line.colorInfo?.translated || line.colorInfo?.original || "";
191
+ if (!value) return "";
192
+ return label ? `${regularCaseLabel(label)}: ${value}` : value;
193
+ })
194
+ .filter(Boolean)
195
+ .slice(0, 3);
196
+ }
197
+
198
+ function stock(item: LineExtras): { label: string; ok: boolean } {
199
+ const status = item.availability?.status;
200
+ if (status === "AVAILABLE") return { label: copyParam("cart.inStock", "In Stock"), ok: true };
201
+ if (status === "PARTIALLY_AVAILABLE") {
202
+ const left = item.availability?.quantityAvailable ?? 0;
203
+ return { label: copyTemplate("cart.onlyLeft", "Only {count} left", { count: left }), ok: false };
204
+ }
205
+ if (status === "NOT_AVAILABLE" || status === "NOT_FOUND") return { label: copyParam("cart.outOfStock", "Out of stock"), ok: false };
206
+ return { label: "", ok: true };
207
+ }
208
+
209
+ function savedFlag(productId: string): boolean {
210
+ try { return productId ? isProductSaved(productId) : false; } catch { return false; }
211
+ }
212
+
213
+ function row(item: WixCartLineItemDetail, index: number): Row {
214
+ const quantity = item.quantity ?? 1;
215
+ const name = item.productName?.original || copyParam("cart.itemFallbackName", "Bag item");
216
+ const image = mediaUrl(item);
217
+ const extras = item as LineExtras;
218
+ const productId = extras.catalogReference?.catalogItemId ?? "";
219
+ const [option1 = "", option2 = "", option3 = ""] = optionLines(extras);
220
+ const st = stock(extras);
221
+ const saved = savedFlag(productId);
222
+ return {
223
+ productId,
224
+ option1,
225
+ option2,
226
+ option3,
227
+ stockLabel: st.label,
228
+ hideStockOk: !st.label || !st.ok,
229
+ hideStockBad: !st.label || st.ok,
230
+ saved,
231
+ notSaved: !saved,
232
+ id: item.id || `line-${index}`,
233
+ name,
234
+ title: name,
235
+ subtitle: copyTemplate("cart.quantityLine", "Qty {quantity}", { quantity }),
236
+ quantity,
237
+ quantityLabel: `${quantity}`,
238
+ atMinQuantity: quantity <= 1,
239
+ total: item.price?.formattedAmount ?? "",
240
+ image,
241
+ initial: (name.trim()[0] || "C").toUpperCase(),
242
+ hasImage: Boolean(image),
243
+ noImage: !image,
244
+ };
245
+ }
246
+
247
+ /** The cart fields the SDK type leaves out: the coupon Wix applied. */
248
+ interface CartExtras {
249
+ appliedDiscounts?: Array<{ coupon?: { code?: string } }>;
250
+ }
251
+ function couponCode(cart: unknown): string {
252
+ return (cart as CartExtras).appliedDiscounts?.find((d) => d.coupon?.code)?.coupon?.code ?? "";
253
+ }
254
+
255
+ /** PATCH /ecom/v1/carts/current {couponCode} — Wix rejects an unknown or expired code. */
256
+ function applyCoupon(code: string): Promise<unknown> {
257
+ return wixCall("PATCH", "/ecom/v1/carts/current", { couponCode: code });
258
+ }
259
+ /** POST /ecom/v1/carts/current/remove-coupon. */
260
+ function removeCoupon(): Promise<unknown> {
261
+ return wixCall("POST", "/ecom/v1/carts/current/remove-coupon", {});
262
+ }
263
+ /** POST /ecom/v1/carts/current/estimate-totals → the discount amount. Best-effort: a
264
+ * failed estimate hides the Discount row; checkout still applies the code. */
265
+ async function discountOf(): Promise<{ ok: true; discount: string } | { ok: false }> {
266
+ try {
267
+ const r = await wixCall<{ priceSummary?: { discount?: { amount?: string; formattedAmount?: string } } }>("POST", "/ecom/v1/carts/current/estimate-totals", {});
268
+ const d = r.priceSummary?.discount;
269
+ return { ok: true, discount: d && Number(d.amount) > 0 && d.formattedAmount ? `\u2212${d.formattedAmount}` : "" };
270
+ } catch {
271
+ return { ok: false };
272
+ }
273
+ }
274
+
275
+ function promoText(arg: unknown): string {
276
+ if (typeof arg === "string") return arg.trim().slice(0, 100);
277
+ return String((arg as { value?: unknown } | undefined)?.value ?? "").trim().slice(0, 100);
278
+ }
279
+
280
+ /** POST /ecom/v1/carts/{cartId}/update-line-items-quantity via @himalaya/wix-ecom. */
281
+ function updateLineItemQuantity(cartId: string, lineItemId: string, quantity: number): Promise<unknown> {
282
+ return updateLineItemsQuantity(cartId, [{ id: lineItemId, quantity: Math.max(1, quantity) }]);
283
+ }
284
+
285
+ function derive(state: State): State {
286
+ return {
287
+ ...state,
288
+ isLoading: state.status === "loading",
289
+ notLoading: state.status !== "loading",
290
+ isErrored: state.status === "error",
291
+ notErrored: state.status !== "error",
292
+ ...errorFlags(state.status, state.errorKind),
293
+ // Exactly one of {content, error card, empty card} renders: content only on
294
+ // "ready" (an errored cart must not paint a blank subtotal), the error card
295
+ // on "error", the empty card on ready + no items.
296
+ hideContent: state.status !== "ready",
297
+ noEmpty: state.status !== "ready" || state.items.length > 0,
298
+ noItems: state.items.length === 0,
299
+ hideCheckoutHint: !state.checkoutHint,
300
+ subtotalLabel: copyTemplate("cart.subtotalLabel", "Subtotal ({count})", { count: state.items.reduce((n, r) => n + r.quantity, 0) }),
301
+ appliedLabel: state.appliedCode ? copyTemplate("cart.promoApplied", "Promo code {code}", { code: state.appliedCode }) : "",
302
+ hidePromoEntry: Boolean(state.appliedCode),
303
+ hidePromoApplied: !state.appliedCode,
304
+ hideDiscount: !state.appliedCode || !state.discount,
305
+ hideFooter: state.status !== "ready" || state.items.length === 0,
306
+ };
307
+ }
308
+
309
+ async function refresh(state: State): Promise<State> {
310
+ const cart = await getCurrentCart();
311
+ const items = (cart.lineItems ?? []).map(row);
312
+ await writeCachedItems(items);
313
+ await publishBagCount(items.reduce((n, r) => n + r.quantity, 0));
314
+ const appliedCode = items.length ? couponCode(cart) : "";
315
+ const estimate = appliedCode ? await discountOf() : undefined;
316
+ const discount = estimate?.ok ? estimate.discount : "";
317
+ return derive({
318
+ ...state,
319
+ status: "ready",
320
+ items,
321
+ appliedCode,
322
+ discount,
323
+ subtotal: cart.subtotal?.formattedAmount ?? "",
324
+ emptyText: items.length ? "" : copyParam("cart.emptyText", "Your bag is empty."),
325
+ checkoutHint: "",
326
+ });
327
+ }
328
+
329
+ /** The state slice a SETTLED order leaves behind: the order consumed the cart, so the
330
+ * lines AND the subtotal go with it (`refresh` and the error path both clear the pair —
331
+ * leaving a stale subtotal in state is the class of defect #864 fixed on the render side).
332
+ *
333
+ * `emptyText` is cleared deliberately: the empty card would otherwise nudge "Your cart is
334
+ * empty." underneath the confirmation, which is noise at the moment of a successful
335
+ * payment. The next `load` restores it.
336
+ *
337
+ * The "Order placed. Thanks!" confirmation is a toast (see `orderSettled`), not a hint.
338
+ *
339
+ * This used to be written inline as `{ items: [], itemCount: 0, checkoutHint: ... }`.
340
+ * `itemCount` is not a field of `State` and never was — a write to nowhere, which is why
341
+ * the subtotal and emptyText resets were missing. It survived because nothing typechecks
342
+ * Tier-5 workers: esbuild erases types, and no tsconfig includes tier5-bundles-src.
343
+ */
344
+ function cartConsumedByOrder(): Pick<State, "items" | "subtotal" | "emptyText" | "checkoutHint" | "promoInput" | "appliedCode" | "discount" | "promoError"> {
345
+ return {
346
+ items: [],
347
+ subtotal: "",
348
+ promoInput: "",
349
+ appliedCode: "",
350
+ discount: "",
351
+ promoError: "",
352
+ emptyText: "",
353
+ checkoutHint: "",
354
+ };
355
+ }
356
+
357
+ async function orderSettled(state: State): Promise<State> {
358
+ const next = derive({ ...state, ...cartConsumedByOrder() });
359
+ await publishBagCount(0);
360
+ return next;
361
+ }
362
+
363
+ const svc = defineService<State, {
364
+ load: (state: State, arg?: unknown) => Promise<State>;
365
+ remove: (state: State, arg?: unknown) => Promise<State>;
366
+ increment: (state: State, arg?: unknown) => Promise<State>;
367
+ decrement: (state: State, arg?: unknown) => Promise<State>;
368
+ checkout: (state: State) => Promise<State>;
369
+ toggleSave: (state: State, arg?: unknown) => State;
370
+ promoChange: (state: State, arg?: unknown) => State;
371
+ applyPromo: (state: State, arg?: unknown) => Promise<State>;
372
+ removePromo: (state: State) => Promise<State>;
373
+ }>("bareFashionCart", {
374
+ state: derive({ status: "loading", items: [], subtotal: "", subtotalLabel: "", emptyText: "", checkoutHint: "", isLoading: true, notLoading: false, isErrored: false, notErrored: true, hideContent: true, noEmpty: true, noItems: true, hideCheckoutHint: true, promoInput: "", appliedCode: "", appliedLabel: "", discount: "", promoError: "", promoBusy: false, hidePromoEntry: false, hidePromoApplied: true, hideDiscount: true, hideFooter: true }),
375
+ actions: {
376
+ load: async (state, arg) => {
377
+ stashCopy(arg);
378
+ takeReturnUrl(arg);
379
+ // 1) Instant paint from the on-device cache (offline-safe; empty on first-ever run).
380
+ const cache = await readCachedItems();
381
+ const cached = cache.ok ? cache.rows : [];
382
+ const base = cached.length
383
+ ? derive({ ...state, status: "ready", items: cached, emptyText: "" })
384
+ : state;
385
+ // 2) Revalidate from Wix and refresh the cache.
386
+ try {
387
+ return await refresh(state);
388
+ } catch (e) {
389
+ // Offline / fetch failure: keep the cached items instead of a blank error state.
390
+ return cached.length
391
+ ? base
392
+ : derive({ ...state, status: "error", errorKind: errorKindOf(e), items: [], subtotal: "", emptyText: copyParam("cart.loadErrorText", "Your bag could not load."), checkoutHint: "" });
393
+ }
394
+ },
395
+ remove: async (state, arg) => {
396
+ const id = itemId(arg);
397
+ if (!id) return state;
398
+ // Optimistic local delete — the cart drops the row immediately (offline or not).
399
+ await cacheDrop(id);
400
+ try {
401
+ await removeLineItemsFromCurrentCart([id]);
402
+ const next = await refresh(state);
403
+ return next;
404
+ } catch (e) {
405
+ if (isBridgeUnavailable(e)) {
406
+ // Offline / no bridge: the optimistic cache drop already shows; queue the
407
+ // removal to replay (WriteQueue, idempotent) when connectivity returns.
408
+ await queueWrite("tier5.bareFashionCart.remove", { id });
409
+ const items = state.items.filter((it) => it.id !== id);
410
+ return derive({ ...state, status: "ready", items, emptyText: items.length ? "" : copyParam("cart.emptyText", "Your bag is empty."), checkoutHint: copyParam("cart.removedOfflineMessage", "Removed offline — will sync when you reconnect.") });
411
+ }
412
+ return derive({ ...state, checkoutHint: copyParam("cart.removeFailedMessage", "Could not remove this item.") });
413
+ }
414
+ },
415
+ increment: async (state, arg) => {
416
+ const id = itemId(arg);
417
+ const line = state.items.find((candidate) => candidate.id === id);
418
+ if (!line) return state;
419
+ try {
420
+ const cartId = (await getCurrentCart()).id || "";
421
+ await updateLineItemQuantity(cartId, id, line.quantity + 1);
422
+ return await refresh(state);
423
+ } catch {
424
+ return derive({ ...state, checkoutHint: copyParam("cart.quantityFailedMessage", "Could not update the quantity.") });
425
+ }
426
+ },
427
+ decrement: async (state, arg) => {
428
+ const id = itemId(arg);
429
+ const line = state.items.find((candidate) => candidate.id === id);
430
+ if (!line) return state;
431
+ try {
432
+ if (line.quantity <= 1) {
433
+ // Qty 1 − ⇒ remove the line (the control never dead-ends).
434
+ await removeLineItemsFromCurrentCart([id]);
435
+ const next = await refresh(state);
436
+ return next;
437
+ }
438
+ const cartId = (await getCurrentCart()).id || "";
439
+ await updateLineItemQuantity(cartId, id, line.quantity - 1);
440
+ return await refresh(state);
441
+ } catch {
442
+ return derive({ ...state, checkoutHint: copyParam("cart.quantityFailedMessage", "Could not update the quantity.") });
443
+ }
444
+ },
445
+ // Promo code: typing only edits the field; Apply (or the keyboard Done key) sends it.
446
+ promoChange: (state, arg) => derive({ ...state, promoInput: promoText(arg), promoError: "" }),
447
+ applyPromo: async (state, arg) => {
448
+ const code = promoText(arg) || state.promoInput;
449
+ if (!code) return derive({ ...state, promoError: copyParam("cart.promoEmpty", "Enter a promo code.") });
450
+ if (state.promoBusy) return state;
451
+ try {
452
+ await applyCoupon(code);
453
+ const next = await refresh({ ...state, promoBusy: true });
454
+ if (!next.appliedCode) return derive({ ...next, promoBusy: false, promoInput: code, promoError: copyParam("cart.promoInvalid", "This promo code is not valid.") });
455
+ return derive({ ...next, promoBusy: false, promoInput: "", promoError: "" });
456
+ } catch (e) {
457
+ const message = isBridgeUnavailable(e)
458
+ ? copyParam("cart.promoOffline", "Connect to the internet to use a promo code.")
459
+ : copyParam("cart.promoInvalid", "This promo code is not valid.");
460
+ return derive({ ...state, promoBusy: false, promoInput: code, promoError: message });
461
+ }
462
+ },
463
+ removePromo: async (state) => {
464
+ try {
465
+ await removeCoupon();
466
+ return derive({ ...(await refresh(state)), promoError: "" });
467
+ } catch {
468
+ return derive({ ...state, promoError: copyParam("cart.promoRemoveFailed", "Could not remove the promo code.") });
469
+ }
470
+ },
471
+ // Heart on a bag row: device-local wishlist (same store as the shop's hearts) — no Wix write.
472
+ toggleSave: (state, arg) => {
473
+ const line = state.items.find((candidate) => candidate.id === itemId(arg));
474
+ if (!line?.productId) return state;
475
+ try {
476
+ toggleSavedProduct({ id: line.productId, name: line.name, price: line.total, image: line.image });
477
+ } catch {
478
+ return derive({ ...state, checkoutHint: copyParam("savedProducts.error", "Could not update your wishlist. Try again.") });
479
+ }
480
+ const items = state.items.map((r) => {
481
+ if (r.productId !== line.productId) return r;
482
+ const saved = savedFlag(r.productId);
483
+ return { ...r, saved, notSaved: !saved };
484
+ });
485
+ return derive({ ...state, items });
486
+ },
487
+ // Phase 2a — cart checkout collects payment IN-APP through the shared pay rail
488
+ // (@wix/himalaya/checkout) instead of always bouncing to the hosted checkout:
489
+ // createCheckoutFromCurrentCart → ecom.createOrder → payCashierOrder
490
+ // A wallet-equipped app settles with NO navigation at all; every other app hands
491
+ // off to the in-app Wix cashier (the previous behaviour), so nothing regresses.
492
+ // `createOrder` returning no paymentGatewayOrderId means there is nothing to
493
+ // charge (fully covered / zero total) — the order already stands.
494
+ checkout: async (state) => {
495
+ if (!state.items.length) return derive({ ...state, checkoutHint: copyParam("cart.checkoutEmptyMessage", "Add an item before checkout.") });
496
+ try {
497
+ const checkout = await createCheckoutFromCurrentCart();
498
+ if (!checkout.checkoutId) return derive({ ...state, checkoutHint: copyParam("cart.checkoutIdMissingMessage", "Wix did not return a checkout id.") });
499
+ const checkoutId = checkout.checkoutId;
500
+
501
+ const order = await createOrder(checkoutId);
502
+ const snapshotId = order.paymentGatewayOrderId;
503
+ if (!snapshotId) {
504
+ return await orderSettled(state);
505
+ }
506
+
507
+ const pay = await payCashierOrder({
508
+ appId: WIX_STORES_APP_ID,
509
+ snapshotId,
510
+ msid: await resolveMsid().then((r) => (r.ok ? r.msid : "")),
511
+ cashierUrl: async () => {
512
+ const redirect = await createRedirectSession({
513
+ ecomCheckout: { checkoutId },
514
+ callbacks: { postFlowUrl: cashierReturnUrl },
515
+ });
516
+ return redirect.redirectSession?.fullUrl;
517
+ },
518
+ });
519
+ if (pay.kind === "paid") {
520
+ // Settled in place — the cart is consumed by the order.
521
+ return await orderSettled(state);
522
+ }
523
+ if (pay.kind === "handoff") {
524
+ // Do NOT clear the cart: payment completes in the cashier and the order is
525
+ // only confirmed once it lands, so the cart must survive a bail-out.
526
+ return derive({ ...state, checkoutHint: copyParam("cart.checkoutOpenedMessage", "Checkout opened.") });
527
+ }
528
+ if (pay.kind === "cancelled") {
529
+ return derive({ ...state, checkoutHint: copyParam("cart.checkoutCancelledMessage", "Payment cancelled — your bag is still here.") });
530
+ }
531
+ return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
532
+ } catch {
533
+ return derive({ ...state, checkoutHint: copyParam("cart.checkoutFailedMessage", "Checkout could not start.") });
534
+ }
535
+ },
536
+ },
537
+ });
538
+
539
+ svc.load();
540
+ export { svc };
@@ -0,0 +1,111 @@
1
+ // Tier-5 bundle: Wix Spaces clone — Collection detail (ON-DEVICE, site-scoped).
2
+ // Prefer Catalog V3 `getStoreCategory`; V1 `getCollection` 428s on CATALOG_V3 sites.
3
+ import { defineService } from "@himalaya/state";
4
+ import {
5
+ categoryCount,
6
+ getCollection,
7
+ getStoreCategory,
8
+ type WixCollection,
9
+ } from "@himalaya/wix-stores-collections";
10
+ import { searchStoreProducts, type StoreProduct } from "@himalaya/wix-stores";
11
+ import { cardId, productCards, refreshSaved, toggleFavorite, type ProductCard } from "../_shared/bare-fashion-product-card.js";
12
+ import { errorFlags, errorKindOf, type ErrorKind } from "../_shared/bare-fashion-load-error.js";
13
+
14
+ interface S {
15
+ status: "loading" | "ready" | "error";
16
+ errorKind?: ErrorKind;
17
+ name: string;
18
+ subtitle: string;
19
+ description: string;
20
+ products: ProductCard[];
21
+ /** Hides the grid while it has nothing to show. */
22
+ noProducts: boolean;
23
+ /** Hides the empty state unless the category loaded and holds no product. */
24
+ noEmpty: boolean;
25
+ hideOfflineError: boolean;
26
+ hideServerError: boolean;
27
+ hidePermissionError: boolean;
28
+ hideSignInError: boolean;
29
+ }
30
+
31
+ function derive(s: Omit<S, "noProducts" | "noEmpty" | keyof ReturnType<typeof errorFlags>> & Partial<S>): S {
32
+ return {
33
+ ...s,
34
+ noProducts: s.products.length === 0,
35
+ noEmpty: !(s.status === "ready" && s.products.length === 0),
36
+ ...errorFlags(s.status, s.errorKind),
37
+ } as S;
38
+ }
39
+
40
+ function inputId(): string {
41
+ return (globalThis as { himalaya?: { input?: { id?: string } } }).himalaya?.input?.id ?? "";
42
+ }
43
+
44
+ /** V1 lists membership on `collectionIds`; V3 on `allCategoriesInfo` / `directCategoriesInfo`.
45
+ * The SDK search has no category filter, so read both shapes and filter here. */
46
+ function categoryIdsOf(p: StoreProduct): string[] {
47
+ const raw = p as unknown as {
48
+ collectionIds?: string[];
49
+ allCategoriesInfo?: { categories?: { id?: string }[] };
50
+ directCategoriesInfo?: { categories?: { id?: string }[] };
51
+ };
52
+ const v3 = [...(raw.allCategoriesInfo?.categories ?? []), ...(raw.directCategoriesInfo?.categories ?? [])]
53
+ .map((c) => c.id ?? "");
54
+ return [...(Array.isArray(raw.collectionIds) ? raw.collectionIds : []), ...v3].filter(Boolean);
55
+ }
56
+
57
+ /** The category's products. A failed read throws: the screen shows the error, never "no products". */
58
+ async function categoryProducts(id: string): Promise<ProductCard[]> {
59
+ const res = await searchStoreProducts({ limit: 100 });
60
+ return productCards((res.products ?? []).filter((p) => categoryIdsOf(p).includes(id)));
61
+ }
62
+
63
+ /** The category's header, or `ok: false` when neither catalog version can read it: the products
64
+ * still show, under the screen's own title. */
65
+ async function categoryInfo(id: string): Promise<{ ok: true; info: Pick<S, "name" | "subtitle" | "description"> } | { ok: false }> {
66
+ try {
67
+ const res = await getStoreCategory(id);
68
+ const c = res.category;
69
+ if (c?.id || c?.name) {
70
+ return { ok: true, info: { name: c.name || "Category", subtitle: categoryCount(c), description: c.description || "" } };
71
+ }
72
+ } catch { /* fall through to V1 */ }
73
+ try {
74
+ const res = await getCollection(id);
75
+ const c = (((res as unknown as { collection?: WixCollection }).collection) ?? (res as unknown as WixCollection)) as unknown as {
76
+ name?: string; numberOfProducts?: number; description?: string;
77
+ };
78
+ const n = c.numberOfProducts;
79
+ return { ok: true, info: {
80
+ name: c.name || "Collection",
81
+ subtitle: n != null ? `${n} ${n === 1 ? "product" : "products"}` : "",
82
+ description: c.description || "",
83
+ } };
84
+ } catch {
85
+ return { ok: false };
86
+ }
87
+ }
88
+
89
+ const svc = defineService<S, { load: (s: S) => Promise<S>; toggleSave: (s: S, arg: unknown) => S }>("bareFashionCollection", {
90
+ state: derive({ status: "loading", name: "", subtitle: "", description: "", products: [] }),
91
+ actions: {
92
+ load: async (s) => {
93
+ const id = inputId();
94
+ if (!id) return derive({ ...s, status: "ready", errorKind: undefined });
95
+ // Independent reads: a header failure must not blank the products, and vice versa.
96
+ const [info, products] = await Promise.all([
97
+ categoryInfo(id),
98
+ categoryProducts(id).then((rows) => ({ ok: true as const, rows }), (e: unknown) => ({ ok: false as const, e })),
99
+ ]);
100
+ const header = info.ok ? info.info : {};
101
+ if (!products.ok) return derive({ ...s, ...header, status: "error", errorKind: errorKindOf(products.e), products: [] });
102
+ return derive({ ...s, ...header, status: "ready", errorKind: undefined, products: products.rows });
103
+ },
104
+ toggleSave: (s, arg) => {
105
+ try { toggleFavorite(s.products, cardId(arg)); } catch { return s; }
106
+ return derive({ ...s, products: refreshSaved(s.products) });
107
+ },
108
+ },
109
+ });
110
+ svc.load();
111
+ export { svc };