@wix/himalaya-cli 0.1847.0 → 0.1849.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 (488) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/business-contact.d.ts +5 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +12 -5
  3. package/dist/browser-plane/assets.json +5 -5
  4. package/dist/browser-plane/preview-deferred/{33204224f8dccbd7094c8b6cb3df3995758bb67e81b987f4e6843897987e39f9.bin → 166f7ee733ea8d0fe7bba8b796232efd4f5413e22af4a8aeee20cae1069b2fd6.bin} +1 -1
  5. package/dist/browser-plane/sw.js +7 -7
  6. package/dist/cli.mjs +2016 -1428
  7. package/dist/preview-assets.generated.bin +0 -0
  8. package/guides/designing-himi-screens.md +5 -0
  9. package/guides/himi-json-output.md +17 -0
  10. package/guides/mobile-ux.md +8 -4
  11. package/guides/release-notes.md +13 -0
  12. package/guides/skill.md +1 -1
  13. package/package.json +2 -2
  14. package/templates/beauty-salon/dev/index.ts +7 -3
  15. package/templates/beauty-salon/l10n/ar.json +10 -0
  16. package/templates/beauty-salon/l10n/cs.json +10 -0
  17. package/templates/beauty-salon/l10n/da.json +10 -0
  18. package/templates/beauty-salon/l10n/de.json +10 -0
  19. package/templates/beauty-salon/l10n/el.json +10 -0
  20. package/templates/beauty-salon/l10n/es.json +10 -0
  21. package/templates/beauty-salon/l10n/fi.json +10 -0
  22. package/templates/beauty-salon/l10n/fr.json +10 -0
  23. package/templates/beauty-salon/l10n/he.json +8 -0
  24. package/templates/beauty-salon/l10n/hu.json +10 -0
  25. package/templates/beauty-salon/l10n/id.json +10 -0
  26. package/templates/beauty-salon/l10n/it.json +10 -0
  27. package/templates/beauty-salon/l10n/ja.json +10 -0
  28. package/templates/beauty-salon/l10n/ko.json +10 -0
  29. package/templates/beauty-salon/l10n/lt.json +10 -0
  30. package/templates/beauty-salon/l10n/nl.json +10 -0
  31. package/templates/beauty-salon/l10n/no.json +10 -0
  32. package/templates/beauty-salon/l10n/pl.json +10 -0
  33. package/templates/beauty-salon/l10n/pt.json +10 -0
  34. package/templates/beauty-salon/l10n/ru.json +10 -0
  35. package/templates/beauty-salon/l10n/sv.json +10 -0
  36. package/templates/beauty-salon/l10n/th.json +10 -0
  37. package/templates/beauty-salon/l10n/tr.json +10 -0
  38. package/templates/beauty-salon/l10n/uk.json +10 -0
  39. package/templates/beauty-salon/l10n/vi.json +10 -0
  40. package/templates/beauty-salon/l10n/zh.json +10 -0
  41. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +26 -3
  42. package/templates/beauty-salon/tier5-src/_shared/member-avatar.ts +76 -0
  43. package/templates/beauty-salon/tier5-src/_shared/result-snackbar.ts +26 -0
  44. package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +9 -2
  45. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +11 -4
  46. package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +6 -2
  47. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +70 -3
  48. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  49. package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  50. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +13 -2
  51. package/templates/beauty-salon-owner/dev/index.ts +1 -0
  52. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +26 -3
  53. package/templates/beauty-salon-owner/tier5-src/_shared/himi-account.ts +209 -0
  54. package/templates/beauty-salon-owner/tier5-src/_shared/member-avatar.ts +76 -0
  55. package/templates/branded-lite/dev/index.ts +7 -3
  56. package/templates/branded-lite/l10n/ar.json +10 -0
  57. package/templates/branded-lite/l10n/cs.json +10 -0
  58. package/templates/branded-lite/l10n/da.json +10 -0
  59. package/templates/branded-lite/l10n/de.json +10 -0
  60. package/templates/branded-lite/l10n/el.json +10 -0
  61. package/templates/branded-lite/l10n/es.json +10 -0
  62. package/templates/branded-lite/l10n/fi.json +10 -0
  63. package/templates/branded-lite/l10n/fr.json +10 -0
  64. package/templates/branded-lite/l10n/he.json +8 -0
  65. package/templates/branded-lite/l10n/hu.json +10 -0
  66. package/templates/branded-lite/l10n/id.json +10 -0
  67. package/templates/branded-lite/l10n/it.json +10 -0
  68. package/templates/branded-lite/l10n/ja.json +10 -0
  69. package/templates/branded-lite/l10n/ko.json +10 -0
  70. package/templates/branded-lite/l10n/lt.json +10 -0
  71. package/templates/branded-lite/l10n/nl.json +10 -0
  72. package/templates/branded-lite/l10n/no.json +10 -0
  73. package/templates/branded-lite/l10n/pl.json +10 -0
  74. package/templates/branded-lite/l10n/pt.json +10 -0
  75. package/templates/branded-lite/l10n/ru.json +10 -0
  76. package/templates/branded-lite/l10n/sv.json +10 -0
  77. package/templates/branded-lite/l10n/th.json +10 -0
  78. package/templates/branded-lite/l10n/tr.json +10 -0
  79. package/templates/branded-lite/l10n/uk.json +10 -0
  80. package/templates/branded-lite/l10n/vi.json +10 -0
  81. package/templates/branded-lite/l10n/zh.json +10 -0
  82. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +19 -3
  83. package/templates/branded-lite/tier5-src/_shared/member-avatar.ts +76 -0
  84. package/templates/branded-lite/tier5-src/_shared/result-snackbar.ts +26 -0
  85. package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +9 -2
  86. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +11 -4
  87. package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +6 -2
  88. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +70 -3
  89. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  90. package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  91. package/templates/branded-lite/tier5-src/himi-branded-lite-member-programs/index.ts +15 -4
  92. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +13 -2
  93. package/templates/brandy/tier5-src/_shared/collection-service.ts +19 -3
  94. package/templates/brandy/tier5-src/_shared/member-avatar.ts +76 -0
  95. package/templates/brandy/tier5-src/himi-store-account/index.ts +13 -2
  96. package/templates/community-club/dev/index.ts +2 -1
  97. package/templates/community-club/l10n/ar.json +10 -0
  98. package/templates/community-club/l10n/cs.json +10 -0
  99. package/templates/community-club/l10n/da.json +10 -0
  100. package/templates/community-club/l10n/de.json +10 -0
  101. package/templates/community-club/l10n/el.json +10 -0
  102. package/templates/community-club/l10n/es.json +10 -0
  103. package/templates/community-club/l10n/fi.json +10 -0
  104. package/templates/community-club/l10n/fr.json +10 -0
  105. package/templates/community-club/l10n/he.json +8 -0
  106. package/templates/community-club/l10n/hu.json +10 -0
  107. package/templates/community-club/l10n/id.json +10 -0
  108. package/templates/community-club/l10n/it.json +10 -0
  109. package/templates/community-club/l10n/ja.json +10 -0
  110. package/templates/community-club/l10n/ko.json +10 -0
  111. package/templates/community-club/l10n/lt.json +10 -0
  112. package/templates/community-club/l10n/nl.json +10 -0
  113. package/templates/community-club/l10n/no.json +10 -0
  114. package/templates/community-club/l10n/pl.json +10 -0
  115. package/templates/community-club/l10n/pt.json +10 -0
  116. package/templates/community-club/l10n/ru.json +10 -0
  117. package/templates/community-club/l10n/sv.json +10 -0
  118. package/templates/community-club/l10n/th.json +10 -0
  119. package/templates/community-club/l10n/tr.json +10 -0
  120. package/templates/community-club/l10n/uk.json +10 -0
  121. package/templates/community-club/l10n/vi.json +10 -0
  122. package/templates/community-club/l10n/zh.json +10 -0
  123. package/templates/community-club/tier5-src/_shared/collection-service.ts +26 -3
  124. package/templates/community-club/tier5-src/_shared/member-avatar.ts +76 -0
  125. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  126. package/templates/community-club/tier5-src/himi-store-account/index.ts +13 -2
  127. package/templates/community-club-owner/dev/index.ts +1 -0
  128. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +26 -3
  129. package/templates/community-club-owner/tier5-src/_shared/himi-account.ts +209 -0
  130. package/templates/community-club-owner/tier5-src/_shared/member-avatar.ts +76 -0
  131. package/templates/conference/tier5-src/_shared/collection-service.ts +26 -3
  132. package/templates/conference/tier5-src/_shared/member-avatar.ts +76 -0
  133. package/templates/conference/tier5-src/himi-store-account/index.ts +13 -2
  134. package/templates/events-meetups/dev/index.ts +2 -1
  135. package/templates/events-meetups/l10n/ar.json +10 -0
  136. package/templates/events-meetups/l10n/cs.json +10 -0
  137. package/templates/events-meetups/l10n/da.json +10 -0
  138. package/templates/events-meetups/l10n/de.json +10 -0
  139. package/templates/events-meetups/l10n/el.json +10 -0
  140. package/templates/events-meetups/l10n/es.json +10 -0
  141. package/templates/events-meetups/l10n/fi.json +10 -0
  142. package/templates/events-meetups/l10n/fr.json +10 -0
  143. package/templates/events-meetups/l10n/he.json +8 -0
  144. package/templates/events-meetups/l10n/hu.json +10 -0
  145. package/templates/events-meetups/l10n/id.json +10 -0
  146. package/templates/events-meetups/l10n/it.json +10 -0
  147. package/templates/events-meetups/l10n/ja.json +10 -0
  148. package/templates/events-meetups/l10n/ko.json +10 -0
  149. package/templates/events-meetups/l10n/lt.json +10 -0
  150. package/templates/events-meetups/l10n/nl.json +10 -0
  151. package/templates/events-meetups/l10n/no.json +10 -0
  152. package/templates/events-meetups/l10n/pl.json +10 -0
  153. package/templates/events-meetups/l10n/pt.json +10 -0
  154. package/templates/events-meetups/l10n/ru.json +10 -0
  155. package/templates/events-meetups/l10n/sv.json +10 -0
  156. package/templates/events-meetups/l10n/th.json +10 -0
  157. package/templates/events-meetups/l10n/tr.json +10 -0
  158. package/templates/events-meetups/l10n/uk.json +10 -0
  159. package/templates/events-meetups/l10n/vi.json +10 -0
  160. package/templates/events-meetups/l10n/zh.json +10 -0
  161. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +26 -3
  162. package/templates/events-meetups/tier5-src/_shared/member-avatar.ts +76 -0
  163. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  164. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +13 -2
  165. package/templates/events-meetups-owner/dev/index.ts +1 -0
  166. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +26 -3
  167. package/templates/events-meetups-owner/tier5-src/_shared/himi-account.ts +209 -0
  168. package/templates/events-meetups-owner/tier5-src/_shared/member-avatar.ts +76 -0
  169. package/templates/fitness-gym/config.ts +55 -17
  170. package/templates/fitness-gym/dev/index.ts +5784 -2453
  171. package/templates/fitness-gym/himalaya.content.json +19 -1
  172. package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +26 -3
  173. package/templates/fitness-gym/tier5-src/_shared/member-avatar.ts +76 -0
  174. package/templates/fitness-gym/tier5-src/_shared/result-snackbar.ts +26 -0
  175. package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +9 -2
  176. package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +11 -4
  177. package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +6 -2
  178. package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +70 -3
  179. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  180. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  181. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  182. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/personal-info.ts +824 -0
  183. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  184. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  185. package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  186. package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +15 -4
  187. package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +5 -2
  188. package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +57 -6
  189. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +13 -2
  190. package/templates/fitness-gym/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  191. package/templates/fitness-gym/tokens.json +6 -0
  192. package/templates/gym-fitness/dev/index.ts +7 -3
  193. package/templates/gym-fitness/l10n/ar.json +10 -0
  194. package/templates/gym-fitness/l10n/cs.json +10 -0
  195. package/templates/gym-fitness/l10n/da.json +10 -0
  196. package/templates/gym-fitness/l10n/de.json +10 -0
  197. package/templates/gym-fitness/l10n/el.json +10 -0
  198. package/templates/gym-fitness/l10n/es.json +10 -0
  199. package/templates/gym-fitness/l10n/fi.json +10 -0
  200. package/templates/gym-fitness/l10n/fr.json +10 -0
  201. package/templates/gym-fitness/l10n/he.json +8 -0
  202. package/templates/gym-fitness/l10n/hu.json +10 -0
  203. package/templates/gym-fitness/l10n/id.json +10 -0
  204. package/templates/gym-fitness/l10n/it.json +10 -0
  205. package/templates/gym-fitness/l10n/ja.json +10 -0
  206. package/templates/gym-fitness/l10n/ko.json +10 -0
  207. package/templates/gym-fitness/l10n/lt.json +10 -0
  208. package/templates/gym-fitness/l10n/nl.json +10 -0
  209. package/templates/gym-fitness/l10n/no.json +10 -0
  210. package/templates/gym-fitness/l10n/pl.json +10 -0
  211. package/templates/gym-fitness/l10n/pt.json +10 -0
  212. package/templates/gym-fitness/l10n/ru.json +10 -0
  213. package/templates/gym-fitness/l10n/sv.json +10 -0
  214. package/templates/gym-fitness/l10n/th.json +10 -0
  215. package/templates/gym-fitness/l10n/tr.json +10 -0
  216. package/templates/gym-fitness/l10n/uk.json +10 -0
  217. package/templates/gym-fitness/l10n/vi.json +10 -0
  218. package/templates/gym-fitness/l10n/zh.json +10 -0
  219. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +26 -3
  220. package/templates/gym-fitness/tier5-src/_shared/member-avatar.ts +76 -0
  221. package/templates/gym-fitness/tier5-src/_shared/result-snackbar.ts +26 -0
  222. package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +9 -2
  223. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +11 -4
  224. package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +6 -2
  225. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +70 -3
  226. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  227. package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  228. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +13 -2
  229. package/templates/gym-fitness-owner/dev/index.ts +1 -0
  230. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +26 -3
  231. package/templates/gym-fitness-owner/tier5-src/_shared/himi-account.ts +209 -0
  232. package/templates/gym-fitness-owner/tier5-src/_shared/member-avatar.ts +76 -0
  233. package/templates/medical-services/config.ts +1 -1
  234. package/templates/medical-services/dev/index.ts +3 -1
  235. package/templates/medical-services/tier5-src/_shared/collection-service.ts +26 -3
  236. package/templates/medical-services/tier5-src/_shared/member-avatar.ts +76 -0
  237. package/templates/medical-services/tier5-src/_shared/result-snackbar.ts +26 -0
  238. package/templates/medical-services/tier5-src/himi-booking-bookings/index.ts +9 -2
  239. package/templates/medical-services/tier5-src/himi-booking-service/index.ts +11 -4
  240. package/templates/medical-services/tier5-src/himi-booking-services/index.ts +6 -2
  241. package/templates/medical-services/tier5-src/himi-booking-time/index.ts +70 -3
  242. package/templates/medical-services/tier5-src/himi-store-account/index.ts +13 -2
  243. package/templates/nonprofit-cause/dev/index.ts +2 -1
  244. package/templates/nonprofit-cause/l10n/ar.json +10 -0
  245. package/templates/nonprofit-cause/l10n/cs.json +10 -0
  246. package/templates/nonprofit-cause/l10n/da.json +10 -0
  247. package/templates/nonprofit-cause/l10n/de.json +10 -0
  248. package/templates/nonprofit-cause/l10n/el.json +10 -0
  249. package/templates/nonprofit-cause/l10n/es.json +10 -0
  250. package/templates/nonprofit-cause/l10n/fi.json +10 -0
  251. package/templates/nonprofit-cause/l10n/fr.json +10 -0
  252. package/templates/nonprofit-cause/l10n/he.json +8 -0
  253. package/templates/nonprofit-cause/l10n/hu.json +10 -0
  254. package/templates/nonprofit-cause/l10n/id.json +10 -0
  255. package/templates/nonprofit-cause/l10n/it.json +10 -0
  256. package/templates/nonprofit-cause/l10n/ja.json +10 -0
  257. package/templates/nonprofit-cause/l10n/ko.json +10 -0
  258. package/templates/nonprofit-cause/l10n/lt.json +10 -0
  259. package/templates/nonprofit-cause/l10n/nl.json +10 -0
  260. package/templates/nonprofit-cause/l10n/no.json +10 -0
  261. package/templates/nonprofit-cause/l10n/pl.json +10 -0
  262. package/templates/nonprofit-cause/l10n/pt.json +10 -0
  263. package/templates/nonprofit-cause/l10n/ru.json +10 -0
  264. package/templates/nonprofit-cause/l10n/sv.json +10 -0
  265. package/templates/nonprofit-cause/l10n/th.json +10 -0
  266. package/templates/nonprofit-cause/l10n/tr.json +10 -0
  267. package/templates/nonprofit-cause/l10n/uk.json +10 -0
  268. package/templates/nonprofit-cause/l10n/vi.json +10 -0
  269. package/templates/nonprofit-cause/l10n/zh.json +10 -0
  270. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +26 -3
  271. package/templates/nonprofit-cause/tier5-src/_shared/member-avatar.ts +76 -0
  272. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  273. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +13 -2
  274. package/templates/nonprofit-cause-owner/dev/index.ts +1 -0
  275. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +26 -3
  276. package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-account.ts +209 -0
  277. package/templates/nonprofit-cause-owner/tier5-src/_shared/member-avatar.ts +76 -0
  278. package/templates/owner-lite/dev/index.ts +1 -0
  279. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +26 -3
  280. package/templates/owner-lite/tier5-src/_shared/himi-account.ts +209 -0
  281. package/templates/owner-lite/tier5-src/_shared/member-avatar.ts +76 -0
  282. package/templates/personal-fitness-trainer/dev/index.ts +7 -3
  283. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +26 -3
  284. package/templates/personal-fitness-trainer/tier5-src/_shared/member-avatar.ts +76 -0
  285. package/templates/personal-fitness-trainer/tier5-src/_shared/result-snackbar.ts +26 -0
  286. package/templates/personal-fitness-trainer/tier5-src/himi-booking-bookings/index.ts +9 -2
  287. package/templates/personal-fitness-trainer/tier5-src/himi-booking-service/index.ts +11 -4
  288. package/templates/personal-fitness-trainer/tier5-src/himi-booking-services/index.ts +6 -2
  289. package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +70 -3
  290. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  291. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  292. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +13 -2
  293. package/templates/podcast-creator/dev/index.ts +2 -1
  294. package/templates/podcast-creator/l10n/ar.json +10 -0
  295. package/templates/podcast-creator/l10n/cs.json +10 -0
  296. package/templates/podcast-creator/l10n/da.json +10 -0
  297. package/templates/podcast-creator/l10n/de.json +10 -0
  298. package/templates/podcast-creator/l10n/el.json +10 -0
  299. package/templates/podcast-creator/l10n/es.json +10 -0
  300. package/templates/podcast-creator/l10n/fi.json +10 -0
  301. package/templates/podcast-creator/l10n/fr.json +10 -0
  302. package/templates/podcast-creator/l10n/he.json +8 -0
  303. package/templates/podcast-creator/l10n/hu.json +10 -0
  304. package/templates/podcast-creator/l10n/id.json +10 -0
  305. package/templates/podcast-creator/l10n/it.json +10 -0
  306. package/templates/podcast-creator/l10n/ja.json +10 -0
  307. package/templates/podcast-creator/l10n/ko.json +10 -0
  308. package/templates/podcast-creator/l10n/lt.json +10 -0
  309. package/templates/podcast-creator/l10n/nl.json +10 -0
  310. package/templates/podcast-creator/l10n/no.json +10 -0
  311. package/templates/podcast-creator/l10n/pl.json +10 -0
  312. package/templates/podcast-creator/l10n/pt.json +10 -0
  313. package/templates/podcast-creator/l10n/ru.json +10 -0
  314. package/templates/podcast-creator/l10n/sv.json +10 -0
  315. package/templates/podcast-creator/l10n/th.json +10 -0
  316. package/templates/podcast-creator/l10n/tr.json +10 -0
  317. package/templates/podcast-creator/l10n/uk.json +10 -0
  318. package/templates/podcast-creator/l10n/vi.json +10 -0
  319. package/templates/podcast-creator/l10n/zh.json +10 -0
  320. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +26 -3
  321. package/templates/podcast-creator/tier5-src/_shared/member-avatar.ts +76 -0
  322. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  323. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +13 -2
  324. package/templates/podcast-creator-owner/dev/index.ts +1 -0
  325. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +26 -3
  326. package/templates/podcast-creator-owner/tier5-src/_shared/himi-account.ts +209 -0
  327. package/templates/podcast-creator-owner/tier5-src/_shared/member-avatar.ts +76 -0
  328. package/templates/portfolio-creative/dev/index.ts +2 -1
  329. package/templates/portfolio-creative/l10n/ar.json +10 -0
  330. package/templates/portfolio-creative/l10n/cs.json +10 -0
  331. package/templates/portfolio-creative/l10n/da.json +10 -0
  332. package/templates/portfolio-creative/l10n/de.json +10 -0
  333. package/templates/portfolio-creative/l10n/el.json +10 -0
  334. package/templates/portfolio-creative/l10n/es.json +10 -0
  335. package/templates/portfolio-creative/l10n/fi.json +10 -0
  336. package/templates/portfolio-creative/l10n/fr.json +10 -0
  337. package/templates/portfolio-creative/l10n/he.json +8 -0
  338. package/templates/portfolio-creative/l10n/hu.json +10 -0
  339. package/templates/portfolio-creative/l10n/id.json +10 -0
  340. package/templates/portfolio-creative/l10n/it.json +10 -0
  341. package/templates/portfolio-creative/l10n/ja.json +10 -0
  342. package/templates/portfolio-creative/l10n/ko.json +10 -0
  343. package/templates/portfolio-creative/l10n/lt.json +10 -0
  344. package/templates/portfolio-creative/l10n/nl.json +10 -0
  345. package/templates/portfolio-creative/l10n/no.json +10 -0
  346. package/templates/portfolio-creative/l10n/pl.json +10 -0
  347. package/templates/portfolio-creative/l10n/pt.json +10 -0
  348. package/templates/portfolio-creative/l10n/ru.json +10 -0
  349. package/templates/portfolio-creative/l10n/sv.json +10 -0
  350. package/templates/portfolio-creative/l10n/th.json +10 -0
  351. package/templates/portfolio-creative/l10n/tr.json +10 -0
  352. package/templates/portfolio-creative/l10n/uk.json +10 -0
  353. package/templates/portfolio-creative/l10n/vi.json +10 -0
  354. package/templates/portfolio-creative/l10n/zh.json +10 -0
  355. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +26 -3
  356. package/templates/portfolio-creative/tier5-src/_shared/member-avatar.ts +76 -0
  357. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  358. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +13 -2
  359. package/templates/portfolio-creative-owner/dev/index.ts +1 -0
  360. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +26 -3
  361. package/templates/portfolio-creative-owner/tier5-src/_shared/himi-account.ts +209 -0
  362. package/templates/portfolio-creative-owner/tier5-src/_shared/member-avatar.ts +76 -0
  363. package/templates/restaurant/dev/index.ts +2 -1
  364. package/templates/restaurant/l10n/ar.json +10 -0
  365. package/templates/restaurant/l10n/cs.json +10 -0
  366. package/templates/restaurant/l10n/da.json +10 -0
  367. package/templates/restaurant/l10n/de.json +10 -0
  368. package/templates/restaurant/l10n/el.json +10 -0
  369. package/templates/restaurant/l10n/es.json +10 -0
  370. package/templates/restaurant/l10n/fi.json +10 -0
  371. package/templates/restaurant/l10n/fr.json +10 -0
  372. package/templates/restaurant/l10n/he.json +8 -0
  373. package/templates/restaurant/l10n/hu.json +10 -0
  374. package/templates/restaurant/l10n/id.json +10 -0
  375. package/templates/restaurant/l10n/it.json +10 -0
  376. package/templates/restaurant/l10n/ja.json +10 -0
  377. package/templates/restaurant/l10n/ko.json +10 -0
  378. package/templates/restaurant/l10n/lt.json +10 -0
  379. package/templates/restaurant/l10n/nl.json +10 -0
  380. package/templates/restaurant/l10n/no.json +10 -0
  381. package/templates/restaurant/l10n/pl.json +10 -0
  382. package/templates/restaurant/l10n/pt.json +10 -0
  383. package/templates/restaurant/l10n/ru.json +10 -0
  384. package/templates/restaurant/l10n/sv.json +10 -0
  385. package/templates/restaurant/l10n/th.json +10 -0
  386. package/templates/restaurant/l10n/tr.json +10 -0
  387. package/templates/restaurant/l10n/uk.json +10 -0
  388. package/templates/restaurant/l10n/vi.json +10 -0
  389. package/templates/restaurant/l10n/zh.json +10 -0
  390. package/templates/restaurant/tier5-src/_shared/collection-service.ts +26 -3
  391. package/templates/restaurant/tier5-src/_shared/member-avatar.ts +76 -0
  392. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  393. package/templates/restaurant/tier5-src/himi-store-account/index.ts +13 -2
  394. package/templates/restaurant-owner/dev/index.ts +1 -0
  395. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +26 -3
  396. package/templates/restaurant-owner/tier5-src/_shared/himi-account.ts +209 -0
  397. package/templates/restaurant-owner/tier5-src/_shared/member-avatar.ts +76 -0
  398. package/templates/retail-store/dev/index.ts +2 -1
  399. package/templates/retail-store/l10n/ar.json +10 -0
  400. package/templates/retail-store/l10n/cs.json +10 -0
  401. package/templates/retail-store/l10n/da.json +10 -0
  402. package/templates/retail-store/l10n/de.json +10 -0
  403. package/templates/retail-store/l10n/el.json +10 -0
  404. package/templates/retail-store/l10n/es.json +10 -0
  405. package/templates/retail-store/l10n/fi.json +10 -0
  406. package/templates/retail-store/l10n/fr.json +10 -0
  407. package/templates/retail-store/l10n/he.json +8 -0
  408. package/templates/retail-store/l10n/hu.json +10 -0
  409. package/templates/retail-store/l10n/id.json +10 -0
  410. package/templates/retail-store/l10n/it.json +10 -0
  411. package/templates/retail-store/l10n/ja.json +10 -0
  412. package/templates/retail-store/l10n/ko.json +10 -0
  413. package/templates/retail-store/l10n/lt.json +10 -0
  414. package/templates/retail-store/l10n/nl.json +10 -0
  415. package/templates/retail-store/l10n/no.json +10 -0
  416. package/templates/retail-store/l10n/pl.json +10 -0
  417. package/templates/retail-store/l10n/pt.json +10 -0
  418. package/templates/retail-store/l10n/ru.json +10 -0
  419. package/templates/retail-store/l10n/sv.json +10 -0
  420. package/templates/retail-store/l10n/th.json +10 -0
  421. package/templates/retail-store/l10n/tr.json +10 -0
  422. package/templates/retail-store/l10n/uk.json +10 -0
  423. package/templates/retail-store/l10n/vi.json +10 -0
  424. package/templates/retail-store/l10n/zh.json +10 -0
  425. package/templates/retail-store/tier5-src/_shared/collection-service.ts +19 -3
  426. package/templates/retail-store/tier5-src/_shared/member-avatar.ts +76 -0
  427. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  428. package/templates/retail-store/tier5-src/himi-store-account/index.ts +13 -2
  429. package/templates/retail-store-owner/dev/index.ts +1 -0
  430. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +26 -3
  431. package/templates/retail-store-owner/tier5-src/_shared/himi-account.ts +209 -0
  432. package/templates/retail-store-owner/tier5-src/_shared/member-avatar.ts +76 -0
  433. package/templates/salon-spa/config.ts +1 -1
  434. package/templates/salon-spa/dev/index.ts +5 -2
  435. package/templates/salon-spa/tier5-src/_shared/collection-service.ts +26 -3
  436. package/templates/salon-spa/tier5-src/_shared/member-avatar.ts +76 -0
  437. package/templates/salon-spa/tier5-src/_shared/result-snackbar.ts +26 -0
  438. package/templates/salon-spa/tier5-src/himi-booking-bookings/index.ts +9 -2
  439. package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +11 -4
  440. package/templates/salon-spa/tier5-src/himi-booking-services/index.ts +6 -2
  441. package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +70 -3
  442. package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  443. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +13 -2
  444. package/templates/wholesale-store/tier5-src/_shared/collection-service.ts +19 -3
  445. package/templates/wholesale-store/tier5-src/_shared/member-avatar.ts +76 -0
  446. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +13 -2
  447. package/templates/yoga-studio/dev/index.ts +7 -3
  448. package/templates/yoga-studio/l10n/ar.json +10 -0
  449. package/templates/yoga-studio/l10n/cs.json +10 -0
  450. package/templates/yoga-studio/l10n/da.json +10 -0
  451. package/templates/yoga-studio/l10n/de.json +10 -0
  452. package/templates/yoga-studio/l10n/el.json +10 -0
  453. package/templates/yoga-studio/l10n/es.json +10 -0
  454. package/templates/yoga-studio/l10n/fi.json +10 -0
  455. package/templates/yoga-studio/l10n/fr.json +10 -0
  456. package/templates/yoga-studio/l10n/he.json +8 -0
  457. package/templates/yoga-studio/l10n/hu.json +10 -0
  458. package/templates/yoga-studio/l10n/id.json +10 -0
  459. package/templates/yoga-studio/l10n/it.json +10 -0
  460. package/templates/yoga-studio/l10n/ja.json +10 -0
  461. package/templates/yoga-studio/l10n/ko.json +10 -0
  462. package/templates/yoga-studio/l10n/lt.json +10 -0
  463. package/templates/yoga-studio/l10n/nl.json +10 -0
  464. package/templates/yoga-studio/l10n/no.json +10 -0
  465. package/templates/yoga-studio/l10n/pl.json +10 -0
  466. package/templates/yoga-studio/l10n/pt.json +10 -0
  467. package/templates/yoga-studio/l10n/ru.json +10 -0
  468. package/templates/yoga-studio/l10n/sv.json +10 -0
  469. package/templates/yoga-studio/l10n/th.json +10 -0
  470. package/templates/yoga-studio/l10n/tr.json +10 -0
  471. package/templates/yoga-studio/l10n/uk.json +10 -0
  472. package/templates/yoga-studio/l10n/vi.json +10 -0
  473. package/templates/yoga-studio/l10n/zh.json +10 -0
  474. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +26 -3
  475. package/templates/yoga-studio/tier5-src/_shared/member-avatar.ts +76 -0
  476. package/templates/yoga-studio/tier5-src/_shared/result-snackbar.ts +26 -0
  477. package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +9 -2
  478. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +11 -4
  479. package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +6 -2
  480. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +70 -3
  481. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/login-info.ts +16 -4
  482. package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +33 -6
  483. package/templates/yoga-studio/tier5-src/himi-branded-lite-member-programs/index.ts +15 -4
  484. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +13 -2
  485. package/templates/yoga-studio-owner/dev/index.ts +1 -0
  486. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +26 -3
  487. package/templates/yoga-studio-owner/tier5-src/_shared/himi-account.ts +209 -0
  488. package/templates/yoga-studio-owner/tier5-src/_shared/member-avatar.ts +76 -0
@@ -0,0 +1,139 @@
1
+ // Privacy — the Public profile switch and the blocked members list. The switch saves at once
2
+ // (joinCommunity / leaveCommunity), so this modal has no Save. Turning it off asks first, because
3
+ // the member also leaves the site's community; turning it on does not. A member record with no
4
+ // privacy status shows no switch, only a notice.
5
+ import { defineService } from "@himalaya/state";
6
+ import { alert } from "@himalaya/ui";
7
+ import { getMyMember, joinCommunity, leaveCommunity } from "@himalaya/wix-members";
8
+ import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
9
+ import { svc as blockedMembers } from "./blocked-members.js";
10
+ import {
11
+ businessNameOf, clean, fetchMember, isSignedOut, loadErrorVariant, sameAccess, signedOutError, type WixMemberResponse,
12
+ } from "./shared.js";
13
+
14
+ interface S {
15
+ phase: "loading" | "ready" | "error" | "signedOut";
16
+ errorVariant: "offline" | "server";
17
+ memberId: string;
18
+ memberEmail: string;
19
+ memberScope: string;
20
+ businessName: string;
21
+ /** "Choose if other members of {business} can see your profile." */
22
+ description: string;
23
+ /** The API returned PUBLIC or PRIVATE. Otherwise the switch is replaced by a notice. */
24
+ privacyKnown: boolean;
25
+ privacyUnknown: boolean;
26
+ isPublic: boolean;
27
+ statusLine: string;
28
+ busy: boolean;
29
+ /** A switch change that did not save. */
30
+ errorText: string;
31
+ noErrorText: boolean;
32
+ }
33
+
34
+ const EMPTY: S = {
35
+ phase: "loading", errorVariant: "server", memberId: "", memberEmail: "", memberScope: "", businessName: "",
36
+ description: "", privacyKnown: false, privacyUnknown: true, isPublic: false, statusLine: "", busy: false,
37
+ errorText: "", noErrorText: true,
38
+ };
39
+
40
+ function statusLine(isPublic: boolean): string {
41
+ return isPublic
42
+ ? copyParam("accountSettings.publicProfileOn", "Other members can see your profile.")
43
+ : copyParam("accountSettings.publicProfileOff", "Only you can see your profile.");
44
+ }
45
+
46
+ function withStatus(s: S, privacyStatus: unknown): S {
47
+ const status = clean(privacyStatus).toUpperCase();
48
+ const known = status === "PUBLIC" || status === "PRIVATE";
49
+ const isPublic = status === "PUBLIC";
50
+ return { ...s, privacyKnown: known, privacyUnknown: !known, isPublic, statusLine: known ? statusLine(isPublic) : "" };
51
+ }
52
+
53
+ let loadVersion = 0;
54
+ let mutationInFlight = false;
55
+ /** The member moved the switch again while a change was saving. That move is not saved, so the
56
+ * switch must be drawn again from the result, or it keeps showing the dropped position. */
57
+ let flipDropped = false;
58
+
59
+ const svc = defineService<S, {
60
+ load: (s: S, arg?: unknown) => Promise<S>;
61
+ showLoading: (s: S) => S;
62
+ begin: (s: S, patch: Partial<S>) => S;
63
+ setPublic: (s: S, arg?: unknown) => Promise<S | undefined>;
64
+ }>("himiBrandedAccountPrivacy", {
65
+ state: { ...EMPTY },
66
+ notHydrated: Object.keys(EMPTY) as (keyof S)[],
67
+ notPersisted: Object.keys(EMPTY) as (keyof S)[],
68
+ actions: {
69
+ showLoading: (s) => ({ ...EMPTY, businessName: s.businessName, description: s.description }),
70
+ begin: (s, patch) => ({ ...s, ...patch, noErrorText: !(patch.errorText ?? s.errorText) }),
71
+ load: async (_s, arg): Promise<S> => {
72
+ const version = ++loadVersion;
73
+ stashCopy(arg);
74
+ const businessName = businessNameOf(arg) || svc.getState().businessName;
75
+ const description = copyTemplate("accountSettings.privacyDescription", "Choose if other members of {business} can see your profile.", { business: businessName });
76
+ if (svc.getState().phase !== "loading") await svc.showLoading();
77
+ // The blocked members section loads with the modal; its own onAppear does the same on a device.
78
+ void blockedMembers.load(arg).catch(() => undefined);
79
+ try {
80
+ const { member, email, scope } = await fetchMember();
81
+ if (version !== loadVersion) return svc.getState();
82
+ return withStatus({ ...EMPTY, phase: "ready", memberId: clean(member.id), memberEmail: email, memberScope: scope, businessName, description }, member.privacyStatus);
83
+ } catch (error) {
84
+ if (version !== loadVersion) return svc.getState();
85
+ return { ...EMPTY, businessName, description, phase: isSignedOut(error) ? "signedOut" : "error", errorVariant: loadErrorVariant(error) };
86
+ }
87
+ },
88
+ setPublic: async (s, arg): Promise<S | undefined> => {
89
+ if (s.phase !== "ready" || !s.privacyKnown || !s.memberId) return undefined;
90
+ if (mutationInFlight) { flipDropped = true; return undefined; }
91
+ const value = (arg as { value?: unknown } | undefined)?.value;
92
+ const wantPublic = value === true || value === "true";
93
+ if (wantPublic === s.isPublic) return undefined;
94
+ flipDropped = false;
95
+ // Draw the switch from `final`; after a dropped move, flip it first so the host redraws it.
96
+ const settle = async (final: S): Promise<S> => {
97
+ if (flipDropped) { flipDropped = false; await svc.begin({ isPublic: !final.isPublic }); }
98
+ return final;
99
+ };
100
+ mutationInFlight = true;
101
+ try {
102
+ // The switch already moved: follow it, so that a Cancel below moves it back.
103
+ await svc.begin({ isPublic: wantPublic, errorText: "" });
104
+ if (!wantPublic) {
105
+ let confirmed = false;
106
+ try {
107
+ const answer = await alert({
108
+ title: copyParam("accountSettings.makePrivateTitle", "Make your profile private?"),
109
+ message: copyTemplate("accountSettings.makePrivateBody", "Other members can't see your profile. You also leave the community of {business}.", { business: s.businessName }),
110
+ confirmLabel: copyParam("accountSettings.makePrivateConfirm", "Make private"),
111
+ cancelLabel: copyParam("common.cancelCta", "Cancel"),
112
+ });
113
+ confirmed = answer.confirmed;
114
+ } catch { /* no presenter: nothing was confirmed */ }
115
+ // Cancel: the switch and its status line go back to public together.
116
+ if (!confirmed) return await settle({ ...svc.getState(), isPublic: true, statusLine: statusLine(true) });
117
+ }
118
+ await svc.begin({ busy: true });
119
+ if (!(await sameAccess(s.memberEmail, s.memberScope))) throw signedOutError();
120
+ const response = wantPublic ? await joinCommunity() : await leaveCommunity();
121
+ if (response.member?.id !== s.memberId || !response.member.privacyStatus) throw new Error("The profile privacy update was not confirmed for this member.");
122
+ const refreshed = await getMyMember({ fieldsets: ["FULL"] }) as WixMemberResponse;
123
+ if (refreshed.member?.id !== s.memberId || !(await sameAccess(s.memberEmail, s.memberScope))) throw signedOutError();
124
+ // A stale read or a rejected write leaves the OLD status in the readback: that is not a save.
125
+ const status = clean(refreshed.member.privacyStatus).toUpperCase();
126
+ if (status !== (wantPublic ? "PUBLIC" : "PRIVATE")) throw new Error("The profile privacy update was not confirmed by the readback.");
127
+ return await settle({ ...withStatus(svc.getState(), status), busy: false, errorText: "", noErrorText: true });
128
+ } catch (error) {
129
+ // The member changed mid-save: show none of the previous member's privacy, only Sign in.
130
+ if (isSignedOut(error)) return { ...EMPTY, businessName: s.businessName, description: s.description, phase: "signedOut" };
131
+ const latest = svc.getState();
132
+ return await settle({ ...latest, isPublic: s.isPublic, statusLine: statusLine(s.isPublic), busy: false,
133
+ errorText: copyParam("accountSettings.privacyError", "Your privacy setting was not updated."), noErrorText: false });
134
+ } finally { mutationInFlight = false; }
135
+ },
136
+ },
137
+ });
138
+
139
+ export { svc as privacy };
@@ -0,0 +1,136 @@
1
+ // Shared by the Account settings menu and its three modals (Personal info, Login info with its
2
+ // Change password step, Privacy). Each modal is its own screen, so each boots this bundle in its
3
+ // own worker and loads the member itself: nothing here is shared state, only the checks.
4
+ import { dispatch } from "@himalaya/dispatch";
5
+ import { classifyLoadError } from "@himalaya/state";
6
+ import { getMyMember } from "@himalaya/wix-members";
7
+ import { getMyData } from "@himalaya/wix-users";
8
+ import { hostSiteFromInput } from "../_shared/branded-lite-hosted.js";
9
+ import { memberAccess } from "../_shared/member-access.js";
10
+ import type { MemberAccountRoutes } from "../_shared/member-account-routes.js";
11
+
12
+ export type WixMemberRecord = {
13
+ id?: string;
14
+ loginEmail?: string;
15
+ contact?: {
16
+ firstName?: string;
17
+ lastName?: string;
18
+ phones?: string[];
19
+ birthdate?: string;
20
+ company?: string;
21
+ jobTitle?: string;
22
+ customFields?: Record<string, { name?: string; value?: unknown } | undefined>;
23
+ };
24
+ profile?: { nickname?: string; title?: string; slug?: string; photo?: { id?: string; url?: string } };
25
+ privacyStatus?: string;
26
+ };
27
+ export type WixMemberResponse = { member?: WixMemberRecord };
28
+
29
+ export function rawText(value: unknown): string { return typeof value === "string" ? value : ""; }
30
+ export function clean(value: unknown): string { return rawText(value).trim(); }
31
+
32
+ export function signedOutError(): Error {
33
+ return Object.assign(new Error("signed_out"), { code: "signed_out" });
34
+ }
35
+ export function isSignedOut(error: unknown): boolean {
36
+ return (error as { code?: string } | null)?.code === "signed_out";
37
+ }
38
+
39
+ /** The load-error variant the modals' ErrorState draws: `offline` only when the request never left. */
40
+ export function loadErrorVariant(error: unknown): "offline" | "server" {
41
+ return classifyLoadError(error) === "offline" ? "offline" : "server";
42
+ }
43
+
44
+ /** The site a hosted build was opened for (`himalaya.input.__himiHostSite`), or "" when the build
45
+ * is not hosted. A hosted build serves many businesses, so this wins over the build's own name. */
46
+ export const hostedBusinessName = clean(hostSiteFromInput((globalThis as { himalaya?: { input?: unknown } }).himalaya?.input)?.name);
47
+
48
+ /** The business name each modal shows as its subtitle and in its copy: the hosted site's, else the
49
+ * descriptor param (the build's own business). */
50
+ export function businessNameOf(arg: unknown): string {
51
+ return hostedBusinessName || clean((arg as { businessName?: unknown } | undefined)?.businessName);
52
+ }
53
+
54
+ /** The signed-in member's own record, read with the member's token, and the identity it was read for. */
55
+ export async function fetchMember(siteUrlInput?: unknown): Promise<{ email: string; scope: string; siteUrl: string; member: WixMemberRecord & { id: string } }> {
56
+ const access = await memberAccess();
57
+ if (!access.email) throw signedOutError();
58
+ const response = await getMyMember({ fieldsets: ["FULL"] }) as WixMemberResponse;
59
+ if (!response.member?.id) throw new Error("The signed-in member profile is unavailable.");
60
+ const after = await memberAccess();
61
+ if (!after.email || after.email !== access.email || after.scope !== access.scope) throw signedOutError();
62
+ const siteUrl = clean(siteUrlInput).replace(/\/$/, "");
63
+ return { email: access.email, scope: access.scope, siteUrl, member: response.member as WixMemberRecord & { id: string } };
64
+ }
65
+
66
+ /** The same member is still signed in, by email, scope and member id. */
67
+ export async function currentMemberRecordMatches(email: string, scope: string, memberId: string): Promise<boolean> {
68
+ const before = await memberAccess();
69
+ if (!before.email || before.email !== email || before.scope !== scope) return false;
70
+ const response = await getMyMember({ fieldsets: ["FULL"] }) as WixMemberResponse;
71
+ const after = await memberAccess();
72
+ return response.member?.id === memberId && after.email === email && after.scope === scope;
73
+ }
74
+
75
+ /** Who is signed in: a member, nobody, or `unavailable` when the host could not say at all.
76
+ * `memberAccess()` reads both failures as "nobody"; the menu must not ask a member to sign in
77
+ * because the identity read failed. Older hosts without `memberIdentity` answer through
78
+ * wix-users (the same rung memberAccess uses); a host that fails both ways is unavailable. */
79
+ export async function memberIdentityState(): Promise<"member" | "guest" | "unavailable"> {
80
+ let raw: unknown;
81
+ let unavailable = false;
82
+ try { raw = await dispatch("himi.wix.memberIdentity"); }
83
+ catch { unavailable = true; }
84
+ const value = raw as { email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
85
+ // A host can say a member is signed in before it has the email.
86
+ if (clean(value?.email ?? value?.payload?.email) || (value?.signedIn ?? value?.payload?.signedIn) === true) return "member";
87
+ if (!unavailable) return "guest";
88
+ try {
89
+ const profile = await getMyData();
90
+ return clean(profile.email ?? profile.contactEmail) ? "member" : "guest";
91
+ } catch {
92
+ return "unavailable";
93
+ }
94
+ }
95
+
96
+ /** Same identity by email and scope alone (no network). */
97
+ export async function sameAccess(email: string, scope: string): Promise<boolean> {
98
+ const current = await memberAccess();
99
+ return !!current.email && current.email === email && current.scope === scope;
100
+ }
101
+
102
+ /** An http(s) URL split at its authority (between `//` and the first `/`, `?` or `#`). A worker has
103
+ * no URL global, so the authority is split by hand. */
104
+ const HTTP_URL = /^https?:\/\/([^/?#]*)(?:[/?#]\S*)?$/i;
105
+ /** A website handoff needs a real http(s) site: the documented placeholder (example.com) never counts,
106
+ * and neither does a URL with userinfo (`https://shop.acme.com@evil.example` opens evil.example). */
107
+ export function siteHandoffAvailable(siteUrl: string): boolean {
108
+ const match = HTTP_URL.exec(siteUrl);
109
+ if (!match || siteUrl.includes("\\")) return false;
110
+ const authority = match[1];
111
+ if (authority.includes("@")) return false;
112
+ const host = authority.replace(/:\d+$/, "").toLowerCase();
113
+ if (!host || /[\s:]/.test(host)) return false;
114
+ return host !== "example.com" && !host.endsWith(".example.com");
115
+ }
116
+
117
+ export function memberInitials(firstName: string, lastName: string, nickname: string): string {
118
+ return ([firstName[0], lastName[0]].filter(Boolean).join("") || nickname.slice(0, 1) || "M").toUpperCase();
119
+ }
120
+
121
+ /** Login info's Password section.
122
+ * - `row`: this app changes the password (a native app on HimalayaCore 1.5.0 or later).
123
+ * - `notice-preview`: the web host, a preview of the app.
124
+ * - `notice-here`: inside another Wix app, an older binary, or an unknown platform and version. */
125
+ export type PasswordMode = "row" | "notice-preview" | "notice-here";
126
+ export function passwordMode(routes: Pick<MemberAccountRoutes, "passwordCredentials" | "webPreview">): PasswordMode {
127
+ if (routes.passwordCredentials) return "row";
128
+ return routes.webPreview ? "notice-preview" : "notice-here";
129
+ }
130
+
131
+ /** The case the Password section draws: the mode, and for a notice whether it links the website. */
132
+ export function passwordCase(mode: PasswordMode, siteLink: boolean): string {
133
+ if (mode === "row") return "row";
134
+ const base = mode === "notice-preview" ? "preview" : "here";
135
+ return siteLink ? `${base}-link` : base;
136
+ }
@@ -31,11 +31,13 @@ import { getMyMember } from "@himalaya/wix-members";
31
31
  import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
32
32
  import { LOADING, loadFailed, type LoadFlags } from "../_shared/branded-load-state.js";
33
33
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
34
+ import { readResultSnackbar, resultSnackbarOn, showResultSnackbar } from "../_shared/result-snackbar.js";
34
35
  import { slotStartInstant } from "../_shared/himi-bookings.js";
35
36
  import { formatServicePrice } from "../_shared/wix-service-price.js";
36
37
  import { compareText } from "../_shared/engine-intl.js";
37
38
  import { assertMemberAccess, memberAccess, memberAccessChanged, type MemberAccess } from "../_shared/member-access.js";
38
39
  import { atLeast } from "../_shared/member-account-routes.js";
40
+ import { MEMBER_AVATAR_KEYS, memberAvatarSource } from "../_shared/member-avatar.js";
39
41
  import { get as getAppInfo } from "@himalaya/app-info";
40
42
  import {
41
43
  distinctChoices, effectiveLocation, locationMenu, readSharedLocation, serviceLocationChoices, writeSharedLocation,
@@ -65,6 +67,9 @@ export interface AgendaEvent {
65
67
  }
66
68
 
67
69
  interface S extends LoadFlags {
70
+ /** The signed-in member's photo and initials, for a screen that asks for its top-bar avatar
71
+ * (onAppear `memberAvatar: "1"`, _shared/member-avatar.ts). Never persisted or restored. */
72
+ memberImage: string; memberInitials: string;
68
73
  firstWeekday: number;
69
74
  today: string;
70
75
  selectedDate: string;
@@ -399,6 +404,12 @@ let resultSeq = 0;
399
404
 
400
405
  /** One action's outcome, for the result sheet: `ok` when it went through. */
401
406
  function result(text: string, ok: boolean): ResultFields {
407
+ // Opted in (`resultSnackbar`): the platform snackbar, and no sheet opens.
408
+ if (resultSnackbarOn()) {
409
+ showResultSnackbar(text, ok ? "success" : "info");
410
+ lastResult = { resultOpen: false, resultOpenB: false, resultText: "", resultOk: ok, resultInfo: !ok };
411
+ return lastResult;
412
+ }
402
413
  const b = ++resultSeq % 2 === 0;
403
414
  lastResult = { resultOpen: !b, resultOpenB: b, resultText: text, resultOk: ok, resultInfo: !ok };
404
415
  return lastResult;
@@ -449,7 +460,9 @@ function derive(s: S): S {
449
460
  const loaded = s.status === "ready" && rowsOk !== false && !!services;
450
461
  const locationEmpty = loaded && !!locationKey && shown.length === 0 && !bookedOnly;
451
462
  const bookedEmpty = loaded && bookedOnly && shown.length === 0;
452
- return {
463
+ // The avatar fields are merged here too: a load that started before the member read finished
464
+ // returns a state built from its own start, which would drop them.
465
+ return avatar.merge({
453
466
  ...s,
454
467
  filter: bookedOnly ? "booked" : "all",
455
468
  // A visitor has no sessions of their own: the filter shows only to a signed-in member.
@@ -481,7 +494,7 @@ function derive(s: S): S {
481
494
  sheetServiceId: sheet?.serviceId ?? "",
482
495
  sheetSessionId: sheet?.sessionId ?? "",
483
496
  sheetStart: sheet?.start ?? "",
484
- };
497
+ });
485
498
  }
486
499
 
487
500
  /** Leave a waitlist. The registration id comes from the load; a place known only by its
@@ -644,7 +657,7 @@ const eventIdOf = (p: unknown): string => argOf(p, "eventId") || argOf(p, "id");
644
657
  * first `ask` before it — fills in today and this week. */
645
658
  function initial(): S {
646
659
  return {
647
- ...LOADING, firstWeekday: 0, today: "", selectedDate: "", rangeStart: "", rangeEnd: "",
660
+ ...LOADING, memberImage: "", memberInitials: "", firstWeekday: 0, today: "", selectedDate: "", rangeStart: "", rangeEnd: "",
648
661
  decorations: [], events: [], scrollTo: "", signedIn: false, updateRequired: false, updateMessage: "", listHidden: true,
649
662
  ...emptyFlags(false, false), resultOpen: false, resultOpenB: false, resultText: "", resultOk: false, resultInfo: false,
650
663
  sheetOpen: false, sheetTitle: "", sheetWhen: "", sheetMeta: "", sheetHideCalendar: true, sheetHideCancel: true, sheetHideLeave: true, sheetBusy: false, sheetServiceId: "", sheetSessionId: "", sheetStart: "",
@@ -677,8 +690,14 @@ let signInStyle: "page" | "" = "";
677
690
  * default; an app with no such screen names its own (salon-spa: the Profile tab, `himi_account`). */
678
691
  let signInScreenId = "himi_sign_in";
679
692
 
693
+ // The top-bar avatar: read only when the screen asks for it, republished through `avatarChanged`.
694
+ const avatar = memberAvatarSource(() => { void svc.avatarChanged(); });
695
+ /** The tab a booking started here returns to (load param `doneTab`), for View class's own `_nav`. */
696
+ let doneTab = "";
697
+
680
698
  const svc = defineService<S, {
681
699
  load: (s: S, p?: unknown) => Promise<S | undefined>;
700
+ avatarChanged: (s: S) => S;
682
701
  retry: (s: S) => Promise<S | undefined>;
683
702
  selectDate: (s: S, p?: unknown) => Promise<S | undefined>;
684
703
  rangeChanged: (s: S, p?: unknown) => Promise<S | undefined>;
@@ -698,13 +717,18 @@ const svc = defineService<S, {
698
717
  }>("himiBrandedAgenda", {
699
718
  // An action's result belongs to that visit: a cold start must not replay it from saved state,
700
719
  // nor reopen the location sheet.
701
- notHydrated: ["resultOpen", "resultOpenB", "resultText", "resultOk", "resultInfo", "locationSheetOpen", "filter", "hideFilter", "bookedEmpty", "notBookedEmpty"],
720
+ notHydrated: ["resultOpen", "resultOpenB", "resultText", "resultOk", "resultInfo", "locationSheetOpen", "filter", "hideFilter", "bookedEmpty", "notBookedEmpty", ...MEMBER_AVATAR_KEYS],
702
721
  // The optional Booked filter is the member's choice for this run: never written to the device.
703
- notPersisted: ["filter", "hideFilter", "bookedEmpty", "notBookedEmpty"],
722
+ notPersisted: ["filter", "hideFilter", "bookedEmpty", "notBookedEmpty", ...MEMBER_AVATAR_KEYS],
704
723
  state: initial(),
705
724
  actions: {
725
+ avatarChanged: (s) => avatar.merge(s),
706
726
  load: async (s, p) => {
707
727
  stashCopy(p);
728
+ readResultSnackbar(p);
729
+ avatar.onLoad(p);
730
+ const tab = argOf(p, "doneTab");
731
+ if (/^[A-Za-z0-9_-]{1,64}$/.test(tab)) doneTab = tab;
708
732
  const presentation = argOf(p, "signInPresentation");
709
733
  if (presentation === "sheet" || presentation === "full_screen") {
710
734
  signInPresentation = presentation;
@@ -803,7 +827,9 @@ const svc = defineService<S, {
803
827
  const session = sessions.find((x) => x.key === sheetKey);
804
828
  sheetKey = "";
805
829
  return session
806
- ? navigate(derive(s), { screenId: "himi_service", args: { id: session.serviceId, sessionId: session.sessionId, start: session.start } })
830
+ // `doneTab` (a load param): a booking started from this sheet returns to this tab. The
831
+ // descriptor's declared `nav` carries it too; this is the path binaries without `nav` take.
832
+ ? navigate(derive(s), { screenId: "himi_service", args: { id: session.serviceId, sessionId: session.sessionId, start: session.start, ...(doneTab ? { doneTab } : {}) } })
807
833
  : derive(s);
808
834
  },
809
835
  // From one slot's own close or dismissal (`slot`: "a" | "b"), or both when it names none.
@@ -985,4 +1011,5 @@ const svc = defineService<S, {
985
1011
  },
986
1012
  },
987
1013
  });
1014
+ avatar.resetRestored(svc);
988
1015
  export { svc };
@@ -31,6 +31,7 @@ import { isNotFoundError } from "../_shared/detail-presence.js";
31
31
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
32
32
  import { formatCurrency, formatDateMedium } from "../_shared/engine-intl.js";
33
33
  import { iapPriceCopy, resetUnhydratedKeysOnOlderRuntime } from "../_shared/iap-worker.js";
34
+ import { MEMBER_AVATAR_KEYS, memberAvatarSource } from "../_shared/member-avatar.js";
34
35
 
35
36
  export const SERVICE = "himiBrandedMemberPrograms";
36
37
  const PAGE_SIZE = 20;
@@ -89,6 +90,9 @@ interface Option { id: string; label: string }
89
90
 
90
91
  export interface State {
91
92
  status: "loading" | "ready" | "error";
93
+ /** The signed-in member's photo and initials, for a screen that asks for its top-bar avatar
94
+ * (onAppear `memberAvatar: "1"`, _shared/member-avatar.ts). Never persisted or restored. */
95
+ memberImage: string; memberInitials: string;
92
96
  rows: ProgramRow[];
93
97
  isLoading: boolean;
94
98
  notLoading: boolean;
@@ -506,7 +510,7 @@ let scopeIncomplete = false;
506
510
  let page: CollectionQueryState<ProgramContent> | undefined;
507
511
 
508
512
  const INITIAL_STATE: State = {
509
- status: "loading", rows: [], isLoading: true, notLoading: false, isErrored: false, notErrored: true, noEmpty: true, hideList: true,
513
+ status: "loading", memberImage: "", memberInitials: "", rows: [], isLoading: true, notLoading: false, isErrored: false, notErrored: true, noEmpty: true, hideList: true,
510
514
  emptyText: "", errorText: "", identityLine: "", needsSignIn: false, noSignIn: true, nextCursor: "", noMore: true, noPageError: true, loadingMore: false,
511
515
  statusFilter: "all", statusOptions: [], hideStatusFilter: true, categoryId: "", categoryChips: [], hideCategoryFilter: true,
512
516
  hidePriceRetry: true, priceRetryText: "", summary: "",
@@ -620,17 +624,22 @@ type Actions = {
620
624
  pricingPublish: (state: State) => State;
621
625
  pricingStart: (state: State) => State;
622
626
  pricingRefresh: (state: State) => Promise<undefined>;
627
+ avatarChanged: (state: State) => State;
623
628
  };
624
629
 
630
+ // The top-bar avatar: read only when the screen asks for it, republished through `avatarChanged`.
631
+ const avatar = memberAvatarSource(() => { void svc.avatarChanged(); });
632
+
625
633
  const actions: Actions = {
626
634
  async load(_state, arg) {
627
635
  stashCopy(arg);
628
636
  stashParticipantScreen(arg);
637
+ avatar.onLoad(arg);
629
638
  // A load of what the screen already shows is the screen coming back: it revalidates behind its rows.
630
639
  await controller.query(criteria(), true, true);
631
640
  return undefined;
632
641
  },
633
- async refresh(_state, arg) { stashCopy(arg); stashParticipantScreen(arg); await controller.query(criteria()); return undefined; },
642
+ async refresh(_state, arg) { stashCopy(arg); stashParticipantScreen(arg); avatar.onLoad(arg); await controller.query(criteria()); return undefined; },
634
643
  async loadMore() { await controller.loadMore(); return undefined; },
635
644
  async retry() { await controller.retry(); return undefined; },
636
645
  setStatus(state, arg) {
@@ -661,11 +670,13 @@ const actions: Actions = {
661
670
  pricingPublish: derive,
662
671
  pricingStart: (state) => ({ ...derive(state), _poll: pricing.pollDirective(`${SERVICE}.pricingRefresh`) }),
663
672
  pricingRefresh: async () => { await priceContent(); return undefined; },
673
+ avatarChanged: (state) => avatar.merge(state),
664
674
  };
665
675
 
666
- // Prices are this run's: never restored from a cold-boot snapshot.
667
- const svc = register<State, Actions>(SERVICE, { state: INITIAL_STATE, actions, notHydrated: [...PRICING_NOT_HYDRATED] } as unknown as Parameters<typeof register<State, Actions>>[1]);
676
+ // Prices and the member's photo are this run's: never restored from a cold-boot snapshot.
677
+ const svc = register<State, Actions>(SERVICE, { state: INITIAL_STATE, actions, notHydrated: [...PRICING_NOT_HYDRATED, ...MEMBER_AVATAR_KEYS], notPersisted: [...MEMBER_AVATAR_KEYS] } as unknown as Parameters<typeof register<State, Actions>>[1]);
668
678
  resetUnhydratedKeysOnOlderRuntime(svc, INITIAL_STATE, PRICING_NOT_HYDRATED);
679
+ avatar.resetRestored(svc);
669
680
  void svc.pricingStart();
670
681
  // Kick the first load at module scope, like every other list bundle; onAppear re-loads with the copy pack.
671
682
  svc.load();
@@ -179,10 +179,13 @@ const svc = defineService<S, {
179
179
  const signIn = strArg(arg, "signInScreenId");
180
180
  const email = signIn ? await within(signedInEmail(), 4_500, "") : "member";
181
181
  const current = now();
182
- if (email) return navigate(current, { screenId: "himi_time", args: { id: s.serviceId } });
182
+ // `doneTab`: a confirmed booking pops back to this tab's root (the goal lives on Home) and
183
+ // says so in a snackbar, instead of leaving the member on Choose a time.
184
+ if (email) return navigate(current, { screenId: "himi_time", args: { id: s.serviceId, doneTab: strArg(arg, "returnTab") || "home" } });
183
185
  return navigate(current, {
184
186
  screenId: signIn, presentation: "sheet",
185
- args: { mode: "signin", modal: "1", returnScreenId: "himi_time", returnId: s.serviceId, returnTab: strArg(arg, "returnTab") || "home" },
187
+ // `returnDoneTab`: Choose a time, resumed after sign-in, gets the same `doneTab` a member's tap passes.
188
+ args: { mode: "signin", modal: "1", returnScreenId: "himi_time", returnId: s.serviceId, returnTab: strArg(arg, "returnTab") || "home", returnDoneTab: strArg(arg, "returnTab") || "home" },
186
189
  });
187
190
  },
188
191
  },
@@ -27,6 +27,7 @@ import { queryDataItems } from "@himalaya/wix-data";
27
27
  import { getMyMember } from "@himalaya/wix-members";
28
28
  import { wixMediaUrl } from "@himalaya/wix-media";
29
29
  import { open as openUrl } from "@himalaya/open-url";
30
+ import { get as getAppInfo, type AppInfo } from "@himalaya/app-info";
30
31
  import { iapPriceFields, onlineProgramItem } from "@himalaya/iap";
31
32
  import { createIapCommerce } from "@himalaya/iap-checkout";
32
33
  import { loadMemberProfile } from "../_shared/himi-account.js";
@@ -81,6 +82,8 @@ export interface S {
81
82
  yourPlanName: string; yourPlanLine: string; noYourPlan: boolean;
82
83
  /** The outcome line of the last Get in touch link ("" when it opened). */
83
84
  linkMessage: string;
85
+ /** About: "Version 1.2.0 (5)", read from the app ("" until known, and the line collapses). */
86
+ appVersionLine: string;
84
87
  }
85
88
 
86
89
  const BOOT: S = {
@@ -96,6 +99,7 @@ const BOOT: S = {
96
99
  offerName: "", offerBadge: "", noOfferBadge: true, offerPrice: "", offerPeriod: "", offerValidity: "", offerBenefits: [], noOffer: true,
97
100
  yourPlanName: "", yourPlanLine: "", noYourPlan: true,
98
101
  linkMessage: "",
102
+ appVersionLine: "",
99
103
  };
100
104
 
101
105
  // ── Reads ────────────────────────────────────────────────────────────────────
@@ -525,6 +529,21 @@ export function allowedLink(raw: string): string {
525
529
  return "";
526
530
  }
527
531
 
532
+ /** About's Privacy policy and Terms of use: an https page only, with no `user@` part. */
533
+ export function allowedPage(raw: string): string {
534
+ const url = raw.trim();
535
+ return /^https:\/\/[^/?#:@\s\\]+(?::\d+)?(?:[/?#]\S*)?$/i.test(url) ? url : "";
536
+ }
537
+
538
+ /** "Version 1.2.0 (5)": the build number only when it differs from the version. */
539
+ export function versionLine(info: Pick<AppInfo, "version" | "buildNumber"> | undefined): string {
540
+ const version = clean(info?.version);
541
+ if (!version) return "";
542
+ const build = clean(info?.buildNumber);
543
+ const full = build && build !== version ? `${version} (${build})` : version;
544
+ return copyTemplate("about.versionLine", "Version {version}", { version: full });
545
+ }
546
+
528
547
  /** The state keys that come from the member (or a price), dropped from a persisted snapshot. */
529
548
  export const MEMBER_KEYS: Array<keyof S> = [
530
549
  "linkMessage", "challenges", "offerPrice",
@@ -537,9 +556,17 @@ export const MEMBER_KEYS: Array<keyof S> = [
537
556
  "yourPlanName", "yourPlanLine", "noYourPlan",
538
557
  ];
539
558
 
559
+ /** This run's own reads that are not the member's: kept out of a snapshot, and NOT reset by a
560
+ * sign-out (`clearMember` resets MEMBER_KEYS only). After an app update a restored "Version …"
561
+ * would name the old build until `loadAbout` answers. */
562
+ const RUN_KEYS: Array<keyof S> = ["appVersionLine"];
563
+ const TRANSIENT_KEYS: Array<keyof S> = [...MEMBER_KEYS, ...RUN_KEYS];
564
+
540
565
  const svc = defineService<S, {
541
566
  openLink: (s: S, arg?: unknown) => Promise<S | undefined>;
542
- load: (s: S, arg?: unknown) => Promise<S>;
567
+ openPage: (s: S, arg?: unknown) => Promise<S | undefined>;
568
+ loadAbout: (s: S, arg?: unknown) => Promise<S | undefined>;
569
+ load:(s: S, arg?: unknown) => Promise<S>;
543
570
  refresh: (s: S, arg?: unknown) => Promise<S>;
544
571
  startRetry: (s: S) => S;
545
572
  clearMember: (s: S) => S;
@@ -550,12 +577,12 @@ const svc = defineService<S, {
550
577
  openGoal: (s: S, arg?: unknown) => S;
551
578
  openForMember: (s: S, arg?: unknown) => Promise<S>;
552
579
  }>(SERVICE, {
553
- // Prices and member data are this run's: a cold start never shows an old amount or another
554
- // member. Every key `derive` takes from the member is in both lists: `notHydrated` stops the
580
+ // Prices, member data and the app version are this run's: a cold start never shows an old
581
+ // amount, another member or an old build. Every key `derive` takes from the member is in both lists: `notHydrated` stops the
555
582
  // restore, `notPersisted` keeps the member's data off the device. A snapshot boots as a visitor
556
583
  // (BOOT's values) until `load` reads the member again.
557
- notHydrated: MEMBER_KEYS,
558
- notPersisted: MEMBER_KEYS,
584
+ notHydrated: TRANSIENT_KEYS,
585
+ notPersisted: TRANSIENT_KEYS,
559
586
  state: BOOT,
560
587
  actions: {
561
588
  // Call, email, maps (Get in touch). A failed open shows a line under the list.
@@ -568,6 +595,30 @@ const svc = defineService<S, {
568
595
  const linkMessage = opened ? "" : copyParam("home.linkFailed", "This link could not be opened.");
569
596
  return current.linkMessage === linkMessage ? undefined : commit({ ...current, linkMessage });
570
597
  },
598
+ // About's Privacy policy and Terms of use. A failed open shows the same line as Get in touch.
599
+ openPage: async (_s, arg) => {
600
+ stashCopy(arg);
601
+ const url = allowedPage(strArg(arg, "url"));
602
+ let opened = false;
603
+ if (url) { try { opened = (await openUrl(url)).opened === true; } catch { opened = false; } }
604
+ const current = now();
605
+ const linkMessage = opened ? "" : copyParam("home.linkFailed", "This link could not be opened.");
606
+ return current.linkMessage === linkMessage ? undefined : commit({ ...current, linkMessage });
607
+ },
608
+ // About's grey version line. A runtime without app info leaves the line collapsed.
609
+ loadAbout: async (s, arg) => {
610
+ stashCopy(arg);
611
+ goalsCollection = strArg(arg, "goals") || goalsCollection;
612
+ // A cold About (a deep link) boots this worker with no Home read before it: read Home's data
613
+ // once, so the shared state never rests in "loading" and Home is ready behind it.
614
+ // Through the handle, as `refresh` does: an action's result is what publishes the state.
615
+ const homeRead = loadSeq === 0 && s.status === "loading" ? svc.load(arg) : undefined;
616
+ let line = "";
617
+ try { line = versionLine(await getAppInfo()); } catch { line = ""; }
618
+ if (homeRead) await homeRead;
619
+ const current = now();
620
+ return current.appVersionLine === line ? undefined : commit({ ...current, appVersionLine: line });
621
+ },
571
622
  load: (s, arg) => {
572
623
  stashCopy(arg);
573
624
  goalsCollection = strArg(arg, "goals") || goalsCollection;
@@ -614,6 +665,6 @@ const svc = defineService<S, {
614
665
  // getState() IS the stored state.
615
666
  if ((globalThis as { himalaya?: { hydrationOptOut?: unknown } }).himalaya?.hydrationOptOut !== true) {
616
667
  const live = (svc as { getState?: () => S | undefined }).getState?.();
617
- if (live && typeof live === "object") for (const key of MEMBER_KEYS) (live as unknown as Record<string, unknown>)[key] = BOOT[key];
668
+ if (live && typeof live === "object") for (const key of TRANSIENT_KEYS) (live as unknown as Record<string, unknown>)[key] = BOOT[key];
618
669
  }
619
670
  export { svc };
@@ -34,6 +34,8 @@ interface AuthRouteInput {
34
34
  modal?: string;
35
35
  /** Modal only: the tab whose stack the return screen opens on once the modal closes. */
36
36
  returnTab?: string;
37
+ /** Passed to the return screen as `doneTab` (a booking returns to that tab once confirmed). */
38
+ returnDoneTab?: string;
37
39
  }
38
40
 
39
41
  // The screen's boot input survives refresh; consuming it must survive too.
@@ -79,12 +81,20 @@ function leaveNav(): "dismiss" | "back" {
79
81
  * only push a second copy of the screen the member is already on. */
80
82
  function resumeTarget(s: Pick<S, "returnScreenId" | "returnId" | "returnChannelId">): { screenId: string; args?: Record<string, string> } | null {
81
83
  if (!s.returnScreenId || s.returnScreenId === "himi_account") return null;
82
- return s.returnId || s.returnChannelId ? {
84
+ const doneTab = routeDoneTab();
85
+ return s.returnId || s.returnChannelId || doneTab ? {
83
86
  screenId: s.returnScreenId,
84
- args: { ...(s.returnId ? { id: s.returnId } : {}), ...(s.returnChannelId ? { channelId: s.returnChannelId } : {}) },
87
+ args: { ...(s.returnId ? { id: s.returnId } : {}), ...(s.returnChannelId ? { channelId: s.returnChannelId } : {}), ...(doneTab ? { doneTab } : {}) },
85
88
  } : { screenId: s.returnScreenId };
86
89
  }
87
90
 
91
+ /** The opener's `returnDoneTab` (a route param): the resumed screen gets it as `doneTab`, so a
92
+ * booking started before sign-in still returns to the tab it began in. Empty when not sent. */
93
+ function routeDoneTab(): string {
94
+ const tab = routeInput().returnDoneTab ?? "";
95
+ return /^[A-Za-z0-9_-]{1,64}$/.test(tab) ? tab : "";
96
+ }
97
+
88
98
  /** Resume the member-only screen that sent the visitor here, once. The return path is
89
99
  * consumed so a later refresh cannot fire it again; the host opens the target only if
90
100
  * it is linkable, the same check an authored `himi.open` gets.
@@ -209,6 +219,7 @@ function openSignIn(next: S, args: Record<string, string>, after: { screenId: st
209
219
  back.returnScreenId = after.screenId;
210
220
  if (after.args?.id) back.returnId = after.args.id;
211
221
  if (after.args?.channelId) back.returnChannelId = after.args.channelId;
222
+ if (after.args?.doneTab) back.returnDoneTab = after.args.doneTab;
212
223
  }
213
224
  if (!presentation) return navigate(next, { screenId, args: { ...args, ...back } });
214
225
  const modalArgs: Record<string, string> = { ...args, modal: "1", ...signInSheetStyle(presentation, signInStyleRequested) };