@salla.sa/twilight-theme-engine 1.0.143 → 1.0.145

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 (322) hide show
  1. package/dist/{AddToCartForm-HIIF72O4.js → AddToCartForm-NZNFVGDV.js} +3 -3
  2. package/dist/{AddToCartForm-HIIF72O4.js.map → AddToCartForm-NZNFVGDV.js.map} +1 -1
  3. package/dist/{BlogAuthorPage-LVUTPDWU.js → BlogAuthorPage-BXRIYXVN.js} +28 -27
  4. package/dist/BlogAuthorPage-BXRIYXVN.js.map +1 -0
  5. package/dist/{BlogCategoryPage-4Q2MU5IF.js → BlogCategoryPage-GHWC2WVM.js} +28 -27
  6. package/dist/BlogCategoryPage-GHWC2WVM.js.map +1 -0
  7. package/dist/{BlogPage-YG3INJ6S.js → BlogPage-ZCGNKBLI.js} +26 -25
  8. package/dist/BlogPage-ZCGNKBLI.js.map +1 -0
  9. package/dist/{BlogSinglePage-P4OPKCYA.js → BlogSinglePage-TH7Z3MKB.js} +26 -25
  10. package/dist/BlogSinglePage-TH7Z3MKB.js.map +1 -0
  11. package/dist/{BlogTagPage-RC4CSYJM.js → BlogTagPage-GM422SOW.js} +28 -27
  12. package/dist/BlogTagPage-GM422SOW.js.map +1 -0
  13. package/dist/{BrandsPage-SRQANTCQ.js → BrandsPage-LNNPU4NX.js} +27 -26
  14. package/dist/BrandsPage-LNNPU4NX.js.map +1 -0
  15. package/dist/{Breadcrumb-I6RHU7TL.js → Breadcrumb-TSG2CW3S.js} +26 -25
  16. package/dist/Breadcrumb-TSG2CW3S.js.map +1 -0
  17. package/dist/{CartItem-WXV4HG7L.js → CartItem-UVSLCSEP.js} +26 -25
  18. package/dist/CartItem-UVSLCSEP.js.map +1 -0
  19. package/dist/{CartSummary-66PEAPVR.js → CartSummary-ZCXTED4G.js} +26 -25
  20. package/dist/CartSummary-ZCXTED4G.js.map +1 -0
  21. package/dist/{Copyright-ADNRUD2V.js → Copyright-B25RLEVV.js} +3 -3
  22. package/dist/{Copyright-ADNRUD2V.js.map → Copyright-B25RLEVV.js.map} +1 -1
  23. package/dist/{CustomerLayout-S4PJGKMT.js → CustomerLayout-WGEUJEDP.js} +26 -25
  24. package/dist/CustomerLayout-WGEUJEDP.js.map +1 -0
  25. package/dist/{Footer-RYWLSTKI.js → Footer-QMNESEEI.js} +4 -4
  26. package/dist/{Footer-RYWLSTKI.js.map → Footer-QMNESEEI.js.map} +1 -1
  27. package/dist/{Header-IM7KKNSG.js → Header-ZPDXQ7U6.js} +11 -11
  28. package/dist/{Header-IM7KKNSG.js.map → Header-ZPDXQ7U6.js.map} +1 -1
  29. package/dist/{LatestProducts-VMDICC67.js → LatestProducts-UEUM47MI.js} +28 -27
  30. package/dist/LatestProducts-UEUM47MI.js.map +1 -0
  31. package/dist/{LoyaltyPage-N7LLJ3ZW.js → LoyaltyPage-ZM3FDTV3.js} +26 -25
  32. package/dist/LoyaltyPage-ZM3FDTV3.js.map +1 -0
  33. package/dist/{LoyaltyPointsPage-HVK6PJRL.js → LoyaltyPointsPage-QQIKIBTH.js} +8 -8
  34. package/dist/{LoyaltyPointsPage-HVK6PJRL.js.map → LoyaltyPointsPage-QQIKIBTH.js.map} +1 -1
  35. package/dist/{MainMenu-ICQUOKYN.js → MainMenu-3Z7HRQGU.js} +7 -7
  36. package/dist/{MainMenu-ICQUOKYN.js.map → MainMenu-3Z7HRQGU.js.map} +1 -1
  37. package/dist/{MasterLayout-WO743UZA.js → MasterLayout-ZRTWOZGC.js} +26 -25
  38. package/dist/{MasterLayout-WO743UZA.js.map → MasterLayout-ZRTWOZGC.js.map} +1 -1
  39. package/dist/{MobileMenu-TK5S3UAR.js → MobileMenu-SC7HJ6BT.js} +27 -26
  40. package/dist/MobileMenu-SC7HJ6BT.js.map +1 -0
  41. package/dist/{NotificationsPage-FNC7EOFV.js → NotificationsPage-JMAZ2N2A.js} +26 -25
  42. package/dist/NotificationsPage-JMAZ2N2A.js.map +1 -0
  43. package/dist/{OrderSinglePage-YS6FBSCD.js → OrderSinglePage-6MAFH4Q6.js} +27 -26
  44. package/dist/OrderSinglePage-6MAFH4Q6.js.map +1 -0
  45. package/dist/{OrdersPage-V3YMXMSN.js → OrdersPage-NMINSG67.js} +26 -25
  46. package/dist/OrdersPage-NMINSG67.js.map +1 -0
  47. package/dist/{PageSingle-QAAJ6NL7.js → PageSingle-WLIXOODC.js} +6 -6
  48. package/dist/{PageSingle-QAAJ6NL7.js.map → PageSingle-WLIXOODC.js.map} +1 -1
  49. package/dist/{ProductDetails-DUQPPDWZ.js → ProductDetails-NFZLUKLN.js} +7 -7
  50. package/dist/{ProductDetails-DUQPPDWZ.js.map → ProductDetails-NFZLUKLN.js.map} +1 -1
  51. package/dist/{ProfilePage-L7DOZZBH.js → ProfilePage-5PBU637J.js} +26 -25
  52. package/dist/ProfilePage-5PBU637J.js.map +1 -0
  53. package/dist/{ReviewsPage-6EIMUR5L.js → ReviewsPage-RWNFVHWR.js} +3 -3
  54. package/dist/{ReviewsPage-6EIMUR5L.js.map → ReviewsPage-RWNFVHWR.js.map} +1 -1
  55. package/dist/{SeoCartWidget-IW2EIOP3.js → SeoCartWidget-HPBQ6673.js} +26 -25
  56. package/dist/SeoCartWidget-HPBQ6673.js.map +1 -0
  57. package/dist/{SettingsPage-3BZD6EXX.js → SettingsPage-Y5X5BNHD.js} +26 -25
  58. package/dist/SettingsPage-Y5X5BNHD.js.map +1 -0
  59. package/dist/{StoreClosedNotification-Z7QF4CPA.js → StoreClosedNotification-5DOQFF2O.js} +27 -26
  60. package/dist/{StoreClosedNotification-Z7QF4CPA.js.map → StoreClosedNotification-5DOQFF2O.js.map} +1 -1
  61. package/dist/{TestimonialsPage-IA7YUNJI.js → TestimonialsPage-ZDALOH2L.js} +6 -6
  62. package/dist/{TestimonialsPage-IA7YUNJI.js.map → TestimonialsPage-ZDALOH2L.js.map} +1 -1
  63. package/dist/{ThankYouPage-GPPMDT4G.js → ThankYouPage-SYMPRWCS.js} +26 -25
  64. package/dist/ThankYouPage-SYMPRWCS.js.map +1 -0
  65. package/dist/{WalletPage-JYNPVXER.js → WalletPage-DPWZBROY.js} +27 -26
  66. package/dist/WalletPage-DPWZBROY.js.map +1 -0
  67. package/dist/WebMcpTools-3TBLKZL5.js +404 -0
  68. package/dist/WebMcpTools-3TBLKZL5.js.map +1 -0
  69. package/dist/{WishlistPage-APID33BZ.js → WishlistPage-BM3XSMQF.js} +28 -27
  70. package/dist/WishlistPage-BM3XSMQF.js.map +1 -0
  71. package/dist/api/advertisement.js +4 -4
  72. package/dist/api/apps.js +4 -4
  73. package/dist/api/blog.js +6 -6
  74. package/dist/api/brands.js +6 -6
  75. package/dist/api/cart.js +6 -6
  76. package/dist/api/category.js +6 -6
  77. package/dist/api/client.js +3 -3
  78. package/dist/api/home.js +4 -4
  79. package/dist/api/loyalty.js +6 -6
  80. package/dist/api/menu.js +4 -4
  81. package/dist/api/notification.js +4 -4
  82. package/dist/api/order.js +6 -6
  83. package/dist/api/page.js +6 -6
  84. package/dist/api/product.js +6 -6
  85. package/dist/api/profile.js +3 -3
  86. package/dist/api/store.js +5 -5
  87. package/dist/api/translations.js +4 -4
  88. package/dist/api/user.js +4 -4
  89. package/dist/api/wallet.js +4 -4
  90. package/dist/api/wishlist.js +7 -7
  91. package/dist/{chunk-FH4EVOMN.js → chunk-2N6XZZ4W.js} +4 -4
  92. package/dist/{chunk-FH4EVOMN.js.map → chunk-2N6XZZ4W.js.map} +1 -1
  93. package/dist/{chunk-2LB2TBNP.js → chunk-2ZESCQRM.js} +3 -3
  94. package/dist/{chunk-2LB2TBNP.js.map → chunk-2ZESCQRM.js.map} +1 -1
  95. package/dist/{chunk-BXBXCVSQ.js → chunk-52QZKUDU.js} +6 -6
  96. package/dist/{chunk-BXBXCVSQ.js.map → chunk-52QZKUDU.js.map} +1 -1
  97. package/dist/{chunk-7HZ6JQAJ.js → chunk-5JZSBFA5.js} +3 -3
  98. package/dist/{chunk-7HZ6JQAJ.js.map → chunk-5JZSBFA5.js.map} +1 -1
  99. package/dist/{chunk-N6ZE6HUX.js → chunk-5V4W3GBI.js} +5 -5
  100. package/dist/{chunk-N6ZE6HUX.js.map → chunk-5V4W3GBI.js.map} +1 -1
  101. package/dist/{chunk-3E3ABCPC.js → chunk-6TFM3UTF.js} +3 -3
  102. package/dist/{chunk-3E3ABCPC.js.map → chunk-6TFM3UTF.js.map} +1 -1
  103. package/dist/{chunk-4LTS5AZ3.js → chunk-7NTPNCIK.js} +3 -3
  104. package/dist/{chunk-4LTS5AZ3.js.map → chunk-7NTPNCIK.js.map} +1 -1
  105. package/dist/{chunk-SBZZEW6D.js → chunk-AJM7KUA3.js} +5 -5
  106. package/dist/{chunk-SBZZEW6D.js.map → chunk-AJM7KUA3.js.map} +1 -1
  107. package/dist/{chunk-2OHGW43N.js → chunk-BMCECPSU.js} +3 -3
  108. package/dist/{chunk-2OHGW43N.js.map → chunk-BMCECPSU.js.map} +1 -1
  109. package/dist/{chunk-LBYLBSVN.js → chunk-DHWMC6VU.js} +4 -4
  110. package/dist/{chunk-LBYLBSVN.js.map → chunk-DHWMC6VU.js.map} +1 -1
  111. package/dist/{chunk-GDLT2GGX.js → chunk-DMR3ICV5.js} +6 -6
  112. package/dist/{chunk-GDLT2GGX.js.map → chunk-DMR3ICV5.js.map} +1 -1
  113. package/dist/{chunk-WQPG22DY.js → chunk-EGI7F57E.js} +3 -3
  114. package/dist/{chunk-WQPG22DY.js.map → chunk-EGI7F57E.js.map} +1 -1
  115. package/dist/{chunk-4RKNISJB.js → chunk-ETC7OJT5.js} +3 -3
  116. package/dist/{chunk-4RKNISJB.js.map → chunk-ETC7OJT5.js.map} +1 -1
  117. package/dist/{chunk-RI6FUYJT.js → chunk-FPGR63AQ.js} +3 -3
  118. package/dist/{chunk-RI6FUYJT.js.map → chunk-FPGR63AQ.js.map} +1 -1
  119. package/dist/{chunk-4XB425HW.js → chunk-GBMMP344.js} +38 -23
  120. package/dist/chunk-GBMMP344.js.map +1 -0
  121. package/dist/{chunk-2FISCDW2.js → chunk-GFRJHCRX.js} +4 -4
  122. package/dist/{chunk-2FISCDW2.js.map → chunk-GFRJHCRX.js.map} +1 -1
  123. package/dist/{chunk-TF6HFXTW.js → chunk-H7LRGY7U.js} +3 -3
  124. package/dist/{chunk-TF6HFXTW.js.map → chunk-H7LRGY7U.js.map} +1 -1
  125. package/dist/{chunk-VS2GO7GL.js → chunk-HJGN3XVG.js} +8 -8
  126. package/dist/{chunk-VS2GO7GL.js.map → chunk-HJGN3XVG.js.map} +1 -1
  127. package/dist/{chunk-OPON37ZR.js → chunk-HRW4YFHR.js} +5 -5
  128. package/dist/{chunk-OPON37ZR.js.map → chunk-HRW4YFHR.js.map} +1 -1
  129. package/dist/{chunk-HOJ5E2PG.js → chunk-IHOUADLX.js} +3 -3
  130. package/dist/{chunk-HOJ5E2PG.js.map → chunk-IHOUADLX.js.map} +1 -1
  131. package/dist/{chunk-4XUBBJUJ.js → chunk-ITNUDQVP.js} +27 -20
  132. package/dist/chunk-ITNUDQVP.js.map +1 -0
  133. package/dist/{chunk-TVNO5MCL.js → chunk-KGSB2Y7O.js} +4 -4
  134. package/dist/{chunk-TVNO5MCL.js.map → chunk-KGSB2Y7O.js.map} +1 -1
  135. package/dist/{chunk-MNI3ZVUN.js → chunk-KKTVDCVO.js} +6 -6
  136. package/dist/{chunk-MNI3ZVUN.js.map → chunk-KKTVDCVO.js.map} +1 -1
  137. package/dist/{chunk-42GSY6HV.js → chunk-LSMKTPIE.js} +4 -4
  138. package/dist/{chunk-42GSY6HV.js.map → chunk-LSMKTPIE.js.map} +1 -1
  139. package/dist/{chunk-LFHYQ6AN.js → chunk-M5WTY3EH.js} +3 -3
  140. package/dist/{chunk-LFHYQ6AN.js.map → chunk-M5WTY3EH.js.map} +1 -1
  141. package/dist/{chunk-RYGEIQWO.js → chunk-MGG4XAJ5.js} +3 -3
  142. package/dist/{chunk-RYGEIQWO.js.map → chunk-MGG4XAJ5.js.map} +1 -1
  143. package/dist/{chunk-3MDXVF4Y.js → chunk-MIAVMNPM.js} +6 -6
  144. package/dist/{chunk-3MDXVF4Y.js.map → chunk-MIAVMNPM.js.map} +1 -1
  145. package/dist/{chunk-ROW2E5ZY.js → chunk-N44U2AA7.js} +4 -4
  146. package/dist/{chunk-ROW2E5ZY.js.map → chunk-N44U2AA7.js.map} +1 -1
  147. package/dist/{chunk-XYLGWKPG.js → chunk-NGWHUW34.js} +3 -3
  148. package/dist/{chunk-XYLGWKPG.js.map → chunk-NGWHUW34.js.map} +1 -1
  149. package/dist/{chunk-DYSSY56M.js → chunk-NLKLS3GZ.js} +5 -5
  150. package/dist/{chunk-DYSSY56M.js.map → chunk-NLKLS3GZ.js.map} +1 -1
  151. package/dist/{chunk-QN5XSUBT.js → chunk-NR5YIBTS.js} +4 -4
  152. package/dist/{chunk-QN5XSUBT.js.map → chunk-NR5YIBTS.js.map} +1 -1
  153. package/dist/{chunk-NSZOUCAR.js → chunk-OLL5OGQ5.js} +4 -4
  154. package/dist/{chunk-NSZOUCAR.js.map → chunk-OLL5OGQ5.js.map} +1 -1
  155. package/dist/{chunk-JKSDTWEC.js → chunk-PCB5DCS4.js} +4 -4
  156. package/dist/{chunk-JKSDTWEC.js.map → chunk-PCB5DCS4.js.map} +1 -1
  157. package/dist/chunk-Q77J3D2W.js +16 -0
  158. package/dist/chunk-Q77J3D2W.js.map +1 -0
  159. package/dist/{chunk-QXHO52TF.js → chunk-QIHSKEWU.js} +4 -4
  160. package/dist/{chunk-QXHO52TF.js.map → chunk-QIHSKEWU.js.map} +1 -1
  161. package/dist/{chunk-MWYKP7CI.js → chunk-QMWP2ZP6.js} +3 -3
  162. package/dist/{chunk-MWYKP7CI.js.map → chunk-QMWP2ZP6.js.map} +1 -1
  163. package/dist/{chunk-JRJYZHQE.js → chunk-R64ITZ7U.js} +4 -4
  164. package/dist/{chunk-JRJYZHQE.js.map → chunk-R64ITZ7U.js.map} +1 -1
  165. package/dist/{chunk-5UWRPWK2.js → chunk-R7VWIXFX.js} +3 -3
  166. package/dist/{chunk-5UWRPWK2.js.map → chunk-R7VWIXFX.js.map} +1 -1
  167. package/dist/{chunk-ATDOPTQ2.js → chunk-RJKMW36K.js} +8 -8
  168. package/dist/{chunk-ATDOPTQ2.js.map → chunk-RJKMW36K.js.map} +1 -1
  169. package/dist/{chunk-Q7E4TNN7.js → chunk-SLBO4SEE.js} +3 -3
  170. package/dist/{chunk-Q7E4TNN7.js.map → chunk-SLBO4SEE.js.map} +1 -1
  171. package/dist/{chunk-FXVII733.js → chunk-T2752RH7.js} +27 -3
  172. package/dist/chunk-T2752RH7.js.map +1 -0
  173. package/dist/{chunk-X7WJ2TAE.js → chunk-TF46NIZF.js} +4 -4
  174. package/dist/{chunk-X7WJ2TAE.js.map → chunk-TF46NIZF.js.map} +1 -1
  175. package/dist/{chunk-NGT46BX2.js → chunk-TWYTA2SX.js} +7 -7
  176. package/dist/{chunk-NGT46BX2.js.map → chunk-TWYTA2SX.js.map} +1 -1
  177. package/dist/{chunk-WDL6T5RX.js → chunk-U2UNWN4G.js} +5 -5
  178. package/dist/{chunk-WDL6T5RX.js.map → chunk-U2UNWN4G.js.map} +1 -1
  179. package/dist/{chunk-UME7NAC5.js → chunk-U5TWRPMK.js} +7 -7
  180. package/dist/{chunk-UME7NAC5.js.map → chunk-U5TWRPMK.js.map} +1 -1
  181. package/dist/{chunk-XK4UZHW7.js → chunk-VCMGBB5Y.js} +3 -3
  182. package/dist/{chunk-XK4UZHW7.js.map → chunk-VCMGBB5Y.js.map} +1 -1
  183. package/dist/{chunk-BKHGXHCJ.js → chunk-VZRZQV4Q.js} +3 -3
  184. package/dist/{chunk-BKHGXHCJ.js.map → chunk-VZRZQV4Q.js.map} +1 -1
  185. package/dist/{chunk-P3ZYGK5E.js → chunk-WIDH6AK6.js} +4 -4
  186. package/dist/{chunk-P3ZYGK5E.js.map → chunk-WIDH6AK6.js.map} +1 -1
  187. package/dist/{chunk-ZJLNYJCD.js → chunk-X4ITNSMT.js} +5 -5
  188. package/dist/{chunk-ZJLNYJCD.js.map → chunk-X4ITNSMT.js.map} +1 -1
  189. package/dist/{chunk-NHA4SBKG.js → chunk-XMRNYUQY.js} +3 -3
  190. package/dist/{chunk-NHA4SBKG.js.map → chunk-XMRNYUQY.js.map} +1 -1
  191. package/dist/{chunk-C76E3NHH.js → chunk-XV3HPKLI.js} +3 -3
  192. package/dist/{chunk-C76E3NHH.js.map → chunk-XV3HPKLI.js.map} +1 -1
  193. package/dist/{chunk-7BNWZKXI.js → chunk-YQOCPSOI.js} +4 -4
  194. package/dist/{chunk-7BNWZKXI.js.map → chunk-YQOCPSOI.js.map} +1 -1
  195. package/dist/{chunk-KAWAAVGL.js → chunk-YYVZFOUI.js} +3 -3
  196. package/dist/{chunk-KAWAAVGL.js.map → chunk-YYVZFOUI.js.map} +1 -1
  197. package/dist/components/cart/index.js +1 -1
  198. package/dist/components/common/index.js +1 -1
  199. package/dist/components/drawer/index.js +24 -23
  200. package/dist/components/home/index.js +29 -28
  201. package/dist/components/layout/index.js +6 -6
  202. package/dist/components/product/index.js +26 -25
  203. package/dist/components/store/index.js +25 -24
  204. package/dist/components/toast/index.js +4 -4
  205. package/dist/dev/editor/index.js +2 -2
  206. package/dist/dev/index.js +2 -2
  207. package/dist/document-class-VHDNGZQK.js +32 -0
  208. package/dist/{document-class-NJGMU7RC.js.map → document-class-VHDNGZQK.js.map} +1 -1
  209. package/dist/hooks/index.js +24 -23
  210. package/dist/hooks/useComments.js +3 -3
  211. package/dist/hooks/useGtm.js +24 -23
  212. package/dist/hooks/useMoney.js +24 -23
  213. package/dist/hooks/useProduct.js +3 -3
  214. package/dist/hooks/useStore.js +24 -23
  215. package/dist/hooks/useUser.js +5 -5
  216. package/dist/hooks/useWishlist.js +3 -3
  217. package/dist/index.js +24 -23
  218. package/dist/index.js.map +1 -1
  219. package/dist/native-app/index.js +3 -3
  220. package/dist/{navigation-ATNB3OMU.js → navigation-C5K5SOU2.js} +8 -8
  221. package/dist/{navigation-ATNB3OMU.js.map → navigation-C5K5SOU2.js.map} +1 -1
  222. package/dist/{navigation-XB2AA2QD.js → navigation-VW5P7XQM.js} +7 -7
  223. package/dist/{navigation-XB2AA2QD.js.map → navigation-VW5P7XQM.js.map} +1 -1
  224. package/dist/{not-found-6PQMIL5E.js → not-found-U2LJEYDT.js} +27 -26
  225. package/dist/not-found-U2LJEYDT.js.map +1 -0
  226. package/dist/providers/TwilightProvider.d.ts +1 -1
  227. package/dist/providers/TwilightProvider.d.ts.map +1 -1
  228. package/dist/providers/index.js +24 -23
  229. package/dist/routes/account/orders.js +8 -8
  230. package/dist/routes/account.js +17 -17
  231. package/dist/routes/blog.js +12 -12
  232. package/dist/routes/brands.js +8 -8
  233. package/dist/routes/cart.js +33 -32
  234. package/dist/routes/cart.js.map +1 -1
  235. package/dist/routes/home.js +30 -29
  236. package/dist/routes/index.js +6 -6
  237. package/dist/routes/loyalty.js +9 -9
  238. package/dist/routes/page.js +8 -8
  239. package/dist/routes/product-listing.js +31 -30
  240. package/dist/routes/product-listing.js.map +1 -1
  241. package/dist/routes/product.js +29 -28
  242. package/dist/routes/product.js.map +1 -1
  243. package/dist/routes/root/beforeLoad.d.ts.map +1 -1
  244. package/dist/routes/seo-redirects.js +6 -6
  245. package/dist/routes/testimonials.js +4 -4
  246. package/dist/routes/thank-you.js +8 -8
  247. package/dist/skeleton.js +30 -29
  248. package/dist/{store-lookup-MDUKB5VN.js → store-lookup-YL4EUIS2.js} +11 -11
  249. package/dist/{store-lookup-MDUKB5VN.js.map → store-lookup-YL4EUIS2.js.map} +1 -1
  250. package/dist/tanstack.js +19 -19
  251. package/dist/types/index.d.ts +5 -1
  252. package/dist/types/index.d.ts.map +1 -1
  253. package/dist/types/salla-sdk.d.ts +9 -1
  254. package/dist/types/salla-sdk.d.ts.map +1 -1
  255. package/dist/types/twilight.d.ts +8 -0
  256. package/dist/types/twilight.d.ts.map +1 -1
  257. package/dist/utils/baseHead.js +2 -2
  258. package/dist/utils/index.js +6 -6
  259. package/dist/utils/store-base.d.ts +30 -0
  260. package/dist/utils/store-base.d.ts.map +1 -1
  261. package/dist/utils/store-identity.d.ts +8 -0
  262. package/dist/utils/store-identity.d.ts.map +1 -1
  263. package/dist/vite/index.js +3 -3
  264. package/dist/webmcp/WebMcpTools.d.ts +8 -0
  265. package/dist/webmcp/WebMcpTools.d.ts.map +1 -0
  266. package/dist/webmcp/cart-tools.d.ts +3 -0
  267. package/dist/webmcp/cart-tools.d.ts.map +1 -0
  268. package/dist/webmcp/catalog-tools.d.ts +3 -0
  269. package/dist/webmcp/catalog-tools.d.ts.map +1 -0
  270. package/dist/webmcp/input.d.ts +20 -0
  271. package/dist/webmcp/input.d.ts.map +1 -0
  272. package/dist/webmcp/model-context.d.ts +10 -0
  273. package/dist/webmcp/model-context.d.ts.map +1 -0
  274. package/dist/webmcp/page-navigation.d.ts +17 -0
  275. package/dist/webmcp/page-navigation.d.ts.map +1 -0
  276. package/dist/webmcp/page-tools.d.ts +3 -0
  277. package/dist/webmcp/page-tools.d.ts.map +1 -0
  278. package/dist/webmcp/registerWebMcpTools.d.ts +9 -0
  279. package/dist/webmcp/registerWebMcpTools.d.ts.map +1 -0
  280. package/dist/webmcp/results.d.ts +9 -0
  281. package/dist/webmcp/results.d.ts.map +1 -0
  282. package/dist/webmcp/salla-deps.d.ts +9 -0
  283. package/dist/webmcp/salla-deps.d.ts.map +1 -0
  284. package/dist/webmcp/schema.d.ts +14 -0
  285. package/dist/webmcp/schema.d.ts.map +1 -0
  286. package/dist/webmcp/tools.d.ts +8 -0
  287. package/dist/webmcp/tools.d.ts.map +1 -0
  288. package/dist/webmcp/types.d.ts +83 -0
  289. package/dist/webmcp/types.d.ts.map +1 -0
  290. package/dist/webmcp/useWebMcpSupported.d.ts +9 -0
  291. package/dist/webmcp/useWebMcpSupported.d.ts.map +1 -0
  292. package/dist/webmcp/useWebMcpTools.d.ts +10 -0
  293. package/dist/webmcp/useWebMcpTools.d.ts.map +1 -0
  294. package/package.json +1 -1
  295. package/tailwind/routes/root/beforeLoad.ts.txt +27 -9
  296. package/dist/BlogAuthorPage-LVUTPDWU.js.map +0 -1
  297. package/dist/BlogCategoryPage-4Q2MU5IF.js.map +0 -1
  298. package/dist/BlogPage-YG3INJ6S.js.map +0 -1
  299. package/dist/BlogSinglePage-P4OPKCYA.js.map +0 -1
  300. package/dist/BlogTagPage-RC4CSYJM.js.map +0 -1
  301. package/dist/BrandsPage-SRQANTCQ.js.map +0 -1
  302. package/dist/Breadcrumb-I6RHU7TL.js.map +0 -1
  303. package/dist/CartItem-WXV4HG7L.js.map +0 -1
  304. package/dist/CartSummary-66PEAPVR.js.map +0 -1
  305. package/dist/CustomerLayout-S4PJGKMT.js.map +0 -1
  306. package/dist/LatestProducts-VMDICC67.js.map +0 -1
  307. package/dist/LoyaltyPage-N7LLJ3ZW.js.map +0 -1
  308. package/dist/MobileMenu-TK5S3UAR.js.map +0 -1
  309. package/dist/NotificationsPage-FNC7EOFV.js.map +0 -1
  310. package/dist/OrderSinglePage-YS6FBSCD.js.map +0 -1
  311. package/dist/OrdersPage-V3YMXMSN.js.map +0 -1
  312. package/dist/ProfilePage-L7DOZZBH.js.map +0 -1
  313. package/dist/SeoCartWidget-IW2EIOP3.js.map +0 -1
  314. package/dist/SettingsPage-3BZD6EXX.js.map +0 -1
  315. package/dist/ThankYouPage-GPPMDT4G.js.map +0 -1
  316. package/dist/WalletPage-JYNPVXER.js.map +0 -1
  317. package/dist/WishlistPage-APID33BZ.js.map +0 -1
  318. package/dist/chunk-4XB425HW.js.map +0 -1
  319. package/dist/chunk-4XUBBJUJ.js.map +0 -1
  320. package/dist/chunk-FXVII733.js.map +0 -1
  321. package/dist/document-class-NJGMU7RC.js +0 -32
  322. package/dist/not-found-6PQMIL5E.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/theme-version.ts","../src/utils/sdk-helpers.ts"],"names":[],"mappings":";;;;AAqCO,SAAS,uBAAA,GAAyC;AACvD,EA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wB,IAAK,OAAA,GAAU,cAAc,CAAA;AACvE,EAAA,OAAO,SAAA,IAAa,IAAA,GAAO,MAAA,CAAO,SAAS,CAAA,GAAI,IAAA;AACjD;AAWO,SAAS,oBAA6D,QAAA,EAAgB;AAC3F,EAAA,MAAM,YAAY,uBAAA,EAAwB;AAC1C,EAAA,IAAI,CAAC,WAAW,OAAO,QAAA;AACvB,EAAA,OAAO,EAAE,GAAG,QAAA,EAAU,OAAA,EAAS,EAAE,GAAG,QAAA,CAAS,OAAA,EAAS,cAAA,EAAgB,SAAA,EAAU,EAAE;AACpF;AAcO,SAAS,oBAAoB,OAAA,EAAwC;AAC1E,EAAA,MAAM,MAAM,WAAA,EAAY;AACxB,EAAA,IAAI,CAAC,GAAA,EAAK;AACV,EAAA,MAAM,SAAA,GAAY,kBAAkB,OAAO,CAAA;AAC3C,EAAA,IAAI;AACF,IAAA,IAAI,aAAa,IAAA,EAAM,GAAA,CAAI,GAAA,EAAK,SAAA,GAAY,gBAAgB,SAAS,CAAA;AAAA,gBACzD,GAAA,CAAI,GAAA,EAAK,OAAO,QAAA,EAAU,OAAA,EAAS,SAAS,cAAc,CAAA;AAAA,EACxE,CAAA,CAAA,MAAQ;AAAA,EAER;AACF","file":"chunk-NHA4SBKG.js","sourcesContent":["/**\n * @fileoverview Which version of the theme's settings to render — the one answer,\n * in one place.\n *\n * A merchant's theme settings are versioned. An ordinary storefront visit names\n * no version and gets the live one; the API decides, and reports it back as\n * `theme.profile.id`. Two surfaces need a different one, and both address it in\n * the URL of an iframe:\n *\n * - the merchant's theme editor at `s.salla.sa/themes/editor/…`, which shows a\n * draft version beside the controls that are editing it;\n * - a partner running the theme locally, whose dev server is the iframe.\n *\n * Written as a module of its own rather than inline at the one call site,\n * because `store-identity.ts` exists for exactly this reason: the identifier a\n * request resolved and the identifier it sent were two different values for\n * days, in two files, and every test passed. A second implementation of this is\n * the bug, not a refactor away from one.\n */\nimport { getRequestStore, getTwilightContext } from '../twilight/context';\nimport type { StoreContext } from '../api/store';\nimport { getInjectedRuntimeEnv } from './runtime-env';\n\n/**\n * The version this request asked for, or null when it asked for none.\n *\n * Deliberately excludes the version the *settings* name. This is the answer to\n * \"what did the caller address?\", and it has to be available before any settings\n * exist — React Query keys are built from it, and a key that means one thing\n * during SSR and another after hydration is how a page refetches everything it\n * was just handed.\n *\n * 1. what the request named, seeded by `twilightMiddleware` on a host permitted\n * to name one;\n * 2. what SSR resolved and published into the head, which is all the browser has\n * once the dispatcher has stripped `?versionId=` from the URL.\n */\nexport function requestedThemeVersionId(): string | null {\n const { versionId } = getRequestStore();\n if (versionId) return versionId;\n\n return getInjectedRuntimeEnv().versionId || null;\n}\n\n/**\n * The version every Salla API call is answered with — what goes in `s-version-id`.\n *\n * The requested version outranks the settings, because a request that named one\n * is the only reason this is ever anything but the live version: falling back to\n * the settings there would let the first answer overwrite the question.\n *\n * The settings' own `theme.profile.id` stays as the fallback, unchanged. It is\n * what this header has always carried, and on an ordinary storefront it still\n * is — it keeps the rest of a page's calls pinned to the version the settings\n * call resolved, rather than letting a version go live mid-render.\n *\n * That pin is only good for the scope the settings were requested with. Each\n * market (scope) has its own version, and the API lets a named version outrank\n * the market's: once the shopper switches market, the loaded settings still\n * describe the previous one, and replaying their version — on the settings call\n * for the new market first of all — gets the previous market's theme back, for\n * good. So the version is replayed only while the active scope is the one the\n * settings were answered for (`store.scope`), which is not always the one they\n * were requested for (`requestedScopeId`): the API falls back to another scope\n * when it does not accept the requested one, and that scope's version must not\n * ride along on the next request for the requested one. With no active scope it\n * is replayed only for settings requested without one. Otherwise nothing is\n * sent and the API picks the version of the scope on the request.\n *\n * `activeScopeId` is passed in by the caller that already resolved the scope for\n * its `s-scope-*` headers.\n *\n * Reading the settings is guarded because `getTwilightContext().settings` throws\n * a `SettingsError` when they have not loaded — which is the normal state on the\n * very first call, the settings call itself.\n */\n/** Whether `settings` were answered for `activeScopeId` (see {@link resolveThemeVersionId}). */\nfunction answersScope(settings: StoreContext | null | undefined, activeScopeId: string | null) {\n const requestedScopeId = settings?.requestedScopeId ?? null;\n if (activeScopeId == null) return requestedScopeId == null;\n const answeredScopeId = settings?.store?.scope?.id;\n return (answeredScopeId != null ? String(answeredScopeId) : requestedScopeId) === activeScopeId;\n}\n\nexport function resolveThemeVersionId(activeScopeId: string | null = null): string | null {\n const requested = requestedThemeVersionId();\n if (requested) return requested;\n\n try {\n const settings = getTwilightContext().settings;\n if (!answersScope(settings, activeScopeId)) return null;\n\n const profileId = settings?.theme?.profile?.id;\n return profileId != null ? String(profileId) : null;\n } catch {\n return null;\n }\n}\n","export type { StoreContext } from '../api/store';\nimport type { StoreContext } from '../api/store';\nimport type { SallaSDK } from '../types/salla-sdk';\nimport { resolveStoreIdentifier } from './store-identity';\nimport { requestedThemeVersionId } from './theme-version';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/**\n * Which store to ask the API about — see {@link resolveStoreIdentifier}.\n *\n * A delegation, not a second implementation. This name is the one on the wire\n * (`api/client.ts` sets the `store-identifier` header from it) and the one\n * themes import from `@salla.sa/twilight-theme-engine/utils`, so it stays; what\n * it must never do again is answer differently from the resolver everything\n * else asks. It had its own copy of the order once, missing the store the\n * request names and preferring the build-time `VITE_STORE_DOMAIN` that a\n * deployed worker does not have — so every published theme sent an empty\n * identifier and rendered \"Store Unavailable\".\n */\nexport function getStoreIdentifier(explicit?: string): string {\n return resolveStoreIdentifier(explicit);\n}\n\n/**\n * Get Salla SDK instance if available\n */\nexport function getSallaSDK(): typeof window.salla | undefined {\n if (!isBrowser) return undefined;\n return window.salla;\n}\n\n/** Dispatched on `window` by the SDK as the last step of loading (twilight `src/index.js`). */\nconst SDK_CREATED_EVENT = 'salla::created';\n\nconst noop = () => {};\n\n/**\n * Whether `window.salla` is the SDK, rather than the stub that stands in for it.\n *\n * ⚠️ `window.salla` exists from the first bytes of the page. The `twilight-init`\n * head script defines it with an `onReady`, so app snippets can queue work, and\n * the SDK — a deferred module — fills it in later. React can hydrate and run\n * effects in between, and there `window.salla?.event.on(…)` passes its `?.` and\n * throws `Cannot read properties of undefined (reading 'on')`.\n *\n * The SDK defines `init` and `event` in one synchronous module evaluation and the\n * stub has neither, so either one means it has loaded.\n */\nfunction isLoaded(sdk: typeof window.salla): sdk is SallaSDK {\n return typeof sdk?.init === 'function' || typeof sdk?.event?.on === 'function';\n}\n\n/** An SDK whose event bus can take a listener — what {@link onSallaEvent} needs. */\nfunction hasEventBus(sdk: typeof window.salla): sdk is SallaSDK {\n return typeof sdk?.event?.on === 'function';\n}\n\n/**\n * Run `callback` with the SDK as soon as it has loaded: now if it has, otherwise\n * when it announces itself.\n *\n * Returns a cancel for an effect's cleanup, so a component that unmounts first\n * never has the callback run. An effect that returned early when the SDK was not\n * there yet never ran again — on a cold load, where hydration beats the SDK, the\n * engine never initialised it at all.\n */\nexport function whenSallaLoaded(callback: (sdk: SallaSDK) => void): () => void {\n return whenSalla(isLoaded, callback);\n}\n\nfunction whenSalla(\n isUsable: (sdk: typeof window.salla) => sdk is SallaSDK,\n callback: (sdk: SallaSDK) => void\n): () => void {\n if (!isBrowser) return noop;\n\n if (isUsable(window.salla)) {\n callback(window.salla);\n return noop;\n }\n\n let settled = false;\n const onCreated = () => {\n const sdk = window.salla;\n if (settled || !isUsable(sdk)) return;\n settled = true;\n window.removeEventListener(SDK_CREATED_EVENT, onCreated);\n callback(sdk);\n };\n window.addEventListener(SDK_CREATED_EVENT, onCreated);\n\n return () => {\n settled = true;\n window.removeEventListener(SDK_CREATED_EVENT, onCreated);\n };\n}\n\n/**\n * Run `callback` once the SDK has loaded **and been initialised** — for work that\n * talks to the API, which needs the store config `init` sets.\n *\n * Loaded is not enough for that: `init` finishes asynchronously, so a cart lookup\n * made the moment the SDK announces itself goes out without a store identifier\n * and is answered `Store Identifier not found`. Returns a cancel, as\n * {@link whenSallaLoaded} does.\n *\n * A rejected `onReady` still runs `callback`, as `useTwilightInit` carries on past\n * one: it means a partial initialisation, and waiting on it would leave the caller\n * waiting for good.\n */\nexport function whenSallaReady(callback: (sdk: SallaSDK) => void): () => void {\n let cancelled = false;\n const cancel = whenSallaLoaded((sdk) => {\n void new Promise((resolve) => resolve(sdk.onReady?.())).catch(noop).then(() => {\n if (!cancelled) callback(sdk);\n });\n });\n return () => {\n cancelled = true;\n cancel();\n };\n}\n\n/**\n * `salla.event.on(name, listener)` once the SDK has loaded. Returns the matching\n * unsubscribe, which also cancels a subscription still waiting for the SDK.\n *\n * Removed from the emitter it was added to, not from whatever `window.salla` is\n * by the time the component unmounts.\n *\n * Waits for an event bus specifically, not for \"loaded\": an SDK is recognised by\n * `init` alone, and subscribing on one without a bus would throw.\n */\nexport function onSallaEvent(name: string, listener: (...args: unknown[]) => void): () => void {\n let bus: SallaSDK['event'] | undefined;\n const cancel = whenSalla(hasEventBus, (sdk) => {\n bus = sdk.event;\n bus.on(name, listener);\n });\n return () => {\n cancel();\n bus?.off?.(name, listener);\n };\n}\n\n/**\n * Push the active route locale onto the Salla SDK.\n *\n * Why this is needed (and why it must run on every navigation):\n * - The SDK seeds its locale from `navigator.language` — the theme sets no `s-lang`\n * cookie or `window.locale` — so an English browser starts the SDK in `en` even on\n * an `/ar` store.\n * - The SDK fixes its axios `accept-language` header ONCE, at init. `salla.lang.setLocale`\n * only swaps UI translations (it never touches the header), and `salla.init()` is a\n * no-op after `Salla.status === 'ready'`, so the header never refreshes on its own.\n * - `profile::info.fetched` (login / profile refresh on navigation) overrides the header\n * to the *account's* language.\n *\n * Net result without this: `salla.api.*` calls (cart/product details) return data in the\n * wrong locale — e.g. English cart item names on `/ar/cart` — intermittently, depending on\n * load order and whether a profile fetch ran. Re-asserting the URL locale here keeps the\n * header correct. No-op on the server and until the SDK exposes the methods.\n */\nexport function syncSdkLocale(locale: string): void {\n const sdk = getSallaSDK();\n if (!sdk || !locale) return;\n try {\n sdk.lang?.setLocale?.(locale);\n sdk.api?.setHeader?.('accept-language', locale);\n // The localization modal swaps `/${user.language_code}/` in the URL on submit;\n // the SDK never sets this locally, so without it the switch reloads the same page.\n sdk.config?.set?.('user.language_code', locale);\n } catch {\n // SDK partially loaded — the header is re-asserted on the next navigation.\n }\n}\n\n/**\n * The `s-version-id` the SDK sends: the version the request named, else the one\n * the settings report.\n *\n * The request outranks the settings here for the reason it does in\n * `resolveThemeVersionId`. `headers['s-version-id']` is the version the API\n * *answered with*, and for a version it cannot reach it reports the live one\n * while rendering defaults. Read alone, a preview's `salla.api.*` calls asked\n * about the live version while the engine's own asked about the previewed one,\n * so one page showed two versions.\n */\nfunction sdkThemeVersionId(headers: StoreContext['headers']): string | null {\n const versionId = requestedThemeVersionId() ?? headers?.['s-version-id'];\n return versionId != null ? String(versionId) : null;\n}\n\n/**\n * Settings as the SDK's `init` should copy them: with `headers` naming the\n * version {@link sdkThemeVersionId} picks.\n *\n * `init` spreads `headers` over its axios defaults, and on a first load nothing\n * re-asserts the version afterwards: TanStack restores the root match's context\n * instead of re-running `rootBeforeLoad` in the browser, so\n * {@link syncSdkThemeVersion} first runs on a client navigation.\n */\nexport function withSdkThemeVersion<T extends Pick<StoreContext, 'headers'>>(settings: T): T {\n const versionId = requestedThemeVersionId();\n if (!versionId) return settings;\n return { ...settings, headers: { ...settings.headers, 's-version-id': versionId } };\n}\n\n/**\n * Push the theme version onto the Salla SDK: the requested one, else the one the\n * current settings name (see {@link sdkThemeVersionId}).\n *\n * The SDK copies `settings.headers` into its axios defaults ONCE, at init, and\n * `s-version-id` is one of them. Settings refetched on the client — the shopper\n * switched market, and each market has its own version — name a different one,\n * and without this every `salla.api.*` call keeps asking for the previous\n * market's version until a full page load. Settings that name no version take\n * the header off instead, so the SDK asks for the live one like the engine's own\n * client does. No-op on the server and until the SDK exposes its api.\n */\nexport function syncSdkThemeVersion(headers: StoreContext['headers']): void {\n const sdk = getSallaSDK();\n if (!sdk) return;\n const versionId = sdkThemeVersionId(headers);\n try {\n if (versionId != null) sdk.api?.setHeader?.('s-version-id', versionId);\n else delete sdk.api?.axios?.defaults?.headers?.common?.['s-version-id'];\n } catch {\n // SDK partially loaded — the header is re-asserted on the next navigation.\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/theme-version.ts","../src/utils/sdk-helpers.ts"],"names":[],"mappings":";;;;AAqCO,SAAS,uBAAA,GAAyC;AACvD,EAAA,MAAM,EAAE,SAAA,EAAU,GAAI,eAAA,EAAgB;AACtC,EAAA,IAAI,WAAW,OAAO,SAAA;AAEtB,EAAA,OAAO,qBAAA,GAAwB,SAAA,IAAa,IAAA;AAC9C;AAmCA,SAAS,YAAA,CAAa,UAA2C,aAAA,EAA8B;AAC7F,EAAA,MAAM,gBAAA,GAAmB,UAAU,gBAAA,IAAoB,IAAA;AACvD,EAAA,IAAI,aAAA,IAAiB,IAAA,EAAM,OAAO,gBAAA,IAAoB,IAAA;AACtD,EAAA,MAAM,eAAA,GAAkB,QAAA,EAAU,KAAA,EAAO,KAAA,EAAO,EAAA;AAChD,EAAA,OAAA,CAAQ,eAAA,IAAmB,IAAA,GAAO,MAAA,CAAO,eAAe,IAAI,gBAAA,MAAsB,aAAA;AACpF;AAEO,SAAS,qBAAA,CAAsB,gBAA+B,IAAA,EAAqB;AACxF,EAAA,MAAM,YAAY,uBAAA,EAAwB;AAC1C,EAAA,IAAI,WAAW,OAAO,SAAA;AAEtB,EAAA,IAAI;AACF,IAAA,MAAM,QAAA,GAAW,oBAAmB,CAAE,QAAA;AACtC,IAAA,IAAI,CAAC,YAAA,CAAa,QAAA,EAAU,aAAa,GAAG,OAAO,IAAA;AAEnD,IAAA,MAAM,SAAA,GAAY,QAAA,EAAU,KAAA,EAAO,OAAA,EAAS,EAAA;AAC5C,IAAA,OAAO,SAAA,IAAa,IAAA,GAAO,MAAA,CAAO,SAAS,CAAA,GAAI,IAAA;AAAA,EACjD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;;;AC3FA,IAAM,SAAA,GAAY,OAAO,MAAA,KAAW,WAAA;AAc7B,SAAS,mBAAmB,QAAA,EAA2B;AAC5D,EAAA,OA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,oBAAA,EAAsB,MAAM,CAAA;AAAA,EAChD,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;AAaA,SAAS,kBAAkB,OAAA,EAAiD;AAC1E,EAAA,MAAM,SAAA,GAAY,uBAAA,EAAwB,IAAK,OAAA,GAAU,cAAc,CAAA;AACvE,EAAA,OAAO,SAAA,IAAa,IAAA,GAAO,MAAA,CAAO,SAAS,CAAA,GAAI,IAAA;AACjD;AAWO,SAAS,oBAA6D,QAAA,EAAgB;AAC3F,EAAA,MAAM,YAAY,uBAAA,EAAwB;AAC1C,EAAA,IAAI,CAAC,WAAW,OAAO,QAAA;AACvB,EAAA,OAAO,EAAE,GAAG,QAAA,EAAU,OAAA,EAAS,EAAE,GAAG,QAAA,CAAS,OAAA,EAAS,cAAA,EAAgB,SAAA,EAAU,EAAE;AACpF;AAcO,SAAS,oBAAoB,OAAA,EAAwC;AAC1E,EAAA,MAAM,MAAM,WAAA,EAAY;AACxB,EAAA,IAAI,CAAC,GAAA,EAAK;AACV,EAAA,MAAM,SAAA,GAAY,kBAAkB,OAAO,CAAA;AAC3C,EAAA,IAAI;AACF,IAAA,IAAI,aAAa,IAAA,EAAM,GAAA,CAAI,GAAA,EAAK,SAAA,GAAY,gBAAgB,SAAS,CAAA;AAAA,gBACzD,GAAA,CAAI,GAAA,EAAK,OAAO,QAAA,EAAU,OAAA,EAAS,SAAS,cAAc,CAAA;AAAA,EACxE,CAAA,CAAA,MAAQ;AAAA,EAER;AACF","file":"chunk-XMRNYUQY.js","sourcesContent":["/**\n * @fileoverview Which version of the theme's settings to render — the one answer,\n * in one place.\n *\n * A merchant's theme settings are versioned. An ordinary storefront visit names\n * no version and gets the live one; the API decides, and reports it back as\n * `theme.profile.id`. Two surfaces need a different one, and both address it in\n * the URL of an iframe:\n *\n * - the merchant's theme editor at `s.salla.sa/themes/editor/…`, which shows a\n * draft version beside the controls that are editing it;\n * - a partner running the theme locally, whose dev server is the iframe.\n *\n * Written as a module of its own rather than inline at the one call site,\n * because `store-identity.ts` exists for exactly this reason: the identifier a\n * request resolved and the identifier it sent were two different values for\n * days, in two files, and every test passed. A second implementation of this is\n * the bug, not a refactor away from one.\n */\nimport { getRequestStore, getTwilightContext } from '../twilight/context';\nimport type { StoreContext } from '../api/store';\nimport { getInjectedRuntimeEnv } from './runtime-env';\n\n/**\n * The version this request asked for, or null when it asked for none.\n *\n * Deliberately excludes the version the *settings* name. This is the answer to\n * \"what did the caller address?\", and it has to be available before any settings\n * exist — React Query keys are built from it, and a key that means one thing\n * during SSR and another after hydration is how a page refetches everything it\n * was just handed.\n *\n * 1. what the request named, seeded by `twilightMiddleware` on a host permitted\n * to name one;\n * 2. what SSR resolved and published into the head, which is all the browser has\n * once the dispatcher has stripped `?versionId=` from the URL.\n */\nexport function requestedThemeVersionId(): string | null {\n const { versionId } = getRequestStore();\n if (versionId) return versionId;\n\n return getInjectedRuntimeEnv().versionId || null;\n}\n\n/**\n * The version every Salla API call is answered with — what goes in `s-version-id`.\n *\n * The requested version outranks the settings, because a request that named one\n * is the only reason this is ever anything but the live version: falling back to\n * the settings there would let the first answer overwrite the question.\n *\n * The settings' own `theme.profile.id` stays as the fallback, unchanged. It is\n * what this header has always carried, and on an ordinary storefront it still\n * is — it keeps the rest of a page's calls pinned to the version the settings\n * call resolved, rather than letting a version go live mid-render.\n *\n * That pin is only good for the scope the settings were requested with. Each\n * market (scope) has its own version, and the API lets a named version outrank\n * the market's: once the shopper switches market, the loaded settings still\n * describe the previous one, and replaying their version — on the settings call\n * for the new market first of all — gets the previous market's theme back, for\n * good. So the version is replayed only while the active scope is the one the\n * settings were answered for (`store.scope`), which is not always the one they\n * were requested for (`requestedScopeId`): the API falls back to another scope\n * when it does not accept the requested one, and that scope's version must not\n * ride along on the next request for the requested one. With no active scope it\n * is replayed only for settings requested without one. Otherwise nothing is\n * sent and the API picks the version of the scope on the request.\n *\n * `activeScopeId` is passed in by the caller that already resolved the scope for\n * its `s-scope-*` headers.\n *\n * Reading the settings is guarded because `getTwilightContext().settings` throws\n * a `SettingsError` when they have not loaded — which is the normal state on the\n * very first call, the settings call itself.\n */\n/** Whether `settings` were answered for `activeScopeId` (see {@link resolveThemeVersionId}). */\nfunction answersScope(settings: StoreContext | null | undefined, activeScopeId: string | null) {\n const requestedScopeId = settings?.requestedScopeId ?? null;\n if (activeScopeId == null) return requestedScopeId == null;\n const answeredScopeId = settings?.store?.scope?.id;\n return (answeredScopeId != null ? String(answeredScopeId) : requestedScopeId) === activeScopeId;\n}\n\nexport function resolveThemeVersionId(activeScopeId: string | null = null): string | null {\n const requested = requestedThemeVersionId();\n if (requested) return requested;\n\n try {\n const settings = getTwilightContext().settings;\n if (!answersScope(settings, activeScopeId)) return null;\n\n const profileId = settings?.theme?.profile?.id;\n return profileId != null ? String(profileId) : null;\n } catch {\n return null;\n }\n}\n","export type { StoreContext } from '../api/store';\nimport type { StoreContext } from '../api/store';\nimport type { SallaSDK } from '../types/salla-sdk';\nimport { resolveStoreIdentifier } from './store-identity';\nimport { requestedThemeVersionId } from './theme-version';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/**\n * Which store to ask the API about — see {@link resolveStoreIdentifier}.\n *\n * A delegation, not a second implementation. This name is the one on the wire\n * (`api/client.ts` sets the `store-identifier` header from it) and the one\n * themes import from `@salla.sa/twilight-theme-engine/utils`, so it stays; what\n * it must never do again is answer differently from the resolver everything\n * else asks. It had its own copy of the order once, missing the store the\n * request names and preferring the build-time `VITE_STORE_DOMAIN` that a\n * deployed worker does not have — so every published theme sent an empty\n * identifier and rendered \"Store Unavailable\".\n */\nexport function getStoreIdentifier(explicit?: string): string {\n return resolveStoreIdentifier(explicit);\n}\n\n/**\n * Get Salla SDK instance if available\n */\nexport function getSallaSDK(): typeof window.salla | undefined {\n if (!isBrowser) return undefined;\n return window.salla;\n}\n\n/** Dispatched on `window` by the SDK as the last step of loading (twilight `src/index.js`). */\nconst SDK_CREATED_EVENT = 'salla::created';\n\nconst noop = () => {};\n\n/**\n * Whether `window.salla` is the SDK, rather than the stub that stands in for it.\n *\n * ⚠️ `window.salla` exists from the first bytes of the page. The `twilight-init`\n * head script defines it with an `onReady`, so app snippets can queue work, and\n * the SDK — a deferred module — fills it in later. React can hydrate and run\n * effects in between, and there `window.salla?.event.on(…)` passes its `?.` and\n * throws `Cannot read properties of undefined (reading 'on')`.\n *\n * The SDK defines `init` and `event` in one synchronous module evaluation and the\n * stub has neither, so either one means it has loaded.\n */\nfunction isLoaded(sdk: typeof window.salla): sdk is SallaSDK {\n return typeof sdk?.init === 'function' || typeof sdk?.event?.on === 'function';\n}\n\n/** An SDK whose event bus can take a listener — what {@link onSallaEvent} needs. */\nfunction hasEventBus(sdk: typeof window.salla): sdk is SallaSDK {\n return typeof sdk?.event?.on === 'function';\n}\n\n/**\n * Run `callback` with the SDK as soon as it has loaded: now if it has, otherwise\n * when it announces itself.\n *\n * Returns a cancel for an effect's cleanup, so a component that unmounts first\n * never has the callback run. An effect that returned early when the SDK was not\n * there yet never ran again — on a cold load, where hydration beats the SDK, the\n * engine never initialised it at all.\n */\nexport function whenSallaLoaded(callback: (sdk: SallaSDK) => void): () => void {\n return whenSalla(isLoaded, callback);\n}\n\nfunction whenSalla(\n isUsable: (sdk: typeof window.salla) => sdk is SallaSDK,\n callback: (sdk: SallaSDK) => void\n): () => void {\n if (!isBrowser) return noop;\n\n if (isUsable(window.salla)) {\n callback(window.salla);\n return noop;\n }\n\n let settled = false;\n const onCreated = () => {\n const sdk = window.salla;\n if (settled || !isUsable(sdk)) return;\n settled = true;\n window.removeEventListener(SDK_CREATED_EVENT, onCreated);\n callback(sdk);\n };\n window.addEventListener(SDK_CREATED_EVENT, onCreated);\n\n return () => {\n settled = true;\n window.removeEventListener(SDK_CREATED_EVENT, onCreated);\n };\n}\n\n/**\n * Run `callback` once the SDK has loaded **and been initialised** — for work that\n * talks to the API, which needs the store config `init` sets.\n *\n * Loaded is not enough for that: `init` finishes asynchronously, so a cart lookup\n * made the moment the SDK announces itself goes out without a store identifier\n * and is answered `Store Identifier not found`. Returns a cancel, as\n * {@link whenSallaLoaded} does.\n *\n * A rejected `onReady` still runs `callback`, as `useTwilightInit` carries on past\n * one: it means a partial initialisation, and waiting on it would leave the caller\n * waiting for good.\n */\nexport function whenSallaReady(callback: (sdk: SallaSDK) => void): () => void {\n let cancelled = false;\n const cancel = whenSallaLoaded((sdk) => {\n void new Promise((resolve) => resolve(sdk.onReady?.())).catch(noop).then(() => {\n if (!cancelled) callback(sdk);\n });\n });\n return () => {\n cancelled = true;\n cancel();\n };\n}\n\n/**\n * `salla.event.on(name, listener)` once the SDK has loaded. Returns the matching\n * unsubscribe, which also cancels a subscription still waiting for the SDK.\n *\n * Removed from the emitter it was added to, not from whatever `window.salla` is\n * by the time the component unmounts.\n *\n * Waits for an event bus specifically, not for \"loaded\": an SDK is recognised by\n * `init` alone, and subscribing on one without a bus would throw.\n */\nexport function onSallaEvent(name: string, listener: (...args: unknown[]) => void): () => void {\n let bus: SallaSDK['event'] | undefined;\n const cancel = whenSalla(hasEventBus, (sdk) => {\n bus = sdk.event;\n bus.on(name, listener);\n });\n return () => {\n cancel();\n bus?.off?.(name, listener);\n };\n}\n\n/**\n * Push the active route locale onto the Salla SDK.\n *\n * Why this is needed (and why it must run on every navigation):\n * - The SDK seeds its locale from `navigator.language` — the theme sets no `s-lang`\n * cookie or `window.locale` — so an English browser starts the SDK in `en` even on\n * an `/ar` store.\n * - The SDK fixes its axios `accept-language` header ONCE, at init. `salla.lang.setLocale`\n * only swaps UI translations (it never touches the header), and `salla.init()` is a\n * no-op after `Salla.status === 'ready'`, so the header never refreshes on its own.\n * - `profile::info.fetched` (login / profile refresh on navigation) overrides the header\n * to the *account's* language.\n *\n * Net result without this: `salla.api.*` calls (cart/product details) return data in the\n * wrong locale — e.g. English cart item names on `/ar/cart` — intermittently, depending on\n * load order and whether a profile fetch ran. Re-asserting the URL locale here keeps the\n * header correct. No-op on the server and until the SDK exposes the methods.\n */\nexport function syncSdkLocale(locale: string): void {\n const sdk = getSallaSDK();\n if (!sdk || !locale) return;\n try {\n sdk.lang?.setLocale?.(locale);\n sdk.api?.setHeader?.('accept-language', locale);\n // The localization modal swaps `/${user.language_code}/` in the URL on submit;\n // the SDK never sets this locally, so without it the switch reloads the same page.\n sdk.config?.set?.('user.language_code', locale);\n } catch {\n // SDK partially loaded — the header is re-asserted on the next navigation.\n }\n}\n\n/**\n * The `s-version-id` the SDK sends: the version the request named, else the one\n * the settings report.\n *\n * The request outranks the settings here for the reason it does in\n * `resolveThemeVersionId`. `headers['s-version-id']` is the version the API\n * *answered with*, and for a version it cannot reach it reports the live one\n * while rendering defaults. Read alone, a preview's `salla.api.*` calls asked\n * about the live version while the engine's own asked about the previewed one,\n * so one page showed two versions.\n */\nfunction sdkThemeVersionId(headers: StoreContext['headers']): string | null {\n const versionId = requestedThemeVersionId() ?? headers?.['s-version-id'];\n return versionId != null ? String(versionId) : null;\n}\n\n/**\n * Settings as the SDK's `init` should copy them: with `headers` naming the\n * version {@link sdkThemeVersionId} picks.\n *\n * `init` spreads `headers` over its axios defaults, and on a first load nothing\n * re-asserts the version afterwards: TanStack restores the root match's context\n * instead of re-running `rootBeforeLoad` in the browser, so\n * {@link syncSdkThemeVersion} first runs on a client navigation.\n */\nexport function withSdkThemeVersion<T extends Pick<StoreContext, 'headers'>>(settings: T): T {\n const versionId = requestedThemeVersionId();\n if (!versionId) return settings;\n return { ...settings, headers: { ...settings.headers, 's-version-id': versionId } };\n}\n\n/**\n * Push the theme version onto the Salla SDK: the requested one, else the one the\n * current settings name (see {@link sdkThemeVersionId}).\n *\n * The SDK copies `settings.headers` into its axios defaults ONCE, at init, and\n * `s-version-id` is one of them. Settings refetched on the client — the shopper\n * switched market, and each market has its own version — name a different one,\n * and without this every `salla.api.*` call keeps asking for the previous\n * market's version until a full page load. Settings that name no version take\n * the header off instead, so the SDK asks for the live one like the engine's own\n * client does. No-op on the server and until the SDK exposes its api.\n */\nexport function syncSdkThemeVersion(headers: StoreContext['headers']): void {\n const sdk = getSallaSDK();\n if (!sdk) return;\n const versionId = sdkThemeVersionId(headers);\n try {\n if (versionId != null) sdk.api?.setHeader?.('s-version-id', versionId);\n else delete sdk.api?.axios?.defaults?.headers?.common?.['s-version-id'];\n } catch {\n // SDK partially loaded — the header is re-asserted on the next navigation.\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { user } from './chunk-7HZ6JQAJ.js';
1
+ import { user } from './chunk-5JZSBFA5.js';
2
2
  import { getTwilightContext } from './chunk-6K34BCUP.js';
3
3
  import { useQuery } from '@tanstack/react-query';
4
4
 
@@ -13,5 +13,5 @@ function useUser() {
13
13
  }
14
14
 
15
15
  export { useUser };
16
- //# sourceMappingURL=chunk-C76E3NHH.js.map
17
- //# sourceMappingURL=chunk-C76E3NHH.js.map
16
+ //# sourceMappingURL=chunk-XV3HPKLI.js.map
17
+ //# sourceMappingURL=chunk-XV3HPKLI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useUser.ts"],"names":[],"mappings":";;;;AAUO,SAAS,OAAA,GAAyB;AACvC,EAAA,MAAM,KAAA,GAAQ,oBAAmB,CAAE,SAAA;AAEnC,EAAA,MAAM,QAAQ,QAAA,CAAS;AAAA,IACrB,GAAG,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACxB,OAAA,EAAS,CAAC,CAAC,KAAA;AAAA,IACX,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAY,CAAC,CAAC,KAAA,EAAM;AACzC","file":"chunk-C76E3NHH.js","sourcesContent":["import { useQuery, type UseQueryResult } from '@tanstack/react-query';\nimport { getTwilightContext } from '../twilight/context';\nimport { user } from '../api/user';\nimport type { User } from '../types';\n\nexport type UseUserReturn = UseQueryResult<User | null> & {\n /** True when an auth token exists (regardless of query state). */\n isLoggedIn: boolean;\n};\n\nexport function useUser(): UseUserReturn {\n const token = getTwilightContext().authToken;\n\n const query = useQuery({\n ...user.queries.current(),\n enabled: !!token,\n placeholderData: null,\n });\n\n return { ...query, isLoggedIn: !!token };\n}\n"]}
1
+ {"version":3,"sources":["../src/hooks/useUser.ts"],"names":[],"mappings":";;;;AAUO,SAAS,OAAA,GAAyB;AACvC,EAAA,MAAM,KAAA,GAAQ,oBAAmB,CAAE,SAAA;AAEnC,EAAA,MAAM,QAAQ,QAAA,CAAS;AAAA,IACrB,GAAG,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACxB,OAAA,EAAS,CAAC,CAAC,KAAA;AAAA,IACX,eAAA,EAAiB;AAAA,GAClB,CAAA;AAED,EAAA,OAAO,EAAE,GAAG,KAAA,EAAO,UAAA,EAAY,CAAC,CAAC,KAAA,EAAM;AACzC","file":"chunk-XV3HPKLI.js","sourcesContent":["import { useQuery, type UseQueryResult } from '@tanstack/react-query';\nimport { getTwilightContext } from '../twilight/context';\nimport { user } from '../api/user';\nimport type { User } from '../types';\n\nexport type UseUserReturn = UseQueryResult<User | null> & {\n /** True when an auth token exists (regardless of query state). */\n isLoggedIn: boolean;\n};\n\nexport function useUser(): UseUserReturn {\n const token = getTwilightContext().authToken;\n\n const query = useQuery({\n ...user.queries.current(),\n enabled: !!token,\n placeholderData: null,\n });\n\n return { ...query, isLoggedIn: !!token };\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { orThrow } from './chunk-OPON37ZR.js';
2
- import { api } from './chunk-WDL6T5RX.js';
1
+ import { orThrow } from './chunk-HRW4YFHR.js';
2
+ import { api } from './chunk-U2UNWN4G.js';
3
3
  import { queryOptions } from '@tanstack/react-query';
4
4
 
5
5
  var page = {
@@ -17,5 +17,5 @@ var page = {
17
17
  };
18
18
 
19
19
  export { page };
20
- //# sourceMappingURL=chunk-7BNWZKXI.js.map
21
- //# sourceMappingURL=chunk-7BNWZKXI.js.map
20
+ //# sourceMappingURL=chunk-YQOCPSOI.js.map
21
+ //# sourceMappingURL=chunk-YQOCPSOI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/page.ts"],"names":[],"mappings":";;;;AAKO,IAAM,IAAA,GAAO;AAAA,EAClB,IAAA,EAAM,OAAO,IAAA,KAA2C;AACtD,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,MAAA,EAAS,IAAI,CAAA,CAAE,CAAA,CAAE,IAAA,EAAgC;AAChF,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAAA,EAEA,aAAa,CAAC,IAAA,KAA2C,QAAQ,IAAA,CAAK,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,EAEhF,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,IAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,OAAA,EAAS,QAAA,EAAU,IAAI,CAAA;AAAA,MAClC,OAAA,EAAS,MAAM,IAAA,CAAK,IAAA,CAAK,IAAI;AAAA,KAC9B;AAAA;AAEP","file":"chunk-7BNWZKXI.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type { ApiPageResponse } from '../routes/page/types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport const page = {\n find: async (slug: string): Promise<ApiPageResponse> => {\n const { data } = await api.get(`pages/${slug}`).json<{ data: ApiPageResponse }>();\n return data;\n },\n\n findOrThrow: (slug: string): Promise<ApiPageResponse> => orThrow(page.find(slug)),\n\n queries: {\n detail: (slug: string) =>\n queryOptions({\n queryKey: ['pages', 'detail', slug],\n queryFn: () => page.find(slug),\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["../src/api/page.ts"],"names":[],"mappings":";;;;AAKO,IAAM,IAAA,GAAO;AAAA,EAClB,IAAA,EAAM,OAAO,IAAA,KAA2C;AACtD,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,MAAM,GAAA,CAAI,IAAI,CAAA,MAAA,EAAS,IAAI,CAAA,CAAE,CAAA,CAAE,IAAA,EAAgC;AAChF,IAAA,OAAO,IAAA;AAAA,EACT,CAAA;AAAA,EAEA,aAAa,CAAC,IAAA,KAA2C,QAAQ,IAAA,CAAK,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,EAEhF,OAAA,EAAS;AAAA,IACP,MAAA,EAAQ,CAAC,IAAA,KACP,YAAA,CAAa;AAAA,MACX,QAAA,EAAU,CAAC,OAAA,EAAS,QAAA,EAAU,IAAI,CAAA;AAAA,MAClC,OAAA,EAAS,MAAM,IAAA,CAAK,IAAA,CAAK,IAAI;AAAA,KAC9B;AAAA;AAEP","file":"chunk-YQOCPSOI.js","sourcesContent":["import { queryOptions } from '@tanstack/react-query';\nimport { api } from './client';\nimport type { ApiPageResponse } from '../routes/page/types';\nimport { orThrow } from '../providers/NavigationProvider';\n\nexport const page = {\n find: async (slug: string): Promise<ApiPageResponse> => {\n const { data } = await api.get(`pages/${slug}`).json<{ data: ApiPageResponse }>();\n return data;\n },\n\n findOrThrow: (slug: string): Promise<ApiPageResponse> => orThrow(page.find(slug)),\n\n queries: {\n detail: (slug: string) =>\n queryOptions({\n queryKey: ['pages', 'detail', slug],\n queryFn: () => page.find(slug),\n }),\n },\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import { MadeWithSalla } from './chunk-OQIIJRAS.js';
2
2
  import { HookSlot, useIsClient } from './chunk-5XDPAKF5.js';
3
3
  import { useTranslation } from './chunk-TYNZ5B2B.js';
4
- import { Image } from './chunk-BKHGXHCJ.js';
4
+ import { Image } from './chunk-VZRZQV4Q.js';
5
5
  import { Link } from './chunk-AXW67SY7.js';
6
6
  import { LazyImageModal } from './chunk-KYMWEUN2.js';
7
7
  import { useTwilight } from './chunk-DF6FBKDN.js';
@@ -281,5 +281,5 @@ function Footer({ inSheet = false } = {}) {
281
281
  }
282
282
 
283
283
  export { Footer };
284
- //# sourceMappingURL=chunk-KAWAAVGL.js.map
285
- //# sourceMappingURL=chunk-KAWAAVGL.js.map
284
+ //# sourceMappingURL=chunk-YYVZFOUI.js.map
285
+ //# sourceMapping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rD,IAAA,EAAA,EAAK,EAAA,EAAG,KAAI,SAAA,EAAU,wDAAA,EACpB,gBAAM,IAAA,EACT,CAAA;AAAA,gBAAQ,GAAA;AAAA,gBAAI,OAAA;AAAA,gBACT,IAAA;AAAA,gCACH,GAAA,CAAC,aAAA,EAAA,EAAc,SAAA,EAAU,MAAA,EAAO;AAAA,eAAA,EAClC;AAAA;AAAA,WAEJ,EACF,CAAA;AAAA,8BAEC,aAAA,EAAA,EAAc;AAAA,SAAA,EACjB,CAAA;AAAA,QAEC,CAAC,OAAA,oBAAW,GAAA,CAAC,QAAA,EAAA,EAAS,MAAK,YAAA,EAAa;AAAA;AAAA;AAAA,GAC3C;AAEJ","file":"chunk-KAWAAVGL.js","sourcesContent":["import { useState } from 'react';\nimport { SallaAppsIcons } from '@salla.sa/twilight-components-react/apps-icons';\nimport { SallaContacts } from '@salla.sa/twilight-components-react/contacts';\nimport { SallaSocial } from '@salla.sa/twilight-components-react/social';\nimport { SallaMenu } from '@salla.sa/twilight-components-react/menu';\nimport { SallaTrustBadges } from '@salla.sa/twilight-components-react/trust-badges';\nimport { SallaPayments } from '@salla.sa/twilight-components-react/payments';\nimport { useTwilight } from '../../providers/twilight-context';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { HookSlot } from '../../hooks/HookSlot';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport { Link, Image } from '../common';\nimport { ImageModal } from '../modal';\nimport { MadeWithSalla } from './MadeWithSalla';\n\n/** Salla's value-added-tax badge icon (70×70, CDN-resized) — a platform\n * asset shared by every store, not specific to any one theme. */\nconst TAX_ICON_URL =\n 'https://cdn.salla.network/cdn-cgi/image/fit=scale-down,width=70,height=70,onerror=redirect,format=auto/images/tax.png?v=2.0.5';\n\n/**\n * The store's value-added-tax registration: the tax number, plus the certificate as\n * the tax icon that opens the certificate image full size in a modal. Nothing shows\n * when the store has no tax number.\n */\nfunction FooterTax({ dark }: { dark: boolean }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n const number = store.settings?.tax?.number;\n const certificate = store.settings?.tax?.certificate;\n if (!number) return null;\n\n return (\n <div\n data-testid=\"store-footer-tax\"\n className=\"store-footer__tax flex items-end gap-2 rtl:space-x-reverse\"\n >\n {certificate && (\n <>\n <button\n type=\"button\"\n data-testid=\"store-footer-tax-certificate\"\n className=\"store-footer__tax-cert shrink-0\"\n aria-label={t('common.elements.tax_certificate', 'Tax Certificate')}\n aria-haspopup=\"dialog\"\n onClick={() => setOpen(true)}\n >\n <img\n src={TAX_ICON_URL}\n alt={t('common.elements.tax_certificate', 'Tax Certificate')}\n width={40}\n height={50}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"w-10 rounded-sm transition-opacity hover:opacity-80\"\n />\n </button>\n <ImageModal\n isOpen={open}\n onClose={() => setOpen(false)}\n src={certificate}\n alt={t('common.elements.tax_certificate', 'Tax Certificate')}\n title={t('common.elements.tax_certificate', 'Tax Certificate')}\n />\n </>\n )}\n <div>\n <p className={`mb-1 text-sm opacity-70 ${dark ? 'text-white' : ''}`}>\n {t('common.elements.tax_number', 'Tax Number')}\n </p>\n <b className=\"text-sm\">{number}</b>\n </div>\n </div>\n );\n}\n\n/** Saudi Business Center (SBC) logo, CDN-versioned like the tax icon -- also a\n * platform asset, not theme-specific. */\nconst SBC_ICON_URL = 'https://cdn.salla.network/images/sbc.png?v=2.0.5';\n\n/**\n * The store's Saudi Business Center certificate: a \"Trusted by Business Platform\" badge that\n * opens the certificate's page on the SBC site so visitors can verify the merchant. Nothing\n * shows when the store has no certificate.\n */\nfunction FooterSbc({ dark }: { dark: boolean }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n const id = store.settings?.certificate?.id;\n if (!id) return null;\n\n return (\n <a\n href={`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${encodeURIComponent(id)}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n data-testid=\"store-footer-sbc\"\n className=\"store-footer__sbc flex items-center gap-2.5 transition-opacity hover:opacity-75\"\n >\n <img\n src={SBC_ICON_URL}\n alt={`SBC ${id}`}\n width={56}\n height={40}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"h-10 w-14 rounded-sm\"\n />\n <div>\n <p className={`text-xs opacity-70 ${dark ? 'text-white' : ''}`}>\n {t('blocks.footer.sbc_trusted_by', 'Trusted by')}\n </p>\n <b className=\"text-sm\">{t('blocks.footer.sbc_platform', 'Business Platform')}</b>\n </div>\n </a>\n );\n}\n\n/** Trust badges, the tax registration and the SBC badge, side by side (wrapping on narrow columns). */\nfunction FooterTrust({ dark, centered }: { dark: boolean; centered: boolean }) {\n return (\n <div\n data-testid=\"store-footer-trust\"\n className={`store-footer__trust flex flex-wrap items-end gap-x-6 gap-y-3${centered ? ' justify-center' : ''}`}\n >\n <FooterTax dark={dark} />\n <FooterSbc dark={dark} />\n <SallaTrustBadges {...(dark ? { dark: true } : {})} />\n </div>\n );\n}\n\n/**\n * The footer's own menu of (\"important\") links -- skipped entirely when\n * `inSheet`, for a theme that opens it from somewhere else of its own (a\n * mobile account sheet, a dedicated links screen, …) instead; showing it\n * again down here would just be a redundant second copy. `heading` wraps it\n * in the grid layout's own `.store-footer__links` column; the centered\n * layout's inline row has none.\n */\nfunction FooterLinksMenu({\n inSheet,\n className,\n heading,\n dark,\n}: {\n inSheet: boolean;\n className: string;\n heading?: string;\n dark: boolean;\n}) {\n if (inSheet) return null;\n\n const menu = <SallaMenu source=\"footer\" className={className} suppressHydrationWarning />;\n if (!heading) return menu;\n\n return (\n <div className=\"store-footer__links\">\n <h3 className={`mb-3 text-lg font-bold lg:mb-5 ${dark ? 'text-white' : 'text-gray-900'}`}>\n {heading}\n </h3>\n {menu}\n </div>\n );\n}\n\n/** App-store / Google-Play buttons. Nothing shows -- not even the wrapping\n * div -- when the store has neither link set. */\nfunction FooterApps({ className }: { className: string }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n // The web component fills its light DOM before React hydrates the footer, a hydration error.\n const isClient = useIsClient();\n if (!store.apps?.appstore && !store.apps?.googleplay) return null;\n\n return (\n <div data-testid=\"store-footer-apps\" className={`store-footer__apps ${className}`}>\n {isClient && (\n <SallaAppsIcons\n apps={store.apps}\n appsTitle={t('blocks.footer.download_apps', 'Get our apps')}\n />\n )}\n </div>\n );\n}\n\n/** The logo link, same shape in both layouts -- only its own spacing differs. */\nfunction FooterLogo({ className }: { className: string }) {\n const { store } = useTwilight();\n return (\n <Link\n to=\"/\"\n className={`store-footer__logo inline-flex items-center m-0 transition-opacity hover:opacity-75 ${className}`}\n >\n <Image\n src={store.logo}\n alt={store.name || 'Store'}\n width={150}\n height={44}\n objectFit=\"contain\"\n className=\"h-11 w-auto max-w-[180px]\"\n />\n </Link>\n );\n}\n\n/** Merchant-authored description HTML -- mirrors the Twig theme's\n * `store.description|raw`. Renders nothing when the store has none set. */\nfunction FooterDescription({ className }: { className: string }) {\n const { store } = useTwilight();\n if (!store.description) return null;\n return (\n <div\n className={`store-footer__desc opacity-80 ${className}`}\n dangerouslySetInnerHTML={{ __html: store.description }}\n />\n );\n}\n\n/** The store's phone and email as one \"Contact us: …\" row under the description\n * (`<salla-contacts>`'s compact `isHeader` layout, which shows only those two).\n * Renders nothing when the store has neither. */\nfunction FooterContacts({ className }: { className: string }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n // The web component fills its light DOM once the SDK is ready, which can come before\n // React hydrates the footer's Suspense boundary: a hydration error (React #418).\n const isClient = useIsClient();\n if (!store.contacts?.phone && !store.contacts?.email) return null;\n return (\n <div className={`store-footer__contacts ${className}`}>\n {isClient && (\n <SallaContacts\n contacts={store.contacts}\n contactsTitle={t('blocks.footer.social', 'Contact us')}\n isHeader\n />\n )}\n </div>\n );\n}\n\n/** Centered layout: logo, description, contacts, social, footer menu, trust\n * badges and app buttons stacked as one centered column. */\nfunction FooterCenteredBody({ inSheet, isDark }: { inSheet: boolean; isDark: boolean }) {\n return (\n <div className=\"container mx-auto flex max-w-2xl flex-col items-center gap-6 text-center\">\n <FooterLogo className=\"\" />\n <FooterDescription className=\"\" />\n <FooterContacts className=\"\" />\n <SallaSocial />\n\n <FooterLinksMenu\n inSheet={inSheet}\n className=\"store-footer__menu store-footer__menu--inline\"\n dark={isDark}\n />\n\n <FooterTrust dark={isDark} centered />\n\n <FooterApps className=\"flex flex-col items-center gap-3\" />\n </div>\n );\n}\n\n/** Columns layout: brand (logo / description / contacts / social / trust) and app\n * buttons side by side, with the footer menu as its own labeled column. */\nfunction FooterColumnsBody({ inSheet, isDark }: { inSheet: boolean; isDark: boolean }) {\n const { t } = useTranslation();\n\n return (\n <div className=\"container grid grid-cols-1 gap-10 sm:grid-cols-2 lg:grid-cols-4 lg:gap-16\">\n <div className=\"store-footer__brand rtl:lg:pl-16 ltr:lg:pr-16 sm:col-span-2\">\n <FooterLogo className=\"mb-5\" />\n <FooterDescription className=\"max-w-sm leading-6 my-5\" />\n <FooterContacts className=\"mb-6\" />\n <SallaSocial className=\"block mb-6\" />\n <FooterTrust dark={isDark} centered={false} />\n </div>\n\n <FooterLinksMenu\n inSheet={inSheet}\n className=\"store-footer__menu store-footer__menu--stacked\"\n heading={t('blocks.footer.important_links', 'Important links')}\n dark={isDark}\n />\n\n <FooterApps className=\"\" />\n </div>\n );\n}\n\nexport interface FooterProps {\n /**\n * Renders as a plain `<div>` (no second `<footer>` landmark) with the\n * `footer:start` / `footer:end` hook slots skipped -- for a theme that\n * repeats these widgets somewhere other than the page's own footer (a\n * mobile sheet, for example) rather than rendering the real page footer a\n * second time.\n */\n inSheet?: boolean;\n}\n\n/**\n * Storefront footer.\n *\n * Two layouts, chosen by the `footer_layout` theme setting:\n * - **columns** (default): logo / description / social / trust badges, the\n * footer menu (\"important links\"), and app-store buttons, side by side.\n * - **centered**: the same pieces stacked as one centered column, with the\n * footer menu laid out as an inline, pipe-separated row.\n *\n * Styling for the handful of pieces rendered by web components this owns no\n * markup for (`<salla-social>`'s `.social-link` icons, `<salla-menu>`'s\n * `.s-menu-footer-item` rows, `<salla-payments>`'s `.s-payments-list-item`\n * icons) is the consuming theme's own responsibility, the same way\n * `inSheet`'s own presentation is -- this component owns structure and data,\n * not every pixel.\n */\nexport function Footer({ inSheet = false }: FooterProps = {}) {\n const { store, theme } = useTwilight();\n const { t } = useTranslation();\n const year = new Date().getFullYear();\n const isCentered = theme.settings?.footer_layout === 'centered';\n const isDark = !!theme.settings?.footer_is_dark;\n\n const Root = inSheet ? 'div' : 'footer';\n\n return (\n <Root\n className={`store-footer store-footer--${isCentered ? 'centered' : 'columns'}${\n inSheet ? ' store-footer--sheet' : ''\n } relative mt-8 sm:mt-16 ${isDark ? 'bg-[#0E0F0F] text-white' : 'bg-[#F4F7F2] text-gray-600'}`}\n suppressHydrationWarning\n >\n {!inSheet && <HookSlot name=\"footer:start\" />}\n\n <div\n aria-label=\"footer\"\n className={`store-footer__inner border-b py-8 lg:py-16 ${\n isDark ? 'bg-[#1D1F1F] border-dashed border-white/10' : 'bg-transparent border-gray-200'\n }`}\n >\n {isCentered ? (\n <FooterCenteredBody inSheet={inSheet} isDark={isDark} />\n ) : (\n <FooterColumnsBody inSheet={inSheet} isDark={isDark} />\n )}\n </div>\n\n <div className=\"store-footer__bottom container md:flex items-center justify-between gap-4 py-4 lg:py-7 text-center\">\n <span className={`text-sm copyright-text ${isDark ? 'text-gray-400' : 'text-gray-700'}`}>\n <HookSlot\n name=\"copyright\"\n context={{ storeName: store.name }}\n fallback={\n <>\n {t('blocks.footer.copyright', 'All rights reserved')}{' '}\n <Link to=\"/\" className=\"transition-opacity hover:opacity-75 hover:text-primary\">\n {store.name}\n </Link>{' '}\n © {year}\n <MadeWithSalla className=\"ms-2\" />\n </>\n }\n />\n </span>\n\n <SallaPayments />\n </div>\n\n {!inSheet && <HookSlot name=\"footer:end\" />}\n </Root>\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/components/layout/Footer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAiBA,IAAM,YAAA,GACJ,+HAAA;AAOF,SAAS,SAAA,C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GAAA,CAAC,aAAA,EAAA,EAAc,SAAA,EAAU,MAAA,EAAO;AAAA,eAAA,EAClC;AAAA;AAAA,WAEJ,EACF,CAAA;AAAA,8BAEC,aAAA,EAAA,EAAc;AAAA,SAAA,EACjB,CAAA;AAAA,QAEC,CAAC,OAAA,oBAAW,GAAA,CAAC,QAAA,EAAA,EAAS,MAAK,YAAA,EAAa;AAAA;AAAA;AAAA,GAC3C;AAEJ","file":"chunk-YYVZFOUI.js","sourcesContent":["import { useState } from 'react';\nimport { SallaAppsIcons } from '@salla.sa/twilight-components-react/apps-icons';\nimport { SallaContacts } from '@salla.sa/twilight-components-react/contacts';\nimport { SallaSocial } from '@salla.sa/twilight-components-react/social';\nimport { SallaMenu } from '@salla.sa/twilight-components-react/menu';\nimport { SallaTrustBadges } from '@salla.sa/twilight-components-react/trust-badges';\nimport { SallaPayments } from '@salla.sa/twilight-components-react/payments';\nimport { useTwilight } from '../../providers/twilight-context';\nimport { useTranslation } from '../../providers/I18nProvider';\nimport { HookSlot } from '../../hooks/HookSlot';\nimport { useIsClient } from '../../hooks/useIsClient';\nimport { Link, Image } from '../common';\nimport { ImageModal } from '../modal';\nimport { MadeWithSalla } from './MadeWithSalla';\n\n/** Salla's value-added-tax badge icon (70×70, CDN-resized) — a platform\n * asset shared by every store, not specific to any one theme. */\nconst TAX_ICON_URL =\n 'https://cdn.salla.network/cdn-cgi/image/fit=scale-down,width=70,height=70,onerror=redirect,format=auto/images/tax.png?v=2.0.5';\n\n/**\n * The store's value-added-tax registration: the tax number, plus the certificate as\n * the tax icon that opens the certificate image full size in a modal. Nothing shows\n * when the store has no tax number.\n */\nfunction FooterTax({ dark }: { dark: boolean }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n const number = store.settings?.tax?.number;\n const certificate = store.settings?.tax?.certificate;\n if (!number) return null;\n\n return (\n <div\n data-testid=\"store-footer-tax\"\n className=\"store-footer__tax flex items-end gap-2 rtl:space-x-reverse\"\n >\n {certificate && (\n <>\n <button\n type=\"button\"\n data-testid=\"store-footer-tax-certificate\"\n className=\"store-footer__tax-cert shrink-0\"\n aria-label={t('common.elements.tax_certificate', 'Tax Certificate')}\n aria-haspopup=\"dialog\"\n onClick={() => setOpen(true)}\n >\n <img\n src={TAX_ICON_URL}\n alt={t('common.elements.tax_certificate', 'Tax Certificate')}\n width={40}\n height={50}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"w-10 rounded-sm transition-opacity hover:opacity-80\"\n />\n </button>\n <ImageModal\n isOpen={open}\n onClose={() => setOpen(false)}\n src={certificate}\n alt={t('common.elements.tax_certificate', 'Tax Certificate')}\n title={t('common.elements.tax_certificate', 'Tax Certificate')}\n />\n </>\n )}\n <div>\n <p className={`mb-1 text-sm opacity-70 ${dark ? 'text-white' : ''}`}>\n {t('common.elements.tax_number', 'Tax Number')}\n </p>\n <b className=\"text-sm\">{number}</b>\n </div>\n </div>\n );\n}\n\n/** Saudi Business Center (SBC) logo, CDN-versioned like the tax icon -- also a\n * platform asset, not theme-specific. */\nconst SBC_ICON_URL = 'https://cdn.salla.network/images/sbc.png?v=2.0.5';\n\n/**\n * The store's Saudi Business Center certificate: a \"Trusted by Business Platform\" badge that\n * opens the certificate's page on the SBC site so visitors can verify the merchant. Nothing\n * shows when the store has no certificate.\n */\nfunction FooterSbc({ dark }: { dark: boolean }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n const id = store.settings?.certificate?.id;\n if (!id) return null;\n\n return (\n <a\n href={`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${encodeURIComponent(id)}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n data-testid=\"store-footer-sbc\"\n className=\"store-footer__sbc flex items-center gap-2.5 transition-opacity hover:opacity-75\"\n >\n <img\n src={SBC_ICON_URL}\n alt={`SBC ${id}`}\n width={56}\n height={40}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"h-10 w-14 rounded-sm\"\n />\n <div>\n <p className={`text-xs opacity-70 ${dark ? 'text-white' : ''}`}>\n {t('blocks.footer.sbc_trusted_by', 'Trusted by')}\n </p>\n <b className=\"text-sm\">{t('blocks.footer.sbc_platform', 'Business Platform')}</b>\n </div>\n </a>\n );\n}\n\n/** Trust badges, the tax registration and the SBC badge, side by side (wrapping on narrow columns). */\nfunction FooterTrust({ dark, centered }: { dark: boolean; centered: boolean }) {\n return (\n <div\n data-testid=\"store-footer-trust\"\n className={`store-footer__trust flex flex-wrap items-end gap-x-6 gap-y-3${centered ? ' justify-center' : ''}`}\n >\n <FooterTax dark={dark} />\n <FooterSbc dark={dark} />\n <SallaTrustBadges {...(dark ? { dark: true } : {})} />\n </div>\n );\n}\n\n/**\n * The footer's own menu of (\"important\") links -- skipped entirely when\n * `inSheet`, for a theme that opens it from somewhere else of its own (a\n * mobile account sheet, a dedicated links screen, …) instead; showing it\n * again down here would just be a redundant second copy. `heading` wraps it\n * in the grid layout's own `.store-footer__links` column; the centered\n * layout's inline row has none.\n */\nfunction FooterLinksMenu({\n inSheet,\n className,\n heading,\n dark,\n}: {\n inSheet: boolean;\n className: string;\n heading?: string;\n dark: boolean;\n}) {\n if (inSheet) return null;\n\n const menu = <SallaMenu source=\"footer\" className={className} suppressHydrationWarning />;\n if (!heading) return menu;\n\n return (\n <div className=\"store-footer__links\">\n <h3 className={`mb-3 text-lg font-bold lg:mb-5 ${dark ? 'text-white' : 'text-gray-900'}`}>\n {heading}\n </h3>\n {menu}\n </div>\n );\n}\n\n/** App-store / Google-Play buttons. Nothing shows -- not even the wrapping\n * div -- when the store has neither link set. */\nfunction FooterApps({ className }: { className: string }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n // The web component fills its light DOM before React hydrates the footer, a hydration error.\n const isClient = useIsClient();\n if (!store.apps?.appstore && !store.apps?.googleplay) return null;\n\n return (\n <div data-testid=\"store-footer-apps\" className={`store-footer__apps ${className}`}>\n {isClient && (\n <SallaAppsIcons\n apps={store.apps}\n appsTitle={t('blocks.footer.download_apps', 'Get our apps')}\n />\n )}\n </div>\n );\n}\n\n/** The logo link, same shape in both layouts -- only its own spacing differs. */\nfunction FooterLogo({ className }: { className: string }) {\n const { store } = useTwilight();\n return (\n <Link\n to=\"/\"\n className={`store-footer__logo inline-flex items-center m-0 transition-opacity hover:opacity-75 ${className}`}\n >\n <Image\n src={store.logo}\n alt={store.name || 'Store'}\n width={150}\n height={44}\n objectFit=\"contain\"\n className=\"h-11 w-auto max-w-[180px]\"\n />\n </Link>\n );\n}\n\n/** Merchant-authored description HTML -- mirrors the Twig theme's\n * `store.description|raw`. Renders nothing when the store has none set. */\nfunction FooterDescription({ className }: { className: string }) {\n const { store } = useTwilight();\n if (!store.description) return null;\n return (\n <div\n className={`store-footer__desc opacity-80 ${className}`}\n dangerouslySetInnerHTML={{ __html: store.description }}\n />\n );\n}\n\n/** The store's phone and email as one \"Contact us: …\" row under the description\n * (`<salla-contacts>`'s compact `isHeader` layout, which shows only those two).\n * Renders nothing when the store has neither. */\nfunction FooterContacts({ className }: { className: string }) {\n const { store } = useTwilight();\n const { t } = useTranslation();\n // The web component fills its light DOM once the SDK is ready, which can come before\n // React hydrates the footer's Suspense boundary: a hydration error (React #418).\n const isClient = useIsClient();\n if (!store.contacts?.phone && !store.contacts?.email) return null;\n return (\n <div className={`store-footer__contacts ${className}`}>\n {isClient && (\n <SallaContacts\n contacts={store.contacts}\n contactsTitle={t('blocks.footer.social', 'Contact us')}\n isHeader\n />\n )}\n </div>\n );\n}\n\n/** Centered layout: logo, description, contacts, social, footer menu, trust\n * badges and app buttons stacked as one centered column. */\nfunction FooterCenteredBody({ inSheet, isDark }: { inSheet: boolean; isDark: boolean }) {\n return (\n <div className=\"container mx-auto flex max-w-2xl flex-col items-center gap-6 text-center\">\n <FooterLogo className=\"\" />\n <FooterDescription className=\"\" />\n <FooterContacts className=\"\" />\n <SallaSocial />\n\n <FooterLinksMenu\n inSheet={inSheet}\n className=\"store-footer__menu store-footer__menu--inline\"\n dark={isDark}\n />\n\n <FooterTrust dark={isDark} centered />\n\n <FooterApps className=\"flex flex-col items-center gap-3\" />\n </div>\n );\n}\n\n/** Columns layout: brand (logo / description / contacts / social / trust) and app\n * buttons side by side, with the footer menu as its own labeled column. */\nfunction FooterColumnsBody({ inSheet, isDark }: { inSheet: boolean; isDark: boolean }) {\n const { t } = useTranslation();\n\n return (\n <div className=\"container grid grid-cols-1 gap-10 sm:grid-cols-2 lg:grid-cols-4 lg:gap-16\">\n <div className=\"store-footer__brand rtl:lg:pl-16 ltr:lg:pr-16 sm:col-span-2\">\n <FooterLogo className=\"mb-5\" />\n <FooterDescription className=\"max-w-sm leading-6 my-5\" />\n <FooterContacts className=\"mb-6\" />\n <SallaSocial className=\"block mb-6\" />\n <FooterTrust dark={isDark} centered={false} />\n </div>\n\n <FooterLinksMenu\n inSheet={inSheet}\n className=\"store-footer__menu store-footer__menu--stacked\"\n heading={t('blocks.footer.important_links', 'Important links')}\n dark={isDark}\n />\n\n <FooterApps className=\"\" />\n </div>\n );\n}\n\nexport interface FooterProps {\n /**\n * Renders as a plain `<div>` (no second `<footer>` landmark) with the\n * `footer:start` / `footer:end` hook slots skipped -- for a theme that\n * repeats these widgets somewhere other than the page's own footer (a\n * mobile sheet, for example) rather than rendering the real page footer a\n * second time.\n */\n inSheet?: boolean;\n}\n\n/**\n * Storefront footer.\n *\n * Two layouts, chosen by the `footer_layout` theme setting:\n * - **columns** (default): logo / description / social / trust badges, the\n * footer menu (\"important links\"), and app-store buttons, side by side.\n * - **centered**: the same pieces stacked as one centered column, with the\n * footer menu laid out as an inline, pipe-separated row.\n *\n * Styling for the handful of pieces rendered by web components this owns no\n * markup for (`<salla-social>`'s `.social-link` icons, `<salla-menu>`'s\n * `.s-menu-footer-item` rows, `<salla-payments>`'s `.s-payments-list-item`\n * icons) is the consuming theme's own responsibility, the same way\n * `inSheet`'s own presentation is -- this component owns structure and data,\n * not every pixel.\n */\nexport function Footer({ inSheet = false }: FooterProps = {}) {\n const { store, theme } = useTwilight();\n const { t } = useTranslation();\n const year = new Date().getFullYear();\n const isCentered = theme.settings?.footer_layout === 'centered';\n const isDark = !!theme.settings?.footer_is_dark;\n\n const Root = inSheet ? 'div' : 'footer';\n\n return (\n <Root\n className={`store-footer store-footer--${isCentered ? 'centered' : 'columns'}${\n inSheet ? ' store-footer--sheet' : ''\n } relative mt-8 sm:mt-16 ${isDark ? 'bg-[#0E0F0F] text-white' : 'bg-[#F4F7F2] text-gray-600'}`}\n suppressHydrationWarning\n >\n {!inSheet && <HookSlot name=\"footer:start\" />}\n\n <div\n aria-label=\"footer\"\n className={`store-footer__inner border-b py-8 lg:py-16 ${\n isDark ? 'bg-[#1D1F1F] border-dashed border-white/10' : 'bg-transparent border-gray-200'\n }`}\n >\n {isCentered ? (\n <FooterCenteredBody inSheet={inSheet} isDark={isDark} />\n ) : (\n <FooterColumnsBody inSheet={inSheet} isDark={isDark} />\n )}\n </div>\n\n <div className=\"store-footer__bottom container md:flex items-center justify-between gap-4 py-4 lg:py-7 text-center\">\n <span className={`text-sm copyright-text ${isDark ? 'text-gray-400' : 'text-gray-700'}`}>\n <HookSlot\n name=\"copyright\"\n context={{ storeName: store.name }}\n fallback={\n <>\n {t('blocks.footer.copyright', 'All rights reserved')}{' '}\n <Link to=\"/\" className=\"transition-opacity hover:opacity-75 hover:text-primary\">\n {store.name}\n </Link>{' '}\n © {year}\n <MadeWithSalla className=\"ms-2\" />\n </>\n }\n />\n </span>\n\n <SallaPayments />\n </div>\n\n {!inSheet && <HookSlot name=\"footer:end\" />}\n </Root>\n );\n}\n"]}
@@ -1,4 +1,4 @@
1
- export { LazyCartItem as CartItem, LazyCartSummary as CartSummary, LazySeoCartWidget as SeoCartWidget } from '../../chunk-ZJLNYJCD.js';
1
+ export { LazyCartItem as CartItem, LazyCartSummary as CartSummary, LazySeoCartWidget as SeoCartWidget } from '../../chunk-X4ITNSMT.js';
2
2
  import '../../chunk-VYGA5AT5.js';
3
3
  import '../../chunk-DGUM43GV.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { BlogSkeleton, LazyBreadcrumb as Breadcrumb, BreadcrumbSkeleton, LazyCurrencySymbol as CurrencySymbol, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, LazyErrorPage as ErrorPage, Image, LazyNoContent as NoContent, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, LazyRenderWhenVisible as RenderWhenVisible, SkeletonPulse, resolveDeferred } from '../../chunk-BKHGXHCJ.js';
1
+ export { BlogSkeleton, LazyBreadcrumb as Breadcrumb, BreadcrumbSkeleton, LazyCurrencySymbol as CurrencySymbol, CustomerLayoutSkeleton, CustomerPageSkeleton, DeferredData, LazyErrorPage as ErrorPage, Image, LazyNoContent as NoContent, PageSkeleton, ProductCardSkeleton, ProductDetailSkeleton, ProductGridSkeleton, LazyRenderWhenVisible as RenderWhenVisible, SkeletonPulse, resolveDeferred } from '../../chunk-VZRZQV4Q.js';
2
2
  export { Link } from '../../chunk-AXW67SY7.js';
3
3
  import '../../chunk-BYMOPN2S.js';
4
4
  import '../../chunk-SKLEJJ6M.js';
@@ -1,44 +1,45 @@
1
1
  export { Drawer } from '../../chunk-6TKIUG5C.js';
2
- import '../../chunk-4XB425HW.js';
3
- import '../../chunk-UME7NAC5.js';
4
- import '../../chunk-KAWAAVGL.js';
5
- import '../../chunk-N6ZE6HUX.js';
2
+ import '../../chunk-GBMMP344.js';
3
+ import '../../chunk-Q77J3D2W.js';
4
+ import '../../chunk-U5TWRPMK.js';
5
+ import '../../chunk-YYVZFOUI.js';
6
+ import '../../chunk-5V4W3GBI.js';
6
7
  import '../../chunk-X55R4VVK.js';
7
8
  import '../../chunk-YL6X3ZMG.js';
8
- import '../../chunk-JKSDTWEC.js';
9
+ import '../../chunk-PCB5DCS4.js';
9
10
  import '../../chunk-OXMUPNMH.js';
10
- import '../../chunk-XYLGWKPG.js';
11
+ import '../../chunk-NGWHUW34.js';
11
12
  import '../../chunk-VVZNW5CB.js';
12
- import '../../chunk-WQPG22DY.js';
13
+ import '../../chunk-EGI7F57E.js';
13
14
  import '../../chunk-GD26FI4J.js';
14
- import '../../chunk-Q7E4TNN7.js';
15
- import '../../chunk-RYGEIQWO.js';
16
- import '../../chunk-OPON37ZR.js';
15
+ import '../../chunk-SLBO4SEE.js';
16
+ import '../../chunk-MGG4XAJ5.js';
17
+ import '../../chunk-HRW4YFHR.js';
17
18
  import '../../chunk-OUW6WESU.js';
18
- import '../../chunk-HOJ5E2PG.js';
19
+ import '../../chunk-IHOUADLX.js';
19
20
  import '../../chunk-HI5V5X3S.js';
20
- import '../../chunk-C76E3NHH.js';
21
- import '../../chunk-7HZ6JQAJ.js';
21
+ import '../../chunk-XV3HPKLI.js';
22
+ import '../../chunk-5JZSBFA5.js';
22
23
  import '../../chunk-MVT5AF2A.js';
23
24
  import '../../chunk-Z653O7MX.js';
24
25
  import '../../chunk-ZCH7W7DZ.js';
25
- import '../../chunk-TF6HFXTW.js';
26
+ import '../../chunk-H7LRGY7U.js';
26
27
  import '../../chunk-JWXJPJBO.js';
27
28
  import '../../chunk-CW625T2E.js';
28
29
  import '../../chunk-7V36I5GT.js';
29
30
  import '../../chunk-6WI7R2BD.js';
30
- import '../../chunk-LFHYQ6AN.js';
31
+ import '../../chunk-M5WTY3EH.js';
31
32
  import '../../chunk-OAMIDZKW.js';
32
- import '../../chunk-TVNO5MCL.js';
33
+ import '../../chunk-KGSB2Y7O.js';
33
34
  import '../../chunk-OQIIJRAS.js';
34
35
  import '../../chunk-V2ZDTY6H.js';
35
- import '../../chunk-4RKNISJB.js';
36
+ import '../../chunk-ETC7OJT5.js';
36
37
  import '../../chunk-5XDPAKF5.js';
37
38
  import '../../chunk-GCPEMNSU.js';
38
- import '../../chunk-WDL6T5RX.js';
39
+ import '../../chunk-U2UNWN4G.js';
39
40
  import '../../chunk-Z5M4YYWT.js';
40
41
  import '../../chunk-TYNZ5B2B.js';
41
- import '../../chunk-BKHGXHCJ.js';
42
+ import '../../chunk-VZRZQV4Q.js';
42
43
  import '../../chunk-AXW67SY7.js';
43
44
  import '../../chunk-BYMOPN2S.js';
44
45
  import '../../chunk-SKLEJJ6M.js';
@@ -46,10 +47,10 @@ import '../../chunk-6BZ5TKEV.js';
46
47
  import '../../chunk-FZKRSGLP.js';
47
48
  import '../../chunk-KYMWEUN2.js';
48
49
  import '../../chunk-YA6ABQB7.js';
49
- import '../../chunk-MWYKP7CI.js';
50
- import '../../chunk-3E3ABCPC.js';
51
- import '../../chunk-NHA4SBKG.js';
52
- import '../../chunk-FXVII733.js';
50
+ import '../../chunk-QMWP2ZP6.js';
51
+ import '../../chunk-6TFM3UTF.js';
52
+ import '../../chunk-XMRNYUQY.js';
53
+ import '../../chunk-T2752RH7.js';
53
54
  import '../../chunk-6K34BCUP.js';
54
55
  import '../../chunk-T72DAX7R.js';
55
56
  import '../../chunk-DF6FBKDN.js';
@@ -1,49 +1,50 @@
1
- export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, PageBlocks, ParallaxBackground, PhotosSlider, ProductsSlider, ReorderProducts, SquarePhotos, StoreFeatures, LazyTestimonials as Testimonials, Youtube, registerHomeComponentConfig, registerHomeComponents, useReorderButtons } from '../../chunk-VS2GO7GL.js';
2
- import '../../chunk-4LTS5AZ3.js';
3
- import '../../chunk-P3ZYGK5E.js';
4
- import '../../chunk-3MDXVF4Y.js';
5
- import '../../chunk-DYSSY56M.js';
1
+ export { BundleComponent, ComponentErrorBoundary, DefaultHomeComponents, FeaturedProductsStyle1, FeaturedProductsStyle2, FeaturedProductsStyle3, FixedBanner, FixedProducts, HomeComponentRenderer, PageBlocks, ParallaxBackground, PhotosSlider, ProductsSlider, ReorderProducts, SquarePhotos, StoreFeatures, LazyTestimonials as Testimonials, Youtube, registerHomeComponentConfig, registerHomeComponents, useReorderButtons } from '../../chunk-HJGN3XVG.js';
2
+ import '../../chunk-7NTPNCIK.js';
3
+ import '../../chunk-WIDH6AK6.js';
4
+ import '../../chunk-MIAVMNPM.js';
5
+ import '../../chunk-NLKLS3GZ.js';
6
6
  import '../../chunk-Y32RHCOH.js';
7
- import '../../chunk-4XB425HW.js';
8
- import '../../chunk-UME7NAC5.js';
9
- import '../../chunk-KAWAAVGL.js';
10
- import '../../chunk-N6ZE6HUX.js';
7
+ import '../../chunk-GBMMP344.js';
8
+ import '../../chunk-Q77J3D2W.js';
9
+ import '../../chunk-U5TWRPMK.js';
10
+ import '../../chunk-YYVZFOUI.js';
11
+ import '../../chunk-5V4W3GBI.js';
11
12
  import '../../chunk-X55R4VVK.js';
12
13
  import '../../chunk-YL6X3ZMG.js';
13
- import '../../chunk-JKSDTWEC.js';
14
+ import '../../chunk-PCB5DCS4.js';
14
15
  import '../../chunk-OXMUPNMH.js';
15
- import '../../chunk-XYLGWKPG.js';
16
+ import '../../chunk-NGWHUW34.js';
16
17
  import '../../chunk-VVZNW5CB.js';
17
- import '../../chunk-WQPG22DY.js';
18
+ import '../../chunk-EGI7F57E.js';
18
19
  import '../../chunk-GD26FI4J.js';
19
- import '../../chunk-Q7E4TNN7.js';
20
- import '../../chunk-RYGEIQWO.js';
21
- import '../../chunk-OPON37ZR.js';
20
+ import '../../chunk-SLBO4SEE.js';
21
+ import '../../chunk-MGG4XAJ5.js';
22
+ import '../../chunk-HRW4YFHR.js';
22
23
  import '../../chunk-OUW6WESU.js';
23
- import '../../chunk-HOJ5E2PG.js';
24
+ import '../../chunk-IHOUADLX.js';
24
25
  import '../../chunk-HI5V5X3S.js';
25
- import '../../chunk-C76E3NHH.js';
26
- import '../../chunk-7HZ6JQAJ.js';
26
+ import '../../chunk-XV3HPKLI.js';
27
+ import '../../chunk-5JZSBFA5.js';
27
28
  import '../../chunk-MVT5AF2A.js';
28
29
  import '../../chunk-Z653O7MX.js';
29
30
  import '../../chunk-ZCH7W7DZ.js';
30
- import '../../chunk-TF6HFXTW.js';
31
+ import '../../chunk-H7LRGY7U.js';
31
32
  import '../../chunk-JWXJPJBO.js';
32
33
  import '../../chunk-CW625T2E.js';
33
34
  import '../../chunk-7V36I5GT.js';
34
35
  import '../../chunk-6WI7R2BD.js';
35
- import '../../chunk-LFHYQ6AN.js';
36
+ import '../../chunk-M5WTY3EH.js';
36
37
  import '../../chunk-OAMIDZKW.js';
37
- import '../../chunk-TVNO5MCL.js';
38
+ import '../../chunk-KGSB2Y7O.js';
38
39
  import '../../chunk-OQIIJRAS.js';
39
40
  import '../../chunk-V2ZDTY6H.js';
40
- import '../../chunk-4RKNISJB.js';
41
+ import '../../chunk-ETC7OJT5.js';
41
42
  import '../../chunk-5XDPAKF5.js';
42
43
  import '../../chunk-GCPEMNSU.js';
43
- import '../../chunk-WDL6T5RX.js';
44
+ import '../../chunk-U2UNWN4G.js';
44
45
  import '../../chunk-Z5M4YYWT.js';
45
46
  import '../../chunk-TYNZ5B2B.js';
46
- import '../../chunk-BKHGXHCJ.js';
47
+ import '../../chunk-VZRZQV4Q.js';
47
48
  import '../../chunk-AXW67SY7.js';
48
49
  import '../../chunk-BYMOPN2S.js';
49
50
  import '../../chunk-SKLEJJ6M.js';
@@ -51,10 +52,10 @@ import '../../chunk-6BZ5TKEV.js';
51
52
  import '../../chunk-FZKRSGLP.js';
52
53
  import '../../chunk-KYMWEUN2.js';
53
54
  import '../../chunk-YA6ABQB7.js';
54
- import '../../chunk-MWYKP7CI.js';
55
- import '../../chunk-3E3ABCPC.js';
56
- import '../../chunk-NHA4SBKG.js';
57
- import '../../chunk-FXVII733.js';
55
+ import '../../chunk-QMWP2ZP6.js';
56
+ import '../../chunk-6TFM3UTF.js';
57
+ import '../../chunk-XMRNYUQY.js';
58
+ import '../../chunk-T2752RH7.js';
58
59
  import '../../chunk-6K34BCUP.js';
59
60
  import '../../chunk-T72DAX7R.js';
60
61
  import '../../chunk-DF6FBKDN.js';
@@ -1,15 +1,15 @@
1
- export { LazyCopyright as Copyright, LazyCustomerLayout as CustomerLayout, LazyFooter as Footer, LazyHeader as Header, LazyMasterLayout as MasterLayout, LazyWidgetHead as WidgetHead } from '../../chunk-NGT46BX2.js';
2
- export { PageAdvertisements } from '../../chunk-TVNO5MCL.js';
1
+ export { LazyCopyright as Copyright, LazyCustomerLayout as CustomerLayout, LazyFooter as Footer, LazyHeader as Header, LazyMasterLayout as MasterLayout, LazyWidgetHead as WidgetHead } from '../../chunk-TWYTA2SX.js';
2
+ export { PageAdvertisements } from '../../chunk-KGSB2Y7O.js';
3
3
  export { MadeWithSalla } from '../../chunk-OQIIJRAS.js';
4
4
  export { pushEqualHeightConfig } from '../../chunk-V2ZDTY6H.js';
5
- import '../../chunk-4RKNISJB.js';
5
+ import '../../chunk-ETC7OJT5.js';
6
6
  import '../../chunk-5XDPAKF5.js';
7
7
  import '../../chunk-GCPEMNSU.js';
8
- import '../../chunk-WDL6T5RX.js';
8
+ import '../../chunk-U2UNWN4G.js';
9
9
  import '../../chunk-Z5M4YYWT.js';
10
10
  import '../../chunk-TYNZ5B2B.js';
11
- import '../../chunk-NHA4SBKG.js';
12
- import '../../chunk-FXVII733.js';
11
+ import '../../chunk-XMRNYUQY.js';
12
+ import '../../chunk-T2752RH7.js';
13
13
  import '../../chunk-6K34BCUP.js';
14
14
  import '../../chunk-T72DAX7R.js';
15
15
  import '../../chunk-DF6FBKDN.js';
@@ -1,46 +1,47 @@
1
- export { LazyAddToCartForm as AddToCartForm, LazyProductDetails as ProductDetails, ProductGallery } from '../../chunk-3MDXVF4Y.js';
2
- export { ProductCard } from '../../chunk-DYSSY56M.js';
1
+ export { LazyAddToCartForm as AddToCartForm, LazyProductDetails as ProductDetails, ProductGallery } from '../../chunk-MIAVMNPM.js';
2
+ export { ProductCard } from '../../chunk-NLKLS3GZ.js';
3
3
  import '../../chunk-Y32RHCOH.js';
4
- import '../../chunk-4XB425HW.js';
5
- import '../../chunk-UME7NAC5.js';
6
- import '../../chunk-KAWAAVGL.js';
7
- import '../../chunk-N6ZE6HUX.js';
4
+ import '../../chunk-GBMMP344.js';
5
+ import '../../chunk-Q77J3D2W.js';
6
+ import '../../chunk-U5TWRPMK.js';
7
+ import '../../chunk-YYVZFOUI.js';
8
+ import '../../chunk-5V4W3GBI.js';
8
9
  import '../../chunk-X55R4VVK.js';
9
10
  import '../../chunk-YL6X3ZMG.js';
10
- import '../../chunk-JKSDTWEC.js';
11
+ import '../../chunk-PCB5DCS4.js';
11
12
  import '../../chunk-OXMUPNMH.js';
12
- import '../../chunk-XYLGWKPG.js';
13
+ import '../../chunk-NGWHUW34.js';
13
14
  import '../../chunk-VVZNW5CB.js';
14
- import '../../chunk-WQPG22DY.js';
15
+ import '../../chunk-EGI7F57E.js';
15
16
  import '../../chunk-GD26FI4J.js';
16
- import '../../chunk-Q7E4TNN7.js';
17
- import '../../chunk-RYGEIQWO.js';
18
- import '../../chunk-OPON37ZR.js';
17
+ import '../../chunk-SLBO4SEE.js';
18
+ import '../../chunk-MGG4XAJ5.js';
19
+ import '../../chunk-HRW4YFHR.js';
19
20
  import '../../chunk-OUW6WESU.js';
20
- import '../../chunk-HOJ5E2PG.js';
21
+ import '../../chunk-IHOUADLX.js';
21
22
  import '../../chunk-HI5V5X3S.js';
22
- import '../../chunk-C76E3NHH.js';
23
- import '../../chunk-7HZ6JQAJ.js';
23
+ import '../../chunk-XV3HPKLI.js';
24
+ import '../../chunk-5JZSBFA5.js';
24
25
  import '../../chunk-MVT5AF2A.js';
25
26
  import '../../chunk-Z653O7MX.js';
26
27
  import '../../chunk-ZCH7W7DZ.js';
27
- import '../../chunk-TF6HFXTW.js';
28
+ import '../../chunk-H7LRGY7U.js';
28
29
  import '../../chunk-JWXJPJBO.js';
29
30
  import '../../chunk-CW625T2E.js';
30
31
  import '../../chunk-7V36I5GT.js';
31
32
  import '../../chunk-6WI7R2BD.js';
32
- import '../../chunk-LFHYQ6AN.js';
33
+ import '../../chunk-M5WTY3EH.js';
33
34
  import '../../chunk-OAMIDZKW.js';
34
- import '../../chunk-TVNO5MCL.js';
35
+ import '../../chunk-KGSB2Y7O.js';
35
36
  import '../../chunk-OQIIJRAS.js';
36
37
  import '../../chunk-V2ZDTY6H.js';
37
- import '../../chunk-4RKNISJB.js';
38
+ import '../../chunk-ETC7OJT5.js';
38
39
  import '../../chunk-5XDPAKF5.js';
39
40
  import '../../chunk-GCPEMNSU.js';
40
- import '../../chunk-WDL6T5RX.js';
41
+ import '../../chunk-U2UNWN4G.js';
41
42
  import '../../chunk-Z5M4YYWT.js';
42
43
  import '../../chunk-TYNZ5B2B.js';
43
- import '../../chunk-BKHGXHCJ.js';
44
+ import '../../chunk-VZRZQV4Q.js';
44
45
  import '../../chunk-AXW67SY7.js';
45
46
  import '../../chunk-BYMOPN2S.js';
46
47
  import '../../chunk-SKLEJJ6M.js';
@@ -48,10 +49,10 @@ import '../../chunk-6BZ5TKEV.js';
48
49
  import '../../chunk-FZKRSGLP.js';
49
50
  import '../../chunk-KYMWEUN2.js';
50
51
  import '../../chunk-YA6ABQB7.js';
51
- import '../../chunk-MWYKP7CI.js';
52
- import '../../chunk-3E3ABCPC.js';
53
- import '../../chunk-NHA4SBKG.js';
54
- import '../../chunk-FXVII733.js';
52
+ import '../../chunk-QMWP2ZP6.js';
53
+ import '../../chunk-6TFM3UTF.js';
54
+ import '../../chunk-XMRNYUQY.js';
55
+ import '../../chunk-T2752RH7.js';
55
56
  import '../../chunk-6K34BCUP.js';
56
57
  import '../../chunk-T72DAX7R.js';
57
58
  import '../../chunk-DF6FBKDN.js';