@salla.sa/twilight-components 2.14.352 → 2.14.353

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 (157) hide show
  1. package/dist/cjs/{filepond-XtsZ6xtH.js → filepond-7SxqaoXb.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-Bj84Ypvg.js → filepond-plugin-file-poster-DwIv84hN.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-aYfb4yYH.js → filepond-plugin-file-validate-size-NUNnIo4Q.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-CJsd6rXl.js → filepond-plugin-file-validate-type-CXI-hfww.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DRlBSg36.js → filepond-plugin-image-edit-fBeBGIBb.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-SY8c6DzI.js → filepond-plugin-image-exif-orientation-BmLTdQ6d.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-iqhJmUmU.js → filepond-plugin-image-preview-CssKRM6n.js} +1 -1
  8. package/dist/cjs/{index-Z-cyrNSM.js → index-B5soIVRX.js} +2 -2
  9. package/dist/cjs/{index-C7-280f4.js → index-B9TEdQDE.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +84 -34
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +8 -3
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  46. package/dist/cjs/twilight.cjs.js +2 -2
  47. package/dist/cjs/{vanilla-picker-Dq7F5bE1.js → vanilla-picker-C6fk8_TR.js} +1 -1
  48. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +18 -6
  49. package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js +7 -2
  50. package/dist/collection/components/salla-color-picker/salla-color-picker.js +39 -8
  51. package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +4 -2
  52. package/dist/collection/components/salla-products-list/salla-products-list.js +17 -11
  53. package/dist/components/index.js +2 -2
  54. package/dist/components/salla-add-product-button2.js +18 -6
  55. package/dist/components/salla-app-install-alert.js +7 -2
  56. package/dist/components/salla-color-picker2.js +38 -7
  57. package/dist/components/salla-maintenance-alert.js +4 -2
  58. package/dist/components/salla-products-list2.js +17 -11
  59. package/dist/esm/{filepond-Dg4ZKM-u.js → filepond-Cuqyleyy.js} +1 -1
  60. package/dist/esm/{filepond-plugin-file-poster-BUIjdsnA.js → filepond-plugin-file-poster-C6Wara8q.js} +1 -1
  61. package/dist/esm/{filepond-plugin-file-validate-size-DgZMMqmi.js → filepond-plugin-file-validate-size-D-M3KSxo.js} +1 -1
  62. package/dist/esm/{filepond-plugin-file-validate-type-DA9tDSFr.js → filepond-plugin-file-validate-type-DzAl1VI8.js} +1 -1
  63. package/dist/esm/{filepond-plugin-image-edit-dotdnN4Z.js → filepond-plugin-image-edit-flutfc9I.js} +1 -1
  64. package/dist/esm/{filepond-plugin-image-exif-orientation-oSI8aLU-.js → filepond-plugin-image-exif-orientation-B2UkG6iE.js} +1 -1
  65. package/dist/esm/{filepond-plugin-image-preview-DEefQK61.js → filepond-plugin-image-preview-B4u8N2nE.js} +1 -1
  66. package/dist/esm/{index-D2-TtAhI.js → index-6mr785rH.js} +2 -2
  67. package/dist/esm/{index-B7E8Tmgi.js → index-xWIb6INF.js} +1 -1
  68. package/dist/esm/loader.js +3 -3
  69. package/dist/esm/salla-accordion_62.entry.js +84 -34
  70. package/dist/esm/salla-advertisement.entry.js +1 -1
  71. package/dist/esm/salla-app-install-alert.entry.js +8 -3
  72. package/dist/esm/salla-apps-icons.entry.js +1 -1
  73. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  74. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  75. package/dist/esm/salla-contacts.entry.js +1 -1
  76. package/dist/esm/salla-custom-fields.entry.js +1 -1
  77. package/dist/esm/salla-filters-widget.entry.js +1 -1
  78. package/dist/esm/salla-filters.entry.js +1 -1
  79. package/dist/esm/salla-hook.entry.js +1 -1
  80. package/dist/esm/salla-installment.entry.js +1 -1
  81. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  82. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  83. package/dist/esm/salla-metadata.entry.js +1 -1
  84. package/dist/esm/salla-notification-item.entry.js +1 -1
  85. package/dist/esm/salla-notifications.entry.js +1 -1
  86. package/dist/esm/salla-offer.entry.js +1 -1
  87. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  88. package/dist/esm/salla-order-details-options.entry.js +1 -1
  89. package/dist/esm/salla-order-details.entry.js +1 -1
  90. package/dist/esm/salla-order-summary.entry.js +1 -1
  91. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  92. package/dist/esm/salla-orders.entry.js +1 -1
  93. package/dist/esm/salla-payments.entry.js +1 -1
  94. package/dist/esm/salla-price-range.entry.js +1 -1
  95. package/dist/esm/salla-review-card.entry.js +1 -1
  96. package/dist/esm/salla-reviews-page.entry.js +1 -1
  97. package/dist/esm/salla-reviews.entry.js +1 -1
  98. package/dist/esm/salla-social.entry.js +1 -1
  99. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  100. package/dist/esm/salla-tooltip.entry.js +1 -1
  101. package/dist/esm/salla-trust-badges.entry.js +1 -1
  102. package/dist/esm/salla-verify.entry.js +1 -1
  103. package/dist/esm/salla-wallet.entry.js +1 -1
  104. package/dist/esm/twilight.js +3 -3
  105. package/dist/esm/{vanilla-picker-DkUGzUrx.js → vanilla-picker-B4PKRAhm.js} +1 -1
  106. package/dist/twilight/{p-cf66ab4d.entry.js → p-0c87ef6c.entry.js} +1 -1
  107. package/dist/twilight/{p-e5c01983.entry.js → p-12e49031.entry.js} +1 -1
  108. package/dist/twilight/{p-9fa5ffcf.entry.js → p-16b8d78c.entry.js} +1 -1
  109. package/dist/twilight/{p-6c2807c8.entry.js → p-18ebec2c.entry.js} +1 -1
  110. package/dist/twilight/{p-9d35196f.entry.js → p-19e07b9e.entry.js} +1 -1
  111. package/dist/twilight/{p-30403778.entry.js → p-28900b2e.entry.js} +1 -1
  112. package/dist/twilight/{p-7b3ca138.entry.js → p-2a26c1d6.entry.js} +1 -1
  113. package/dist/twilight/{p-933881d3.entry.js → p-2d209f96.entry.js} +1 -1
  114. package/dist/twilight/{p-a858523c.entry.js → p-300624bb.entry.js} +1 -1
  115. package/dist/twilight/{p-d4faa0f6.entry.js → p-33ea3141.entry.js} +1 -1
  116. package/dist/twilight/{p-67c327a8.entry.js → p-4253fc44.entry.js} +1 -1
  117. package/dist/twilight/{p-4a594c06.entry.js → p-4bc98557.entry.js} +1 -1
  118. package/dist/twilight/{p-81df7a2e.entry.js → p-5067322a.entry.js} +1 -1
  119. package/dist/twilight/{p-b9d0212c.entry.js → p-5bf05092.entry.js} +1 -1
  120. package/dist/twilight/{p-f6ffc708.entry.js → p-6472200c.entry.js} +1 -1
  121. package/dist/twilight/p-67830f2a.entry.js +4 -0
  122. package/dist/twilight/{p-e73c28a8.entry.js → p-6f576591.entry.js} +1 -1
  123. package/dist/twilight/{p-9b8f5399.entry.js → p-6f5d02c6.entry.js} +1 -1
  124. package/dist/twilight/{p-D2-TtAhI.js → p-6mr785rH.js} +1 -1
  125. package/dist/twilight/{p-5dbf4cec.entry.js → p-751dddd4.entry.js} +1 -1
  126. package/dist/twilight/{p-db526796.entry.js → p-7e39343d.entry.js} +1 -1
  127. package/dist/twilight/{p-6ce3f119.entry.js → p-81702ecb.entry.js} +1 -1
  128. package/dist/twilight/{p-b1af2aca.entry.js → p-8b018d82.entry.js} +1 -1
  129. package/dist/twilight/{p-b208650b.entry.js → p-8c7b7712.entry.js} +1 -1
  130. package/dist/twilight/{p-2aa0a4e2.entry.js → p-9946fa76.entry.js} +1 -1
  131. package/dist/twilight/{p-3a74b551.entry.js → p-9b22a7eb.entry.js} +1 -1
  132. package/dist/twilight/{p-B0ba6Gec.js → p-B2SkkGH8.js} +2 -2
  133. package/dist/twilight/{p-Czq4p9Qp.js → p-BijadG7g.js} +1 -1
  134. package/dist/twilight/{p-Cmkcwiop.js → p-Bp_xKTyn.js} +1 -1
  135. package/dist/twilight/{p-DhcC83-2.js → p-C_h1JDCU.js} +1 -1
  136. package/dist/twilight/{p-DPqkW1aD.js → p-ChfiVIJv.js} +2 -2
  137. package/dist/twilight/{p-DJ557xys.js → p-Cuxsz9f-.js} +1 -1
  138. package/dist/twilight/{p-C2bMx7q5.js → p-DnELO4MH.js} +1 -1
  139. package/dist/twilight/{p-a42d626d.entry.js → p-a515a8cc.entry.js} +1 -1
  140. package/dist/twilight/{p-6b0a03f6.entry.js → p-ac6fc286.entry.js} +1 -1
  141. package/dist/twilight/{p-ed60a726.entry.js → p-b60db6c8.entry.js} +1 -1
  142. package/dist/twilight/{p-e26cc25b.entry.js → p-c096e336.entry.js} +1 -1
  143. package/dist/twilight/{p-22d83528.entry.js → p-c4821f8b.entry.js} +1 -1
  144. package/dist/twilight/{p-0effc34b.entry.js → p-d4aaeef4.entry.js} +1 -1
  145. package/dist/twilight/{p-fea62668.entry.js → p-dde21f4b.entry.js} +1 -1
  146. package/dist/twilight/{p-01bccbf2.entry.js → p-de807340.entry.js} +1 -1
  147. package/dist/twilight/{p-6d886b96.entry.js → p-e909d28b.entry.js} +1 -1
  148. package/dist/twilight/{p-8e7fa4a9.entry.js → p-fa585081.entry.js} +1 -1
  149. package/dist/twilight/{p-q-O0srMP.js → p-tFBCbVoG.js} +1 -1
  150. package/dist/twilight/{p-_JhF_Kvb.js → p-zHj-W7EE.js} +1 -1
  151. package/dist/twilight/twilight.esm.js +1 -1
  152. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +5 -0
  153. package/dist/types/components/salla-app-install-alert/salla-app-install-alert.d.ts +3 -1
  154. package/dist/types/components/salla-color-picker/salla-color-picker.d.ts +10 -0
  155. package/dist/types/components/salla-products-list/salla-products-list.d.ts +2 -0
  156. package/package.json +5 -5
  157. package/dist/twilight/p-4e416704.entry.js +0 -4
@@ -40,12 +40,19 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
40
40
  this.productType = 'product';
41
41
  this.selectedOptions = [];
42
42
  this.buyNowText = salla.lang.get('pages.products.buy_now');
43
+ /** Use matchMedia instead of window.innerWidth to avoid forced reflow (Lighthouse/PageSpeed) */
44
+ this.isDesktopViewport = typeof window !== 'undefined' ? window.matchMedia('(min-width: 768px)').matches : true;
45
+ this.viewportMediaQuery = null;
46
+ this.onViewportChange = (e) => {
47
+ this.isDesktopViewport = e.matches;
48
+ this.btn?.setText((e.matches && !!this.passedLabel) ? this.passedLabel : this.getLabel());
49
+ };
43
50
  salla.lang.onLoaded(() => {
44
51
  this.buyNowText = salla.lang.get('pages.products.buy_now');
45
52
  });
46
53
  }
47
54
  getLabel() {
48
- if (this.productStatus === 'sale' && this.supportStickyBar && window.innerWidth <= 768 && this.showQuickBuy && this.isApplePayActive) {
55
+ if (this.productStatus === 'sale' && this.supportStickyBar && !this.isDesktopViewport && this.showQuickBuy && this.isApplePayActive) {
49
56
  return PendingOrdersIcon;
50
57
  }
51
58
  if (this.hasPreOrder) {
@@ -138,7 +145,7 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
138
145
  getQuickBuyBtnAttributes() {
139
146
  return {
140
147
  ...this.getBtnAttributes(),
141
- type: this.supportStickyBar && window.innerWidth <= 768 ? 'plain' : this.productType == 'donating' ? 'donate' : 'buy'
148
+ type: this.supportStickyBar && !this.isDesktopViewport ? 'plain' : this.productType == 'donating' ? 'donate' : 'buy'
142
149
  };
143
150
  }
144
151
  miniCheckoutWidget() {
@@ -161,11 +168,12 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
161
168
  && salla.config.get('store.settings.payments')?.includes('apple_pay')
162
169
  && salla.config.get('store.settings.is_salla_gateway', false);
163
170
  this.passedLabel = this.host.innerHTML.replace('<!---->', '').trim();
164
- if (!!this.passedLabel && window.innerWidth >= 768) {
171
+ if (!!this.passedLabel && this.isDesktopViewport) {
165
172
  return this.btn?.setText(this.passedLabel);
166
173
  }
167
174
  if (this.host.getAttribute('type') === 'submit' && this.supportStickyBar) {
168
- window.addEventListener('resize', () => this.btn?.setText((window.innerWidth >= 768 && !!this.passedLabel) ? this.passedLabel : this.getLabel()));
175
+ this.viewportMediaQuery = window.matchMedia('(min-width: 768px)');
176
+ this.viewportMediaQuery.addEventListener('change', this.onViewportChange);
169
177
  }
170
178
  });
171
179
  }
@@ -217,7 +225,7 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
217
225
  }
218
226
  componentDidRender() {
219
227
  //if label not passed, get label
220
- if (!!this.passedLabel && (!this.supportStickyBar || window.innerWidth >= 768)) {
228
+ if (!!this.passedLabel && (!this.supportStickyBar || this.isDesktopViewport)) {
221
229
  // if passed label, set it
222
230
  this.btn?.setText(this.passedLabel);
223
231
  return;
@@ -225,6 +233,9 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
225
233
  this.btn?.setText(this.getLabel());
226
234
  salla.lang.onLoaded(() => this.btn?.setText(this.getLabel()));
227
235
  }
236
+ disconnectedCallback() {
237
+ this.viewportMediaQuery?.removeEventListener('change', this.onViewportChange);
238
+ }
228
239
  get host() { return this; }
229
240
  static get style() { return sallaAddProductButtonCss; }
230
241
  }, [4, "salla-add-product-button", {
@@ -244,7 +255,8 @@ const SallaAddProductButton = /*@__PURE__*/ proxyCustomElement(class SallaAddPro
244
255
  "selectedOptions": [32],
245
256
  "showQuickBuy": [32],
246
257
  "isApplePayActive": [32],
247
- "buyNowText": [32]
258
+ "buyNowText": [32],
259
+ "isDesktopViewport": [32]
248
260
  }]);
249
261
  function defineCustomElement() {
250
262
  if (typeof customElements === "undefined") {
@@ -30,12 +30,17 @@ const SallaAppInstallAlert$1 = /*@__PURE__*/ proxyCustomElement(class SallaAppIn
30
30
  }
31
31
  /**
32
32
  * Check if the website opens from mobile or tablet devices only (android/ios).
33
+ * Uses matchMedia instead of window.innerWidth to avoid forced reflow (Lighthouse/PageSpeed).
34
+ * Guards against SSR/non-browser contexts (window, navigator, document).
33
35
  *
34
- * @param {number} screen the width of the biggest screen to be checked
36
+ * @param {number} screen the width of the biggest screen to be checked (default 1024)
35
37
  * @returns {boolean} true if it is mobile or tablet else false
36
38
  */
37
39
  isMobileOrTabletDevice(screen = 1024) {
38
- const screenWidth = window.innerWidth <= screen;
40
+ if (typeof window === 'undefined' || typeof navigator === 'undefined' || typeof document === 'undefined') {
41
+ return false;
42
+ }
43
+ const screenWidth = window.matchMedia(`(max-width: ${screen}px)`).matches;
39
44
  const userAgentCheck = /Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
40
45
  const hasTouch = 'ontouchstart' in window ||
41
46
  'ontouchend' in document ||
@@ -43,6 +43,10 @@ const SallaColorPicker = /*@__PURE__*/ proxyCustomElement(class SallaColorPicker
43
43
  * Whether to enable adjusting the alpha channel.
44
44
  */
45
45
  this.enableAlpha = false;
46
+ this.updateViewportCache = () => {
47
+ this.cachedViewportWidth = this.getViewportWidthFromBreakpoints();
48
+ };
49
+ this.cachedViewportWidth = 0; // Will be populated in componentDidLoad via requestAnimationFrame
46
50
  }
47
51
  colorChangeHandler(color) {
48
52
  if (this.colorInput)
@@ -60,7 +64,10 @@ const SallaColorPicker = /*@__PURE__*/ proxyCustomElement(class SallaColorPicker
60
64
  this.submitted.emit(color);
61
65
  }
62
66
  popupOpenedHandler(color) {
63
- this.setPopInPosition();
67
+ // Double rAF: defer setPopInPosition (getBoundingClientRect) until after paint to avoid forced reflow
68
+ requestAnimationFrame(() => {
69
+ requestAnimationFrame(() => this.setPopInPosition());
70
+ });
64
71
  this.popupOpened.emit(color);
65
72
  }
66
73
  popupClosedHandler(color) {
@@ -133,26 +140,47 @@ const SallaColorPicker = /*@__PURE__*/ proxyCustomElement(class SallaColorPicker
133
140
  this.picker = null;
134
141
  this.pickerReady = null;
135
142
  }
143
+ disconnectedCallback() {
144
+ window.removeEventListener('resize', this.updateViewportCache);
145
+ }
136
146
  componentWillLoad() {
137
147
  salla.onReady(() => {
138
148
  this.color = this.color ? this.color : salla.config.get('theme.color.primary', '#5dd5c4');
139
149
  });
140
150
  }
151
+ /**
152
+ * Returns viewport width from matchMedia breakpoints (no layout read).
153
+ * Must match updateViewportCache breakpoints for consistency.
154
+ */
155
+ getViewportWidthFromBreakpoints() {
156
+ if (typeof window === 'undefined')
157
+ return 1024;
158
+ if (window.matchMedia('(min-width: 1200px)').matches)
159
+ return 1200;
160
+ if (window.matchMedia('(min-width: 992px)').matches)
161
+ return 992;
162
+ if (window.matchMedia('(min-width: 768px)').matches)
163
+ return 768;
164
+ return 375;
165
+ }
141
166
  setPopInPosition() {
167
+ // Use cached viewport width – reading innerWidth at popup open causes forced reflow.
168
+ // Fallback: matchMedia-based value when cache is 0 (e.g. SSR before hydration). Same breakpoints as updateViewportCache.
169
+ const viewportWidth = this.cachedViewportWidth || this.getViewportWidthFromBreakpoints();
142
170
  const popup = this.host.querySelector('.picker_wrapper');
143
171
  const widgetEl = this.host.querySelector('.s-color-picker-widget');
144
172
  if (!popup || !widgetEl)
145
173
  return;
146
174
  const widgetPosition = widgetEl.getBoundingClientRect();
147
- const widgetToWindowEq = window.innerWidth / 2 - widgetPosition.width / 2;
175
+ const widgetToWindowEq = viewportWidth / 2 - widgetPosition.width / 2;
148
176
  const widgetInLeft = widgetToWindowEq > widgetPosition.x;
149
177
  const widgetInRight = widgetToWindowEq < widgetPosition.x;
150
178
  const widgetInCenter = widgetToWindowEq === widgetPosition.x;
151
- const isMobile = window.innerWidth < 768;
179
+ const isMobile = !window.matchMedia('(min-width: 768px)').matches;
152
180
  if (isMobile && widgetInLeft) {
153
181
  popup.style.left = '0';
154
182
  }
155
- if (isMobile && (widgetInRight)) {
183
+ if (isMobile && widgetInRight) {
156
184
  popup.style.left = 'auto';
157
185
  }
158
186
  if (!isMobile || (isMobile && ((!widgetInRight && !widgetInLeft) || widgetInCenter))) {
@@ -160,7 +188,7 @@ const SallaColorPicker = /*@__PURE__*/ proxyCustomElement(class SallaColorPicker
160
188
  }
161
189
  }
162
190
  initColorPicker() {
163
- this.pickerReady = import('./vanilla-picker.js').then(function (n) { return n.v; }).then((mod) => {
191
+ this.pickerReady = import('./vanilla-picker.js').then(function (n) { return n.v; }).then(mod => {
164
192
  const Picker = mod.default;
165
193
  const picker = new Picker({
166
194
  parent: this.host,
@@ -180,14 +208,17 @@ const SallaColorPicker = /*@__PURE__*/ proxyCustomElement(class SallaColorPicker
180
208
  });
181
209
  }
182
210
  render() {
183
- return (h(Host, { key: 'f6a001611bf20e8264346028c848490cf94c686a', class: "s-color-picker-main" }, h("slot", { key: '79648d165d81f200e064c8ef56a138f6b66757ed', name: "widget" }, h("div", { key: '95e7a8b7a92f5bb8f6f05b8cd39e6c91710e52a2', class: "s-color-picker-widget" }, h("div", { key: '24813d1de9a5834cfd37edf7affd4be94608f96c', class: "s-color-picker-widget-canvas", ref: dv => this.canvas = dv }), h("span", { key: '5f29f537140bc4b74431fc33229563cb1b7ce231', innerHTML: ArrowDown }))), h("input", { key: '188a9d7233388fca9a25cd5d319c0973448b07bc', class: "s-hidden", name: this.name, required: this.required, value: this.color, ref: color => this.colorInput = color })));
211
+ return (h(Host, { key: 'dc90f101197031b0ec17939dc940b527cbb42764', class: "s-color-picker-main" }, h("slot", { key: '504a93f8bba3130a953dbfc1e03420d622247c0f', name: "widget" }, h("div", { key: '7eb60d1353d1fa6edefc400d7851499d083c3000', class: "s-color-picker-widget" }, h("div", { key: '01361959e0beeecd5c4b9ba0210931f3864b9273', class: "s-color-picker-widget-canvas", ref: dv => (this.canvas = dv) }), h("span", { key: '4091ba421758a3af182e7224ffbd74c5ca58166a', innerHTML: ArrowDown }))), h("input", { key: '5302b4da7dc9beaec6ab469175dee79d5b8c5dc5', class: "s-hidden", name: this.name, required: this.required, value: this.color, ref: color => (this.colorInput = color) })));
184
212
  }
185
213
  componentDidLoad() {
186
214
  if (this.canvas)
187
215
  this.canvas.style.backgroundColor = this.color;
188
216
  this.initColorPicker();
217
+ // Populate viewport cache in next frame (avoids forced reflow during initial render)
218
+ requestAnimationFrame(() => this.updateViewportCache());
219
+ window.addEventListener('resize', this.updateViewportCache);
189
220
  if (this.colorInput) {
190
- this.colorInput.addEventListener('invalid', (e) => {
221
+ this.colorInput.addEventListener('invalid', e => {
191
222
  this.invalidInput.emit(e);
192
223
  });
193
224
  this.colorInput.addEventListener('input', () => {
@@ -14,14 +14,16 @@ const SallaMaintenanceAlert$1 = /*@__PURE__*/ proxyCustomElement(class SallaMain
14
14
  componentWillLoad() {
15
15
  this.title = salla.config.get('maintenance_details.title');
16
16
  this.message = salla.config.get('maintenance_details.message');
17
- this.buttonTitle = window.innerWidth <= 768 ? salla.config.get('maintenance_details.button_title') : salla.config.get('maintenance_details.button_full_title');
17
+ // Use matchMedia instead of window.innerWidth to avoid forced reflow (Lighthouse/PageSpeed)
18
+ const isMobile = typeof window !== 'undefined' && !window.matchMedia('(min-width: 768px)').matches;
19
+ this.buttonTitle = isMobile ? salla.config.get('maintenance_details.button_title') : salla.config.get('maintenance_details.button_full_title');
18
20
  }
19
21
  closeAlert() {
20
22
  salla.storage.set('hide_salla-maintenance-alert_at', Date.now());
21
23
  this.host.style.display = 'none';
22
24
  }
23
25
  render() {
24
- return (h(Host, { key: 'f307529d9fa1a3cfdf33cc48dea142e274eb4f72', class: "s-maintenance-alert-wrapper" }, h("button", { key: 'a8a8d3d4c03151f9fe468153d4368ab66de0ba5f', class: "s-maintenance-alert-close", innerHTML: Cancel, onClick: () => this.closeAlert() }), h("div", { key: 'f53e7ab72950f72b68eeb5ff6887203e8f6d0dbd', class: "s-maintenance-alert-content" }, h("div", { key: 'c3c69c738da0417114c87b03c49f0a8d36663558', class: "s-maintenance-alert-container" }, h("div", { key: 'af1ec8ff601873c04de610341f15775e05a5d185', class: "s-maintenance-alert-icon" }, h("img", { key: 'a1b6dd0d161749eff7f6e7d4e92fd161896b593b', src: salla.url.cdn('images/alert.png'), alt: "Alert" })), h("div", { key: 'f1f81302bbaf4d83d50770ff1f40416624bde583', class: "s-maintenance-alert-text" }, h("h2", { key: '79eab40b1cf6cf9d307d1e9bda24fe6dd8c03852' }, this.title), h("p", { key: '5bdbe219346851b9aff8c20fd41075853fe6b981' }, this.message))), h("div", { key: '8e2cd9ad611a551ee7960310f11a9f7f07668811' }, h("a", { key: '9658d9a3e82f9719c35caf362601a12a62475508', class: "s-maintenance-alert-btn", href: salla.config.get('maintenance_details.button_url') }, this.buttonTitle)))));
26
+ return (h(Host, { key: '109e687d7d6ba48ddf89cd3631f5a852d50688fd', class: "s-maintenance-alert-wrapper" }, h("button", { key: 'd70e7e53acc699336e1611589ca3bdfc704504c2', class: "s-maintenance-alert-close", innerHTML: Cancel, onClick: () => this.closeAlert() }), h("div", { key: 'b816c1a9635828c206c792d68203ccfbe8e8235b', class: "s-maintenance-alert-content" }, h("div", { key: '61e91088a5613d943b6f662f5ed44093ecf99237', class: "s-maintenance-alert-container" }, h("div", { key: '1ca223334f52bc5097677dd23433107080567894', class: "s-maintenance-alert-icon" }, h("img", { key: '22e07c7a104267cda2bed74929307d039018698d', src: salla.url.cdn('images/alert.png'), alt: "Alert" })), h("div", { key: '64d37700bc1454f5afadb55b49512bbd5b412d9c', class: "s-maintenance-alert-text" }, h("h2", { key: '7651dcd09a0ba07f14ed744758598015d4b45ecd' }, this.title), h("p", { key: '1f8d057af072466f34d0f3a13396de5144bc967f' }, this.message))), h("div", { key: '34f8471b855011b499c2038b1ac9dd24cc5e2e8b' }, h("a", { key: 'd9c4f4a9fb80ab90c13dc1dde69adcb7c4cd7e9f', class: "s-maintenance-alert-btn", href: salla.config.get('maintenance_details.button_url') }, this.buttonTitle)))));
25
27
  }
26
28
  componentDidLoad() {
27
29
  //auto-hide the alert if close button is clicked before one hour
@@ -40,6 +40,8 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
40
40
  this.prevCategoryIdKey = "prevCategoryId";
41
41
  this.isProcessing = false; // Tracks if we are processing data
42
42
  this.scrollTimeout = null;
43
+ this.boundScrollToLastViewedProduct = () => this.scrollToLastViewedProduct();
44
+ this.boundHandleScroll = () => this.handleScroll();
43
45
  this.specialPagesWithoutIds = {
44
46
  'product.index.latest': 'latest',
45
47
  'product.index.offers': 'offers',
@@ -64,11 +66,12 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
64
66
  if ("scrollRestoration" in history)
65
67
  history.scrollRestoration = "manual";
66
68
  // required for scroll restoration case when the component loads before DOM content is completed (slow internet bandwidth /low device specs)
67
- window.addEventListener('DOMContentLoaded', this.scrollToLastViewedProduct.bind(this));
69
+ window.addEventListener('DOMContentLoaded', this.boundScrollToLastViewedProduct);
68
70
  salla.event.on('salla-filters::changed', filters => this.setFilters(filters));
69
71
  }
70
72
  disconnectedCallback() {
71
- window.removeEventListener('DOMContentLoaded', this.scrollToLastViewedProduct);
73
+ window.removeEventListener('DOMContentLoaded', this.boundScrollToLastViewedProduct);
74
+ window.removeEventListener('scroll', this.boundHandleScroll);
72
75
  }
73
76
  /**
74
77
  * Set parsed filters data from URI
@@ -470,7 +473,7 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
470
473
  this.loading(true, this.autoload ? false : true);
471
474
  });
472
475
  // Manual scroll listener
473
- shouldApplyManualLoad && window.addEventListener('scroll', this.handleScroll.bind(this));
476
+ shouldApplyManualLoad && window.addEventListener('scroll', this.boundHandleScroll);
474
477
  this.infiniteScroll?.on('load', async (response) => {
475
478
  if (this.isProcessing)
476
479
  return;
@@ -523,14 +526,17 @@ const SallaProductsList = /*@__PURE__*/ proxyCustomElement(class SallaProductsLi
523
526
  return;
524
527
  this.scrollTimeout = setTimeout(() => {
525
528
  this.scrollTimeout = null;
526
- const wrapperRect = this.wrapper.getBoundingClientRect();
527
- const windowHeight = window.innerHeight;
528
- const distanceToBottom = wrapperRect.bottom - windowHeight;
529
- // Trigger only when the wrapper bottom is within 200px of the viewport bottom
530
- if (distanceToBottom <= 200 && !this.isProcessing && this.nextPage) {
531
- // Reached near the bottom of the wrapper, loading next page...
532
- this.manualLoadNextPage();
533
- }
529
+ // Defer layout reads to next frame to avoid forced reflow (Lighthouse/PageSpeed)
530
+ requestAnimationFrame(() => {
531
+ const wrapperRect = this.wrapper.getBoundingClientRect();
532
+ const windowHeight = window.innerHeight;
533
+ const distanceToBottom = wrapperRect.bottom - windowHeight;
534
+ // Trigger only when the wrapper bottom is within 200px of the viewport bottom
535
+ if (distanceToBottom <= 200 && !this.isProcessing && this.nextPage) {
536
+ // Reached near the bottom of the wrapper, loading next page...
537
+ this.manualLoadNextPage();
538
+ }
539
+ });
534
540
  }, 200);
535
541
  }
536
542
  manualLoadNextPage() {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { d as getDefaultExportFromCjs } from './index-D2-TtAhI.js';
4
+ import { d as getDefaultExportFromCjs } from './index-6mr785rH.js';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {