@salla.sa/twilight-components 2.14.261 → 2.14.262

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 (304) hide show
  1. package/dist/cjs/{app-globals-9KVXzA9b.js → app-globals-e3kKmuwC.js} +3 -3
  2. package/dist/cjs/{app-globals-9KVXzA9b.js.map → app-globals-e3kKmuwC.js.map} +1 -1
  3. package/dist/cjs/{index-CfmOwvmC.js → index-BJv-nH8x.js} +4 -4
  4. package/dist/cjs/index-BJv-nH8x.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-accordion_4.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  39. package/dist/cjs/twilight.cjs.js +2 -2
  40. package/dist/components/index.js +2 -2
  41. package/dist/components/index.js.map +1 -1
  42. package/dist/esm/{app-globals-BgG-hCSq.js → app-globals-VqthM5f6.js} +3 -3
  43. package/dist/esm/{app-globals-BgG-hCSq.js.map → app-globals-VqthM5f6.js.map} +1 -1
  44. package/dist/esm/{index-LSZwJPPB.js → index-gdhHvm6V.js} +4 -4
  45. package/dist/esm/index-gdhHvm6V.js.map +1 -0
  46. package/dist/esm/loader.js +3 -3
  47. package/dist/esm/salla-accordion_4.entry.js +1 -1
  48. package/dist/esm/salla-add-product-button_51.entry.js +1 -1
  49. package/dist/esm/salla-advertisement.entry.js +1 -1
  50. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  51. package/dist/esm/salla-apps-icons.entry.js +1 -1
  52. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  53. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  54. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  55. package/dist/esm/salla-contacts.entry.js +1 -1
  56. package/dist/esm/salla-filters-widget.entry.js +1 -1
  57. package/dist/esm/salla-filters.entry.js +1 -1
  58. package/dist/esm/salla-installment.entry.js +1 -1
  59. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  60. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  61. package/dist/esm/salla-metadata.entry.js +1 -1
  62. package/dist/esm/salla-notification-item.entry.js +1 -1
  63. package/dist/esm/salla-notifications.entry.js +1 -1
  64. package/dist/esm/salla-offer.entry.js +1 -1
  65. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  66. package/dist/esm/salla-order-details.entry.js +1 -1
  67. package/dist/esm/salla-order-summary.entry.js +1 -1
  68. package/dist/esm/salla-orders.entry.js +1 -1
  69. package/dist/esm/salla-payments.entry.js +1 -1
  70. package/dist/esm/salla-price-range.entry.js +1 -1
  71. package/dist/esm/salla-product-options.entry.js +1 -1
  72. package/dist/esm/salla-review-card.entry.js +1 -1
  73. package/dist/esm/salla-reviews-page.entry.js +1 -1
  74. package/dist/esm/salla-reviews.entry.js +1 -1
  75. package/dist/esm/salla-social.entry.js +1 -1
  76. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  77. package/dist/esm/salla-tooltip.entry.js +1 -1
  78. package/dist/esm/salla-verify.entry.js +1 -1
  79. package/dist/esm/salla-wallet.entry.js +1 -1
  80. package/dist/esm/twilight.js +3 -3
  81. package/dist/esm-es5/{app-globals-BgG-hCSq.js → app-globals-VqthM5f6.js} +2 -2
  82. package/dist/esm-es5/{app-globals-BgG-hCSq.js.map → app-globals-VqthM5f6.js.map} +1 -1
  83. package/dist/esm-es5/{index-LSZwJPPB.js → index-gdhHvm6V.js} +3 -3
  84. package/dist/esm-es5/index-gdhHvm6V.js.map +1 -0
  85. package/dist/esm-es5/loader.js +1 -1
  86. package/dist/esm-es5/salla-accordion_4.entry.js +1 -1
  87. package/dist/esm-es5/salla-add-product-button_51.entry.js +4 -4
  88. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  89. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  90. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  91. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  92. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  93. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  94. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  95. package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
  96. package/dist/esm-es5/salla-filters.entry.js +1 -1
  97. package/dist/esm-es5/salla-installment.entry.js +1 -1
  98. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  99. package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
  100. package/dist/esm-es5/salla-metadata.entry.js +1 -1
  101. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  102. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  103. package/dist/esm-es5/salla-offer.entry.js +1 -1
  104. package/dist/esm-es5/salla-order-details-multiple-bundle-product.entry.js +1 -1
  105. package/dist/esm-es5/salla-order-details.entry.js +1 -1
  106. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  107. package/dist/esm-es5/salla-orders.entry.js +1 -1
  108. package/dist/esm-es5/salla-payments.entry.js +1 -1
  109. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  110. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  111. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  112. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  113. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  114. package/dist/esm-es5/salla-social.entry.js +1 -1
  115. package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
  116. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  117. package/dist/esm-es5/salla-verify.entry.js +1 -1
  118. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  119. package/dist/esm-es5/twilight.js +1 -1
  120. package/dist/twilight/{p-64c8b0e2.system.entry.js → p-00d05d4c.system.entry.js} +2 -2
  121. package/dist/twilight/{p-de2b1078.system.entry.js → p-07327345.system.entry.js} +2 -2
  122. package/dist/twilight/{p-1f93b886.system.entry.js → p-16493b31.system.entry.js} +2 -2
  123. package/dist/twilight/{p-ea832823.system.entry.js → p-18eaeb07.system.entry.js} +2 -2
  124. package/dist/twilight/{p-09bc1f72.system.entry.js → p-1e3e4a84.system.entry.js} +2 -2
  125. package/dist/twilight/{p-aa49c07f.entry.js → p-1e4e21ab.entry.js} +2 -2
  126. package/dist/twilight/{p-fcfd9a2b.entry.js → p-1e5c48d0.entry.js} +2 -2
  127. package/dist/twilight/{p-39d68fc1.system.entry.js → p-229e4f73.system.entry.js} +2 -2
  128. package/dist/twilight/{p-4eef3c0e.system.entry.js → p-2314d050.system.entry.js} +2 -2
  129. package/dist/twilight/{p-059405fc.system.entry.js → p-243cd247.system.entry.js} +2 -2
  130. package/dist/twilight/{p-143dd94c.system.entry.js → p-28cc1200.system.entry.js} +2 -2
  131. package/dist/twilight/{p-ce02710a.entry.js → p-2f3b050a.entry.js} +2 -2
  132. package/dist/twilight/{p-c09565da.entry.js → p-36f043a4.entry.js} +2 -2
  133. package/dist/twilight/{p-f0cc5b35.entry.js → p-37bdeacb.entry.js} +2 -2
  134. package/dist/twilight/{p-0e1cd76c.system.entry.js → p-42aa8f00.system.entry.js} +3 -3
  135. package/dist/twilight/{p-47de107e.entry.js → p-4446d80b.entry.js} +6 -6
  136. package/dist/twilight/{p-88e53a1e.system.entry.js → p-4f54efd1.system.entry.js} +2 -2
  137. package/dist/twilight/{p-9e6c5671.entry.js → p-513eb3ab.entry.js} +2 -2
  138. package/dist/twilight/{p-fa5ead87.entry.js → p-51563172.entry.js} +2 -2
  139. package/dist/twilight/{p-d660efad.entry.js → p-545204c4.entry.js} +2 -2
  140. package/dist/twilight/{p-1f8bf87a.entry.js → p-58702c6a.entry.js} +2 -2
  141. package/dist/twilight/{p-c38dbed0.entry.js → p-5fb7d021.entry.js} +2 -2
  142. package/dist/twilight/{p-b0d88d59.entry.js → p-6234d5b1.entry.js} +2 -2
  143. package/dist/twilight/{p-5bae6d14.system.entry.js → p-66440eaf.system.entry.js} +2 -2
  144. package/dist/twilight/{p-c5fa09d1.system.entry.js → p-68e96348.system.entry.js} +2 -2
  145. package/dist/twilight/{p-675d4ab7.entry.js → p-6d9239fa.entry.js} +2 -2
  146. package/dist/twilight/{p-d1ef5396.entry.js → p-7a849013.entry.js} +2 -2
  147. package/dist/twilight/{p-d62c20f1.system.entry.js → p-7d8494a1.system.entry.js} +2 -2
  148. package/dist/twilight/{p-Xd4af-0t.system.js.map → p-7hzBIbI9.system.js.map} +1 -1
  149. package/dist/twilight/{p-fe0234a1.entry.js → p-8aa7e30f.entry.js} +2 -2
  150. package/dist/twilight/{p-87d32e2f.entry.js → p-8f3dec24.entry.js} +2 -2
  151. package/dist/twilight/{p-Cnbdx_CN.system.js.map → p-93DWpqSw.system.js.map} +1 -1
  152. package/dist/twilight/{p-4806aee6.system.entry.js → p-953d84e6.system.entry.js} +2 -2
  153. package/dist/twilight/{p-d3a36873.entry.js → p-9a8f94bd.entry.js} +2 -2
  154. package/dist/twilight/{p-H5xAa3Fp.system.js.map → p-B1BJxOVi.system.js.map} +1 -1
  155. package/dist/twilight/{p-B52cxJwt.system.js → p-BEQYXrdz.system.js} +2 -2
  156. package/dist/twilight/{p-B52cxJwt.system.js.map → p-BEQYXrdz.system.js.map} +1 -1
  157. package/dist/twilight/{p-CNqf1L3p.system.js.map → p-BKXNNMLm.system.js.map} +1 -1
  158. package/dist/twilight/{p-DQg5Q6X-.js → p-BReGkw3Y.js} +2 -2
  159. package/dist/twilight/{p-DQg5Q6X-.js.map → p-BReGkw3Y.js.map} +1 -1
  160. package/dist/twilight/{p-BMe9fgvJ.system.js.map → p-Bmkf6XAv.system.js.map} +1 -1
  161. package/dist/twilight/{p-DN3CCyG-.system.js.map → p-BmwVeBpY.system.js.map} +1 -1
  162. package/dist/twilight/{p-CLHJmBGj.system.js.map → p-BvtfE2-2.system.js.map} +1 -1
  163. package/dist/twilight/{p-BBjPvuu7.system.js.map → p-C6KNQG1y.system.js.map} +1 -1
  164. package/dist/twilight/{p-D3JDyRUW.system.js.map → p-C8x80jPq.system.js.map} +1 -1
  165. package/dist/twilight/{p-BC-cnFy-.system.js.map → p-CClJfpon.system.js.map} +1 -1
  166. package/dist/twilight/{p-Cb9M2a-j.system.js.map → p-CLWUAiQH.system.js.map} +1 -1
  167. package/dist/twilight/{p-jGMZVThE.system.js.map → p-COFul74p.system.js.map} +1 -1
  168. package/dist/twilight/{p-DaTp8sB1.system.js.map → p-COYoK3Au.system.js.map} +1 -1
  169. package/dist/twilight/{p-B7SRc_rs.system.js.map → p-CXqdittj.system.js.map} +1 -1
  170. package/dist/twilight/{p-C51w7Au-.system.js.map → p-Cbo44k63.system.js.map} +1 -1
  171. package/dist/twilight/{p-DS9HrJPI.system.js.map → p-D-3lG5I2.system.js.map} +1 -1
  172. package/dist/twilight/{p-B4sHNRyB.system.js.map → p-D3R0t76R.system.js.map} +1 -1
  173. package/dist/twilight/{p-D8jKZnWs.system.js.map → p-D6LCDuHg.system.js.map} +1 -1
  174. package/dist/twilight/{p-8i-yI1XS.system.js.map → p-DBvyXCi6.system.js.map} +1 -1
  175. package/dist/twilight/{p-DzjfnKbb.system.js.map → p-DJmCwgGP.system.js.map} +1 -1
  176. package/dist/twilight/{p-C_Jmr6ar.system.js.map → p-DR264Rhr.system.js.map} +1 -1
  177. package/dist/twilight/{p-DHFCX5Dz.system.js.map → p-DbmggJGw.system.js.map} +1 -1
  178. package/dist/twilight/{p-DVEvrSjN.system.js.map → p-Dko7YEnJ.system.js.map} +1 -1
  179. package/dist/twilight/{p-DNiwBHdX.system.js.map → p-DmPhtn_C.system.js.map} +1 -1
  180. package/dist/twilight/{p-BtWTphPP.system.js.map → p-DnJZZ7tb.system.js.map} +1 -1
  181. package/dist/twilight/{p-NCpDIEN8.system.js.map → p-DoWBCSPK.system.js.map} +1 -1
  182. package/dist/twilight/{p-MzTS1h7j.system.js.map → p-DpeEK_nM.system.js.map} +1 -1
  183. package/dist/twilight/{p-aff393D5.system.js.map → p-Dr_IaU2s.system.js.map} +1 -1
  184. package/dist/twilight/{p-CGmIt4gq.system.js.map → p-J6Yhk9LX.system.js.map} +1 -1
  185. package/dist/twilight/{p-Co12cj-7.system.js.map → p-UvhFktOU.system.js.map} +1 -1
  186. package/dist/twilight/{p-BL3DMysj.system.js.map → p-WTZEldbP.system.js.map} +1 -1
  187. package/dist/twilight/{p-d02a08e9.entry.js → p-a13b8146.entry.js} +2 -2
  188. package/dist/twilight/{p-f80b373d.system.entry.js → p-a15f23df.system.entry.js} +2 -2
  189. package/dist/twilight/{p-b94bc357.entry.js → p-a2128c52.entry.js} +2 -2
  190. package/dist/twilight/{p-ccffcd08.entry.js → p-a48c5028.entry.js} +2 -2
  191. package/dist/twilight/{p-aa357e2b.system.entry.js → p-a51585ee.system.entry.js} +2 -2
  192. package/dist/twilight/{p-2957c27c.entry.js → p-a56f6418.entry.js} +2 -2
  193. package/dist/twilight/{p-528aa2c4.system.entry.js → p-afecdf40.system.entry.js} +2 -2
  194. package/dist/twilight/{p-008a771c.entry.js → p-b589f4db.entry.js} +2 -2
  195. package/dist/twilight/{p-f1218836.system.entry.js → p-b9708fef.system.entry.js} +2 -2
  196. package/dist/twilight/{p-B2wed4KP.system.js.map → p-bGMoB2qG.system.js.map} +1 -1
  197. package/dist/twilight/{p-42bcde7d.entry.js → p-bad5d163.entry.js} +2 -2
  198. package/dist/twilight/{p-6a8ba65f.system.entry.js → p-c0871d45.system.entry.js} +2 -2
  199. package/dist/twilight/{p-6b1753ce.entry.js → p-c0951c06.entry.js} +2 -2
  200. package/dist/twilight/{p-5271a9e8.entry.js → p-c7973d48.entry.js} +2 -2
  201. package/dist/twilight/{p-188e8d1c.system.entry.js → p-c9fdaf20.system.entry.js} +3 -3
  202. package/dist/twilight/{p-3ede6721.entry.js → p-caac9050.entry.js} +2 -2
  203. package/dist/twilight/{p-71bd4d79.system.entry.js → p-d17bcd5b.system.entry.js} +2 -2
  204. package/dist/twilight/{p-6ad30bc0.entry.js → p-e2930923.entry.js} +2 -2
  205. package/dist/twilight/{p-b7572664.entry.js → p-e5ab5482.entry.js} +2 -2
  206. package/dist/twilight/{p-a13fcfe1.entry.js → p-e63915a5.entry.js} +2 -2
  207. package/dist/twilight/{p-68285203.system.entry.js → p-e6558318.system.entry.js} +2 -2
  208. package/dist/twilight/{p-81b99416.system.entry.js → p-e8c5510b.system.entry.js} +2 -2
  209. package/dist/twilight/{p-68327c54.entry.js → p-eb8c92b5.entry.js} +2 -2
  210. package/dist/twilight/{p-53e00642.system.entry.js → p-ef0d3f01.system.entry.js} +2 -2
  211. package/dist/twilight/{p-DaMdjqfe.system.js.map → p-etxkGBiL.system.js.map} +1 -1
  212. package/dist/twilight/{p-275332fa.system.entry.js → p-f065dc14.system.entry.js} +2 -2
  213. package/dist/twilight/{p-d1ca52ee.system.entry.js → p-f0aabe3f.system.entry.js} +2 -2
  214. package/dist/twilight/p-f1e1d569.system.entry.js +5 -0
  215. package/dist/twilight/{p-0407da23.entry.js → p-f342f449.entry.js} +2 -2
  216. package/dist/twilight/{p-2ed6d081.system.entry.js → p-f65cfedf.system.entry.js} +2 -2
  217. package/dist/twilight/{p-64de4869.system.entry.js → p-f9981248.system.entry.js} +2 -2
  218. package/dist/twilight/{p-a6961af5.entry.js → p-fbc449aa.entry.js} +2 -2
  219. package/dist/twilight/{p-e5eae8ce.system.entry.js → p-fc0f5c2e.system.entry.js} +2 -2
  220. package/dist/twilight/{p-9847a4f4.entry.js → p-fc37604a.entry.js} +2 -2
  221. package/dist/twilight/{p-dad1b603.system.entry.js → p-fc72825e.system.entry.js} +2 -2
  222. package/dist/twilight/{p-ef823dbd.system.entry.js → p-fc7808d3.system.entry.js} +2 -2
  223. package/dist/twilight/{p-LSZwJPPB.js → p-gdhHvm6V.js} +3 -3
  224. package/dist/twilight/p-gdhHvm6V.js.map +1 -0
  225. package/dist/twilight/{p-CCJYFUxF.system.js.map → p-kuWGCb9j.system.js.map} +1 -1
  226. package/dist/twilight/{p-Ce2XJNsy.system.js → p-sMaYJNRW.system.js} +3 -3
  227. package/dist/twilight/p-sMaYJNRW.system.js.map +1 -0
  228. package/dist/twilight/{p-BMCxvVxH.system.js → p-womksxIV.system.js} +2 -2
  229. package/dist/twilight/{p-BMCxvVxH.system.js.map → p-womksxIV.system.js.map} +1 -1
  230. package/dist/twilight/twilight.esm.js +1 -1
  231. package/dist/twilight/twilight.js +1 -1
  232. package/package.json +5 -5
  233. package/dist/cjs/index-CfmOwvmC.js.map +0 -1
  234. package/dist/esm/index-LSZwJPPB.js.map +0 -1
  235. package/dist/esm-es5/index-LSZwJPPB.js.map +0 -1
  236. package/dist/twilight/p-13a2e582.system.entry.js +0 -5
  237. package/dist/twilight/p-Ce2XJNsy.system.js.map +0 -1
  238. package/dist/twilight/p-LSZwJPPB.js.map +0 -1
  239. /package/dist/twilight/{p-64c8b0e2.system.entry.js.map → p-00d05d4c.system.entry.js.map} +0 -0
  240. /package/dist/twilight/{p-de2b1078.system.entry.js.map → p-07327345.system.entry.js.map} +0 -0
  241. /package/dist/twilight/{p-1f93b886.system.entry.js.map → p-16493b31.system.entry.js.map} +0 -0
  242. /package/dist/twilight/{p-ea832823.system.entry.js.map → p-18eaeb07.system.entry.js.map} +0 -0
  243. /package/dist/twilight/{p-09bc1f72.system.entry.js.map → p-1e3e4a84.system.entry.js.map} +0 -0
  244. /package/dist/twilight/{p-aa49c07f.entry.js.map → p-1e4e21ab.entry.js.map} +0 -0
  245. /package/dist/twilight/{p-fcfd9a2b.entry.js.map → p-1e5c48d0.entry.js.map} +0 -0
  246. /package/dist/twilight/{p-39d68fc1.system.entry.js.map → p-229e4f73.system.entry.js.map} +0 -0
  247. /package/dist/twilight/{p-4eef3c0e.system.entry.js.map → p-2314d050.system.entry.js.map} +0 -0
  248. /package/dist/twilight/{p-059405fc.system.entry.js.map → p-243cd247.system.entry.js.map} +0 -0
  249. /package/dist/twilight/{p-143dd94c.system.entry.js.map → p-28cc1200.system.entry.js.map} +0 -0
  250. /package/dist/twilight/{p-ce02710a.entry.js.map → p-2f3b050a.entry.js.map} +0 -0
  251. /package/dist/twilight/{p-c09565da.entry.js.map → p-36f043a4.entry.js.map} +0 -0
  252. /package/dist/twilight/{p-f0cc5b35.entry.js.map → p-37bdeacb.entry.js.map} +0 -0
  253. /package/dist/twilight/{p-0e1cd76c.system.entry.js.map → p-42aa8f00.system.entry.js.map} +0 -0
  254. /package/dist/twilight/{p-47de107e.entry.js.map → p-4446d80b.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-88e53a1e.system.entry.js.map → p-4f54efd1.system.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-9e6c5671.entry.js.map → p-513eb3ab.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-fa5ead87.entry.js.map → p-51563172.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-d660efad.entry.js.map → p-545204c4.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-1f8bf87a.entry.js.map → p-58702c6a.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-c38dbed0.entry.js.map → p-5fb7d021.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-b0d88d59.entry.js.map → p-6234d5b1.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-5bae6d14.system.entry.js.map → p-66440eaf.system.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-c5fa09d1.system.entry.js.map → p-68e96348.system.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-675d4ab7.entry.js.map → p-6d9239fa.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-d1ef5396.entry.js.map → p-7a849013.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-d62c20f1.system.entry.js.map → p-7d8494a1.system.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-fe0234a1.entry.js.map → p-8aa7e30f.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-87d32e2f.entry.js.map → p-8f3dec24.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-4806aee6.system.entry.js.map → p-953d84e6.system.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-d3a36873.entry.js.map → p-9a8f94bd.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-d02a08e9.entry.js.map → p-a13b8146.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-f80b373d.system.entry.js.map → p-a15f23df.system.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-b94bc357.entry.js.map → p-a2128c52.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-ccffcd08.entry.js.map → p-a48c5028.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-aa357e2b.system.entry.js.map → p-a51585ee.system.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-2957c27c.entry.js.map → p-a56f6418.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-528aa2c4.system.entry.js.map → p-afecdf40.system.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-008a771c.entry.js.map → p-b589f4db.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-f1218836.system.entry.js.map → p-b9708fef.system.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-42bcde7d.entry.js.map → p-bad5d163.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-6a8ba65f.system.entry.js.map → p-c0871d45.system.entry.js.map} +0 -0
  282. /package/dist/twilight/{p-6b1753ce.entry.js.map → p-c0951c06.entry.js.map} +0 -0
  283. /package/dist/twilight/{p-5271a9e8.entry.js.map → p-c7973d48.entry.js.map} +0 -0
  284. /package/dist/twilight/{p-188e8d1c.system.entry.js.map → p-c9fdaf20.system.entry.js.map} +0 -0
  285. /package/dist/twilight/{p-3ede6721.entry.js.map → p-caac9050.entry.js.map} +0 -0
  286. /package/dist/twilight/{p-71bd4d79.system.entry.js.map → p-d17bcd5b.system.entry.js.map} +0 -0
  287. /package/dist/twilight/{p-6ad30bc0.entry.js.map → p-e2930923.entry.js.map} +0 -0
  288. /package/dist/twilight/{p-b7572664.entry.js.map → p-e5ab5482.entry.js.map} +0 -0
  289. /package/dist/twilight/{p-a13fcfe1.entry.js.map → p-e63915a5.entry.js.map} +0 -0
  290. /package/dist/twilight/{p-68285203.system.entry.js.map → p-e6558318.system.entry.js.map} +0 -0
  291. /package/dist/twilight/{p-81b99416.system.entry.js.map → p-e8c5510b.system.entry.js.map} +0 -0
  292. /package/dist/twilight/{p-68327c54.entry.js.map → p-eb8c92b5.entry.js.map} +0 -0
  293. /package/dist/twilight/{p-53e00642.system.entry.js.map → p-ef0d3f01.system.entry.js.map} +0 -0
  294. /package/dist/twilight/{p-275332fa.system.entry.js.map → p-f065dc14.system.entry.js.map} +0 -0
  295. /package/dist/twilight/{p-d1ca52ee.system.entry.js.map → p-f0aabe3f.system.entry.js.map} +0 -0
  296. /package/dist/twilight/{p-13a2e582.system.entry.js.map → p-f1e1d569.system.entry.js.map} +0 -0
  297. /package/dist/twilight/{p-0407da23.entry.js.map → p-f342f449.entry.js.map} +0 -0
  298. /package/dist/twilight/{p-2ed6d081.system.entry.js.map → p-f65cfedf.system.entry.js.map} +0 -0
  299. /package/dist/twilight/{p-64de4869.system.entry.js.map → p-f9981248.system.entry.js.map} +0 -0
  300. /package/dist/twilight/{p-a6961af5.entry.js.map → p-fbc449aa.entry.js.map} +0 -0
  301. /package/dist/twilight/{p-e5eae8ce.system.entry.js.map → p-fc0f5c2e.system.entry.js.map} +0 -0
  302. /package/dist/twilight/{p-9847a4f4.entry.js.map → p-fc37604a.entry.js.map} +0 -0
  303. /package/dist/twilight/{p-dad1b603.system.entry.js.map → p-fc72825e.system.entry.js.map} +0 -0
  304. /package/dist/twilight/{p-ef823dbd.system.entry.js.map → p-fc7808d3.system.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{a as t,d as i,e,f as s,r,h as a,g as n}from"./p-LSZwJPPB.js";import{S as o}from"./p-DiKTtDW5.js";import{H as l}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";var c;var u;function f(){if(u)return c;u=1;var i=t();var e=function(){return i.Date.now()};c=e;return c}var h;var d;function v(){if(d)return h;d=1;var t=/\s/;function i(i){var e=i.length;while(e--&&t.test(i.charAt(e))){}return e}h=i;return h}var p;var m;function g(){if(m)return p;m=1;var t=v();var i=/^\s+/;function e(e){return e?e.slice(0,t(e)+1).replace(i,""):e}p=e;return p}var w;var y;function b(){if(y)return w;y=1;var t=g(),s=i(),r=e();var a=0/0;var n=/^[-+]0x[0-9a-f]+$/i;var o=/^0b[01]+$/i;var l=/^0o[0-7]+$/i;var c=parseInt;function u(i){if(typeof i=="number"){return i}if(r(i)){return a}if(s(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=s(e)?e+"":e}if(typeof i!="string"){return i===0?i:+i}i=t(i);var u=o.test(i);return u||l.test(i)?c(i.slice(2),u?2:8):n.test(i)?a:+i}w=u;return w}var _;var k;function T(){if(k)return _;k=1;var t=i(),e=f(),s=b();var r="Expected a function";var a=Math.max,n=Math.min;function o(i,o,l){var c,u,f,h,d,v,p=0,m=false,g=false,w=true;if(typeof i!="function"){throw new TypeError(r)}o=s(o)||0;if(t(l)){m=!!l.leading;g="maxWait"in l;f=g?a(s(l.maxWait)||0,o):f;w="trailing"in l?!!l.trailing:w}function y(t){var e=c,s=u;c=u=undefined;p=t;h=i.apply(s,e);return h}function b(t){p=t;d=setTimeout(T,o);return m?y(t):h}function _(t){var i=t-v,e=t-p,s=o-i;return g?n(s,f-e):s}function k(t){var i=t-v,e=t-p;return v===undefined||i>=o||i<0||g&&e>=f}function T(){var t=e();if(k(t)){return S(t)}d=setTimeout(T,_(t))}function S(t){d=undefined;if(w&&c){return y(t)}c=u=undefined;return h}function E(){if(d!==undefined){clearTimeout(d)}p=0;c=v=u=d=undefined}function C(){return d===undefined?h:S(e())}function M(){var t=e(),i=k(t);c=arguments;u=this;v=t;if(i){if(d===undefined){return b(v)}if(g){clearTimeout(d);d=setTimeout(T,o);return y(v)}}if(d===undefined){d=setTimeout(T,o)}return h}M.cancel=E;M.flush=C;return M}_=o;return _}var S;var E;function C(){if(E)return S;E=1;var t=T(),e=i();var s="Expected a function";function r(i,r,a){var n=true,o=true;if(typeof i!="function"){throw new TypeError(s)}if(e(a)){n="leading"in a?!!a.leading:n;o="trailing"in a?!!a.trailing:o}return t(i,r,{leading:n,maxWait:r,trailing:o})}S=r;return S}var M=C();var x=s(M);class L{constructor(t){this.grid=t;this.create=()=>{this.mutationObserver.observe(this.grid,{childList:true});for(const t of Array.from(this.grid.children)){this.resizeObserver.observe(t)}};this.onContainerMutation=t=>{const i=t.flatMap((t=>Array.from(t.removedNodes)));const e=t.flatMap((t=>Array.from(t.addedNodes)));for(const t of i){if(t instanceof Element){this.resizeObserver.unobserve(t)}}for(const t of e){if(t instanceof Element){this.resizeObserver.observe(t)}}if(i.length>0&&e.length===0){this.update()}};this.onChildrenResize=t=>{const i=t.filter((t=>t.target.parentElement!==null));if(i.length>0){this.update()}};this.update=x((()=>{const t=window.getComputedStyle(this.grid);if(t.getPropertyValue("display").includes("grid")===false){this.clean();return}const i=A(this.grid);if(i.length<=1){this.clean();return}const e=Number.parseFloat(t.getPropertyValue("row-gap").trim())||0;const s=Array.from(this.grid.children);for(let t=0;t<i.length;t++){const i=s[t];i===null||i===void 0?void 0:i.style.removeProperty("margin-top")}for(let t=0;t<s.length;t++){const r=s[t-i.length];const a=s[t];if(r!==undefined&&a!==undefined){const t=r.getBoundingClientRect().bottom;a.style.removeProperty("margin-top");const i=a.getBoundingClientRect().top;if(i-e!==t){const s=Math.round((t-(i-e)+Number.EPSILON)*100)/100;a.style.setProperty("margin-top",`${s}px`)}}}}),32);this.destroy=()=>{this.resizeObserver.disconnect();this.mutationObserver.disconnect();this.clean()};this.clean=()=>{for(const t of Array.from(this.grid.children)){t.style.removeProperty("margin-top")}};this.mutationObserver=new MutationObserver(this.onContainerMutation);this.resizeObserver=new ResizeObserver(this.onChildrenResize);if(CSS.supports("grid-template-rows","masonry")===false){this.create()}}[Symbol.dispose](){this.destroy()}}function A(t){const i=window.getComputedStyle(t);const e=i.getPropertyValue("grid-template-columns");return e.trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}const R=":host{display:block}";const j=class{constructor(t){r(this,t);this.reviews=[];this.isLoading=false;this.pagination=null;this.sort="latest"}getUrlParams(){const t=new URLSearchParams(window.location.search);return{sort:t.get("sort")||null,page:Number.parseInt(t.get("page"))||1}}updateUrlParams(t){const i=new URL(window.location.href);for(const[e,s]of Object.entries(t)){if(s){i.searchParams.set(e,s.toString())}else{i.searchParams.delete(e)}}window.history.replaceState({},"",i.toString())}fetchReviews(t,i){const e=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:i||e.page||1,sort:t||e.sort||null}})}async initializeMasonry(){const t=this.el.querySelector(".s-reviews-page-grid");if(!t)return;try{new L(t);salla.logger.info("Masonry initialized successfully")}catch(t){salla.logger.error("Masonry initialization failed:",t)}}animateReviewCards(){const t=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");l.animateItems(t)}initiateInfiniteScroll(){var t,i,e;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>{var t,i;return((i=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||i===void 0?void 0:i.next)||null},history:false,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(()=>{this.isLoading=true}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(t=>{this.pagination=t.pagination;this.reviews=[...this.reviews,...t.data];this.isLoading=false;this.updateUrlParams({page:t.pagination.current_page})}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("error",(t=>{salla.logger.error("Error loading more reviews:",t);this.isLoading=false}))}componentDidRender(){setTimeout((()=>{requestAnimationFrame(this.animateReviewCards.bind(this))}),176)}async componentWillLoad(){var t;try{await salla.onReady();this.langTitlesReviews=salla.lang.get("common.titles.reviews");this.langSorting=salla.lang.get("pages.categories.sorting");this.placeholderText=salla.lang.choice("pages.rating.reviews",0);this.langLoadMore=salla.lang.get("common.elements.load_more");this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc");this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc");this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc");this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");const i=this.getUrlParams();const e=await this.fetchReviews(i.sort);this.sort=i.sort;this.reviews=e.data;this.pagination=e.pagination;this.langRatingReviews=salla.lang.choice("pages.rating.reviews",(t=this.pagination)===null||t===void 0?void 0:t.total)}catch(t){salla.logger.error("Error loading reviews:",t)}}async handleSorting(t){const i=t.target.value;this.sort=i;this.updateUrlParams({sort:i,page:1});const e=await this.fetchReviews(i,1);this.reviews=e.data;this.pagination=e.pagination}async componentDidLoad(){await this.initializeMasonry();this.initiateInfiniteScroll();this.sort=this.getUrlParams().sort||"latest";this.updateUrlParams({sort:this.sort,page:1})}disconnectedCallback(){if(this.infiniteScroll){this.infiniteScroll.destroy()}}renderSortingOptions(){const t=[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}];return t.map((t=>a("option",{key:t.value,value:t.value,selected:t.value===this.sort},t.label)))}render(){var t,i;return a("host",{key:"f3b06307322a56ad320374a50e13161be4e7cc8a"},a("div",{key:"3dcabdae4ee87de5c62873f327657991a56bc0e1",class:"s-reviews-page-header-wrapper"},a("h2",{key:"61bca34f24c52440fd8f736f9a6ab2b37be65c34",class:"s-reviews-page-title"},this.langTitlesReviews,a("span",{key:"c29228eaa51e9c202c6031e5f69b95905aa5485a",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),a("div",{key:"81f964be39231e21cd7c994e7e241e755af54c86",class:"s-reviews-page-filter-wrapper"},a("label",{key:"d408952ef5ffba3bedd5e01b5c6edec1aeb34f28",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),a("select",{key:"5138fdf478aed6fea544dd1adf4d32f715f89532",onChange:t=>this.handleSorting(t),disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?a("main",{class:"s-reviews-page-grid",ref:t=>{this.wrapper=t}},this.reviews.map((t=>a("salla-review-card",{key:t.id,review:t})))):a("div",{class:"s-products-list-placeholder"},a("span",{innerHTML:o}),a("p",null,this.placeholderText)),((i=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||i===void 0?void 0:i.next)&&this.reviews.length?a("div",{class:"s-reviews-page-load-more-container"},a("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:()=>{var t;return(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()},onKeyUp:()=>{var t;return(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}},this.langLoadMore)):null)}get el(){return n(this)}};j.style=R;export{j as salla_reviews_page};
5
- //# sourceMappingURL=p-b94bc357.entry.js.map
4
+ import{a as t,d as i,e,f as s,r,h as a,g as n}from"./p-gdhHvm6V.js";import{S as o}from"./p-DiKTtDW5.js";import{H as l}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";var c;var u;function f(){if(u)return c;u=1;var i=t();var e=function(){return i.Date.now()};c=e;return c}var h;var d;function v(){if(d)return h;d=1;var t=/\s/;function i(i){var e=i.length;while(e--&&t.test(i.charAt(e))){}return e}h=i;return h}var p;var m;function g(){if(m)return p;m=1;var t=v();var i=/^\s+/;function e(e){return e?e.slice(0,t(e)+1).replace(i,""):e}p=e;return p}var w;var y;function b(){if(y)return w;y=1;var t=g(),s=i(),r=e();var a=0/0;var n=/^[-+]0x[0-9a-f]+$/i;var o=/^0b[01]+$/i;var l=/^0o[0-7]+$/i;var c=parseInt;function u(i){if(typeof i=="number"){return i}if(r(i)){return a}if(s(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=s(e)?e+"":e}if(typeof i!="string"){return i===0?i:+i}i=t(i);var u=o.test(i);return u||l.test(i)?c(i.slice(2),u?2:8):n.test(i)?a:+i}w=u;return w}var _;var k;function T(){if(k)return _;k=1;var t=i(),e=f(),s=b();var r="Expected a function";var a=Math.max,n=Math.min;function o(i,o,l){var c,u,f,h,d,v,p=0,m=false,g=false,w=true;if(typeof i!="function"){throw new TypeError(r)}o=s(o)||0;if(t(l)){m=!!l.leading;g="maxWait"in l;f=g?a(s(l.maxWait)||0,o):f;w="trailing"in l?!!l.trailing:w}function y(t){var e=c,s=u;c=u=undefined;p=t;h=i.apply(s,e);return h}function b(t){p=t;d=setTimeout(T,o);return m?y(t):h}function _(t){var i=t-v,e=t-p,s=o-i;return g?n(s,f-e):s}function k(t){var i=t-v,e=t-p;return v===undefined||i>=o||i<0||g&&e>=f}function T(){var t=e();if(k(t)){return E(t)}d=setTimeout(T,_(t))}function E(t){d=undefined;if(w&&c){return y(t)}c=u=undefined;return h}function S(){if(d!==undefined){clearTimeout(d)}p=0;c=v=u=d=undefined}function C(){return d===undefined?h:E(e())}function M(){var t=e(),i=k(t);c=arguments;u=this;v=t;if(i){if(d===undefined){return b(v)}if(g){clearTimeout(d);d=setTimeout(T,o);return y(v)}}if(d===undefined){d=setTimeout(T,o)}return h}M.cancel=S;M.flush=C;return M}_=o;return _}var E;var S;function C(){if(S)return E;S=1;var t=T(),e=i();var s="Expected a function";function r(i,r,a){var n=true,o=true;if(typeof i!="function"){throw new TypeError(s)}if(e(a)){n="leading"in a?!!a.leading:n;o="trailing"in a?!!a.trailing:o}return t(i,r,{leading:n,maxWait:r,trailing:o})}E=r;return E}var M=C();var x=s(M);class A{constructor(t){this.grid=t;this.create=()=>{this.mutationObserver.observe(this.grid,{childList:true});for(const t of Array.from(this.grid.children)){this.resizeObserver.observe(t)}};this.onContainerMutation=t=>{const i=t.flatMap((t=>Array.from(t.removedNodes)));const e=t.flatMap((t=>Array.from(t.addedNodes)));for(const t of i){if(t instanceof Element){this.resizeObserver.unobserve(t)}}for(const t of e){if(t instanceof Element){this.resizeObserver.observe(t)}}if(i.length>0&&e.length===0){this.update()}};this.onChildrenResize=t=>{const i=t.filter((t=>t.target.parentElement!==null));if(i.length>0){this.update()}};this.update=x((()=>{const t=window.getComputedStyle(this.grid);if(t.getPropertyValue("display").includes("grid")===false){this.clean();return}const i=L(this.grid);if(i.length<=1){this.clean();return}const e=Number.parseFloat(t.getPropertyValue("row-gap").trim())||0;const s=Array.from(this.grid.children);for(let t=0;t<i.length;t++){const i=s[t];i===null||i===void 0?void 0:i.style.removeProperty("margin-top")}for(let t=0;t<s.length;t++){const r=s[t-i.length];const a=s[t];if(r!==undefined&&a!==undefined){const t=r.getBoundingClientRect().bottom;a.style.removeProperty("margin-top");const i=a.getBoundingClientRect().top;if(i-e!==t){const s=Math.round((t-(i-e)+Number.EPSILON)*100)/100;a.style.setProperty("margin-top",`${s}px`)}}}}),32);this.destroy=()=>{this.resizeObserver.disconnect();this.mutationObserver.disconnect();this.clean()};this.clean=()=>{for(const t of Array.from(this.grid.children)){t.style.removeProperty("margin-top")}};this.mutationObserver=new MutationObserver(this.onContainerMutation);this.resizeObserver=new ResizeObserver(this.onChildrenResize);if(CSS.supports("grid-template-rows","masonry")===false){this.create()}}[Symbol.dispose](){this.destroy()}}function L(t){const i=window.getComputedStyle(t);const e=i.getPropertyValue("grid-template-columns");return e.trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}const R=":host{display:block}";const j=class{constructor(t){r(this,t);this.reviews=[];this.isLoading=false;this.pagination=null;this.sort="latest"}getUrlParams(){const t=new URLSearchParams(window.location.search);return{sort:t.get("sort")||null,page:Number.parseInt(t.get("page"))||1}}updateUrlParams(t){const i=new URL(window.location.href);for(const[e,s]of Object.entries(t)){if(s){i.searchParams.set(e,s.toString())}else{i.searchParams.delete(e)}}window.history.replaceState({},"",i.toString())}fetchReviews(t,i){const e=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:i||e.page||1,sort:t||e.sort||null}})}async initializeMasonry(){const t=this.el.querySelector(".s-reviews-page-grid");if(!t)return;try{new A(t);salla.logger.info("Masonry initialized successfully")}catch(t){salla.logger.error("Masonry initialization failed:",t)}}animateReviewCards(){const t=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");l.animateItems(t)}initiateInfiniteScroll(){var t,i,e;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>{var t,i;return((i=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||i===void 0?void 0:i.next)||null},history:false,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(()=>{this.isLoading=true}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(t=>{this.pagination=t.pagination;this.reviews=[...this.reviews,...t.data];this.isLoading=false;this.updateUrlParams({page:t.pagination.current_page})}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("error",(t=>{salla.logger.error("Error loading more reviews:",t);this.isLoading=false}))}componentDidRender(){setTimeout((()=>{requestAnimationFrame(this.animateReviewCards.bind(this))}),176)}async componentWillLoad(){var t;try{await salla.onReady();this.langTitlesReviews=salla.lang.get("common.titles.reviews");this.langSorting=salla.lang.get("pages.categories.sorting");this.placeholderText=salla.lang.choice("pages.rating.reviews",0);this.langLoadMore=salla.lang.get("common.elements.load_more");this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc");this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc");this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc");this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");const i=this.getUrlParams();const e=await this.fetchReviews(i.sort);this.sort=i.sort;this.reviews=e.data;this.pagination=e.pagination;this.langRatingReviews=salla.lang.choice("pages.rating.reviews",(t=this.pagination)===null||t===void 0?void 0:t.total)}catch(t){salla.logger.error("Error loading reviews:",t)}}async handleSorting(t){const i=t.target.value;this.sort=i;this.updateUrlParams({sort:i,page:1});const e=await this.fetchReviews(i,1);this.reviews=e.data;this.pagination=e.pagination}async componentDidLoad(){await this.initializeMasonry();this.initiateInfiniteScroll();this.sort=this.getUrlParams().sort||"latest";this.updateUrlParams({sort:this.sort,page:1})}disconnectedCallback(){if(this.infiniteScroll){this.infiniteScroll.destroy()}}renderSortingOptions(){const t=[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}];return t.map((t=>a("option",{key:t.value,value:t.value,selected:t.value===this.sort},t.label)))}render(){var t,i;return a("host",{key:"f3b06307322a56ad320374a50e13161be4e7cc8a"},a("div",{key:"3dcabdae4ee87de5c62873f327657991a56bc0e1",class:"s-reviews-page-header-wrapper"},a("h2",{key:"61bca34f24c52440fd8f736f9a6ab2b37be65c34",class:"s-reviews-page-title"},this.langTitlesReviews,a("span",{key:"c29228eaa51e9c202c6031e5f69b95905aa5485a",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),a("div",{key:"81f964be39231e21cd7c994e7e241e755af54c86",class:"s-reviews-page-filter-wrapper"},a("label",{key:"d408952ef5ffba3bedd5e01b5c6edec1aeb34f28",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),a("select",{key:"5138fdf478aed6fea544dd1adf4d32f715f89532",onChange:t=>this.handleSorting(t),disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?a("main",{class:"s-reviews-page-grid",ref:t=>{this.wrapper=t}},this.reviews.map((t=>a("salla-review-card",{key:t.id,review:t})))):a("div",{class:"s-products-list-placeholder"},a("span",{innerHTML:o}),a("p",null,this.placeholderText)),((i=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||i===void 0?void 0:i.next)&&this.reviews.length?a("div",{class:"s-reviews-page-load-more-container"},a("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:()=>{var t;return(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()},onKeyUp:()=>{var t;return(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}},this.langLoadMore)):null)}get el(){return n(this)}};j.style=R;export{j as salla_reviews_page};
5
+ //# sourceMappingURL=p-a2128c52.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as t,H as s,g as e}from"./p-LSZwJPPB.js";const i="";const l=class{constructor(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(a){salla.log("Bad json passed via entityId prop")}}}getValue(a){if(a.type==="file"){return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`}if(a.type==="url"){return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`}if(a.type==="date"){const t=new Date(a.value);const s=String(t.getDate()).padStart(2,"0");const e=String(t.getMonth()+1).padStart(2,"0");const i=t.getFullYear();const l=`${s}/${e}/${i}`;return l}return a.value}async componentWillLoad(){var a,t;await salla.onReady();if(!((a=salla.config.get("store.features"))===null||a===void 0?void 0:a.includes("custom-fields"))){return salla.logger.error("feature custom-fields is not activated")}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return salla.logger.error("can't render salla-metadata without enity-id prop!")}await salla.lang.onLoaded();this.download=salla.lang.get("pages.thank_you.download");const s=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=(t=s.data[0])===null||t===void 0?void 0:t.sections}render(){if(!this.specs.length){return}return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};l.style=i;export{l as salla_metadata};
5
- //# sourceMappingURL=p-ccffcd08.entry.js.map
4
+ import{r as a,h as t,H as s,g as e}from"./p-gdhHvm6V.js";const i="";const l=class{constructor(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(a){salla.log("Bad json passed via entityId prop")}}}getValue(a){if(a.type==="file"){return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`}if(a.type==="url"){return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`}if(a.type==="date"){const t=new Date(a.value);const s=String(t.getDate()).padStart(2,"0");const e=String(t.getMonth()+1).padStart(2,"0");const i=t.getFullYear();const l=`${s}/${e}/${i}`;return l}return a.value}async componentWillLoad(){var a,t;await salla.onReady();if(!((a=salla.config.get("store.features"))===null||a===void 0?void 0:a.includes("custom-fields"))){return salla.logger.error("feature custom-fields is not activated")}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return salla.logger.error("can't render salla-metadata without enity-id prop!")}await salla.lang.onLoaded();this.download=salla.lang.get("pages.thank_you.download");const s=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=(t=s.data[0])===null||t===void 0?void 0:t.sections}render(){if(!this.specs.length){return}return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};l.style=i;export{l as salla_metadata};
5
+ //# sourceMappingURL=p-a48c5028.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-Ce2XJNsy.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var n,s,i,e;return{setters:[function(t){n=t.r;s=t.h;i=t.g},function(t){e=t.a}],execute:function(){var a=":host{display:block}";var r=t("salla_advertisement",function(){function t(t){var s=this;n(this,t);var i;this.currentSlug=salla.config.get("page.slug");salla.onReady((function(){s.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||'<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n '}t.prototype.isNotVisible=function(t){return!!salla.storage.get("statusAd-".concat(t.id))};t.prototype.setCanDisplayFlag=function(t,n){if(!n){salla.storage.set("statusAd-".concat(t.id),"dismissed");e({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}};t.prototype.render=function(){var t=this;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((function(n){return s("div",{class:{"s-hidden":t.isNotVisible(n),"s-advertisement":true},"data-id":n.id,style:{"background-color":n.colors.bg,color:n.colors.text}},s("div",{id:"adv-slot",innerHTML:t.advSlot.replace("{iconElem}",'<i class="s-advertisement-content-icon '.concat(n.icon,'"></i>')).replace("{urlElem}",n.url?'<a href="'.concat(n.url,'" target="').concat(n.target,'">').concat(n.description,"</a>"):n.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",n.icon).replace("{url}",n.url).replace("{target}",n.target).replace("{description}",n.description).replace("{bg_color}",n.colors.bg).replace("{text_color}",n.colors.text)}))}))};t.prototype.componentWillLoad=function(){var t=this;return new Promise((function(t){return salla.onReady(t)})).then((function(){return salla.api.advertisement.fetch(t.currentSlug)})).then((function(t){return Array.isArray(t.data)?t.data.find((function(t){return!salla.storage.get("statusAd-".concat(t.id))})):null})).then((function(n){return t.advertisements=n?[n]:[]}))};t.prototype.componentDidRender=function(){var t=this;var n;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((function(){var n=t.host.querySelector(".s-advertisement-action");if(n){n.addEventListener("click",(function(){return t.setCanDisplayFlag(t.advertisements[0],false)}))}}));this.host.querySelectorAll("#adv-slot").forEach((function(t){return t===null||t===void 0?void 0:t.replaceWith(t===null||t===void 0?void 0:t.firstChild)}));(n=this.host.querySelector('[slot="adv"]'))===null||n===void 0?void 0:n.remove();e({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());r.style=a}}}));
5
- //# sourceMappingURL=p-aa357e2b.system.entry.js.map
4
+ System.register(["./p-sMaYJNRW.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var n,s,i,e;return{setters:[function(t){n=t.r;s=t.h;i=t.g},function(t){e=t.a}],execute:function(){var a=":host{display:block}";var r=t("salla_advertisement",function(){function t(t){var s=this;n(this,t);var i;this.currentSlug=salla.config.get("page.slug");salla.onReady((function(){s.currentSlug=salla.config.get("page.slug")}));this.advSlot=((i=this.host.querySelector('[slot="adv"]'))===null||i===void 0?void 0:i.innerHTML)||'<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n '}t.prototype.isNotVisible=function(t){return!!salla.storage.get("statusAd-".concat(t.id))};t.prototype.setCanDisplayFlag=function(t,n){if(!n){salla.storage.set("statusAd-".concat(t.id),"dismissed");e({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}};t.prototype.render=function(){var t=this;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((function(n){return s("div",{class:{"s-hidden":t.isNotVisible(n),"s-advertisement":true},"data-id":n.id,style:{"background-color":n.colors.bg,color:n.colors.text}},s("div",{id:"adv-slot",innerHTML:t.advSlot.replace("{iconElem}",'<i class="s-advertisement-content-icon '.concat(n.icon,'"></i>')).replace("{urlElem}",n.url?'<a href="'.concat(n.url,'" target="').concat(n.target,'">').concat(n.description,"</a>"):n.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",n.icon).replace("{url}",n.url).replace("{target}",n.target).replace("{description}",n.description).replace("{bg_color}",n.colors.bg).replace("{text_color}",n.colors.text)}))}))};t.prototype.componentWillLoad=function(){var t=this;return new Promise((function(t){return salla.onReady(t)})).then((function(){return salla.api.advertisement.fetch(t.currentSlug)})).then((function(t){return Array.isArray(t.data)?t.data.find((function(t){return!salla.storage.get("statusAd-".concat(t.id))})):null})).then((function(n){return t.advertisements=n?[n]:[]}))};t.prototype.componentDidRender=function(){var t=this;var n;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((function(){var n=t.host.querySelector(".s-advertisement-action");if(n){n.addEventListener("click",(function(){return t.setCanDisplayFlag(t.advertisements[0],false)}))}}));this.host.querySelectorAll("#adv-slot").forEach((function(t){return t===null||t===void 0?void 0:t.replaceWith(t===null||t===void 0?void 0:t.firstChild)}));(n=this.host.querySelector('[slot="adv"]'))===null||n===void 0?void 0:n.remove();e({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());r.style=a}}}));
5
+ //# sourceMappingURL=p-a51585ee.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as i,h as o,H as s,g as n}from"./p-LSZwJPPB.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
5
- //# sourceMappingURL=p-2957c27c.entry.js.map
4
+ import{r as t,c as i,h as o,H as s,g as n}from"./p-gdhHvm6V.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
5
+ //# sourceMappingURL=p-a56f6418.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,i,e,n){function s(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{c(n.next(t))}catch(t){r(t)}}function u(t){try{c(n["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):s(t.value).then(a,u)}c((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(i){return c([t,i])}}function c(u){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(n=1,s&&(r=u[0]&2?s["return"]:u[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,u[1])).done)return r;if(s=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;s=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=i.call(t,e)}catch(t){u=[6,t];s=0}finally{n=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-Ce2XJNsy.system.js","./p-CzwwMHuN.system.js","./p-Bnro4LR3.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var i,e,n,s,r,a,u;return{setters:[function(t){i=t.r;e=t.c;n=t.h;s=t.H;r=t.g},function(t){a=t.H},function(t){u=t.F},null],execute:function(){var c=":host{display:block}";var o=t("salla_filters_widget",function(){function t(t){i(this,t);this.changed=e(this,"changed");this.initHeight=195;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(){return __awaiter(this,arguments,void 0,(function(t){var i=this;if(t===void 0){t=250}return __generator(this,(function(e){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=i.widgetContent.scrollHeight;i.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===u.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.isOpen=!this.isOpen;a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var i=this;if(![u.VALUES,u.MINIMUM,u.VARIANTS].includes(t.type)){return""}return t.values.map((function(e,s){var r=typeof e=="number"?e:e.key||e.value;return n("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(r),key:"".concat(t.key,"-option-").concat(r)},n("input",{id:"".concat(t.key,"-option-").concat(r),name:t.key,type:"radio",checked:i.isSelectedOption(t,r),class:"s-filters-radio",onChange:function(e){return i.changed.emit({event:e,option:t,value:r})}}),i.getOptionLabel(t,e))}))};t.prototype.isSelectedOption=function(t,i){if(t.type===u.MINIMUM){return this.filtersData[t.key]==i}if(t.type===u.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==i}if(t.type===u.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==i.min&&this.filtersData[t.key].max==i.max}if(t.type===u.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(i)}return false};t.prototype.getOptionLabel=function(t,i){if(t.key=="rating"){return n("salla-rating-stars",{size:"small",value:i})}var e=i.value||"null";return n("span",{class:"s-filters-option-name"},e)};t.prototype.render=function(){var t=this;return n(s,{key:"1987fec03cfe48cddc60af2d81bbc30a476dcb61",class:"s-filters-widget-container"},n("h3",{key:"4232775c4012d1be8bb3036d9d09e5d29d951ee4",class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},n("span",{key:"61cf9ea5a69f3ab5377502a396cc84478c6152a1"},this.option.label),n("span",{key:"b75914eb06f9d419d0a89da2a8f2da2f891f3d27",class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),n("div",{key:"f65e2f8a44648b034dacf1bda1aa64b5398627b7",class:"s-filters-widget-content",ref:function(i){return t.widgetContent=i}},n("div",{key:"adcafe169ce8cbef671263f3624bce071b168c36",class:"s-filters-widget-values",ref:function(i){return t.widgetValues=i}},n("slot",{key:"fa006556e44e508c3c64cc5ae76cc826b7e7601e"}),this.option.type!==u.RANGE?this.renderFilterOption(this.option):n("salla-price-range",{onChanged:function(i){t.changed.emit(i.detail)},ref:function(i){return t.priceRange=i},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&n("a",{key:"16a4ddeb365dc1d52fc51a8999fc6d7dbe094658",class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());o.style=c}}}));
5
- //# sourceMappingURL=p-528aa2c4.system.entry.js.map
4
+ */System.register(["./p-sMaYJNRW.system.js","./p-CzwwMHuN.system.js","./p-Bnro4LR3.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var i,e,n,s,r,a,u;return{setters:[function(t){i=t.r;e=t.c;n=t.h;s=t.H;r=t.g},function(t){a=t.H},function(t){u=t.F},null],execute:function(){var c=":host{display:block}";var o=t("salla_filters_widget",function(){function t(t){i(this,t);this.changed=e(this,"changed");this.initHeight=195;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(){return __awaiter(this,arguments,void 0,(function(t){var i=this;if(t===void 0){t=250}return __generator(this,(function(e){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=i.widgetContent.scrollHeight;i.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===u.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.isOpen=!this.isOpen;a.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var i=this;if(![u.VALUES,u.MINIMUM,u.VARIANTS].includes(t.type)){return""}return t.values.map((function(e,s){var r=typeof e=="number"?e:e.key||e.value;return n("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(r),key:"".concat(t.key,"-option-").concat(r)},n("input",{id:"".concat(t.key,"-option-").concat(r),name:t.key,type:"radio",checked:i.isSelectedOption(t,r),class:"s-filters-radio",onChange:function(e){return i.changed.emit({event:e,option:t,value:r})}}),i.getOptionLabel(t,e))}))};t.prototype.isSelectedOption=function(t,i){if(t.type===u.MINIMUM){return this.filtersData[t.key]==i}if(t.type===u.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==i}if(t.type===u.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==i.min&&this.filtersData[t.key].max==i.max}if(t.type===u.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(i)}return false};t.prototype.getOptionLabel=function(t,i){if(t.key=="rating"){return n("salla-rating-stars",{size:"small",value:i})}var e=i.value||"null";return n("span",{class:"s-filters-option-name"},e)};t.prototype.render=function(){var t=this;return n(s,{key:"1987fec03cfe48cddc60af2d81bbc30a476dcb61",class:"s-filters-widget-container"},n("h3",{key:"4232775c4012d1be8bb3036d9d09e5d29d951ee4",class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},n("span",{key:"61cf9ea5a69f3ab5377502a396cc84478c6152a1"},this.option.label),n("span",{key:"b75914eb06f9d419d0a89da2a8f2da2f891f3d27",class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),n("div",{key:"f65e2f8a44648b034dacf1bda1aa64b5398627b7",class:"s-filters-widget-content",ref:function(i){return t.widgetContent=i}},n("div",{key:"adcafe169ce8cbef671263f3624bce071b168c36",class:"s-filters-widget-values",ref:function(i){return t.widgetValues=i}},n("slot",{key:"fa006556e44e508c3c64cc5ae76cc826b7e7601e"}),this.option.type!==u.RANGE?this.renderFilterOption(this.option):n("salla-price-range",{onChanged:function(i){t.changed.emit(i.detail)},ref:function(i){return t.priceRange=i},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&n("a",{key:"16a4ddeb365dc1d52fc51a8999fc6d7dbe094658",class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());o.style=c}}}));
5
+ //# sourceMappingURL=p-afecdf40.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-LSZwJPPB.js";import{S as i,A as e}from"./p-yRO-ZESF.js";import{G as c}from"./p-C0JNGIpa.js";var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n`;var a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n`;const l=":host{display:block}";const n=class{constructor(t){s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:o,GiftIcon:c,FireIcon:a,SpecialDiscountIcon:i,TagMoneyIcon:r};this.visibleOffersCount=3;this.handleCartItemUpdated=s=>{const t=s.data.cart.items.find((s=>s.id===this.itemId));if((t===null||t===void 0?void 0:t.id)===this.itemId){this.internalQuantity=t.quantity;this.internalOffers=t.detailed_offers||[];this.internalProductPrice=t.product_price}};this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady();await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam");this.receivedOffer=salla.lang.get("pages.cart.received_offer");this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}));this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice}componentDidLoad(){salla.event.on("cart::item.updated",(s=>this.handleCartItemUpdated(s)))}parseOffers(s){try{if(typeof s!=="string"){console.warn("Offers is not a string. Returning as-is.",s);return Array.isArray(s)?s:[]}return JSON.parse(s||"[]")}catch(s){console.error("Failed to parse offers",s);return[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(s,t){return s-t.free_quantity}renderOffer(s,i){const e=this.getPaidQty(s,i);return t("div",{class:"s-cart-item-offers-box"},i.free_quantity>0&&e>0&&t("div",{class:"s-cart-item-offers-paid-free"},t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",t("span",{innerHTML:salla.money(this.internalProductPrice)})),t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(i.free_quantity)," ×",t("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),t("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),t("div",{class:"s-cart-item-offers-details"},t("span",{class:`s-cart-item-offers-icon`,innerHTML:this.icons[i.discount_icon]||""}),t("div",null,t("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",i.offer_name)),t("p",{class:"s-cart-item-offers-discount"},t("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(i.discount_amount.toFixed(2)))})))))}render(){var s,i;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return t("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((s=>this.renderOffer(this.internalQuantity,s))),((i=this.internalOffers)===null||i===void 0?void 0:i.length)>this.visibleOffersCount&&t("div",{class:"s-cart-item-offers-show-more"},t("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},t("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,t("span",{innerHTML:e,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&t("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((s=>this.renderOffer(this.internalQuantity,s)))))}};n.style=l;export{n as salla_cart_item_offers};
5
- //# sourceMappingURL=p-008a771c.entry.js.map
4
+ import{r as s,h as t}from"./p-gdhHvm6V.js";import{S as i,A as e}from"./p-yRO-ZESF.js";import{G as c}from"./p-C0JNGIpa.js";var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n`;var a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n`;const l=":host{display:block}";const n=class{constructor(t){s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:o,GiftIcon:c,FireIcon:a,SpecialDiscountIcon:i,TagMoneyIcon:r};this.visibleOffersCount=3;this.handleCartItemUpdated=s=>{const t=s.data.cart.items.find((s=>s.id===this.itemId));if((t===null||t===void 0?void 0:t.id)===this.itemId){this.internalQuantity=t.quantity;this.internalOffers=t.detailed_offers||[];this.internalProductPrice=t.product_price}};this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady();await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam");this.receivedOffer=salla.lang.get("pages.cart.received_offer");this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}));this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice}componentDidLoad(){salla.event.on("cart::item.updated",(s=>this.handleCartItemUpdated(s)))}parseOffers(s){try{if(typeof s!=="string"){console.warn("Offers is not a string. Returning as-is.",s);return Array.isArray(s)?s:[]}return JSON.parse(s||"[]")}catch(s){console.error("Failed to parse offers",s);return[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(s,t){return s-t.free_quantity}renderOffer(s,i){const e=this.getPaidQty(s,i);return t("div",{class:"s-cart-item-offers-box"},i.free_quantity>0&&e>0&&t("div",{class:"s-cart-item-offers-paid-free"},t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",t("span",{innerHTML:salla.money(this.internalProductPrice)})),t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(i.free_quantity)," ×",t("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),t("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),t("div",{class:"s-cart-item-offers-details"},t("span",{class:`s-cart-item-offers-icon`,innerHTML:this.icons[i.discount_icon]||""}),t("div",null,t("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",i.offer_name)),t("p",{class:"s-cart-item-offers-discount"},t("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(i.discount_amount.toFixed(2)))})))))}render(){var s,i;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return t("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((s=>this.renderOffer(this.internalQuantity,s))),((i=this.internalOffers)===null||i===void 0?void 0:i.length)>this.visibleOffersCount&&t("div",{class:"s-cart-item-offers-show-more"},t("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},t("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,t("span",{innerHTML:e,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&t("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((s=>this.renderOffer(this.internalQuantity,s)))))}};n.style=l;export{n as salla_cart_item_offers};
5
+ //# sourceMappingURL=p-b589f4db.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-Ce2XJNsy.system.js"],(function(t){"use strict";var s,a,i,e;return{setters:[function(t){s=t.r;a=t.h;i=t.H;e=t.g}],execute:function(){var l=":host{display:block}";var n=t("salla_payments",function(){function t(t){s(this,t);this.exclude=[]}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var s,a,i;if(typeof t.exclude==="string"){try{t.exclude=JSON.parse(t.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",t.exclude);t.exclude=[]}}t.placeholderImage=salla.url.cdn("images/s-empty.png");t.paymentSlot=((s=t.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src="{image}" alt={payment} /><li>');t.sbcSlot=((a=t.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');t.codSlot=((i=t.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');t.payments=salla.config.get("store.settings.payments")}))};t.prototype.render=function(){var t=this;var s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");var e=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return a(i,{key:"a1a26ba03aa60491071f0e63bac40de3ad91bce6",class:"s-payments-list-wrap"},a("ul",{key:"d31ca162e83aade956f45d8f517029942a748646",class:"s-payments-list"},s&&a("li",{key:"552e3e57345d01ab33bfd20094cbcf8f702c6efa",class:"s-payments-list-item"},a("img",{key:"04eb9c9a1950edc9ea3c2e218fbe6c5c21d65f6a",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((function(s){return s=="cod"?a("div",{id:"cod-slot",innerHTML:t.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}):a("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(s,"_mini.png"),58,58)).replace(/\{payment\}/g,s)})})),e&&a("div",{key:"5f69b3c936edf8039006d6ecd73e3c44b74b9167",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(e))})))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,s,a;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(s=this.host.querySelector('[slot="sbc"]'))===null||s===void 0?void 0:s.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());n.style=l}}}));
5
- //# sourceMappingURL=p-f1218836.system.entry.js.map
4
+ System.register(["./p-sMaYJNRW.system.js"],(function(t){"use strict";var s,a,i,e;return{setters:[function(t){s=t.r;a=t.h;i=t.H;e=t.g}],execute:function(){var l=":host{display:block}";var n=t("salla_payments",function(){function t(t){s(this,t);this.exclude=[]}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var s,a,i;if(typeof t.exclude==="string"){try{t.exclude=JSON.parse(t.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",t.exclude);t.exclude=[]}}t.placeholderImage=salla.url.cdn("images/s-empty.png");t.paymentSlot=((s=t.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src="{image}" alt={payment} /><li>');t.sbcSlot=((a=t.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');t.codSlot=((i=t.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');t.payments=salla.config.get("store.settings.payments")}))};t.prototype.render=function(){var t=this;var s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");var e=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return a(i,{key:"a1a26ba03aa60491071f0e63bac40de3ad91bce6",class:"s-payments-list-wrap"},a("ul",{key:"d31ca162e83aade956f45d8f517029942a748646",class:"s-payments-list"},s&&a("li",{key:"552e3e57345d01ab33bfd20094cbcf8f702c6efa",class:"s-payments-list-item"},a("img",{key:"04eb9c9a1950edc9ea3c2e218fbe6c5c21d65f6a",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((function(s){return s=="cod"?a("div",{id:"cod-slot",innerHTML:t.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}):a("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(s,"_mini.png"),58,58)).replace(/\{payment\}/g,s)})})),e&&a("div",{key:"5f69b3c936edf8039006d6ecd73e3c44b74b9167",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(e))})))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,s,a;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(s=this.host.querySelector('[slot="sbc"]'))===null||s===void 0?void 0:s.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());n.style=l}}}));
5
+ //# sourceMappingURL=p-b9708fef.system.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-B2wed4KP.system.js","sources":["src/components/salla-cart-item-offers/salla-cart-item-offers.scss?tag=salla-cart-item-offers","src/components/salla-cart-item-offers/salla-cart-item-offers.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport SpecialDiscountIcon from '../../assets/svg/special-discount.svg';\nimport GiftIcon from '../../assets/svg/gift.svg';\nimport TagMoneyIcon from '../../assets/svg/tag-money.svg';\nimport FireIcon from '../../assets/svg/fire.svg';\nimport DiscountCouponIcon from '../../assets/svg/discount-coupon.svg';\nimport ArrowDownIcon from '../../assets/svg/keyboard_arrow_down.svg';\n\n@Component({\n tag: 'salla-cart-item-offers',\n styleUrl: 'salla-cart-item-offers.scss',\n})\nexport class SallaCartItemOffers {\n /**\n * The quantity of the cart item\n */\n @Prop() quantity!: number;\n /**\n * JSON string containing the offers associated with the cart item\n */\n @Prop() offers!: string;\n /**\n * The unique identifier of the cart item\n */\n @Prop() itemId!: number;\n /**\n * The original price of the product in the cart\n */\n @Prop() productPrice!: number;\n\n @State() internalQuantity!: number;\n @State() internalOffers: any[] = [];\n @State() internalProductPrice!: number;\n @State() showAll: boolean = false;\n // Translations\n @State() freeLabel: string = '';\n @State() receivedOffer: string = '';\n @State() discountAmountLabel: string = '';\n @State() showMoreOffers: string = '';\n\n\n private readonly icons: Record<string, string> = {\n DiscountCouponIcon,\n GiftIcon,\n FireIcon,\n SpecialDiscountIcon,\n TagMoneyIcon,\n };\n\n private visibleOffersCount = 3;\n\n async componentWillLoad() {\n await Salla.onReady();\n await salla.lang.onLoaded(() => {\n this.freeLabel = salla.lang.get('common.elements.freeExclam');\n this.receivedOffer = salla.lang.get('pages.cart.received_offer');\n this.discountAmountLabel = salla.lang.get('pages.cart.discount_amount');\n this.showMoreOffers = salla.lang.get('pages.cart.show_more_offers');\n });\n\n this.internalQuantity = this.quantity;\n this.internalOffers = this.parseOffers(this.offers);\n this.internalProductPrice = this.productPrice;\n }\n\n componentDidLoad() {\n salla.event.on('cart::item.updated', (event) => this.handleCartItemUpdated(event));\n }\n\n private parseOffers(offers: string): any[] {\n try {\n if (typeof offers !== 'string') {\n console.warn('Offers is not a string. Returning as-is.', offers);\n return Array.isArray(offers) ? offers : [];\n }\n\n return JSON.parse(offers || '[]');\n } catch (e) {\n console.error('Failed to parse offers', e);\n return [];\n }\n }\n\n private handleCartItemUpdated = (event) => {\n const updatedItem = event.data.cart.items.find((item) => item.id === this.itemId);\n if (updatedItem?.id === this.itemId) {\n this.internalQuantity = updatedItem.quantity;\n this.internalOffers = updatedItem.detailed_offers || [];\n this.internalProductPrice = updatedItem.product_price;\n }\n };\n\n private get visibleOffers() {\n return this.internalOffers.slice(0, this.visibleOffersCount);\n }\n\n private get hiddenOffers() {\n return this.internalOffers.slice(this.visibleOffersCount);\n }\n\n private toggleShowAll = () => {\n this.showAll = !this.showAll;\n };\n\n private getPaidQty(quantity: number, offer: any) {\n return quantity - offer.free_quantity;\n }\n\n private renderOffer(quantity: number, offer: any) {\n const paidQty = this.getPaidQty(quantity, offer);\n\n return (\n <div class=\"s-cart-item-offers-box\">\n {offer.free_quantity > 0 && paidQty > 0 && (\n <div class=\"s-cart-item-offers-paid-free\">\n <div class=\"s-cart-item-offers-line\">\n {salla.helpers.number(paidQty)} × <span innerHTML={salla.money(this.internalProductPrice)}></span>\n </div>\n <div class=\"s-cart-item-offers-line\">\n {salla.helpers.number(offer.free_quantity)} × \n <span class=\"s-cart-item-offers-regular-price\" innerHTML={salla.money(this.internalProductPrice)}></span>\n <span class=\"s-cart-item-offers-free-label\">{this.freeLabel}</span>\n </div>\n </div>\n )}\n\n <div class=\"s-cart-item-offers-details\">\n <span class={`s-cart-item-offers-icon`} innerHTML={this.icons[offer.discount_icon] || ''}></span>\n <div>\n <p class=\"s-cart-item-offers-title\">\n {this.receivedOffer.replace(':offer', offer.offer_name)}\n </p>\n <p class=\"s-cart-item-offers-discount\">\n <span innerHTML={this.discountAmountLabel.replace(':amount', salla.money(offer.discount_amount.toFixed(2)))}></span>\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n render() {\n if (!this.internalOffers?.length) {\n return null;\n }\n\n return (\n <div class=\"s-cart-item-offers-container\" id={`offers_list_${this.itemId}`}>\n {this.visibleOffers.map((offer) => this.renderOffer(this.internalQuantity, offer))}\n\n {this.internalOffers?.length > this.visibleOffersCount && (\n <div class=\"s-cart-item-offers-show-more\">\n <button\n class=\"s-cart-item-offers-show-more-btn\"\n onClick={this.toggleShowAll}\n type=\"button\">\n <span class=\"s-cart-item-offers-show-more-label\">\n +{this.hiddenOffers.length} {this.showMoreOffers}\n <span\n innerHTML={ArrowDownIcon}\n class={{\n 's-cart-item-offers-arrow-icon': true,\n 's-cart-item-offers-arrow-open': this.showAll,\n }}\n ></span>\n </span>\n </button>\n </div>\n )}\n\n {this.showAll && (\n <div class=\"s-cart-item-offers-collapsed\" id={`offers_${this.itemId}`}>\n {this.hiddenOffers.map((offer) => this.renderOffer(this.internalQuantity, offer))}\n </div>\n )}\n </div>\n );\n }\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"p-bGMoB2qG.system.js","sources":["src/components/salla-cart-item-offers/salla-cart-item-offers.scss?tag=salla-cart-item-offers","src/components/salla-cart-item-offers/salla-cart-item-offers.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Prop, State, h } from '@stencil/core';\nimport SpecialDiscountIcon from '../../assets/svg/special-discount.svg';\nimport GiftIcon from '../../assets/svg/gift.svg';\nimport TagMoneyIcon from '../../assets/svg/tag-money.svg';\nimport FireIcon from '../../assets/svg/fire.svg';\nimport DiscountCouponIcon from '../../assets/svg/discount-coupon.svg';\nimport ArrowDownIcon from '../../assets/svg/keyboard_arrow_down.svg';\n\n@Component({\n tag: 'salla-cart-item-offers',\n styleUrl: 'salla-cart-item-offers.scss',\n})\nexport class SallaCartItemOffers {\n /**\n * The quantity of the cart item\n */\n @Prop() quantity!: number;\n /**\n * JSON string containing the offers associated with the cart item\n */\n @Prop() offers!: string;\n /**\n * The unique identifier of the cart item\n */\n @Prop() itemId!: number;\n /**\n * The original price of the product in the cart\n */\n @Prop() productPrice!: number;\n\n @State() internalQuantity!: number;\n @State() internalOffers: any[] = [];\n @State() internalProductPrice!: number;\n @State() showAll: boolean = false;\n // Translations\n @State() freeLabel: string = '';\n @State() receivedOffer: string = '';\n @State() discountAmountLabel: string = '';\n @State() showMoreOffers: string = '';\n\n\n private readonly icons: Record<string, string> = {\n DiscountCouponIcon,\n GiftIcon,\n FireIcon,\n SpecialDiscountIcon,\n TagMoneyIcon,\n };\n\n private visibleOffersCount = 3;\n\n async componentWillLoad() {\n await Salla.onReady();\n await salla.lang.onLoaded(() => {\n this.freeLabel = salla.lang.get('common.elements.freeExclam');\n this.receivedOffer = salla.lang.get('pages.cart.received_offer');\n this.discountAmountLabel = salla.lang.get('pages.cart.discount_amount');\n this.showMoreOffers = salla.lang.get('pages.cart.show_more_offers');\n });\n\n this.internalQuantity = this.quantity;\n this.internalOffers = this.parseOffers(this.offers);\n this.internalProductPrice = this.productPrice;\n }\n\n componentDidLoad() {\n salla.event.on('cart::item.updated', (event) => this.handleCartItemUpdated(event));\n }\n\n private parseOffers(offers: string): any[] {\n try {\n if (typeof offers !== 'string') {\n console.warn('Offers is not a string. Returning as-is.', offers);\n return Array.isArray(offers) ? offers : [];\n }\n\n return JSON.parse(offers || '[]');\n } catch (e) {\n console.error('Failed to parse offers', e);\n return [];\n }\n }\n\n private handleCartItemUpdated = (event) => {\n const updatedItem = event.data.cart.items.find((item) => item.id === this.itemId);\n if (updatedItem?.id === this.itemId) {\n this.internalQuantity = updatedItem.quantity;\n this.internalOffers = updatedItem.detailed_offers || [];\n this.internalProductPrice = updatedItem.product_price;\n }\n };\n\n private get visibleOffers() {\n return this.internalOffers.slice(0, this.visibleOffersCount);\n }\n\n private get hiddenOffers() {\n return this.internalOffers.slice(this.visibleOffersCount);\n }\n\n private toggleShowAll = () => {\n this.showAll = !this.showAll;\n };\n\n private getPaidQty(quantity: number, offer: any) {\n return quantity - offer.free_quantity;\n }\n\n private renderOffer(quantity: number, offer: any) {\n const paidQty = this.getPaidQty(quantity, offer);\n\n return (\n <div class=\"s-cart-item-offers-box\">\n {offer.free_quantity > 0 && paidQty > 0 && (\n <div class=\"s-cart-item-offers-paid-free\">\n <div class=\"s-cart-item-offers-line\">\n {salla.helpers.number(paidQty)} × <span innerHTML={salla.money(this.internalProductPrice)}></span>\n </div>\n <div class=\"s-cart-item-offers-line\">\n {salla.helpers.number(offer.free_quantity)} × \n <span class=\"s-cart-item-offers-regular-price\" innerHTML={salla.money(this.internalProductPrice)}></span>\n <span class=\"s-cart-item-offers-free-label\">{this.freeLabel}</span>\n </div>\n </div>\n )}\n\n <div class=\"s-cart-item-offers-details\">\n <span class={`s-cart-item-offers-icon`} innerHTML={this.icons[offer.discount_icon] || ''}></span>\n <div>\n <p class=\"s-cart-item-offers-title\">\n {this.receivedOffer.replace(':offer', offer.offer_name)}\n </p>\n <p class=\"s-cart-item-offers-discount\">\n <span innerHTML={this.discountAmountLabel.replace(':amount', salla.money(offer.discount_amount.toFixed(2)))}></span>\n </p>\n </div>\n </div>\n </div>\n );\n }\n\n render() {\n if (!this.internalOffers?.length) {\n return null;\n }\n\n return (\n <div class=\"s-cart-item-offers-container\" id={`offers_list_${this.itemId}`}>\n {this.visibleOffers.map((offer) => this.renderOffer(this.internalQuantity, offer))}\n\n {this.internalOffers?.length > this.visibleOffersCount && (\n <div class=\"s-cart-item-offers-show-more\">\n <button\n class=\"s-cart-item-offers-show-more-btn\"\n onClick={this.toggleShowAll}\n type=\"button\">\n <span class=\"s-cart-item-offers-show-more-label\">\n +{this.hiddenOffers.length} {this.showMoreOffers}\n <span\n innerHTML={ArrowDownIcon}\n class={{\n 's-cart-item-offers-arrow-icon': true,\n 's-cart-item-offers-arrow-open': this.showAll,\n }}\n ></span>\n </span>\n </button>\n </div>\n )}\n\n {this.showAll && (\n <div class=\"s-cart-item-offers-collapsed\" id={`offers_${this.itemId}`}>\n {this.hiddenOffers.map((offer) => this.renderOffer(this.internalQuantity, offer))}\n </div>\n )}\n </div>\n );\n }\n}\n"],"names":[],"mappings":"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"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as e,h as i,H as s}from"./p-LSZwJPPB.js";const a="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";const c=class{constructor(i){t(this,i);this.prizeItemSelected=e(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return i(s,{key:"5ca09a4202a344b0483bdfec61051430c6804143"},i("div",{key:"685bab3cdebcc0ebb8899bf41af4864dc613835b",onClick:this.onPrizeItemClick.bind(this)},i("img",{key:"412d27faaf4fdb3df213806613ce0ce362f86f63",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),i("div",{key:"9de2b85059c3db4cf750303e549938a577995d92",class:"s-loyalty-prize-item-title"},this.item.name),i("div",{key:"9ecf6845d0edf53937476a8bebfc36372ab1b4d9",class:"s-loyalty-prize-item-subtitle"},this.item.description),i("div",{key:"0c5f1cd8d22bc90178063c06eaf32bbac9f167ff",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};c.style=a;export{c as salla_loyalty_prize_item};
5
- //# sourceMappingURL=p-42bcde7d.entry.js.map
4
+ import{r as t,c as e,h as i,H as s}from"./p-gdhHvm6V.js";const a="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";const c=class{constructor(i){t(this,i);this.prizeItemSelected=e(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return i(s,{key:"5ca09a4202a344b0483bdfec61051430c6804143"},i("div",{key:"685bab3cdebcc0ebb8899bf41af4864dc613835b",onClick:this.onPrizeItemClick.bind(this)},i("img",{key:"412d27faaf4fdb3df213806613ce0ce362f86f63",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),i("div",{key:"9de2b85059c3db4cf750303e549938a577995d92",class:"s-loyalty-prize-item-title"},this.item.name),i("div",{key:"9ecf6845d0edf53937476a8bebfc36372ab1b4d9",class:"s-loyalty-prize-item-subtitle"},this.item.description),i("div",{key:"0c5f1cd8d22bc90178063c06eaf32bbac9f167ff",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};c.style=a;export{c as salla_loyalty_prize_item};
5
+ //# sourceMappingURL=p-bad5d163.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,a,e,n){function r(t){return t instanceof e?t:new e((function(a){a(t)}))}return new(e||(e=Promise))((function(e,i){function s(t){try{o(n.next(t))}catch(t){i(t)}}function u(t){try{o(n["throw"](t))}catch(t){i(t)}}function o(t){t.done?e(t.value):r(t.value).then(s,u)}o((n=n.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(a){return o([t,a])}}function o(u){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(n=1,r&&(i=u[0]&2?r["return"]:u[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;if(r=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;r=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=a.call(t,e)}catch(t){u=[6,t];r=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-Ce2XJNsy.system.js"],(function(t){"use strict";var a,e,n,r;return{setters:[function(t){a=t.r;e=t.h;n=t.H;r=t.g}],execute:function(){var i="";var s=t("salla_metadata",function(){function t(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var e=String(a.getDate()).padStart(2,"0");var n=String(a.getMonth()+1).padStart(2,"0");var r=a.getFullYear();var i="".concat(e,"/").concat(n,"/").concat(r);return i}return t.value};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,e;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.onReady()];case 1:n.sent();if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){return[2,salla.logger.error("feature custom-fields is not activated")]}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return[2,salla.logger.error("can't render salla-metadata without enity-id prop!")]}return[4,salla.lang.onLoaded()];case 2:n.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=n.sent();this.specs=(a=e.data[0])===null||a===void 0?void 0:a.sections;return[2]}}))}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return e(n,{class:"s-metadata-wrapper"},this.specs.map((function(a){return e("div",{class:"s-metadata-box"},e("div",{class:"s-metadata-box-header"},e("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return e("div",{class:"s-metadata-row"},e("p",{class:"s-metadata-row-name"},a.name),e("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());s.style=i}}}));
5
- //# sourceMappingURL=p-6a8ba65f.system.entry.js.map
4
+ */System.register(["./p-sMaYJNRW.system.js"],(function(t){"use strict";var a,e,n,r;return{setters:[function(t){a=t.r;e=t.h;n=t.H;r=t.g}],execute:function(){var i="";var s=t("salla_metadata",function(){function t(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var e=String(a.getDate()).padStart(2,"0");var n=String(a.getMonth()+1).padStart(2,"0");var r=a.getFullYear();var i="".concat(e,"/").concat(n,"/").concat(r);return i}return t.value};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,e;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.onReady()];case 1:n.sent();if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){return[2,salla.logger.error("feature custom-fields is not activated")]}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return[2,salla.logger.error("can't render salla-metadata without enity-id prop!")]}return[4,salla.lang.onLoaded()];case 2:n.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=n.sent();this.specs=(a=e.data[0])===null||a===void 0?void 0:a.sections;return[2]}}))}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return e(n,{class:"s-metadata-wrapper"},this.specs.map((function(a){return e("div",{class:"s-metadata-box"},e("div",{class:"s-metadata-box-header"},e("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return e("div",{class:"s-metadata-row"},e("p",{class:"s-metadata-row-name"},a.name),e("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());s.style=i}}}));
5
+ //# sourceMappingURL=p-c0871d45.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as l,h as a,H as t}from"./p-LSZwJPPB.js";import{G as s}from"./p-C0JNGIpa.js";const o="";const r=l=>{if(!l)return"";return new Date(Number(l)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};const e=l=>{if(!l)return"";try{const a=l.toLowerCase();const t=salla.lang.get(`pages.loyalty_program.${a}`);return t===`pages.loyalty_program.${a}`?l:t}catch(a){return l}};const i=class{constructor(a){l(this,a);this.loyaltyPointsArray=[];this.isLoadingLoyalty=false;this.nextPageUrlLoyalty="";this.handleClick=()=>{this.loadMoreLoyaltyPoints()}}componentWillLoad(){return salla.onReady().then((()=>{this.loadLoyaltyPoints()}))}async loadLoyaltyPoints(){this.isLoadingLoyalty=true;try{let l=`/balance/points?page=1`;let a=await salla.api.request(l);this.loyaltyPointsArray=a.data;this.nextPageUrlLoyalty=a.cursor.next}catch(l){console.error("Error loading loyalty points transactions",l)}finally{this.isLoadingLoyalty=false}}async loadMoreLoyaltyPoints(){var l;if(!this.nextPageUrlLoyalty)return;this.isLoadingLoyalty=true;try{let a=await salla.api.request(this.nextPageUrlLoyalty);this.loyaltyPointsArray=[...this.loyaltyPointsArray,...a.data];this.nextPageUrlLoyalty=((l=a.cursor)===null||l===void 0?void 0:l.next)||""}catch(l){console.error("Error loading more loyalty points",l)}finally{this.isLoadingLoyalty=false}}render(){return a(t,{key:"300d58186edf747b1dd6dc7a1d67c0c93606aa5e"},a("div",{key:"98e3a15104e813c6798ccac75fbd1bb163735c54"},this.isLoadingLoyalty?a("salla-loading",null):a("div",null,this.loyaltyPointsArray.length>0?a("div",null,a("table",{class:"s-loyalty-program-table"},a("thead",{class:"s-loyalty-program-table-head"},a("tr",{class:"s-loyalty-program-table-head-tr"},a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),a("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((l=>a("tr",{class:"s-loyalty-program-table-tbody-tr"},a("td",{class:"s-loyalty-program-table-tbody-tr-td"},(l===null||l===void 0?void 0:l.type)==="plus"?"+":"",(l===null||l===void 0?void 0:l.points)||""," ",salla.lang.get("pages.loyalty_program.point")),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r((l===null||l===void 0?void 0:l.created_at)?Number(l.created_at)*1e3:undefined)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.points_expire_date)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e(l===null||l===void 0?void 0:l.key)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e(l===null||l===void 0?void 0:l.status_key))))))),a("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&a("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):a("div",null,a("div",{class:"s-loyalty-program-table-empty-state"},a("span",{innerHTML:s}),a("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),a("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))}};i.style=o;export{i as salla_loyalty_program};
5
- //# sourceMappingURL=p-6b1753ce.entry.js.map
4
+ import{r as l,h as a,H as t}from"./p-gdhHvm6V.js";import{G as s}from"./p-C0JNGIpa.js";const o="";const r=l=>{if(!l)return"";return new Date(Number(l)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};const e=l=>{if(!l)return"";try{const a=l.toLowerCase();const t=salla.lang.get(`pages.loyalty_program.${a}`);return t===`pages.loyalty_program.${a}`?l:t}catch(a){return l}};const i=class{constructor(a){l(this,a);this.loyaltyPointsArray=[];this.isLoadingLoyalty=false;this.nextPageUrlLoyalty="";this.handleClick=()=>{this.loadMoreLoyaltyPoints()}}componentWillLoad(){return salla.onReady().then((()=>{this.loadLoyaltyPoints()}))}async loadLoyaltyPoints(){this.isLoadingLoyalty=true;try{let l=`/balance/points?page=1`;let a=await salla.api.request(l);this.loyaltyPointsArray=a.data;this.nextPageUrlLoyalty=a.cursor.next}catch(l){console.error("Error loading loyalty points transactions",l)}finally{this.isLoadingLoyalty=false}}async loadMoreLoyaltyPoints(){var l;if(!this.nextPageUrlLoyalty)return;this.isLoadingLoyalty=true;try{let a=await salla.api.request(this.nextPageUrlLoyalty);this.loyaltyPointsArray=[...this.loyaltyPointsArray,...a.data];this.nextPageUrlLoyalty=((l=a.cursor)===null||l===void 0?void 0:l.next)||""}catch(l){console.error("Error loading more loyalty points",l)}finally{this.isLoadingLoyalty=false}}render(){return a(t,{key:"300d58186edf747b1dd6dc7a1d67c0c93606aa5e"},a("div",{key:"98e3a15104e813c6798ccac75fbd1bb163735c54"},this.isLoadingLoyalty?a("salla-loading",null):a("div",null,this.loyaltyPointsArray.length>0?a("div",null,a("table",{class:"s-loyalty-program-table"},a("thead",{class:"s-loyalty-program-table-head"},a("tr",{class:"s-loyalty-program-table-head-tr"},a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),a("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),a("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((l=>a("tr",{class:"s-loyalty-program-table-tbody-tr"},a("td",{class:"s-loyalty-program-table-tbody-tr-td"},(l===null||l===void 0?void 0:l.type)==="plus"?"+":"",(l===null||l===void 0?void 0:l.points)||""," ",salla.lang.get("pages.loyalty_program.point")),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r((l===null||l===void 0?void 0:l.created_at)?Number(l.created_at)*1e3:undefined)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.points_expire_date)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e(l===null||l===void 0?void 0:l.key)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},e(l===null||l===void 0?void 0:l.status_key))))))),a("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&a("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):a("div",null,a("div",{class:"s-loyalty-program-table-empty-state"},a("span",{innerHTML:s}),a("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),a("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))}};i.style=o;export{i as salla_loyalty_program};
5
+ //# sourceMappingURL=p-c0951c06.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,c as i,h as t,H as e,g as l}from"./p-LSZwJPPB.js";import{M as r}from"./p-DmgxDvXL.js";var h=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n`;const o="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";const a=class{constructor(t){s(this,t);this.verified=i(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((()=>{var s;this.translationLoaded=true;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type);(s=this.modal)===null||s===void 0?void 0:s.setTitle(this.title)}));if(this.display=="inline"){this.modal={open:()=>"",close:()=>"",setTitle:()=>""};return}salla.event.on("profile::verification",(s=>{var i;let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=true;this.open(t);this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type);(i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title)}));salla.event.on("modalClosed",(()=>{this.resendAfter=0;this.timer.innerHTML="30 : 00"}))}splitNumber(s){this.resetError();let i=s.data||s.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(s.target,i)}modifyNext(s,i){s.value=i[0];i=i.substring(1);if(s.nextElementSibling&&i.length){this.modifyNext(s.nextElementSibling,i)}else if(!s.nextElementSibling&&i.length===0){s.focus()}else if(s.nextElementSibling&&i.length===0){s.nextElementSibling.focus()}}checkAllInputs(){let s=true;for(let i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){s=false}}return s}handleKeyUp(s){var i,t,e,l;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key)){return}let r=s.keyCode||s.charCode;if(s.target.value){(i=s.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(t=s.target.nextElementSibling)===null||t===void 0?void 0:t.select()}else if([8,46].includes(r)){(e=s.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(l=s.target.previousElementSibling)===null||l===void 0?void 0:l.select()}if(s.target.value.length>1){this.splitNumber(s)}}handlePaste(s){this.resetError();const i=salla.helpers.number(s.clipboardData.getData("text"))||"";let t=i.replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length);this.otpInputs.forEach((s=>s.value=""));this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError();salla.helpers.inputDigitsOnly(s.target);if(this.checkAllInputs()){setTimeout((()=>{this.toggleOTPSubmit()}),100)}}resetError(){this.hasError=false;this.errorMessage=""}handleFocus(s){var i;if(s.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(s.target.previousElementSibling.value==""){s.target.previousElementSibling.focus()}}async getCode(){return this.code.value}async open(s){var i,t;this.data=s;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(t=this.firstOtpInput)===null||t===void 0?void 0:t.addEventListener("input",(s=>this.splitNumber(s)));setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];this.otpInputs.forEach((i=>i.value&&s.push(i.value)));this.code.value=s.join("");if(s.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value=""));this.code.value="";this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;let s=setInterval((()=>{if(this.resendAfter<=0){clearInterval(s);this.resend.style.display="block";this.resendMessage.style.display="none"}else{this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`;this.resendAfter--}}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value=""));this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{var i,t,e;this.hasError=true;this.errorMessage=((e=(t=(i=s.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||e===void 0?void 0:e.message)||salla.lang.get("common.errors.error_occurred");if(!s.response){console.log("Unexpected error",s)}else{salla.logger.error(s)}this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return this.display=="inline"?t(e,null,this.myBody()):t("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},t("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?h:r}),this.myBody())}myBody(){return t("div",{class:"s-verify-body",ref:s=>this.body=s},t("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("slot",{name:"mobile"}),t("slot",{name:"email"}),t("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:s=>this.code=s}),t("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>t("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":true,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:true})))),this.hasError&&this.errorMessage?t("span",{class:"s-verify-error-message"},this.errorMessage):"",t("div",{slot:"footer",class:"s-verify-footer"},t("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return l(this)}};a.style=o;export{a as salla_verify};
5
- //# sourceMappingURL=p-5271a9e8.entry.js.map
4
+ import{r as s,c as i,h as t,H as e,g as h}from"./p-gdhHvm6V.js";import{M as l}from"./p-DmgxDvXL.js";var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n`;const o="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";const a=class{constructor(t){s(this,t);this.verified=i(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((()=>{var s;this.translationLoaded=true;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type);(s=this.modal)===null||s===void 0?void 0:s.setTitle(this.title)}));if(this.display=="inline"){this.modal={open:()=>"",close:()=>"",setTitle:()=>""};return}salla.event.on("profile::verification",(s=>{var i;let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=true;this.open(t);this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type);(i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title)}));salla.event.on("modalClosed",(()=>{this.resendAfter=0;this.timer.innerHTML="30 : 00"}))}splitNumber(s){this.resetError();let i=s.data||s.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(s.target,i)}modifyNext(s,i){s.value=i[0];i=i.substring(1);if(s.nextElementSibling&&i.length){this.modifyNext(s.nextElementSibling,i)}else if(!s.nextElementSibling&&i.length===0){s.focus()}else if(s.nextElementSibling&&i.length===0){s.nextElementSibling.focus()}}checkAllInputs(){let s=true;for(let i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){s=false}}return s}handleKeyUp(s){var i,t,e,h;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key)){return}let l=s.keyCode||s.charCode;if(s.target.value){(i=s.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(t=s.target.nextElementSibling)===null||t===void 0?void 0:t.select()}else if([8,46].includes(l)){(e=s.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(h=s.target.previousElementSibling)===null||h===void 0?void 0:h.select()}if(s.target.value.length>1){this.splitNumber(s)}}handlePaste(s){this.resetError();const i=salla.helpers.number(s.clipboardData.getData("text"))||"";let t=i.replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length);this.otpInputs.forEach((s=>s.value=""));this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError();salla.helpers.inputDigitsOnly(s.target);if(this.checkAllInputs()){setTimeout((()=>{this.toggleOTPSubmit()}),100)}}resetError(){this.hasError=false;this.errorMessage=""}handleFocus(s){var i;if(s.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(s.target.previousElementSibling.value==""){s.target.previousElementSibling.focus()}}async getCode(){return this.code.value}async open(s){var i,t;this.data=s;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(t=this.firstOtpInput)===null||t===void 0?void 0:t.addEventListener("input",(s=>this.splitNumber(s)));setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];this.otpInputs.forEach((i=>i.value&&s.push(i.value)));this.code.value=s.join("");if(s.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value=""));this.code.value="";this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;let s=setInterval((()=>{if(this.resendAfter<=0){clearInterval(s);this.resend.style.display="block";this.resendMessage.style.display="none"}else{this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`;this.resendAfter--}}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value=""));this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{var i,t,e;this.hasError=true;this.errorMessage=((e=(t=(i=s.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||e===void 0?void 0:e.message)||salla.lang.get("common.errors.error_occurred");if(!s.response){console.log("Unexpected error",s)}else{salla.logger.error(s)}this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return this.display=="inline"?t(e,null,this.myBody()):t("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},t("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?r:l}),this.myBody())}myBody(){return t("div",{class:"s-verify-body",ref:s=>this.body=s},t("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("slot",{name:"mobile"}),t("slot",{name:"email"}),t("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:s=>this.code=s}),t("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>t("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":true,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:true})))),this.hasError&&this.errorMessage?t("span",{class:"s-verify-error-message"},this.errorMessage):"",t("div",{slot:"footer",class:"s-verify-footer"},t("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return h(this)}};a.style=o;export{a as salla_verify};
5
+ //# sourceMappingURL=p-c7973d48.entry.js.map