@salla.sa/twilight-components 2.14.312 → 2.14.338

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 (258) hide show
  1. package/dist/cjs/{filepond-CiAt5i10.js → filepond-hpLROc_m.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DdEJEgnf.js → filepond-plugin-file-poster-C8gskRGl.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-0E5awx2w.js → filepond-plugin-file-validate-size-CaO6qVs6.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-gT-JewGH.js → filepond-plugin-file-validate-type-mUUtcgCs.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DtBf5E5M.js → filepond-plugin-image-edit-rptDhPuc.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-DlG1UV1W.js → filepond-plugin-image-exif-orientation-B6L8W0Qe.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Dub3Jpec.js → filepond-plugin-image-preview-BoqOfOki.js} +1 -1
  8. package/dist/cjs/{index-BP5-4y-K.js → index-2liYDuhx.js} +583 -420
  9. package/dist/cjs/{index-i_mnWz5-.js → index-ChHHnqio.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +173 -94
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +2 -2
  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 +60 -12
  20. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-hook.cjs.entry.js +2 -2
  22. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +2 -2
  24. package/dist/cjs/salla-loyalty-program.cjs.entry.js +2 -2
  25. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-notification-item.cjs.entry.js +2 -2
  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 +2 -2
  30. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  32. package/dist/cjs/salla-order-summary.cjs.entry.js +2 -2
  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 +3 -3
  36. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  37. package/dist/cjs/salla-review-card.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-reviews-page.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-reviews.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  41. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  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/collection/components/salla-apps-icons/salla-apps-icons.js +1 -1
  48. package/dist/collection/components/salla-button/salla-button.js +29 -13
  49. package/dist/collection/components/salla-comments/salla-comment-item.js +8 -3
  50. package/dist/collection/components/salla-comments/salla-comments.js +1 -1
  51. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +62 -12
  52. package/dist/collection/components/salla-gifting/salla-gifting.js +3 -3
  53. package/dist/collection/components/salla-hook/salla-hook.js +1 -1
  54. package/dist/collection/components/salla-list-tile/salla-list-tile.js +1 -1
  55. package/dist/collection/components/salla-loading/salla-loading.js +1 -1
  56. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +1 -1
  57. package/dist/collection/components/salla-login-modal/salla-login-modal.js +15 -2
  58. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +1 -1
  59. package/dist/collection/components/salla-loyalty-program/salla-loyalty-program.js +1 -1
  60. package/dist/collection/components/salla-maintenance-alert/salla-maintenance-alert.js +1 -1
  61. package/dist/collection/components/salla-map/salla-map.js +3 -3
  62. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +1 -1
  63. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  64. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -4
  65. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +2 -2
  66. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +1 -1
  67. package/dist/collection/components/salla-notifications/salla-notification-item.js +1 -1
  68. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +1 -1
  69. package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +1 -1
  70. package/dist/collection/components/salla-order-details/salla-order-details.js +1 -1
  71. package/dist/collection/components/salla-order-summary/salla-order-summary.js +1 -1
  72. package/dist/collection/components/salla-payments/salla-payments.js +2 -2
  73. package/dist/collection/components/salla-placeholder/salla-placeholder.js +1 -1
  74. package/dist/collection/components/salla-price-range/salla-price-range.js +2 -2
  75. package/dist/collection/components/salla-product-availability/salla-product-availability.js +1 -1
  76. package/dist/collection/components/salla-product-card/salla-product-card.js +5 -5
  77. package/dist/collection/components/salla-product-options/salla-product-options.js +37 -16
  78. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +2 -2
  79. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +13 -2
  80. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +2 -2
  81. package/dist/collection/components/salla-review-card/salla-review-card.js +1 -1
  82. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  83. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  84. package/dist/collection/components/salla-scopes/salla-scopes.js +1 -1
  85. package/dist/collection/components/salla-search/salla-search.js +3 -3
  86. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  87. package/dist/collection/components/salla-slider/salla-slider.js +2 -2
  88. package/dist/collection/components/salla-social/salla-social.js +1 -1
  89. package/dist/collection/components/salla-social-share/salla-social-share.js +5 -1
  90. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  91. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  92. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  93. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  94. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  95. package/dist/collection/components/salla-user-menu/salla-user-menu.js +9 -1
  96. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  97. package/dist/collection/plugins/commonjs-cache-fix.js +21 -0
  98. package/dist/components/axios.js +583 -420
  99. package/dist/components/index.js +2 -2
  100. package/dist/components/salla-apps-icons.js +1 -1
  101. package/dist/components/salla-button2.js +29 -13
  102. package/dist/components/salla-comment-item2.js +8 -3
  103. package/dist/components/salla-comments.js +1 -1
  104. package/dist/components/salla-filters-widget2.js +61 -11
  105. package/dist/components/salla-gifting.js +3 -3
  106. package/dist/components/salla-hook.js +1 -1
  107. package/dist/components/salla-list-tile2.js +1 -1
  108. package/dist/components/salla-loading2.js +1 -1
  109. package/dist/components/salla-localization-modal.js +1 -1
  110. package/dist/components/salla-login-modal.js +15 -2
  111. package/dist/components/salla-loyalty-prize-item.js +1 -1
  112. package/dist/components/salla-loyalty-program.js +1 -1
  113. package/dist/components/salla-maintenance-alert.js +1 -1
  114. package/dist/components/salla-map2.js +3 -3
  115. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -1
  116. package/dist/components/salla-multiple-bundle-product-details2.js +2 -2
  117. package/dist/components/salla-multiple-bundle-product-options-modal2.js +4 -4
  118. package/dist/components/salla-multiple-bundle-product-slider2.js +2 -2
  119. package/dist/components/salla-multiple-bundle-product.js +1 -1
  120. package/dist/components/salla-notification-item2.js +1 -1
  121. package/dist/components/salla-offer-modal.js +1 -1
  122. package/dist/components/salla-order-details-multiple-bundle-product2.js +1 -1
  123. package/dist/components/salla-order-details.js +1 -1
  124. package/dist/components/salla-order-summary.js +1 -1
  125. package/dist/components/salla-payments.js +2 -2
  126. package/dist/components/salla-placeholder2.js +1 -1
  127. package/dist/components/salla-price-range2.js +2 -2
  128. package/dist/components/salla-product-availability2.js +1 -1
  129. package/dist/components/salla-product-card2.js +5 -5
  130. package/dist/components/salla-product-options2.js +37 -16
  131. package/dist/components/salla-product-size-guide.js +2 -2
  132. package/dist/components/salla-quantity-input.js +13 -2
  133. package/dist/components/salla-quick-buy2.js +6 -4
  134. package/dist/components/salla-review-card2.js +1 -1
  135. package/dist/components/salla-reviews-page.js +1 -1
  136. package/dist/components/salla-reviews.js +1 -1
  137. package/dist/components/salla-scopes.js +1 -1
  138. package/dist/components/salla-search.js +3 -3
  139. package/dist/components/salla-skeleton2.js +1 -1
  140. package/dist/components/salla-slider2.js +2 -2
  141. package/dist/components/salla-social-share.js +5 -1
  142. package/dist/components/salla-social.js +1 -1
  143. package/dist/components/salla-tab-content2.js +1 -1
  144. package/dist/components/salla-tab-header2.js +1 -1
  145. package/dist/components/salla-tabs2.js +1 -1
  146. package/dist/components/salla-tel-input2.js +1 -1
  147. package/dist/components/salla-tooltip2.js +1 -1
  148. package/dist/components/salla-user-menu.js +9 -1
  149. package/dist/components/salla-user-settings.js +1 -1
  150. package/dist/esm/{filepond-aj0Vz3hN.js → filepond-CwjnR_95.js} +1 -1
  151. package/dist/esm/{filepond-plugin-file-poster-lPOvqQlG.js → filepond-plugin-file-poster-DES9KQfe.js} +1 -1
  152. package/dist/esm/{filepond-plugin-file-validate-size-CV5FbyeW.js → filepond-plugin-file-validate-size-BcloWdhO.js} +1 -1
  153. package/dist/esm/{filepond-plugin-file-validate-type-B7RUT3W_.js → filepond-plugin-file-validate-type-CbjGxksB.js} +1 -1
  154. package/dist/esm/{filepond-plugin-image-edit-CXPgbHP6.js → filepond-plugin-image-edit-BtZ6aJg8.js} +1 -1
  155. package/dist/esm/{filepond-plugin-image-exif-orientation-BKxDLyfR.js → filepond-plugin-image-exif-orientation-BVNb0UTU.js} +1 -1
  156. package/dist/esm/{filepond-plugin-image-preview-B3b6dOj7.js → filepond-plugin-image-preview-t1v2q4Jq.js} +1 -1
  157. package/dist/esm/{index-BVJkSSs6.js → index-CRmtzwUF.js} +583 -420
  158. package/dist/esm/{index-CvvOXX3k.js → index-HmYGeOpS.js} +1 -1
  159. package/dist/esm/loader.js +3 -3
  160. package/dist/esm/salla-accordion_62.entry.js +173 -94
  161. package/dist/esm/salla-advertisement.entry.js +1 -1
  162. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  163. package/dist/esm/salla-apps-icons.entry.js +2 -2
  164. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  165. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  166. package/dist/esm/salla-contacts.entry.js +1 -1
  167. package/dist/esm/salla-custom-fields.entry.js +1 -1
  168. package/dist/esm/salla-filters-widget.entry.js +60 -12
  169. package/dist/esm/salla-filters.entry.js +1 -1
  170. package/dist/esm/salla-hook.entry.js +2 -2
  171. package/dist/esm/salla-installment.entry.js +1 -1
  172. package/dist/esm/salla-loyalty-prize-item.entry.js +2 -2
  173. package/dist/esm/salla-loyalty-program.entry.js +2 -2
  174. package/dist/esm/salla-metadata.entry.js +1 -1
  175. package/dist/esm/salla-notification-item.entry.js +2 -2
  176. package/dist/esm/salla-notifications.entry.js +1 -1
  177. package/dist/esm/salla-offer.entry.js +1 -1
  178. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +2 -2
  179. package/dist/esm/salla-order-details-options.entry.js +1 -1
  180. package/dist/esm/salla-order-details.entry.js +2 -2
  181. package/dist/esm/salla-order-summary.entry.js +2 -2
  182. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  183. package/dist/esm/salla-orders.entry.js +1 -1
  184. package/dist/esm/salla-payments.entry.js +3 -3
  185. package/dist/esm/salla-price-range.entry.js +3 -3
  186. package/dist/esm/salla-review-card.entry.js +2 -2
  187. package/dist/esm/salla-reviews-page.entry.js +2 -2
  188. package/dist/esm/salla-reviews.entry.js +2 -2
  189. package/dist/esm/salla-social.entry.js +2 -2
  190. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  191. package/dist/esm/salla-tooltip.entry.js +2 -2
  192. package/dist/esm/salla-trust-badges.entry.js +1 -1
  193. package/dist/esm/salla-verify.entry.js +1 -1
  194. package/dist/esm/salla-wallet.entry.js +1 -1
  195. package/dist/esm/twilight.js +3 -3
  196. package/dist/twilight/p-057e38a1.entry.js +4 -0
  197. package/dist/twilight/p-19f40612.entry.js +4 -0
  198. package/dist/twilight/{p-56e70b23.entry.js → p-1c31f335.entry.js} +1 -1
  199. package/dist/twilight/{p-3ba6d234.entry.js → p-1f31af27.entry.js} +1 -1
  200. package/dist/twilight/{p-caac78a8.entry.js → p-21ced14f.entry.js} +1 -1
  201. package/dist/twilight/{p-e7eeebf1.entry.js → p-2bb93ed0.entry.js} +1 -1
  202. package/dist/twilight/{p-a5780098.entry.js → p-3862a37f.entry.js} +1 -1
  203. package/dist/twilight/{p-65ce7926.entry.js → p-3f45a06b.entry.js} +1 -1
  204. package/dist/twilight/{p-0dcda629.entry.js → p-403bef37.entry.js} +1 -1
  205. package/dist/twilight/{p-62e50e0c.entry.js → p-4317d018.entry.js} +1 -1
  206. package/dist/twilight/{p-da2c81c6.entry.js → p-45053a9b.entry.js} +1 -1
  207. package/dist/twilight/{p-615331d4.entry.js → p-48d76aa7.entry.js} +1 -1
  208. package/dist/twilight/{p-366c2a7d.entry.js → p-56d3794f.entry.js} +1 -1
  209. package/dist/twilight/{p-061ec27c.entry.js → p-69600ceb.entry.js} +1 -1
  210. package/dist/twilight/{p-3c7c63ee.entry.js → p-817fca09.entry.js} +1 -1
  211. package/dist/twilight/{p-5606e8dd.entry.js → p-877ee446.entry.js} +1 -1
  212. package/dist/twilight/p-878f405f.entry.js +4 -0
  213. package/dist/twilight/{p-883a04da.entry.js → p-88c9cdc0.entry.js} +1 -1
  214. package/dist/twilight/p-8d231ba5.entry.js +4 -0
  215. package/dist/twilight/p-9108e972.entry.js +4 -0
  216. package/dist/twilight/p-95f3e7ea.entry.js +4 -0
  217. package/dist/twilight/{p-Bf2ln7Tf.js → p-BgkeXrDK.js} +1 -1
  218. package/dist/twilight/{p-CimxEIO_.js → p-BxtqlawD.js} +2 -2
  219. package/dist/twilight/p-CRmtzwUF.js +5 -0
  220. package/dist/twilight/{p-Cau1tMDQ.js → p-DTy6dAEi.js} +1 -1
  221. package/dist/twilight/{p-CtmyX8MN.js → p-DdMTtNYY.js} +1 -1
  222. package/dist/twilight/{p-CslymsND.js → p-VCBBJkYb.js} +1 -1
  223. package/dist/twilight/{p-CJWu6tW6.js → p-YYVkPdoE.js} +1 -1
  224. package/dist/twilight/{p-7d6d19b9.entry.js → p-a3ae644b.entry.js} +1 -1
  225. package/dist/twilight/{p-b3311168.entry.js → p-a4ad6d0b.entry.js} +1 -1
  226. package/dist/twilight/{p-3939ed34.entry.js → p-a665ff5d.entry.js} +1 -1
  227. package/dist/twilight/{p-032b235d.entry.js → p-a9bec6cf.entry.js} +1 -1
  228. package/dist/twilight/{p-41b68e9a.entry.js → p-b7f1e672.entry.js} +1 -1
  229. package/dist/twilight/p-c0f8d377.entry.js +11 -0
  230. package/dist/twilight/{p-0979d5a6.entry.js → p-e98f8bae.entry.js} +1 -1
  231. package/dist/twilight/{p-b9090ce1.entry.js → p-eb6378eb.entry.js} +1 -1
  232. package/dist/twilight/{p-0e4a8f9f.entry.js → p-ef827c32.entry.js} +1 -1
  233. package/dist/twilight/{p-c133896d.entry.js → p-f01949b5.entry.js} +1 -1
  234. package/dist/twilight/{p-5afe6962.entry.js → p-f10087fd.entry.js} +1 -1
  235. package/dist/twilight/{p-f586994e.entry.js → p-f33a5658.entry.js} +1 -1
  236. package/dist/twilight/p-f4dc16e8.entry.js +4 -0
  237. package/dist/twilight/{p-eb9bf011.entry.js → p-f6a7b2cf.entry.js} +1 -1
  238. package/dist/twilight/{p-DZVGmyCg.js → p-sFNa2aTl.js} +1 -1
  239. package/dist/twilight/{p-BQe0WtLQ.js → p-xAxNmkBV.js} +1 -1
  240. package/dist/twilight/twilight.esm.js +1 -1
  241. package/dist/types/components/salla-button/salla-button.d.ts +0 -1
  242. package/dist/types/components/salla-comments/interfaces.d.ts +1 -0
  243. package/dist/types/components/salla-comments/salla-comment-item.d.ts +1 -0
  244. package/dist/types/components/salla-filters-widget/salla-filters-widget.d.ts +7 -2
  245. package/dist/types/components/salla-product-options/salla-product-options.d.ts +8 -0
  246. package/dist/types/components/salla-quantity-input/salla-quantity-input.d.ts +5 -1
  247. package/dist/types/components/salla-social-share/salla-social-share.d.ts +1 -0
  248. package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +1 -0
  249. package/package.json +5 -5
  250. package/dist/twilight/p-4657145b.entry.js +0 -11
  251. package/dist/twilight/p-7f03a939.entry.js +0 -4
  252. package/dist/twilight/p-87fe3f74.entry.js +0 -4
  253. package/dist/twilight/p-96f53e45.entry.js +0 -4
  254. package/dist/twilight/p-BVJkSSs6.js +0 -5
  255. package/dist/twilight/p-b81e66b2.entry.js +0 -4
  256. package/dist/twilight/p-d46b3cb6.entry.js +0 -4
  257. package/dist/twilight/p-e0c73f9b.entry.js +0 -4
  258. package/dist/twilight/p-f4383a51.entry.js +0 -4
@@ -22,6 +22,7 @@ export class SallaProductOptions {
22
22
  this.selectAmount = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ');
23
23
  this.isCustomDonation = false;
24
24
  this.selectedOptions = [];
25
+ this.canDisabled = false;
25
26
  this.disableCardValue = true;
26
27
  this.availableDigitalCardValues = [];
27
28
  this.userInitiatedValidation = false;
@@ -77,7 +78,6 @@ export class SallaProductOptions {
77
78
  const completed = option.donation.target_amount <= option.donation.collected_amount;
78
79
  return h("div", { class: { "s-product-options-donation-message": true, "s-product-options-donation-completed": completed, "s-product-options-donation-expired": !completed } }, h("p", null, option.donation.target_message), h("span", { innerHTML: completed ? salla.money(option.donation.target_amount) : '' }));
79
80
  };
80
- this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability') || salla.url.is_page('cart');
81
81
  salla.lang.onLoaded(() => {
82
82
  this.outOfStockText = salla.lang.get("pages.products.out_of_stock");
83
83
  this.donationAmount = salla.lang.get('pages.products.donation_amount');
@@ -177,7 +177,7 @@ export class SallaProductOptions {
177
177
  if (!closestProductOption.classList.contains('s-product-options-option-error')) {
178
178
  closestProductOption.classList.add('s-product-options-option-error');
179
179
  }
180
- if (this.userInitiatedValidation && !salla.url.is_page('cart')) {
180
+ if ((this.userInitiatedValidation || salla.helpers.isIOSDevice()) && !salla.url.is_page('cart')) {
181
181
  const firstInvalidElement = this.host.querySelector('.s-product-options-option-error');
182
182
  if (firstInvalidElement === closestProductOption) {
183
183
  this.scrollToElement(closestProductOption);
@@ -185,9 +185,9 @@ export class SallaProductOptions {
185
185
  }
186
186
  }
187
187
  scrollToElement(element) {
188
- if (element) {
189
- element.scrollIntoView({ behavior: 'smooth', block: 'center' });
190
- }
188
+ if (!element)
189
+ return;
190
+ element.scrollIntoView({ behavior: 'smooth', block: 'center' });
191
191
  }
192
192
  changedHandler(event, option, fireChangeEvent = true) {
193
193
  const data = {
@@ -382,10 +382,17 @@ export class SallaProductOptions {
382
382
  }
383
383
  this.outOfStockText = salla.lang.get('pages.products.out_of_stock');
384
384
  await salla.onReady();
385
- document.addEventListener("paste", this.handlePaste.bind(this));
385
+ this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability') || salla.url.is_page('cart');
386
+ this.pasteHandler = this.handlePaste.bind(this);
387
+ document.addEventListener("paste", this.pasteHandler);
386
388
  const needsCartId = (!salla.storage.get('cart.id') && this.optionsData.some(option => ['file', 'image'].includes(option.type)));
387
389
  return needsCartId ? salla.api.cart.getCurrentCartId(false, "salla-product-options") : null;
388
390
  }
391
+ disconnectedCallback() {
392
+ if (this.pasteHandler) {
393
+ document.removeEventListener("paste", this.pasteHandler);
394
+ }
395
+ }
389
396
  /**
390
397
  * This is a workaround for a bug in iOS 26 Safari, when pasting English text to RTL inputs, it adds extra text!!
391
398
  * To avoid any break changes, we will make it only work on these conditions:
@@ -399,7 +406,8 @@ export class SallaProductOptions {
399
406
  const target = event.target;
400
407
  if (!Salla.helpers.isAppleDevice()
401
408
  || !(target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement)
402
- || !target.classList.contains('s-form-control')) {
409
+ || !target.classList.contains('s-form-control')
410
+ || !this.host.contains(target)) {
403
411
  return;
404
412
  }
405
413
  // Prevent default paste (to avoid Safari inserting extra content)
@@ -429,7 +437,7 @@ export class SallaProductOptions {
429
437
  }
430
438
  return (h(Host, { class: "s-product-options-wrapper" }, h("salla-conditional-fields", null, this.optionsData.map((option) => h("div", { key: option.id, class: `s-product-options-option-container${option.visibility_condition || this.hideDigitalCardsOptions(option) ? ' hidden' : ''}`, "data-option-id": option.id, ...this.getOptionShownWhen(option) }, option.name === 'splitter' ?
431
439
  this.splitterOption()
432
- : h("div", { class: { "s-product-options-option": true, "s-product-options-option-booking": option.type === DisplayType.BOOKING && salla.url.is_page("cart") }, "data-option-type": option.type, "data-option-required": `${option.required}` }, h("label", { htmlFor: this.generateInputName(option.id), class: `s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}` }, h("b", null, option.name, option.required && h("span", null, " * "), " "), h("small", null, option.placeholder)), h("div", { class: `s-product-options-option-content ${this.hideLabel(option) || (option.type === DisplayType.BOOKING && salla.url.is_page("cart")) ? 's-product-options-option-content-full-width' : ''}` }, this.getDisplayForType(option))))))));
440
+ : h("div", { class: { "s-product-options-option": true, "s-product-options-option-booking": option.type === DisplayType.BOOKING && salla.url.is_page("cart") }, "data-option-type": option.type, "data-option-required": `${option.required}` }, h("label", { htmlFor: this.generateInputId(option.id), class: `s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}` }, h("b", null, option.name, option.required && h("span", null, " * "), " "), h("small", null, option.placeholder)), h("div", { class: `s-product-options-option-content ${this.hideLabel(option) || (option.type === DisplayType.BOOKING && salla.url.is_page("cart")) ? 's-product-options-option-content-full-width' : ''}` }, this.getDisplayForType(option))))))));
433
441
  }
434
442
  generateUniqueKey(defaultValue) {
435
443
  const contextData = this.bundleContext;
@@ -449,6 +457,14 @@ export class SallaProductOptions {
449
457
  }
450
458
  return baseKey;
451
459
  }
460
+ /**
461
+ * Generate a valid HTML id for option inputs.
462
+ * @param optionId - The option ID
463
+ * @returns The formatted id string
464
+ */
465
+ generateInputId(optionId) {
466
+ return this.generateUniqueKey(`option-${optionId}`);
467
+ }
452
468
  /**
453
469
  * Generate the correct input name based on bundle context
454
470
  * @param optionId - The option ID
@@ -456,6 +472,7 @@ export class SallaProductOptions {
456
472
  */
457
473
  generateInputName(optionId) {
458
474
  const contextData = this.bundleContext;
475
+ const baseOptionId = optionId.toString();
459
476
  if (contextData) {
460
477
  try {
461
478
  // Handle both string and object types
@@ -463,13 +480,13 @@ export class SallaProductOptions {
463
480
  ? JSON.parse(contextData)
464
481
  : contextData;
465
482
  const { sectionId, productId } = context;
466
- return `bundle[${sectionId}][${productId}][options][${optionId}]`;
483
+ return `bundle[${sectionId}][${productId}][options][${baseOptionId}]`;
467
484
  }
468
485
  catch (e) {
469
- return `options[${optionId}]`;
486
+ return `options[${baseOptionId}]`;
470
487
  }
471
488
  }
472
- return `options[${optionId}]`;
489
+ return `options[${baseOptionId}]`;
473
490
  }
474
491
  fillSelectedOptions() {
475
492
  this.selectedOptions = this.optionsData.reduce((acc, opt) => {
@@ -547,7 +564,7 @@ export class SallaProductOptions {
547
564
  // TODO: (ONLY FOR TESTING!) find a better way to make it testable, e.g. wrap it with a unique class like textOption
548
565
  //@ts-ignore
549
566
  numberOption(option) {
550
- return h("input", { type: "text", value: option.value, class: "s-form-control", required: !option.visibility_condition && option.required, name: this.generateInputName(option.id), placeholder: option.placeholder, onBlur: e => this.changedHandler(e, option), onInvalid: (e) => this.invalidHandler(e, option), onInput: e => salla.helpers.inputDigitsOnly(e.target) });
567
+ return h("input", { type: "text", value: option.value, class: "s-form-control", required: !option.visibility_condition && option.required, id: this.generateInputId(option.id), name: this.generateInputName(option.id), placeholder: option.placeholder, onBlur: e => this.changedHandler(e, option), onInvalid: (e) => this.invalidHandler(e, option), onInput: e => salla.helpers.inputDigitsOnly(e.target) });
551
568
  }
552
569
  //@ts-ignore
553
570
  splitterOption() {
@@ -555,12 +572,12 @@ export class SallaProductOptions {
555
572
  }
556
573
  //@ts-ignore
557
574
  textOption(option) {
558
- return h("div", { class: "s-product-options-text" }, h("input", { type: "text", value: option.value, maxLength: option?.length, class: 's-form-control', required: !option.visibility_condition && option.required, name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option) }));
575
+ return h("div", { class: "s-product-options-text" }, h("input", { type: "text", value: option.value, maxLength: option?.length, class: 's-form-control', required: !option.visibility_condition && option.required, id: this.generateInputId(option.id), name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option) }));
559
576
  }
560
577
  //@ts-ignore
561
578
  textareaOption(option) {
562
579
  //todo::remove mt-1 class, and if it's okay to remove the tag itself will be great
563
- return h("div", { class: "s-product-options-textarea" }, h("div", { class: "mt-1" }, h("textarea", { rows: 4, value: option.value, maxLength: option?.length, class: "s-form-control", required: !option.visibility_condition && option.required, id: this.generateUniqueKey(option.id.toString()), name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) })));
580
+ return h("div", { class: "s-product-options-textarea" }, h("div", { class: "mt-1" }, h("textarea", { rows: 4, value: option.value, maxLength: option?.length, class: "s-form-control", required: !option.visibility_condition && option.required, id: this.generateInputId(option.id), name: this.generateInputName(option.id), placeholder: option.placeholder, onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) })));
564
581
  }
565
582
  //@ts-ignore
566
583
  mapOption(option) {
@@ -656,7 +673,7 @@ export class SallaProductOptions {
656
673
  * @returns HTMLElement - A select dropdown element with all option details.
657
674
  */
658
675
  renderSelect(option) {
659
- return (h("div", null, h("select", { name: this.generateInputName(option.id), required: !option.visibility_condition && option.required, class: "s-form-control", onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }, h("option", { value: "" }, option.placeholder), option?.details.map((detail) => (h("option", { key: detail.id, value: detail.id, disabled: this.canDisabled && this.isOptionDetailOut(detail), selected: detail.is_selected }, this.getOptionDetailName(detail)))))));
676
+ return (h("div", null, h("select", { id: this.generateInputId(option.id), name: this.generateInputName(option.id), required: !option.visibility_condition && option.required, class: "s-form-control", onInvalid: (e) => this.invalidHandler(e, option), onChange: (e) => this.changedHandler(e, option) }, h("option", { value: "" }, option.placeholder), option?.details.map((detail) => (h("option", { key: detail.id, value: detail.id, disabled: this.canDisabled && this.isOptionDetailOut(detail), selected: detail.is_selected }, this.getOptionDetailName(detail)))))));
660
677
  }
661
678
  /**
662
679
  * Renders a grid-based layout for option inputs (radio or checkbox).
@@ -732,7 +749,11 @@ export class SallaProductOptions {
732
749
  }
733
750
  countryOption(option) {
734
751
  return h("div", { class: "s-product-options-digital-card-wrapper" }, option.details.map((detail) => {
735
- return h("label", { htmlFor: this.generateUniqueKey(detail.id.toString()), key: detail.id, class: { "s-product-options-digital-card-option": true, "s-product-options-digital-card-option-stock-out": detail.is_out } }, h("input", { id: this.generateUniqueKey(detail.id.toString()), type: "radio", class: "s-form-control s-product-options-digital-card-input", value: detail.id, name: this.generateInputName(option.id), disabled: detail.is_out, required: !option.visibility_condition && option.required, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option), onClick: () => { this.disableCardValue = false; }, ...(salla.url.is_page("cart") ? { defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id } : {}) }), h("img", { loading: 'lazy', alt: detail.code, height: 24, width: 24, class: "s-product-options-country-flag", src: `https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(detail.code).toLocaleLowerCase()}.svg` }), h("span", null, detail.name));
752
+ return h("label", { htmlFor: this.generateUniqueKey(detail.id.toString()), key: detail.id, class: { "s-product-options-digital-card-option": true, "s-product-options-digital-card-option-stock-out": detail.is_out } }, h("input", { id: this.generateUniqueKey(detail.id.toString()), type: "radio", class: "s-form-control s-product-options-digital-card-input", value: detail.id, name: this.generateInputName(option.id), disabled: detail.is_out, required: !option.visibility_condition && option.required, onInvalid: (e) => this.invalidHandler(e, option), onChange: e => this.changedHandler(e, option), onClick: () => { this.disableCardValue = false; }, ...(salla.url.is_page("cart") ? { defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id } : {}) }), h("img", { loading: "lazy", alt: detail.code, height: 24, width: 24, class: "s-product-options-country-flag", src: `https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(detail.code).toLocaleLowerCase()}.svg`, onError: e => {
753
+ e.currentTarget.onerror = null;
754
+ e.currentTarget.src =
755
+ salla.url.cdn('images/globe.svg');
756
+ } }), h("span", null, detail.name));
736
757
  }));
737
758
  }
738
759
  static get is() { return "salla-product-options"; }
@@ -45,11 +45,11 @@ export class SallaProductSizeGuide {
45
45
  return h("salla-placeholder", { alignment: "center", iconSize: "xl" }, h("div", { slot: "title" }, this.placeholder_title), h("div", { slot: "description" }, this.placeholder_description));
46
46
  }
47
47
  render() {
48
- return (h("salla-modal", { key: '384f363c957c3df3ee65334136f7d0ef09ce36fc', class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("span", { key: '0c049828fbf3eae9156f24d6ef30b5b823bfd2c1', slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }), h("div", { key: '8166846ab7611d50796bce6d208f6978f5c1c088', slot: "loading" }, h("div", { key: '6feaa9186dfd939b36d05c5f337c8784fc644480', class: "s-product-size-guide-skeleton" }, h("salla-skeleton", { key: '921e7520d9a90e751222c18716bfb39a865b4b46', height: '15px', width: '25%' }), h("div", { key: '1ecb6eb9a1728656ddfe699cf376737dd7b72357', class: "s-product-size-guide-skeleton-header" }, h("salla-skeleton", { key: '9d8c11db7b515db9b4c341c90211882803a58e9c', height: '40px' }), h("salla-skeleton", { key: 'e91f8003b99e1126e5254a729d62542e032f4e99', height: '40px' }), h("salla-skeleton", { key: 'e6d30569c9d87bc0e9e273df13fb2d57d5bd3716', height: '40px' }), h("salla-skeleton", { key: '112765ae4bc7e1a41377e67523737049b8234e8d', height: '40px' })), h("div", { key: '2248ed8073b05ccea031742a498e1dc3bb3178e3', class: "s-product-size-guide-skeleton-content" }, h("salla-skeleton", { key: '7d5929af223435e8f43362f78b277bbd0e0d9479', height: '15px', width: '25%' }), h("salla-skeleton", { key: 'cd4eab828a3e625ab3a8f16f6199861035c1fe49', height: '10px', width: '75%' }), h("salla-skeleton", { key: '83c1a6ed44dc352dfb7e29e41f82b4f6043b0695', height: '10px', width: '50%' }), h("salla-skeleton", { key: 'f9c4005b5b2dbf50ec29506ccbf13fee6642fffa', height: '10px', width: '75%' }), h("salla-skeleton", { key: 'fed1a272411d0d092c9d384962e0d1dcfb10ca40', height: '10px', width: '100%' }), h("salla-skeleton", { key: 'a8933a1796a4993431fce91f9f471310aeca3a77', height: '10px', width: '25%' }), h("salla-skeleton", { key: '79a1e76732a2aff6245fd860940c37ea7e1a1b2b', height: '10px', width: '60%' }), h("salla-skeleton", { key: '19cf1175e01bb2e88e8253c5389d137d00441d77', height: '10px', width: '45%' }), h("salla-skeleton", { key: '919c1fe25c1d87a986560d915e1684ce041c3b41', height: '10px', width: '30%' })))), h("slot", { key: '583482193b8fbc5305b3f17e2a4b5ac432d02914', name: "header" }), !this.hasError && !!this.guides ?
48
+ return (h("salla-modal", { key: '6c952c6cdd01f99332809112fd5921c4b43cd518', class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, h("span", { key: 'f4260144f981da0081e09895b7a065cad1fa66bc', slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }), h("div", { key: '80e28a80741f103fdc788a6afa8809dfabfd64f6', slot: "loading" }, h("div", { key: 'e190d657a6a03e48a813c2f78321c12cf95eadcb', class: "s-product-size-guide-skeleton" }, h("salla-skeleton", { key: '94cb87240b52244a86ba76893261048aa3f356d9', height: '15px', width: '25%' }), h("div", { key: 'c8bba70713c78829d0973b845a3ed942cb7fa150', class: "s-product-size-guide-skeleton-header" }, h("salla-skeleton", { key: '13b2fe8a4655457567d087e5763e43abb8b2d2a5', height: '40px' }), h("salla-skeleton", { key: '4b23015076c7c44794eecf85a4355264f778ef10', height: '40px' }), h("salla-skeleton", { key: '3cd58dfafb05cc2bac89ad6973247075d0dd9571', height: '40px' }), h("salla-skeleton", { key: '36f28def58893e567e6186d94ec3a84abed159ab', height: '40px' })), h("div", { key: '854881c782f372b2ed1b08874dfa4bd5d64edef2', class: "s-product-size-guide-skeleton-content" }, h("salla-skeleton", { key: 'a790751c95177a49135859f5810b4cd947fa4314', height: '15px', width: '25%' }), h("salla-skeleton", { key: 'a9e4bd9a0bf55bd391da7f68ba85db7893f1eb81', height: '10px', width: '75%' }), h("salla-skeleton", { key: 'b0f73c83abd9b6e8521dacb823d65f13f9ba54bb', height: '10px', width: '50%' }), h("salla-skeleton", { key: 'fe92879eedf28801c4d267e4595e5f4aa5c7b871', height: '10px', width: '75%' }), h("salla-skeleton", { key: '652d460114bc710073adcb2e31a6627c938259c5', height: '10px', width: '100%' }), h("salla-skeleton", { key: '71f461d5256a05d4ac407b00daf2e20dccef0cf5', height: '10px', width: '25%' }), h("salla-skeleton", { key: 'dbd224caad4233eb0bf8a5012fab7160d067d371', height: '10px', width: '60%' }), h("salla-skeleton", { key: 'c87baa836ae0282047ccc8b7fb122a80cdf7256a', height: '10px', width: '45%' }), h("salla-skeleton", { key: '2c02db790ed567de556d7fa74f48843d156dedb6', height: '10px', width: '30%' })))), h("slot", { key: '155efc69836cfc62382a8b3f7929c7200244f4ba', name: "header" }), !this.hasError && !!this.guides ?
49
49
  [
50
50
  h("salla-tabs", null, this.guides.map((guide) => h("salla-tab-header", { slot: "header", name: guide.name }, h("span", null, guide.name))), this.guides.map((guide) => h("salla-tab-content", { slot: "content", name: guide.name }, h("div", { innerHTML: guide.description }))))
51
51
  ]
52
- : this.showPlaceholder(), h("slot", { key: 'd6ad0d235f1bb604cdef6a8e092b80eb09e5c447', name: "footer" })));
52
+ : this.showPlaceholder(), h("slot", { key: '6d212a3d48df9363485e77f37f71276a1c3f8ee7', name: "footer" })));
53
53
  }
54
54
  static get is() { return "salla-product-size-guide"; }
55
55
  static get originalStyleUrls() {
@@ -7,6 +7,10 @@ import Minus from "../../assets/svg/minus.svg";
7
7
  import Helper from "../../Helpers/Helper";
8
8
  export class SallaQuantityInput {
9
9
  constructor() {
10
+ /**
11
+ * Based on store setting: store.settings.product.manual_quantity
12
+ */
13
+ this.disableInput = false;
10
14
  this.hostAttributes = {};
11
15
  this.hasIncrementSlot = false;
12
16
  this.hasDecrementSlot = false;
@@ -32,7 +36,9 @@ export class SallaQuantityInput {
32
36
  });
33
37
  });
34
38
  }
35
- componentWillLoad() {
39
+ async componentWillLoad() {
40
+ await salla.onReady();
41
+ this.disableInput = salla.config.get('store.settings.product.manual_quantity');
36
42
  this.quantity = parseInt(this.host.getAttribute('value')) || 1;
37
43
  this.hasIncrementSlot = !!this.host.querySelector('[slot="increment-button"]');
38
44
  this.hasDecrementSlot = !!this.host.querySelector('[slot="decrement-button"]');
@@ -80,7 +86,11 @@ export class SallaQuantityInput {
80
86
  return this.host;
81
87
  }
82
88
  render() {
83
- return (h(Host, { key: '28affdf05857418dae49033176368c0d94adb689', class: "s-quantity-input" }, h("div", { key: 'be40a888c3c22ff958e8c32691ad881d9d4b6fd5', class: "s-quantity-input-container" }, h("button", { key: '50149c259fb29239c685568b15320f11d6c278bd', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button" }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: 'c8e0e34aa674924fd5163cea734891d865ce22d0', name: "increment-button" })), h("input", { key: '778309d2e7e4c47fefecdcb0b2d56373eb120511', class: "s-quantity-input-input", ...this.getInputAttributes(), ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", value: this.quantity }), h("button", { key: '8827f979a0606757f904c9d92c42b86940bda956', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button" }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: '2d3bd8ae0cd13042dfc88314d6f4dfad751d004d', name: "decrement-button" })))));
89
+ const inputAttributes = this.getInputAttributes();
90
+ if (!inputAttributes['aria-label'] && !inputAttributes['aria-labelledby']) {
91
+ inputAttributes['aria-label'] = salla.lang.getWithDefault('common.elements.quantity', 'Quantity');
92
+ }
93
+ return (h(Host, { key: '4dfc6c39c86047493c7b37057c877657fc6206ab', class: "s-quantity-input" }, h("div", { key: '246b30299c5b318d9412d7b065e0a219a77ba342', class: "s-quantity-input-container" }, h("button", { key: '1e8f61c6014f36e257fbc7958547228481393624', onClick: () => this.increase(), class: "s-quantity-input-increase-button s-quantity-input-button", type: "button", "aria-label": salla.lang.getWithDefault('common.elements.increase_quantity', 'Increase quantity') }, !this.hasIncrementSlot ? h("span", { innerHTML: Add }) : '', h("slot", { key: '1da4aa703d8f135437e49b35c8bd664a39c207cc', name: "increment-button" })), h("input", { key: 'd781816bc3fa9b2fc5d004c5284a583f0dc4f75b', class: "s-quantity-input-input", ...inputAttributes, ref: (el) => this.textInput = el, onInput: (event) => this.setValue(event.target.value), min: "1", readOnly: this.disableInput, value: this.quantity }), h("button", { key: 'a52ed57453eeae844e435de4f1d0e9ae66768892', class: "s-quantity-input-decrease-button s-quantity-input-button", onClick: () => this.decrease(), type: "button", "aria-label": salla.lang.getWithDefault('common.elements.decrease_quantity', 'Decrease quantity') }, !this.hasDecrementSlot ? h("span", { innerHTML: Minus }) : '', h("slot", { key: '9c2b8ef10df5dc976120249dbc5fb6d3e3b68d31', name: "decrement-button" })))));
84
94
  }
85
95
  static get is() { return "salla-quantity-input"; }
86
96
  static get originalStyleUrls() {
@@ -118,6 +128,7 @@ export class SallaQuantityInput {
118
128
  }
119
129
  static get states() {
120
130
  return {
131
+ "disableInput": {},
121
132
  "quantity": {},
122
133
  "fireChangeEvent": {}
123
134
  };
@@ -129,7 +129,7 @@ export class SallaQuickBuy {
129
129
  return new Promise((resolve, reject) => {
130
130
  salla.onReady(async () => {
131
131
  if (!this.currency) {
132
- this.currency = salla.config.get('user.currency_code');
132
+ this.currency = salla.config.get('store.settings.buy_now.multi_currency') ? salla.config.get('user.currency_code') : 'SAR';
133
133
  }
134
134
  if (!this.productId && salla.config.get('page.id')) {
135
135
  this.productId = salla.config.get('page.id');
@@ -184,7 +184,7 @@ export class SallaQuickBuy {
184
184
  });
185
185
  }
186
186
  render() {
187
- return h(Host, { key: '0d36f47ae833aca9cd0b70490eb7092d8d430e24' }, this.quickBuyButton());
187
+ return h(Host, { key: 'a6093f9df07d58cc290a3376c44847c8b4c345ce' }, this.quickBuyButton());
188
188
  }
189
189
  quickBuyButton() {
190
190
  return h("apple-pay-button", { locale: salla.config.get('user.language_code'), onClick: () => this.quickBuyHandler(), "data-quick-purchase": "applepay", class: "s-quick-buy-apple-pay", "data-is-applepay": "1", buttonstyle: "black", type: this.type });
@@ -158,7 +158,7 @@ export class SallaReviewCard {
158
158
  return (h("a", { href: this.review?.product?.url, class: "s-review-card-product-container" }, h("img", { alt: product.image?.alt || "Product", src: product.image?.url, class: "s-review-card-product-image", width: 60, height: 60, loading: "lazy", decoding: "async", draggable: false }), h("div", { class: "s-review-card-product-details" }, h("p", { class: "s-review-card-product-details-name" }, product.name), this.showPurchaseCount ? h("p", { class: "s-review-card-product-details-purchase-count" }, h("span", { innerHTML: IconFire2 }), this.purchasedCount) : null)));
159
159
  }
160
160
  render() {
161
- return h("div", { key: '57b8602cde06bc2846839c094cdfeb1f92780a2b', class: "s-review-card-container" }, this.renderSlider(), this.renderSingleImage(), renderDivider(), h("div", { key: 'b2688bb378d07c71a77d5df33dc24f6a20430345', class: "s-review-card-content" }, this.renderHeader(), h("p", { key: '1e9b07be77c6705a2bfeb5ca52ddb27c78823082', class: "s-review-card-review-content", innerHTML: this.review?.content }), renderDivider(), this.renderProductInfo()));
161
+ return h("div", { key: '251b76f2f2935ab7be248f589badaebe0f297cb2', class: "s-review-card-container" }, this.renderSlider(), this.renderSingleImage(), renderDivider(), h("div", { key: '2621097a4115e278b1b99d46b6be22341a7ea064', class: "s-review-card-content" }, this.renderHeader(), h("p", { key: 'cd641970280867954f431fc3a2812080ebe32bd9', class: "s-review-card-review-content", innerHTML: this.review?.content }), renderDivider(), this.renderProductInfo()));
162
162
  }
163
163
  static get is() { return "salla-review-card"; }
164
164
  static get originalStyleUrls() {
@@ -85,7 +85,7 @@ export class SallaReviews {
85
85
  });
86
86
  }
87
87
  render() {
88
- return (h("div", { key: '739e117f33d9f071215068317af037bc00c989c8', class: "s-reviews-container" }, h("div", { key: '995ab49861aeaf2acb6358e5cd746d7891175554', class: "s-reviews-header-wrapper" }, h("h1", { key: 'd2e4f0938ad61c64f8709dc05124887e4602a7be', class: "s-reviews-header" }, this.testimonialText), !!this.displayAllLink ? (h("a", { href: this.displayAllURL, class: "s-reviews-display-all" }, this.displayAllLinkText, h("span", { class: "s-reviews-display-all-icon", innerHTML: IconArrowLeft }))) : null), h("salla-slider", { key: '9eb679a2bcb336db54987e1cf52e25845e3da3c6', centered: true, "slides-per-view": 1, type: "testimonials", class: "s-reviews-testimonials-slider", "controls-outer": true, "auto-play": true, id: `testimonials-${this.source}-slider` }, h("div", { key: 'b0d5f0336b5b7f5c3f0992b141d4e92ba6fbc38b', slot: "items" }, this.reviews.map((item, index) => (h("div", { key: index, class: "s-reviews-swiper-slide" }, h("div", { class: "s-reviews-testimonial" }, h("div", { class: "s-reviews-testimonial__inner" }, h("div", { class: "s-reviews-testimonial__avatar" }, h("img", { src: 'images/s-empty.png', "data-src": item.avatar, alt: item.name ? item.name : 'testimonial-' + index, class: "lazy" })), h("div", { class: "s-reviews-testimonial__text" }, h("p", { innerHTML: item.content }), h("div", { class: "s-reviews-testimonial__name_wrapper" }, h("div", { class: "s-reviews-testimonial__info" }, item.name && h("h2", null, `${item.name}`)), h("div", { class: "s-reviews-testimonial__rating" }, h("salla-rating-stars", { size: "small", value: item.stars })))), h("span", { class: "s-reviews-testimonial__icon", innerHTML: IconQuoteOpen }))))))))));
88
+ return (h("div", { key: 'aa4937182950d1b0fbcb67aa577d6fb3c413af79', class: "s-reviews-container" }, h("div", { key: 'dbfb22a037c29a0bf88b73481aa8ea4988ef819a', class: "s-reviews-header-wrapper" }, h("h1", { key: '7b874af56f8933777942d829d1311cd0854e5a12', class: "s-reviews-header" }, this.testimonialText), !!this.displayAllLink ? (h("a", { href: this.displayAllURL, class: "s-reviews-display-all" }, this.displayAllLinkText, h("span", { class: "s-reviews-display-all-icon", innerHTML: IconArrowLeft }))) : null), h("salla-slider", { key: '0050aac87a3aadc858aa352ba7ac82158bb586de', centered: true, "slides-per-view": 1, type: "testimonials", class: "s-reviews-testimonials-slider", "controls-outer": true, "auto-play": true, id: `testimonials-${this.source}-slider` }, h("div", { key: '7d1801d35aeba19fa913609202128b6866ca7118', slot: "items" }, this.reviews.map((item, index) => (h("div", { key: index, class: "s-reviews-swiper-slide" }, h("div", { class: "s-reviews-testimonial" }, h("div", { class: "s-reviews-testimonial__inner" }, h("div", { class: "s-reviews-testimonial__avatar" }, h("img", { src: 'images/s-empty.png', "data-src": item.avatar, alt: item.name ? item.name : 'testimonial-' + index, class: "lazy" })), h("div", { class: "s-reviews-testimonial__text" }, h("p", { innerHTML: item.content }), h("div", { class: "s-reviews-testimonial__name_wrapper" }, h("div", { class: "s-reviews-testimonial__info" }, item.name && h("h2", null, `${item.name}`)), h("div", { class: "s-reviews-testimonial__rating" }, h("salla-rating-stars", { size: "small", value: item.stars })))), h("span", { class: "s-reviews-testimonial__icon", innerHTML: IconQuoteOpen }))))))))));
89
89
  }
90
90
  static get is() { return "salla-reviews"; }
91
91
  static get originalStyleUrls() {
@@ -142,7 +142,7 @@ export class SallaReviewsPage {
142
142
  return options.map(option => (h("option", { key: option.value, value: option.value, selected: option.value === this.sort }, option.label)));
143
143
  }
144
144
  render() {
145
- return (h("host", { key: '15a205e6f8aa688b4b2a38bc990bc9c6800b7ef6' }, h("div", { key: '3ad7666bdae456b056e450143f4112987b59a0aa', class: "s-reviews-page-header-wrapper" }, h("h2", { key: '75b2e6b66ac8690505dcc21739beb82449eb176d', class: "s-reviews-page-title" }, this.langTitlesReviews, h("span", { key: '3984e8157aed8909a529c603a2004688ceb10a1d', class: "s-reviews-page-count" }, "(", this.langRatingReviews, ")")), h("div", { key: '2dbfe5c5922b7ecabbdc9468cfe2af3a52a01bd0', class: "s-reviews-page-filter-wrapper" }, h("label", { key: '6ab3f0f16f585267755b02a3de92fbda73b767b9', class: "s-reviews-page-filter-label", htmlFor: "testimonials-filter" }, this.langSorting), h("select", { key: 'c282ada5d6c15d97a85148b6bc9eceb97eac1277', onChange: (e) => this.handleSorting(e), disabled: !this.reviews.length, class: "s-reviews-page-filter" }, this.renderSortingOptions()))), this.reviews.length ? h("main", { class: "s-reviews-page-grid", ref: el => {
145
+ return (h("host", { key: '5e3b4042e6412dd2fdef3d776d4204c731df6c80' }, h("div", { key: 'a9daf869bac109b7c627c9fd8fd7c84cd4dd2965', class: "s-reviews-page-header-wrapper" }, h("h2", { key: '01cd6892650d8288003d79b4c12e82c4693e1cb6', class: "s-reviews-page-title" }, this.langTitlesReviews, h("span", { key: '935329858a3cc699da6fb6fb8c8515348ded9eb4', class: "s-reviews-page-count" }, "(", this.langRatingReviews, ")")), h("div", { key: 'e74312403c6dc7625c0c2090e6627a8a6b5fca9b', class: "s-reviews-page-filter-wrapper" }, h("label", { key: 'bf51576936b030ee59836861b03fa3b06471ed1f', class: "s-reviews-page-filter-label", htmlFor: "testimonials-filter" }, this.langSorting), h("select", { key: '72f09a679c5f42b08f55b908f67f3d3627b3a50c', onChange: (e) => this.handleSorting(e), disabled: !this.reviews.length, class: "s-reviews-page-filter" }, this.renderSortingOptions()))), this.reviews.length ? h("main", { class: "s-reviews-page-grid", ref: el => {
146
146
  this.wrapper = el;
147
147
  } }, this.reviews.map(review => (h("salla-review-card", { key: review.id, review: review }))))
148
148
  : h("div", { class: "s-products-list-placeholder" }, h("span", { innerHTML: ShoppingBag }), h("p", null, this.placeholderText)), this.pagination?.links?.next && this.reviews.length ? (h("div", { class: "s-reviews-page-load-more-container" }, h("salla-button", { class: "s-reviews-page-load-more-btn", loading: this.isLoading, onClick: () => this.infiniteScroll?.loadNextPage(), onKeyUp: () => this.infiniteScroll?.loadNextPage() }, this.langLoadMore))) : null));
@@ -146,7 +146,7 @@ export class SallaScopees {
146
146
  return salla.onReady();
147
147
  }
148
148
  render() {
149
- return (h(Host, { key: 'c9e89e9452e6227472d007e01bcb84f3e8662b31' }, h("salla-modal", { key: '9f3bde0125dec95840a9df1c1ae7730f291acc6f', ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: this.loading, "has-skeleton": true }, this.loading ?
149
+ return (h(Host, { key: '8cbe5fbbe87bff9b835ae59fc92278725a9d09cf' }, h("salla-modal", { key: '82017d18802be5fa8fff95b2cbe32886308bb23e', ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: this.loading, "has-skeleton": true }, this.loading ?
150
150
  h("div", { slot: "loading" }, h("div", { class: "s-scopes-skeleton" }, h("salla-list-tile", { class: "s-scopes-header" }, h("div", { slot: "icon", class: "s-scopes-header-icon" }, h("salla-skeleton", { type: "circle" })), h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-scopes-skeleton-search" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '30px', width: '100%' })), h("div", { class: "s-scopes-skeleton-scopes" }, h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-scopes-skeleton-btn" }, h("salla-skeleton", { height: '40px', width: '100%' }))))
151
151
  :
152
152
  [h("salla-list-tile", { class: this.originalScopesList?.length ? "s-scopes-header block" : "s-hidden" }, h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), h("div", { slot: "title", class: "s-scopes-header-title" }, salla.lang.get('blocks.scope.you_are_browse_store_from')), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList?.length && h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList?.length > this.searchDisplayLimit ?
@@ -121,12 +121,12 @@ export class SallaSearch {
121
121
  this.inputValue.length < 3 ? this.container.classList.remove('s-search-no-results') : '';
122
122
  }
123
123
  render() {
124
- const searchContent = h("div", { key: '87730f3e2b289256978be308b6c89e7c6442fe90', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => this.container = container }, h("div", { key: '45cbe1c5c33aee61a41108c8a3d988f5148db9c9', class: "s-search-input-wrapper" }, h("span", { key: '804b1374b1d382a994329f966194b28b02cdaf67', class: "s-search-icon-wrap" }, h("span", { key: '750df807146faed676ecb89157d5c9c85b835e22', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: '3a1c7f98c40dff3d62f70d5e82f2c3d82436d29d', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => this.searchInput = input, style: { height: this.height + 'px', borderRadius: this.oval ? this.height / 2 + 'px' : '' } }), this.showAction ?
125
- h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search })) : null), h("div", { key: '52327f5d989f66c2d56574b88ca91c4397b9ef28', class: "s-search-results" }, this.results?.data.map((product) => h("a", { href: product.url + '?from=search-bar', class: { "s-search-product": true, 's-search-product-not-available': !product.is_available }, innerHTML: this.productSlot
124
+ const searchContent = h("div", { key: '2e945555af379b5992375336c5b33a1dbb92589b', class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => this.container = container }, h("div", { key: '28c948e49a1d72a3a79e87477f37cc5f26dd4b3a', class: "s-search-input-wrapper" }, h("span", { key: 'b053ea1b4e6ed3c4030010dd61923421fcfeb214', class: "s-search-icon-wrap" }, h("span", { key: 'e1ecd01ab77d0ddd0b7b2010788fe28deaebd2af', class: "s-search-icon", innerHTML: this.loading ? '<i class="s-search-spinner-loader"/>' : Search })), h("input", { key: 'bca441ce72aac9bb85f2862413c77fa853e703c6', type: "search", enterkeyhint: "search", autocomplete: "off", class: "s-search-input", placeholder: salla.lang.get('blocks.header.search_placeholder'), onInput: (e) => this.limitWordsAndSearch(e), onKeyDown: e => this.handleKeyDown(e), ref: input => this.searchInput = input, style: { height: this.height + 'px', borderRadius: this.oval ? this.height / 2 + 'px' : '' } }), this.showAction ?
125
+ h("salla-button", { loading: this.loading, class: { 's-search-action': true, 's-search-action-oval': this.oval }, onClick: () => this.handleActionClick() }, !this.loading && h("span", { innerHTML: Search })) : null), h("div", { key: '07ed4d8828b8343dd05bacb3a6904ad30eacce7a', class: "s-search-results" }, this.results?.data.map((product) => h("a", { href: product.url + '?from=search-bar', class: { "s-search-product": true, 's-search-product-not-available': !product.is_available }, innerHTML: this.productSlot
126
126
  .replace(/\{name\}/g, product.name)
127
127
  .replace(/\{price\}/g, product.price ? salla.money(product.price) : '')
128
128
  .replace(/\{regular_price\}/g, product.is_on_sale && product.regular_price ? salla.money(product.regular_price) : '')
129
- .replace(/\{image\}/g, product.image.url) })), h("p", { key: '0a6c1a9fd26eb21e94a23d1b4a12ad159e3321c7', ref: el => this.noResults = el, class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options'))));
129
+ .replace(/\{image\}/g, product.image.url) })), h("p", { key: '7a3420f60f2172f39c44633176a454f9ae06f0ce', ref: el => this.noResults = el, class: "s-search-no-results-placeholder" }, salla.lang.get('common.elements.no_options'))));
130
130
  return (this.inline ?
131
131
  h("div", { class: "s-search-modal" }, searchContent)
132
132
  :
@@ -22,7 +22,7 @@ export class SallaSkeleton {
22
22
  's-skeleton-item': true,
23
23
  's-skeleton-item-circular': this.type == 'circle',
24
24
  };
25
- return (h(Host, { key: '30502d1578371d865a0e18585d2c6a8943862d2e', class: "s-skeleton-wrapper", style: { width: this.width, height: this.height } }, h("div", { key: '9888e6790e33749ef8b9e5f0e0dbdbb12c202169', class: classes }, "\u00A0")));
25
+ return (h(Host, { key: 'ad465a77b10e2f1d739c802643076f63985cfda5', class: "s-skeleton-wrapper", style: { width: this.width, height: this.height } }, h("div", { key: '0b05bcfc21d3bcb85389a2a0c9b63c3a7aa28d60', class: classes }, "\u00A0")));
26
26
  }
27
27
  static get is() { return "salla-skeleton"; }
28
28
  static get originalStyleUrls() {
@@ -507,7 +507,7 @@ export class SallaSlider {
507
507
  classes += this.verticalThumbs ? ' s-slider-vertical ' : ' s-slider-horizontal ';
508
508
  classes += this.arrowsCentered ? ' s-slider-v-centered ' : '';
509
509
  classes += this.gridThumbs ? ' s-slider-with-grid-thumbs ' : '';
510
- return (h(Host, { key: '5f395e1022170d4e3c7d73868c107c240cd3e859', class: 's-slider-wrapper ' + classes }, this.blockTitle || this.showControls ?
510
+ return (h(Host, { key: '1ea8cca50a8069cfa57617a79d84a1d9a9f85d8a', class: 's-slider-wrapper ' + classes }, this.blockTitle || this.showControls ?
511
511
  h("div", { class: "s-slider-block__title" }, this.blockTitle ?
512
512
  h("div", { class: "s-slider-block__title-right" }, h("h2", null, this.blockTitle), this.blockSubtitle ? h("p", { innerHTML: this.blockSubtitle }) : '')
513
513
  : '', h("div", { class: "s-slider-block__title-left" }, this.displayAllUrl ?
@@ -515,7 +515,7 @@ export class SallaSlider {
515
515
  : '', this.showControls ?
516
516
  h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon })), h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon })))
517
517
  : ''))
518
- : '', h("div", { key: '6fe1748e02836b39f80c55871e3f62d94cf1402c', class: "swiper s-slider-container", ref: el => this.sliderContainer = el, dir: this.vertical ? "ltr" : this.direction }, h("slot", { key: 'bcb56faea40964993d0fce7355aab7b59d722f02' }), h("div", { key: '030ab812826807417b743659f1bf33aa534bd585', class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, h("slot", { key: 'a5e25081d9b27f188f818b3cfe9b973fabc7e256', name: 'items' })), this.pagination ? h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' && this.hasThumbSlot ? h("div", { class: "s-slider-thumbs" }, h("div", { class: "swiper s-slider-thumbs-container", dir: this.getThumbsDirection(), ref: el => this.thumbsSliderContainer = el }, h("div", { class: { "s-slider-swiper-wrapper swiper-wrapper": true, "s-slider-grid-thumbs": this.gridThumbs }, ref: el => this.thumbsSliderWrapper = el }, h("slot", { name: "thumbs" })), this.showThumbsControls ?
518
+ : '', h("div", { key: 'e782e1a255ef74387e143be5e54ec8212b133f63', class: "swiper s-slider-container", ref: el => this.sliderContainer = el, dir: this.vertical ? "ltr" : this.direction }, h("slot", { key: 'e69fb142f47b11d749a0ea2676177118eaa2093a' }), h("div", { key: '469f85e0a975a1de25c6c6c47918b85bb640e271', class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, h("slot", { key: '87d7c9b65e2d499bbd716a17ec5ce1f3079cc750', name: 'items' })), this.pagination ? h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' && this.hasThumbSlot ? h("div", { class: "s-slider-thumbs" }, h("div", { class: "swiper s-slider-thumbs-container", dir: this.getThumbsDirection(), ref: el => this.thumbsSliderContainer = el }, h("div", { class: { "s-slider-swiper-wrapper swiper-wrapper": true, "s-slider-grid-thumbs": this.gridThumbs }, ref: el => this.thumbsSliderWrapper = el }, h("slot", { name: "thumbs" })), this.showThumbsControls ?
519
519
  h("div", { class: "s-slider-thumbs-nav", dir: "rtl" }, h("button", { "aria-label": "Previous Slide", class: "s-slider-thumbs-prev s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon })), h("button", { "aria-label": "Next Slide", class: "s-slider-thumbs-next s-slider-nav-arrow" }, h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon })))
520
520
  : null))
521
521
  : null));
@@ -31,7 +31,7 @@ export class SallaSocial {
31
31
  }
32
32
  render() {
33
33
  const linksArray = this.getLinksArray();
34
- return (h(Host, { key: 'ae314660ceb6b6619fda1c95ee9ebc9eb8b56e49' }, h("ul", { key: 'a1ffb8cdcdd6cacd98c76ae6e003e45919075c41', class: "s-social-list" }, linksArray.map((link) => (h("li", { class: "s-social-link" }, h("div", { id: "social-slot", innerHTML: this.socialSlot
34
+ return (h(Host, { key: 'a0bcd60fddd2fd8e86f32cd71d484ec76d02cf49' }, h("ul", { key: 'b595d8de59199de5081370b9440c8a46cb8c751f', class: "s-social-list" }, linksArray.map((link) => (h("li", { class: "s-social-link" }, h("div", { id: "social-slot", innerHTML: this.socialSlot
35
35
  .replace(/\{icon\}/g, this.iconsList[link.type])
36
36
  .replace(/\{type\}/g, link.type)
37
37
  .replace(/\{link\}/g, link.value.toString()) })))))));
@@ -40,6 +40,9 @@ export class SallaSocialShare {
40
40
  this.platforms = 'facebook,twitter,whatsapp,email,copy_link';
41
41
  }
42
42
  componentWillLoad() {
43
+ if (this.host.hasAttribute('aria-label')) {
44
+ this.host.removeAttribute('aria-label');
45
+ }
43
46
  if (document.getElementById('a2a-script')) {
44
47
  return;
45
48
  }
@@ -119,7 +122,7 @@ export class SallaSocialShare {
119
122
  window.a2a?.init('page');
120
123
  }
121
124
  render() {
122
- return (h("div", { key: '0cc4ce871482b02588ae793d581b452c074ae292', class: "s-social-share-wrapper" }, h("slot", { key: 'b953d89a698d4c1801ef99831a9f29432f23f0f7', name: 'widget' }, h("salla-button", { key: 'f152f0839aa50406a5bac84298e580e6c51ca749', "aria-label": "Share", onClick: () => this.open(), class: "s-social-share-btn", shape: "icon", fill: "outline", color: "light" }, h("span", { key: '2e424400e4253f36824338c825bf9762fada793c', innerHTML: this.opened ? Cancel : ShareAlt }))), h("ul", { key: '38b3c21e35746e90d00d2fa14107cb66ab5b6eb4', ref: el => this.shareMenu = el, class: "s-social-share-list a2a_kit share", "data-a2a-url": this.url ? this.url : window.location.href, "data-a2a-title": this.urlName ? this.urlName : document.title }, this.platforms.split(',').map(platform => {
125
+ return (h("div", { key: 'c4ac8faea4a8ec8aa5ba9f4e744710d508387d78', class: "s-social-share-wrapper" }, h("slot", { key: '6c6b54513f67be8818a9a042570286d09b7115f8', name: 'widget' }, h("salla-button", { key: '8a57650940dad634cf3576dada4cc35687ed447c', "aria-label": "Share", onClick: () => this.open(), class: "s-social-share-btn", shape: "icon", fill: "outline", color: "light" }, h("span", { key: '207f2fb0e2f89e7057775153ffcc68eebb069824', innerHTML: this.opened ? Cancel : ShareAlt }))), h("ul", { key: 'fd9b25a483a93efa10994c2a7a876b6741d976c2', ref: el => this.shareMenu = el, class: "s-social-share-list a2a_kit share", "data-a2a-url": this.url ? this.url : window.location.href, "data-a2a-title": this.urlName ? this.urlName : document.title }, this.platforms.split(',').map(platform => {
123
126
  return (h("li", null, h("a", { class: `a2a_button_${platform}`, "aria-label": `Share Via ${platform}` }, this.platformIcons.map((icon) => {
124
127
  if (icon.name === platform) {
125
128
  return h("span", { class: "s-social-share-icon", innerHTML: icon.icon });
@@ -263,4 +266,5 @@ export class SallaSocialShare {
263
266
  }
264
267
  };
265
268
  }
269
+ static get elementRef() { return "host"; }
266
270
  }
@@ -30,7 +30,7 @@ export class SallaTabContent {
30
30
  's-tabs-content': true,
31
31
  's-tabs-content-selected': this.isSelected
32
32
  };
33
- return (h("div", { key: '5514145160fbb89b7a1eec0263c8ae164399da05', class: classes }, h("slot", { key: 'd6a6e6e2245f7225e6f40f700d00b3fe8a3f0f31' })));
33
+ return (h("div", { key: '6b11ec3a839c759e64e1766de55f9ac1be18931e', class: classes }, h("slot", { key: '17300d7a52e068428ea956b2c5d5be6d0ab69fca' })));
34
34
  }
35
35
  static get is() { return "salla-tab-content"; }
36
36
  static get originalStyleUrls() {
@@ -52,7 +52,7 @@ export class SallaTabHeader {
52
52
  's-tabs-active': this.isSelected,
53
53
  };
54
54
  return [
55
- h("div", { key: 'e5789e9c370c6ad2bcda924605ff41bbf222cb33', class: classes, onClick: this.onClick.bind(this) }, h("slot", { key: 'b0f31634fd70d3a46d6dca7f7a951be1bdbf6569' })),
55
+ h("div", { key: '08c51c1ad15c6b0efbeb165c89fc7d73748467d0', class: classes, onClick: this.onClick.bind(this) }, h("slot", { key: 'ba5045dab7c254eb4533dc64630ab0c1f561701b' })),
56
56
  ];
57
57
  }
58
58
  static get is() { return "salla-tab-header"; }
@@ -50,7 +50,7 @@ export class SallaTabs {
50
50
  }
51
51
  render() {
52
52
  return [
53
- h("div", { key: '663a81a31e6b49c72d8ba27706037846385a5048', class: "s-tabs" }, h("div", { key: 'd58fb40e9afe024d274d9779d3bca68dcc1cb22f', class: "s-tabs-header" }, h("slot", { key: '513bbd3091f24dd9f8cb7a1f6750a8fe75d79bb1', name: "header" })), h("div", { key: 'daeb6318f0e10c1676a0c2b82e68af9e109397d9', class: "s-tabs-content-wrapper" }, h("slot", { key: '39b4e0ee8592d6c77007f61bb9a80043d20b3a72', name: "content" })))
53
+ h("div", { key: '3195e8954179d52867093b5e861b3c0caa6d7af6', class: "s-tabs" }, h("div", { key: 'cf75a77b6cc9b9cd288e963ee56acf19e177029a', class: "s-tabs-header" }, h("slot", { key: 'fa345597be2fbb8ff4f1cb420a030c5ec821bc8b', name: "header" })), h("div", { key: 'f7fd939608e5341b6d9c1d75e7d9dc909a4d8912', class: "s-tabs-content-wrapper" }, h("slot", { key: '86ce2c9bcb3be06264e75369a6be81b2e1361619', name: "content" })))
54
54
  ];
55
55
  }
56
56
  static get is() { return "salla-tabs"; }
@@ -123,7 +123,7 @@ export class SallaTelInput {
123
123
  }
124
124
  }
125
125
  render() {
126
- return (h(Host, { key: 'c1970701aebf32650bec6072f4c5494a7b443c79', class: "s-tel-input" }, h("input", { key: '9774b0740d214eb72f3da4ebd10f119ac4c47d89', type: "tel", disabled: this.disabled, name: this.name, value: this.phone, onChange: (event) => this.handleCountryInput(event), ref: el => this.phoneInput = el, enterkeyhint: "next", autocomplete: "tel", class: "s-tel-input-control tel-input s-ltr" }), h("span", { key: '9f159c42e3f9c8c0dba6205ba13d6de1f4462109', class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }), h("input", { key: 'a9c5b9c2aba8b5b35378481686ec9b6783fb101b', type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
126
+ return (h(Host, { key: '362e48d1b39b0715c10df0c15c730ca21793a46b', class: "s-tel-input" }, h("input", { key: '07dcb2fcf639c2d7b95c250079bd24a80441e0ca', type: "tel", disabled: this.disabled, name: this.name, value: this.phone, onChange: (event) => this.handleCountryInput(event), ref: el => this.phoneInput = el, enterkeyhint: "next", autocomplete: "tel", class: "s-tel-input-control tel-input s-ltr" }), h("span", { key: 'c50f81a50debf37dc92f81fc61c3ddd3e622031f', class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }), h("input", { key: '2217131b313a32c5b62dcce6132a4914f30dc005', type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
127
127
  }
128
128
  componentDidLoad() {
129
129
  this.initTelInput();
@@ -22,7 +22,7 @@ export class SallaTooltip {
22
22
  this.targetElement = document.getElementById(this.targetId);
23
23
  }
24
24
  render() {
25
- return (h("div", { key: '1de8b4c05780d978edc217c9de5421607290b34a', class: "s-tooltip-container" }, h("slot", { key: '633882a65d997d2d3ef0fb8ce050eda1b6444df3' }), this.show && h("div", { key: 'd74010440f5a2cc3b373d4311f6d26fe6c46b593', class: "s-tooltip-item" }, this.text)));
25
+ return (h("div", { key: 'f2a52de43a80ec8fe2f7f2120c8ba38c7228183f', class: "s-tooltip-container" }, h("slot", { key: 'dc6ac92e0b894fa4f6c01c2aa0fad39a195a8047' }), this.show && h("div", { key: '8d4f57501bbcdb423781f6711a4af7610b89faf7', class: "s-tooltip-item" }, this.text)));
26
26
  }
27
27
  static get is() { return "salla-tooltip"; }
28
28
  static get originalStyleUrls() {
@@ -124,6 +124,7 @@ export class SallaUserMenu {
124
124
  async componentWillLoad() {
125
125
  await salla.onReady();
126
126
  await salla.lang.onLoaded();
127
+ Salla.event.on('api::token.injected', (token) => this.profileUrl = this.buildProfileUrl(token));
127
128
  this.sallaAccountEnabled = Salla.config.get('store.features')?.includes('salla-account');
128
129
  this.items = this.sallaAccountEnabled ? { ...this.items, settings: SettingstIcon } : this.items;
129
130
  //we need it only in theme-y
@@ -132,7 +133,11 @@ export class SallaUserMenu {
132
133
  }
133
134
  //we need it to be the last item
134
135
  this.items.logout = LogoutIcon;
135
- this.profileUrl = `${Salla.config.get('account.url', 'https://accounts.salla.com')}/${salla.config.get('user.language_code')}/user?store=${Salla.config.get('store.id')}&info=${encodeURIComponent(Salla.storage.get('token'))}`;
136
+ let token = Salla.storage.get('token');
137
+ if (!token) {
138
+ token = '';
139
+ }
140
+ this.profileUrl = this.buildProfileUrl(token);
136
141
  const trigger = this.host.querySelector('[slot="trigger"]');
137
142
  this.triggerSlot =
138
143
  '<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>';
@@ -230,6 +235,9 @@ export class SallaUserMenu {
230
235
  componentDidLoad() {
231
236
  document.lazyLoadInstance?.update(this.host.querySelectorAll('.lazy'));
232
237
  }
238
+ buildProfileUrl(token) {
239
+ return `${Salla.config.get('account.url', 'https://accounts.salla.com')}/${salla.config.get('user.language_code')}/user?store=${Salla.config.get('store.id')}&info=${encodeURIComponent(token)}`;
240
+ }
233
241
  static get is() { return "salla-user-menu"; }
234
242
  static get originalStyleUrls() {
235
243
  return {
@@ -56,7 +56,7 @@ export class SallaUserSettings {
56
56
  await salla.profile.delete().finally(() => this.confirmationModal.close());
57
57
  }
58
58
  render() {
59
- return (h(Host, { key: 'ec0a4acb9df3401db99cec16067f6bd942a13dac', class: "s-user-settings-wrapper" }, this.canHideName && h("div", { key: 'e2326b1cf07a71b6153cf308cbc6576603750238', class: "s-user-settings-section" }, h("salla-list-tile", { key: 'dfb2108ffb91585ed13fbd57dd022be26caba564' }, h("div", { key: '5c409c117bab9442aa80d9a76e781e0494c74eae', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '5f361b8df7d36ae67c2538e420332cf2cd35dcad', innerHTML: UserCancel })), h("div", { key: '11efad0c8c14f372c6377b419545151f10468d06', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.hideMyName)), h("div", { key: '7eb0871e5bbc9b1d93fa2531665ea71a86abe909', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.hideMyNameDesc)), h("div", { key: '2c3458300fcd6e77c3ee6ac793e7e48a0973c19a', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '21ce7928f15d6e366dc0ff9741f1e335551221e3', class: "s-toggle" }, h("input", { key: 'd2795c7b04b4a88d86f7df40eb0b8a4c91d67e26', class: "s-toggle-input", checked: this.isHiddenName, onChange: (e) => this.toggleSetting('is_hidden_name', e), type: "checkbox" }), h("div", { key: '3a5f79277e6001a46daa62ddc3a1b7fe1e90aba0', class: "s-toggle-switcher" }))))), h("div", { key: '3c4dbc2b6246bad36014b2a546fcbb601cf492db', class: "s-user-settings-section" }, h("salla-list-tile", { key: '9aa2588f75f13249cd4f3afb8754c7e83cfd99dc' }, h("div", { key: '46676cb5c9252c00a964d0a7d9e65c8b6307d0c0', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '512c9be252b70f029c39da90a4253a86e28600a1', innerHTML: Bullhorn })), h("div", { key: '3765c432fbf079214bcd79ae247e8b8a04c7bdff', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.promotionalMsgs)), h("div", { key: 'c5f16f46d894631182f1266efc3b5835a75fc100', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.promotionalMsgsDesc)), h("div", { key: '3d8d2440fc51853efbdfbe97968d14a770a96e46', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '6d6d4d80b2d81fc99460e8b895afbbe2ceee674c', class: "s-toggle" }, h("input", { key: '1be1bc0d9fab3d1829e3aea336bfabef0ec46936', class: "s-toggle-input", checked: this.isNotifiable, onChange: (e) => this.toggleSetting('is_notifiable', e), type: "checkbox" }), h("div", { key: '1f2a00f621a5521b378e4c059d13a778277b66d0', class: "s-toggle-switcher" }))))), h("div", { key: '45f7184fecc12b058d27dbc698a486661dbd246f', class: "s-user-settings-section s-user-settings-section-deactivate-user" }, h("salla-list-tile", { key: '7b8d46aae51b3a416bca566e8f0bb328f2544bf2' }, h("div", { key: '914cdf3d0ee608988ebade460a39d41e303a6b95', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: 'a9fad1f10f2eef6c617130bbf48054f1945ff307', innerHTML: UserOff })), h("div", { key: 'f6e0e1735fa46b2b5a759858d8c24ffee917c6c6', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deactivateAccount)), h("div", { key: '71b84f766856ad6844805cfaf6146717bcae36ff', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.deactivateDesc)), h("div", { key: 'f2ae2cfaba59e1c745b96722076ec30600984925', slot: 'action', class: "s-user-settings-section-action" }, h("salla-button", { key: '5bf8bb39df0caab3b4ad77381799814632c65599', fill: "outline", color: "danger", shape: "btn", size: "medium", width: "normal", onClick: () => this.openDeactivateModal() }, this.capitalizeText(this.deactivateAccount))))), h("salla-modal", { key: '6b11f4737f2db50c1856583d56454bf77fbb11b1', width: "sm", subTitle: this.capitalizeText(this.sorryForLeavingText), ref: modal => this.confirmationModal = modal }, h("span", { key: '00116a316bf222ec493951b4ada7ccd26044d3fe', slot: 'icon', class: "s-user-settings-confirmation-icon", innerHTML: UserOff }), h("div", { key: 'dfb25cd0a4d95581fe9ea6b0f2524fcac32d3a53', class: "s-user-settings-confirmation" }, h("div", { key: '113dab7cf24bf0d66823a77ccb60c9f7f1513090', class: "s-user-settings-confirmation-warning" }, this.capitalizeText(this.warningText)), h("div", { key: 'b0316ad64a4b449d0cc4ec04e7aaaf9286caeb53', class: "s-user-settings-confirmation-actions" }, h("salla-button", { key: 'd0d97ccdd2ce6450f485043afaab0c08f2ef694d', width: "wide", onClick: () => this.confirmationModal.close() }, this.capitalizeText(this.keepAccount)), h("salla-button", { key: '772f3dca599f001e508e460f59a0b06deff94fbd', fill: 'outline', loading: this.buttonLoading, width: "wide", onClick: () => this.deleteAccount() }, this.capitalizeText(this.deactivateAccount)))))));
59
+ return (h(Host, { key: 'e47b5c39666443b29de9d54ec8f05cb97950ace1', class: "s-user-settings-wrapper" }, this.canHideName && h("div", { key: '54b3098aa736c43d6d3ef53f6a49710dc039a16d', class: "s-user-settings-section" }, h("salla-list-tile", { key: 'dd1d06cd2ad3e0696c76cfd3f4c8b342e774b679' }, h("div", { key: '2e8b8fb48d36ce6f183698cb60a856ee0b74c639', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '0f7158ae21c5a93c5458c38388c79fb7cfa1e88d', innerHTML: UserCancel })), h("div", { key: 'f3f648e8f55f5998362107654d3a3c438bec2999', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.hideMyName)), h("div", { key: 'eddfaf2a9faf242123db36f1aa5a87fc242f6ccc', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.hideMyNameDesc)), h("div", { key: '1112ebcb125325688758d57de115ed36d965752d', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '4bacd7e71a3f9ccef749d091d70be45b0184d195', class: "s-toggle" }, h("input", { key: '64db5795f938f72a5c0710c03c46f84bb0248b68', class: "s-toggle-input", checked: this.isHiddenName, onChange: (e) => this.toggleSetting('is_hidden_name', e), type: "checkbox" }), h("div", { key: 'b1e178372d37f63992ba81ee6d5645fb17f5ce33', class: "s-toggle-switcher" }))))), h("div", { key: 'a11d585e1b5fe0430ca00757394e5c9a085192f9', class: "s-user-settings-section" }, h("salla-list-tile", { key: '61ad291644bc8314b443eec5d3a32abccc9c46ba' }, h("div", { key: 'e54526b5f18ce365d68efb9292af2d67ae20b77b', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: 'e2bb0f2b30ac57d6336785485ef99279acf09617', innerHTML: Bullhorn })), h("div", { key: '2f6ec0835993e79b1923778bfe0d6442d71809f0', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.promotionalMsgs)), h("div", { key: '6ad65576302c12e2298abd3de70fd5edd54aa542', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.promotionalMsgsDesc)), h("div", { key: '05f00c6ed5511bd6a21b3e01a54a01549c758940', slot: 'action', class: "s-user-settings-section-action" }, h("label", { key: '5c3520e04e57205dfe2e7f441e45c46682a56ad4', class: "s-toggle" }, h("input", { key: '8f7f59433b3685acbc0d35c6ceca93a9a6a4ebbf', class: "s-toggle-input", checked: this.isNotifiable, onChange: (e) => this.toggleSetting('is_notifiable', e), type: "checkbox" }), h("div", { key: 'a92abe23b596360bfb3e516ffb0789b53abaabd0', class: "s-toggle-switcher" }))))), h("div", { key: '0996cc090ab85a67e763b5acd19cc87db11c090d', class: "s-user-settings-section s-user-settings-section-deactivate-user" }, h("salla-list-tile", { key: 'f6b43aa4a618d75981fed8844ed1f4ebc3947239' }, h("div", { key: '3027e7c901c1ec214a9effdbd36e1c25d96cdb75', slot: "icon", class: "s-user-settings-section-icon" }, h("span", { key: '11468d7a54fa406e697e07b2ff2fe5c945a28746', innerHTML: UserOff })), h("div", { key: 'c2fd73f5d313daaba740c89ad2654144f6f54bb1', slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deactivateAccount)), h("div", { key: 'e2bad2737f3ca8e30bbb375ad7691d607366551c', slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.deactivateDesc)), h("div", { key: 'df155e019df0514ed77faaeef107845ce144ca08', slot: 'action', class: "s-user-settings-section-action" }, h("salla-button", { key: 'e7bd07fcbc49ba9e991adf52854b35c9ca8d0344', fill: "outline", color: "danger", shape: "btn", size: "medium", width: "normal", onClick: () => this.openDeactivateModal() }, this.capitalizeText(this.deactivateAccount))))), h("salla-modal", { key: '730df3b04afb89a1eba96651899cf84818d49b6b', width: "sm", subTitle: this.capitalizeText(this.sorryForLeavingText), ref: modal => this.confirmationModal = modal }, h("span", { key: '5254b44fac993e1e1454da4eae346afc5ad7211c', slot: 'icon', class: "s-user-settings-confirmation-icon", innerHTML: UserOff }), h("div", { key: '9c07be490266024dee72ca4a244c8dd4ffdd9d71', class: "s-user-settings-confirmation" }, h("div", { key: 'd42ac2fa9cc0030778b444b21958992677667cc3', class: "s-user-settings-confirmation-warning" }, this.capitalizeText(this.warningText)), h("div", { key: 'b3cd6b31255244c469571beaf05a0f266eb431af', class: "s-user-settings-confirmation-actions" }, h("salla-button", { key: 'aadfefcd7e2561542adb10c416bac0ff14b25fef', width: "wide", onClick: () => this.confirmationModal.close() }, this.capitalizeText(this.keepAccount)), h("salla-button", { key: '12693adf31b54a4ca993632fb527dac91ec810b2', fill: 'outline', loading: this.buttonLoading, width: "wide", onClick: () => this.deleteAccount() }, this.capitalizeText(this.deactivateAccount)))))));
60
60
  }
61
61
  static get is() { return "salla-user-settings"; }
62
62
  static get originalStyleUrls() {
@@ -0,0 +1,21 @@
1
+ // Plugin to fix @rollup/plugin-commonjs "Cannot read properties of undefined (reading 'resolved')" error
2
+ // in watch/dev mode. This only affects dev builds - production builds retain full caching.
3
+
4
+ function isDevMode() {
5
+ return process.argv.includes('-w') || process.argv.includes('--watch') || process.argv.includes('--dev');
6
+ }
7
+
8
+ function commonjsCacheFix() {
9
+ const devMode = isDevMode();
10
+ return {
11
+ name: 'commonjs-cache-fix',
12
+ options(options) {
13
+ if (devMode) {
14
+ return { ...options, cache: false };
15
+ }
16
+ return null; // return null to preserve original options unchanged
17
+ }
18
+ };
19
+ }
20
+
21
+ module.exports = { commonjsCacheFix, isDevMode };