@wix/himalaya-cli 0.1761.0 → 0.1763.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 (741) 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 +10 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +23 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +136 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +112 -0
  6. package/dist/browser-plane/assets.json +5 -5
  7. package/dist/browser-plane/preview-deferred/{7c3c05d452efd3f1e1e81b47dde7d9fa870c1e5217b00b253661a22b571fdbef.bin → a96903bb457796ee606fe986078d9629ba53b5ba4013bdb94e8afba3288284ed.bin} +1 -1
  8. package/dist/browser-plane/sw.js +7 -7
  9. package/dist/cli.mjs +51413 -50002
  10. package/dist/preview-assets.generated.bin +0 -0
  11. package/guides/base44-app-to-himi-app.md +56 -0
  12. package/guides/component-reference.json +1 -1
  13. package/guides/component-reference.md +10 -0
  14. package/guides/himi-json-output.md +35 -0
  15. package/guides/one-app-section-mappings.md +6 -6
  16. package/guides/one-app-to-himi-app.md +33 -4
  17. package/guides/push-cli-onboarding.md +25 -14
  18. package/guides/recipe-dynamic-list.md +4 -2
  19. package/guides/wix-business-context.md +1 -1
  20. package/package.json +2 -2
  21. package/templates/beauty-salon/l10n/ar.json +9 -420
  22. package/templates/beauty-salon/l10n/cs.json +9 -420
  23. package/templates/beauty-salon/l10n/da.json +9 -420
  24. package/templates/beauty-salon/l10n/de.json +9 -420
  25. package/templates/beauty-salon/l10n/el.json +9 -420
  26. package/templates/beauty-salon/l10n/en.json +8 -61
  27. package/templates/beauty-salon/l10n/es.json +9 -420
  28. package/templates/beauty-salon/l10n/fi.json +9 -420
  29. package/templates/beauty-salon/l10n/fr.json +9 -420
  30. package/templates/beauty-salon/l10n/he.json +9 -338
  31. package/templates/beauty-salon/l10n/hu.json +9 -420
  32. package/templates/beauty-salon/l10n/id.json +9 -420
  33. package/templates/beauty-salon/l10n/it.json +9 -420
  34. package/templates/beauty-salon/l10n/ja.json +9 -420
  35. package/templates/beauty-salon/l10n/ko.json +9 -420
  36. package/templates/beauty-salon/l10n/lt.json +9 -420
  37. package/templates/beauty-salon/l10n/nl.json +9 -420
  38. package/templates/beauty-salon/l10n/no.json +9 -420
  39. package/templates/beauty-salon/l10n/pl.json +9 -420
  40. package/templates/beauty-salon/l10n/pt.json +9 -420
  41. package/templates/beauty-salon/l10n/ru.json +9 -420
  42. package/templates/beauty-salon/l10n/sv.json +9 -420
  43. package/templates/beauty-salon/l10n/th.json +9 -420
  44. package/templates/beauty-salon/l10n/tr.json +9 -420
  45. package/templates/beauty-salon/l10n/uk.json +9 -420
  46. package/templates/beauty-salon/l10n/vi.json +9 -420
  47. package/templates/beauty-salon/l10n/zh.json +9 -420
  48. package/templates/branded-lite/l10n/ar.json +31 -5
  49. package/templates/branded-lite/l10n/cs.json +31 -5
  50. package/templates/branded-lite/l10n/da.json +31 -5
  51. package/templates/branded-lite/l10n/de.json +31 -5
  52. package/templates/branded-lite/l10n/el.json +31 -5
  53. package/templates/branded-lite/l10n/en.json +8 -6
  54. package/templates/branded-lite/l10n/es.json +31 -5
  55. package/templates/branded-lite/l10n/fi.json +31 -5
  56. package/templates/branded-lite/l10n/fr.json +31 -5
  57. package/templates/branded-lite/l10n/he.json +27 -4
  58. package/templates/branded-lite/l10n/hu.json +31 -5
  59. package/templates/branded-lite/l10n/id.json +31 -5
  60. package/templates/branded-lite/l10n/it.json +31 -5
  61. package/templates/branded-lite/l10n/ja.json +31 -5
  62. package/templates/branded-lite/l10n/ko.json +31 -5
  63. package/templates/branded-lite/l10n/lt.json +31 -5
  64. package/templates/branded-lite/l10n/nl.json +31 -5
  65. package/templates/branded-lite/l10n/no.json +31 -5
  66. package/templates/branded-lite/l10n/pl.json +31 -5
  67. package/templates/branded-lite/l10n/pt.json +31 -5
  68. package/templates/branded-lite/l10n/ru.json +31 -5
  69. package/templates/branded-lite/l10n/sv.json +31 -5
  70. package/templates/branded-lite/l10n/th.json +31 -5
  71. package/templates/branded-lite/l10n/tr.json +31 -5
  72. package/templates/branded-lite/l10n/uk.json +31 -5
  73. package/templates/branded-lite/l10n/vi.json +31 -5
  74. package/templates/branded-lite/l10n/zh.json +31 -5
  75. package/templates/branded-lite/recipes/blog-search.json +45 -0
  76. package/templates/{events-meetups/recipes/programs-participant-carousel.json → branded-lite/recipes/galleries-carousel.json} +39 -118
  77. package/templates/{gym-fitness/recipes/programs-participant-carousel.json → branded-lite/recipes/galleries-list.json} +43 -121
  78. package/templates/{community-club/recipes/events-inline-list.json → branded-lite/recipes/group-feed.json} +112 -89
  79. package/templates/{beauty-salon/recipes/programs-participant-carousel.json → branded-lite/recipes/groups-cards.json} +71 -93
  80. package/templates/{beauty-salon/recipes/groups-list.json → branded-lite/recipes/services-list.json} +33 -9
  81. package/templates/{community-club/recipes/groups-list.json → branded-lite/recipes/subscriptions-list.json} +124 -60
  82. package/templates/branded-lite/recipes/upcoming-bookings.json +350 -0
  83. package/templates/branded-lite/recipes/videos-carousel.json +248 -0
  84. package/templates/branded-lite/tier5-src/_shared/blog-list.ts +75 -21
  85. package/templates/branded-lite/tier5-src/_shared/galleries-section.ts +115 -0
  86. package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +137 -0
  87. package/templates/branded-lite/tier5-src/_shared/groups-section.ts +7 -3
  88. package/templates/branded-lite/tier5-src/_shared/my-subscriptions-section.ts +107 -0
  89. package/templates/branded-lite/tier5-src/_shared/plans-section.ts +11 -3
  90. package/templates/branded-lite/tier5-src/_shared/programs-section.ts +2 -0
  91. package/templates/branded-lite/tier5-src/_shared/services-section.ts +122 -0
  92. package/templates/branded-lite/tier5-src/_shared/upcoming-bookings-section.ts +102 -0
  93. package/templates/branded-lite/tier5-src/_shared/videos-section.ts +91 -0
  94. package/templates/brandy/README.md +21 -3
  95. package/templates/brandy/config.ts +131 -14
  96. package/templates/brandy/dev/index.ts +41 -5
  97. package/templates/brandy/dev/member-screens.ts +14412 -0
  98. package/templates/brandy/provisioning.member.example.json +25 -0
  99. package/templates/brandy/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  100. package/templates/brandy/tier5-src/_shared/branded-load-state.ts +109 -0
  101. package/templates/brandy/tier5-src/_shared/chat-live.ts +242 -0
  102. package/templates/brandy/tier5-src/_shared/collection-contract.ts +228 -0
  103. package/templates/brandy/tier5-src/_shared/collection-query-legacy.ts +194 -0
  104. package/templates/brandy/tier5-src/_shared/collection-query.ts +252 -0
  105. package/templates/brandy/tier5-src/_shared/collection-service.ts +423 -0
  106. package/templates/brandy/tier5-src/_shared/engine-intl.ts +523 -0
  107. package/templates/brandy/tier5-src/_shared/himi-account.ts +194 -0
  108. package/templates/brandy/tier5-src/_shared/himi-store.ts +7 -0
  109. package/templates/brandy/tier5-src/_shared/himi-text.ts +24 -0
  110. package/templates/brandy/tier5-src/_shared/hosted-checkout.ts +70 -0
  111. package/templates/brandy/tier5-src/_shared/iap-worker.ts +127 -0
  112. package/templates/brandy/tier5-src/_shared/inbox-rooms.ts +68 -0
  113. package/templates/brandy/tier5-src/_shared/live-session.ts +172 -0
  114. package/templates/brandy/tier5-src/_shared/local-preferences.ts +38 -0
  115. package/templates/brandy/tier5-src/_shared/member-access.ts +63 -0
  116. package/templates/brandy/tier5-src/_shared/member-account-routes.ts +52 -0
  117. package/templates/brandy/tier5-src/_shared/member-orders.ts +8 -0
  118. package/templates/brandy/tier5-src/_shared/member-read.ts +82 -0
  119. package/templates/brandy/tier5-src/_shared/member-screen.ts +99 -0
  120. package/templates/brandy/tier5-src/_shared/notification-target.ts +141 -0
  121. package/templates/brandy/tier5-src/_shared/online-actions.ts +76 -0
  122. package/templates/brandy/tier5-src/_shared/owner-load-error.ts +348 -0
  123. package/templates/brandy/tier5-src/_shared/payment-setup.ts +6 -0
  124. package/templates/brandy/tier5-src/_shared/pricing-plan-display.ts +64 -0
  125. package/templates/brandy/tier5-src/_shared/rich-body.ts +78 -0
  126. package/templates/brandy/tier5-src/_shared/rich-content-link.ts +34 -0
  127. package/templates/brandy/tier5-src/_shared/sign-in-sheet.ts +18 -0
  128. package/templates/brandy/tier5-src/_shared/store-order-presentation.ts +56 -0
  129. package/templates/brandy/tier5-src/_shared/wix-bi.ts +85 -0
  130. package/templates/brandy/tier5-src/_shared/wix-member-links.ts +114 -0
  131. package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +92 -0
  132. package/templates/brandy/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
  133. package/templates/brandy/tier5-src/himi-branded-lite-order/index.ts +477 -0
  134. package/templates/brandy/tier5-src/himi-branded-lite-orders/index.ts +327 -0
  135. package/templates/brandy/tier5-src/himi-store-account/index.ts +1007 -0
  136. package/templates/brandy/tier5-src/wix-spaces-chat-thread/index.ts +350 -0
  137. package/templates/brandy/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  138. package/templates/brandy/tier5-src/wix-spaces-my-subscriptions/index.ts +89 -0
  139. package/templates/brandy/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  140. package/templates/brandy/tokens.json +25 -0
  141. package/templates/community-club/l10n/ar.json +0 -412
  142. package/templates/community-club/l10n/cs.json +0 -412
  143. package/templates/community-club/l10n/da.json +0 -412
  144. package/templates/community-club/l10n/de.json +0 -412
  145. package/templates/community-club/l10n/el.json +0 -412
  146. package/templates/community-club/l10n/en.json +1 -46
  147. package/templates/community-club/l10n/es.json +0 -412
  148. package/templates/community-club/l10n/fi.json +0 -412
  149. package/templates/community-club/l10n/fr.json +0 -412
  150. package/templates/community-club/l10n/he.json +0 -331
  151. package/templates/community-club/l10n/hu.json +0 -412
  152. package/templates/community-club/l10n/id.json +0 -412
  153. package/templates/community-club/l10n/it.json +0 -412
  154. package/templates/community-club/l10n/ja.json +0 -412
  155. package/templates/community-club/l10n/ko.json +0 -412
  156. package/templates/community-club/l10n/lt.json +0 -412
  157. package/templates/community-club/l10n/nl.json +0 -412
  158. package/templates/community-club/l10n/no.json +0 -412
  159. package/templates/community-club/l10n/pl.json +0 -412
  160. package/templates/community-club/l10n/pt.json +0 -412
  161. package/templates/community-club/l10n/ru.json +0 -412
  162. package/templates/community-club/l10n/sv.json +0 -412
  163. package/templates/community-club/l10n/th.json +0 -412
  164. package/templates/community-club/l10n/tr.json +0 -412
  165. package/templates/community-club/l10n/uk.json +0 -412
  166. package/templates/community-club/l10n/vi.json +0 -412
  167. package/templates/community-club/l10n/zh.json +0 -412
  168. package/templates/events-meetups/l10n/ar.json +0 -412
  169. package/templates/events-meetups/l10n/cs.json +0 -412
  170. package/templates/events-meetups/l10n/da.json +0 -412
  171. package/templates/events-meetups/l10n/de.json +0 -412
  172. package/templates/events-meetups/l10n/el.json +0 -412
  173. package/templates/events-meetups/l10n/en.json +1 -46
  174. package/templates/events-meetups/l10n/es.json +0 -412
  175. package/templates/events-meetups/l10n/fi.json +0 -412
  176. package/templates/events-meetups/l10n/fr.json +0 -412
  177. package/templates/events-meetups/l10n/he.json +0 -331
  178. package/templates/events-meetups/l10n/hu.json +0 -412
  179. package/templates/events-meetups/l10n/id.json +0 -412
  180. package/templates/events-meetups/l10n/it.json +0 -412
  181. package/templates/events-meetups/l10n/ja.json +0 -412
  182. package/templates/events-meetups/l10n/ko.json +0 -412
  183. package/templates/events-meetups/l10n/lt.json +0 -412
  184. package/templates/events-meetups/l10n/nl.json +0 -412
  185. package/templates/events-meetups/l10n/no.json +0 -412
  186. package/templates/events-meetups/l10n/pl.json +0 -412
  187. package/templates/events-meetups/l10n/pt.json +0 -412
  188. package/templates/events-meetups/l10n/ru.json +0 -412
  189. package/templates/events-meetups/l10n/sv.json +0 -412
  190. package/templates/events-meetups/l10n/th.json +0 -412
  191. package/templates/events-meetups/l10n/tr.json +0 -412
  192. package/templates/events-meetups/l10n/uk.json +0 -412
  193. package/templates/events-meetups/l10n/vi.json +0 -412
  194. package/templates/events-meetups/l10n/zh.json +0 -412
  195. package/templates/gym-fitness/l10n/ar.json +9 -405
  196. package/templates/gym-fitness/l10n/cs.json +9 -405
  197. package/templates/gym-fitness/l10n/da.json +9 -405
  198. package/templates/gym-fitness/l10n/de.json +9 -405
  199. package/templates/gym-fitness/l10n/el.json +9 -405
  200. package/templates/gym-fitness/l10n/en.json +8 -51
  201. package/templates/gym-fitness/l10n/es.json +9 -405
  202. package/templates/gym-fitness/l10n/fi.json +9 -405
  203. package/templates/gym-fitness/l10n/fr.json +9 -405
  204. package/templates/gym-fitness/l10n/he.json +9 -326
  205. package/templates/gym-fitness/l10n/hu.json +9 -405
  206. package/templates/gym-fitness/l10n/id.json +9 -405
  207. package/templates/gym-fitness/l10n/it.json +9 -405
  208. package/templates/gym-fitness/l10n/ja.json +9 -405
  209. package/templates/gym-fitness/l10n/ko.json +9 -405
  210. package/templates/gym-fitness/l10n/lt.json +9 -405
  211. package/templates/gym-fitness/l10n/nl.json +9 -405
  212. package/templates/gym-fitness/l10n/no.json +9 -405
  213. package/templates/gym-fitness/l10n/pl.json +9 -405
  214. package/templates/gym-fitness/l10n/pt.json +9 -405
  215. package/templates/gym-fitness/l10n/ru.json +9 -405
  216. package/templates/gym-fitness/l10n/sv.json +9 -405
  217. package/templates/gym-fitness/l10n/th.json +9 -405
  218. package/templates/gym-fitness/l10n/tr.json +9 -405
  219. package/templates/gym-fitness/l10n/uk.json +9 -405
  220. package/templates/gym-fitness/l10n/vi.json +9 -405
  221. package/templates/gym-fitness/l10n/zh.json +9 -405
  222. package/templates/nonprofit-cause/l10n/ar.json +0 -387
  223. package/templates/nonprofit-cause/l10n/cs.json +0 -387
  224. package/templates/nonprofit-cause/l10n/da.json +0 -387
  225. package/templates/nonprofit-cause/l10n/de.json +0 -387
  226. package/templates/nonprofit-cause/l10n/el.json +0 -387
  227. package/templates/nonprofit-cause/l10n/en.json +1 -46
  228. package/templates/nonprofit-cause/l10n/es.json +0 -387
  229. package/templates/nonprofit-cause/l10n/fi.json +0 -387
  230. package/templates/nonprofit-cause/l10n/fr.json +0 -387
  231. package/templates/nonprofit-cause/l10n/he.json +0 -311
  232. package/templates/nonprofit-cause/l10n/hu.json +0 -387
  233. package/templates/nonprofit-cause/l10n/id.json +0 -387
  234. package/templates/nonprofit-cause/l10n/it.json +0 -387
  235. package/templates/nonprofit-cause/l10n/ja.json +0 -387
  236. package/templates/nonprofit-cause/l10n/ko.json +0 -387
  237. package/templates/nonprofit-cause/l10n/lt.json +0 -387
  238. package/templates/nonprofit-cause/l10n/nl.json +0 -387
  239. package/templates/nonprofit-cause/l10n/no.json +0 -387
  240. package/templates/nonprofit-cause/l10n/pl.json +0 -387
  241. package/templates/nonprofit-cause/l10n/pt.json +0 -387
  242. package/templates/nonprofit-cause/l10n/ru.json +0 -387
  243. package/templates/nonprofit-cause/l10n/sv.json +0 -387
  244. package/templates/nonprofit-cause/l10n/th.json +0 -387
  245. package/templates/nonprofit-cause/l10n/tr.json +0 -387
  246. package/templates/nonprofit-cause/l10n/uk.json +0 -387
  247. package/templates/nonprofit-cause/l10n/vi.json +0 -387
  248. package/templates/nonprofit-cause/l10n/zh.json +0 -387
  249. package/templates/podcast-creator/l10n/ar.json +0 -417
  250. package/templates/podcast-creator/l10n/cs.json +0 -417
  251. package/templates/podcast-creator/l10n/da.json +0 -417
  252. package/templates/podcast-creator/l10n/de.json +0 -417
  253. package/templates/podcast-creator/l10n/el.json +0 -417
  254. package/templates/podcast-creator/l10n/en.json +1 -46
  255. package/templates/podcast-creator/l10n/es.json +0 -417
  256. package/templates/podcast-creator/l10n/fi.json +0 -417
  257. package/templates/podcast-creator/l10n/fr.json +0 -417
  258. package/templates/podcast-creator/l10n/he.json +0 -335
  259. package/templates/podcast-creator/l10n/hu.json +0 -417
  260. package/templates/podcast-creator/l10n/id.json +0 -417
  261. package/templates/podcast-creator/l10n/it.json +0 -417
  262. package/templates/podcast-creator/l10n/ja.json +0 -417
  263. package/templates/podcast-creator/l10n/ko.json +0 -417
  264. package/templates/podcast-creator/l10n/lt.json +0 -417
  265. package/templates/podcast-creator/l10n/nl.json +0 -417
  266. package/templates/podcast-creator/l10n/no.json +0 -417
  267. package/templates/podcast-creator/l10n/pl.json +0 -417
  268. package/templates/podcast-creator/l10n/pt.json +0 -417
  269. package/templates/podcast-creator/l10n/ru.json +0 -417
  270. package/templates/podcast-creator/l10n/sv.json +0 -417
  271. package/templates/podcast-creator/l10n/th.json +0 -417
  272. package/templates/podcast-creator/l10n/tr.json +0 -417
  273. package/templates/podcast-creator/l10n/uk.json +0 -417
  274. package/templates/podcast-creator/l10n/vi.json +0 -417
  275. package/templates/podcast-creator/l10n/zh.json +0 -417
  276. package/templates/portfolio-creative/l10n/ar.json +0 -437
  277. package/templates/portfolio-creative/l10n/cs.json +0 -437
  278. package/templates/portfolio-creative/l10n/da.json +0 -437
  279. package/templates/portfolio-creative/l10n/de.json +0 -437
  280. package/templates/portfolio-creative/l10n/el.json +0 -437
  281. package/templates/portfolio-creative/l10n/en.json +1 -46
  282. package/templates/portfolio-creative/l10n/es.json +0 -437
  283. package/templates/portfolio-creative/l10n/fi.json +0 -437
  284. package/templates/portfolio-creative/l10n/fr.json +0 -437
  285. package/templates/portfolio-creative/l10n/he.json +0 -351
  286. package/templates/portfolio-creative/l10n/hu.json +0 -437
  287. package/templates/portfolio-creative/l10n/id.json +0 -437
  288. package/templates/portfolio-creative/l10n/it.json +0 -437
  289. package/templates/portfolio-creative/l10n/ja.json +0 -437
  290. package/templates/portfolio-creative/l10n/ko.json +0 -437
  291. package/templates/portfolio-creative/l10n/lt.json +0 -437
  292. package/templates/portfolio-creative/l10n/nl.json +0 -437
  293. package/templates/portfolio-creative/l10n/no.json +0 -437
  294. package/templates/portfolio-creative/l10n/pl.json +0 -437
  295. package/templates/portfolio-creative/l10n/pt.json +0 -437
  296. package/templates/portfolio-creative/l10n/ru.json +0 -437
  297. package/templates/portfolio-creative/l10n/sv.json +0 -437
  298. package/templates/portfolio-creative/l10n/th.json +0 -437
  299. package/templates/portfolio-creative/l10n/tr.json +0 -437
  300. package/templates/portfolio-creative/l10n/uk.json +0 -437
  301. package/templates/portfolio-creative/l10n/vi.json +0 -437
  302. package/templates/portfolio-creative/l10n/zh.json +0 -437
  303. package/templates/restaurant/l10n/ar.json +0 -447
  304. package/templates/restaurant/l10n/cs.json +0 -447
  305. package/templates/restaurant/l10n/da.json +0 -447
  306. package/templates/restaurant/l10n/de.json +0 -447
  307. package/templates/restaurant/l10n/el.json +0 -447
  308. package/templates/restaurant/l10n/en.json +1 -46
  309. package/templates/restaurant/l10n/es.json +0 -447
  310. package/templates/restaurant/l10n/fi.json +0 -447
  311. package/templates/restaurant/l10n/fr.json +0 -447
  312. package/templates/restaurant/l10n/he.json +0 -359
  313. package/templates/restaurant/l10n/hu.json +0 -447
  314. package/templates/restaurant/l10n/id.json +0 -447
  315. package/templates/restaurant/l10n/it.json +0 -447
  316. package/templates/restaurant/l10n/ja.json +0 -447
  317. package/templates/restaurant/l10n/ko.json +0 -447
  318. package/templates/restaurant/l10n/lt.json +0 -447
  319. package/templates/restaurant/l10n/nl.json +0 -447
  320. package/templates/restaurant/l10n/no.json +0 -447
  321. package/templates/restaurant/l10n/pl.json +0 -447
  322. package/templates/restaurant/l10n/pt.json +0 -447
  323. package/templates/restaurant/l10n/ru.json +0 -447
  324. package/templates/restaurant/l10n/sv.json +0 -447
  325. package/templates/restaurant/l10n/th.json +0 -447
  326. package/templates/restaurant/l10n/tr.json +0 -447
  327. package/templates/restaurant/l10n/uk.json +0 -447
  328. package/templates/restaurant/l10n/vi.json +0 -447
  329. package/templates/restaurant/l10n/zh.json +0 -447
  330. package/templates/retail-store/l10n/ar.json +0 -462
  331. package/templates/retail-store/l10n/cs.json +0 -462
  332. package/templates/retail-store/l10n/da.json +0 -462
  333. package/templates/retail-store/l10n/de.json +0 -462
  334. package/templates/retail-store/l10n/el.json +0 -462
  335. package/templates/retail-store/l10n/en.json +1 -61
  336. package/templates/retail-store/l10n/es.json +0 -462
  337. package/templates/retail-store/l10n/fi.json +0 -462
  338. package/templates/retail-store/l10n/fr.json +0 -462
  339. package/templates/retail-store/l10n/he.json +0 -371
  340. package/templates/retail-store/l10n/hu.json +0 -462
  341. package/templates/retail-store/l10n/id.json +0 -462
  342. package/templates/retail-store/l10n/it.json +0 -462
  343. package/templates/retail-store/l10n/ja.json +0 -462
  344. package/templates/retail-store/l10n/ko.json +0 -462
  345. package/templates/retail-store/l10n/lt.json +0 -462
  346. package/templates/retail-store/l10n/nl.json +0 -462
  347. package/templates/retail-store/l10n/no.json +0 -462
  348. package/templates/retail-store/l10n/pl.json +0 -462
  349. package/templates/retail-store/l10n/pt.json +0 -462
  350. package/templates/retail-store/l10n/ru.json +0 -462
  351. package/templates/retail-store/l10n/sv.json +0 -462
  352. package/templates/retail-store/l10n/th.json +0 -462
  353. package/templates/retail-store/l10n/tr.json +0 -462
  354. package/templates/retail-store/l10n/uk.json +0 -462
  355. package/templates/retail-store/l10n/vi.json +0 -462
  356. package/templates/retail-store/l10n/zh.json +0 -462
  357. package/templates/yoga-studio/l10n/ar.json +9 -197
  358. package/templates/yoga-studio/l10n/cs.json +9 -197
  359. package/templates/yoga-studio/l10n/da.json +9 -197
  360. package/templates/yoga-studio/l10n/de.json +9 -197
  361. package/templates/yoga-studio/l10n/el.json +9 -197
  362. package/templates/yoga-studio/l10n/en.json +8 -30
  363. package/templates/yoga-studio/l10n/es.json +9 -197
  364. package/templates/yoga-studio/l10n/fi.json +9 -197
  365. package/templates/yoga-studio/l10n/fr.json +9 -197
  366. package/templates/yoga-studio/l10n/he.json +9 -159
  367. package/templates/yoga-studio/l10n/hu.json +9 -197
  368. package/templates/yoga-studio/l10n/id.json +9 -197
  369. package/templates/yoga-studio/l10n/it.json +9 -197
  370. package/templates/yoga-studio/l10n/ja.json +9 -197
  371. package/templates/yoga-studio/l10n/ko.json +9 -197
  372. package/templates/yoga-studio/l10n/lt.json +9 -197
  373. package/templates/yoga-studio/l10n/nl.json +9 -197
  374. package/templates/yoga-studio/l10n/no.json +9 -197
  375. package/templates/yoga-studio/l10n/pl.json +9 -197
  376. package/templates/yoga-studio/l10n/pt.json +9 -197
  377. package/templates/yoga-studio/l10n/ru.json +9 -197
  378. package/templates/yoga-studio/l10n/sv.json +9 -197
  379. package/templates/yoga-studio/l10n/th.json +9 -197
  380. package/templates/yoga-studio/l10n/tr.json +9 -197
  381. package/templates/yoga-studio/l10n/uk.json +9 -197
  382. package/templates/yoga-studio/l10n/vi.json +9 -197
  383. package/templates/yoga-studio/l10n/zh.json +9 -197
  384. package/templates/beauty-salon/recipes/announcement-card.json +0 -72
  385. package/templates/beauty-salon/recipes/blog-hero.json +0 -95
  386. package/templates/beauty-salon/recipes/blog-list-thumb-start.json +0 -394
  387. package/templates/beauty-salon/recipes/blog-list.json +0 -394
  388. package/templates/beauty-salon/recipes/blog-see-all.json +0 -50
  389. package/templates/beauty-salon/recipes/events-inline-list.json +0 -228
  390. package/templates/beauty-salon/recipes/events-inline.json +0 -309
  391. package/templates/beauty-salon/recipes/faq-list.json +0 -503
  392. package/templates/beauty-salon/recipes/members-list.json +0 -445
  393. package/templates/beauty-salon/recipes/plans-card.json +0 -811
  394. package/templates/beauty-salon/recipes/products-carousel.json +0 -141
  395. package/templates/beauty-salon/recipes/products-grid.json +0 -143
  396. package/templates/beauty-salon/recipes/programs-card.json +0 -254
  397. package/templates/beauty-salon/recipes/programs-carousel.json +0 -234
  398. package/templates/beauty-salon/recipes/programs-filters.json +0 -94
  399. package/templates/beauty-salon/recipes/programs-see-all.json +0 -43
  400. package/templates/beauty-salon/recipes/section-error.json +0 -58
  401. package/templates/beauty-salon/tier5-src/_shared/announcement-section.ts +0 -122
  402. package/templates/beauty-salon/tier5-src/_shared/blog-list.ts +0 -207
  403. package/templates/beauty-salon/tier5-src/_shared/event-registration.ts +0 -86
  404. package/templates/beauty-salon/tier5-src/_shared/events-card.ts +0 -33
  405. package/templates/beauty-salon/tier5-src/_shared/events-inline-options.ts +0 -25
  406. package/templates/beauty-salon/tier5-src/_shared/events-inline.ts +0 -84
  407. package/templates/beauty-salon/tier5-src/_shared/faq-list.ts +0 -405
  408. package/templates/beauty-salon/tier5-src/_shared/groups-section.ts +0 -110
  409. package/templates/beauty-salon/tier5-src/_shared/member-activity.ts +0 -34
  410. package/templates/beauty-salon/tier5-src/_shared/member-row-extras.ts +0 -175
  411. package/templates/beauty-salon/tier5-src/_shared/members-directory-view.ts +0 -39
  412. package/templates/beauty-salon/tier5-src/_shared/members-directory.ts +0 -271
  413. package/templates/beauty-salon/tier5-src/_shared/plan-facts.ts +0 -87
  414. package/templates/beauty-salon/tier5-src/_shared/plans-section.ts +0 -106
  415. package/templates/beauty-salon/tier5-src/_shared/products-section.ts +0 -76
  416. package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +0 -16
  417. package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +0 -740
  418. package/templates/beauty-salon/tier5-src/_shared/relative-time.ts +0 -21
  419. package/templates/community-club/recipes/announcement-card.json +0 -72
  420. package/templates/community-club/recipes/blog-hero.json +0 -95
  421. package/templates/community-club/recipes/blog-list-thumb-start.json +0 -394
  422. package/templates/community-club/recipes/blog-list.json +0 -394
  423. package/templates/community-club/recipes/blog-see-all.json +0 -50
  424. package/templates/community-club/recipes/events-inline.json +0 -309
  425. package/templates/community-club/recipes/faq-list.json +0 -503
  426. package/templates/community-club/recipes/members-list.json +0 -445
  427. package/templates/community-club/recipes/plans-card.json +0 -811
  428. package/templates/community-club/recipes/products-carousel.json +0 -141
  429. package/templates/community-club/recipes/products-grid.json +0 -143
  430. package/templates/community-club/recipes/programs-card.json +0 -254
  431. package/templates/community-club/recipes/programs-carousel.json +0 -234
  432. package/templates/community-club/recipes/programs-filters.json +0 -94
  433. package/templates/community-club/recipes/programs-participant-carousel.json +0 -257
  434. package/templates/community-club/recipes/programs-see-all.json +0 -43
  435. package/templates/community-club/recipes/section-error.json +0 -58
  436. package/templates/community-club/tier5-src/_shared/announcement-section.ts +0 -122
  437. package/templates/community-club/tier5-src/_shared/blog-list.ts +0 -207
  438. package/templates/community-club/tier5-src/_shared/events-card.ts +0 -33
  439. package/templates/community-club/tier5-src/_shared/events-inline-options.ts +0 -25
  440. package/templates/community-club/tier5-src/_shared/events-inline.ts +0 -84
  441. package/templates/community-club/tier5-src/_shared/faq-list.ts +0 -405
  442. package/templates/community-club/tier5-src/_shared/groups-section.ts +0 -110
  443. package/templates/community-club/tier5-src/_shared/member-activity.ts +0 -34
  444. package/templates/community-club/tier5-src/_shared/member-row-extras.ts +0 -175
  445. package/templates/community-club/tier5-src/_shared/members-directory-view.ts +0 -39
  446. package/templates/community-club/tier5-src/_shared/members-directory.ts +0 -271
  447. package/templates/community-club/tier5-src/_shared/plan-facts.ts +0 -87
  448. package/templates/community-club/tier5-src/_shared/plans-section.ts +0 -106
  449. package/templates/community-club/tier5-src/_shared/products-section.ts +0 -76
  450. package/templates/community-club/tier5-src/_shared/program-fields.ts +0 -16
  451. package/templates/community-club/tier5-src/_shared/programs-section.ts +0 -740
  452. package/templates/community-club/tier5-src/_shared/relative-time.ts +0 -21
  453. package/templates/events-meetups/recipes/announcement-card.json +0 -72
  454. package/templates/events-meetups/recipes/blog-hero.json +0 -95
  455. package/templates/events-meetups/recipes/blog-list-thumb-start.json +0 -394
  456. package/templates/events-meetups/recipes/blog-list.json +0 -394
  457. package/templates/events-meetups/recipes/blog-see-all.json +0 -50
  458. package/templates/events-meetups/recipes/events-inline-list.json +0 -228
  459. package/templates/events-meetups/recipes/events-inline.json +0 -309
  460. package/templates/events-meetups/recipes/faq-list.json +0 -503
  461. package/templates/events-meetups/recipes/groups-list.json +0 -196
  462. package/templates/events-meetups/recipes/members-list.json +0 -445
  463. package/templates/events-meetups/recipes/plans-card.json +0 -811
  464. package/templates/events-meetups/recipes/products-carousel.json +0 -141
  465. package/templates/events-meetups/recipes/products-grid.json +0 -143
  466. package/templates/events-meetups/recipes/programs-card.json +0 -254
  467. package/templates/events-meetups/recipes/programs-carousel.json +0 -234
  468. package/templates/events-meetups/recipes/programs-filters.json +0 -94
  469. package/templates/events-meetups/recipes/programs-see-all.json +0 -43
  470. package/templates/events-meetups/recipes/section-error.json +0 -58
  471. package/templates/events-meetups/tier5-src/_shared/announcement-section.ts +0 -122
  472. package/templates/events-meetups/tier5-src/_shared/blog-list.ts +0 -207
  473. package/templates/events-meetups/tier5-src/_shared/detail-presence.ts +0 -51
  474. package/templates/events-meetups/tier5-src/_shared/events-card.ts +0 -33
  475. package/templates/events-meetups/tier5-src/_shared/events-inline-options.ts +0 -25
  476. package/templates/events-meetups/tier5-src/_shared/events-inline.ts +0 -84
  477. package/templates/events-meetups/tier5-src/_shared/faq-list.ts +0 -405
  478. package/templates/events-meetups/tier5-src/_shared/groups-section.ts +0 -110
  479. package/templates/events-meetups/tier5-src/_shared/member-activity.ts +0 -34
  480. package/templates/events-meetups/tier5-src/_shared/member-row-extras.ts +0 -175
  481. package/templates/events-meetups/tier5-src/_shared/members-directory-view.ts +0 -39
  482. package/templates/events-meetups/tier5-src/_shared/members-directory.ts +0 -271
  483. package/templates/events-meetups/tier5-src/_shared/plan-facts.ts +0 -87
  484. package/templates/events-meetups/tier5-src/_shared/plans-section.ts +0 -106
  485. package/templates/events-meetups/tier5-src/_shared/products-section.ts +0 -76
  486. package/templates/events-meetups/tier5-src/_shared/program-fields.ts +0 -16
  487. package/templates/events-meetups/tier5-src/_shared/programs-section.ts +0 -740
  488. package/templates/events-meetups/tier5-src/_shared/relative-time.ts +0 -21
  489. package/templates/gym-fitness/recipes/announcement-card.json +0 -72
  490. package/templates/gym-fitness/recipes/blog-hero.json +0 -95
  491. package/templates/gym-fitness/recipes/blog-list-thumb-start.json +0 -394
  492. package/templates/gym-fitness/recipes/blog-list.json +0 -394
  493. package/templates/gym-fitness/recipes/blog-see-all.json +0 -50
  494. package/templates/gym-fitness/recipes/events-inline-list.json +0 -228
  495. package/templates/gym-fitness/recipes/events-inline.json +0 -309
  496. package/templates/gym-fitness/recipes/faq-list.json +0 -503
  497. package/templates/gym-fitness/recipes/groups-list.json +0 -196
  498. package/templates/gym-fitness/recipes/members-list.json +0 -445
  499. package/templates/gym-fitness/recipes/plans-card.json +0 -811
  500. package/templates/gym-fitness/recipes/products-carousel.json +0 -141
  501. package/templates/gym-fitness/recipes/products-grid.json +0 -143
  502. package/templates/gym-fitness/recipes/programs-card.json +0 -254
  503. package/templates/gym-fitness/recipes/programs-carousel.json +0 -234
  504. package/templates/gym-fitness/recipes/programs-filters.json +0 -94
  505. package/templates/gym-fitness/recipes/programs-see-all.json +0 -43
  506. package/templates/gym-fitness/recipes/section-error.json +0 -58
  507. package/templates/gym-fitness/tier5-src/_shared/announcement-section.ts +0 -122
  508. package/templates/gym-fitness/tier5-src/_shared/blog-list.ts +0 -207
  509. package/templates/gym-fitness/tier5-src/_shared/events-card.ts +0 -33
  510. package/templates/gym-fitness/tier5-src/_shared/events-inline-options.ts +0 -25
  511. package/templates/gym-fitness/tier5-src/_shared/events-inline.ts +0 -84
  512. package/templates/gym-fitness/tier5-src/_shared/faq-list.ts +0 -405
  513. package/templates/gym-fitness/tier5-src/_shared/groups-section.ts +0 -110
  514. package/templates/gym-fitness/tier5-src/_shared/member-activity.ts +0 -34
  515. package/templates/gym-fitness/tier5-src/_shared/member-row-extras.ts +0 -175
  516. package/templates/gym-fitness/tier5-src/_shared/members-directory-view.ts +0 -39
  517. package/templates/gym-fitness/tier5-src/_shared/members-directory.ts +0 -271
  518. package/templates/gym-fitness/tier5-src/_shared/plan-facts.ts +0 -87
  519. package/templates/gym-fitness/tier5-src/_shared/plans-section.ts +0 -106
  520. package/templates/gym-fitness/tier5-src/_shared/products-section.ts +0 -76
  521. package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +0 -16
  522. package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +0 -740
  523. package/templates/gym-fitness/tier5-src/_shared/relative-time.ts +0 -21
  524. package/templates/nonprofit-cause/recipes/announcement-card.json +0 -72
  525. package/templates/nonprofit-cause/recipes/blog-hero.json +0 -95
  526. package/templates/nonprofit-cause/recipes/blog-list-thumb-start.json +0 -394
  527. package/templates/nonprofit-cause/recipes/blog-list.json +0 -394
  528. package/templates/nonprofit-cause/recipes/blog-see-all.json +0 -50
  529. package/templates/nonprofit-cause/recipes/events-inline-list.json +0 -228
  530. package/templates/nonprofit-cause/recipes/events-inline.json +0 -309
  531. package/templates/nonprofit-cause/recipes/faq-list.json +0 -503
  532. package/templates/nonprofit-cause/recipes/groups-list.json +0 -196
  533. package/templates/nonprofit-cause/recipes/members-list.json +0 -445
  534. package/templates/nonprofit-cause/recipes/plans-card.json +0 -811
  535. package/templates/nonprofit-cause/recipes/products-carousel.json +0 -141
  536. package/templates/nonprofit-cause/recipes/products-grid.json +0 -143
  537. package/templates/nonprofit-cause/recipes/programs-card.json +0 -254
  538. package/templates/nonprofit-cause/recipes/programs-carousel.json +0 -234
  539. package/templates/nonprofit-cause/recipes/programs-filters.json +0 -94
  540. package/templates/nonprofit-cause/recipes/programs-participant-carousel.json +0 -257
  541. package/templates/nonprofit-cause/recipes/programs-see-all.json +0 -43
  542. package/templates/nonprofit-cause/recipes/section-error.json +0 -58
  543. package/templates/nonprofit-cause/tier5-src/_shared/announcement-section.ts +0 -122
  544. package/templates/nonprofit-cause/tier5-src/_shared/blog-list.ts +0 -207
  545. package/templates/nonprofit-cause/tier5-src/_shared/events-card.ts +0 -33
  546. package/templates/nonprofit-cause/tier5-src/_shared/events-inline-options.ts +0 -25
  547. package/templates/nonprofit-cause/tier5-src/_shared/events-inline.ts +0 -84
  548. package/templates/nonprofit-cause/tier5-src/_shared/faq-list.ts +0 -405
  549. package/templates/nonprofit-cause/tier5-src/_shared/groups-section.ts +0 -110
  550. package/templates/nonprofit-cause/tier5-src/_shared/member-activity.ts +0 -34
  551. package/templates/nonprofit-cause/tier5-src/_shared/member-row-extras.ts +0 -175
  552. package/templates/nonprofit-cause/tier5-src/_shared/members-directory-view.ts +0 -39
  553. package/templates/nonprofit-cause/tier5-src/_shared/members-directory.ts +0 -271
  554. package/templates/nonprofit-cause/tier5-src/_shared/plan-facts.ts +0 -87
  555. package/templates/nonprofit-cause/tier5-src/_shared/plans-section.ts +0 -106
  556. package/templates/nonprofit-cause/tier5-src/_shared/products-section.ts +0 -76
  557. package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +0 -16
  558. package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +0 -740
  559. package/templates/nonprofit-cause/tier5-src/_shared/relative-time.ts +0 -21
  560. package/templates/podcast-creator/recipes/announcement-card.json +0 -72
  561. package/templates/podcast-creator/recipes/blog-hero.json +0 -95
  562. package/templates/podcast-creator/recipes/blog-list-thumb-start.json +0 -394
  563. package/templates/podcast-creator/recipes/blog-list.json +0 -394
  564. package/templates/podcast-creator/recipes/blog-see-all.json +0 -50
  565. package/templates/podcast-creator/recipes/events-inline-list.json +0 -228
  566. package/templates/podcast-creator/recipes/events-inline.json +0 -309
  567. package/templates/podcast-creator/recipes/faq-list.json +0 -503
  568. package/templates/podcast-creator/recipes/groups-list.json +0 -196
  569. package/templates/podcast-creator/recipes/members-list.json +0 -445
  570. package/templates/podcast-creator/recipes/plans-card.json +0 -811
  571. package/templates/podcast-creator/recipes/products-carousel.json +0 -141
  572. package/templates/podcast-creator/recipes/products-grid.json +0 -143
  573. package/templates/podcast-creator/recipes/programs-card.json +0 -254
  574. package/templates/podcast-creator/recipes/programs-carousel.json +0 -234
  575. package/templates/podcast-creator/recipes/programs-filters.json +0 -94
  576. package/templates/podcast-creator/recipes/programs-participant-carousel.json +0 -257
  577. package/templates/podcast-creator/recipes/programs-see-all.json +0 -43
  578. package/templates/podcast-creator/recipes/section-error.json +0 -58
  579. package/templates/podcast-creator/tier5-src/_shared/announcement-section.ts +0 -122
  580. package/templates/podcast-creator/tier5-src/_shared/blog-list.ts +0 -207
  581. package/templates/podcast-creator/tier5-src/_shared/events-card.ts +0 -33
  582. package/templates/podcast-creator/tier5-src/_shared/events-inline-options.ts +0 -25
  583. package/templates/podcast-creator/tier5-src/_shared/events-inline.ts +0 -84
  584. package/templates/podcast-creator/tier5-src/_shared/faq-list.ts +0 -405
  585. package/templates/podcast-creator/tier5-src/_shared/groups-section.ts +0 -110
  586. package/templates/podcast-creator/tier5-src/_shared/member-activity.ts +0 -34
  587. package/templates/podcast-creator/tier5-src/_shared/member-row-extras.ts +0 -175
  588. package/templates/podcast-creator/tier5-src/_shared/members-directory-view.ts +0 -39
  589. package/templates/podcast-creator/tier5-src/_shared/members-directory.ts +0 -271
  590. package/templates/podcast-creator/tier5-src/_shared/plan-facts.ts +0 -87
  591. package/templates/podcast-creator/tier5-src/_shared/plans-section.ts +0 -106
  592. package/templates/podcast-creator/tier5-src/_shared/products-section.ts +0 -76
  593. package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +0 -16
  594. package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +0 -740
  595. package/templates/podcast-creator/tier5-src/_shared/relative-time.ts +0 -21
  596. package/templates/portfolio-creative/recipes/announcement-card.json +0 -72
  597. package/templates/portfolio-creative/recipes/blog-hero.json +0 -95
  598. package/templates/portfolio-creative/recipes/blog-list-thumb-start.json +0 -394
  599. package/templates/portfolio-creative/recipes/blog-list.json +0 -394
  600. package/templates/portfolio-creative/recipes/blog-see-all.json +0 -50
  601. package/templates/portfolio-creative/recipes/events-inline-list.json +0 -228
  602. package/templates/portfolio-creative/recipes/events-inline.json +0 -309
  603. package/templates/portfolio-creative/recipes/faq-list.json +0 -503
  604. package/templates/portfolio-creative/recipes/groups-list.json +0 -196
  605. package/templates/portfolio-creative/recipes/members-list.json +0 -445
  606. package/templates/portfolio-creative/recipes/plans-card.json +0 -811
  607. package/templates/portfolio-creative/recipes/products-carousel.json +0 -141
  608. package/templates/portfolio-creative/recipes/products-grid.json +0 -143
  609. package/templates/portfolio-creative/recipes/programs-card.json +0 -254
  610. package/templates/portfolio-creative/recipes/programs-carousel.json +0 -234
  611. package/templates/portfolio-creative/recipes/programs-filters.json +0 -94
  612. package/templates/portfolio-creative/recipes/programs-participant-carousel.json +0 -257
  613. package/templates/portfolio-creative/recipes/programs-see-all.json +0 -43
  614. package/templates/portfolio-creative/recipes/section-error.json +0 -58
  615. package/templates/portfolio-creative/tier5-src/_shared/announcement-section.ts +0 -122
  616. package/templates/portfolio-creative/tier5-src/_shared/blog-list.ts +0 -207
  617. package/templates/portfolio-creative/tier5-src/_shared/events-card.ts +0 -33
  618. package/templates/portfolio-creative/tier5-src/_shared/events-inline-options.ts +0 -25
  619. package/templates/portfolio-creative/tier5-src/_shared/events-inline.ts +0 -84
  620. package/templates/portfolio-creative/tier5-src/_shared/faq-list.ts +0 -405
  621. package/templates/portfolio-creative/tier5-src/_shared/groups-section.ts +0 -110
  622. package/templates/portfolio-creative/tier5-src/_shared/member-activity.ts +0 -34
  623. package/templates/portfolio-creative/tier5-src/_shared/member-row-extras.ts +0 -175
  624. package/templates/portfolio-creative/tier5-src/_shared/members-directory-view.ts +0 -39
  625. package/templates/portfolio-creative/tier5-src/_shared/members-directory.ts +0 -271
  626. package/templates/portfolio-creative/tier5-src/_shared/plan-facts.ts +0 -87
  627. package/templates/portfolio-creative/tier5-src/_shared/plans-section.ts +0 -106
  628. package/templates/portfolio-creative/tier5-src/_shared/products-section.ts +0 -76
  629. package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +0 -16
  630. package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +0 -740
  631. package/templates/portfolio-creative/tier5-src/_shared/relative-time.ts +0 -21
  632. package/templates/restaurant/recipes/announcement-card.json +0 -72
  633. package/templates/restaurant/recipes/blog-hero.json +0 -95
  634. package/templates/restaurant/recipes/blog-list-thumb-start.json +0 -394
  635. package/templates/restaurant/recipes/blog-list.json +0 -394
  636. package/templates/restaurant/recipes/blog-see-all.json +0 -50
  637. package/templates/restaurant/recipes/events-inline-list.json +0 -228
  638. package/templates/restaurant/recipes/events-inline.json +0 -309
  639. package/templates/restaurant/recipes/faq-list.json +0 -503
  640. package/templates/restaurant/recipes/groups-list.json +0 -196
  641. package/templates/restaurant/recipes/members-list.json +0 -445
  642. package/templates/restaurant/recipes/plans-card.json +0 -811
  643. package/templates/restaurant/recipes/products-carousel.json +0 -141
  644. package/templates/restaurant/recipes/products-grid.json +0 -143
  645. package/templates/restaurant/recipes/programs-card.json +0 -254
  646. package/templates/restaurant/recipes/programs-carousel.json +0 -234
  647. package/templates/restaurant/recipes/programs-filters.json +0 -94
  648. package/templates/restaurant/recipes/programs-participant-carousel.json +0 -257
  649. package/templates/restaurant/recipes/programs-see-all.json +0 -43
  650. package/templates/restaurant/recipes/section-error.json +0 -58
  651. package/templates/restaurant/tier5-src/_shared/announcement-section.ts +0 -122
  652. package/templates/restaurant/tier5-src/_shared/blog-list.ts +0 -207
  653. package/templates/restaurant/tier5-src/_shared/events-card.ts +0 -33
  654. package/templates/restaurant/tier5-src/_shared/events-inline-options.ts +0 -25
  655. package/templates/restaurant/tier5-src/_shared/events-inline.ts +0 -84
  656. package/templates/restaurant/tier5-src/_shared/faq-list.ts +0 -405
  657. package/templates/restaurant/tier5-src/_shared/groups-section.ts +0 -110
  658. package/templates/restaurant/tier5-src/_shared/member-activity.ts +0 -34
  659. package/templates/restaurant/tier5-src/_shared/member-row-extras.ts +0 -175
  660. package/templates/restaurant/tier5-src/_shared/members-directory-view.ts +0 -39
  661. package/templates/restaurant/tier5-src/_shared/members-directory.ts +0 -271
  662. package/templates/restaurant/tier5-src/_shared/plan-facts.ts +0 -87
  663. package/templates/restaurant/tier5-src/_shared/plans-section.ts +0 -106
  664. package/templates/restaurant/tier5-src/_shared/products-section.ts +0 -76
  665. package/templates/restaurant/tier5-src/_shared/program-fields.ts +0 -16
  666. package/templates/restaurant/tier5-src/_shared/programs-section.ts +0 -740
  667. package/templates/restaurant/tier5-src/_shared/relative-time.ts +0 -21
  668. package/templates/retail-store/recipes/announcement-card.json +0 -72
  669. package/templates/retail-store/recipes/blog-hero.json +0 -95
  670. package/templates/retail-store/recipes/blog-list-thumb-start.json +0 -394
  671. package/templates/retail-store/recipes/blog-list.json +0 -394
  672. package/templates/retail-store/recipes/blog-see-all.json +0 -50
  673. package/templates/retail-store/recipes/events-inline-list.json +0 -228
  674. package/templates/retail-store/recipes/events-inline.json +0 -309
  675. package/templates/retail-store/recipes/faq-list.json +0 -503
  676. package/templates/retail-store/recipes/groups-list.json +0 -196
  677. package/templates/retail-store/recipes/members-list.json +0 -445
  678. package/templates/retail-store/recipes/plans-card.json +0 -811
  679. package/templates/retail-store/recipes/products-carousel.json +0 -141
  680. package/templates/retail-store/recipes/products-grid.json +0 -143
  681. package/templates/retail-store/recipes/programs-card.json +0 -254
  682. package/templates/retail-store/recipes/programs-carousel.json +0 -234
  683. package/templates/retail-store/recipes/programs-filters.json +0 -94
  684. package/templates/retail-store/recipes/programs-participant-carousel.json +0 -257
  685. package/templates/retail-store/recipes/programs-see-all.json +0 -43
  686. package/templates/retail-store/recipes/section-error.json +0 -58
  687. package/templates/retail-store/tier5-src/_shared/announcement-section.ts +0 -122
  688. package/templates/retail-store/tier5-src/_shared/blog-list.ts +0 -207
  689. package/templates/retail-store/tier5-src/_shared/event-registration.ts +0 -86
  690. package/templates/retail-store/tier5-src/_shared/events-card.ts +0 -33
  691. package/templates/retail-store/tier5-src/_shared/events-inline-options.ts +0 -25
  692. package/templates/retail-store/tier5-src/_shared/events-inline.ts +0 -84
  693. package/templates/retail-store/tier5-src/_shared/faq-list.ts +0 -405
  694. package/templates/retail-store/tier5-src/_shared/groups-section.ts +0 -110
  695. package/templates/retail-store/tier5-src/_shared/member-activity.ts +0 -34
  696. package/templates/retail-store/tier5-src/_shared/member-row-extras.ts +0 -175
  697. package/templates/retail-store/tier5-src/_shared/members-directory-view.ts +0 -39
  698. package/templates/retail-store/tier5-src/_shared/members-directory.ts +0 -271
  699. package/templates/retail-store/tier5-src/_shared/plan-facts.ts +0 -87
  700. package/templates/retail-store/tier5-src/_shared/plans-section.ts +0 -106
  701. package/templates/retail-store/tier5-src/_shared/products-section.ts +0 -76
  702. package/templates/retail-store/tier5-src/_shared/program-fields.ts +0 -16
  703. package/templates/retail-store/tier5-src/_shared/programs-section.ts +0 -740
  704. package/templates/retail-store/tier5-src/_shared/relative-time.ts +0 -21
  705. package/templates/yoga-studio/recipes/announcement-card.json +0 -72
  706. package/templates/yoga-studio/recipes/blog-hero.json +0 -95
  707. package/templates/yoga-studio/recipes/blog-list-thumb-start.json +0 -394
  708. package/templates/yoga-studio/recipes/blog-list.json +0 -394
  709. package/templates/yoga-studio/recipes/blog-see-all.json +0 -50
  710. package/templates/yoga-studio/recipes/events-inline-list.json +0 -228
  711. package/templates/yoga-studio/recipes/events-inline.json +0 -309
  712. package/templates/yoga-studio/recipes/faq-list.json +0 -503
  713. package/templates/yoga-studio/recipes/groups-list.json +0 -196
  714. package/templates/yoga-studio/recipes/members-list.json +0 -445
  715. package/templates/yoga-studio/recipes/plans-card.json +0 -811
  716. package/templates/yoga-studio/recipes/products-carousel.json +0 -141
  717. package/templates/yoga-studio/recipes/products-grid.json +0 -143
  718. package/templates/yoga-studio/recipes/programs-card.json +0 -254
  719. package/templates/yoga-studio/recipes/programs-carousel.json +0 -234
  720. package/templates/yoga-studio/recipes/programs-filters.json +0 -94
  721. package/templates/yoga-studio/recipes/programs-participant-carousel.json +0 -257
  722. package/templates/yoga-studio/recipes/programs-see-all.json +0 -43
  723. package/templates/yoga-studio/recipes/section-error.json +0 -58
  724. package/templates/yoga-studio/tier5-src/_shared/announcement-section.ts +0 -122
  725. package/templates/yoga-studio/tier5-src/_shared/blog-list.ts +0 -207
  726. package/templates/yoga-studio/tier5-src/_shared/events-card.ts +0 -33
  727. package/templates/yoga-studio/tier5-src/_shared/events-inline-options.ts +0 -25
  728. package/templates/yoga-studio/tier5-src/_shared/events-inline.ts +0 -84
  729. package/templates/yoga-studio/tier5-src/_shared/faq-list.ts +0 -405
  730. package/templates/yoga-studio/tier5-src/_shared/groups-section.ts +0 -110
  731. package/templates/yoga-studio/tier5-src/_shared/member-activity.ts +0 -34
  732. package/templates/yoga-studio/tier5-src/_shared/member-row-extras.ts +0 -175
  733. package/templates/yoga-studio/tier5-src/_shared/members-directory-view.ts +0 -39
  734. package/templates/yoga-studio/tier5-src/_shared/members-directory.ts +0 -271
  735. package/templates/yoga-studio/tier5-src/_shared/plan-facts.ts +0 -87
  736. package/templates/yoga-studio/tier5-src/_shared/plans-section.ts +0 -106
  737. package/templates/yoga-studio/tier5-src/_shared/products-section.ts +0 -76
  738. package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +0 -16
  739. package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +0 -740
  740. package/templates/yoga-studio/tier5-src/_shared/relative-time.ts +0 -21
  741. /package/templates/{community-club → brandy}/tier5-src/_shared/detail-presence.ts +0 -0
@@ -0,0 +1,1007 @@
1
+ import { authFailure, authMessage, identityErrors, type AuthOperation } from "@himalaya/auth";
2
+ // Tier-5 bundle: himi-store — visitor/member account state.
3
+ //
4
+ // SINGLE-SITE BY DESIGN. A Branded Lite build talks to exactly one Wix site, and the
5
+ // binding is the baked Headless `clientId` itself:
6
+ // there is no metaSiteId to move and Wix will not route a consumer token minted for one
7
+ // client at another site. This worker therefore has no site picker — Profile used to carry
8
+ // a "Your sites" list that dispatched `branded_lite.select_site`, which changed the
9
+ // `wix-site-id` header and nothing else, so every read stayed on the baked site while the
10
+ // UI claimed otherwise. Managing several businesses is Owner Lite's job (account auth, a
11
+ // real Sites List, and per-call site scope via `site.forSite`).
12
+ import { defineService, navigate } from "@himalaya/state";
13
+ import { dispatch } from "@himalaya/dispatch";
14
+ import { getCurrentCart, searchOrders, type WixOrder } from "@himalaya/wix-ecom";
15
+ import { guestProfile, loadMemberProfile, signedInEmail, strOf, fmtDate, titleCase, type AccountActivityRow } from "../_shared/himi-account";
16
+ import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
17
+ import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
18
+ import { memberAccountRoutes } from "../_shared/member-account-routes.js";
19
+ import { CONTINUATION_BUDGET_MS, memberScreenTarget, within } from "../_shared/member-screen.js";
20
+ import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesProductOrders } from "@himalaya/iap-checkout";
21
+ import { IAP_RESTORE_KEYS, NO_IAP_RESTORE, createIapRestore, resetUnhydratedKeysOnOlderRuntime, type IapRestoreFields } from "../_shared/iap-worker.js";
22
+
23
+ interface AuthRouteInput {
24
+ authContinuation?: string;
25
+ /** Standalone sign-in only: `register` opens the form on Create account. */
26
+ mode?: string;
27
+ intent?: string;
28
+ contextName?: string;
29
+ returnScreenId?: string;
30
+ returnId?: string;
31
+ returnChannelId?: string;
32
+ /** Standalone sign-in only: "1" when it was opened as a modal (sheet / cover). */
33
+ modal?: string;
34
+ /** Modal only: the tab whose stack the return screen opens on once the modal closes. */
35
+ returnTab?: string;
36
+ }
37
+
38
+ // The screen's boot input survives refresh; consuming it must survive too.
39
+ let routeInputConsumed = false;
40
+ // The form's heading has its copy: a copy pack was stashed, a probe (not the boot load)
41
+ // finished without one, or the visitor switched mode — the form is in use by then.
42
+ let headingReady = false;
43
+
44
+ /** Mid-flow open params land on `himalaya.input` (paramKeys on himi_account). */
45
+ function routeInput(): AuthRouteInput {
46
+ const input = (globalThis as { himalaya?: { input?: AuthRouteInput } }).himalaya?.input;
47
+ return input && typeof input === "object" ? input : {};
48
+ }
49
+
50
+ /** The route opened the standalone form on Create account. Read once, before any probe. */
51
+ const ROUTE_ASKS_REGISTER = routeInput().mode === "register";
52
+
53
+ function strField(arg: unknown, key: string): string {
54
+ if (!arg || typeof arg !== "object") return "";
55
+ const raw = (arg as Record<string, unknown>)[key];
56
+ return typeof raw === "string" ? raw.trim() : "";
57
+ }
58
+
59
+ /** Mid-flow auth (UX F3): intent + return path from himi.open / himalaya.input. */
60
+ function authIntentFromArg(arg: unknown, prev: Pick<S, "authIntent" | "authContextName" | "returnScreenId" | "returnId" | "returnChannelId">): Pick<S, "authIntent" | "authContextName" | "returnScreenId" | "returnId" | "returnChannelId"> {
61
+ const route = routeInputConsumed ? {} : routeInput();
62
+ return {
63
+ authIntent: strField(arg, "intent") || route.intent || prev.authIntent || "",
64
+ authContextName: strField(arg, "contextName") || route.contextName || prev.authContextName || "",
65
+ returnScreenId: strField(arg, "returnScreenId") || route.returnScreenId || prev.returnScreenId || "",
66
+ returnId: strField(arg, "returnId") || route.returnId || prev.returnId || "",
67
+ returnChannelId: strField(arg, "returnChannelId") || route.returnChannelId || prev.returnChannelId || "",
68
+ };
69
+ }
70
+
71
+ /** How the standalone form leaves. A modal is closed: on web `back` pops the tab's stack,
72
+ * not the modal. A pushed form goes back. */
73
+ function leaveNav(): "dismiss" | "back" {
74
+ return routeInput().modal === "1" ? "dismiss" : "back";
75
+ }
76
+
77
+ /** Where a successful sign-in returns to, or null. Never Account itself — that would
78
+ * only push a second copy of the screen the member is already on. */
79
+ function resumeTarget(s: Pick<S, "returnScreenId" | "returnId" | "returnChannelId">): { screenId: string; args?: Record<string, string> } | null {
80
+ if (!s.returnScreenId || s.returnScreenId === "himi_account") return null;
81
+ return s.returnId || s.returnChannelId ? {
82
+ screenId: s.returnScreenId,
83
+ args: { ...(s.returnId ? { id: s.returnId } : {}), ...(s.returnChannelId ? { channelId: s.returnChannelId } : {}) },
84
+ } : { screenId: s.returnScreenId };
85
+ }
86
+
87
+ /** Resume the member-only screen that sent the visitor here, once. The return path is
88
+ * consumed so a later refresh cannot fire it again; the host opens the target only if
89
+ * it is linkable, the same check an authored `himi.open` gets.
90
+ *
91
+ * On the standalone sign-in screen the target is pushed, not a `replace`: on iOS and
92
+ * Android `replace` resets the stack to its root, which would drop the screens the
93
+ * visitor came through. Back from the target shows the form again, and the form sends a
94
+ * member back on appear (settle). With no target the form goes back.
95
+ *
96
+ * A modal form closes. A target pushed from here would open inside the modal (iOS, Android)
97
+ * or under it (web), so a modal that names a `returnTab` hands the target to that tab: the
98
+ * host closes the modal, then pushes it on that tab's stack (Account's member rows). A host
99
+ * showing no such tab (a drawer, a narrow Mac window) drops that request whole, modal and
100
+ * all, so the modal is also dismissed directly: it always closes, and the row opens where
101
+ * the tab exists. With no `returnTab` it only closes, and the screen under it loads again —
102
+ * the screen that opened the modal is the return target. */
103
+ async function resumeAfterAuth(next: S): Promise<S> {
104
+ const target = resumeTarget(next);
105
+ if (!next.isMember) return next;
106
+ const tab = routeInput().modal === "1" ? routeInput().returnTab ?? "" : "";
107
+ if (target && tab && next.standalone) {
108
+ routeInputConsumed = true;
109
+ // The opener's continuation is spent first, so a later form replacement cannot resume it too.
110
+ // "refused" means another form already spent it, or it expired. A host may replace this form
111
+ // when the account changes yet let this sign-in finish (Android Himi Player parks the old
112
+ // worker alive): the replacement opened the screen, so this form only closes. A continuation
113
+ // lives 5 min from the tap, and a guest can take longer (Forgot your password?): a form shown
114
+ // about that long resumes, so an expiry never costs them the screen.
115
+ if (routeInput().authContinuation) {
116
+ const answer = await within(consumeContinuation(target.screenId), CONTINUATION_BUDGET_MS, "unsupported" as const);
117
+ if (answer === "refused" && Date.now() - formShownAt < CONTINUATION_LIFETIME_MS - CONTINUATION_MARGIN_MS) {
118
+ return navigate(derive({ ...next, ...NO_VISIT }), { presentation: leaveNav() });
119
+ }
120
+ }
121
+ void dispatch("himi.open", { presentation: "dismiss" });
122
+ const cleared = derive({ ...next, authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "" });
123
+ return navigate(cleared, target.args ? { tab, screenId: target.screenId, args: target.args } : { tab, screenId: target.screenId });
124
+ }
125
+ if (!target || routeInput().modal === "1") return next.standalone ? navigate(next, { presentation: leaveNav() }) : next;
126
+ routeInputConsumed = true;
127
+ const cleared = derive({ ...next, authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "" });
128
+ return navigate(cleared, target);
129
+ }
130
+
131
+ /** How long a host keeps a continuation: 300 s in all three (web authContinuation.ts, iOS and Android
132
+ * AuthProvider). A form shown that long has outlived the one it was opened with. The margin covers
133
+ * the time between the tap and the form's appear. */
134
+ const CONTINUATION_LIFETIME_MS = 300_000;
135
+ const CONTINUATION_MARGIN_MS = 15_000;
136
+ /** When this visit's form appeared (`appearConfig`), for the continuation's lifetime above. */
137
+ let formShownAt = Date.now();
138
+
139
+ /** Spend the host-held continuation an opener began for `screenId` (_shared/member-screen.ts).
140
+ * "confirmed" once, and only after a sign-in made on this form confirmed it for the member signed
141
+ * in now; "refused" otherwise (spent, cancelled, expired, forged); "unsupported" on a host without
142
+ * the contract. */
143
+ async function consumeContinuation(screenId: string): Promise<"confirmed" | "refused" | "unsupported"> {
144
+ try {
145
+ const value = await dispatch("himi.wix.authContinuation", { operation: "consume", target: memberScreenTarget(screenId) }) as
146
+ { supported?: unknown; confirmed?: unknown; payload?: { supported?: unknown; confirmed?: unknown } } | null;
147
+ const fields = value?.payload ?? value;
148
+ if (fields?.supported !== true) return "unsupported";
149
+ return fields.confirmed === true ? "confirmed" : "refused";
150
+ } catch {
151
+ return "unsupported";
152
+ }
153
+ }
154
+
155
+ /** A modal form whose sign-in replaced this worker. On Android the account change of a sign-in
156
+ * boots a new worker for the open form before `authenticate` returns, so resumeAfterAuth never
157
+ * runs, and this worker sees only a member on the form, which settle sends back. The return
158
+ * path resumes here only with the opener's continuation, which the sign-in on this form
159
+ * confirmed and the host spends once; a route alone never opens it (see settle). */
160
+ async function resumeFromContinuation(next: S, arg: unknown): Promise<S | null> {
161
+ const route = routeInput();
162
+ // Not gated on `routeInputConsumed`: the replacement's boot load settles first and marks the
163
+ // route used. The host's consume is the one-shot authority.
164
+ if (!next.standalone || !next.isMember || strField(arg, "standalone") !== "1") return null;
165
+ if (route.modal !== "1" || !route.returnTab || !route.authContinuation) return null;
166
+ const returnPath = { returnScreenId: route.returnScreenId ?? "", returnId: route.returnId ?? "", returnChannelId: route.returnChannelId ?? "" };
167
+ const target = resumeTarget(returnPath);
168
+ if (!target || await within(consumeContinuation(target.screenId), CONTINUATION_BUDGET_MS, "unsupported" as const) !== "confirmed") return null;
169
+ routeInputConsumed = true;
170
+ void dispatch("himi.open", { presentation: "dismiss" });
171
+ const cleared = derive({ ...next, ...NO_VISIT });
172
+ return navigate(cleared, target.args ? { tab: route.returnTab, screenId: target.screenId, args: target.args } : { tab: route.returnTab, screenId: target.screenId });
173
+ }
174
+
175
+ /** After a probe: a form a sign-in replaced resumes its return path; anything else settles. */
176
+ async function afterProbe(r: { next: S; latest: boolean } | { kept: S; latest: boolean }, arg: unknown): Promise<S> {
177
+ if ("next" in r && r.latest) {
178
+ const resumed = await resumeFromContinuation(r.next, arg);
179
+ if (resumed) return resumed;
180
+ }
181
+ return "next" in r ? settle(r.next, arg, r.latest) : r.latest ? settle(r.kept, arg, true) : r.kept;
182
+ }
183
+
184
+ /** Account with a standalone sign-in screen (`signInScreen` appear param): a guest who
185
+ * arrives with a sign-in intent or a return path — a member gate, an old deep link — is
186
+ * sent on to that screen with the same params, once. */
187
+ function forwardToSignIn(next: S): S {
188
+ if (!next.signInScreen || next.isMember || routeInputConsumed) return next;
189
+ if (!next.authIntent && !next.returnScreenId) return next;
190
+ routeInputConsumed = true;
191
+ const args: Record<string, string> = { mode: "signin" };
192
+ for (const key of ["authIntent", "authContextName"] as const) {
193
+ if (next[key]) args[key === "authIntent" ? "intent" : "contextName"] = next[key];
194
+ }
195
+ return openSignIn(derive({ ...next, authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "" }),
196
+ args, resumeTarget(next));
197
+ }
198
+
199
+ /** Account sends a guest to the standalone sign-in screen, with `after`, the member screen to
200
+ * open once signed in. With a `signInPresentation` appear param it opens as that modal, and
201
+ * `after` goes on Account's own tab (`signInReturnTab`) when the modal closes; pushed, the form
202
+ * pushes `after` itself (resumeAfterAuth). */
203
+ function openSignIn(next: S, args: Record<string, string>, after: { screenId: string; args?: Record<string, string> } | null): S {
204
+ const screenId = next.signInScreen || "himi_sign_in";
205
+ const presentation = signInPresentationRequested;
206
+ const back: Record<string, string> = {};
207
+ if (after) {
208
+ back.returnScreenId = after.screenId;
209
+ if (after.args?.id) back.returnId = after.args.id;
210
+ if (after.args?.channelId) back.returnChannelId = after.args.channelId;
211
+ }
212
+ if (!presentation) return navigate(next, { screenId, args: { ...args, ...back } });
213
+ const modalArgs: Record<string, string> = { ...args, modal: "1", ...signInSheetStyle(presentation, signInStyleRequested) };
214
+ // With no tab to open it on, a modal has no way to the member screen: it only closes.
215
+ if (after && signInReturnTabRequested) Object.assign(modalArgs, back, { returnTab: signInReturnTabRequested });
216
+ return navigate(next, { screenId, presentation, args: modalArgs });
217
+ }
218
+
219
+ /** After a load: the standalone sign-in screen sends a member back (a stale link, or a
220
+ * sign-in finished elsewhere); Account forwards a guest with a sign-in intent.
221
+ *
222
+ * The member goes back WITHOUT the return path: only a sign-in made on this form resumes
223
+ * it (authenticate → resumeAfterAuth). The screen is public, so honouring a route's
224
+ * return path here would let a bare link open a member-only screen with no tap. */
225
+ function stashScreenCopy(arg: unknown): void {
226
+ stashCopy(arg);
227
+ if (strField(arg, "copy")) headingReady = true;
228
+ }
229
+
230
+ function settle(next: S, arg: unknown, latest = true): S {
231
+ // A member on the form goes back. Coming back to the form after the pushed
232
+ // target, iOS re-runs only `load()` with no params and DISCARDS its result, so the move is
233
+ // a dispatch, not `_nav`. Never from the boot load: the appear refresh of the same visit
234
+ // sends it.
235
+ if (next.standalone && next.isMember) {
236
+ routeInputConsumed = true;
237
+ const cleared = derive({ ...next, ...NO_VISIT });
238
+ // Only the newest probe moves: web re-shows a form with an arg-less load AND the appear
239
+ // refresh, and both may land, any time apart. The boot load never moves.
240
+ if (!latest || strField(arg, "boot") === "1") return cleared;
241
+ // The appear refresh returns `_nav`, which every host applies — binaries from before
242
+ // worker nav dispatch included. Only an arg-less load, whose result iOS
243
+ // discards, dispatches.
244
+ if (strField(arg, "standalone") === "1") return navigate(cleared, { presentation: leaveNav() });
245
+ // Not from a modal: nothing pushed over it comes back to it, and on iOS the closing modal's
246
+ // own screen reloads here once, after it has asked to close — a late dismiss would close
247
+ // whatever modal is open by then.
248
+ if (routeInput().modal !== "1") void dispatch("himi.open", { presentation: leaveNav() });
249
+ return cleared;
250
+ }
251
+ // Account forwards only on an appear refresh: the boot `load()` has no params and its
252
+ // navigation is dropped, so a forward there was lost and used up the one forward.
253
+ return strField(arg, "signInScreen") ? forwardToSignIn(next) : next;
254
+ }
255
+
256
+ // A tick reads only the session. The profile is read again only when the signed-in email
257
+ // changes, so an idle tick costs no profile read and no re-render. Account opts in
258
+ // (`pollIdentity`): a sign-in on the standalone screen changes the session while Account
259
+ // stays mounted, and not every host re-runs `load` when it comes back.
260
+ const IDENTITY_POLL = { id: "himi-account-identity", intervalMs: 1500, action: "himiStoreAccount.sync" };
261
+
262
+ /** "Hey, <name>" wants a first name. A profile with no display name carries the email. */
263
+ function greetingName(memberName: string): string {
264
+ const name = memberName.trim();
265
+ const bare = name.includes("@") ? name.slice(0, name.indexOf("@")) : name;
266
+ return bare.split(/\s+/)[0] ?? "";
267
+ }
268
+
269
+ // Applied once per worker: the standalone screen opens on the mode its route asked for.
270
+ let routeModeApplied = false;
271
+
272
+ /** One visit's form mode and mid-flow return path. Never restored from a snapshot: the
273
+ * snapshot is keyed by screen, not by the route that opened it. */
274
+ const NO_VISIT = {
275
+ isRegistering: false, isRecovering: false,
276
+ authIntent: "", authContextName: "", returnScreenId: "", returnId: "", returnChannelId: "",
277
+ };
278
+ const VISIT_KEYS = Object.keys(NO_VISIT) as (keyof typeof NO_VISIT)[];
279
+ /** What derive() computes from the visit keys. Hydration copies keys without re-deriving,
280
+ * so these stay out of the snapshot with them, or the first paint mixes two visits. */
281
+ const VISIT_DERIVED_KEYS = ["notRegistering", "notRecovering", "hideSignInChoices", "authTitle", "authBody",
282
+ "hasReturnPath", "noReturnPath", "returnCta"] as const;
283
+
284
+ // Actions are not serialized: two quick Sign in taps both run against the pre-tap
285
+ // state, so without this both would submit credentials and both would resume.
286
+ let authInFlight = false;
287
+ // Never projected or persisted. The renderer retains its own masked draft for retry.
288
+ let passwordDraft = "";
289
+ let editRevision = 0;
290
+ // load, refresh and sync each run a whole probe and replace the whole state. Only the newest
291
+ // one to start may land: a boot `load()` that resolves after the appear refresh would put
292
+ // back a state without the appear params, and a sync that resolves after a Sign out would
293
+ // put the member back.
294
+ let probeSeq = 0;
295
+ let appliedSeq = 0;
296
+ // The appear params belong to the worker session too, like the two flags above: a probe
297
+ // dropped because the visitor typed must not take them with it.
298
+ let signInScreenRequested = "";
299
+ /** Account only: how it opens the standalone sign-in screen ("" = push). */
300
+ let signInPresentationRequested: "" | "sheet" | "full_screen" = "";
301
+ /** Account only: `signInSheetStyle`, "page" when the app opens that sheet as a full page. */
302
+ let signInStyleRequested: "page" | "" = "";
303
+ /** Account only: its tab, where a member screen opens after a modal sign-in. */
304
+ let signInReturnTabRequested = "";
305
+ let standaloneRequested = false;
306
+ let pollIdentityRequested = false;
307
+ // iOS can start the arg-less boot load after the appear refresh that asks for the row; the
308
+ // newer boot probe must not land, or be kept, without it.
309
+ let restorePurchasesRequested = false;
310
+ // Bumped by every mode switch, so a dropped probe never puts back a mode the visitor left.
311
+ let modeSwitches = 0;
312
+
313
+ interface AppearConfig { mode: Partial<S>; visit: Partial<S> }
314
+
315
+ /** The appear params the worker session has seen so far — read when a state is built, so a
316
+ * probe that started before an appear refresh still carries what that refresh asked for. */
317
+ function appearBase(): Partial<S> {
318
+ return {
319
+ signInScreen: signInScreenRequested,
320
+ standalone: standaloneRequested,
321
+ pollIdentity: pollIdentityRequested,
322
+ restorePurchases: restorePurchasesRequested,
323
+ ...(pollIdentityRequested ? { _poll: { ...IDENTITY_POLL } } : {}),
324
+ };
325
+ }
326
+
327
+ /** What the appear params ask for. Read before the probe awaits anything. */
328
+ function appearConfig(s: S, arg: unknown): AppearConfig {
329
+ const appearing = strField(arg, "standalone") === "1";
330
+ // Each visit to the form reads its own route again. A pooled worker comes back for a
331
+ // later visit with the same params, after an earlier visit consumed the route.
332
+ if (appearing) {
333
+ routeInputConsumed = false;
334
+ formShownAt = Date.now();
335
+ // A pooled worker serves the next visitor too: the fields mount empty, so the last
336
+ // visit's draft must not be what Sign in submits.
337
+ passwordDraft = "";
338
+ }
339
+ signInScreenRequested ||= strField(arg, "signInScreen") || s.signInScreen;
340
+ const presentation = strField(arg, "signInPresentation");
341
+ if (presentation === "sheet" || presentation === "full_screen") {
342
+ signInPresentationRequested = presentation;
343
+ signInStyleRequested = signInPageStyle(strField(arg, "signInSheetStyle"));
344
+ }
345
+ signInReturnTabRequested ||= strField(arg, "signInReturnTab");
346
+ // Only the sign-in screen's route carries `mode`, so it marks the form from the boot load on.
347
+ standaloneRequested ||= s.standalone || appearing || (!routeInputConsumed && !!routeInput().mode);
348
+ pollIdentityRequested ||= s.pollIdentity || strField(arg, "pollIdentity") === "1";
349
+ restorePurchasesRequested ||= s.restorePurchases || strField(arg, "restorePurchases") === "1";
350
+ // The form opens on the mode its route asked for each time it appears, sign-in by
351
+ // default: a pooled worker reopened with the same params must not open on the mode the
352
+ // last visit toggled to.
353
+ let mode: Partial<S> = {};
354
+ if (standaloneRequested && (!routeModeApplied || appearing)) {
355
+ routeModeApplied = true;
356
+ const asked = strField(arg, "mode") || (routeInputConsumed ? "" : routeInput().mode ?? "");
357
+ const isRegistering = asked === "register";
358
+ if (isRegistering !== !!s.isRegistering || s.isRecovering) {
359
+ mode = { isRegistering, isRecovering: false, ...NO_FOCUS_MODE_SWITCH };
360
+ }
361
+ }
362
+ const visit: Partial<S> = appearing
363
+ // The route's own intent and return path too: a dropped probe must not keep the last
364
+ // visit's (an abandoned gate) for the next Sign in to resume.
365
+ ? { email: "", firstName: "", lastName: "", password: "", emailError: "", passwordError: "", message: "", lastNameFocus: "", emailFocus: "", passwordFocus: "", ...authIntentFromArg(arg, NO_VISIT) }
366
+ : {};
367
+ return { mode, visit };
368
+ }
369
+
370
+ /** The probe's state, or — when it must not land — the appear params alone, on the
371
+ * current state. */
372
+ // Bumped when an appear refresh's visit reset lands. A probe that started before it read the
373
+ // last visit's state, so it must not land over the reset (iOS can start the arg-less load
374
+ // after the appear refresh, from the same pre-reset state).
375
+ let visitsApplied = 0;
376
+
377
+ async function freshProbe(s: S, arg?: unknown): Promise<{ next: S; latest: boolean } | { kept: S; latest: boolean }> {
378
+ const seq = ++probeSeq;
379
+ const revision = editRevision;
380
+ const switches = modeSwitches;
381
+ const visits = visitsApplied;
382
+ const config = appearConfig(s, arg);
383
+ const next = await probe(s, arg, config);
384
+ if (authInFlight || revision !== editRevision || seq < appliedSeq || visits !== visitsApplied) {
385
+ const current = svc.getState();
386
+ const mode = authInFlight || switches !== modeSwitches ? {} : config.mode;
387
+ // The new visit's clean form, except for what the visitor typed since it appeared.
388
+ const visit = Object.fromEntries(Object.entries(config.visit)
389
+ .filter(([key]) => current[key as keyof S] === s[key as keyof S]));
390
+ // Dropped only because a visit reset landed meanwhile: this is still the newest probe, so
391
+ // it may still move a member off the form (the reset's own probe was not the newest).
392
+ const latest = !authInFlight && revision === editRevision && seq >= appliedSeq && seq === probeSeq;
393
+ const kept = derive({ ...current, ...appearBase(), ...mode, ...visit });
394
+ // The reset still landed even though its probe was dropped. Invalidate arg-less loads
395
+ // that started from the previous visit's state before they can restore its return path.
396
+ if (strField(arg, "standalone") === "1") visitsApplied++;
397
+ return { kept, latest };
398
+ }
399
+ appliedSeq = seq;
400
+ if (strField(arg, "standalone") === "1") visitsApplied++;
401
+ // A newer probe is still on its way: this one may land, but must not navigate.
402
+ return { next, latest: seq === probeSeq };
403
+ }
404
+ // Descriptor configuration belongs to the worker session. Keep it even when a
405
+ // delayed profile probe is discarded because the user edited the form.
406
+ let memberAccountLinksRequested = false;
407
+ let cartCountRequested = false;
408
+ const translated = (key: string) => copyParam(key, authMessage(key));
409
+
410
+ function validateAuth(s: S, operation: AuthOperation): S {
411
+ const errors = identityErrors({ email: s.email, password: passwordDraft }, operation);
412
+ return derive({ ...s, emailError: errors.email ? translated(errors.email) : "",
413
+ passwordError: errors.password ? translated(errors.password) : "",
414
+ emailFocus: errors.email ? bumpToken(s.emailFocus) : s.emailFocus,
415
+ passwordFocus: !errors.email && errors.password ? bumpToken(s.passwordFocus) : s.passwordFocus,
416
+ message: "" });
417
+ }
418
+ function rejectResult(raw: unknown, operation: AuthOperation) {
419
+ const value = raw as { status?: string; error?: unknown; payload?: { error?: unknown } } | null;
420
+ if (value?.status === "error" || value?.error || value?.payload?.error) throw authFailure(raw, operation, translated);
421
+ }
422
+ async function authenticate(s: S, operation: "signIn" | "register"): Promise<S | undefined> {
423
+ if (authInFlight) return undefined;
424
+ const checked = validateAuth(s, operation);
425
+ if (checked.emailError || checked.passwordError) return checked;
426
+ authInFlight = true;
427
+ const revision = editRevision;
428
+ const password = passwordDraft;
429
+ try {
430
+ await svc.beginAuth(); // publish busy before waiting for the network
431
+ const raw = await dispatch(operation === "signIn" ? "himi.wix.signInDirect" : "himi.wix.registerDirect", {
432
+ email: s.email.trim(), password,
433
+ // An opaque host-issued token, never a return route. Native commits it before the
434
+ // account change can destroy this worker; the replacement does not need this promise.
435
+ ...(routeInput().authContinuation ? { authContinuation: routeInput().authContinuation } : {}),
436
+ ...(operation === "register" ? { firstName: s.firstName, lastName: s.lastName } : {}),
437
+ });
438
+ rejectResult(raw, operation);
439
+ if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
440
+ const next = await probe(svc.getState());
441
+ if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
442
+ if (!next.isMember) throw { code: "unknown" };
443
+ passwordDraft = "";
444
+ return await resumeAfterAuth(completedAuth(next));
445
+ } catch (error) {
446
+ return derive({ ...svc.getState(), authBusy: false,
447
+ message: revision === editRevision ? authFailure(error, operation, translated).reason : "" });
448
+ } finally { authInFlight = false; }
449
+ }
450
+
451
+ // Next value of a focus token: never empty once requested, and never a value this worker
452
+ // issued before — one counter for every token, not "previous + 1". A visit reset puts a
453
+ // token back to "" while a pooled form's field may still be mounted; "previous + 1" would
454
+ // then republish a value that field already acted on, and it would ignore the request.
455
+ // A counter rather than Date.now() — deterministic under test, and immune to two focus
456
+ // requests landing inside the same millisecond.
457
+ let focusSeq = 0;
458
+ function bumpToken(_previous: string): string {
459
+ return String(++focusSeq);
460
+ }
461
+
462
+ // A token may be cleared ONLY by a transition that unmounts the field it targets, so
463
+ // the two transitions here clear different sets — the whole rule in two constants.
464
+ //
465
+ // A mode switch re-lays-out the card: the name fields (gated on notRegistering) go
466
+ // away, but Email is rendered in ALL three modes and stays mounted. Clearing
467
+ // `emailFocus` here would be a reset-while-mounted: Email's renderer-side "last token
468
+ // I acted on" survives, so the next bump would republish a value it has already seen
469
+ // and ignores — the Last name → Email chain would silently die after one round-trip.
470
+ const NO_FOCUS_MODE_SWITCH = { lastNameFocus: "" };
471
+
472
+ // Sign-out hides the entire login card (it is gated on isMember), Email included, so
473
+ // here both tokens must go or the re-mounted card auto-focuses Email on logout.
474
+ const NO_FOCUS_ALL = { lastNameFocus: "", emailFocus: "" };
475
+
476
+ // Every focus token, cleared once the visitor types (see setEmail).
477
+ const TYPED = { ...NO_FOCUS_ALL, passwordFocus: "" };
478
+
479
+ function authHeadline(s: S, isRegistering: boolean, isRecovering: boolean): { authTitle: string; authBody: string } {
480
+ if (isRecovering) {
481
+ return {
482
+ authTitle: copyParam("storeAccount.authTitleRecovery", "Reset password"),
483
+ authBody: copyParam("storeAccount.authBodyRecovery", "Enter your member email and we will send a reset link."),
484
+ };
485
+ }
486
+ if (isRegistering) {
487
+ return {
488
+ authTitle: copyParam("storeAccount.authTitleRegister", "Create account"),
489
+ authBody: copyParam("storeAccount.authBodyRegister", "Create a member account to continue — cart, bookings, RSVPs, and memberships stay with you."),
490
+ };
491
+ }
492
+ switch (s.authIntent) {
493
+ case "join_group":
494
+ return {
495
+ authTitle: copyParam("storeAccount.authTitleJoinGroup", "Sign in to join"),
496
+ authBody: s.authContextName
497
+ ? copyTemplate("storeAccount.authBodyJoinGroupNamed", "Sign in to join {name}, then we’ll bring you back.", { name: s.authContextName })
498
+ : copyParam("storeAccount.authBodyJoinGroup", "Sign in to join this group, then we’ll bring you back."),
499
+ };
500
+ case "rsvp":
501
+ return {
502
+ authTitle: copyParam("storeAccount.authTitleRsvp", "Sign in to RSVP"),
503
+ authBody: copyParam("storeAccount.authBodyRsvp", "Sign in to RSVP, then we’ll bring you back."),
504
+ };
505
+ case "book":
506
+ return {
507
+ authTitle: copyParam("storeAccount.authTitleBook", "Sign in to book"),
508
+ authBody: copyParam("storeAccount.authBodyBook", "Sign in to book this time, then we’ll bring you back."),
509
+ };
510
+ case "post":
511
+ return {
512
+ authTitle: copyParam("storeAccount.authTitlePost", "Sign in to post"),
513
+ authBody: copyParam("storeAccount.authBodyPost", "Sign in to join the conversation, then we’ll bring you back."),
514
+ };
515
+ default:
516
+ return {
517
+ authTitle: copyParam("storeAccount.authTitle", "Welcome"),
518
+ authBody: copyParam("storeAccount.authBody", "Sign in to continue — cart, bookings, RSVPs, and memberships stay with you."),
519
+ };
520
+ }
521
+ }
522
+
523
+ interface S extends IapRestoreFields {
524
+ status: "loading" | "ready";
525
+ isMember: boolean;
526
+ notMember: boolean;
527
+ identityLine: string;
528
+ detailLine: string;
529
+ memberName: string;
530
+ memberEmail: string;
531
+ memberImage: string;
532
+ memberInitials: string;
533
+ hasMemberImage: boolean;
534
+ noMemberImage: boolean;
535
+ authTitle: string;
536
+ authBody: string;
537
+ /** Mid-flow gate intent (`join_group` | `rsvp` | `book` | `post` | ""). */
538
+ authIntent: string;
539
+ authContextName: string;
540
+ returnScreenId: string;
541
+ returnId: string;
542
+ returnChannelId: string;
543
+ /** Show Continue when an already-signed-in member opens Account with a return path.
544
+ * A sign-in made here resumes on its own (resumeAfterAuth). */
545
+ hasReturnPath: boolean;
546
+ noReturnPath: boolean;
547
+ returnCta: string;
548
+ email: string;
549
+ /** Legacy snapshot slot, always empty. The active form keeps its password in
550
+ * transient memory for retry; hydration never restores a persisted secret. */
551
+ password: string;
552
+ authBusy: boolean;
553
+ busyMessage?: string;
554
+ emailError: string;
555
+ passwordError: string;
556
+ passwordFocus: string;
557
+ firstName: string;
558
+ lastName: string;
559
+ // Focus TOKENS (`TextFieldProps.focus_path`), not flags: the bound field focuses
560
+ // whenever the token becomes a new non-empty value, so a monotonic counter is the
561
+ // shape — a latched boolean cannot request focus a second time. Every other
562
+ // transition here goes through derive({...s}), which carries them, and they are
563
+ // deliberately never reset: re-publishing a token the renderer has already seen
564
+ // is ignored, which would make the Next key go dead.
565
+ lastNameFocus: string;
566
+ emailFocus: string;
567
+ message: string;
568
+ hideMessage: boolean;
569
+ messageKind: "error" | "success";
570
+ resetSent: boolean;
571
+ isLoading: boolean;
572
+ notLoading: boolean;
573
+ isRegistering: boolean;
574
+ notRegistering: boolean;
575
+ isRecovering: boolean;
576
+ notRecovering: boolean;
577
+ hideSignInChoices: boolean;
578
+ activityTitle: string;
579
+ activitySummary: string;
580
+ activityRows: AccountActivityRow[];
581
+ activityEmptyText: string;
582
+ hasActivity: boolean;
583
+ noActivity: boolean;
584
+ /** Set once a descriptor asks for the member-account links (appear param
585
+ * `memberAccountLinks: "1"`). Only then does the probe read app_info, so a descriptor
586
+ * that renders no such link need not declare that capability. */
587
+ memberAccountLinks: boolean;
588
+ /** Hides My Addresses where this runtime cannot reach the address book. */
589
+ noMemberAddresses: boolean;
590
+ /** Hides My Wallet where this runtime cannot reach saved cards. */
591
+ noMemberWallet: boolean;
592
+ /** Set once a descriptor asks for the Restore purchases row (appear param
593
+ * `restorePurchases: "1"`). Only then does the worker reach the App Store layer, so a
594
+ * descriptor that renders no such row need not declare `iap`. */
595
+ restorePurchases: boolean;
596
+ /** Top-bar cart badge, read only once a descriptor asks for it (appear param
597
+ * `cartCount: "1"`), so an app with no store never reads a cart. A guest has a
598
+ * visitor cart too, so this is read for members and guests alike. */
599
+ cartCount: number;
600
+ /** "Hey, guest" / "Hey, <first name>". */
601
+ greeting: string;
602
+ /** The member's first name alone. Account puts it after its own translated "Hey,":
603
+ * the server translates descriptor copy, never worker copy. */
604
+ greetingFirstName: string;
605
+ /** Guest header: hidden for a member and while the first session check runs. */
606
+ hideGuest: boolean;
607
+ /** Member header and the Sign out footer: hidden for a guest and while loading. */
608
+ hideMember: boolean;
609
+ /** Account only (appear param): the standalone sign-in screen a guest is sent to. */
610
+ signInScreen: string;
611
+ /** The standalone sign-in screen itself (appear param `standalone: "1"`). */
612
+ standalone: boolean;
613
+ /** Account only (appear param `pollIdentity: "1"`): re-read the session on a timer. */
614
+ pollIdentity: boolean;
615
+ }
616
+
617
+ // Restore purchases (App Review 3.1.1) for every vertical the app sells through the App Store. The
618
+ // row shows once purchasing is ready on this host (a bound iOS binary with managed StoreKit), to a
619
+ // guest too: the restore itself asks them to sign in.
620
+ const commerce = createIapCommerce({
621
+ adapters: [onlineProgramOrders, pricingPlanOrders, storesProductOrders],
622
+ onChange: () => { void svc.restorePublish(); },
623
+ });
624
+ const restore = createIapRestore(commerce, { prefix: "storeAccount", repaint: () => { void svc.restorePublish(); } });
625
+ let commerceEntered = false;
626
+
627
+ /** The first entry reads readiness and recovers held purchases; later ones reconcile, as on any
628
+ * screen that sells. */
629
+ function enterCommerce(): void {
630
+ void (commerceEntered ? commerce.reconcile() : commerce.start());
631
+ commerceEntered = true;
632
+ }
633
+
634
+ function derive(s: S): S {
635
+ const isRegistering = !!s.isRegistering;
636
+ const isRecovering = !!s.isRecovering;
637
+ const hasActivity = s.activityRows.length > 0;
638
+ // Empty until the screen's copy pack (or a probe) arrives: the boot state is built before
639
+ // any copy, and its English default would paint first in a translated app.
640
+ const headline = headingReady ? authHeadline(s, isRegistering, isRecovering) : { authTitle: "", authBody: "" };
641
+ const hasReturnPath = !!s.isMember && !!s.returnScreenId;
642
+ const loading = s.status === "loading";
643
+ const name = s.isMember ? greetingName(s.memberName) : "";
644
+ return {
645
+ ...s,
646
+ hideMessage: !s.message,
647
+ messageKind: s.resetSent ? "success" : "error",
648
+ resetSent: !!s.message && !!s.resetSent,
649
+ greeting: name
650
+ ? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
651
+ : copyParam("storeAccount.greetingGuest", "Hey, guest"),
652
+ greetingFirstName: name,
653
+ hideGuest: loading || !!s.isMember,
654
+ hideMember: loading || !s.isMember,
655
+ password: "",
656
+ busyMessage: s.authBusy ? translated("auth.feedback.busy") : "",
657
+ isLoading: s.status === "loading",
658
+ notLoading: s.status !== "loading",
659
+ notMember: !s.isMember,
660
+ isRegistering,
661
+ notRegistering: !isRegistering,
662
+ isRecovering,
663
+ notRecovering: !isRecovering,
664
+ hideSignInChoices: isRegistering || isRecovering,
665
+ hasActivity,
666
+ noActivity: !hasActivity,
667
+ ...restore.fields(s.restorePurchases && commerce.readiness().status === "ready"),
668
+ authTitle: headline.authTitle,
669
+ authBody: headline.authBody,
670
+ hasReturnPath,
671
+ noReturnPath: !hasReturnPath,
672
+ returnCta: s.authIntent === "join_group"
673
+ ? copyParam("storeAccount.returnJoinGroupCta", "Back to group")
674
+ : s.authIntent === "rsvp"
675
+ ? copyParam("storeAccount.returnRsvpCta", "Back to event")
676
+ : s.authIntent === "post"
677
+ ? copyParam("storeAccount.returnPostCta", "Back to feed")
678
+ : copyParam("storeAccount.returnCta", "Continue"),
679
+ };
680
+ }
681
+
682
+ function orderEmail(order: WixOrder): string {
683
+ return (order.buyerInfo?.email || "").toLowerCase();
684
+ }
685
+
686
+ function itemCount(order: WixOrder): string {
687
+ const total = (order.lineItems ?? []).reduce((sum, item) => sum + (item.quantity || 1), 0);
688
+ if (!total) return "";
689
+ return `${total} ${total === 1 ? "item" : "items"}`;
690
+ }
691
+
692
+ function orderRow(order: WixOrder): AccountActivityRow {
693
+ const total = order.priceSummary?.total?.formattedAmount || "";
694
+ const meta = [fmtDate(order.createdDate), itemCount(order)].filter(Boolean).join(" · ");
695
+ return {
696
+ id: order.id || order.number || "order",
697
+ title: `Order #${order.number || order.id || ""}`.trim(),
698
+ subtitle: total || "Order total unavailable",
699
+ meta,
700
+ status: titleCase(order.fulfillmentStatus || order.paymentStatus) || "Order",
701
+ };
702
+ }
703
+
704
+ async function orderRows(memberEmail: string): Promise<AccountActivityRow[]> {
705
+ if (!memberEmail) return [];
706
+ const res = await searchOrders({
707
+ search: {
708
+ cursorPaging: { limit: 30 },
709
+ sort: [{ fieldName: "createdDate", order: "DESC" }],
710
+ },
711
+ });
712
+ return (res.orders ?? [])
713
+ .filter((order) => orderEmail(order) === memberEmail.toLowerCase())
714
+ .slice(0, 3)
715
+ .map(orderRow);
716
+ }
717
+
718
+ /** A failed read keeps the count the badge last showed (`known`): an unreachable cart
719
+ * must not read as an emptied one. Before any read succeeds, that is 0 — no badge. */
720
+ async function cartItemCount(known: number): Promise<number> {
721
+ try {
722
+ const cart = await getCurrentCart();
723
+ return (cart.lineItems ?? []).reduce((n, li) => n + (li.quantity ?? 1), 0);
724
+ } catch {
725
+ return known;
726
+ }
727
+ }
728
+
729
+ async function probe(s: S, arg?: unknown, config: AppearConfig = appearConfig(s, arg)): Promise<S> {
730
+ memberAccountLinksRequested ||= s.memberAccountLinks || strField(arg, "memberAccountLinks") === "1";
731
+ // A new visit to the form reads its intent and return path from its own route only: the
732
+ // last visit's (an abandoned gate) must not be resumed by a plain sign-in.
733
+ const intent = authIntentFromArg(arg, strField(arg, "standalone") === "1" ? NO_VISIT : s);
734
+ cartCountRequested ||= strField(arg, "cartCount") === "1";
735
+ // Beside the profile, not after it: the badge must not add a round trip to the paint.
736
+ // Not asked for (yet — the boot load runs before the appear params): keep the count the
737
+ // snapshot restored, not a 0 that would empty the badge until the appear refresh lands.
738
+ const cartCountRead = cartCountRequested ? cartItemCount(s.cartCount ?? 0) : Promise.resolve(s.cartCount ?? 0);
739
+ const profile = await loadMemberProfile(copyParam("storeAccount.guestDetail", "Sign in to keep your cart and orders connected."));
740
+ // Not the boot load: it never carries the copy, and the appear refresh that does is coming.
741
+ if (strField(arg, "boot") !== "1") headingReady = true;
742
+ const memberAccountLinks = memberAccountLinksRequested;
743
+ if (restorePurchasesRequested) enterCommerce();
744
+ const routes = memberAccountLinks ? await memberAccountRoutes() : { addresses: false, wallet: false };
745
+ let activityRows: AccountActivityRow[] = [];
746
+ if (profile.isMember) {
747
+ try {
748
+ activityRows = await orderRows(profile.memberEmail);
749
+ } catch {
750
+ activityRows = [];
751
+ }
752
+ }
753
+ const cartCount = await cartCountRead;
754
+ return derive({
755
+ ...s,
756
+ ...intent,
757
+ status: "ready",
758
+ cartCount,
759
+ isMember: profile.isMember,
760
+ identityLine: profile.identityLine,
761
+ detailLine: profile.detailLine,
762
+ memberName: profile.memberName,
763
+ memberEmail: profile.memberEmail,
764
+ memberImage: profile.memberImage,
765
+ memberInitials: profile.memberInitials,
766
+ hasMemberImage: profile.hasMemberImage,
767
+ noMemberImage: profile.noMemberImage,
768
+ email: profile.memberEmail || s.email,
769
+ message: "",
770
+ memberAccountLinks,
771
+ ...appearBase(),
772
+ ...config.mode,
773
+ ...config.visit,
774
+ noMemberAddresses: !routes.addresses,
775
+ noMemberWallet: !routes.wallet,
776
+ activityRows,
777
+ activityTitle: copyParam("storeAccount.activityTitle", "Previous orders"),
778
+ activitySummary: activityRows.length
779
+ ? `${activityRows.length} recent ${activityRows.length === 1 ? "order" : "orders"}`
780
+ : copyParam("storeAccount.activityHint", "Orders are loaded from the store."),
781
+ activityEmptyText: profile.isMember
782
+ ? copyParam("storeAccount.activityEmptyMember", "No previous orders for this member yet.")
783
+ : copyParam("storeAccount.activityEmptyGuest", "Sign in to see orders."),
784
+ });
785
+ }
786
+
787
+ function completedAuth(s: S): S {
788
+ return derive({
789
+ ...s,
790
+ password: "",
791
+ authBusy: false, emailError: "", passwordError: "", passwordFocus: "",
792
+ firstName: "",
793
+ lastName: "",
794
+ isRegistering: false,
795
+ isRecovering: false,
796
+ message: "",
797
+ });
798
+ }
799
+
800
+ const svc = defineService<S, {
801
+ beginAuth: (s: S) => S;
802
+ submit: (s: S) => Promise<S | undefined>;
803
+ load: (s: S, arg?: unknown) => Promise<S>;
804
+ refresh: (s: S, arg?: unknown) => Promise<S>;
805
+ setEmail: (s: S, arg?: unknown) => S;
806
+ setPassword: (s: S, arg?: unknown) => S;
807
+ setFirstName: (s: S, arg?: unknown) => S;
808
+ setLastName: (s: S, arg?: unknown) => S;
809
+ focusLastName: (s: S) => S;
810
+ focusEmail: (s: S) => S;
811
+ showRegister: (s: S) => S;
812
+ showSignIn: (s: S) => S;
813
+ showRecovery: (s: S) => S;
814
+ resetPassword: (s: S) => Promise<S>;
815
+ signIn: (s: S) => Promise<S | undefined>;
816
+ register: (s: S) => Promise<S | undefined>;
817
+ signOut: (s: S) => Promise<S>;
818
+ sync: (s: S) => Promise<S | undefined>;
819
+ openMember: (s: S, arg?: unknown) => Promise<S>;
820
+ leave: (s: S) => S;
821
+ restorePublish: (s: S) => S;
822
+ iapRestore: (s: S) => Promise<undefined>;
823
+ }>("himiStoreAccount", {
824
+ notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
825
+ state: derive({
826
+ status: "loading",
827
+ isMember: false,
828
+ notMember: true,
829
+ identityLine: "",
830
+ detailLine: "",
831
+ memberName: "",
832
+ memberEmail: "",
833
+ memberImage: "",
834
+ memberInitials: "M",
835
+ hasMemberImage: false,
836
+ noMemberImage: true,
837
+ authTitle: "Welcome",
838
+ authBody: "Sign in to continue — cart, bookings, RSVPs, and memberships stay with you.",
839
+ authIntent: "",
840
+ authContextName: "",
841
+ returnScreenId: "",
842
+ returnId: "",
843
+ returnChannelId: "",
844
+ hasReturnPath: false,
845
+ noReturnPath: true,
846
+ returnCta: "Continue",
847
+ email: "",
848
+ password: "",
849
+ authBusy: false, emailError: "", passwordError: "", passwordFocus: "",
850
+ firstName: "",
851
+ lastName: "",
852
+ lastNameFocus: "",
853
+ emailFocus: "",
854
+ message: "",
855
+ hideMessage: true,
856
+ messageKind: "error",
857
+ resetSent: false,
858
+ isLoading: true,
859
+ notLoading: false,
860
+ // The form's first paint is already on its route's mode: only sign-in's route has `mode`.
861
+ isRegistering: ROUTE_ASKS_REGISTER,
862
+ notRegistering: true,
863
+ isRecovering: false,
864
+ notRecovering: true,
865
+ hideSignInChoices: false,
866
+ activityTitle: "Previous orders",
867
+ activitySummary: "",
868
+ activityRows: [],
869
+ activityEmptyText: "No previous orders for this member yet.",
870
+ hasActivity: false,
871
+ noActivity: true,
872
+ memberAccountLinks: false,
873
+ noMemberAddresses: true,
874
+ noMemberWallet: true,
875
+ restorePurchases: false,
876
+ cartCount: 0,
877
+ greeting: "Hey, guest",
878
+ greetingFirstName: "",
879
+ hideGuest: true,
880
+ hideMember: true,
881
+ signInScreen: "",
882
+ standalone: false,
883
+ pollIdentity: false,
884
+ ...NO_IAP_RESTORE,
885
+ }),
886
+ actions: {
887
+ submit: (s): Promise<S | undefined> => s.isRecovering ? svc.resetPassword() : authenticate(s, s.isRegistering ? "register" : "signIn"),
888
+ beginAuth: (s) => derive({ ...s, authBusy: true, message: "", emailError: "", passwordError: "" }),
889
+ load: async (s, arg): Promise<S> => { stashScreenCopy(arg); return afterProbe(await freshProbe(s, arg), arg); },
890
+ refresh: async (s, arg): Promise<S> => { stashScreenCopy(arg); return afterProbe(await freshProbe(s, arg), arg); },
891
+ // Idle ticks return undefined, so an unchanged session costs no re-render.
892
+ sync: async (s): Promise<S | undefined> => {
893
+ if (authInFlight) return undefined;
894
+ const email = (await signedInEmail()).toLowerCase();
895
+ // An empty read during a poll is a failed read as often as a sign-out (a network blip,
896
+ // a 5xx): it never turns a member into a guest. Account's own Sign out, and the next
897
+ // appear refresh, handle a real sign-out.
898
+ if (!email && s.isMember) return undefined;
899
+ if (email === s.memberEmail.toLowerCase() && !!email === s.isMember) return undefined;
900
+ const r = await freshProbe(s);
901
+ return "next" in r ? r.next : undefined;
902
+ },
903
+ // A row to a member-only screen shows to a guest too. A member opens it; a guest signs
904
+ // in first, and the sign-in screen then opens the row's screen — as a modal, by closing
905
+ // and pushing it on this tab (openSignIn) — so Back returns here either way.
906
+ openMember: async (s, arg): Promise<S> => {
907
+ const screenId = strField(arg, "screenId");
908
+ if (!screenId) return s;
909
+ const member = s.isMember || !!await signedInEmail();
910
+ // From the state as it is now: a probe may have landed during the identity read.
911
+ const now = svc.getState();
912
+ if (member) return navigate(now, { screenId });
913
+ return openSignIn(now, { mode: "signin" }, { screenId });
914
+ },
915
+ // The standalone form's Continue: leaves the form the way it was opened.
916
+ leave: (s) => navigate(s, { presentation: leaveNav() }),
917
+ // Typing means any focus request was delivered: clear the tokens (safe while mounted, since
918
+ // bumpToken never repeats), so a visit rarely ends — and a pooled form rarely reopens —
919
+ // holding one.
920
+ // A setter given the value it already has is not an edit: a hidden form's secure field
921
+ // clears itself on unmount (setPassword("")), and counting that would drop the probe
922
+ // that is about to move a member off the form.
923
+ setEmail: (s, arg) => { if (strOf(arg).trim() === s.email) return s; editRevision++; const next = { ...s, ...TYPED, email: strOf(arg).trim(), message: "" }; return derive({ ...next, emailError: s.emailError ? (identityErrors({ email: next.email }, "reset").email ? translated(identityErrors({ email: next.email }, "reset").email!) : "") : "" }); },
924
+ setPassword: (s, arg) => { if (strOf(arg) === passwordDraft) return s; editRevision++; passwordDraft = strOf(arg); return derive({ ...s, ...TYPED, message: "", passwordError: s.passwordError && !passwordDraft ? translated("auth.validation.passwordRequired") : "" }); },
925
+ setFirstName: (s, arg) => { if (strOf(arg) === s.firstName) return s; editRevision++; return derive({ ...s, ...TYPED, firstName: strOf(arg), message: "" }); },
926
+ setLastName: (s, arg) => { if (strOf(arg) === s.lastName) return s; editRevision++; return derive({ ...s, ...TYPED, lastName: strOf(arg), message: "" }); },
927
+ // The register form's Next keys. Only first/last name carry one: they share a
928
+ // single visibility gate (notRegistering) so their target is always on screen.
929
+ // Email deliberately does NOT chain to password — see the comment on the
930
+ // descriptor: password is hidden while recovering, and submitLabel is static.
931
+ focusLastName: (s) => derive({ ...s, lastNameFocus: bumpToken(s.lastNameFocus) }),
932
+ focusEmail: (s) => derive({ ...s, emailFocus: bumpToken(s.emailFocus) }),
933
+ // A mode switch RE-LAYS-OUT this card, mounting and unmounting fields behind
934
+ // `hiddenWhen`. A re-mounted field treats its first seed as "focus me on open", so
935
+ // a carried-over token would drop the user into the MIDDLE of the form — leaving
936
+ // register and coming back would open focused on Last name, skipping First name.
937
+ // Only the tokens whose fields actually unmount here are cleared: see
938
+ // NO_FOCUS_MODE_SWITCH for why Email's is deliberately NOT among them.
939
+ showRegister: (s) => { if (authInFlight) return s; editRevision++; modeSwitches++; headingReady = true; return derive({ ...s, isRegistering: true, isRecovering: false, message: "", emailError: "", passwordError: "", ...NO_FOCUS_MODE_SWITCH }) },
940
+ showSignIn: (s) => { if (authInFlight) return s; editRevision++; modeSwitches++; headingReady = true; return derive({ ...s, isRegistering: false, isRecovering: false, message: "", emailError: "", passwordError: "", ...NO_FOCUS_MODE_SWITCH }) },
941
+ showRecovery: (s) => { if (authInFlight) return s; editRevision++; modeSwitches++; headingReady = true; return derive({ ...s, isRegistering: false, isRecovering: true, password: "", message: "", emailError: "", passwordError: "", ...NO_FOCUS_MODE_SWITCH }) },
942
+ resetPassword: async (s): Promise<S> => {
943
+ if (authInFlight) return s;
944
+ const checked = validateAuth(s, "reset");
945
+ if (checked.emailError) return checked;
946
+ authInFlight = true;
947
+ const revision = editRevision;
948
+ try {
949
+ await svc.beginAuth();
950
+ const raw = await dispatch("himi.wix.resetPassword", { email: s.email.trim() });
951
+ rejectResult(raw, "reset");
952
+ if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
953
+ return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
954
+ resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
955
+ } catch (error) {
956
+ return derive({ ...svc.getState(), authBusy: false,
957
+ resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
958
+ } finally { authInFlight = false; }
959
+ },
960
+ signIn: (s) => authenticate(s, "signIn"),
961
+ register: (s) => authenticate(s, "register"),
962
+ signOut: async (s): Promise<S> => {
963
+ if (authInFlight) return svc.getState();
964
+ passwordDraft = ""; editRevision++;
965
+ routeInputConsumed = true;
966
+ try { await dispatch("himi.wix.signOut"); } catch { /* ignore */ }
967
+ // Do NOT re-probe via getMyData after logout — visitor-scoped my-data can
968
+ // still return a site nickname and resurrect isMember (BUG-3). Trust the
969
+ // cleared session and paint the guest form immediately.
970
+ const guest = guestProfile(copyParam("storeAccount.guestDetail", "Sign in to keep your cart and orders connected."));
971
+ const cleared = {
972
+ ...s,
973
+ ...guest,
974
+ status: "ready" as const,
975
+ isMember: false,
976
+ isRegistering: false,
977
+ isRecovering: false,
978
+ message: "",
979
+ password: "",
980
+ // Signing out re-mounts the whole login card (it hides behind isMember), so a
981
+ // carried token would auto-focus Email and pop the keyboard the instant the
982
+ // user logs out. This is the one transition that unmounts Email too, so unlike
983
+ // the mode switches it clears BOTH tokens.
984
+ ...NO_FOCUS_ALL,
985
+ activityRows: [] as AccountActivityRow[],
986
+ activityEmptyText: copyParam("storeAccount.activityEmptyGuest", "Sign in to see orders."),
987
+ authIntent: "",
988
+ authContextName: "",
989
+ returnScreenId: "",
990
+ returnId: "",
991
+ returnChannelId: "",
992
+ // The member's cart stays with the member; the new visitor session has its own.
993
+ cartCount: cartCountRequested ? await cartItemCount(0) : 0,
994
+ ...(s.pollIdentity ? { _poll: { ...IDENTITY_POLL } } : {}),
995
+ };
996
+ return derive(cleared);
997
+ },
998
+ restorePublish: (s) => derive(s),
999
+ iapRestore: async () => { await restore.run(); return undefined; },
1000
+ },
1001
+ });
1002
+
1003
+ resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
1004
+ // `boot` tells settle this is not a visit: the host drops this call's navigation, and the
1005
+ // appear refresh does the visit's moves.
1006
+ svc.load({ boot: "1" });
1007
+ export { svc };