@salla.sa/twilight-components 2.14.250 → 2.14.252

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 (317) hide show
  1. package/dist/cjs/{app-globals-BgNFpKiG.js → app-globals-ChKTQEJ9.js} +3 -3
  2. package/dist/cjs/{app-globals-BgNFpKiG.js.map → app-globals-ChKTQEJ9.js.map} +1 -1
  3. package/dist/cjs/{index-DFk4JQs_.js → index-DtXwvL5X.js} +4 -4
  4. package/dist/cjs/index-DtXwvL5X.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-offer.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 +22 -1
  31. package/dist/cjs/salla-product-options.cjs.entry.js.map +1 -1
  32. package/dist/cjs/salla-product-options.entry.cjs.js.map +1 -1
  33. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  41. package/dist/cjs/twilight.cjs.js +2 -2
  42. package/dist/collection/components/salla-product-options/salla-product-options.js +21 -0
  43. package/dist/collection/components/salla-product-options/salla-product-options.js.map +1 -1
  44. package/dist/components/index.js +2 -2
  45. package/dist/components/index.js.map +1 -1
  46. package/dist/components/salla-product-options.js +21 -0
  47. package/dist/components/salla-product-options.js.map +1 -1
  48. package/dist/esm/{app-globals-DoDOGg4t.js → app-globals-3b0DwjjK.js} +3 -3
  49. package/dist/esm/{app-globals-DoDOGg4t.js.map → app-globals-3b0DwjjK.js.map} +1 -1
  50. package/dist/esm/{index-Fh3juwdj.js → index-D4D34Ujk.js} +4 -4
  51. package/dist/esm/index-D4D34Ujk.js.map +1 -0
  52. package/dist/esm/loader.js +3 -3
  53. package/dist/esm/salla-accordion-body.entry.js +1 -1
  54. package/dist/esm/salla-accordion-head.entry.js +1 -1
  55. package/dist/esm/salla-accordion.entry.js +1 -1
  56. package/dist/esm/salla-add-product-button_51.entry.js +1 -1
  57. package/dist/esm/salla-advertisement.entry.js +1 -1
  58. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  59. package/dist/esm/salla-apps-icons.entry.js +1 -1
  60. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  61. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  62. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  63. package/dist/esm/salla-contacts.entry.js +1 -1
  64. package/dist/esm/salla-filters-widget.entry.js +1 -1
  65. package/dist/esm/salla-filters.entry.js +1 -1
  66. package/dist/esm/salla-installment.entry.js +1 -1
  67. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  68. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  69. package/dist/esm/salla-metadata.entry.js +1 -1
  70. package/dist/esm/salla-notification-item.entry.js +1 -1
  71. package/dist/esm/salla-notifications.entry.js +1 -1
  72. package/dist/esm/salla-offer.entry.js +1 -1
  73. package/dist/esm/salla-order-summary.entry.js +1 -1
  74. package/dist/esm/salla-orders.entry.js +1 -1
  75. package/dist/esm/salla-payments.entry.js +1 -1
  76. package/dist/esm/salla-price-range.entry.js +1 -1
  77. package/dist/esm/salla-product-options.entry.js +22 -1
  78. package/dist/esm/salla-product-options.entry.js.map +1 -1
  79. package/dist/esm/salla-review-card.entry.js +1 -1
  80. package/dist/esm/salla-reviews-page.entry.js +1 -1
  81. package/dist/esm/salla-reviews.entry.js +1 -1
  82. package/dist/esm/salla-social.entry.js +1 -1
  83. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  84. package/dist/esm/salla-tooltip.entry.js +1 -1
  85. package/dist/esm/salla-verify.entry.js +1 -1
  86. package/dist/esm/salla-wallet.entry.js +1 -1
  87. package/dist/esm/twilight.js +3 -3
  88. package/dist/esm-es5/{app-globals-DoDOGg4t.js → app-globals-3b0DwjjK.js} +2 -2
  89. package/dist/esm-es5/{app-globals-DoDOGg4t.js.map → app-globals-3b0DwjjK.js.map} +1 -1
  90. package/dist/esm-es5/{index-Fh3juwdj.js → index-D4D34Ujk.js} +3 -3
  91. package/dist/esm-es5/index-D4D34Ujk.js.map +1 -0
  92. package/dist/esm-es5/loader.js +1 -1
  93. package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
  94. package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
  95. package/dist/esm-es5/salla-accordion.entry.js +1 -1
  96. package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
  97. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  98. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  99. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  100. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  101. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  102. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  103. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  104. package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
  105. package/dist/esm-es5/salla-filters.entry.js +1 -1
  106. package/dist/esm-es5/salla-installment.entry.js +1 -1
  107. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  108. package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
  109. package/dist/esm-es5/salla-metadata.entry.js +1 -1
  110. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  111. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  112. package/dist/esm-es5/salla-offer.entry.js +1 -1
  113. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  114. package/dist/esm-es5/salla-orders.entry.js +1 -1
  115. package/dist/esm-es5/salla-payments.entry.js +1 -1
  116. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  117. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  118. package/dist/esm-es5/salla-product-options.entry.js.map +1 -1
  119. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  120. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  121. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  122. package/dist/esm-es5/salla-social.entry.js +1 -1
  123. package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
  124. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  125. package/dist/esm-es5/salla-verify.entry.js +1 -1
  126. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  127. package/dist/esm-es5/twilight.js +1 -1
  128. package/dist/twilight/{p-c8409d01.system.entry.js → p-06b95a05.system.entry.js} +2 -2
  129. package/dist/twilight/{p-8c4ff806.entry.js → p-1055f2fb.entry.js} +2 -2
  130. package/dist/twilight/{p-feb47383.system.entry.js → p-13324cdd.system.entry.js} +2 -2
  131. package/dist/twilight/{p-2c7106a0.entry.js → p-154fc672.entry.js} +2 -2
  132. package/dist/twilight/{p-3f5fc0ac.entry.js → p-17c50686.entry.js} +2 -2
  133. package/dist/twilight/{p-41858b7a.entry.js → p-17ee3d18.entry.js} +2 -2
  134. package/dist/twilight/{p-65e55582.system.entry.js → p-1a9eebb6.system.entry.js} +2 -2
  135. package/dist/twilight/{p-af947a45.system.entry.js → p-1b24ea99.system.entry.js} +2 -2
  136. package/dist/twilight/{p-51fff39f.entry.js → p-2ae75a1c.entry.js} +2 -2
  137. package/dist/twilight/{p-ea4cddf9.system.entry.js → p-2af0da5a.system.entry.js} +2 -2
  138. package/dist/twilight/{p-969a72ac.entry.js → p-2ecf868e.entry.js} +2 -2
  139. package/dist/twilight/{p-ef1c9026.system.entry.js → p-3483eb09.system.entry.js} +2 -2
  140. package/dist/twilight/p-3483eb09.system.entry.js.map +1 -0
  141. package/dist/twilight/{p-90b19a52.entry.js → p-396198a2.entry.js} +2 -2
  142. package/dist/twilight/{p-f4dd7c30.entry.js → p-3eaddcf1.entry.js} +2 -2
  143. package/dist/twilight/{p-6e2c5013.system.entry.js → p-407d19d8.system.entry.js} +2 -2
  144. package/dist/twilight/{p-ce2994fb.system.entry.js → p-40e20722.system.entry.js} +2 -2
  145. package/dist/twilight/{p-c5bdc891.system.entry.js → p-423d91f5.system.entry.js} +3 -3
  146. package/dist/twilight/{p-5aa8dd63.system.entry.js → p-442340d3.system.entry.js} +2 -2
  147. package/dist/twilight/{p-67a30d9c.entry.js → p-45b61475.entry.js} +2 -2
  148. package/dist/twilight/{p-b0342394.entry.js → p-4af5ffea.entry.js} +2 -2
  149. package/dist/twilight/{p-ed74ff73.system.entry.js → p-4d6baea7.system.entry.js} +2 -2
  150. package/dist/twilight/{p-4f532944.system.entry.js → p-553bc6b4.system.entry.js} +2 -2
  151. package/dist/twilight/{p-12ec4275.entry.js → p-5542a867.entry.js} +2 -2
  152. package/dist/twilight/{p-dca1a091.entry.js → p-58085711.entry.js} +2 -2
  153. package/dist/twilight/{p-c143cae6.system.entry.js → p-5b882c52.system.entry.js} +2 -2
  154. package/dist/twilight/{p-caf5e9c0.system.entry.js → p-60bf8746.system.entry.js} +3 -3
  155. package/dist/twilight/{p-a4373a58.entry.js → p-63a5bdc6.entry.js} +2 -2
  156. package/dist/twilight/{p-9b377923.entry.js → p-63cba8e3.entry.js} +2 -2
  157. package/dist/twilight/{p-8422a030.entry.js → p-648fb6ca.entry.js} +2 -2
  158. package/dist/twilight/{p-3011ae50.entry.js → p-669db4df.entry.js} +2 -2
  159. package/dist/twilight/{p-07e383ed.entry.js → p-6a0b5799.entry.js} +2 -2
  160. package/dist/twilight/{p-2fc264a5.system.entry.js → p-6b716e82.system.entry.js} +2 -2
  161. package/dist/twilight/{p-d2f4c095.system.entry.js → p-6e24a5f0.system.entry.js} +2 -2
  162. package/dist/twilight/{p-0093b63c.system.entry.js → p-7234c5f2.system.entry.js} +2 -2
  163. package/dist/twilight/{p-bcb8b7a7.system.entry.js → p-7eff7dc5.system.entry.js} +2 -2
  164. package/dist/twilight/{p-d3177b59.entry.js → p-81aeef6a.entry.js} +2 -2
  165. package/dist/twilight/{p-3c7322ea.system.entry.js → p-8213a9ef.system.entry.js} +2 -2
  166. package/dist/twilight/{p-d6d41f95.entry.js → p-8359eb2a.entry.js} +2 -2
  167. package/dist/twilight/{p-48c8c116.system.entry.js → p-8c0822f7.system.entry.js} +2 -2
  168. package/dist/twilight/{p-f8232bd5.entry.js → p-95adf84e.entry.js} +2 -2
  169. package/dist/twilight/{p-CXK1rNlC.system.js → p-B0xoNOFR.system.js} +3 -3
  170. package/dist/twilight/p-B0xoNOFR.system.js.map +1 -0
  171. package/dist/twilight/{p-B5711wvS.system.js.map → p-BHI6mAw4.system.js.map} +1 -1
  172. package/dist/twilight/{p-kq1kexdS.system.js.map → p-BJUBMQeL.system.js.map} +1 -1
  173. package/dist/twilight/{p-ClGf-mQe.system.js.map → p-BN8tVPbo.system.js.map} +1 -1
  174. package/dist/twilight/{p-DFHtpaXy.system.js.map → p-BRsVFuI-.system.js.map} +1 -1
  175. package/dist/twilight/{p-B_e6C9C7.system.js.map → p-BXoB3JpD.system.js.map} +1 -1
  176. package/dist/twilight/{p-CQ0P5lf7.system.js.map → p-B_aBck2N.system.js.map} +1 -1
  177. package/dist/twilight/{p-BlIQW2lO.system.js.map → p-BbDuw4AO.system.js.map} +1 -1
  178. package/dist/twilight/{p-yR-D_QVV.system.js.map → p-Bqv1miCk.system.js.map} +1 -1
  179. package/dist/twilight/{p-CjFC0ce0.system.js.map → p-BrxIkK1y.system.js.map} +1 -1
  180. package/dist/twilight/{p-Dm-9Eytr.system.js.map → p-BxORDCZ3.system.js.map} +1 -1
  181. package/dist/twilight/{p-F0k7g9iY.system.js.map → p-ByNC3ygM.system.js.map} +1 -1
  182. package/dist/twilight/{p-C7zV68dE.system.js.map → p-C-vbYsMC.system.js.map} +1 -1
  183. package/dist/twilight/{p-RTeyQLWy.system.js.map → p-C9DFiJHW.system.js.map} +1 -1
  184. package/dist/twilight/{p-CuT3SRo-.system.js.map → p-CB3G0Z8y.system.js.map} +1 -1
  185. package/dist/twilight/{p-C7pQcCCO.system.js.map → p-CDmxJQ_1.system.js.map} +1 -1
  186. package/dist/twilight/{p-CJCijTkx.system.js.map → p-CNqFfslE.system.js.map} +1 -1
  187. package/dist/twilight/{p-AKVBtuMk.system.js.map → p-CVW8a0jw.system.js.map} +1 -1
  188. package/dist/twilight/{p-oQO9FKN9.system.js.map → p-CZGaqTus.system.js.map} +1 -1
  189. package/dist/twilight/{p-BEv7FXnl.system.js.map → p-CaCB348j.system.js.map} +1 -1
  190. package/dist/twilight/{p-D7rVz8w9.system.js.map → p-Cc6e2YrQ.system.js.map} +1 -1
  191. package/dist/twilight/{p-I3V9OjUh.system.js.map → p-Ccj70VFr.system.js.map} +1 -1
  192. package/dist/twilight/{p-DL20L4sR.system.js.map → p-CgDN9ZEV.system.js.map} +1 -1
  193. package/dist/twilight/{p-BGI8pwzX.system.js.map → p-CiGTTlgd.system.js.map} +1 -1
  194. package/dist/twilight/{p-xqp4ddQE.system.js.map → p-Cs3Irr4v.system.js.map} +1 -1
  195. package/dist/twilight/{p-Fh3juwdj.js → p-D4D34Ujk.js} +3 -3
  196. package/dist/twilight/p-D4D34Ujk.js.map +1 -0
  197. package/dist/twilight/{p-6K3EacFl.system.js → p-DMKkUrkS.system.js} +2 -2
  198. package/dist/twilight/{p-6K3EacFl.system.js.map → p-DMKkUrkS.system.js.map} +1 -1
  199. package/dist/twilight/{p-C5ceUSVS.js → p-DNiQ_YXx.js} +2 -2
  200. package/dist/twilight/{p-C5ceUSVS.js.map → p-DNiQ_YXx.js.map} +1 -1
  201. package/dist/twilight/{p-C1ANpTev.system.js.map → p-DVnmchft.system.js.map} +1 -1
  202. package/dist/twilight/{p-JqK0adg-.system.js.map → p-Daef3WlT.system.js.map} +1 -1
  203. package/dist/twilight/{p-DDYb73x9.system.js.map → p-DlRNuq8n.system.js.map} +1 -1
  204. package/dist/twilight/{p-DXIfbc_E.system.js.map → p-DvrwOwqK.system.js.map} +1 -1
  205. package/dist/twilight/{p-CsNoOX-E.system.js → p-DxRZfb-O.system.js} +2 -2
  206. package/dist/twilight/{p-CsNoOX-E.system.js.map → p-DxRZfb-O.system.js.map} +1 -1
  207. package/dist/twilight/p-O_6m6zp3.system.js.map +1 -0
  208. package/dist/twilight/{p-0Yb-UePn.system.js.map → p-OzJ9XEsV.system.js.map} +1 -1
  209. package/dist/twilight/{p-CV9enCHU.system.js.map → p-TrPvZWq-.system.js.map} +1 -1
  210. package/dist/twilight/{p-11c6d38a.system.entry.js → p-a18f81a8.system.entry.js} +2 -2
  211. package/dist/twilight/{p-5e07c206.system.entry.js → p-a1d102d3.system.entry.js} +2 -2
  212. package/dist/twilight/{p-b3e42e7f.system.entry.js → p-aad20f10.system.entry.js} +2 -2
  213. package/dist/twilight/{p-0d5aa57d.system.entry.js → p-ab7cc63a.system.entry.js} +2 -2
  214. package/dist/twilight/{p-0ecc5067.system.entry.js → p-ad0fedcd.system.entry.js} +2 -2
  215. package/dist/twilight/{p-89bfcbd9.entry.js → p-c0363ba7.entry.js} +2 -2
  216. package/dist/twilight/{p-72dbdf8a.entry.js → p-c84819d5.entry.js} +2 -2
  217. package/dist/twilight/{p-84efc4e5.system.entry.js → p-c87d6aa6.system.entry.js} +2 -2
  218. package/dist/twilight/{p-f0ad1f7a.system.entry.js → p-c9678188.system.entry.js} +2 -2
  219. package/dist/twilight/{p-a74c3613.entry.js → p-d0004953.entry.js} +2 -2
  220. package/dist/twilight/{p-aa17ca75.system.entry.js → p-d097a67d.system.entry.js} +2 -2
  221. package/dist/twilight/{p-cc88bd11.entry.js → p-d15630dd.entry.js} +2 -2
  222. package/dist/twilight/{p-15109abe.entry.js → p-d513da6f.entry.js} +2 -2
  223. package/dist/twilight/{p-be0c1dee.entry.js → p-d5750810.entry.js} +2 -2
  224. package/dist/twilight/{p-1d675685.entry.js → p-d84eb47c.entry.js} +2 -2
  225. package/dist/twilight/{p-8e87d5bb.entry.js → p-dd83a408.entry.js} +2 -2
  226. package/dist/twilight/{p-BqsAYW_z.system.js.map → p-e-FAhVeu.system.js.map} +1 -1
  227. package/dist/twilight/{p-2ae3f0e1.system.entry.js → p-e2ab2b64.system.entry.js} +2 -2
  228. package/dist/twilight/{p-31c2d596.entry.js → p-e784d087.entry.js} +2 -2
  229. package/dist/twilight/{p-777970a0.system.entry.js → p-e823d4e8.system.entry.js} +2 -2
  230. package/dist/twilight/{p-eab0ef43.system.entry.js → p-e9bc1fa4.system.entry.js} +2 -2
  231. package/dist/twilight/{p-5b0c8164.system.entry.js → p-ebd4ac51.system.entry.js} +2 -2
  232. package/dist/twilight/{p-314b3b1d.system.entry.js → p-ef38f4ac.system.entry.js} +2 -2
  233. package/dist/twilight/{p-cbd8cbee.entry.js → p-f57bcc51.entry.js} +2 -2
  234. package/dist/twilight/{p-b07d4935.entry.js → p-f745fcad.entry.js} +2 -2
  235. package/dist/twilight/p-fbe10567.entry.js +5 -0
  236. package/dist/twilight/p-fbe10567.entry.js.map +1 -0
  237. package/dist/twilight/{p-d8605d58.entry.js → p-fcc64f6d.entry.js} +2 -2
  238. package/dist/twilight/{p-BeIXRKnY.system.js.map → p-ofxyuLsh.system.js.map} +1 -1
  239. package/dist/twilight/{p-OPHJjNOp.system.js.map → p-u0que_SA.system.js.map} +1 -1
  240. package/dist/twilight/salla-product-options.entry.esm.js.map +1 -1
  241. package/dist/twilight/twilight.esm.js +1 -1
  242. package/dist/twilight/twilight.js +1 -1
  243. package/dist/types/components/salla-product-options/salla-product-options.d.ts +1 -0
  244. package/package.json +5 -5
  245. package/dist/cjs/index-DFk4JQs_.js.map +0 -1
  246. package/dist/esm/index-Fh3juwdj.js.map +0 -1
  247. package/dist/esm-es5/index-Fh3juwdj.js.map +0 -1
  248. package/dist/twilight/p-86a30b82.entry.js +0 -5
  249. package/dist/twilight/p-86a30b82.entry.js.map +0 -1
  250. package/dist/twilight/p-CXK1rNlC.system.js.map +0 -1
  251. package/dist/twilight/p-DydKtKGm.system.js.map +0 -1
  252. package/dist/twilight/p-Fh3juwdj.js.map +0 -1
  253. package/dist/twilight/p-ef1c9026.system.entry.js.map +0 -1
  254. /package/dist/twilight/{p-c8409d01.system.entry.js.map → p-06b95a05.system.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-8c4ff806.entry.js.map → p-1055f2fb.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-feb47383.system.entry.js.map → p-13324cdd.system.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-2c7106a0.entry.js.map → p-154fc672.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-3f5fc0ac.entry.js.map → p-17c50686.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-41858b7a.entry.js.map → p-17ee3d18.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-65e55582.system.entry.js.map → p-1a9eebb6.system.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-af947a45.system.entry.js.map → p-1b24ea99.system.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-51fff39f.entry.js.map → p-2ae75a1c.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-ea4cddf9.system.entry.js.map → p-2af0da5a.system.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-969a72ac.entry.js.map → p-2ecf868e.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-90b19a52.entry.js.map → p-396198a2.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-f4dd7c30.entry.js.map → p-3eaddcf1.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-6e2c5013.system.entry.js.map → p-407d19d8.system.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-ce2994fb.system.entry.js.map → p-40e20722.system.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-c5bdc891.system.entry.js.map → p-423d91f5.system.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-5aa8dd63.system.entry.js.map → p-442340d3.system.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-67a30d9c.entry.js.map → p-45b61475.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-b0342394.entry.js.map → p-4af5ffea.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-ed74ff73.system.entry.js.map → p-4d6baea7.system.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-4f532944.system.entry.js.map → p-553bc6b4.system.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-12ec4275.entry.js.map → p-5542a867.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-dca1a091.entry.js.map → p-58085711.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-c143cae6.system.entry.js.map → p-5b882c52.system.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-caf5e9c0.system.entry.js.map → p-60bf8746.system.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-a4373a58.entry.js.map → p-63a5bdc6.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-9b377923.entry.js.map → p-63cba8e3.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-8422a030.entry.js.map → p-648fb6ca.entry.js.map} +0 -0
  282. /package/dist/twilight/{p-3011ae50.entry.js.map → p-669db4df.entry.js.map} +0 -0
  283. /package/dist/twilight/{p-07e383ed.entry.js.map → p-6a0b5799.entry.js.map} +0 -0
  284. /package/dist/twilight/{p-2fc264a5.system.entry.js.map → p-6b716e82.system.entry.js.map} +0 -0
  285. /package/dist/twilight/{p-d2f4c095.system.entry.js.map → p-6e24a5f0.system.entry.js.map} +0 -0
  286. /package/dist/twilight/{p-0093b63c.system.entry.js.map → p-7234c5f2.system.entry.js.map} +0 -0
  287. /package/dist/twilight/{p-bcb8b7a7.system.entry.js.map → p-7eff7dc5.system.entry.js.map} +0 -0
  288. /package/dist/twilight/{p-d3177b59.entry.js.map → p-81aeef6a.entry.js.map} +0 -0
  289. /package/dist/twilight/{p-3c7322ea.system.entry.js.map → p-8213a9ef.system.entry.js.map} +0 -0
  290. /package/dist/twilight/{p-d6d41f95.entry.js.map → p-8359eb2a.entry.js.map} +0 -0
  291. /package/dist/twilight/{p-48c8c116.system.entry.js.map → p-8c0822f7.system.entry.js.map} +0 -0
  292. /package/dist/twilight/{p-f8232bd5.entry.js.map → p-95adf84e.entry.js.map} +0 -0
  293. /package/dist/twilight/{p-11c6d38a.system.entry.js.map → p-a18f81a8.system.entry.js.map} +0 -0
  294. /package/dist/twilight/{p-5e07c206.system.entry.js.map → p-a1d102d3.system.entry.js.map} +0 -0
  295. /package/dist/twilight/{p-b3e42e7f.system.entry.js.map → p-aad20f10.system.entry.js.map} +0 -0
  296. /package/dist/twilight/{p-0d5aa57d.system.entry.js.map → p-ab7cc63a.system.entry.js.map} +0 -0
  297. /package/dist/twilight/{p-0ecc5067.system.entry.js.map → p-ad0fedcd.system.entry.js.map} +0 -0
  298. /package/dist/twilight/{p-89bfcbd9.entry.js.map → p-c0363ba7.entry.js.map} +0 -0
  299. /package/dist/twilight/{p-72dbdf8a.entry.js.map → p-c84819d5.entry.js.map} +0 -0
  300. /package/dist/twilight/{p-84efc4e5.system.entry.js.map → p-c87d6aa6.system.entry.js.map} +0 -0
  301. /package/dist/twilight/{p-f0ad1f7a.system.entry.js.map → p-c9678188.system.entry.js.map} +0 -0
  302. /package/dist/twilight/{p-a74c3613.entry.js.map → p-d0004953.entry.js.map} +0 -0
  303. /package/dist/twilight/{p-aa17ca75.system.entry.js.map → p-d097a67d.system.entry.js.map} +0 -0
  304. /package/dist/twilight/{p-cc88bd11.entry.js.map → p-d15630dd.entry.js.map} +0 -0
  305. /package/dist/twilight/{p-15109abe.entry.js.map → p-d513da6f.entry.js.map} +0 -0
  306. /package/dist/twilight/{p-be0c1dee.entry.js.map → p-d5750810.entry.js.map} +0 -0
  307. /package/dist/twilight/{p-1d675685.entry.js.map → p-d84eb47c.entry.js.map} +0 -0
  308. /package/dist/twilight/{p-8e87d5bb.entry.js.map → p-dd83a408.entry.js.map} +0 -0
  309. /package/dist/twilight/{p-2ae3f0e1.system.entry.js.map → p-e2ab2b64.system.entry.js.map} +0 -0
  310. /package/dist/twilight/{p-31c2d596.entry.js.map → p-e784d087.entry.js.map} +0 -0
  311. /package/dist/twilight/{p-777970a0.system.entry.js.map → p-e823d4e8.system.entry.js.map} +0 -0
  312. /package/dist/twilight/{p-eab0ef43.system.entry.js.map → p-e9bc1fa4.system.entry.js.map} +0 -0
  313. /package/dist/twilight/{p-5b0c8164.system.entry.js.map → p-ebd4ac51.system.entry.js.map} +0 -0
  314. /package/dist/twilight/{p-314b3b1d.system.entry.js.map → p-ef38f4ac.system.entry.js.map} +0 -0
  315. /package/dist/twilight/{p-cbd8cbee.entry.js.map → p-f57bcc51.entry.js.map} +0 -0
  316. /package/dist/twilight/{p-b07d4935.entry.js.map → p-f745fcad.entry.js.map} +0 -0
  317. /package/dist/twilight/{p-d8605d58.entry.js.map → p-fcc64f6d.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DisplayType","Currency","sallaProductOptionsCss","SallaProductOptions","exports","class_1","hostRef","_this","this","fileTypes","pdf","png","jpg","word","exl","txt","outOfStockText","donationAmount","salla","lang","get","selectDonationAmount","getWithDefault","selectAmount","isCustomDonation","selectedOptions","disableCardValue","availableDigitalCardValues","outSkus","ignoreDefaultCardValue","productId","config","handleDonationOptions","event","detail","type","helpers","inputDigitsOnly","target","emit","id","price","value","preventDefault","stopPropagation","donationInput","focus","hideLabel","option","DONATION","donation","can_donate","getExpireDonationMessage","completed","target_amount","collected_amount","h","class","target_message","innerHTML","money","canDisabled","url","is_page","onLoaded","options","setOptionsData","Array","isArray","JSON","parse","e","log","optionsData","api","product","getDetails","then","resp","data","prototype","that","_b","_a","details","forEach","Object","entries","skus_availability","filter","sku","map","push","Number","getSelectedOptionsData","formData","host","getElementSallaData","key","startsWith","replace","reportValidity","requiredElements","querySelectorAll","pass","i","length","hasOutOfStockOption","some","is_out","selectedSkus","every","includes","getSelectedOptions","getOption","option_id","find","invalidHandler","closestProductOption","closest","classList","contains","add","firstInvalidElement","querySelector","scrollToElement","element","scrollIntoView","behavior","block","changedHandler","fireChangeEvent","handleCountryOptionChange","optionElement","FILE","IMAGE","MAP","lat","lng","setTimeout","remove","setSelectedSkus","handleRequiredMultipleOptions","index","findIndex","opt","MULTIPLE_OPTIONS","detailIndex","splice","assign","keys","is_selected","selected","changed","reduce","p","c","required","optionContainer","concat","hasChecked","input","toggleAttribute","getLatLng","split","getDisplayForType","COLOR_PICKER","colorPickerOption","multipleOptions","SINGLE_OPTION","singleOption","DIGITAL_CARD_VALUE","digitalCardValuesOption","COUNTRY","countryOption","BOOKING","onInvalidInput","getOptionShownWhen","visibility_condition","operator","getAvailableDigitalCardSKUs","digitalCardOption","_d","Error","outofStockSKUs","op","SKU_key","stopImmediatePropagation","currentCardValue","checked","getSelectedDigitalCardOptions","selectedOption","defaultOption","is_default","componentWillLoad","fillSelectedOptions","optionConfig","error","console","shouldSelectDefaultOption","defaultSelection","onReady","sent","document","addEventListener","handlePaste","bind","needsCartId","storage","cart","getCurrentCartId","Salla","hasApplePay","HTMLInputElement","HTMLTextAreaElement","name","text","clipboardData","getData","start","selectionStart","end","selectionEnd","newValue","slice","setSelectionRange","hideDigitalCardsOptions","render","Host","splitterOption","htmlFor","placeholder","generateUniqueKey","defaultValue","uniqueKey","acc","selectedDetails","mappedDetails","triggerProductFormSelectionEvents","trigger","f","dispatchEvent","window","Event","bubbles","form","observer_1","MutationObserver","disconnect","observe","body","childList","subtree","componentDidLoad","selectedDonationOption","additional_price","donationOption","onChange","custom_amount_enabled","shown","ref","el","onInput","onBlur","onInvalid","currency","symbol","fileUploader","additions","height","onAdded","getUploadImageEndpoint","cart_item_id","product_id","accept","CameraIcon","FileIcon","imageOption","fileOption","types","Boolean","join","numberOption","textOption","maxLength","textareaOption","rows","mapOption","zoom","searchable","onSelected","onSubmitted","color","timeOption","noCalendar","enableTime","dateFormat","onPicked","dateOption","minDate","Date","datetimeOption","maxDate","to_date_time","from_date_time","getOptionDetailName","outOfStock","optionType","detailName","COLOR","isOptionDetailOut","hideOutLabel","isDetailSelected","outSelectableSkus_1","renderInput","isRequired","buttonStyle","isDisabled","disabled","renderOptionDetails","renderSelect","renderButtonStyle","colorOption","style","backgroundColor","thumbnailOption","option_value","image","src","title","alt","CheckCircleIcon","String","toString","defaultChecked","_c","onClick","loading","code","width","toLocaleLowerCase"],"sources":["src/components/salla-product-options/interfaces.ts","src/components/salla-product-options/salla-product-options.scss?tag=salla-product-options","src/components/salla-product-options/salla-product-options.tsx"],"sourcesContent":["export enum DisplayType {\n COLOR = \"color\",\n DATE = \"date\",\n DATETIME = \"datetime\",\n DONATION = \"donation\",\n IMAGE = \"image\",\n MULTIPLE_OPTIONS = \"multiple-options\",\n NUMBER = \"number\",\n SINGLE_OPTION = \"single-option\",\n DIGITAL_CARD_VALUE = \"digital-code-value\",\n COUNTRY = \"country\",\n SPLITTER = \"splitter\",\n TEXT = \"text\",\n TEXTAREA = \"textarea\",\n THUMBNAIL = \"thumbnail\",\n TIME = \"time\",\n RADIO = \"radio\",\n CHECKBOX = \"checkbox\",\n MAP = \"map\",\n FILE = \"file\", // similar to image type (file-uploader component)\n COLOR_PICKER = \"color_picker\",\n BOOKING = \"booking\"\n}\n\nexport interface ProductDetail {\n id: string;\n sku: string;\n name: string;\n description: string;\n url: string;\n promotion_title: string;\n subtitle: string;\n type: string;\n status: string;\n price: number;\n sale_price: number;\n regular_price: number;\n starting_price: null;\n quantity: number;\n max_quantity: number;\n discount_ends: number;\n is_taxable: boolean;\n has_read_more: boolean;\n can_add_note: boolean;\n can_show_remained_quantity: boolean;\n can_upload_file: boolean;\n has_custom_form: boolean;\n is_on_sale: boolean;\n is_hidden_quantity: boolean;\n is_available: boolean;\n is_out_of_stock: boolean;\n weight: null;\n calories: null;\n image: SimpleImage;\n brand: Brand;\n donation?: ProductDonation;\n images: Image[];\n tags: Tag[];\n notify_availability: null;\n rating: Rating;\n options: Option[];\n sold_quantity: number;\n category: Category;\n}\n\nexport interface SimpleImage {\n url: string;\n alt: string;\n}\n\nexport interface Category {\n name: string;\n url: string;\n icon: string;\n}\n\nexport interface ProductDonation {\n target_message?: string;\n collected_amount?: number;\n target_amount?: number;\n target_percent?: number;\n target_end_date?: string;\n can_donate: boolean;\n custom_amount_enabled: boolean;\n}\n\nexport interface Image {\n id: number;\n url: string;\n main: boolean;\n three_d_image_url: string;\n alt: string;\n video_url: string;\n type: string;\n sort: number;\n}\n\nexport interface Option {\n id: number;\n name: string;\n required: boolean;\n type: string;\n placeholder: string;\n option_type: string;\n not_same_day_order: boolean;\n availability_range: number;\n from_date_time: null;\n to_date_time: null;\n visibility_condition?: { option: number, operator: \"=\" | \"!=\", value: number };\n details?: Detail[];\n condition_attributes: string;\n value?: any;\n length?: number;\n donation?: Donation\n}\n\nexport interface Donation {\n custom_amount_enabled: boolean;\n target_message?: string;\n target_date: string | \"2023-04-18\";\n target_end_date: string | \"2023-04-18\";\n target_amount: number;\n collected_amount: number;\n can_donate: boolean;\n}\n\nexport interface Detail {\n id: number;\n option_id: number;\n name: string;\n additional_price: number;\n option_value: null | string;\n image: null | string;\n color: null | string;\n is_out: boolean;\n skus_availability?: { [sku_id: number]: boolean };\n is_selected: boolean;\n is_default?: 0 | 1;\n code?: string;\n type?: string;\n\n}\n\nexport interface Brand {\n id: string;\n url: string;\n name: string;\n logo: string;\n}\n\nexport interface PreTaxPrice {\n amount: number;\n currency: Currency;\n}\n\nexport enum Currency {\n Sar = \"SAR\",\n}\n\nexport interface Promotion {\n title: string;\n sub_title: string;\n}\n\nexport interface Rating {\n count: number;\n stars: number;\n}\n\nexport interface Tag {\n name: string;\n url: string;\n}\n\nexport interface OptionConfig {\n singleOption?: OptionDisplayType;\n multipleOption?: OptionDisplayType;\n}\n\nexport interface OptionDisplayType {\n type: 'button' | 'default'; // defaults to 'default', which is select and checkbox for single and multiple options respectivly\n}\n","\n.s-product-options{\n &-wrapper{\n\n }\n &-option-container{\n\n }\n &-option{\n\n }\n &-option-label{\n\n }\n &-option-content{\n\n }\n &-colors-wrapper{\n\n }\n &-date-element{\n\n }\n &-time-element{\n \n }\n &-datetime-element{\n\n }\n &-image-input{\n\n }\n &-multiple-options-wrapper{\n\n }\n &-splitter{\n\n }\n &-text{\n\n }\n &-textarea{\n\n }\n &-thumbnails-wrapper{\n\n }\n}\n","import { Component, Prop, h, State, Element, Host, Event, type EventEmitter, Method } from '@stencil/core';\nimport { type Option, DisplayType, type Detail, OptionConfig } from './interfaces';\nimport CheckCircleIcon from '../../assets/svg/check.svg';\nimport CameraIcon from '../../assets/svg/camera.svg';\nimport FileIcon from '../../assets/svg/file-upload.svg';\n\n@Component({\n tag: 'salla-product-options',\n styleUrl: 'salla-product-options.scss',\n})\nexport class SallaProductOptions {\n\n constructor() {\n this.canDisabled = !salla.config.get('store.settings.product.notify_options_availability') || salla.url.is_page('cart');\n salla.lang.onLoaded(() => {\n this.outOfStockText = salla.lang.get(\"pages.products.out_of_stock\");\n this.donationAmount = salla.lang.get('pages.products.donation_amount');\n this.selectDonationAmount = salla.lang.getWithDefault('pages.products.select_donation_amount', 'تحديد مبلغ التبرع');\n this.selectAmount = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ');\n });\n\n if (this.options) {\n try {\n this.setOptionsData(Array.isArray(this.options) ? this.options : JSON.parse(this.options));\n return;\n } catch (e) {\n salla.log('Bad json passed via options prop');\n }\n }\n if (!Array.isArray(this.optionsData)) {\n salla.log('Options is not an array[] ---> ', this.optionsData);\n this.setOptionsData([]);\n }\n\n if (this.productId && !salla.url.is_page('cart')) {\n salla.api.product.getDetails(this.productId, ['options']).then(resp => this.setOptionsData(resp.data.options));\n }\n }\n /**\n * Sets the options data for the product\n * @param optionsData - Array of product options\n */\n @Method()\n async setOptionsData(optionsData: Option[]) {\n this.optionsData = optionsData;\n const that = this\n this.optionsData[0]?.details?.forEach(function (detail) {\n Object.entries(detail.skus_availability || {})\n .filter(sku => !sku[1])\n .map(sku => that.outSkus.push(Number(sku[0])));\n });\n }\n\n @Element() host: HTMLElement;\n\n private fileTypes: Record<string, string> = {\n pdf: 'application/pdf',\n png: 'image/png',\n jpg: 'image/jpeg',\n word: 'application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n exl: 'application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n txt: 'text/plain',\n };\n\n @State() optionsData: Option[]\n @State() outOfStockText = \"\"\n @State() donationAmount: string = salla.lang.get('pages.products.donation_amount')\n @State() selectDonationAmount: string = salla.lang.getWithDefault('pages.products.select_donation_amount', 'تحديد مبلغ التبرع')\n @State() selectAmount: string = salla.lang.getWithDefault('pages.products.select_amount', 'اختر المبلغ')\n @State() isCustomDonation = false;\n @State() selectedOptions = [];\n @State() canDisabled: boolean;\n @State() selectedSkus?: Array<string | number>;\n @State() selectedOutSkus?: Array<string | number>;\n @State() disableCardValue = true\n @State() availableDigitalCardValues: Detail[] = []\n\n private outSkus: Array<string | number> = [];\n private donationInput?: HTMLInputElement;\n private optionConfig: OptionConfig;\n /**\n * Avoid selection of previous default or selected card value option \n * when switching between digital card country options for the 1st time\n */\n private ignoreDefaultCardValue = false\n /**\n * The id of the product to which the options are going to be fetched for.\n */\n @Prop() productId: number = salla.config.get('page.id');\n\n /**\n * Product detail information.\n */\n @Prop() options: string\n\n /**\n * Hide the out of stock label.\n * Will be used in the case of live validation such as cart page and inline checkout\n */\n @Prop() hideOutLabel: string\n\n /**\n * A unique key used to generate distinct identifiers.\n * \n * This key is appended to a default value to ensure uniqueness\n * across instances or components where differentiation is required.\n */\n @Prop() uniqueKey: string\n\n /**\n * Configuration for customizing the display layout of product options.\n * The `config` prop accepts a JSON string that specifies the layout type for rendering options.\n * It allows customization of how single-option and multiple-option selections are displayed.\n * \n * Example Usage:\n * ```html\n * <salla-product-options \n * options=\"{{ product.options }}\" \n * product-id=\"{{ product.id }}\" \n * unique-key=\"abc123\"\n * config='{\n * \"single-option\": { \"type\": \"button\" },\n * \"multiple-option\": { \"type\": \"button\" }\n * }'>\n * </salla-product-options>\n * ```\n * \n * Example Config JSON:\n * ```json\n * {\n * \"single-option\": { \"type\": \"button\" },\n * \"multiple-option\": { \"type\": \"default\" }\n * }\n * ```\n * \n * - `single-option`:\n * - Defines the display style for single-option selections.\n * - `type`: Supported values:\n * - `\"button\"`: Displays options in a button-style grid layout.\n * - `\"default\"`: Displays options as a dropdown (default).\n * \n * - `multiple-option`:\n * - Defines the display style for multiple-option selections.\n * - `type`: Supported values:\n * - `\"button\"`: Displays options in a button-style grid layout.\n * - `\"default\"`: Displays options as a list of checkboxes (default).\n */\n @Prop() config: string;\n\n /**\n * Get the id's of the selected options.\n * */\n @Method()\n async getSelectedOptionsData() {\n const selectedOptions = {}\n const formData = (this.host as HTMLElement & { getElementSallaData: () => FormData }).getElementSallaData();\n formData.forEach((value, key) => {\n if (key.startsWith('options[')) { (selectedOptions[key.replace('options[', '').replace(']', '')] = value) }\n });\n return selectedOptions;\n }\n\n /**\n * Report options form validity.\n * */\n @Method()\n async reportValidity() {\n const requiredElements = this.host.querySelectorAll('[required]') as unknown as Array<HTMLInputElement>;\n let pass = true;\n for (let i = 0; i < requiredElements.length; i++) {\n //if there is only one invalid option, return false\n if ('reportValidity' in requiredElements[i] && !requiredElements[i].reportValidity()) {\n pass = false;\n }\n }\n return pass;\n }\n\n /**\n * Return true if there is any out of stock options are selected and vise versa.\n * */\n @Method()\n async hasOutOfStockOption() {\n return this.selectedOptions.some(option => option.is_out) || (this.selectedSkus?.length && this.selectedSkus?.every(sku => this.outSkus.includes(sku)));\n }\n\n /**\n * Get selected options.\n * */\n @Method()\n async getSelectedOptions() {\n return this.selectedOptions;\n }\n\n /**\n * Get a specific option by its id.\n * */\n @Method()\n async getOption(option_id) {\n return this.optionsData.find(option => option.id === option_id);\n }\n\n /**\n * An event that emitted when any option is changed.\n */\n @Event() changed: EventEmitter;\n\n // @ts-ignore\n private invalidHandler(event: Event, option: Option) {\n const closestProductOption = (event.target as HTMLInputElement).closest('.s-product-options-option') as HTMLElement;\n\n if (!closestProductOption.classList.contains('s-product-options-option-error')) {\n closestProductOption.classList.add('s-product-options-option-error');\n }\n\n if (!salla.url.is_page('cart')) {\n const firstInvalidElement = this.host.querySelector('.s-product-options-option-error');\n if (firstInvalidElement === closestProductOption) {\n this.scrollToElement(closestProductOption);\n }\n }\n }\n\n private scrollToElement(element: HTMLElement) {\n if (element) {\n element.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }\n }\n\n private changedHandler(event, option, fireChangeEvent = true) {\n const data = {\n event: event,\n option: option,\n detail: null,\n productId: this.productId\n };\n\n if (option.details) {\n const detail = option.details.find((detail) => {\n return Number(detail.id) === Number(event.target.value);\n });\n data.detail = detail;\n }\n\n if (option.type === 'country') {\n this.handleCountryOptionChange(event, data.detail);\n }\n\n const optionElement = event.target.closest('.s-product-options-option');\n if (event.target.value ||\n ((option.type === DisplayType.FILE || option.type === DisplayType.IMAGE) && event.type === 'added') ||\n (option.type === DisplayType.MAP && event.type === 'selected' && (event.target.lat && event.target.lng))) {\n setTimeout(() => {\n optionElement.classList.remove('s-product-options-option-error');\n }, 200);\n }\n\n if (option.type === DisplayType.DONATION) {\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n }\n\n this.setSelectedSkus();\n this.handleRequiredMultipleOptions(option);\n\n const index = this.selectedOptions.findIndex(opt => opt.option_id === data.option.id);\n\n if (data.option.type === DisplayType.MULTIPLE_OPTIONS) {\n // Handle multiple selections\n const detailIndex = this.selectedOptions.findIndex(\n opt => opt.option_id === data.option.id && opt?.id === data.detail?.id\n );\n if (detailIndex > -1) {\n // If the option is already selected, remove it (unselect)\n this.selectedOptions.splice(detailIndex, 1);\n } else {\n // If the option is not selected, add it to the selectedOptions array\n this.selectedOptions.push({ ...data.detail, option_id: data.option.id });\n }\n } else {\n // Handle single selection\n if (!data.detail || Object.keys(data.detail).length === 0) {\n // If there is no value for the single-select, remove it from the selectedOptions array\n if (index > -1) {\n this.selectedOptions.splice(index, 1);\n }\n } else {\n // If a value exists, update or add the selection\n if (index > -1) {\n // Replace the existing selection with the new one\n this.selectedOptions[index] = { ...data.detail, option_id: data.option.id };\n } else {\n // If no selection exists for this input, add the new selection\n this.selectedOptions.push({ ...data.detail, option_id: data.option.id });\n }\n }\n }\n\n \n // Update optionsData directly\n this.optionsData = this.optionsData.map(opt => {\n if (opt.id === data.option.id) {\n return {\n ...opt,\n details: opt.details.map(detail => ({\n ...detail,\n is_selected: data.option.type === DisplayType.MULTIPLE_OPTIONS\n ? this.selectedOptions.some(selected => selected.id === detail.id)\n : Number(detail.id) === Number(data.detail?.id),\n value: data.detail?.value\n }))\n };\n }\n return opt;\n });\n // Emit the event only if fireChangeEvent is true\n if (fireChangeEvent) {\n this.changed.emit(data);\n salla.event.emit('product-options::change', data);\n }\n }\n\n\n private handleDonationOptions = (event, detail, type) => {\n if (detail === 'custom' && type === 'input') {\n salla.helpers.inputDigitsOnly(event.target)\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n this.isCustomDonation = event.target.value === 'custom';\n if (this.donationInput) {\n if (event.target.value === 'custom') {\n this.donationInput.value = '';\n this.donationInput.focus()\n } else {\n this.donationInput.value = event.target.value;\n }\n if (detail === 'custom') {\n return\n }\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: event.target.value\n });\n }\n }\n\n private hideLabel = (option) => {\n if (option.type === DisplayType.DONATION && (option.donation && !option.donation.can_donate)) {\n return true;\n }\n return false;\n }\n\n private getExpireDonationMessage = (option) => {\n if (!option.donation) {\n return;\n }\n const completed = option.donation.target_amount <= option.donation.collected_amount;\n return <div class={{ \"s-product-options-donation-message\": true, \"s-product-options-donation-completed\": completed, \"s-product-options-donation-expired\": !completed }}>\n <p>{option.donation.target_message}</p>\n <span innerHTML={completed ? salla.money(option.donation.target_amount) : ''}></span>\n </div>\n }\n /**\n * loop throw all selected details, then get common sku, if it's only one, means we selected all of them;\n */\n private setSelectedSkus() {\n this.selectedSkus = this.selectedOptions.map(detail => Object.keys(detail.skus_availability || {}))\n .reduce((p, c) => p.filter(e => c.includes(e)), []) // Initialize accumulator as an empty array\n .map(sku => Number(sku));\n }\n \n\n private handleRequiredMultipleOptions(option) {\n if (option.type !== DisplayType.MULTIPLE_OPTIONS || !option.required) {\n return;\n }\n const optionContainer = this.host.querySelector(`[data-option-id=\"${option.id}\"]`);\n const hasChecked = optionContainer.querySelectorAll('input:checked').length;\n optionContainer.querySelectorAll('input').forEach(input => input.toggleAttribute('required', !hasChecked));\n }\n\n private getLatLng(value, type: 'lat' | 'lng') {\n return value\n ? value.split(',')[type === 'lat' ? 0 : 1]\n : '';\n }\n\n private getDisplayForType(option: Option) {\n if (this[`${option.type}Option`]) {\n return this[`${option.type}Option`](option);\n }\n\n if (option.type === DisplayType.COLOR_PICKER) {\n return this.colorPickerOption(option)\n }\n\n if (option.type === DisplayType.MULTIPLE_OPTIONS) {\n return this.multipleOptions(option);\n }\n\n if (option.type === DisplayType.SINGLE_OPTION) {\n return this.singleOption(option);\n }\n\n if (option.type === DisplayType.DIGITAL_CARD_VALUE) {\n return this.digitalCardValuesOption(option);\n }\n if (option.type === DisplayType.COUNTRY) {\n return this.countryOption(option);\n }\n\n if (option.type === DisplayType.BOOKING && salla.url.is_page(\"cart\")) {\n return <salla-booking-field onInvalidInput={(e) => this.invalidHandler(e, option)} option={option as any} productId={option.value}></salla-booking-field>\n }\n\n salla.log(`Couldn't find options type(${option.type})😢`);\n return '';\n }\n\n protected getOptionShownWhen(option: Option) {\n return option.visibility_condition\n ? { \"data-show-when\": `options[${option.visibility_condition.option}] ${option.visibility_condition.operator} ${option.visibility_condition.value}` }\n : {};\n }\n\n private getAvailableDigitalCardSKUs(detail: Detail) {\n const digitalCardOption = this.optionsData.find(({ type }) => type === 'digital-code-value')\n\n if (!digitalCardOption) throw new Error('product-options:: No digital card options found')\n\n const outofStockSKUs = Object.keys(detail.skus_availability).filter(key => detail.skus_availability[key] === false)\n\n this.availableDigitalCardValues = digitalCardOption.details.filter((op) => {\n\n return !Object.keys(op.skus_availability).filter(SKU_key => outofStockSKUs.includes(SKU_key)).length\n\n })\n\n }\n private handleCountryOptionChange(event: Event, detail: Detail) {\n event.stopImmediatePropagation()\n\n this.ignoreDefaultCardValue = true\n\n const currentCardValue = this.host.querySelector(\"input[data-code-value]:checked\") as HTMLInputElement | null\n\n if (currentCardValue) currentCardValue.checked = false\n\n const digitalCardOption = this.optionsData.find(({ type }) => type === 'digital-code-value')\n\n if (!digitalCardOption) throw new Error('product-options:: No digital card options found')\n\n this.getAvailableDigitalCardSKUs(detail)\n }\n\n private getSelectedDigitalCardOptions(option: Option) {\n const selectedOption = option.details.find(detail => detail.is_selected)\n const defaultOption = option.details.find(detail => !!detail.is_default) || option.details[0] /*option.details[0] only applys for counrty options*/\n if (!['digital-code-value', 'country'].includes(option.type)) return\n\n return selectedOption || defaultOption\n\n\n }\n\n //we need the cart Id for productOption Image\n async componentWillLoad() {\n if(salla.url.is_page(\"cart\")){\n this.disableCardValue=false\n this.fillSelectedOptions();\n }\n\n if (this.config) {\n try {\n this.optionConfig = typeof this.config === 'string' ? JSON.parse(this.config) : this.config;\n } catch (error) {\n console.error('Failed to parse JSON in config prop:', error);\n }\n }\n\n const shouldSelectDefaultOption = this.optionsData.filter(({ type }) => [\"country\", \"digital-card-value\"].includes(type)).length > 0 && salla.url.is_page('cart')\n\n if (shouldSelectDefaultOption) {\n const countryOption = this.optionsData.find(option => option.type === 'country')\n\n const defaultSelection = countryOption && this.getSelectedDigitalCardOptions(countryOption)\n\n if (defaultSelection) {\n this.getAvailableDigitalCardSKUs(defaultSelection)\n }\n }\n this.outOfStockText = salla.lang.get('pages.products.out_of_stock')\n await salla.onReady();\n document.addEventListener(\"paste\", this.handlePaste.bind(this));\n const needsCartId = (!salla.storage.get('cart.id') && this.optionsData.some(option => ['file', 'image'].includes(option.type)));\n return needsCartId ? salla.api.cart.getCurrentCartId(false, \"salla-product-options\") : null;\n }\n\n /**\n * This is a workaround for a bug in iOS 26 Safari, when pasting English text to RTL inputs, it adds extra text!!\n * To avoid any break changes, we will make it only work on these conditions:\n * - content_copyright is on\n * - Apple Pay is enabled (means it's iOS/safari)\n * - Input is an input or textarea\n * - Salla form control\n * - Options array\n */\n private handlePaste(event: ClipboardEvent) {\n const target = event.target;\n if (\n !Salla.config.get('store.settings.content_copyright')\n || !Salla.helpers.hasApplePay()\n || !(target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement)\n || !target.classList.contains('s-form-control')\n || !target.name.startsWith('options[')) {\n return;\n }\n // Prevent default paste (to avoid Safari inserting extra content)\n event.preventDefault();\n\n // Read only the clipboard data\n const text = event.clipboardData?.getData(\"text\") || \"\";\n\n // Insert it manually at cursor if you want\n const start = target.selectionStart;\n const end = target.selectionEnd;\n\n const newValue = target.value.slice(0, start) + text + target.value.slice(end);\n\n target.value = newValue;\n\n // Reset cursor position\n target.setSelectionRange(start + text.length, start + text.length);\n }\n\n private hideDigitalCardsOptions(option:Option){\n return (this.disableCardValue && option.type===DisplayType.DIGITAL_CARD_VALUE && !salla.url.is_page(\"cart\"))\n }\n\n render() {\n if (this.optionsData?.length === 0) {\n return;\n }\n\n return (\n <Host class=\"s-product-options-wrapper\">\n {/* TODO:: move salla-conditional-field logic to here, no need of another component*/}\n <salla-conditional-fields>\n {this.optionsData.map((option: Option) =>\n <div key={option.id} class={`s-product-options-option-container${option.visibility_condition || this.hideDigitalCardsOptions(option) ? ' hidden' : ''}`}\n data-option-id={option.id}\n {...this.getOptionShownWhen(option)}>\n {option.name === 'splitter' ?\n this.splitterOption()\n : <div class={{ \"s-product-options-option\": true, \"s-product-options-option-booking\": option.type === DisplayType.BOOKING && salla.url.is_page(\"cart\") }} data-option-type={option.type}\n data-option-required={`${option.required}`}>\n <label htmlFor={`options[${option.id}]`} class={`s-product-options-option-label ${this.hideLabel(option) ? 's-product-options-option-label-hidden' : ''}`}>\n <b>\n {option.name}\n {option.required && <span> * </span>} </b>\n <small>{option.placeholder}</small>\n </label>\n <div class={`s-product-options-option-content ${this.hideLabel(option) || (option.type === DisplayType.BOOKING && salla.url.is_page(\"cart\")) ? 's-product-options-option-content-full-width' : ''}`}>\n {this.getDisplayForType(option)}\n </div>\n </div>}\n </div>\n )}\n </salla-conditional-fields>\n </Host>\n );\n\n }\n\n private generateUniqueKey(defaultValue: string): string {\n return this.uniqueKey ? `${defaultValue}-${this.uniqueKey}` : defaultValue;\n }\n private fillSelectedOptions() {\n this.selectedOptions = this.optionsData.reduce((acc, opt) => {\n const selectedDetails = opt.details.filter(detail => detail.is_selected);\n const mappedDetails = selectedDetails.map(detail => ({\n ...detail,\n option_id: opt.id\n }));\n return acc.concat(mappedDetails);\n }, []);\n }\n\n private triggerProductFormSelectionEvents() {\n const trigger = (f: HTMLFormElement) =>\n ['change', 'input'].forEach(e => f.dispatchEvent(new window.Event(e, { bubbles: true })));\n const form = this.host.closest('form') as HTMLFormElement;\n if (form) {\n trigger(form);\n } else {\n // Fallback: wait for parent form to appear\n const observer = new MutationObserver(() => {\n const form = this.host.closest('form') as HTMLFormElement;\n if (form) {\n trigger(form);\n observer.disconnect();\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n }\n }\n\n componentDidLoad() {\n if (salla.url.is_page('product.single')) {\n this.triggerProductFormSelectionEvents();\n }\n if (this.optionsData?.length === 0 && !this.optionsData.some(option => option.type === DisplayType.DONATION)) {\n return;\n }\n const selectedDonationOption = this.optionsData.find(option => option.type === DisplayType.DONATION)?.details.find(detail => detail.is_selected);\n if (!selectedDonationOption) {\n return;\n }\n setTimeout(() => {\n salla.event.emit('product-options::donation-changed', {\n id: this.productId,\n price: selectedDonationOption.additional_price\n });\n }, 1000);\n }\n //@ts-ignore\n private donationOption(option: Option, product: Product) {\n return <div class=\"s-product-options-donation-wrapper\">\n\n {option.donation?.can_donate ? [\n option.donation ?\n <div key={option.id} class=\"s-product-options-donation-progress\">\n <salla-progress-bar donation={option.donation}>\n </salla-progress-bar>\n </div>\n : '',\n option.details.length ?\n [<h4 key={option.id}>{this.selectAmount}</h4>,\n <div key={option.id} class=\"s-product-options-donation-options\">\n {option.details.map((detail, i) =>\n <div key={option.id} class=\"s-product-options-donation-options-item\">\n <input id={this.generateUniqueKey(`donation-option-${i}`)} type=\"radio\" name=\"donating_option\" checked={detail.is_selected} value={detail.additional_price} onChange={e => this.handleDonationOptions(e, detail, 'option')} />\n <label htmlFor={this.generateUniqueKey(`donation-option-${i}`)}>\n <span innerHTML={salla.money(detail.name)}></span>\n </label>\n </div>\n )}\n {option.donation?.custom_amount_enabled ?\n <div class=\"s-product-options-donation-options-item\">\n <input id={this.generateUniqueKey(\"donation-option-custom\")} type=\"radio\" name=\"donating_option\" value=\"custom\" onChange={e => this.handleDonationOptions(e, 'custom', 'option')} />\n <label htmlFor={this.generateUniqueKey(\"donation-option-custom\")}>\n <span> {this.selectDonationAmount} </span>\n </label>\n </div>\n : ''\n }\n </div>] : '',\n\n <div key={option.id} class={{ \"s-product-options-donation-input-group\": true, \"shown\": !option.details.length || (option.details.length && this.isCustomDonation) }}>\n <input\n type=\"text\"\n id=\"donating-amount\"\n name=\"donation_amount\"\n class=\"s-form-control\"\n ref={el => { this.donationInput = el as HTMLInputElement }}\n value={\n option.details.length\n && option.details.some(detail => detail.is_selected)\n ? option.details.find(detail => detail.is_selected).additional_price\n : option.value}\n // required\n placeholder={option.placeholder}\n onInput={e => this.handleDonationOptions(e, 'custom', 'input')}\n onBlur={e => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n />\n {/* value={option.value} */}\n <span class=\"s-product-options-donation-amount-currency\">\n {salla.config.currency(salla.config.get('user.currency_code')).symbol}\n </span>\n </div>\n ] :\n this.getExpireDonationMessage(option)\n }\n </div>\n }\n\n private fileUploader(option: Option, additions: Record<string, unknown> | null = null) {\n return <salla-file-upload\n {...(additions || {})}\n payload-name=\"file\"\n value={option.value}\n instant-upload={true}\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n height=\"120px\"\n onAdded={(e) => this.changedHandler(e, option)}\n url={salla.cart.api.getUploadImageEndpoint()}\n form-data={{ cart_item_id: this.productId, product_id: this.productId }}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n class={{ \"s-product-options-image-input\": true, required: option.required }}\n >\n <div class=\"s-product-options-filepond-placeholder\">\n <span class=\"s-product-options-filepond-placeholder-icon\"\n innerHTML={(additions as { accept: string }).accept?.split(',').every(type => type.includes('image'))\n ? CameraIcon\n : FileIcon}\n />\n <p class=\"s-product-options-filepond-placeholder-text\">{salla.lang.get('common.uploader.drag_and_drop')}</p>\n <span class=\"filepond--label-action\">{salla.lang.get('common.uploader.browse')}</span>\n </div>\n </salla-file-upload>\n }\n\n //@ts-ignore\n private imageOption(option: Option) {\n return this.fileUploader(option, { accept: 'image/png,image/jpeg,image/jpg,image/gif' });\n }\n\n //@ts-ignore\n private fileOption(option: Option) {\n const types = option.details.map(detail => this.fileTypes[detail.name]).filter(Boolean);\n return types?.length\n ? this.fileUploader(option, { accept: types.join(',') })\n : 'File types not selected.';\n }\n\n // TODO: (ONLY FOR TESTING!) find a better way to make it testable, e.g. wrap it with a unique class like textOption\n //@ts-ignore\n private numberOption(option: Option) {\n return <input\n type=\"text\"\n value={option.value}\n class=\"s-form-control\"\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onBlur={e => this.changedHandler(e, option)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onInput={e => salla.helpers.inputDigitsOnly(e.target)} />\n }\n\n //@ts-ignore\n private splitterOption() {\n return <div class=\"s-product-options-splitter\" />\n }\n\n //@ts-ignore\n private textOption(option: Option) {\n return <div class=\"s-product-options-text\">\n <input\n type=\"text\"\n value={option.value}\n maxLength={option?.length}\n class='s-form-control'\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={e => this.changedHandler(e, option)} />\n </div>\n }\n\n //@ts-ignore\n private textareaOption(option: Option) {\n //todo::remove mt-1 class, and if it's okay to remove the tag itself will be great\n return <div class=\"s-product-options-textarea\">\n <div class=\"mt-1\">\n <textarea\n rows={4}\n value={option.value}\n maxLength={option?.length}\n class=\"s-form-control\"\n required={!option.visibility_condition && option.required}\n id={`options[${option.id}]`}\n name={`options[${option.id}]`}\n placeholder={option.placeholder}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)} />\n </div>\n </div>\n }\n\n //@ts-ignore\n private mapOption(option: Option) {\n return <salla-map\n zoom={15}\n lat={this.getLatLng(option.value, 'lat')}\n lng={this.getLatLng(option.value, 'lng')}\n name={`options[${option.id}]`}\n searchable={true}\n required={option.required}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onSelected={e => this.changedHandler(e, option)} />\n }\n\n private colorPickerOption(option: Option) {\n return <salla-color-picker\n onSubmitted={e => this.changedHandler(e, option)}\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n color={option.value} />\n }\n\n /**\n * ============= Date Time options =============\n */\n //@ts-ignore\n private timeOption(option: Option) {\n return <salla-datetime-picker\n noCalendar={true}\n enableTime={true}\n dateFormat=\"h:i K\"\n value={option.value}\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n class=\"s-product-options-time-element\"\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n }\n\n //@ts-ignore\n private dateOption(option: Option) {\n //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23\n return <div class=\"s-product-options-date-element\">\n <salla-datetime-picker\n value={option.value}\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n minDate={new Date()}\n name={`options[${option.id}]`}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n </div>\n }\n\n //@ts-ignore\n private datetimeOption(option: Option) {\n //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23\n return <div class=\"s-product-options-datetime-element\">\n <salla-datetime-picker\n enableTime={true}\n value={option.value}\n dateFormat=\"Y-m-d G:i:K\"\n placeholder={option.name}\n required={!option.visibility_condition && option.required}\n name={`options[${option.id}]`}\n maxDate={option.to_date_time}\n minDate={option.from_date_time}\n onInvalidInput={(e) => this.invalidHandler(e, option)}\n onPicked={e => this.changedHandler(e, option)} />\n </div>\n }\n\n /**\n * ============= Advanced options =============\n */\n protected getOptionDetailName(detail: Detail, outOfStock = true, optionType?: string) {\n let detailName;\n if (optionType && optionType === DisplayType.COLOR) {\n detailName = detail.name\n + ((outOfStock && this.isOptionDetailOut(detail) && !salla.url.is_page(\"cart\")) && !this.hideOutLabel ? ` <br/> <p> ${this.outOfStockText} </p>` : '')\n + (detail.additional_price ? ` <p> (${salla.money(detail.additional_price, false)}) </p>` : '');\n }\n\n if(!detailName){\n detailName = detail.name\n + ((outOfStock && this.isOptionDetailOut(detail) && !salla.url.is_page(\"cart\")) && !this.hideOutLabel ? ` - ${this.outOfStockText}` : '')\n + (detail.additional_price ? ` (${salla.money(detail.additional_price, false)})` : '');\n }\n\n //Some merchants adding price to the names of the options,\n //and because we are using this inside select option, we need to replace the html currency symbol with the store currency symbol\n return detailName.replace('<i class=sicon-sar></i>',salla.config.currency()?.symbol || 'ر.س');\n }\n\n\n protected isOptionDetailOut(detail: Detail) {\n if (detail.is_out || !detail.skus_availability || !this.selectedSkus?.length) {\n return detail.is_out;\n }\n\n const isDetailSelected = this.selectedOptions.filter(option => option.id === detail.id).length;\n //if the current options is the only selected option, so we are sure that it's not out, because there is no other options selected yet\n if (isDetailSelected && this.selectedOptions.length === 1) {\n return false;\n }\n\n //if current details has sku in the possible outSkus it's out for sure\n if (isDetailSelected) {\n //here we will get the possible outSkus for current selected options\n const outSelectableSkus = this.selectedSkus.filter(sku => this.outSkus.includes(sku));\n return Object.keys(detail.skus_availability).some(sku => outSelectableSkus.includes(Number(sku)))\n }\n\n return this.selectedOptions.some(option => option.is_out && option.option_id !== detail.option_id)\n\n }\n\n /**\n * Renders a single input element (radio or checkbox) for an option detail.\n * @param type - The type of input element ('radio' or 'checkbox').\n * @param detail - The detail object representing an option detail.\n * @param option - The parent option object containing the details.\n * @param isRequired - Indicates if the input is required based on the option's rules.\n * @param name - The name attribute for the input element.\n * @returns HTMLElement - A labeled input element.\n */\n private renderInput(\n type: 'radio' | 'checkbox',\n detail: Detail,\n option: Option,\n isRequired: boolean,\n name: string,\n buttonStyle: boolean,\n ): HTMLElement {\n const id = this.generateUniqueKey(`${type}-${option.id}-${detail.id}`);\n const isDisabled = this.isOptionDetailOut(detail);\n return (\n <label class={{\n \"s-product-options-disabled\": isDisabled,\n }}>\n <input\n id={id}\n type={type}\n name={name}\n value={detail.id}\n disabled={isDisabled}\n required={isRequired}\n checked={detail.is_selected}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)}\n />\n <div class={{\"s-product-options-grid-mode-span\": buttonStyle, \"s-product-options-disabled\": isDisabled}}>\n {this.getOptionDetailName(detail)}\n </div>\n </label>\n );\n }\n\n /**\n * Renders a collection of input elements for all details of an option.\n * @param type - The type of input elements ('radio' or 'checkbox').\n * @param option - The parent option object containing the details.\n * @param isRequired - Indicates if the inputs are required based on the option's rules.\n * @returns HTMLElement[] - An array of labeled input elements.\n */\n private renderOptionDetails(\n type: 'radio' | 'checkbox',\n option: Option,\n isRequired: boolean,\n buttonStyle: boolean = false\n ): HTMLElement[] {\n const name = type === 'radio' ? `options[${option.id}]` : `options[${option.id}][]`;\n return option?.details.map((detail: Detail) =>\n this.renderInput(type, detail, option, isRequired, name, buttonStyle)\n );\n }\n\n /**\n * Renders a dropdown (select) element for a single-option selection.\n * @param option - The parent option object.\n * @returns HTMLElement - A select dropdown element with all option details.\n */\n private renderSelect(option: Option): HTMLElement {\n return (\n <div>\n <select\n name={`options[${option.id}]`}\n required={!option.visibility_condition && option.required}\n class=\"s-form-control\"\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)}\n >\n <option value=\"\">{option.placeholder}</option>\n {option?.details.map((detail: Detail) => (\n <option\n key={detail.id}\n value={detail.id}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n selected={detail.is_selected}\n >\n {this.getOptionDetailName(detail)}\n </option>\n ))}\n </select>\n </div>\n );\n }\n\n /**\n * Renders a grid-based layout for option inputs (radio or checkbox).\n * @param type - The type of input elements ('radio' or 'checkbox').\n * @param option - The parent option object containing the details.\n * @param isRequired - Indicates if the inputs are required based on the option's rules.\n * @returns HTMLElement - A grid-based container with input elements.\n */\n private renderButtonStyle(\n type: 'radio' | 'checkbox',\n option: Option,\n isRequired: boolean\n ): HTMLElement {\n return (\n <div class=\"s-product-options-grid-mode\">\n {this.renderOptionDetails(type, option, isRequired, true)}\n </div>\n );\n }\n\n /**\n * Renders a single-option selection, either as a grid or dropdown, based on configuration.\n * @param option - The parent option object.\n * @returns HTMLElement - The rendered single-option element.\n */\n private singleOption(option: Option): HTMLElement {\n const buttonStyle = this.optionConfig?.['single-option']?.type === 'button';\n const isRequired = !option.visibility_condition && option.required;\n\n return buttonStyle\n ? this.renderButtonStyle('radio', option, isRequired)\n : this.renderSelect(option);\n }\n\n /**\n * Renders a multiple-option selection, either as a grid or list, based on configuration.\n * @param option - The parent option object.\n * @returns HTMLElement - The rendered multiple-option element.\n */\n private multipleOptions(option: Option): HTMLElement {\n const buttonStyle = this.optionConfig?.['multiple-option']?.type === 'button';\n const isRequired =\n option.required &&\n !option.details.some((detail) => detail.is_selected) &&\n !option.visibility_condition;\n\n return buttonStyle\n ? this.renderButtonStyle('checkbox', option, isRequired)\n : (\n <div\n class={{\n 's-product-options-multiple-options-wrapper': true,\n required: option.required,\n }}\n >\n {this.renderOptionDetails('checkbox', option, isRequired)}\n </div>\n );\n }\n \n //@ts-ignore\n private colorOption(option: Option) {\n return (\n <fieldset\n class=\"s-product-options-colors-wrapper\"\n >\n {option?.details.map((detail) => (\n <div\n class=\"s-product-options-colors-item\"\n key={detail.id}\n >\n <input\n type=\"radio\"\n value={detail.id}\n required={!option.visibility_condition && option.required}\n checked={detail.is_selected}\n name={`options[${option.id}]`}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n id={this.generateUniqueKey(`color-${this.productId}-${option.id}-${detail.id}`)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)}\n />\n <label htmlFor={this.generateUniqueKey(`color-${this.productId}-${option.id}-${detail.id}`)}>\n <span style={{ backgroundColor: detail.color }} />\n <div innerHTML={this.getOptionDetailName(detail, true, option.type)} />\n </label>\n </div>\n ))}\n </fieldset>\n );\n } \n\n //@ts-ignore\n private thumbnailOption(option: Option) {\n return <div class=\"s-product-options-thumbnails-wrapper\">\n {option.details.map((detail: Detail) => {\n return <div key={detail.id}>\n <input type=\"radio\"\n value={detail.id}\n data-itemid={detail.id} //todo:: why need this? it's already in the value!\n required={!option.visibility_condition && option.required}\n checked={detail.is_selected}\n name={`options[${option.id}]`}\n data-img-id={detail.option_value}\n disabled={this.canDisabled && this.isOptionDetailOut(detail)}\n id={this.generateUniqueKey(`option_${this.productId}-${option.id}_${detail.id}`)}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={(e) => this.changedHandler(e, option)} />\n <label htmlFor={this.generateUniqueKey(`option_${this.productId}-${option.id}_${detail.id}`)}\n data-img-id={detail.option_value}\n class=\"go-to-slide\">\n <img data-src={detail.image} src={detail.image} title={detail.name} alt={detail.name} />\n <span innerHTML={CheckCircleIcon} class=\"s-product-options-thumbnails-icon\" />\n {this.isOptionDetailOut(detail) ?\n [\n <small key={detail.id} class=\"s-product-options-thumbnails-stock-badge\">{this.outOfStockText}</small>,\n this.canDisabled ? <div key={detail.id} class=\"s-product-options-thumbnails-badge-overlay\" /> : '',\n ]\n : ''}\n </label>\n <p>{this.getOptionDetailName(detail, false)} </p>\n </div>\n })}\n </div>\n }\n\n // Digital card options\n private digitalCardValuesOption(option: Option) {\n\n return <div class=\"s-product-options-digital-card-wrapper\">\n {this.availableDigitalCardValues.length > 0 ? this.availableDigitalCardValues.map((detail) => {\n const id = String(detail.id)\n return <label htmlFor={this.generateUniqueKey(id.toString())} key={id} class=\"s-product-options-digital-card-option\">\n <input type=\"radio\" data-code-value class=\"s-form-control s-product-options-digital-card-input\" value={detail.id}\n name={`options[${option.id}]`}\n id={this.generateUniqueKey(id.toString())}\n required={!option.visibility_condition && option.required}\n onInvalid={(e) => this.invalidHandler(e, option)}\n {...(!this.ignoreDefaultCardValue ? {defaultChecked: this.getSelectedDigitalCardOptions(option)?.id === detail.id}:{})}\n\n />\n <span>{detail.name} {salla.config?.currency()?.symbol}</span>\n </label>\n })\n : <div class=\"s-product-options-digital-card-out-of-stock\"/>\n }\n </div>\n }\n private countryOption(option: Option) {\n return <div class=\"s-product-options-digital-card-wrapper\">\n {option.details.map((detail) => {\n\n return <label htmlFor={this.generateUniqueKey(detail.id.toString())} key={detail.id} class={{\"s-product-options-digital-card-option\":true,\"s-product-options-digital-card-option-stock-out\":detail.is_out}}>\n <input id={this.generateUniqueKey(detail.id.toString())} type=\"radio\" class=\"s-form-control s-product-options-digital-card-input\" value={detail.id}\n name={`options[${option.id}]`}\n disabled={detail.is_out}\n required={!option.visibility_condition && option.required}\n onInvalid={(e) => this.invalidHandler(e, option)}\n onChange={e => this.changedHandler(e, option)}\n onClick={()=>{ this.disableCardValue = false}}\n {...(salla.url.is_page(\"cart\") ? {defaultChecked:this.getSelectedDigitalCardOptions(option)?.id === detail.id}:{})}\n\n />\n <img loading='lazy' alt={detail.code} height={24} width={24} class=\"s-product-options-country-flag\" src={`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(detail.code).toLocaleLowerCase()}.svg`}/>\n <span >{detail.name}</span>\n </label>\n })\n }\n </div>\n\n }\n\n}\n"],"mappings":";;;iQAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,iBACAA,EAAA,eACAA,EAAA,uBACAA,EAAA,uBACAA,EAAA,iBACAA,EAAA,uCACAA,EAAA,mBACAA,EAAA,iCACAA,EAAA,2CACAA,EAAA,qBACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,uBACAA,EAAA,y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OAAOP,IAAKxS,EAAOgT,KAAMrE,OAAQ,GAAIsE,MAAO,GAAI1R,MAAM,iCAAiC+Q,IAAK,mEAAAzK,OAAmE6K,OAAO1S,EAAOgT,MAAME,oBAAmB,UACxN5R,EAAA,YAAQtB,EAAOqL,M,6HAloCO,I","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as a,H as t,g as l}from"./p-Fh3juwdj.js";const r=":host{display:block}";const i=class{constructor(a){s(this,a);var t;this.apps=salla.config.get("store.apps");this.appSlot=((t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.innerHTML)||`<img alt={name} src={icon} />`;salla.onReady((()=>{this.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){var s;(s=this.host.querySelector('[slot="app"]'))===null||s===void 0?void 0:s.remove()}get host(){return l(this)}};i.style=r;export{i as salla_apps_icons};
5
- //# sourceMappingURL=p-90b19a52.entry.js.map
4
+ import{r as s,h as a,H as t,g as l}from"./p-D4D34Ujk.js";const r=":host{display:block}";const i=class{constructor(a){s(this,a);var t;this.apps=salla.config.get("store.apps");this.appSlot=((t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.innerHTML)||`<img alt={name} src={icon} />`;salla.onReady((()=>{this.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){var s;(s=this.host.querySelector('[slot="app"]'))===null||s===void 0?void 0:s.remove()}get host(){return l(this)}};i.style=r;export{i as salla_apps_icons};
5
+ //# sourceMappingURL=p-396198a2.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as e,H as i,g as l}from"./p-Fh3juwdj.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";const n=class{constructor(e){t(this,e);this.changed=s(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(()=>this.host.style.display="none"));salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply");this.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=a.VALUES;let{max:s,min:e}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=e||t<=s))}if(this.filtersData.variants&&t.type==a.VARIANTS){s.variants=this.filtersData.variants}if(this.filtersData[t.key]&&t.type!==a.VARIANTS){s[t.key]=this.filtersData[t.key]}let e=new URLSearchParams(window.location.search);let i=false;for(let t of e.keys()){if(t.includes("filters")){i=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(s).length==0&&!i){let t=window.location.href;let e=salla.config.get("page.id");let i=t.indexOf("?")!==-1?"&":"?";let l=t+i+"filters[category_id]="+e;s.category_id=e;window.history.pushState({path:l},"",l)}return t}));this.filtersData=s;this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady){return}let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{var s;if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries()){if(s.startsWith("filters")){t.searchParams.delete(s)}}let s=this.encodeFilters(this.filtersData);let e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");if(e){t.search=t.search.split("&filters")[0]+"&"+s}else{t.search=`?${s}`}window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);(s=t.searchParams)===null||s===void 0?void 0:s.delete("filters");window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData);this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const e=[];for(const i in t){if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i];const a=s?`${s}[${i}]`:i;if(Array.isArray(l)){for(let t=0;t<l.length;t++){e.push(`${a}[${t}]=${l[t]}`)}}else if(typeof l==="object"&&l!==null){e.push(this.encodeFilters(l,a))}else{let t=`${a}=${l}`;e.push(t)}}}return e.join("&")}async resetFilters(){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((t=>t.reset&&t.reset()));salla.event.emit("salla-filters::reset");return this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search);const s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&");const e=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,s,e){if(s.type===a.RANGE){this.filtersData[s.key]=e}let i=t.target.checked;if(s.type===a.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[s.key]=e);i||delete this.filtersData.variants[s.key]}else if(t.target.type=="radio"){i&&(this.filtersData[s.key]=e);i||delete this.filtersData[s.key]}else if(t.target.type=="checkbox"){this.filtersData[s.key]=this.filtersData[s.key]||[];if(i){this.filtersData[s.key].push(e)}this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=e))}this.applyFilters()}render(){var t,s;return e(i,{key:"d62d9a867f140a911cb5da11a1034511fd230745"},(t=this.filters)===null||t===void 0?void 0:t.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:e}})=>{this.handleOptionChange(t,s,e)}}))),((s=this.filters)===null||s===void 0?void 0:s.length)?e("div",{class:"s-filters-footer"},e("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=true}get host(){return l(this)}};n.style=o;export{n as salla_filters};
5
- //# sourceMappingURL=p-f4dd7c30.entry.js.map
4
+ import{r as t,c as s,h as e,H as i,g as l}from"./p-D4D34Ujk.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";const n=class{constructor(e){t(this,e);this.changed=s(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(()=>this.host.style.display="none"));salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply");this.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=a.VALUES;let{max:s,min:e}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=e||t<=s))}if(this.filtersData.variants&&t.type==a.VARIANTS){s.variants=this.filtersData.variants}if(this.filtersData[t.key]&&t.type!==a.VARIANTS){s[t.key]=this.filtersData[t.key]}let e=new URLSearchParams(window.location.search);let i=false;for(let t of e.keys()){if(t.includes("filters")){i=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(s).length==0&&!i){let t=window.location.href;let e=salla.config.get("page.id");let i=t.indexOf("?")!==-1?"&":"?";let l=t+i+"filters[category_id]="+e;s.category_id=e;window.history.pushState({path:l},"",l)}return t}));this.filtersData=s;this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady){return}let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{var s;if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries()){if(s.startsWith("filters")){t.searchParams.delete(s)}}let s=this.encodeFilters(this.filtersData);let e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");if(e){t.search=t.search.split("&filters")[0]+"&"+s}else{t.search=`?${s}`}window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);(s=t.searchParams)===null||s===void 0?void 0:s.delete("filters");window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData);this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const e=[];for(const i in t){if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i];const a=s?`${s}[${i}]`:i;if(Array.isArray(l)){for(let t=0;t<l.length;t++){e.push(`${a}[${t}]=${l[t]}`)}}else if(typeof l==="object"&&l!==null){e.push(this.encodeFilters(l,a))}else{let t=`${a}=${l}`;e.push(t)}}}return e.join("&")}async resetFilters(){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((t=>t.reset&&t.reset()));salla.event.emit("salla-filters::reset");return this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search);const s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&");const e=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,s,e){if(s.type===a.RANGE){this.filtersData[s.key]=e}let i=t.target.checked;if(s.type===a.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[s.key]=e);i||delete this.filtersData.variants[s.key]}else if(t.target.type=="radio"){i&&(this.filtersData[s.key]=e);i||delete this.filtersData[s.key]}else if(t.target.type=="checkbox"){this.filtersData[s.key]=this.filtersData[s.key]||[];if(i){this.filtersData[s.key].push(e)}this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=e))}this.applyFilters()}render(){var t,s;return e(i,{key:"d62d9a867f140a911cb5da11a1034511fd230745"},(t=this.filters)===null||t===void 0?void 0:t.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:e}})=>{this.handleOptionChange(t,s,e)}}))),((s=this.filters)===null||s===void 0?void 0:s.length)?e("div",{class:"s-filters-footer"},e("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=true}get host(){return l(this)}};n.style=o;export{n as salla_filters};
5
+ //# sourceMappingURL=p-3eaddcf1.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js"],(function(i){"use strict";var n,t,e;return{setters:[function(i){n=i.r;t=i.h;e=i.H}],execute:function(){var o;(function(i){i["PERCENTAGE"]="percentage";i["FIXED"]="fixed";i["FREE_PRODUCT"]="free_product"})(o||(o={}));var r;(function(i){i["PRODUCT_COUNT"]="products_count";i["PRODUCT_PURCHASE"]="order_amount"})(r||(r={}));var a=":host{display:block}";var l=i("salla_conditional_offer",function(){function i(i){n(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}i.prototype.componentWillLoad=function(){var i=this;salla.onReady().then((function(){var i,n,t;if(!((i=salla.config.get("store.features"))===null||i===void 0?void 0:i.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(n=salla.storage.get("cart"))===null||n===void 0?void 0:n.summary)===null||t===void 0?void 0:t.count)){throw new Error("feature or cart object does not existed")}})).then((function(){return salla.api.cart.offers()})).then((function(n){var t=n.data;i.offer=t.find((function(i){return i.type==="conditional"}));if(!i.offer){i.canRender=false;return}i.isLoading=true;i.offer.details.discounts.unshift({value:0,min_spend:0});return i.updateInitialOfferValue()})).then((function(){if(!i.offer)return;return i.getProducts()})).then((function(){if(!i.offer)return;salla.event.on("cart::updated",(function(n){return i.updateOfferValues(n)}))})).catch((function(n){i.canRender=false;salla.logger.warn("salla-conditional-offer:: ",n)})).finally((function(){i.isLoading=false}))};i.prototype.getProducts=function(){var i=this;var n=this.offer.details.discounts.filter((function(i){var n=i.type;return n===o.FREE_PRODUCT})).map((function(i){var n=i.value;return n}));if(n.length>0){return salla.product.fetch({source:"selected",source_value:n}).then((function(n){var t=n.data;t.forEach((function(n){var t=n.id,e=n.url,o=n.image;i.products[t]={url:e,image:o}}))}))}};i.prototype.updateInitialOfferValue=function(){var i=this;return salla.api.cart.details().then((function(n){var t=n.data.cart;return i.updateOfferValues(t)}))};i.prototype.updateOfferValues=function(i){var n=i.items,t=i.sub_total;var e,o;var a=this.offer.details.based_on===r.PRODUCT_COUNT?(e=n===null||n===void 0?void 0:n.reduce((function(i,n){var t=n.quantity;return i+t}),0))!==null&&e!==void 0?e:0:t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(o=this.offer)===null||o===void 0?void 0:o.details),{current_value:a})});return this.offer};i.prototype.getCheckpointContent=function(i){var n,e;if(i.type===o.PERCENTAGE)return"".concat(i.value,"%");if(i.type===o.FIXED)return salla.money(i.value);if(i.type!==o.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(i.type,")!"));return""}var r=this.products[i.value];if(!r){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(i.value,")!"));return""}return t("a",{class:"s-conditional-offer-product-link",href:r.url},t("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((n=r===null||r===void 0?void 0:r.image)===null||n===void 0?void 0:n.alt)||"",src:(e=r===null||r===void 0?void 0:r.image)===null||e===void 0?void 0:e.url}))};i.prototype.getOfferType=function(i){var n;var t=(n=this.offer.details)===null||n===void 0?void 0:n.based_on;if(t===r.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",i.min_spend);if(t===r.PRODUCT_PURCHASE)return salla.money(i.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(i.min_spend)};i.prototype.clamp=function(i,n,t){return Math.max(n,Math.min(i,t))};i.prototype.mapValueRanges=function(i,n,t,e,o){var r=(i-n)*(o-e)/(t-n)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};i.prototype.getCheckPointView=function(i,n){var e,o;var r=this.offer.details.discounts.findIndex((function(n){var t=n.min_spend;return t===i.min_spend}));var a=(o=(e=this.offer.details.discounts[r-1])===null||e===void 0?void 0:e.min_spend)!==null&&o!==void 0?o:0;var l=this.mapValueRanges(this.offer.details.current_value,a,i.min_spend,0,100);var s=i.min_spend<=this.offer.details.current_value;return t("div",{class:"s-conditional-offer-checkpoint-container"},n>0?[t("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},t("div",{class:"s-conditional-offer-progress-line-inactive"}),t("div",{class:"s-conditional-offer-progress-line-active",style:{width:"".concat(l,"%")}})),t("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(s?"s-conditional-offer-active-checkpoint":"")},t("div",{class:"s-conditional-offer-item-avatar-content ".concat(s?"active":""),innerHTML:this.products&&this.getCheckpointContent(i)}),t("div",{class:"s-conditional-offer-checkpoint-label ".concat(s?"active":""),innerHTML:this.getOfferType(i)}))]:t("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":n===0,active:s},innerHTML:this.getOfferType(i)}))};i.prototype.getLoadingSkeletonView=function(){return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-skeleton-inner-container"},t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"30%"})),t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"35%"})),t("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((function(){return[t("salla-skeleton",{key:"checkpoint-line",height:"8px"}),t("div",{key:"checkpoint"},t("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))]})))))};i.prototype.render=function(){var i=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-title-wrapper"},t("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?t("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",t("i",{class:"sicon-information"})):null),t("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map((function(n,e){return t("div",{class:{"flex-1":e>0},key:n.min_spend},i.getCheckPointView(n,e))}))))};return i}());l.style=a}}}));
5
- //# sourceMappingURL=p-6e2c5013.system.entry.js.map
4
+ System.register(["./p-B0xoNOFR.system.js"],(function(i){"use strict";var n,t,e;return{setters:[function(i){n=i.r;t=i.h;e=i.H}],execute:function(){var o;(function(i){i["PERCENTAGE"]="percentage";i["FIXED"]="fixed";i["FREE_PRODUCT"]="free_product"})(o||(o={}));var r;(function(i){i["PRODUCT_COUNT"]="products_count";i["PRODUCT_PURCHASE"]="order_amount"})(r||(r={}));var a=":host{display:block}";var l=i("salla_conditional_offer",function(){function i(i){n(this,i);this.offer=null;this.products={};this.isLoading=false;this.canRender=true}i.prototype.componentWillLoad=function(){var i=this;salla.onReady().then((function(){var i,n,t;if(!((i=salla.config.get("store.features"))===null||i===void 0?void 0:i.includes("conditional-offer"))||salla.storage.get("cart")!==""&&!((t=(n=salla.storage.get("cart"))===null||n===void 0?void 0:n.summary)===null||t===void 0?void 0:t.count)){throw new Error("feature or cart object does not existed")}})).then((function(){return salla.api.cart.offers()})).then((function(n){var t=n.data;i.offer=t.find((function(i){return i.type==="conditional"}));if(!i.offer){i.canRender=false;return}i.isLoading=true;i.offer.details.discounts.unshift({value:0,min_spend:0});return i.updateInitialOfferValue()})).then((function(){if(!i.offer)return;return i.getProducts()})).then((function(){if(!i.offer)return;salla.event.on("cart::updated",(function(n){return i.updateOfferValues(n)}))})).catch((function(n){i.canRender=false;salla.logger.warn("salla-conditional-offer:: ",n)})).finally((function(){i.isLoading=false}))};i.prototype.getProducts=function(){var i=this;var n=this.offer.details.discounts.filter((function(i){var n=i.type;return n===o.FREE_PRODUCT})).map((function(i){var n=i.value;return n}));if(n.length>0){return salla.product.fetch({source:"selected",source_value:n}).then((function(n){var t=n.data;t.forEach((function(n){var t=n.id,e=n.url,o=n.image;i.products[t]={url:e,image:o}}))}))}};i.prototype.updateInitialOfferValue=function(){var i=this;return salla.api.cart.details().then((function(n){var t=n.data.cart;return i.updateOfferValues(t)}))};i.prototype.updateOfferValues=function(i){var n=i.items,t=i.sub_total;var e,o;var a=this.offer.details.based_on===r.PRODUCT_COUNT?(e=n===null||n===void 0?void 0:n.reduce((function(i,n){var t=n.quantity;return i+t}),0))!==null&&e!==void 0?e:0:t;this.offer=Object.assign(Object.assign({},this.offer),{details:Object.assign(Object.assign({},(o=this.offer)===null||o===void 0?void 0:o.details),{current_value:a})});return this.offer};i.prototype.getCheckpointContent=function(i){var n,e;if(i.type===o.PERCENTAGE)return"".concat(i.value,"%");if(i.type===o.FIXED)return salla.money(i.value);if(i.type!==o.FREE_PRODUCT){salla.logger.error("salla-conditional-offer:: unexpected type (".concat(i.type,")!"));return""}var r=this.products[i.value];if(!r){salla.logger.error("salla-conditional-offer:: there is no product with id (".concat(i.value,")!"));return""}return t("a",{class:"s-conditional-offer-product-link",href:r.url},t("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:((n=r===null||r===void 0?void 0:r.image)===null||n===void 0?void 0:n.alt)||"",src:(e=r===null||r===void 0?void 0:r.image)===null||e===void 0?void 0:e.url}))};i.prototype.getOfferType=function(i){var n;var t=(n=this.offer.details)===null||n===void 0?void 0:n.based_on;if(t===r.PRODUCT_COUNT)return salla.lang.choice("blocks.header.products_count",i.min_spend);if(t===r.PRODUCT_PURCHASE)return salla.money(i.min_spend);salla.logger.warn("salla-conditional-offer:: Unexpected offer detail's based_on value: ".concat(t));return"".concat(i.min_spend)};i.prototype.clamp=function(i,n,t){return Math.max(n,Math.min(i,t))};i.prototype.mapValueRanges=function(i,n,t,e,o){var r=(i-n)*(o-e)/(t-n)+e;if(r===Number.POSITIVE_INFINITY)return 100;if(r===Number.NEGATIVE_INFINITY)return 0;return this.clamp(r,0,100)};i.prototype.getCheckPointView=function(i,n){var e,o;var r=this.offer.details.discounts.findIndex((function(n){var t=n.min_spend;return t===i.min_spend}));var a=(o=(e=this.offer.details.discounts[r-1])===null||e===void 0?void 0:e.min_spend)!==null&&o!==void 0?o:0;var l=this.mapValueRanges(this.offer.details.current_value,a,i.min_spend,0,100);var s=i.min_spend<=this.offer.details.current_value;return t("div",{class:"s-conditional-offer-checkpoint-container"},n>0?[t("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},t("div",{class:"s-conditional-offer-progress-line-inactive"}),t("div",{class:"s-conditional-offer-progress-line-active",style:{width:"".concat(l,"%")}})),t("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint ".concat(s?"s-conditional-offer-active-checkpoint":"")},t("div",{class:"s-conditional-offer-item-avatar-content ".concat(s?"active":""),innerHTML:this.products&&this.getCheckpointContent(i)}),t("div",{class:"s-conditional-offer-checkpoint-label ".concat(s?"active":""),innerHTML:this.getOfferType(i)}))]:t("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":true,"first-checkpoint":n===0,active:s},innerHTML:this.getOfferType(i)}))};i.prototype.getLoadingSkeletonView=function(){return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-skeleton-inner-container"},t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"30%"})),t("div",{class:"s-conditional-offer-skeleton-subtitle"},t("salla-skeleton",{height:"16px",width:"35%"})),t("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((function(){return[t("salla-skeleton",{key:"checkpoint-line",height:"8px"}),t("div",{key:"checkpoint"},t("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))]})))))};i.prototype.render=function(){var i=this;if(!this.canRender)return null;if(this.isLoading)return this.getLoadingSkeletonView();if(!this.offer)return null;return t(e,{class:"s-conditional-offer-container"},t("div",{class:"s-conditional-offer-title-wrapper"},t("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?t("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",t("i",{class:"sicon-information"})):null),t("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map((function(n,e){return t("div",{class:{"flex-1":e>0},key:n.min_spend},i.getCheckPointView(n,e))}))))};return i}());l.style=a}}}));
5
+ //# sourceMappingURL=p-407d19d8.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js"],(function(e){"use strict";var c,t,n;return{setters:[function(e){c=e.r;t=e.h;n=e.H}],execute:function(){var r="";var b=e("salla_accordion_body",function(){function e(e){c(this,e)}e.prototype.render=function(){return t(n,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},t("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return e}());b.style=r}}}));
5
- //# sourceMappingURL=p-ce2994fb.system.entry.js.map
4
+ System.register(["./p-B0xoNOFR.system.js"],(function(e){"use strict";var c,t,n;return{setters:[function(e){c=e.r;t=e.h;n=e.H}],execute:function(){var r="";var b=e("salla_accordion_body",function(){function e(e){c(this,e)}e.prototype.render=function(){return t(n,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},t("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return e}());b.style=r}}}));
5
+ //# sourceMappingURL=p-40e20722.system.entry.js.map
@@ -1,5 +1,5 @@
1
- var __awaiter=this&&this.__awaiter||function(t,a,e,r){function n(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(r.next(t))}catch(t){i(t)}}function u(t){try{o(r["throw"](t))}catch(t){i(t)}}function o(t){t.done?e(t.value):n(t.value).then(s,u)}o((r=r.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:[]},r,n,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(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(r=1,n&&(i=u[0]&2?n["return"]:u[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;if(n=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++;n=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];n=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
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-CXK1rNlC.system.js"],(function(t){"use strict";var a,e,r,n;return{setters:[function(t){a=t.r;e=t.h;r=t.H;n=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 r=String(a.getMonth()+1).padStart(2,"0");var n=a.getFullYear();var i="".concat(e,"/").concat(r,"/").concat(n);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(r){switch(r.label){case 0:return[4,salla.onReady()];case 1:r.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:r.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=r.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(r,{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 n(this)},enumerable:false,configurable:true});return t}());s.style=i}}}));
5
- //# sourceMappingURL=p-c5bdc891.system.entry.js.map
4
+ */System.register(["./p-B0xoNOFR.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-423d91f5.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(i,t,e,n){function r(i){return i instanceof e?i:new e((function(t){t(i)}))}return new(e||(e=Promise))((function(e,s){function a(i){try{u(n.next(i))}catch(i){s(i)}}function o(i){try{u(n["throw"](i))}catch(i){s(i)}}function u(i){i.done?e(i.value):r(i.value).then(a,o)}u((n=n.apply(i,t||[])).next())}))};var __generator=this&&this.__generator||function(i,t){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(i){return function(t){return u([i,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(e=0)),e)try{if(n=1,r&&(s=o[0]&2?r["return"]:o[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,o[1])).done)return s;if(r=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;r=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){e.label=o[1];break}if(o[0]===6&&e.label<s[1]){e.label=s[1];s=o;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(o);break}if(s[2])e.ops.pop();e.trys.pop();continue}o=t.call(i,e)}catch(i){o=[6,i];r=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-CXK1rNlC.system.js","./p-Dxc5oJG6.system.js"],(function(i){"use strict";var t,e,n,r;return{setters:[function(i){t=i.r;e=i.h;n=i.g},function(i){r=i.I}],execute:function(){var s=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>';var a=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>';var o=' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>';var u=":host{display:block}";var l=i("salla_review_card",function(){function i(i){var e=this;t(this,i);this.currentSlide=0;this.showPurchaseCount=false;this.startPoint={x:0,y:0};this.isSwiping=false;this.isRTL="rtl";this.handlePointerDown=function(i){var t;if(!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.setPointerCapture(i.pointerId);e.startSwipe(i.clientX,i.clientY);i.preventDefault()};this.handlePointerMove=function(i){if(!e.isSwiping||!i.isPrimary)return;i.preventDefault()};this.handlePointerUp=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.endSwipe(i.clientX,i.clientY)};this.handlePointerCancel=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.isSwiping=false};this.goToSlide=function(i){e.currentSlide=Math.max(0,Math.min(i,e.images.length-1))}}i.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var i,t;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",false);this.isRTL=salla.config.get("theme.is_rtl",true);this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?" تم شراءه ".concat((i=this.review.product)===null||i===void 0?void 0:i.sold_quantity," مرة"):"Purchased ".concat(this.review.product.sold_quantity," times"),{count:(t=this.review.product)===null||t===void 0?void 0:t.sold_quantity});this.initializeSlider();return[2]}}))}))};i.prototype.disconnectedCallback=function(){this.removeEventListeners()};Object.defineProperty(i.prototype,"images",{get:function(){var i,t;var e=this.review;return((i=e===null||e===void 0?void 0:e.images)===null||i===void 0?void 0:i.length)>1?e.images.map((function(i,t){return{url:i,alt:"",id:t}})):((t=e===null||e===void 0?void 0:e.product)===null||t===void 0?void 0:t.images)||[]},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"hasMultipleImages",{get:function(){return this.images.length>1},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"slideTransform",{get:function(){var i=this.isRTL?1:-1;return"translateX(".concat(this.currentSlide*100*i,"%)")},enumerable:false,configurable:true});i.prototype.initializeSlider=function(){if(!this.hasMultipleImages)return;this.sliderElement=this.el.querySelector(".s-review-card-slider-container");if(!this.sliderElement)return;this.sliderElement.style.touchAction="pan-y pinch-zoom";this.addEventListeners()};i.prototype.addEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:false});this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:false});this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:true});this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:true})};i.prototype.removeEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown);this.sliderElement.removeEventListener("pointermove",this.handlePointerMove);this.sliderElement.removeEventListener("pointerup",this.handlePointerUp);this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel)};i.prototype.startSwipe=function(i,t){this.startPoint={x:i,y:t};this.isSwiping=true};i.prototype.componentDidRender=function(){this.removeEventListeners();this.addEventListeners()};i.prototype.endSwipe=function(i,t){this.isSwiping=false;var e=i-this.startPoint.x;var n=t-this.startPoint.y;this.processSwipe(e,n)};i.prototype.processSwipe=function(i,t){var e=10;if(Math.abs(i)<e||Math.abs(t)>Math.abs(i))return;var n=i<0;var r=this.isRTL?!n:n;if(r){this.goToNextSlide()}else{this.goToPrevSlide()}};i.prototype.goToNextSlide=function(){if(this.currentSlide<this.images.length-1){this.currentSlide++}};i.prototype.goToPrevSlide=function(){if(this.currentSlide>0){this.currentSlide--}};i.prototype.renderStars=function(){var i=this;return Array(5).fill(null).map((function(t,n){return e("span",{key:n,innerHTML:i.review.stars>=n+1?s:a})}))};i.prototype.renderDots=function(){var i=this;return this.images.map((function(t,n){var r=t.url;return e("button",{key:r||n,type:"button",class:"s-review-card-slider-dot ".concat(i.currentSlide===n?"active":""),onClick:function(){return i.goToSlide(n)},"aria-label":"Go to slide ".concat(n+1),onPointerDown:function(){return i.goToSlide(n)}})}))};i.prototype.renderSlider=function(){if(!this.hasMultipleImages)return null;return e("div",{class:"s-review-card-slider-container"},e("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((function(i){return e("div",{key:i===null||i===void 0?void 0:i.id,class:"s-review-card-slider-slide"},e("img",{src:i.url,alt:i.alt||"Product image",width:275,height:275,loading:"lazy",draggable:false}))}))),e("div",{class:"s-review-card-slider-dots"},this.renderDots()))};i.prototype.renderSingleImage=function(){var i,t;var n=(t=(i=this.review)===null||i===void 0?void 0:i.product)===null||t===void 0?void 0:t.image;if(!n||this.hasMultipleImages)return null;return e("img",{src:n.url,alt:n.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:false})};i.prototype.renderHeader=function(){var i,t;return e("div",{class:"s-review-card-header"},e("div",{class:"s-review-card-reviewer-name"},e("p",null,(i=this.review)===null||i===void 0?void 0:i.name),((t=this.review)===null||t===void 0?void 0:t.has_order)&&e("span",{class:"s-review-card-verified-icon",innerHTML:r})),e("div",{class:"s-review-card-stars"},this.renderStars()))};i.prototype.renderProductInfo=function(){var i,t,n,r,s;var a=(i=this.review)===null||i===void 0?void 0:i.product;if(!a)return null;return e("a",{href:(n=(t=this.review)===null||t===void 0?void 0:t.product)===null||n===void 0?void 0:n.url,class:"s-review-card-product-container"},e("img",{alt:((r=a.image)===null||r===void 0?void 0:r.alt)||"Product",src:(s=a.image)===null||s===void 0?void 0:s.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:false}),e("div",{class:"s-review-card-product-details"},e("p",{class:"s-review-card-product-details-name"},a.name),this.showPurchaseCount?e("p",{class:"s-review-card-product-details-purchase-count"},e("span",{innerHTML:o}),this.purchasedCount):null))};i.prototype.render=function(){var i;return e("div",{key:"8797bb6b8123ab8a8d4536eb990dcde15e1ddd06",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),c(),e("div",{key:"b2b3bdc4e8a63aae9103eca5274003b49d4bf19e",class:"s-review-card-content"},this.renderHeader(),e("p",{key:"0e64b3fe2ae5e59a1899515c04063f74b9828001",class:"s-review-card-review-content",innerHTML:(i=this.review)===null||i===void 0?void 0:i.content}),c(),this.renderProductInfo()))};Object.defineProperty(i.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return i}());var c=function(i){return e("div",{class:"s-review-card-divider ".concat("")})};l.style=u}}}));
5
- //# sourceMappingURL=p-5aa8dd63.system.entry.js.map
4
+ */System.register(["./p-B0xoNOFR.system.js","./p-Dxc5oJG6.system.js"],(function(i){"use strict";var t,e,n,r;return{setters:[function(i){t=i.r;e=i.h;n=i.g},function(i){r=i.I}],execute:function(){var s=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>';var a=' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>';var o=' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>';var u=":host{display:block}";var l=i("salla_review_card",function(){function i(i){var e=this;t(this,i);this.currentSlide=0;this.showPurchaseCount=false;this.startPoint={x:0,y:0};this.isSwiping=false;this.isRTL="rtl";this.handlePointerDown=function(i){var t;if(!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.setPointerCapture(i.pointerId);e.startSwipe(i.clientX,i.clientY);i.preventDefault()};this.handlePointerMove=function(i){if(!e.isSwiping||!i.isPrimary)return;i.preventDefault()};this.handlePointerUp=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.endSwipe(i.clientX,i.clientY)};this.handlePointerCancel=function(i){var t;if(!e.isSwiping||!i.isPrimary)return;(t=e.sliderElement)===null||t===void 0?void 0:t.releasePointerCapture(i.pointerId);e.isSwiping=false};this.goToSlide=function(i){e.currentSlide=Math.max(0,Math.min(i,e.images.length-1))}}i.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var i,t;return __generator(this,(function(e){switch(e.label){case 0:return[4,salla.onReady()];case 1:e.sent();this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",false);this.isRTL=salla.config.get("theme.is_rtl",true);this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?" تم شراءه ".concat((i=this.review.product)===null||i===void 0?void 0:i.sold_quantity," مرة"):"Purchased ".concat(this.review.product.sold_quantity," times"),{count:(t=this.review.product)===null||t===void 0?void 0:t.sold_quantity});this.initializeSlider();return[2]}}))}))};i.prototype.disconnectedCallback=function(){this.removeEventListeners()};Object.defineProperty(i.prototype,"images",{get:function(){var i,t;var e=this.review;return((i=e===null||e===void 0?void 0:e.images)===null||i===void 0?void 0:i.length)>1?e.images.map((function(i,t){return{url:i,alt:"",id:t}})):((t=e===null||e===void 0?void 0:e.product)===null||t===void 0?void 0:t.images)||[]},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"hasMultipleImages",{get:function(){return this.images.length>1},enumerable:false,configurable:true});Object.defineProperty(i.prototype,"slideTransform",{get:function(){var i=this.isRTL?1:-1;return"translateX(".concat(this.currentSlide*100*i,"%)")},enumerable:false,configurable:true});i.prototype.initializeSlider=function(){if(!this.hasMultipleImages)return;this.sliderElement=this.el.querySelector(".s-review-card-slider-container");if(!this.sliderElement)return;this.sliderElement.style.touchAction="pan-y pinch-zoom";this.addEventListeners()};i.prototype.addEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:false});this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:false});this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:true});this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:true})};i.prototype.removeEventListeners=function(){if(!this.sliderElement)return;this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown);this.sliderElement.removeEventListener("pointermove",this.handlePointerMove);this.sliderElement.removeEventListener("pointerup",this.handlePointerUp);this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel)};i.prototype.startSwipe=function(i,t){this.startPoint={x:i,y:t};this.isSwiping=true};i.prototype.componentDidRender=function(){this.removeEventListeners();this.addEventListeners()};i.prototype.endSwipe=function(i,t){this.isSwiping=false;var e=i-this.startPoint.x;var n=t-this.startPoint.y;this.processSwipe(e,n)};i.prototype.processSwipe=function(i,t){var e=10;if(Math.abs(i)<e||Math.abs(t)>Math.abs(i))return;var n=i<0;var r=this.isRTL?!n:n;if(r){this.goToNextSlide()}else{this.goToPrevSlide()}};i.prototype.goToNextSlide=function(){if(this.currentSlide<this.images.length-1){this.currentSlide++}};i.prototype.goToPrevSlide=function(){if(this.currentSlide>0){this.currentSlide--}};i.prototype.renderStars=function(){var i=this;return Array(5).fill(null).map((function(t,n){return e("span",{key:n,innerHTML:i.review.stars>=n+1?s:a})}))};i.prototype.renderDots=function(){var i=this;return this.images.map((function(t,n){var r=t.url;return e("button",{key:r||n,type:"button",class:"s-review-card-slider-dot ".concat(i.currentSlide===n?"active":""),onClick:function(){return i.goToSlide(n)},"aria-label":"Go to slide ".concat(n+1),onPointerDown:function(){return i.goToSlide(n)}})}))};i.prototype.renderSlider=function(){if(!this.hasMultipleImages)return null;return e("div",{class:"s-review-card-slider-container"},e("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((function(i){return e("div",{key:i===null||i===void 0?void 0:i.id,class:"s-review-card-slider-slide"},e("img",{src:i.url,alt:i.alt||"Product image",width:275,height:275,loading:"lazy",draggable:false}))}))),e("div",{class:"s-review-card-slider-dots"},this.renderDots()))};i.prototype.renderSingleImage=function(){var i,t;var n=(t=(i=this.review)===null||i===void 0?void 0:i.product)===null||t===void 0?void 0:t.image;if(!n||this.hasMultipleImages)return null;return e("img",{src:n.url,alt:n.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:false})};i.prototype.renderHeader=function(){var i,t;return e("div",{class:"s-review-card-header"},e("div",{class:"s-review-card-reviewer-name"},e("p",null,(i=this.review)===null||i===void 0?void 0:i.name),((t=this.review)===null||t===void 0?void 0:t.has_order)&&e("span",{class:"s-review-card-verified-icon",innerHTML:r})),e("div",{class:"s-review-card-stars"},this.renderStars()))};i.prototype.renderProductInfo=function(){var i,t,n,r,s;var a=(i=this.review)===null||i===void 0?void 0:i.product;if(!a)return null;return e("a",{href:(n=(t=this.review)===null||t===void 0?void 0:t.product)===null||n===void 0?void 0:n.url,class:"s-review-card-product-container"},e("img",{alt:((r=a.image)===null||r===void 0?void 0:r.alt)||"Product",src:(s=a.image)===null||s===void 0?void 0:s.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:false}),e("div",{class:"s-review-card-product-details"},e("p",{class:"s-review-card-product-details-name"},a.name),this.showPurchaseCount?e("p",{class:"s-review-card-product-details-purchase-count"},e("span",{innerHTML:o}),this.purchasedCount):null))};i.prototype.render=function(){var i;return e("div",{key:"8797bb6b8123ab8a8d4536eb990dcde15e1ddd06",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),c(),e("div",{key:"b2b3bdc4e8a63aae9103eca5274003b49d4bf19e",class:"s-review-card-content"},this.renderHeader(),e("p",{key:"0e64b3fe2ae5e59a1899515c04063f74b9828001",class:"s-review-card-review-content",innerHTML:(i=this.review)===null||i===void 0?void 0:i.content}),c(),this.renderProductInfo()))};Object.defineProperty(i.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return i}());var c=function(i){return e("div",{class:"s-review-card-divider ".concat("")})};l.style=u}}}));
5
+ //# sourceMappingURL=p-442340d3.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-Fh3juwdj.js";import{G as s}from"./p-C0JNGIpa.js";const o="";const e=l=>{if(!l)return"";return new Date(Number(l)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};const r=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:"985386d18096b99ef6114a6e21363900c5dab374"},a("div",{key:"67bb4fceebc5ef047cd3b0ee5b94297e4c9d9d17"},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"},e((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"},e(l===null||l===void 0?void 0:l.points_expire_date)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.key)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(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-67a30d9c.entry.js.map
4
+ import{r as l,h as a,H as t}from"./p-D4D34Ujk.js";import{G as s}from"./p-C0JNGIpa.js";const o="";const e=l=>{if(!l)return"";return new Date(Number(l)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"})};const r=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:"985386d18096b99ef6114a6e21363900c5dab374"},a("div",{key:"67bb4fceebc5ef047cd3b0ee5b94297e4c9d9d17"},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"},e((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"},e(l===null||l===void 0?void 0:l.points_expire_date)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(l===null||l===void 0?void 0:l.key)),a("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(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-45b61475.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as s,H as i}from"./p-Fh3juwdj.js";import{a}from"./p-BedNk7k1.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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n`;const l=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";const h=class{constructor(s){e(this,s);this.changed=t(this,"changed");this.min=0;this.max=1e4;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.isMin=false;this.isRTL=salla.config.get("theme.is_rtl",true);this.filterValues=[]}connectedCallback(){var e;if(this.filtersData&&((e=this.filtersData)===null||e===void 0?void 0:e.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel);this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel);this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel);this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}const t=Math.ceil(this.option.values.length/5);for(let e=0;e<this.option.values.length;e+=t){this.filterValues.push(this.option.values.slice(e,e+t).reduce(((e,t)=>{e.to=t.to;e.count+=t.count;return e})))}}async reset(){this.minInput.value=null;this.maxInput.value=null;this.minPrice=null;this.maxPrice=null}getPriceLabel(e){if(isNaN(e.from)||e.from<1){return`${this.lessThanLabel} ${salla.money(e.to)}`}if(isNaN(e.to)||e.to<1){return`${this.moreThanLabel} ${salla.money(e.from)}`}return`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){if(e&&(e>this.max||this.maxPrice&&e>this.maxPrice)){return}if(e<this.min){this.minPrice=this.min;return}if(e){this.minPrice=e}}maxInputValidation(e){if(e&&(e<this.min||this.minPrice&&e<this.minPrice)){return}if(e>this.max){this.maxPrice=this.max;return}}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput);salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?+this.minPrice*1:null;const s=this.maxPrice?+this.maxPrice*1:null;if(!this.maxPrice){this.maxPrice=""}if(this.isMin){this.minInputValidation(t)}else{if(!this.minPrice){this.minPrice=0}this.maxInputValidation(s)}this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from;this.maxPrice=t.to!=="*"?t.to:"";this.changedEventHandler(e)}isChecked(e){if(!this.minPrice&&!this.maxPrice){return false}let t=(e.from<1||e.from=="*")&&this.minPrice==0||e.from==this.minPrice;let s=e.to=="*"||!e.to||e.to==this.maxPrice;return t&&s}handleMinPrice(e){this.isMin=true;const t=e.target.value;this.minPrice=t===""?0:t}handleMaxPrice(e){this.isMin=false;const t=e.target.value;this.maxPrice=t===undefined?"":t}render(){return s(i,{key:"e257e65621d724438fd4fdd74cdec45596a81cd0"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"097faf8d72b3c441bc22041a5643f91f61bbdd40",class:"flex justify-center items-center"},s("div",{key:"6adaa2b16c015de4ab5e254d4a9be05bb65b7848",class:"relative max-w-xl w-full"},s("div",{key:"3667d98c1e0886fc31600d23dd5a41a18d5ff8d0",class:"s-price-range-inputs"},s("div",{key:"98fdc0fdc9632318daa4664d4798154a17fe700a",class:"s-price-range-relative"},s("div",{key:"addd7b56c1e2496dba50db7ec320f8f5ea129d42",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"d36e129fd777ccfe30cf8d974dd96cf82e64c805",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"b1fcc176d31d724c646291262e42c6a74e75f299",class:"s-price-range-gray-text"}," -"),s("div",{key:"93db8728b9f118be78549c6839a4d85d4664a3dc",class:"s-price-range-relative"},s("div",{key:"7b63ca0ffd946d34549768bf87876868842478a4",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"ba005f3834bc2179e1346cae746b7c734abaf0dd",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"74283ca210bf2f85a4e5d7dde69372e55453a5a5",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"04600f026e465f96f98d54841e8c7bd7d1c849bd",innerHTML:this.isRTL?a:r}))))))}componentDidLoad(){this.isReady=true}};h.style=l;export{h as salla_price_range};
5
- //# sourceMappingURL=p-b0342394.entry.js.map
4
+ import{r as e,c as t,h as s,H as i}from"./p-D4D34Ujk.js";import{a}from"./p-BedNk7k1.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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n`;const l=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{-ms-flex-direction:row-reverse;flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";const h=class{constructor(s){e(this,s);this.changed=t(this,"changed");this.min=0;this.max=1e4;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.isMin=false;this.isRTL=salla.config.get("theme.is_rtl",true);this.filterValues=[]}connectedCallback(){var e;if(this.filtersData&&((e=this.filtersData)===null||e===void 0?void 0:e.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel);this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel);this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel);this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}const t=Math.ceil(this.option.values.length/5);for(let e=0;e<this.option.values.length;e+=t){this.filterValues.push(this.option.values.slice(e,e+t).reduce(((e,t)=>{e.to=t.to;e.count+=t.count;return e})))}}async reset(){this.minInput.value=null;this.maxInput.value=null;this.minPrice=null;this.maxPrice=null}getPriceLabel(e){if(isNaN(e.from)||e.from<1){return`${this.lessThanLabel} ${salla.money(e.to)}`}if(isNaN(e.to)||e.to<1){return`${this.moreThanLabel} ${salla.money(e.from)}`}return`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){if(e&&(e>this.max||this.maxPrice&&e>this.maxPrice)){return}if(e<this.min){this.minPrice=this.min;return}if(e){this.minPrice=e}}maxInputValidation(e){if(e&&(e<this.min||this.minPrice&&e<this.minPrice)){return}if(e>this.max){this.maxPrice=this.max;return}}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput);salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?+this.minPrice*1:null;const s=this.maxPrice?+this.maxPrice*1:null;if(!this.maxPrice){this.maxPrice=""}if(this.isMin){this.minInputValidation(t)}else{if(!this.minPrice){this.minPrice=0}this.maxInputValidation(s)}this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from;this.maxPrice=t.to!=="*"?t.to:"";this.changedEventHandler(e)}isChecked(e){if(!this.minPrice&&!this.maxPrice){return false}let t=(e.from<1||e.from=="*")&&this.minPrice==0||e.from==this.minPrice;let s=e.to=="*"||!e.to||e.to==this.maxPrice;return t&&s}handleMinPrice(e){this.isMin=true;const t=e.target.value;this.minPrice=t===""?0:t}handleMaxPrice(e){this.isMin=false;const t=e.target.value;this.maxPrice=t===undefined?"":t}render(){return s(i,{key:"e257e65621d724438fd4fdd74cdec45596a81cd0"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"097faf8d72b3c441bc22041a5643f91f61bbdd40",class:"flex justify-center items-center"},s("div",{key:"6adaa2b16c015de4ab5e254d4a9be05bb65b7848",class:"relative max-w-xl w-full"},s("div",{key:"3667d98c1e0886fc31600d23dd5a41a18d5ff8d0",class:"s-price-range-inputs"},s("div",{key:"98fdc0fdc9632318daa4664d4798154a17fe700a",class:"s-price-range-relative"},s("div",{key:"addd7b56c1e2496dba50db7ec320f8f5ea129d42",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"d36e129fd777ccfe30cf8d974dd96cf82e64c805",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"b1fcc176d31d724c646291262e42c6a74e75f299",class:"s-price-range-gray-text"}," -"),s("div",{key:"93db8728b9f118be78549c6839a4d85d4664a3dc",class:"s-price-range-relative"},s("div",{key:"7b63ca0ffd946d34549768bf87876868842478a4",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"ba005f3834bc2179e1346cae746b7c734abaf0dd",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"74283ca210bf2f85a4e5d7dde69372e55453a5a5",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"04600f026e465f96f98d54841e8c7bd7d1c849bd",innerHTML:this.isRTL?a:r}))))))}componentDidLoad(){this.isReady=true}};h.style=l;export{h as salla_price_range};
5
+ //# sourceMappingURL=p-4af5ffea.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js","./p-C2rVu_Jb.system.js"],(function(c){"use strict";var a,e,t,i,s,n,d;return{setters:[function(c){a=c.r;e=c.c;t=c.h;i=c.H;s=c.g},function(c){n=c.p;d=c.m}],execute:function(){var o="";var r=c("salla_accordion_head",function(){function c(c){a(this,c);this.accordionToggle=e(this,"accordionToggle");this.collapsible=false;this.collapsed=true}c.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};c.prototype.toggleCollapse=function(){var c,a,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(c=this.host.parentElement)===null||c===void 0?void 0:c.setAttribute("data-collapsed",this.collapsed.toString());(e=(a=this.host.parentElement)===null||a===void 0?void 0:a.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};c.prototype.render=function(){var c=this;return t(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return c.toggleCollapse()},class:"s-accordion-head-wrapper"},t("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},t("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),t("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"})),t("div",{key:"ddeff9dcacc42028d272298371c721ce00039176",class:"s-accordion-head-wrapper-end"},t("slot",{key:"daa4d8c9db6484f3fc67cf855250c5bc3cc59314",name:"notification"}),this.collapsible&&t("button",{key:"2bcc66dc07c3ae1ea9a31fbd0c7b8204f1eca2be",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(a){a.stopPropagation();c.toggleCollapse()}},t("span",{key:"2853844a2fbc662c002f7e2cacb299874c9debb3",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?n:d}))))};Object.defineProperty(c.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return c}());r.style=o}}}));
5
- //# sourceMappingURL=p-ed74ff73.system.entry.js.map
4
+ System.register(["./p-B0xoNOFR.system.js","./p-C2rVu_Jb.system.js"],(function(c){"use strict";var a,e,t,i,s,n,d;return{setters:[function(c){a=c.r;e=c.c;t=c.h;i=c.H;s=c.g},function(c){n=c.p;d=c.m}],execute:function(){var o="";var r=c("salla_accordion_head",function(){function c(c){a(this,c);this.accordionToggle=e(this,"accordionToggle");this.collapsible=false;this.collapsed=true}c.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};c.prototype.toggleCollapse=function(){var c,a,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(c=this.host.parentElement)===null||c===void 0?void 0:c.setAttribute("data-collapsed",this.collapsed.toString());(e=(a=this.host.parentElement)===null||a===void 0?void 0:a.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};c.prototype.render=function(){var c=this;return t(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return c.toggleCollapse()},class:"s-accordion-head-wrapper"},t("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},t("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),t("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"})),t("div",{key:"ddeff9dcacc42028d272298371c721ce00039176",class:"s-accordion-head-wrapper-end"},t("slot",{key:"daa4d8c9db6484f3fc67cf855250c5bc3cc59314",name:"notification"}),this.collapsible&&t("button",{key:"2bcc66dc07c3ae1ea9a31fbd0c7b8204f1eca2be",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(a){a.stopPropagation();c.toggleCollapse()}},t("span",{key:"2853844a2fbc662c002f7e2cacb299874c9debb3",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?n:d}))))};Object.defineProperty(c.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return c}());r.style=o}}}));
5
+ //# sourceMappingURL=p-4d6baea7.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js"],(function(e){"use strict";var t,i,a,s;return{setters:[function(e){t=e.r;i=e.c;a=e.h;s=e.H}],execute:function(){var c="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}";var l=e("salla_loyalty_prize_item",function(){function e(e){t(this,e);this.prizeItemSelected=i(this,"prizeItemSelected")}e.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};e.prototype.render=function(){return a(s,{key:"601dbcf73e68678eecc912c14c2b1be612a78551"},a("div",{key:"074f8b4cb736bfabd5885d9df77bf74e7c4829a1",onClick:this.onPrizeItemClick.bind(this)},a("img",{key:"4bec672992f7e998bde639295831a5c9ad5f5088",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),a("div",{key:"c8f858a7f406fe8e9123c57df627a4b6a2cbd719",class:"s-loyalty-prize-item-title"},this.item.name),a("div",{key:"81b954aa730e07c7f32ee538692581dede3543db",class:"s-loyalty-prize-item-subtitle"},this.item.description),a("div",{key:"b7baeada2da364fec6ee7bd606b595b1f652d8a8",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return e}());l.style=c}}}));
5
- //# sourceMappingURL=p-4f532944.system.entry.js.map
4
+ System.register(["./p-B0xoNOFR.system.js"],(function(e){"use strict";var t,i,a,s;return{setters:[function(e){t=e.r;i=e.c;a=e.h;s=e.H}],execute:function(){var c="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}";var b=e("salla_loyalty_prize_item",function(){function e(e){t(this,e);this.prizeItemSelected=i(this,"prizeItemSelected")}e.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};e.prototype.render=function(){return a(s,{key:"601dbcf73e68678eecc912c14c2b1be612a78551"},a("div",{key:"074f8b4cb736bfabd5885d9df77bf74e7c4829a1",onClick:this.onPrizeItemClick.bind(this)},a("img",{key:"4bec672992f7e998bde639295831a5c9ad5f5088",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),a("div",{key:"c8f858a7f406fe8e9123c57df627a4b6a2cbd719",class:"s-loyalty-prize-item-title"},this.item.name),a("div",{key:"81b954aa730e07c7f32ee538692581dede3543db",class:"s-loyalty-prize-item-subtitle"},this.item.description),a("div",{key:"b7baeada2da364fec6ee7bd606b595b1f652d8a8",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return e}());b.style=c}}}));
5
+ //# sourceMappingURL=p-553bc6b4.system.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-Fh3juwdj.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-12ec4275.entry.js.map
4
+ import{r as a,h as t,H as s,g as e}from"./p-D4D34Ujk.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-5542a867.entry.js.map
@@ -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-Fh3juwdj.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 h(){if(u)return c;u=1;var i=t();var e=function(){return i.Date.now()};c=e;return c}var f;var d;function v(){if(d)return f;d=1;var t=/\s/;function i(i){var e=i.length;while(e--&&t.test(i.charAt(e))){}return e}f=i;return f}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 b;function y(){if(b)return w;b=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=h(),s=y();var r="Expected a function";var a=Math.max,n=Math.min;function o(i,o,l){var c,u,h,f,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;h=g?a(s(l.maxWait)||0,o):h;w="trailing"in l?!!l.trailing:w}function b(t){var e=c,s=u;c=u=undefined;p=t;f=i.apply(s,e);return f}function y(t){p=t;d=setTimeout(T,o);return m?b(t):f}function _(t){var i=t-v,e=t-p,s=o-i;return g?n(s,h-e):s}function k(t){var i=t-v,e=t-p;return v===undefined||i>=o||i<0||g&&e>=h}function T(){var t=e();if(k(t)){return E(t)}d=setTimeout(T,_(t))}function E(t){d=undefined;if(w&&c){return b(t)}c=u=undefined;return f}function S(){if(d!==undefined){clearTimeout(d)}p=0;c=v=u=d=undefined}function C(){return d===undefined?f:E(e())}function M(){var t=e(),i=k(t);c=arguments;u=this;v=t;if(i){if(d===undefined){return y(v)}if(g){clearTimeout(d);d=setTimeout(T,o);return b(v)}}if(d===undefined){d=setTimeout(T,o)}return f}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 j=s(M);class x{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=j((()=>{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 L=":host{display:block}";const R=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 x(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:"2108b6bebdc8a651705e45d169fb10127c3c215e"},a("div",{key:"84972824884151462a1040bdc53c334b733cd7fb",class:"s-reviews-page-header-wrapper"},a("h2",{key:"80905de0950443f7e2b1c28d63bcb7f3fa47dc0c",class:"s-reviews-page-title"},this.langTitlesReviews,a("span",{key:"d51385e66a1dee802786b50d063501b6397ce345",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),a("div",{key:"2fc74d0b61d0377f0d14a5fd15a4d852e6850932",class:"s-reviews-page-filter-wrapper"},a("label",{key:"8d1363a2b2f6722f1c56445b5ba33a98f241b106",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),a("select",{key:"eb27d82e25fa609b25d5ca825381285c0a40cc5b",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)}};R.style=L;export{R as salla_reviews_page};
5
- //# sourceMappingURL=p-dca1a091.entry.js.map
4
+ import{a as t,d as i,e,f as s,r,h as a,g as n}from"./p-D4D34Ujk.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 b;function y(){if(b)return w;b=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=y();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 b(t){var e=c,s=u;c=u=undefined;p=t;h=i.apply(s,e);return h}function y(t){p=t;d=setTimeout(T,o);return m?b(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 b(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 y(v)}if(g){clearTimeout(d);d=setTimeout(T,o);return b(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 j{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 D=":host{display:block}";const L=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 j(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:"2108b6bebdc8a651705e45d169fb10127c3c215e"},a("div",{key:"84972824884151462a1040bdc53c334b733cd7fb",class:"s-reviews-page-header-wrapper"},a("h2",{key:"80905de0950443f7e2b1c28d63bcb7f3fa47dc0c",class:"s-reviews-page-title"},this.langTitlesReviews,a("span",{key:"d51385e66a1dee802786b50d063501b6397ce345",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),a("div",{key:"2fc74d0b61d0377f0d14a5fd15a4d852e6850932",class:"s-reviews-page-filter-wrapper"},a("label",{key:"8d1363a2b2f6722f1c56445b5ba33a98f241b106",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),a("select",{key:"eb27d82e25fa609b25d5ca825381285c0a40cc5b",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)}};L.style=D;export{L as salla_reviews_page};
5
+ //# sourceMappingURL=p-58085711.entry.js.map