storefront-layouts 1.0.3 → 1.0.4

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 (509) hide show
  1. package/dist/components/auth/LoginForm.js +2 -2
  2. package/dist/components/auth/LoginSheet.js +2 -2
  3. package/dist/components/auth/login-form-core.js +3 -3
  4. package/dist/components/auth/login-sheet-header.js +3 -3
  5. package/dist/components/auth/login-sheet-registry.js +2 -2
  6. package/dist/components/auth/login-sheet-themes/booking-agenda.theme.js +1 -1
  7. package/dist/components/auth/login-sheet-themes/booking.theme.js +1 -1
  8. package/dist/components/auth/login-sheet-themes/clothing-minimal.theme.js +1 -1
  9. package/dist/components/auth/login-sheet-themes/clothing.theme.js +1 -1
  10. package/dist/components/auth/login-sheet-themes/electronics-grid.theme.js +1 -1
  11. package/dist/components/auth/login-sheet-themes/electronics.theme.js +1 -1
  12. package/dist/components/auth/login-sheet-themes/food-modern.theme.js +1 -1
  13. package/dist/components/auth/login-sheet-themes/food.theme.js +1 -1
  14. package/dist/components/auth/login-sheet-themes/index.js +9 -9
  15. package/dist/components/auth/login-sheet-themes/motivational-speaker.theme.js +1 -1
  16. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts +2 -2
  17. package/dist/components/auth/login-sheet-themes/theme-input-baselines.d.ts.map +1 -1
  18. package/dist/components/auth/login-sheet-themes/theme-input-baselines.js +2 -2
  19. package/dist/components/auth/login-sheets/StoreLoginSheetShell.d.ts.map +1 -1
  20. package/dist/components/auth/login-sheets/StoreLoginSheetShell.js +6 -6
  21. package/dist/components/auth/use-login-submit.js +3 -3
  22. package/dist/components/cart/InventoryHoldCountdown.js +2 -2
  23. package/dist/components/categories/category-masonry-grid.js +3 -3
  24. package/dist/components/checkout/CheckoutFeeLines.js +1 -1
  25. package/dist/components/checkout/ShippingOptionsPanel.js +3 -3
  26. package/dist/components/learning/CertificateTemplates.js +2 -2
  27. package/dist/components/learning/CertificateViewer.js +3 -3
  28. package/dist/components/learning/MentorshipProgress.d.ts.map +1 -1
  29. package/dist/components/learning/MentorshipProgress.js +4 -4
  30. package/dist/components/product/ProductVariationSelectors.js +1 -1
  31. package/dist/components/rich-text/CategoryDescription.js +2 -2
  32. package/dist/components/rich-text/ProductDescription.js +2 -2
  33. package/dist/components/rich-text/RichTextExcerpt.js +1 -1
  34. package/dist/components/rich-text/SafeRichHtml.d.ts +8 -11
  35. package/dist/components/rich-text/SafeRichHtml.d.ts.map +1 -1
  36. package/dist/components/rich-text/SafeRichHtml.js +3 -5
  37. package/dist/components/shipping/ProductDeliveryInfoSection.d.ts.map +1 -1
  38. package/dist/components/shipping/ProductDeliveryInfoSection.js +7 -4
  39. package/dist/components/shipping/ShippingQuoteAddressForm.js +3 -3
  40. package/dist/components/ui/alert-modal.js +2 -2
  41. package/dist/components/ui/avatar-image.js +1 -1
  42. package/dist/components/ui/badge.js +1 -1
  43. package/dist/components/ui/breadcrumbs.js +1 -1
  44. package/dist/components/ui/button.d.ts +1 -1
  45. package/dist/components/ui/button.js +1 -1
  46. package/dist/components/ui/card.js +1 -1
  47. package/dist/components/ui/category-tree.js +2 -2
  48. package/dist/components/ui/checkout-button.d.ts.map +1 -1
  49. package/dist/components/ui/checkout-button.js +11 -283
  50. package/dist/components/ui/guest-checkout-modal.js +3 -3
  51. package/dist/components/ui/image-skeleton.js +2 -2
  52. package/dist/components/ui/image-with-fallback.d.ts +3 -1
  53. package/dist/components/ui/image-with-fallback.d.ts.map +1 -1
  54. package/dist/components/ui/image-with-fallback.js +55 -139
  55. package/dist/components/ui/input.js +1 -1
  56. package/dist/components/ui/limited-time-offer-badge.js +2 -2
  57. package/dist/components/ui/loading-skeleton-wrapper.js +1 -1
  58. package/dist/components/ui/modal.js +2 -2
  59. package/dist/components/ui/otp-input.js +1 -1
  60. package/dist/components/ui/out-of-stock-overlay.js +1 -1
  61. package/dist/components/ui/page-animate-wrapper.js +2 -2
  62. package/dist/components/ui/page-content-loader.js +2 -2
  63. package/dist/components/ui/page-loader.js +1 -1
  64. package/dist/components/ui/product-card.d.ts.map +1 -1
  65. package/dist/components/ui/product-card.js +17 -17
  66. package/dist/components/ui/product-rating.js +1 -1
  67. package/dist/components/ui/product-stock-badge.js +2 -2
  68. package/dist/components/ui/review-form.js +2 -2
  69. package/dist/components/ui/route-skeleton-loader.js +6 -6
  70. package/dist/components/ui/sheet.d.ts +2 -1
  71. package/dist/components/ui/sheet.d.ts.map +1 -1
  72. package/dist/components/ui/sheet.js +4 -4
  73. package/dist/components/ui/skeleton.js +1 -1
  74. package/dist/components/ui/skeletons/index.js +5 -5
  75. package/dist/components/ui/skeletons/product-grid-skeleton.js +1 -1
  76. package/dist/components/ui/store-logos.d.ts.map +1 -1
  77. package/dist/components/ui/store-logos.js +4 -4
  78. package/dist/components/ui/toast.js +1 -1
  79. package/dist/components/ui/video-player.js +2 -2
  80. package/dist/editor/alignment-schemas/booking.js +1 -1
  81. package/dist/editor/alignment-schemas/clothing-minimal.js +1 -1
  82. package/dist/editor/alignment-schemas/index.js +20 -20
  83. package/dist/editor/alignment-schemas/lazy-loader.js +1 -1
  84. package/dist/editor/alignment-schemas/metadata.js +1 -1
  85. package/dist/editor/alignment-schemas/resolve-canvas-inspector-leaf.js +3 -3
  86. package/dist/editor/blocks/index.js +3 -3
  87. package/dist/editor/blocks/migrate-clothing-minimal.js +3 -3
  88. package/dist/editor/blocks/nav-outline-utils.js +2 -2
  89. package/dist/editor/blocks/registry.js +1 -1
  90. package/dist/editor/document/adapter.js +4 -4
  91. package/dist/editor/document/block-tree.js +1 -1
  92. package/dist/editor/document/index.js +6 -6
  93. package/dist/editor/document/validate.js +1 -1
  94. package/dist/editor/index.js +12 -12
  95. package/dist/editor/layout-content-loader.js +3 -3
  96. package/dist/editor/payaza-form/ArrayItemManager.js +2 -2
  97. package/dist/editor/payaza-form/EditorCanvasPreview.js +5 -5
  98. package/dist/editor/payaza-form/FieldRenderer.js +17 -17
  99. package/dist/editor/payaza-form/IframePreviewMessageBridge.js +3 -3
  100. package/dist/editor/payaza-form/PayazaFormEditor.js +31 -31
  101. package/dist/editor/payaza-form/PayazaFormEditorFullPage.js +2 -2
  102. package/dist/editor/payaza-form/SliderArrayEditor.js +3 -3
  103. package/dist/editor/payaza-form/components/ArrayField.js +1 -1
  104. package/dist/editor/payaza-form/components/BlockStylesInspector.js +1 -1
  105. package/dist/editor/payaza-form/components/BlocksField.js +9 -9
  106. package/dist/editor/payaza-form/components/ButtonField.js +3 -3
  107. package/dist/editor/payaza-form/components/CanvasGranularInspector.js +11 -11
  108. package/dist/editor/payaza-form/components/IconField.js +2 -2
  109. package/dist/editor/payaza-form/components/ImageField.js +1 -1
  110. package/dist/editor/payaza-form/components/NumberField.js +1 -1
  111. package/dist/editor/payaza-form/components/RichTextField.js +2 -2
  112. package/dist/editor/payaza-form/components/SectionField.js +1 -1
  113. package/dist/editor/payaza-form/components/SectionSchemaInspector.js +3 -3
  114. package/dist/editor/payaza-form/components/StarRatingField.js +2 -2
  115. package/dist/editor/payaza-form/components/TextField.js +1 -1
  116. package/dist/editor/payaza-form/data-merger.js +6 -6
  117. package/dist/editor/payaza-form/data-transformer.js +3 -3
  118. package/dist/editor/payaza-form/engine.js +1 -1
  119. package/dist/editor/payaza-form/examples/custom-widgets.example.js +1 -1
  120. package/dist/editor/payaza-form/index.js +8 -8
  121. package/dist/editor/payaza-form/layout-loader.js +2 -2
  122. package/dist/editor/payaza-form/preview-message-handler.js +3 -3
  123. package/dist/editor/payaza-form/schema-bridge.js +3 -3
  124. package/dist/editor/payaza-form/widget-registry.js +1 -1
  125. package/dist/editor/shared/BlockOutlineTree.js +2 -2
  126. package/dist/editor/shared/EditorHeader.js +2 -2
  127. package/dist/editor/shared/EditorNavigator.js +2 -2
  128. package/dist/editor/shared/IframePreview.js +6 -6
  129. package/dist/editor/shared/InlineCanvasPreview.js +8 -8
  130. package/dist/editor/shared/LayoutRenderer.js +1 -1
  131. package/dist/editor/shared/ResizableSidebar.js +1 -1
  132. package/dist/editor/shared/index.js +7 -7
  133. package/dist/hooks/use-analytics.js +3 -3
  134. package/dist/hooks/use-api.js +1 -1
  135. package/dist/hooks/use-cart-api.d.ts.map +1 -1
  136. package/dist/hooks/use-cart-api.js +8 -3
  137. package/dist/hooks/use-catalog-loader.js +3 -3
  138. package/dist/hooks/use-catalog-price-range.d.ts +2 -5
  139. package/dist/hooks/use-catalog-price-range.d.ts.map +1 -1
  140. package/dist/hooks/use-catalog-price-range.js +20 -5
  141. package/dist/hooks/use-category-products.d.ts +8 -0
  142. package/dist/hooks/use-category-products.d.ts.map +1 -0
  143. package/dist/hooks/use-category-products.js +43 -0
  144. package/dist/hooks/use-checkout-fees.d.ts +3 -4
  145. package/dist/hooks/use-checkout-fees.d.ts.map +1 -1
  146. package/dist/hooks/use-checkout-fees.js +1 -1
  147. package/dist/hooks/use-content-ready.js +1 -1
  148. package/dist/hooks/use-featured-products.d.ts +3 -0
  149. package/dist/hooks/use-featured-products.d.ts.map +1 -0
  150. package/dist/hooks/use-featured-products.js +25 -0
  151. package/dist/hooks/use-multi-store-checkout-fees.d.ts +3 -4
  152. package/dist/hooks/use-multi-store-checkout-fees.d.ts.map +1 -1
  153. package/dist/hooks/use-multi-store-checkout-fees.js +1 -1
  154. package/dist/hooks/use-navigation-loading.js +1 -1
  155. package/dist/hooks/use-payaza-checkout.d.ts +1 -1
  156. package/dist/hooks/use-payaza-checkout.d.ts.map +1 -1
  157. package/dist/hooks/use-payaza-checkout.js +9 -3
  158. package/dist/hooks/use-product-brands.d.ts +5 -0
  159. package/dist/hooks/use-product-brands.d.ts.map +1 -0
  160. package/dist/hooks/use-product-brands.js +25 -0
  161. package/dist/hooks/use-product-by-slug.d.ts +7 -0
  162. package/dist/hooks/use-product-by-slug.d.ts.map +1 -0
  163. package/dist/hooks/use-product-by-slug.js +38 -0
  164. package/dist/hooks/use-product-reviews.d.ts +15 -0
  165. package/dist/hooks/use-product-reviews.d.ts.map +1 -0
  166. package/dist/hooks/use-product-reviews.js +75 -0
  167. package/dist/hooks/use-product-variation-selection.d.ts +2 -8
  168. package/dist/hooks/use-product-variation-selection.d.ts.map +1 -1
  169. package/dist/hooks/use-product-variation-selection.js +1 -1
  170. package/dist/hooks/use-products-api.js +3 -3
  171. package/dist/hooks/use-shipping-quote.js +2 -2
  172. package/dist/hooks/use-store-api.js +4 -4
  173. package/dist/hooks/usePreviewSlideSync.js +1 -1
  174. package/dist/index.d.ts +62 -74
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js +141 -153
  177. package/dist/layouts/booking/components/BookingHomePage.d.ts.map +1 -1
  178. package/dist/layouts/booking/components/BookingHomePage.js +68 -74
  179. package/dist/layouts/booking/components/BookingMultilineHeading.js +1 -1
  180. package/dist/layouts/booking/components/BookingTestimonialCard.js +2 -2
  181. package/dist/layouts/booking/components/BookingTestimonialsEmptyState.js +1 -1
  182. package/dist/layouts/booking/components/booking-footer-defaults.js +2 -2
  183. package/dist/layouts/booking/index.js +8 -8
  184. package/dist/layouts/booking/pages/AboutPage.d.ts +1 -1
  185. package/dist/layouts/booking/pages/AboutPage.d.ts.map +1 -1
  186. package/dist/layouts/booking/pages/AboutPage.js +39 -60
  187. package/dist/layouts/booking/pages/BookPage.d.ts.map +1 -1
  188. package/dist/layouts/booking/pages/BookPage.js +16 -22
  189. package/dist/layouts/booking/pages/CategoriesPage.js +6 -6
  190. package/dist/layouts/booking/pages/CategoryPage.d.ts +1 -1
  191. package/dist/layouts/booking/pages/CategoryPage.d.ts.map +1 -1
  192. package/dist/layouts/booking/pages/CategoryPage.js +17 -26
  193. package/dist/layouts/booking/pages/ContactPage.d.ts +1 -1
  194. package/dist/layouts/booking/pages/ContactPage.d.ts.map +1 -1
  195. package/dist/layouts/booking/pages/ContactPage.js +5 -12
  196. package/dist/layouts/booking/pages/ProductDetailPage.d.ts +1 -1
  197. package/dist/layouts/booking/pages/ProductDetailPage.d.ts.map +1 -1
  198. package/dist/layouts/booking/pages/ProductDetailPage.js +203 -150
  199. package/dist/layouts/booking/pages/ServicesPage.d.ts +1 -1
  200. package/dist/layouts/booking/pages/ServicesPage.d.ts.map +1 -1
  201. package/dist/layouts/booking/pages/ServicesPage.js +11 -31
  202. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.d.ts.map +1 -1
  203. package/dist/layouts/booking-agenda/components/BookingHomePageAgenda.js +21 -30
  204. package/dist/layouts/booking-agenda/index.js +8 -8
  205. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts +1 -1
  206. package/dist/layouts/booking-agenda/pages/AboutPage.d.ts.map +1 -1
  207. package/dist/layouts/booking-agenda/pages/AboutPage.js +11 -14
  208. package/dist/layouts/booking-agenda/pages/BookPage.d.ts.map +1 -1
  209. package/dist/layouts/booking-agenda/pages/BookPage.js +15 -21
  210. package/dist/layouts/booking-agenda/pages/CategoriesPage.js +5 -5
  211. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts +1 -1
  212. package/dist/layouts/booking-agenda/pages/CategoryPage.d.ts.map +1 -1
  213. package/dist/layouts/booking-agenda/pages/CategoryPage.js +12 -18
  214. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts +1 -1
  215. package/dist/layouts/booking-agenda/pages/ContactPage.d.ts.map +1 -1
  216. package/dist/layouts/booking-agenda/pages/ContactPage.js +8 -13
  217. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts +1 -1
  218. package/dist/layouts/booking-agenda/pages/ProductDetailPage.d.ts.map +1 -1
  219. package/dist/layouts/booking-agenda/pages/ProductDetailPage.js +202 -149
  220. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts +1 -1
  221. package/dist/layouts/booking-agenda/pages/ServicesPage.d.ts.map +1 -1
  222. package/dist/layouts/booking-agenda/pages/ServicesPage.js +8 -23
  223. package/dist/layouts/clothing/components/ClothingHomePage.d.ts.map +1 -1
  224. package/dist/layouts/clothing/components/ClothingHomePage.js +199 -136
  225. package/dist/layouts/clothing/index.js +7 -7
  226. package/dist/layouts/clothing/pages/AboutPage.d.ts +1 -1
  227. package/dist/layouts/clothing/pages/AboutPage.d.ts.map +1 -1
  228. package/dist/layouts/clothing/pages/AboutPage.js +19 -33
  229. package/dist/layouts/clothing/pages/CategoriesPage.js +8 -8
  230. package/dist/layouts/clothing/pages/CategoryPage.d.ts +1 -1
  231. package/dist/layouts/clothing/pages/CategoryPage.d.ts.map +1 -1
  232. package/dist/layouts/clothing/pages/CategoryPage.js +15 -41
  233. package/dist/layouts/clothing/pages/ContactPage.d.ts +1 -1
  234. package/dist/layouts/clothing/pages/ContactPage.d.ts.map +1 -1
  235. package/dist/layouts/clothing/pages/ContactPage.js +5 -8
  236. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts +1 -1
  237. package/dist/layouts/clothing/pages/ProductDetailPage.d.ts.map +1 -1
  238. package/dist/layouts/clothing/pages/ProductDetailPage.js +256 -167
  239. package/dist/layouts/clothing/pages/ProductsPage.d.ts +1 -1
  240. package/dist/layouts/clothing/pages/ProductsPage.d.ts.map +1 -1
  241. package/dist/layouts/clothing/pages/ProductsPage.js +125 -59
  242. package/dist/layouts/clothing/payaza-bindings.js +2 -2
  243. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.d.ts.map +1 -1
  244. package/dist/layouts/clothing-minimal/components/ClothingHomePageMinimal.js +32 -131
  245. package/dist/layouts/clothing-minimal/components/clothing-minimal-block-render.js +8 -8
  246. package/dist/layouts/clothing-minimal/index.js +7 -7
  247. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts +1 -1
  248. package/dist/layouts/clothing-minimal/pages/AboutPage.d.ts.map +1 -1
  249. package/dist/layouts/clothing-minimal/pages/AboutPage.js +37 -61
  250. package/dist/layouts/clothing-minimal/pages/CategoriesPage.js +7 -7
  251. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts +1 -1
  252. package/dist/layouts/clothing-minimal/pages/CategoryPage.d.ts.map +1 -1
  253. package/dist/layouts/clothing-minimal/pages/CategoryPage.js +13 -18
  254. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts +1 -1
  255. package/dist/layouts/clothing-minimal/pages/ContactPage.d.ts.map +1 -1
  256. package/dist/layouts/clothing-minimal/pages/ContactPage.js +5 -8
  257. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts +1 -1
  258. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.d.ts.map +1 -1
  259. package/dist/layouts/clothing-minimal/pages/ProductDetailPage.js +202 -143
  260. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts +1 -1
  261. package/dist/layouts/clothing-minimal/pages/ProductsPage.d.ts.map +1 -1
  262. package/dist/layouts/clothing-minimal/pages/ProductsPage.js +126 -57
  263. package/dist/layouts/electronics/components/ElectronicsCategoriesPage.js +7 -7
  264. package/dist/layouts/electronics/components/ElectronicsGridProductCard.js +10 -10
  265. package/dist/layouts/electronics/components/ElectronicsHomePage.d.ts.map +1 -1
  266. package/dist/layouts/electronics/components/ElectronicsHomePage.js +29 -31
  267. package/dist/layouts/electronics/components/ElectronicsPageWrapper.js +4 -4
  268. package/dist/layouts/electronics/components/ElectronicsProductsPage.d.ts.map +1 -1
  269. package/dist/layouts/electronics/components/ElectronicsProductsPage.js +81 -23
  270. package/dist/layouts/electronics/components/ElectronicsStoreFooter.js +2 -2
  271. package/dist/layouts/electronics/components/ElectronicsStoreHeader.js +6 -6
  272. package/dist/layouts/electronics/index.js +18 -18
  273. package/dist/layouts/electronics/pages/AboutPage.d.ts +1 -1
  274. package/dist/layouts/electronics/pages/AboutPage.d.ts.map +1 -1
  275. package/dist/layouts/electronics/pages/AboutPage.js +11 -14
  276. package/dist/layouts/electronics/pages/CategoriesPage.js +1 -1
  277. package/dist/layouts/electronics/pages/CategoryPage.d.ts +1 -1
  278. package/dist/layouts/electronics/pages/CategoryPage.d.ts.map +1 -1
  279. package/dist/layouts/electronics/pages/CategoryPage.js +14 -20
  280. package/dist/layouts/electronics/pages/ContactPage.d.ts +1 -1
  281. package/dist/layouts/electronics/pages/ContactPage.d.ts.map +1 -1
  282. package/dist/layouts/electronics/pages/ContactPage.js +8 -13
  283. package/dist/layouts/electronics/pages/HelpCenterPage.js +1 -1
  284. package/dist/layouts/electronics/pages/PrivacyPolicyPage.js +1 -1
  285. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts +1 -1
  286. package/dist/layouts/electronics/pages/ProductDetailPage.d.ts.map +1 -1
  287. package/dist/layouts/electronics/pages/ProductDetailPage.js +201 -142
  288. package/dist/layouts/electronics/pages/ProductsPage.d.ts +1 -1
  289. package/dist/layouts/electronics/pages/ProductsPage.d.ts.map +1 -1
  290. package/dist/layouts/electronics/pages/ProductsPage.js +119 -49
  291. package/dist/layouts/electronics/pages/TermsPage.js +1 -1
  292. package/dist/layouts/electronics/pages/TrackOrderPage.js +4 -4
  293. package/dist/layouts/electronics-grid/components/ElectronicsGridProductCard.js +10 -10
  294. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.d.ts.map +1 -1
  295. package/dist/layouts/electronics-grid/components/ElectronicsHomePageGrid.js +75 -33
  296. package/dist/layouts/electronics-grid/index.js +14 -14
  297. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts +1 -1
  298. package/dist/layouts/electronics-grid/pages/AboutPage.d.ts.map +1 -1
  299. package/dist/layouts/electronics-grid/pages/AboutPage.js +11 -14
  300. package/dist/layouts/electronics-grid/pages/CategoriesPage.js +1 -1
  301. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts +1 -1
  302. package/dist/layouts/electronics-grid/pages/CategoryPage.d.ts.map +1 -1
  303. package/dist/layouts/electronics-grid/pages/CategoryPage.js +14 -20
  304. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts +1 -1
  305. package/dist/layouts/electronics-grid/pages/ContactPage.d.ts.map +1 -1
  306. package/dist/layouts/electronics-grid/pages/ContactPage.js +8 -13
  307. package/dist/layouts/electronics-grid/pages/ElectronicsGridCategoriesPage.js +6 -6
  308. package/dist/layouts/electronics-grid/pages/HelpCenterPage.js +1 -1
  309. package/dist/layouts/electronics-grid/pages/PrivacyPolicyPage.js +1 -1
  310. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts +1 -1
  311. package/dist/layouts/electronics-grid/pages/ProductDetailPage.d.ts.map +1 -1
  312. package/dist/layouts/electronics-grid/pages/ProductDetailPage.js +201 -142
  313. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts +1 -1
  314. package/dist/layouts/electronics-grid/pages/ProductsPage.d.ts.map +1 -1
  315. package/dist/layouts/electronics-grid/pages/ProductsPage.js +121 -52
  316. package/dist/layouts/electronics-grid/pages/TermsPage.js +1 -1
  317. package/dist/layouts/electronics-grid/pages/TrackOrderPage.js +4 -4
  318. package/dist/layouts/food/components/FoodHomePage.d.ts.map +1 -1
  319. package/dist/layouts/food/components/FoodHomePage.js +42 -41
  320. package/dist/layouts/food/index.js +8 -8
  321. package/dist/layouts/food/pages/AboutPage.d.ts +1 -1
  322. package/dist/layouts/food/pages/AboutPage.d.ts.map +1 -1
  323. package/dist/layouts/food/pages/AboutPage.js +44 -45
  324. package/dist/layouts/food/pages/CategoriesPage.js +6 -6
  325. package/dist/layouts/food/pages/CategoryPage.d.ts +1 -1
  326. package/dist/layouts/food/pages/CategoryPage.d.ts.map +1 -1
  327. package/dist/layouts/food/pages/CategoryPage.js +23 -21
  328. package/dist/layouts/food/pages/ContactPage.d.ts +1 -1
  329. package/dist/layouts/food/pages/ContactPage.d.ts.map +1 -1
  330. package/dist/layouts/food/pages/ContactPage.js +5 -7
  331. package/dist/layouts/food/pages/MenuPage.d.ts +1 -1
  332. package/dist/layouts/food/pages/MenuPage.d.ts.map +1 -1
  333. package/dist/layouts/food/pages/MenuPage.js +81 -42
  334. package/dist/layouts/food/pages/ProductDetailPage.d.ts +1 -1
  335. package/dist/layouts/food/pages/ProductDetailPage.d.ts.map +1 -1
  336. package/dist/layouts/food/pages/ProductDetailPage.js +209 -171
  337. package/dist/layouts/food/pages/ProductsPage.d.ts +1 -1
  338. package/dist/layouts/food/pages/ProductsPage.d.ts.map +1 -1
  339. package/dist/layouts/food/pages/ProductsPage.js +130 -45
  340. package/dist/layouts/food-modern/components/FoodHomePageModern.js +10 -10
  341. package/dist/layouts/food-modern/index.js +8 -8
  342. package/dist/layouts/food-modern/pages/AboutPage.d.ts +1 -1
  343. package/dist/layouts/food-modern/pages/AboutPage.d.ts.map +1 -1
  344. package/dist/layouts/food-modern/pages/AboutPage.js +11 -14
  345. package/dist/layouts/food-modern/pages/CategoriesPage.js +5 -5
  346. package/dist/layouts/food-modern/pages/CategoryPage.d.ts +1 -1
  347. package/dist/layouts/food-modern/pages/CategoryPage.d.ts.map +1 -1
  348. package/dist/layouts/food-modern/pages/CategoryPage.js +23 -20
  349. package/dist/layouts/food-modern/pages/ContactPage.d.ts +1 -1
  350. package/dist/layouts/food-modern/pages/ContactPage.d.ts.map +1 -1
  351. package/dist/layouts/food-modern/pages/ContactPage.js +5 -7
  352. package/dist/layouts/food-modern/pages/MenuPage.d.ts +1 -1
  353. package/dist/layouts/food-modern/pages/MenuPage.d.ts.map +1 -1
  354. package/dist/layouts/food-modern/pages/MenuPage.js +81 -46
  355. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts +1 -1
  356. package/dist/layouts/food-modern/pages/ProductDetailPage.d.ts.map +1 -1
  357. package/dist/layouts/food-modern/pages/ProductDetailPage.js +202 -143
  358. package/dist/layouts/food-modern/pages/ProductsPage.d.ts +1 -1
  359. package/dist/layouts/food-modern/pages/ProductsPage.d.ts.map +1 -1
  360. package/dist/layouts/food-modern/pages/ProductsPage.js +117 -33
  361. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.d.ts.map +1 -1
  362. package/dist/layouts/motivational-speaker/components/MotivationalHomePage.js +32 -23
  363. package/dist/layouts/motivational-speaker/components/MotivationalSpeakerPageWrapper.js +1 -1
  364. package/dist/layouts/motivational-speaker/index.js +9 -9
  365. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts +1 -1
  366. package/dist/layouts/motivational-speaker/pages/AboutPage.d.ts.map +1 -1
  367. package/dist/layouts/motivational-speaker/pages/AboutPage.js +6 -9
  368. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts +1 -1
  369. package/dist/layouts/motivational-speaker/pages/CategoryPage.d.ts.map +1 -1
  370. package/dist/layouts/motivational-speaker/pages/CategoryPage.js +18 -22
  371. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts +1 -1
  372. package/dist/layouts/motivational-speaker/pages/ContactPage.d.ts.map +1 -1
  373. package/dist/layouts/motivational-speaker/pages/ContactPage.js +9 -13
  374. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts +1 -1
  375. package/dist/layouts/motivational-speaker/pages/ProductsPage.d.ts.map +1 -1
  376. package/dist/layouts/motivational-speaker/pages/ProductsPage.js +121 -52
  377. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts +1 -1
  378. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.d.ts.map +1 -1
  379. package/dist/layouts/motivational-speaker/pages/ServiceDetailPage.js +15 -24
  380. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts +1 -1
  381. package/dist/layouts/motivational-speaker/pages/ServicesPage.d.ts.map +1 -1
  382. package/dist/layouts/motivational-speaker/pages/ServicesPage.js +8 -23
  383. package/dist/layouts/motivational-speaker/pages/SubscriptionPage.js +7 -7
  384. package/dist/layouts/shared/components/BaseStoreLayout.js +9 -9
  385. package/dist/layouts/shared/components/CartLineQuantityControl.js +1 -1
  386. package/dist/layouts/shared/components/GenericPageWrapper.js +3 -3
  387. package/dist/layouts/shared/components/ProductPriceFilterSection.js +4 -4
  388. package/dist/layouts/shared/components/PromoBanner.d.ts +1 -4
  389. package/dist/layouts/shared/components/PromoBanner.d.ts.map +1 -1
  390. package/dist/layouts/shared/components/PromoBanner.js +12 -8
  391. package/dist/layouts/shared/components/StoreFooter.js +10 -10
  392. package/dist/layouts/shared/components/StoreHeader.js +7 -7
  393. package/dist/layouts/shared/components/TestimonialCard.d.ts.map +1 -1
  394. package/dist/layouts/shared/components/TestimonialCard.js +2 -2
  395. package/dist/layouts/shared/components/headers/BookingAgendaSidebar.js +2 -2
  396. package/dist/layouts/shared/components/headers/ClothingMinimalHeader.js +11 -11
  397. package/dist/layouts/shared/components/headers/FoodModernHeader.js +7 -7
  398. package/dist/layouts/shared/index.js +22 -22
  399. package/dist/layouts/shared/pages/AccountPage.d.ts.map +1 -1
  400. package/dist/layouts/shared/pages/AccountPage.js +101 -27
  401. package/dist/layouts/shared/pages/CartPage.d.ts.map +1 -1
  402. package/dist/layouts/shared/pages/CartPage.js +39 -90
  403. package/dist/layouts/shared/pages/CheckoutPage.d.ts.map +1 -1
  404. package/dist/layouts/shared/pages/CheckoutPage.js +349 -868
  405. package/dist/layouts/shared/pages/CookiePolicyPage.js +1 -1
  406. package/dist/layouts/shared/pages/FeatureDisabledPage.js +1 -1
  407. package/dist/layouts/shared/pages/HelpCenterPage.js +1 -1
  408. package/dist/layouts/shared/pages/MaintenancePage.d.ts.map +1 -1
  409. package/dist/layouts/shared/pages/MaintenancePage.js +2 -3
  410. package/dist/layouts/shared/pages/PortfolioPage.d.ts.map +1 -1
  411. package/dist/layouts/shared/pages/PortfolioPage.js +2 -2
  412. package/dist/layouts/shared/pages/PrivacyPolicyPage.js +1 -1
  413. package/dist/layouts/shared/pages/SizeGuidePage.js +1 -1
  414. package/dist/layouts/shared/pages/StyleGuidePage.js +3 -3
  415. package/dist/layouts/shared/pages/TeamPage.d.ts.map +1 -1
  416. package/dist/layouts/shared/pages/TeamPage.js +1 -1
  417. package/dist/layouts/shared/pages/TermsPage.js +1 -1
  418. package/dist/layouts/shared/pages/TrackOrderPage.js +4 -4
  419. package/dist/layouts/shared/pages/WishlistPage.d.ts.map +1 -1
  420. package/dist/layouts/shared/pages/WishlistPage.js +44 -29
  421. package/dist/layouts/shared/wrappers/BookingAgendaLayout.d.ts.map +1 -1
  422. package/dist/layouts/shared/wrappers/BookingAgendaLayout.js +80 -35
  423. package/dist/layouts/shared/wrappers/ClothingLayout.js +8 -8
  424. package/dist/layouts/shared/wrappers/ClothingMinimalLayout.js +7 -7
  425. package/dist/layouts/shared/wrappers/ElectronicsLayout.js +5 -5
  426. package/dist/layouts/shared/wrappers/FoodModernLayout.js +6 -6
  427. package/dist/layouts/shared/wrappers/MotivationalLayout.js +9 -9
  428. package/dist/layouts/shared/wrappers/StandardLayout.js +8 -8
  429. package/dist/lib/api.d.ts +3 -4
  430. package/dist/lib/api.d.ts.map +1 -1
  431. package/dist/lib/api.js +69 -109
  432. package/dist/lib/auth-context.js +2 -2
  433. package/dist/lib/content-selectors.d.ts +1 -1
  434. package/dist/lib/content-selectors.d.ts.map +1 -1
  435. package/dist/lib/content-selectors.js +8 -0
  436. package/dist/lib/layout-config-hydration.js +2 -2
  437. package/dist/lib/loading-context.d.ts.map +1 -1
  438. package/dist/lib/loading-context.js +11 -21
  439. package/dist/lib/payaza-checkout.d.ts.map +1 -1
  440. package/dist/lib/payaza-checkout.js +2 -4
  441. package/dist/lib/payaza-public-key.d.ts +6 -0
  442. package/dist/lib/payaza-public-key.d.ts.map +1 -0
  443. package/dist/lib/payaza-public-key.js +10 -0
  444. package/dist/lib/rich-html.d.ts +31 -26
  445. package/dist/lib/rich-html.d.ts.map +1 -1
  446. package/dist/lib/rich-html.js +1 -0
  447. package/dist/lib/services/analytics.service.js +1 -1
  448. package/dist/lib/services/auth.service.js +1 -1
  449. package/dist/lib/services/booking.service.js +1 -1
  450. package/dist/lib/services/category.service.js +1 -1
  451. package/dist/lib/services/checkout.service.d.ts +3 -0
  452. package/dist/lib/services/checkout.service.d.ts.map +1 -1
  453. package/dist/lib/services/checkout.service.js +1 -1
  454. package/dist/lib/services/contact.service.js +1 -1
  455. package/dist/lib/services/customer.service.js +1 -1
  456. package/dist/lib/services/fees.service.d.ts +17 -63
  457. package/dist/lib/services/fees.service.d.ts.map +1 -1
  458. package/dist/lib/services/fees.service.js +4 -138
  459. package/dist/lib/services/index.js +13 -13
  460. package/dist/lib/services/location.service.js +1 -1
  461. package/dist/lib/services/order.service.js +1 -1
  462. package/dist/lib/services/payment.service.js +1 -1
  463. package/dist/lib/services/product.service.d.ts +7 -2
  464. package/dist/lib/services/product.service.d.ts.map +1 -1
  465. package/dist/lib/services/product.service.js +13 -1
  466. package/dist/lib/services/promo.service.js +1 -1
  467. package/dist/lib/services/review.service.js +1 -1
  468. package/dist/lib/services/service.service.js +1 -1
  469. package/dist/lib/services/shipping.service.js +1 -1
  470. package/dist/lib/services/store.service.js +1 -1
  471. package/dist/lib/store-config-utils.d.ts +1 -10
  472. package/dist/lib/store-config-utils.d.ts.map +1 -1
  473. package/dist/lib/store-config-utils.js +73 -261
  474. package/dist/lib/store-config.js +1 -1
  475. package/dist/lib/store-context.d.ts +1 -23
  476. package/dist/lib/store-context.d.ts.map +1 -1
  477. package/dist/lib/store-context.js +89 -111
  478. package/dist/lib/store-types.d.ts +9 -91
  479. package/dist/lib/store-types.d.ts.map +1 -1
  480. package/dist/lib/utils/asset-helpers.js +1 -1
  481. package/dist/lib/utils/catalog-price-bounds.d.ts +16 -6
  482. package/dist/lib/utils/catalog-price-bounds.d.ts.map +1 -1
  483. package/dist/lib/utils/catalog-price-bounds.js +58 -14
  484. package/dist/lib/utils/category-tree.d.ts +9 -0
  485. package/dist/lib/utils/category-tree.d.ts.map +1 -1
  486. package/dist/lib/utils/category-tree.js +26 -0
  487. package/dist/lib/utils/editor-preview.d.ts +5 -0
  488. package/dist/lib/utils/editor-preview.d.ts.map +1 -1
  489. package/dist/lib/utils/editor-preview.js +17 -3
  490. package/dist/lib/utils/fee-calculations.d.ts +5 -1
  491. package/dist/lib/utils/fee-calculations.d.ts.map +1 -1
  492. package/dist/lib/utils/fee-calculations.js +28 -31
  493. package/dist/lib/utils/index.d.ts +1 -1
  494. package/dist/lib/utils/index.d.ts.map +1 -1
  495. package/dist/lib/utils/index.js +4 -4
  496. package/dist/lib/utils/product-images.js +1 -1
  497. package/dist/lib/utils/product-share.js +1 -1
  498. package/dist/lib/utils/url-helpers.d.ts +6 -0
  499. package/dist/lib/utils/url-helpers.d.ts.map +1 -1
  500. package/dist/lib/utils/url-helpers.js +20 -4
  501. package/dist/preview/LayoutPreview.js +6 -6
  502. package/dist/preview/PreviewRouter.js +4 -4
  503. package/dist/preview/canvas/PreviewCanvasEnhancer.js +8 -8
  504. package/dist/preview/canvas/preview-flush-await.js +1 -1
  505. package/dist/preview/canvas/preview-isolation.js +1 -1
  506. package/dist/preview/canvas/preview-route.js +2 -2
  507. package/dist/preview/index.js +5 -5
  508. package/dist/styles/index.css +190 -149
  509. package/package.json +31 -43
@@ -1 +1 @@
1
- {"version":3,"file":"ProductsPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing-minimal/pages/ProductsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAyBrE,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AA8uBD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,iBAAiB,2CAMnE"}
1
+ {"version":3,"file":"ProductsPage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/clothing-minimal/pages/ProductsPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,0BAA0B,CAAC;AAyBrE,UAAU,iBAAiB;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AA6wBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAMpD"}
@@ -1,42 +1,37 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
4
- import { Breadcrumbs } from '../../../components/ui/breadcrumbs.js';
5
- import { Sheet } from '../../../components/ui/sheet.js';
6
- import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
7
- import { ProductCard } from '../../../components/ui/product-card.js';
8
- import { ProductGridSkeleton } from '../../../components/ui/skeletons/index.js';
9
- import { CategoryTree } from '../../../components/ui/category-tree.js';
10
- import { useStore } from '../../../lib/store-context.js';
11
- import { useToast } from '../../../components/ui/toast.js';
12
- import { useLoading } from '../../../lib/loading-context.js';
13
- import { useAnalytics } from '../../../hooks/use-analytics.js';
3
+ import { Button } from '../../../components/ui/button';
4
+ import { Breadcrumbs } from '../../../components/ui/breadcrumbs';
5
+ import { Sheet } from '../../../components/ui/sheet';
6
+ import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
7
+ import { ProductCard } from '../../../components/ui/product-card';
8
+ import { ProductGridSkeleton } from '../../../components/ui/skeletons';
9
+ import { CategoryTree } from '../../../components/ui/category-tree';
10
+ import { useStore } from '../../../lib/store-context';
11
+ import { useToast } from '../../../components/ui/toast';
12
+ import { useLoading } from '../../../lib/loading-context';
13
+ import { useAnalytics } from '../../../hooks/use-analytics';
14
14
  import { ChevronDown, ChevronUp, Star, Check, Search, RotateCcw, SlidersHorizontal } from 'lucide-react';
15
- import Link from 'next/link';
16
15
  import { useSearchParams } from 'next/navigation';
17
- import { useState, useMemo, useEffect, Suspense } from 'react';
18
- import { formatCurrency, isEditorPreviewMode, resolveStoreProductsForDisplay } from '../../../lib/utils/index.js';
19
- import { useCatalogLoader } from '../../../hooks/use-catalog-loader.js';
20
- import { useCatalogPriceRange } from '../../../hooks/use-catalog-price-range.js';
21
- import { getAllCategoryIds, flattenCategoryTree, buildCategoryTree } from '../../../lib/utils/category-tree.js';
22
- import { getBannerImage, getLayoutText } from '../../../lib/utils/asset-helpers.js';
23
- import { shouldUseAPI } from '../../../lib/utils/demo-detection.js';
24
- import { getStoreUrl } from '../../../lib/utils/url-helpers.js';
25
- import { encodePayazaFieldKey } from '../../../preview/canvas/field-key.js';
16
+ import { useState, useMemo, useEffect, useRef, Suspense } from 'react';
17
+ import { useProductBrands } from '../../../hooks/use-product-brands';
18
+ import { filterActiveProducts } from '../../../lib/utils';
19
+ import { getAllCategoryIds, flattenCategoryTree, buildCategoryTree } from '../../../lib/utils/category-tree';
20
+ import { getBannerImage, getLayoutText } from '../../../lib/utils/asset-helpers';
21
+ import { shouldUseAPI } from '../../../lib/utils/demo-detection';
22
+ import { useCatalogPriceRange } from '../../../hooks/use-catalog-price-range';
23
+ import { isWithinActivePriceRange } from '../../../lib/utils/catalog-price-bounds';
24
+ import { ProductPriceFilterSection } from '../../shared/components/ProductPriceFilterSection';
26
25
  function ProductsPageContent({ storeConfig: initialConfig }) {
27
26
  const { store, addToCart } = useStore();
28
27
  const storeConfig = store || initialConfig;
29
- const isPreview = isEditorPreviewMode(storeConfig);
30
- const payaza = (sectionKey, segments) => isPreview ? encodePayazaFieldKey(sectionKey, segments) : undefined;
31
- const { products: loadedProducts, categories: loadedCategories, isLoading: isLoadingProducts } = useCatalogLoader(storeConfig, { fetchServices: false });
32
28
  const searchParams = useSearchParams();
33
29
  const categoryParam = searchParams.get('category');
34
30
  const [products, setProducts] = useState(() => {
35
- let initialProducts = resolveStoreProductsForDisplay(loadedProducts, isPreview);
36
- // Ensure all products have unique IDs just in case mock data has duplicates
37
- // or if we are artificially duplicating for grid demo
38
- if (initialProducts.length > 0) {
39
- // If very few products, duplicate them to show grid structure
31
+ // Filter out inactive/deleted products first
32
+ let initialProducts = filterActiveProducts(storeConfig.products || []);
33
+ // Template demos only: pad thin catalogs so the grid has structure.
34
+ if (initialProducts.length > 0 && !shouldUseAPI(storeConfig.slug)) {
40
35
  if (initialProducts.length < 4) {
41
36
  initialProducts = [...initialProducts, ...initialProducts].map((p, i) => ({
42
37
  ...p,
@@ -45,8 +40,6 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
45
40
  }));
46
41
  }
47
42
  else {
48
- // Even if enough products, ensure IDs are unique strings
49
- // (Mock data usually is fine, but this is a safeguard)
50
43
  const seenIds = new Set();
51
44
  initialProducts = initialProducts.map((p, i) => {
52
45
  if (seenIds.has(p.id)) {
@@ -59,19 +52,18 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
59
52
  }
60
53
  return initialProducts;
61
54
  });
62
- const categories = loadedCategories;
63
- useEffect(() => {
64
- if (loadedProducts.length > 0) {
65
- setProducts(resolveStoreProductsForDisplay(loadedProducts, isPreview));
66
- }
67
- }, [loadedProducts, isPreview]);
55
+ const [isLoadingProducts, setIsLoadingProducts] = useState(false);
56
+ const [currentPage, setCurrentPage] = useState(1);
57
+ const [totalProducts, setTotalProducts] = useState(storeConfig.productsTotal || storeConfig.products?.length || 0);
58
+ const categories = storeConfig.categories || [];
68
59
  const { addToast } = useToast();
69
60
  const { startBackendLoading, stopBackendLoading } = useLoading();
70
61
  const { trackEvent } = useAnalytics();
71
62
  // State for filters & sort
72
- const { priceRange, setPriceRange, catalogBounds, sliderMax, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(products);
73
63
  const [selectedBrands, setSelectedBrands] = useState([]);
74
64
  const [selectedCategories, setSelectedCategories] = useState([]);
65
+ const storeCurrency = storeConfig.settings?.currency || 'NGN';
66
+ const { priceRange, setPriceRange, catalogBounds, resetPriceRange, hasActivePriceFilter, } = useCatalogPriceRange(products);
75
67
  const [selectedCategoryFilter, setSelectedCategoryFilter] = useState(null);
76
68
  // Initialize filters from URL
77
69
  useEffect(() => {
@@ -86,24 +78,20 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
86
78
  const [sortBy, setSortBy] = useState('featured');
87
79
  const [visibleProducts, setVisibleProducts] = useState(12);
88
80
  const [isFiltering, setIsFiltering] = useState(false);
89
- // Extract unique brands
90
- const brands = useMemo(() => {
81
+ // Fallback brands from the loaded page; full catalog brands come from the brands API.
82
+ const fallbackBrands = useMemo(() => {
91
83
  const brandSet = new Set();
92
84
  products.forEach(product => {
93
- // First check specifications for Brand
94
85
  if (product.specifications?.Brand) {
95
86
  brandSet.add(product.specifications.Brand);
96
87
  }
97
- else {
98
- // Fallback to regex matching common brand names
99
- const brandMatch = product.name.match(/\b(Reebok|Nike|Adidas|Puma|Zara|Dickies|Vans|Uniqlo|New Balance|Converse|Sony|Samsung|Apple|Dell|HP|Gucci|Prada|Versace|Armani|Calvin Klein|Tommy Hilfiger|Levi's|Gap|H&M|Forever 21|ASOS|Shein|Amazon|Microsoft|LG|Canon|Nikon|Bose|JBL|Beats|Ray-Ban|Oakley)\b/i);
100
- if (brandMatch) {
101
- brandSet.add(brandMatch[1]);
102
- }
88
+ else if (product.brand) {
89
+ brandSet.add(product.brand);
103
90
  }
104
91
  });
105
92
  return Array.from(brandSet).sort();
106
93
  }, [products]);
94
+ const brands = useProductBrands(storeConfig.id, fallbackBrands);
107
95
  // Track filter changes and show loading
108
96
  useEffect(() => {
109
97
  setIsFiltering(true);
@@ -147,7 +135,7 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
147
135
  }
148
136
  }
149
137
  // Price filter
150
- if (product.price < priceRange[0] || product.price > priceRange[1]) {
138
+ if (!isWithinActivePriceRange(product.price, priceRange, catalogBounds)) {
151
139
  return false;
152
140
  }
153
141
  // Category Filter (Top Buttons)
@@ -193,8 +181,87 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
193
181
  }
194
182
  return result;
195
183
  }, [products, selectedBrands, effectiveCategoryIds, priceRange, selectedCategoryFilter, minRating, showInStockOnly, sortBy, categories]);
184
+ const productQuery = useMemo(() => {
185
+ const categoryIds = new Set(effectiveCategoryIds);
186
+ const selectedCategory = categories.find((category) => category.slug === selectedCategoryFilter);
187
+ if (selectedCategory)
188
+ getAllCategoryIds(selectedCategory).forEach((id) => categoryIds.add(id));
189
+ return {
190
+ storeId: storeConfig.id,
191
+ categoryIds: categoryIds.size ? Array.from(categoryIds).join(',') : undefined,
192
+ brands: selectedBrands.length ? selectedBrands.join(',') : undefined,
193
+ minPrice: priceRange[0] || undefined,
194
+ maxPrice: priceRange[1] < catalogBounds.max ? priceRange[1] : undefined,
195
+ rating: minRating || undefined,
196
+ inStock: showInStockOnly || undefined,
197
+ sortBy,
198
+ };
199
+ }, [catalogBounds.max, categories, effectiveCategoryIds, minRating, priceRange, selectedBrands, selectedCategoryFilter, showInStockOnly, sortBy, storeConfig.id]);
200
+ const skipBootstrapRefetch = useRef(true);
201
+ useEffect(() => {
202
+ let cancelled = false;
203
+ const isDefaultQuery = !productQuery.categoryIds &&
204
+ !productQuery.brands &&
205
+ !productQuery.minPrice &&
206
+ productQuery.maxPrice === undefined &&
207
+ !productQuery.rating &&
208
+ !productQuery.inStock &&
209
+ productQuery.sortBy === 'featured';
210
+ const fetchFilteredProducts = async () => {
211
+ // Keep SSR bootstrap first paint; only refetch when filters/sort change.
212
+ if (skipBootstrapRefetch.current && isDefaultQuery && products.length > 0) {
213
+ skipBootstrapRefetch.current = false;
214
+ setTotalProducts(storeConfig.productsTotal || products.length);
215
+ return;
216
+ }
217
+ skipBootstrapRefetch.current = false;
218
+ setIsLoadingProducts(true);
219
+ try {
220
+ const { productService } = await import('../../../lib/services/product.service');
221
+ const { transformProductToStoreProduct } = await import('../../../lib/store-config-utils');
222
+ const response = await productService.getProducts({ ...productQuery, page: 1, limit: 12 });
223
+ if (cancelled)
224
+ return;
225
+ setProducts(response.data.map(transformProductToStoreProduct));
226
+ setCurrentPage(1);
227
+ setTotalProducts(response.meta.total);
228
+ setVisibleProducts(12);
229
+ }
230
+ catch (error) {
231
+ if (!cancelled)
232
+ console.error('Failed to fetch products:', error);
233
+ }
234
+ finally {
235
+ if (!cancelled)
236
+ setIsLoadingProducts(false);
237
+ }
238
+ };
239
+ fetchFilteredProducts();
240
+ return () => { cancelled = true; };
241
+ }, [productQuery]);
196
242
  const displayedProducts = filteredAndSortedProducts.slice(0, visibleProducts);
197
- const hasMore = visibleProducts < filteredAndSortedProducts.length;
243
+ const hasMore = currentPage * 12 < totalProducts;
244
+ const handleLoadMore = async () => {
245
+ if (isLoadingProducts || !hasMore)
246
+ return;
247
+ setIsLoadingProducts(true);
248
+ try {
249
+ const { productService } = await import('../../../lib/services/product.service');
250
+ const { transformProductToStoreProduct } = await import('../../../lib/store-config-utils');
251
+ const nextPage = currentPage + 1;
252
+ const response = await productService.getProducts({ ...productQuery, page: nextPage, limit: 12 });
253
+ setProducts((current) => [...current, ...response.data.map(transformProductToStoreProduct)]);
254
+ setCurrentPage(nextPage);
255
+ setTotalProducts(response.meta.total);
256
+ setVisibleProducts((current) => current + 12);
257
+ }
258
+ catch (error) {
259
+ console.error('Failed to load more products:', error);
260
+ }
261
+ finally {
262
+ setIsLoadingProducts(false);
263
+ }
264
+ };
198
265
  const handleAddToCart = (product) => {
199
266
  addToCart(product);
200
267
  addToast(`${product.name} added to cart`, 'success');
@@ -217,8 +284,8 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
217
284
  showInStockOnly;
218
285
  // Breadcrumbs
219
286
  const breadcrumbItems = [
220
- { label: storeConfig.name, href: getStoreUrl(storeConfig.slug, '/') },
221
- { label: 'Products', href: getStoreUrl(storeConfig.slug, '/products') },
287
+ { label: storeConfig.name, href: `/${storeConfig.slug}` },
288
+ { label: 'Products', href: `/${storeConfig.slug}/products` },
222
289
  ];
223
290
  // Get layout config and category header image
224
291
  const layoutConfig = storeConfig.layoutConfig;
@@ -231,9 +298,9 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
231
298
  hasAssignedText: !!layoutConfig?.assignedText,
232
299
  categoryHeaderTitle: layoutConfig?.assignedText?.['category_header:title'],
233
300
  });
234
- // Get category header image from assignedAssets; fall back to a minimal fashion default
301
+ // Get category header image from assignedAssets
235
302
  const categoryHeaderImage = layoutConfig?.assignedAssets?.category_header ||
236
- getBannerImage(storeConfig, 'category_header', 'https://images.unsplash.com/photo-1490481651871-ab68de25d43d?q=80&w=2070&auto=format&fit=crop');
303
+ getBannerImage(storeConfig, 'category_header', '');
237
304
  console.log('[ProductsPage] Category header image:', categoryHeaderImage ? 'found' : 'not found', categoryHeaderImage);
238
305
  // Get category header title from assignedText
239
306
  const categoryHeaderTitle = layoutConfig?.assignedText?.['category_header:title'] ||
@@ -252,10 +319,12 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
252
319
  const secondaryButtonText = hasSecondaryButtonFromConfig
253
320
  ? (categoryHeaderSecondaryButton && categoryHeaderSecondaryButton.trim() !== '' ? categoryHeaderSecondaryButton.trim() : null)
254
321
  : getLayoutText(storeConfig, 'sections.categories.viewAll', 'View Categories');
255
- return (_jsxs("div", { className: "min-h-screen bg-white font-sans text-slate-900", children: [layoutConfig?.sections?.productsHeader?.show !== false && (_jsxs("div", { "data-section": "productsHeader", "data-payaza-section-key": "productsHeader", "data-payaza-page": "products", className: "relative overflow-hidden bg-white", children: [(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute inset-0 z-0", "data-payaza-image": payaza('productsHeader', ['image']), children: [_jsx(ImageWithFallback, { src: layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage, alt: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || storeConfig.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-black/60" })] })), !(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[500px] h-[500px] bg-gray-100 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-10%] w-[400px] h-[400px] bg-gray-50 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow", style: { animationDelay: '2s' } })] })), _jsx("div", { className: `container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-12 pb-16 lg:pt-20 lg:pb-24 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'min-h-[500px] flex items-center' : ''}`, children: _jsx("div", { className: "flex flex-col items-center w-full max-w-4xl mx-auto", children: _jsxs("div", { className: `w-full text-center lg:text-left animate-fade-in-up ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : ''}`, children: [_jsx("div", { className: "flex justify-center lg:justify-start mb-6", children: _jsx(Breadcrumbs, { items: breadcrumbItems, variant: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'light' : 'default' }) }), _jsx("h1", { className: `text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight mb-6 leading-[1.1] ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : 'text-gray-900'}`, "data-payaza-edit": payaza('productsHeader', ['title']), children: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || (_jsxs(_Fragment, { children: ["Explore The Collections of ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-gray-900 via-gray-700 to-gray-900", children: storeConfig.name })] })) }), _jsx("p", { className: `text-lg mb-8 leading-relaxed max-w-lg mx-auto lg:mx-0 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white/90' : 'text-gray-600'}`, "data-payaza-edit": payaza('productsHeader', ['description']), children: layoutConfig?.sections?.productsHeader?.description || getLayoutText(storeConfig, 'category_header:description', "Don't miss out on shopping our latest collection! curated for quality and style. Experience the perfect blend of modern aesthetics and premium craftsmanship.") }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 justify-center lg:justify-start", children: [(layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText) && (layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText).trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white text-gray-900 hover:bg-gray-100' : ''}`, onClick: () => {
322
+ return (_jsxs("div", { className: "min-h-screen bg-white font-sans text-slate-900", children: [layoutConfig?.sections?.productsHeader?.show !== false && (_jsxs("div", { className: "relative overflow-hidden bg-white", children: [(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute inset-0 z-0", children: [_jsx(ImageWithFallback, { src: layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage, alt: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || storeConfig.name, className: "w-full h-full object-cover", skeletonAspectRatio: "16/9" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-r from-black/60 via-black/40 to-black/60" })] })), !(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) && (_jsxs("div", { className: "absolute top-0 left-0 w-full h-full overflow-hidden z-0 pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[500px] h-[500px] bg-gray-100 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-10%] w-[400px] h-[400px] bg-gray-50 rounded-full mix-blend-multiply filter blur-3xl opacity-70 animate-pulse-slow", style: { animationDelay: '2s' } })] })), _jsx("div", { className: `container mx-auto px-4 sm:px-6 lg:px-8 relative z-10 pt-12 pb-16 lg:pt-20 lg:pb-24 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'min-h-[500px] flex items-center' : ''}`, children: _jsx("div", { className: "flex flex-col items-center w-full max-w-4xl mx-auto", children: _jsxs("div", { className: `w-full text-center lg:text-left animate-fade-in-up ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : ''}`, children: [_jsx("div", { className: "flex justify-center lg:justify-start mb-6", children: _jsx("div", { className: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/10 backdrop-blur-md px-4 py-2 rounded-full border border-white/20' : '', children: _jsx(Breadcrumbs, { items: breadcrumbItems, variant: (layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'light' : 'default' }) }) }), _jsxs("div", { className: `inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-bold tracking-wider uppercase mb-6 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/20 backdrop-blur-md text-white border border-white/30' : 'bg-black/5 text-gray-900'}`, children: [_jsx("span", { className: `w-2 h-2 rounded-full animate-pulse ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white' : 'bg-black'}` }), layoutConfig?.sections?.productsHeader?.badge || getLayoutText(storeConfig, 'common.newArrivals', 'New Arrivals 2024')] }), _jsx("h1", { className: `text-4xl sm:text-5xl lg:text-6xl font-bold tracking-tight mb-6 leading-[1.1] ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white' : 'text-gray-900'}`, children: layoutConfig?.sections?.productsHeader?.title || categoryHeaderTitle || (_jsxs(_Fragment, { children: ["Explore The Collections of ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-gray-900 via-gray-700 to-gray-900", children: storeConfig.name })] })) }), _jsx("p", { className: `text-lg mb-8 leading-relaxed max-w-lg mx-auto lg:mx-0 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'text-white/90' : 'text-gray-600'}`, children: layoutConfig?.sections?.productsHeader?.description || getLayoutText(storeConfig, 'category_header:description', "Don't miss out on shopping our latest collection! curated for quality and style. Experience the perfect blend of modern aesthetics and premium craftsmanship.") }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 justify-center lg:justify-start", children: [(layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText) && (layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText).trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white text-gray-900 hover:bg-gray-100' : ''}`, onClick: () => {
256
323
  const element = document.getElementById('product-grid');
257
324
  element?.scrollIntoView({ behavior: 'smooth' });
258
- }, children: _jsx("span", { "data-payaza-edit": payaza('productsHeader', ['primaryButtonText']), children: layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText }) })), (layoutConfig?.sections?.productsHeader?.secondaryButtonText || secondaryButtonText) && (layoutConfig?.sections?.productsHeader?.secondaryButtonText || secondaryButtonText).trim() !== '' && (_jsx(Link, { href: getStoreUrl(storeConfig.slug, layoutConfig?.sections?.productsHeader?.secondaryButtonLink || '/categories'), children: _jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/10 backdrop-blur-md text-white border border-white/30 hover:bg-white/20' : 'bg-gray-100 text-gray-900 hover:bg-gray-200 border border-gray-200'}`, children: _jsx("span", { "data-payaza-edit": payaza('productsHeader', ['secondaryButtonText']), children: layoutConfig?.sections?.productsHeader?.secondaryButtonText || secondaryButtonText }) }) }))] })] }) }) })] })), _jsxs("div", { "data-content-ready": true, "data-section": "productsGrid", "data-payaza-section-key": "productsGrid", "data-payaza-page": "products", className: "container mx-auto px-4 sm:px-6 lg:px-8 py-8", children: [_jsxs("div", { className: "flex gap-3 mb-8 overflow-x-auto pb-2 scrollbar-hide", children: [_jsx("button", { onClick: () => setSelectedCategoryFilter(null), className: `px-6 py-2.5 rounded-lg text-sm font-semibold whitespace-nowrap transition-all ${!selectedCategoryFilter
325
+ }, children: layoutConfig?.sections?.productsHeader?.primaryButtonText || primaryButtonText })), (layoutConfig?.sections?.productsHeader?.secondaryButtonText || secondaryButtonText) && (layoutConfig?.sections?.productsHeader?.secondaryButtonText || secondaryButtonText).trim() !== '' && (_jsx(Button, { className: `h-12 px-8 rounded-full text-base font-medium shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 ${(layoutConfig?.sections?.productsHeader?.image || categoryHeaderImage) ? 'bg-white/10 backdrop-blur-md text-white border border-white/30 hover:bg-white/20' : 'bg-gray-100 text-gray-900 hover:bg-gray-200 border border-gray-200'}`, onClick: () => {
326
+ window.location.href = `/${storeConfig.slug}/categories`;
327
+ }, children: layoutConfig?.sections?.productsHeader?.secondaryButtonText || secondaryButtonText }))] })] }) }) })] })), _jsxs("div", { "data-content-ready": true, className: "container mx-auto px-4 sm:px-6 lg:px-8 py-8", children: [_jsxs("div", { className: "flex gap-3 mb-8 overflow-x-auto pb-2 scrollbar-hide", children: [_jsx("button", { onClick: () => setSelectedCategoryFilter(null), className: `px-6 py-2.5 rounded-lg text-sm font-semibold whitespace-nowrap transition-all ${!selectedCategoryFilter
259
328
  ? 'bg-gray-900 text-white hover:bg-blue-600'
260
329
  : 'bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600'}`, children: "All" }), categories.map((category) => (_jsx("button", { onClick: () => setSelectedCategoryFilter(selectedCategoryFilter === category.slug ? null : category.slug), className: `px-6 py-2.5 rounded-lg text-sm font-semibold whitespace-nowrap transition-all ${selectedCategoryFilter === category.slug
261
330
  ? 'bg-gray-900 text-white hover:bg-blue-600'
@@ -263,12 +332,12 @@ function ProductsPageContent({ storeConfig: initialConfig }) {
263
332
  setSelectedCategories(prev => isSelected
264
333
  ? [...prev, categoryId]
265
334
  : prev.filter(id => id !== categoryId));
266
- }, mode: "checkbox" })] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide", children: "Price Range" }), (priceRange[0] > 0 || hasActivePriceFilter) && (_jsx("button", { onClick: () => resetPriceRange(), className: "text-xs text-gray-600 hover:text-blue-600 font-medium transition-colors", children: "Reset" }))] }), _jsxs("div", { className: "space-y-4", children: [_jsx("div", { className: "flex items-center gap-2", children: _jsx("input", { type: "range", min: "0", max: sliderMax, step: "50", value: priceRange[1], onChange: (e) => setPriceRange([priceRange[0], parseInt(e.target.value)]), className: "flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-gray-900" }) }), _jsxs("div", { className: "flex items-center justify-between text-sm font-medium", children: [_jsx("span", { className: "text-gray-900", children: formatCurrency(priceRange[0], storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 }) }), _jsx("span", { className: "text-gray-900", children: formatCurrency(priceRange[1], storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 }) })] }), _jsxs("div", { className: "grid grid-cols-2 gap-2", children: [_jsxs("button", { onClick: () => setPriceRange([0, 100]), className: "px-3 py-2 text-xs font-semibold rounded-lg bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600 transition-colors", children: [formatCurrency(0, storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 }), " - ", formatCurrency(100, storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 })] }), _jsxs("button", { onClick: () => setPriceRange([0, 500]), className: "px-3 py-2 text-xs font-semibold rounded-lg bg-gray-100 text-gray-700 hover:bg-blue-50 hover:text-blue-600 transition-colors", children: [formatCurrency(0, storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 }), " - ", formatCurrency(500, storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 })] })] })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Rating" }), _jsx("div", { className: "space-y-2", children: [4, 3, 2, 1].map((rating) => (_jsxs("label", { className: "flex items-center gap-3 cursor-pointer group p-2 -ml-2 rounded-lg hover:bg-blue-50 hover:text-blue-600 transition-colors", children: [_jsx("div", { className: `w-5 h-5 rounded-full border flex items-center justify-center transition-colors ${minRating === rating ? 'border-blue-600 bg-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, children: minRating === rating && _jsx("div", { className: "w-2.5 h-2.5 bg-white rounded-full" }) }), _jsx("input", { type: "radio", name: "rating", checked: minRating === rating, onChange: () => setMinRating(minRating === rating ? null : rating), className: "hidden" }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("div", { className: "flex text-yellow-400", children: Array.from({ length: 5 }).map((_, i) => (_jsx(Star, { className: `h-3.5 w-3.5 ${i < rating ? 'fill-current' : 'text-gray-200 fill-gray-200'}` }, i))) }), _jsx("span", { className: "text-sm text-gray-600", children: "& Up" })] })] }, rating))) })] })] }), _jsxs("div", { className: "lg:col-span-3", children: [_jsxs("div", { className: "lg:hidden mb-6 flex items-center justify-between", children: [_jsxs(Button, { onClick: () => setIsFilterOpen(true), variant: "outline", className: "flex items-center gap-2", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), " Filters"] }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-700 focus:outline-none", children: [_jsx("option", { value: "featured", children: "Sort by: Featured" }), _jsx("option", { value: "newest", children: "Sort by: Newest" }), _jsx("option", { value: "price-asc", children: "Sort by: Price Low-High" }), _jsx("option", { value: "price-desc", children: "Sort by: Price High-Low" })] })] }), _jsxs("div", { className: "hidden lg:flex items-center justify-between mb-6", children: [_jsxs("p", { className: "text-sm text-gray-600", children: ["Showing ", _jsx("span", { className: "font-semibold text-gray-900", children: filteredAndSortedProducts.length }), " products"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-gray-500", children: "Sort by:" }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-900 focus:outline-none cursor-pointer hover:text-blue-600 transition-colors", children: [_jsx("option", { value: "featured", children: "Featured" }), _jsx("option", { value: "newest", children: "Newest Arrivals" }), _jsx("option", { value: "price-asc", children: "Price: Low to High" }), _jsx("option", { value: "price-desc", children: "Price: High to Low" }), _jsx("option", { value: "rating", children: "Top Rated" })] })] })] }), isLoadingProducts || isFiltering ? (_jsx(ProductGridSkeleton, { count: 12, columns: 3 })) : displayedProducts.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: displayedProducts.map((product) => (_jsx(ProductCard, { product: product, storeSlug: storeConfig.slug, onAddToCart: handleAddToCart, onQuickView: handleQuickView }, product.id))) }), hasMore && (_jsx("div", { className: "mt-12 text-center", children: _jsx(Button, { onClick: () => setVisibleProducts(prev => prev + 12), variant: "outline", className: "min-w-[200px]", children: "Load More" }) }))] })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-20 bg-white rounded-lg border border-dashed border-gray-200 text-center", children: [_jsx("div", { className: "w-12 h-12 bg-gray-50 rounded-full flex items-center justify-center mb-4 text-gray-400", children: _jsx(Search, { className: "h-6 w-6" }) }), _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-1", children: "No products found" }), _jsx("p", { className: "text-sm text-gray-500 mb-6", children: "Try adjusting your filters or search criteria." }), _jsx(Button, { onClick: clearAllFilters, variant: "outline", children: "Clear All Filters" })] }))] })] })] }), _jsxs(Sheet, { isOpen: isFilterOpen, onClose: () => setIsFilterOpen(false), title: "Filters", side: "right", children: [_jsxs("div", { className: "flex flex-col h-full overflow-y-auto pb-20 space-y-8 p-1", children: [_jsxs("div", { className: "pb-6 border-b border-gray-100", children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Availability" }), _jsxs("label", { className: "flex items-center gap-3", children: [_jsx("input", { type: "checkbox", checked: showInStockOnly, onChange: () => setShowInStockOnly(!showInStockOnly), className: "rounded border-gray-300 text-black focus:ring-black" }), _jsx("span", { className: "text-sm text-gray-700", children: "In Stock Only" })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Price Range" }), _jsx("input", { type: "range", min: "0", max: sliderMax, step: "50", value: priceRange[1], onChange: (e) => setPriceRange([priceRange[0], parseInt(e.target.value)]), className: "w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-black mb-4" }), _jsxs("div", { className: "flex justify-between font-bold text-sm", children: [_jsx("span", { children: formatCurrency(0, storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 }) }), _jsxs("span", { children: [formatCurrency(priceRange[1], storeConfig.settings?.currency || 'USD', { minimumFractionDigits: 0, maximumFractionDigits: 0 }), "+"] })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Categories" }), _jsx(CategoryTree, { categories: categories, selectedCategoryIds: selectedCategories, onCategoryToggle: (categoryId, isSelected) => {
335
+ }, mode: "checkbox" })] }), _jsx(ProductPriceFilterSection, { currency: storeCurrency, priceRange: priceRange, onPriceRangeChange: setPriceRange, bounds: catalogBounds, isFilterActive: hasActivePriceFilter, onReset: resetPriceRange }), _jsxs("div", { children: [_jsx("h3", { className: "text-sm font-semibold text-gray-900 uppercase tracking-wide mb-4", children: "Rating" }), _jsx("div", { className: "space-y-2", children: [4, 3, 2, 1].map((rating) => (_jsxs("label", { className: "flex items-center gap-3 cursor-pointer group p-2 -ml-2 rounded-lg hover:bg-blue-50 hover:text-blue-600 transition-colors", children: [_jsx("div", { className: `w-5 h-5 rounded-full border flex items-center justify-center transition-colors ${minRating === rating ? 'border-blue-600 bg-blue-600' : 'border-gray-300 group-hover:border-blue-400'}`, children: minRating === rating && _jsx("div", { className: "w-2.5 h-2.5 bg-white rounded-full" }) }), _jsx("input", { type: "radio", name: "rating", checked: minRating === rating, onChange: () => setMinRating(minRating === rating ? null : rating), className: "hidden" }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("div", { className: "flex text-yellow-400", children: Array.from({ length: 5 }).map((_, i) => (_jsx(Star, { className: `h-3.5 w-3.5 ${i < rating ? 'fill-current' : 'text-gray-200 fill-gray-200'}` }, i))) }), _jsx("span", { className: "text-sm text-gray-600", children: "& Up" })] })] }, rating))) })] })] }), _jsxs("div", { className: "lg:col-span-3", children: [_jsxs("div", { className: "lg:hidden mb-6 flex items-center justify-between", children: [_jsxs(Button, { onClick: () => setIsFilterOpen(true), variant: "outline", className: "flex items-center gap-2", children: [_jsx(SlidersHorizontal, { className: "h-4 w-4" }), " Filters"] }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-700 focus:outline-none", children: [_jsx("option", { value: "featured", children: "Sort by: Featured" }), _jsx("option", { value: "newest", children: "Sort by: Newest" }), _jsx("option", { value: "price-asc", children: "Sort by: Price Low-High" }), _jsx("option", { value: "price-desc", children: "Sort by: Price High-Low" })] })] }), _jsxs("div", { className: "hidden lg:flex items-center justify-between mb-6", children: [_jsxs("p", { className: "text-sm text-gray-600", children: ["Showing ", _jsx("span", { className: "font-semibold text-gray-900", children: filteredAndSortedProducts.length }), " products"] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-gray-500", children: "Sort by:" }), _jsxs("select", { value: sortBy, onChange: (e) => setSortBy(e.target.value), className: "bg-transparent text-sm font-medium text-gray-900 focus:outline-none cursor-pointer hover:text-blue-600 transition-colors", children: [_jsx("option", { value: "featured", children: "Featured" }), _jsx("option", { value: "newest", children: "Newest Arrivals" }), _jsx("option", { value: "price-asc", children: "Price: Low to High" }), _jsx("option", { value: "price-desc", children: "Price: High to Low" }), _jsx("option", { value: "rating", children: "Top Rated" })] })] })] }), isLoadingProducts || isFiltering ? (_jsx(ProductGridSkeleton, { count: 12, columns: 3 })) : displayedProducts.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: displayedProducts.map((product) => (_jsx(ProductCard, { product: product, storeSlug: storeConfig.slug, onAddToCart: handleAddToCart, onQuickView: handleQuickView }, product.id))) }), hasMore && (_jsx("div", { className: "mt-12 text-center", children: _jsx(Button, { onClick: handleLoadMore, variant: "outline", className: "min-w-[200px]", children: "Load More" }) }))] })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-20 bg-white rounded-lg border border-dashed border-gray-200 text-center", children: [_jsx("div", { className: "w-12 h-12 bg-gray-50 rounded-full flex items-center justify-center mb-4 text-gray-400", children: _jsx(Search, { className: "h-6 w-6" }) }), _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-1", children: "No products found" }), _jsx("p", { className: "text-sm text-gray-500 mb-6", children: "Try adjusting your filters or search criteria." }), _jsx(Button, { onClick: clearAllFilters, variant: "outline", children: "Clear All Filters" })] }))] })] })] }), _jsxs(Sheet, { isOpen: isFilterOpen, onClose: () => setIsFilterOpen(false), title: "Filters", side: "right", children: [_jsxs("div", { className: "flex flex-col h-full overflow-y-auto pb-20 space-y-8 p-1", children: [_jsxs("div", { className: "pb-6 border-b border-gray-100", children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Availability" }), _jsxs("label", { className: "flex items-center gap-3", children: [_jsx("input", { type: "checkbox", checked: showInStockOnly, onChange: () => setShowInStockOnly(!showInStockOnly), className: "rounded border-gray-300 text-black focus:ring-black" }), _jsx("span", { className: "text-sm text-gray-700", children: "In Stock Only" })] })] }), _jsx(ProductPriceFilterSection, { currency: storeCurrency, priceRange: priceRange, onPriceRangeChange: setPriceRange, bounds: catalogBounds, isFilterActive: hasActivePriceFilter, onReset: resetPriceRange }), _jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Categories" }), _jsx(CategoryTree, { categories: categories, selectedCategoryIds: selectedCategories, onCategoryToggle: (categoryId, isSelected) => {
267
336
  setSelectedCategories(prev => isSelected
268
337
  ? [...prev, categoryId]
269
338
  : prev.filter(id => id !== categoryId));
270
339
  }, mode: "checkbox" })] }), _jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Brand" }), brands.length > 0 ? (_jsx("div", { className: "space-y-3", children: brands.map(brand => (_jsxs("label", { className: "flex items-center gap-3", children: [_jsx("input", { type: "checkbox", checked: selectedBrands.includes(brand), onChange: () => setSelectedBrands(prev => prev.includes(brand) ? prev.filter(b => b !== brand) : [...prev, brand]), className: "rounded border-gray-300 text-black focus:ring-black" }), _jsx("span", { className: "text-sm text-gray-700", children: brand })] }, brand))) })) : (_jsx("p", { className: "text-xs text-gray-500 italic", children: "No brands available" }))] }), _jsxs("div", { children: [_jsx("h3", { className: "font-bold text-sm uppercase tracking-widest mb-4", children: "Rating" }), _jsx("div", { className: "space-y-3", children: [4, 3, 2, 1].map(rating => (_jsxs("label", { className: "flex items-center gap-3", children: [_jsx("input", { type: "radio", name: "mobile-rating", checked: minRating === rating, onChange: () => setMinRating(minRating === rating ? null : rating), className: "rounded-full border-gray-300 text-black focus:ring-black" }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx("div", { className: "flex text-yellow-400", children: Array.from({ length: 5 }).map((_, i) => (_jsx(Star, { className: `h-3 w-3 ${i < rating ? 'fill-current' : 'text-gray-200 fill-gray-200'}` }, i))) }), _jsx("span", { className: "text-sm text-gray-600", children: "& Up" })] })] }, rating))) })] })] }), _jsxs("div", { className: "absolute bottom-0 left-0 right-0 p-4 bg-white border-t border-gray-100 flex gap-3", children: [_jsx(Button, { onClick: clearAllFilters, variant: "outline", className: "flex-1 h-12 font-bold rounded-lg border-gray-300", children: "Reset" }), _jsx(Button, { onClick: () => setIsFilterOpen(false), className: "flex-[2] bg-black text-white hover:bg-blue-600 h-12 font-bold rounded-lg transition-colors", children: "View Results" })] })] })] }));
271
340
  }
272
- export function ClothingMinimalProductsPage(props) {
341
+ export function ProductsPage(props) {
273
342
  return (_jsx(Suspense, { fallback: _jsx("div", { className: "min-h-screen flex items-center justify-center", children: _jsx("div", { className: "w-8 h-8 border-2 border-black border-t-transparent rounded-full animate-spin" }) }), children: _jsx(ProductsPageContent, { ...props }) }));
274
343
  }
@@ -1,14 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Zap, Smartphone, Laptop, Headphones, Watch, Camera } from 'lucide-react';
4
- import { Breadcrumbs } from '../../../components/ui/breadcrumbs.js';
5
- import { useStore } from '../../../lib/store-context.js';
6
- import { useCatalogLoader } from '../../../hooks/use-catalog-loader.js';
7
- import { isEditorPreviewMode, resolveStoreCategoriesForDisplay } from '../../../lib/utils/index.js';
8
- import { ElectronicsStoreHeader } from './ElectronicsStoreHeader.js';
9
- import { ElectronicsStoreFooter } from './ElectronicsStoreFooter.js';
4
+ import { Breadcrumbs } from '../../../components/ui/breadcrumbs';
5
+ import { useStore } from '../../../lib/store-context';
6
+ import { useCatalogLoader } from '../../../hooks/use-catalog-loader';
7
+ import { isEditorPreviewMode, resolveStoreCategoriesForDisplay } from '../../../lib/utils';
8
+ import { ElectronicsStoreHeader } from './ElectronicsStoreHeader';
9
+ import { ElectronicsStoreFooter } from './ElectronicsStoreFooter';
10
10
  import { motion } from 'framer-motion';
11
- import { CategoryMasonryGrid } from '../../../components/categories/category-masonry-grid.js';
11
+ import { CategoryMasonryGrid } from '../../../components/categories/category-masonry-grid';
12
12
  function getCategoryIcon(slug) {
13
13
  if (slug.includes('phone'))
14
14
  return _jsx(Smartphone, { className: "h-6 w-6" });
@@ -1,19 +1,19 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
4
- import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
5
- import { ProductRating } from '../../../components/ui/product-rating.js';
3
+ import { Button } from '../../../components/ui/button';
4
+ import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
5
+ import { ProductRating } from '../../../components/ui/product-rating';
6
6
  import { Heart, Plus } from 'lucide-react';
7
7
  import Link from 'next/link';
8
8
  import { motion } from 'framer-motion';
9
9
  import { useState } from 'react';
10
- import { useStore } from '../../../lib/store-context.js';
11
- import { useToast } from '../../../components/ui/toast.js';
12
- import { ButtonLoader } from '../../../components/ui/page-loader.js';
13
- import { useLoading } from '../../../lib/loading-context.js';
14
- import { cn, formatCurrency } from '../../../lib/utils/index.js';
15
- import { OutOfStockOverlay } from '../../../components/ui/out-of-stock-overlay.js';
16
- import { trackStorefrontEvent } from '../../../lib/mixpanel.js';
10
+ import { useStore } from '../../../lib/store-context';
11
+ import { useToast } from '../../../components/ui/toast';
12
+ import { ButtonLoader } from '../../../components/ui/page-loader';
13
+ import { useLoading } from '../../../lib/loading-context';
14
+ import { cn, formatCurrency } from '../../../lib/utils';
15
+ import { OutOfStockOverlay } from '../../../components/ui/out-of-stock-overlay';
16
+ import { trackStorefrontEvent } from '../../../lib/mixpanel';
17
17
  export function ElectronicsGridProductCard({ product, storeSlug, onAddToCart, index }) {
18
18
  const [isHovered, setIsHovered] = useState(false);
19
19
  const { toggleWishlist, isInWishlist, isWishlistLoading, store } = useStore();
@@ -1 +1 @@
1
- {"version":3,"file":"ElectronicsHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsHomePage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAoB9D,UAAU,wBAAwB;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,wBAAwB,2CAmb3F"}
1
+ {"version":3,"file":"ElectronicsHomePage.d.ts","sourceRoot":"","sources":["../../../../src/layouts/electronics/components/ElectronicsHomePage.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAe9D,UAAU,wBAAwB;IAC/B,WAAW,EAAE,WAAW,CAAC;CAC3B;AAED,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,wBAAwB,2CA8c3F"}
@@ -1,29 +1,26 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Button } from '../../../components/ui/button.js';
4
- import { ImageWithFallback } from '../../../components/ui/image-with-fallback.js';
5
- import { ArrowRight, ShoppingCart, Zap, Smartphone, Laptop, Headphones, Watch, Camera, Battery, Wifi } from 'lucide-react';
6
- import { DynamicIcon } from '../../../components/ui/dynamic-icon.js';
3
+ import { useFeaturedProducts } from '../../../hooks/use-featured-products';
4
+ import { Button } from '../../../components/ui/button';
5
+ import { ImageWithFallback } from '../../../components/ui/image-with-fallback';
6
+ import { ArrowRight, ShoppingCart, Zap, Shield, Smartphone, Laptop, Headphones, Watch, Camera, Cpu, Battery, Wifi } from 'lucide-react';
7
7
  import Link from 'next/link';
8
- import { ElectronicsStoreHeader } from './ElectronicsStoreHeader.js';
9
- import { ElectronicsStoreFooter } from './ElectronicsStoreFooter.js';
8
+ import { ElectronicsStoreHeader } from './ElectronicsStoreHeader';
9
+ import { ElectronicsStoreFooter } from './ElectronicsStoreFooter';
10
10
  import { motion, useScroll, useTransform } from 'framer-motion';
11
- import { useRef } from 'react';
12
- import { useStore } from '../../../lib/store-context.js';
13
- import { useToast } from '../../../components/ui/toast.js';
14
- import { formatCurrency, filterActiveProducts } from '../../../lib/utils/index.js';
15
- import { getLayoutText } from '../../../lib/utils/asset-helpers.js';
16
- import { PromoBanner } from '../../shared/components/PromoBanner.js';
17
- import { getPayazaSectionInlineStyle } from '../../../lib/payaza-section-styles.js';
18
- import { showLayoutDecorativeBadges } from '../../../lib/layout-badges.js';
19
- import { CategoryMasonryGrid } from '../../../components/categories/category-masonry-grid.js';
20
- import { trackStorefrontEvent } from '../../../lib/mixpanel.js';
11
+ import { useRef, useState } from 'react';
12
+ import { useStore } from '../../../lib/store-context';
13
+ import { useToast } from '../../../components/ui/toast';
14
+ import { formatCurrency, filterActiveProducts } from '../../../lib/utils';
15
+ import { getLayoutText } from '../../../lib/utils/asset-helpers';
16
+ import { PromoBanner } from '../../shared/components/PromoBanner';
21
17
  export function ElectronicsHomePage({ storeConfig: initialConfig }) {
22
18
  const { store, addToCart } = useStore();
23
19
  const storeConfig = store || initialConfig;
24
20
  const MotionDiv = motion.div;
25
21
  const { addToast } = useToast();
26
22
  const scrollContainerRef = useRef(null);
23
+ const [email, setEmail] = useState('');
27
24
  // Layout Visibility
28
25
  const layout = storeConfig.layoutConfig;
29
26
  const scrollLeft = () => {
@@ -42,6 +39,12 @@ export function ElectronicsHomePage({ storeConfig: initialConfig }) {
42
39
  addToCart(product);
43
40
  addToast(`${product.name} added to cart`, 'success');
44
41
  };
42
+ const handleSubscribe = () => {
43
+ if (email) {
44
+ addToast('Thank you for subscribing!', 'success');
45
+ setEmail('');
46
+ }
47
+ };
45
48
  // In preview mode, use mock data if none are available
46
49
  const isPreview = (typeof window !== 'undefined' && window.__IS_PREVIEW__) || storeConfig.layoutConfig?.isPreview;
47
50
  const categories = (storeConfig.categories && storeConfig.categories.length > 0)
@@ -52,7 +55,8 @@ export function ElectronicsHomePage({ storeConfig: initialConfig }) {
52
55
  { id: 'cat3', name: 'Audio', slug: 'audio', image: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?q=80&w=800' },
53
56
  { id: 'cat4', name: 'Wearables', slug: 'wearables', image: 'https://images.unsplash.com/photo-1523275335684-37898b6baf30?q=80&w=800' }
54
57
  ] : []);
55
- const rawProducts = storeConfig.products || [];
58
+ const initialProducts = storeConfig.products || [];
59
+ const rawProducts = useFeaturedProducts(storeConfig.id, initialProducts, !isPreview);
56
60
  const activeProducts = filterActiveProducts(rawProducts);
57
61
  // Use real active products if available, otherwise if in preview, use all products (including drafts),
58
62
  // and if still none, use mock data
@@ -87,18 +91,12 @@ export function ElectronicsHomePage({ storeConfig: initialConfig }) {
87
91
  return _jsx(Camera, { className: "h-6 w-6" });
88
92
  return _jsx(Zap, { className: "h-6 w-6" });
89
93
  };
90
- return (_jsxs("div", { className: "min-h-screen bg-slate-50 text-slate-900 font-sans selection:bg-blue-600 selection:text-white", children: [_jsx(ElectronicsStoreHeader, { storeConfig: storeConfig }), (layout?.sections?.hero?.show ?? layout?.hero?.show) !== false && (_jsxs("section", { "data-section": "hero", "data-payaza-section-key": "hero", "data-payaza-page": "home", ref: targetRef, className: "relative min-h-screen flex items-center pt-20 overflow-hidden bg-slate-950", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'hero'), children: [_jsxs("div", { className: "absolute inset-0 overflow-hidden pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[600px] h-[600px] bg-blue-600/20 rounded-full blur-[120px]" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-5%] w-[500px] h-[500px] bg-indigo-600/20 rounded-full blur-[100px]" }), _jsx("div", { className: "absolute top-[20%] left-[20%] w-[300px] h-[300px] bg-cyan-500/10 rounded-full blur-[80px]" })] }), _jsx("div", { className: "container mx-auto px-6 relative z-10 py-20", children: _jsxs("div", { className: "grid lg:grid-cols-2 gap-16 items-center", children: [_jsxs(MotionDiv, { style: { opacity, scale }, className: "space-y-8 relative z-20", children: [showLayoutDecorativeBadges() && (layout?.sections?.hero?.showBadges ?? layout?.hero?.showBadges) === true && (_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-slate-900/50 border border-slate-800 text-blue-400 text-xs font-bold uppercase tracking-wider backdrop-blur-md", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-blue-500 animate-pulse" }), layout?.sections?.hero?.badge || getLayoutText(storeConfig, 'electronics.newArrivals', 'Next Gen • 2025 Series')] })), _jsxs("h1", { className: "text-4xl sm:text-6xl md:text-7xl lg:text-8xl font-black tracking-tighter leading-[0.9] text-white", children: [layout?.sections?.hero?.title || getLayoutText(storeConfig, 'hero.title', 'Future Realized'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-indigo-400 to-cyan-400", children: "Realized." })] }), _jsx("div", { className: "lg:hidden w-full max-w-[300px] mx-auto py-8", children: _jsx("div", { className: "relative aspect-square bg-gradient-to-br from-slate-800/50 to-slate-900/50 rounded-3xl p-6 border border-slate-700/30", children: _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-full object-contain drop-shadow-2xl", skeletonAspectRatio: "square" }) }) }), _jsx("p", { className: "text-lg text-slate-400 max-w-xl leading-relaxed font-medium", children: layout?.sections?.hero?.subtitle || `${storeConfig.description} Experience the pinnacle of engineering with our curated collection of premium electronics.` }), _jsxs("div", { className: "flex flex-wrap items-center gap-4 pt-4", children: [(layout?.sections?.hero?.showCTA ?? layout?.hero?.showCTA) !== false && (_jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsxs(Button, { className: "h-14 px-10 rounded-full bg-blue-600 hover:bg-blue-500 text-white font-bold text-lg transition-all hover:scale-105 shadow-[0_0_40px_-10px_rgba(59,130,246,0.5)] border-0 ring-0", children: [layout?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-5 w-5" })] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsxs("div", { className: "flex items-center gap-4 text-slate-400 text-sm font-medium ml-4", children: [_jsx("div", { className: "flex -space-x-3", children: [1, 2, 3].map(i => (_jsx("div", { className: "w-10 h-10 rounded-full border-2 border-slate-950 bg-slate-800 flex items-center justify-center text-xs text-white", children: _jsx("span", { className: "sr-only", children: "User" }) }, i))) }), _jsxs("div", { children: [_jsx("p", { className: "text-white font-bold", children: getLayoutText(storeConfig, 'common.account', '10k+ Happy') }), _jsx("p", { children: getLayoutText(storeConfig, 'common.account', 'Customers') })] })] }))] })] }), _jsx("div", { className: "relative h-[600px] hidden lg:block perspective-1000", children: _jsxs(MotionDiv, { initial: { opacity: 0, x: 100, rotateY: -20 }, animate: { opacity: 1, x: 0, rotateY: 0 }, transition: { duration: 1, ease: "easeOut" }, className: "relative z-10 w-full h-full", children: [_jsxs("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] h-[500px] bg-gradient-to-br from-slate-800/80 to-slate-900/80 backdrop-blur-xl rounded-[3rem] border border-slate-700/50 p-8 shadow-2xl shadow-blue-900/20 transform rotate-[-6deg] hover:rotate-0 transition-transform duration-700", children: [_jsx("div", { className: "absolute top-8 right-8", children: _jsx(Zap, { className: "text-blue-500 w-8 h-8" }) }), _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-3/4 object-contain drop-shadow-[0_20px_50px_rgba(0,0,0,0.5)]", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute bottom-8 left-8 right-8", children: _jsxs("div", { className: "flex justify-between items-end", children: [_jsxs("div", { children: [_jsx("p", { className: "text-blue-400 font-bold text-sm mb-1", children: "New Arrival" }), _jsx("h3", { className: "text-white text-2xl font-bold", children: products[0]?.name })] }), _jsx("div", { className: "text-right", children: _jsx("p", { className: "text-white text-2xl font-bold", children: formatCurrency(products[0]?.price || 0, products[0]?.currency || storeConfig?.settings?.currency || 'USD') }) })] }) })] }), _jsx(MotionDiv, { animate: { y: [0, -20, 0] }, transition: { repeat: Infinity, duration: 6, ease: "easeInOut" }, className: "absolute top-20 right-10 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-green-500/20 p-2 rounded-lg", children: _jsx(Battery, { className: "text-green-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Battery Life" }), _jsx("p", { className: "text-sm font-bold text-white", children: "24 Hours" })] })] }) }), _jsx(MotionDiv, { animate: { y: [0, 20, 0] }, transition: { repeat: Infinity, duration: 5, ease: "easeInOut", delay: 1 }, className: "absolute bottom-40 left-0 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-blue-500/20 p-2 rounded-lg", children: _jsx(Wifi, { className: "text-blue-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Connectivity" }), _jsx("p", { className: "text-sm font-bold text-white", children: "5G Ultra" })] })] }) })] }) })] }) })] })), layout?.sections?.brands?.show !== false && (_jsx("div", { "data-section": "brands", "data-payaza-section-key": "brands", "data-payaza-page": "home", className: "bg-slate-950 border-y border-slate-900 overflow-hidden py-10", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'brands'), children: _jsx("div", { className: "flex gap-16 items-center animate-scroll whitespace-nowrap opacity-50 hover:opacity-100 transition-opacity duration-300", children: [...Array(2)].map((_, i) => (_jsx("div", { className: "flex gap-16 items-center", children: ['SONY', 'SAMSUNG', 'APPLE', 'DELL', 'LG', 'ASUS', 'HP', 'BOSE', 'CANON', 'NIKON'].map((brand) => (_jsx("span", { className: "text-3xl font-black text-slate-800 tracking-tight hover:text-slate-600 transition-colors cursor-default select-none", children: brand }, brand))) }, i))) }) })), layout?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", "data-payaza-section-key": "categories", "data-payaza-page": "home", className: "py-16 md:py-32 bg-slate-50", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'categories'), children: _jsxs("div", { className: "container mx-auto px-6", children: [_jsxs("div", { className: "flex justify-between items-end mb-10 md:mb-16", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-4xl font-bold mb-4 text-slate-900 tracking-tight", children: layout?.sections?.categories?.title || (isPreview ? 'Ecosystems' : '') }), _jsx("p", { className: "text-lg text-slate-500", children: layout?.sections?.categories?.subtitle || (isPreview ? 'Curated collections for every aspect of your digital life.' : '') })] }), layout?.sections?.categories?.showViewAll !== false && (_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "flex items-center gap-2 text-blue-600 font-bold hover:gap-3 transition-all", children: ["View All ", _jsx(ArrowRight, { className: "h-5 w-5" })] }))] }), categories.length === 0 ? (_jsxs("div", { className: "text-center py-20 bg-white rounded-2xl border border-slate-200", children: [_jsx("h3", { className: "text-xl font-semibold text-slate-900 mb-2", children: "No categories available" }), _jsx("p", { className: "text-slate-500", children: "Categories will appear here once they are added to the store." })] })) : (_jsx(CategoryMasonryGrid, { categories: categories, mode: "compact", columns: 4, limit: layout?.sections?.categories?.limit || 5, showDescriptions: false, getHref: (category) => `/${storeConfig.slug}/categories/${category.slug}`, exploreLabel: "View Products", variant: "electronics", renderCardOverlay: (category) => (_jsx("div", { className: "mb-3 text-white/80 group-hover:text-blue-400 transition-colors", children: getCategoryIcon(category.slug) })) }))] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsx("section", { "data-section": "featuredProducts", "data-payaza-section-key": "featuredProducts", "data-payaza-page": "home", className: "py-16 md:py-32 bg-white relative overflow-hidden", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'featuredProducts'), children: _jsxs("div", { className: "container mx-auto px-6 relative z-10", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-end mb-8 md:mb-12 gap-6", children: [_jsxs("div", { className: "max-w-2xl", children: [_jsx("span", { className: "text-blue-600 font-bold tracking-widest text-xs uppercase mb-3 block", children: "Latest Drops" }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold text-slate-900 tracking-tight", children: layout?.sections?.featuredProducts?.title || "Performance Redefined" })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "outline", size: "icon", onClick: scrollLeft, className: "rounded-full border-slate-200 hover:bg-slate-100 hover:text-slate-900", children: _jsx(ArrowRight, { className: "h-5 w-5 rotate-180" }) }), _jsx(Button, { variant: "outline", size: "icon", onClick: scrollRight, className: "rounded-full border-slate-200 hover:bg-slate-100 hover:text-slate-900", children: _jsx(ArrowRight, { className: "h-5 w-5" }) })] })] }), _jsx("div", { ref: scrollContainerRef, className: "flex overflow-x-auto snap-x snap-mandatory gap-8 pb-12 -mx-6 px-6 scrollbar-hide", children: products.map((product) => (_jsxs("div", { className: "min-w-[280px] md:min-w-[320px] snap-center group", children: [_jsxs("div", { className: "relative aspect-[4/5] bg-slate-50 rounded-[2.5rem] overflow-hidden mb-6 border border-slate-100", children: [_jsx("div", { className: "absolute top-4 left-4 z-20", children: product.compareAtPrice && (_jsx("span", { className: "bg-slate-900 text-white text-[10px] font-bold px-3 py-1.5 rounded-full", children: "SALE" })) }), layout?.sections?.featuredProducts?.showAddToCart !== false && (_jsx("div", { className: "absolute top-4 right-4 z-20 opacity-0 group-hover:opacity-100 transition-opacity", children: _jsx(Button, { size: "icon", onClick: (e) => handleAddToCart(e, product), className: "rounded-full bg-white text-slate-900 hover:bg-blue-600 hover:text-white shadow-lg", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) }) })), _jsx("div", { className: "absolute inset-0 flex items-center justify-center p-8 bg-gradient-to-br from-white to-slate-50", children: _jsx(ImageWithFallback, { src: product.images?.[0], alt: product.name, className: "w-full h-full object-contain group-hover:scale-110 transition-transform duration-500", skeletonAspectRatio: "square" }) })] }), _jsxs("div", { className: "space-y-1 px-2", children: [_jsx("h3", { className: "font-bold text-lg text-slate-900 truncate group-hover:text-blue-600 transition-colors", children: product.name }), _jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-slate-900 font-bold", children: formatCurrency(product.price, product.currency || 'USD') }), product.compareAtPrice && _jsx("span", { className: "text-slate-400 text-sm line-through", children: formatCurrency(product.compareAtPrice, product.currency || 'USD') })] })] }), _jsx(Link, { href: `/${storeConfig.slug}/products/${product.slug}`, className: "absolute inset-0 z-10", onClick: () => trackStorefrontEvent('Product_clicked', {
91
- storeId: storeConfig.id,
92
- storeSlug: storeConfig.slug,
93
- productId: product.id,
94
- productName: product.name,
95
- categoryId: product.categoryId,
96
- price: product.price,
97
- }) })] }, product.id))) })] }) })), layout?.features?.show !== false && (_jsxs("section", { "data-section": "features", "data-payaza-section-key": "features", "data-payaza-page": "home", className: "py-16 md:py-32 bg-slate-950 text-white relative overflow-hidden", style: getPayazaSectionInlineStyle(storeConfig, 'home', 'features'), children: [_jsx("div", { className: "absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:64px_64px] [mask-image:radial-gradient(ellipse_60%_60%_at_50%_50%,#000_70%,transparent_100%)]" }), _jsx("div", { className: "container mx-auto px-6 relative z-10", children: _jsx("div", { className: "grid md:grid-cols-3 gap-8 md:gap-12", children: (layout?.sections?.features?.items?.length
98
- ? layout.sections.features.items
99
- : (isPreview ? [
100
- { icon: 'Cpu', title: "Neural Processing", description: "Advanced AI capabilities built into every device for smarter performance." },
101
- { icon: 'Shield', title: "Military Grade", description: "Tested against rigorous standards to ensure durability in any environment." },
102
- { icon: 'Zap', title: "Hyper Charge", description: "Next-generation battery technology for all-day power in minutes." }
103
- ] : [])).map((feature, i) => (_jsxs("div", { className: "bg-slate-900/50 backdrop-blur-sm border border-slate-800 p-8 rounded-[2rem] hover:bg-slate-800/50 transition-colors", children: [_jsx("div", { className: "w-14 h-14 rounded-2xl bg-blue-600/20 flex items-center justify-center mb-6 text-blue-400", children: layout?.features?.showIcons !== false && (_jsx(DynamicIcon, { name: feature.icon || 'Cpu', className: "h-7 w-7" })) }), _jsx("h3", { className: "text-xl font-bold mb-3", children: feature.title }), _jsx("p", { className: "text-slate-400 leading-relaxed", children: feature.description || feature.desc })] }, i))) }) })] })), _jsx(PromoBanner, { config: layout?.sections?.promoBanner, storeSlug: storeConfig.slug, layoutStyle: "electronics" }), _jsx(ElectronicsStoreFooter, { storeConfig: storeConfig })] }));
94
+ return (_jsxs("div", { className: "min-h-screen bg-slate-50 text-slate-900 font-sans selection:bg-blue-600 selection:text-white", children: [_jsx(ElectronicsStoreHeader, { storeConfig: storeConfig }), layout?.hero?.show !== false && (_jsxs("section", { "data-section": "hero", ref: targetRef, className: "relative min-h-screen flex items-center pt-20 overflow-hidden bg-slate-950", children: [_jsxs("div", { className: "absolute inset-0 overflow-hidden pointer-events-none", children: [_jsx("div", { className: "absolute top-[-10%] right-[-5%] w-[600px] h-[600px] bg-blue-600/20 rounded-full blur-[120px]" }), _jsx("div", { className: "absolute bottom-[-10%] left-[-5%] w-[500px] h-[500px] bg-indigo-600/20 rounded-full blur-[100px]" }), _jsx("div", { className: "absolute top-[20%] left-[20%] w-[300px] h-[300px] bg-cyan-500/10 rounded-full blur-[80px]" })] }), _jsx("div", { className: "container mx-auto px-6 relative z-10 py-20", children: _jsxs("div", { className: "grid lg:grid-cols-2 gap-16 items-center", children: [_jsxs(MotionDiv, { style: { opacity, scale }, className: "space-y-8 relative z-20", children: [layout?.hero?.showBadges !== false && (_jsxs("div", { className: "inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-slate-900/50 border border-slate-800 text-blue-400 text-xs font-bold uppercase tracking-wider backdrop-blur-md", children: [_jsx("span", { className: "w-2 h-2 rounded-full bg-blue-500 animate-pulse" }), layout?.sections?.hero?.badge || getLayoutText(storeConfig, 'electronics.newArrivals', 'Next Gen • 2025 Series')] })), _jsxs("h1", { className: "text-4xl sm:text-6xl md:text-7xl lg:text-8xl font-black tracking-tighter leading-[0.9] text-white", children: [layout?.sections?.hero?.title || getLayoutText(storeConfig, 'hero.title', 'Future Realized'), " ", _jsx("br", {}), _jsx("span", { className: "text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-indigo-400 to-cyan-400", children: "Realized." })] }), _jsx("div", { className: "lg:hidden w-full max-w-[300px] mx-auto py-8", children: _jsx("div", { className: "relative aspect-square bg-gradient-to-br from-slate-800/50 to-slate-900/50 rounded-3xl p-6 border border-slate-700/30", children: _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-full object-contain drop-shadow-2xl", skeletonAspectRatio: "square" }) }) }), _jsx("p", { className: "text-lg text-slate-400 max-w-xl leading-relaxed font-medium", children: layout?.sections?.hero?.subtitle || `${storeConfig.description} Experience the pinnacle of engineering with our curated collection of premium electronics.` }), _jsxs("div", { className: "flex flex-wrap items-center gap-4 pt-4", children: [layout?.hero?.showCTA !== false && (_jsx(Link, { href: `/${storeConfig.slug}/products`, children: _jsxs(Button, { className: "h-14 px-10 rounded-full bg-blue-600 hover:bg-blue-500 text-white font-bold text-lg transition-all hover:scale-105 shadow-[0_0_40px_-10px_rgba(59,130,246,0.5)] border-0 ring-0", children: [layout?.sections?.hero?.primaryCTA || getLayoutText(storeConfig, 'common.shopNow', 'Shop Now'), " ", _jsx(ArrowRight, { className: "ml-2 h-5 w-5" })] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsxs("div", { className: "flex items-center gap-4 text-slate-400 text-sm font-medium ml-4", children: [_jsx("div", { className: "flex -space-x-3", children: [1, 2, 3].map(i => (_jsx("div", { className: "w-10 h-10 rounded-full border-2 border-slate-950 bg-slate-800 flex items-center justify-center text-xs text-white", children: _jsx("span", { className: "sr-only", children: "User" }) }, i))) }), _jsxs("div", { children: [_jsx("p", { className: "text-white font-bold", children: getLayoutText(storeConfig, 'common.account', '10k+ Happy') }), _jsx("p", { children: getLayoutText(storeConfig, 'common.account', 'Customers') })] })] }))] })] }), _jsx("div", { className: "relative h-[600px] hidden lg:block perspective-1000", children: _jsxs(MotionDiv, { initial: { opacity: 0, x: 100, rotateY: -20 }, animate: { opacity: 1, x: 0, rotateY: 0 }, transition: { duration: 1, ease: "easeOut" }, className: "relative z-10 w-full h-full", children: [_jsxs("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] h-[500px] bg-gradient-to-br from-slate-800/80 to-slate-900/80 backdrop-blur-xl rounded-[3rem] border border-slate-700/50 p-8 shadow-2xl shadow-blue-900/20 transform rotate-[-6deg] hover:rotate-0 transition-transform duration-700", children: [_jsx("div", { className: "absolute top-8 right-8", children: _jsx(Zap, { className: "text-blue-500 w-8 h-8" }) }), _jsx(ImageWithFallback, { src: products[0]?.images?.[0], alt: "Hero Product", className: "w-full h-3/4 object-contain drop-shadow-[0_20px_50px_rgba(0,0,0,0.5)]", skeletonAspectRatio: "square" }), _jsx("div", { className: "absolute bottom-8 left-8 right-8", children: _jsxs("div", { className: "flex justify-between items-end", children: [_jsxs("div", { children: [_jsx("p", { className: "text-blue-400 font-bold text-sm mb-1", children: "New Arrival" }), _jsx("h3", { className: "text-white text-2xl font-bold", children: products[0]?.name })] }), _jsx("div", { className: "text-right", children: _jsx("p", { className: "text-white text-2xl font-bold", children: formatCurrency(products[0]?.price || 0, products[0]?.currency || storeConfig?.settings?.currency || 'USD') }) })] }) })] }), _jsx(MotionDiv, { animate: { y: [0, -20, 0] }, transition: { repeat: Infinity, duration: 6, ease: "easeInOut" }, className: "absolute top-20 right-10 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-green-500/20 p-2 rounded-lg", children: _jsx(Battery, { className: "text-green-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Battery Life" }), _jsx("p", { className: "text-sm font-bold text-white", children: "24 Hours" })] })] }) }), _jsx(MotionDiv, { animate: { y: [0, 20, 0] }, transition: { repeat: Infinity, duration: 5, ease: "easeInOut", delay: 1 }, className: "absolute bottom-40 left-0 bg-white/10 backdrop-blur-md p-4 rounded-2xl border border-white/10", children: _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "bg-blue-500/20 p-2 rounded-lg", children: _jsx(Wifi, { className: "text-blue-400 w-5 h-5" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-xs text-slate-400", children: "Connectivity" }), _jsx("p", { className: "text-sm font-bold text-white", children: "5G Ultra" })] })] }) })] }) })] }) })] })), layout?.sections?.brands?.show !== false && (_jsx("div", { "data-section": "brands", className: "bg-slate-950 border-y border-slate-900 overflow-hidden py-10", children: _jsx("div", { className: "flex gap-16 items-center animate-scroll whitespace-nowrap opacity-50 hover:opacity-100 transition-opacity duration-300", children: [...Array(2)].map((_, i) => (_jsx("div", { className: "flex gap-16 items-center", children: ['SONY', 'SAMSUNG', 'APPLE', 'DELL', 'LG', 'ASUS', 'HP', 'BOSE', 'CANON', 'NIKON'].map((brand) => (_jsx("span", { className: "text-3xl font-black text-slate-800 tracking-tight hover:text-slate-600 transition-colors cursor-default select-none", children: brand }, brand))) }, i))) }) })), layout?.sections?.categories?.show !== false && (_jsx("section", { "data-section": "categories", className: "py-16 md:py-32 bg-slate-50", children: _jsxs("div", { className: "container mx-auto px-6", children: [_jsxs("div", { className: "flex justify-between items-end mb-10 md:mb-16", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-4xl font-bold mb-4 text-slate-900 tracking-tight", children: "Ecosystems" }), _jsx("p", { className: "text-lg text-slate-500", children: "Curated collections for every aspect of your digital life." })] }), layout?.sections?.categories?.showViewAll !== false && (_jsxs(Link, { href: `/${storeConfig.slug}/categories`, className: "flex items-center gap-2 text-blue-600 font-bold hover:gap-3 transition-all", children: ["View All ", _jsx(ArrowRight, { className: "h-5 w-5" })] }))] }), categories.length === 0 ? (_jsxs("div", { className: "text-center py-20 bg-white rounded-2xl border border-slate-200", children: [_jsx("h3", { className: "text-xl font-semibold text-slate-900 mb-2", children: "No categories available" }), _jsx("p", { className: "text-slate-500", children: "Categories will appear here once they are added to the store." })] })) : (_jsx("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-6 auto-rows-[300px]", children: categories.slice(0, layout?.sections?.categories?.limit || 5).map((category, idx) => {
95
+ const isLarge = idx === 0 || idx === 3;
96
+ return (_jsxs(Link, { href: `/${storeConfig.slug}/categories/${category.slug}`, className: `group relative overflow-hidden rounded-[2.5rem] bg-white shadow-sm border border-slate-100 hover:shadow-2xl hover:shadow-blue-500/10 transition-all duration-500 ${isLarge ? 'md:col-span-2' : 'md:col-span-1'}`, children: [_jsx(ImageWithFallback, { src: category.image, alt: category.name, className: "absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-105", skeletonAspectRatio: "auto" }), _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-slate-950/80 via-slate-950/20 to-transparent opacity-80 group-hover:opacity-90 transition-opacity" }), _jsxs("div", { className: "absolute bottom-0 left-0 p-8 w-full", children: [_jsx("div", { className: "mb-3 text-white/80 group-hover:text-blue-400 transition-colors", children: getCategoryIcon(category.slug) }), _jsx("h3", { className: `font-bold text-white mb-2 ${isLarge ? 'text-3xl' : 'text-xl'}`, children: category.name }), _jsx("div", { className: "w-10 h-1 bg-blue-500 rounded-full transform scale-x-0 group-hover:scale-x-100 transition-transform origin-left duration-300" })] })] }, idx));
97
+ }) }))] }) })), layout?.sections?.featuredProducts?.show !== false && (_jsx("section", { "data-section": "featuredProducts", className: "py-16 md:py-32 bg-white relative overflow-hidden", children: _jsxs("div", { className: "container mx-auto px-6 relative z-10", children: [_jsxs("div", { className: "flex flex-col md:flex-row justify-between items-end mb-8 md:mb-12 gap-6", children: [_jsxs("div", { className: "max-w-2xl", children: [_jsx("span", { className: "text-blue-600 font-bold tracking-widest text-xs uppercase mb-3 block", children: "Latest Drops" }), _jsx("h2", { className: "text-4xl md:text-5xl font-bold text-slate-900 tracking-tight", children: layout?.sections?.featuredProducts?.title || "Performance Redefined" })] }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { variant: "outline", size: "icon", onClick: scrollLeft, className: "rounded-full border-slate-200 hover:bg-slate-100 hover:text-slate-900", children: _jsx(ArrowRight, { className: "h-5 w-5 rotate-180" }) }), _jsx(Button, { variant: "outline", size: "icon", onClick: scrollRight, className: "rounded-full border-slate-200 hover:bg-slate-100 hover:text-slate-900", children: _jsx(ArrowRight, { className: "h-5 w-5" }) })] })] }), _jsx("div", { ref: scrollContainerRef, className: "flex overflow-x-auto snap-x snap-mandatory gap-8 pb-12 -mx-6 px-6 scrollbar-hide", children: products.map((product) => (_jsxs("div", { className: "min-w-[280px] md:min-w-[320px] snap-center group", children: [_jsxs("div", { className: "relative aspect-[4/5] bg-slate-50 rounded-[2.5rem] overflow-hidden mb-6 border border-slate-100", children: [_jsx("div", { className: "absolute top-4 left-4 z-20", children: product.compareAtPrice && (_jsx("span", { className: "bg-slate-900 text-white text-[10px] font-bold px-3 py-1.5 rounded-full", children: "SALE" })) }), layout?.sections?.featuredProducts?.showAddToCart !== false && (_jsx("div", { className: "absolute top-4 right-4 z-20 opacity-0 group-hover:opacity-100 transition-opacity", children: _jsx(Button, { size: "icon", onClick: (e) => handleAddToCart(e, product), className: "rounded-full bg-white text-slate-900 hover:bg-blue-600 hover:text-white shadow-lg", children: _jsx(ShoppingCart, { className: "h-4 w-4" }) }) })), _jsx("div", { className: "absolute inset-0 flex items-center justify-center p-8 bg-gradient-to-br from-white to-slate-50", children: _jsx(ImageWithFallback, { src: product.images?.[0], alt: product.name, className: "w-full h-full object-contain group-hover:scale-110 transition-transform duration-500", skeletonAspectRatio: "square" }) })] }), _jsxs("div", { className: "space-y-1 px-2", children: [_jsx("h3", { className: "font-bold text-lg text-slate-900 truncate group-hover:text-blue-600 transition-colors", children: product.name }), _jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-slate-900 font-bold", children: formatCurrency(product.price, product.currency || 'USD') }), product.compareAtPrice && _jsx("span", { className: "text-slate-400 text-sm line-through", children: formatCurrency(product.compareAtPrice, product.currency || 'USD') })] })] }), _jsx(Link, { href: `/${storeConfig.slug}/products/${product.slug}`, className: "absolute inset-0 z-10" })] }, product.id))) })] }) })), layout?.features?.show !== false && (_jsxs("section", { "data-section": "features", className: "py-16 md:py-32 bg-slate-950 text-white relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:64px_64px] [mask-image:radial-gradient(ellipse_60%_60%_at_50%_50%,#000_70%,transparent_100%)]" }), _jsx("div", { className: "container mx-auto px-6 relative z-10", children: _jsx("div", { className: "grid md:grid-cols-3 gap-8 md:gap-12", children: [
98
+ { icon: Cpu, title: "Neural Processing", desc: "Advanced AI capabilities built into every device for smarter performance." },
99
+ { icon: Shield, title: "Military Grade", desc: "Tested against rigorous standards to ensure durability in any environment." },
100
+ { icon: Zap, title: "Hyper Charge", desc: "Next-generation battery technology for all-day power in minutes." }
101
+ ].map((feature, i) => (_jsxs("div", { className: "bg-slate-900/50 backdrop-blur-sm border border-slate-800 p-8 rounded-[2rem] hover:bg-slate-800/50 transition-colors", children: [_jsx("div", { className: "w-14 h-14 rounded-2xl bg-blue-600/20 flex items-center justify-center mb-6 text-blue-400", children: layout?.features?.showIcons !== false && _jsx(feature.icon, { className: "h-7 w-7" }) }), _jsx("h3", { className: "text-xl font-bold mb-3", children: feature.title }), _jsx("p", { className: "text-slate-400 leading-relaxed", children: feature.desc })] }, i))) }) })] })), layout?.sections?.marketing?.showNewsletter !== false && (_jsx("section", { "data-section": "marketing", className: "py-16 md:py-32 bg-white", children: _jsx("div", { className: "container mx-auto px-6", children: _jsxs("div", { className: "bg-blue-600 rounded-[3rem] p-10 md:p-24 text-center relative overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-blue-500 to-indigo-600" }), _jsx("div", { className: "absolute inset-0 opacity-20 bg-[url('https://grainy-gradients.vercel.app/noise.svg')]" }), _jsxs("div", { className: "relative z-10 max-w-2xl mx-auto space-y-8", children: [_jsx("h2", { className: "text-4xl md:text-5xl font-black text-white tracking-tight", children: layout?.sections?.marketing?.newsletterTitle || 'Stay Ahead of the Curve' }), _jsx("p", { className: "text-blue-100 text-lg", children: layout?.sections?.marketing?.newsletterSubtitle || 'Join our exclusive community for early access to drops and special offers.' }), _jsxs("div", { className: "flex flex-col sm:flex-row gap-4 max-w-md mx-auto", children: [_jsx("input", { type: "email", placeholder: layout?.sections?.marketing?.newsletterPlaceholder || 'Enter your email', value: email, onChange: (e) => setEmail(e.target.value), className: "flex-1 h-14 px-6 rounded-full bg-white/10 border border-white/20 text-white placeholder:text-blue-200 focus:outline-none focus:bg-white/20 focus:border-white transition-all backdrop-blur-md" }), _jsx(Button, { onClick: handleSubscribe, className: "h-14 px-8 rounded-full bg-white text-blue-600 hover:bg-blue-50 font-bold text-lg shadow-xl", children: layout?.sections?.marketing?.newsletterButton || 'Subscribe' })] })] })] }) }) })), _jsx(PromoBanner, { config: layout?.sections?.promoBanner, layoutStyle: "electronics" }), _jsx(ElectronicsStoreFooter, { storeConfig: storeConfig })] }));
104
102
  }