@salla.sa/twilight-components 2.13.17 → 2.13.19

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 (242) hide show
  1. package/dist/cjs/{camera-807a5122.js → camera-82e553eb.js} +1 -9
  2. package/dist/cjs/camera-82e553eb.js.map +1 -0
  3. package/dist/cjs/check-771d889f.js +15 -0
  4. package/dist/cjs/check-771d889f.js.map +1 -0
  5. package/dist/cjs/{index-40f35e63.js → index-96c545df.js} +12 -3
  6. package/dist/cjs/index-96c545df.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/salla-add-product-button_47.cjs.entry.js +5 -4
  9. package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
  10. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-app-install-alert.cjs.entry.js +10 -20
  12. package/dist/cjs/salla-app-install-alert.cjs.entry.js.map +1 -1
  13. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-conditional-fields.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-order-summary.cjs.entry.js +107 -0
  24. package/dist/cjs/salla-order-summary.cjs.entry.js.map +1 -0
  25. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-product-options.cjs.entry.js +4 -3
  28. package/dist/cjs/salla-product-options.cjs.entry.js.map +1 -1
  29. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  32. package/dist/cjs/twilight.cjs.js +2 -2
  33. package/dist/collection/collection-manifest.json +1 -0
  34. package/dist/collection/components/salla-app-install-alert/interfaces.js +2 -0
  35. package/dist/collection/components/salla-app-install-alert/interfaces.js.map +1 -0
  36. package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js +9 -19
  37. package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js.map +1 -1
  38. package/dist/collection/components/salla-order-summary/interfaces.js +2 -0
  39. package/dist/collection/components/salla-order-summary/interfaces.js.map +1 -0
  40. package/dist/collection/components/salla-order-summary/salla-order-summary.css +3 -0
  41. package/dist/collection/components/salla-order-summary/salla-order-summary.js +113 -0
  42. package/dist/collection/components/salla-order-summary/salla-order-summary.js.map +1 -0
  43. package/dist/collection/components/salla-order-summary/test/salla-order-summary.e2e.js +13 -0
  44. package/dist/collection/components/salla-order-summary/test/salla-order-summary.e2e.js.map +1 -0
  45. package/dist/collection/components/salla-order-summary/test/salla-order-summary.spec.js +21 -0
  46. package/dist/collection/components/salla-order-summary/test/salla-order-summary.spec.js.map +1 -0
  47. package/dist/collection/components/salla-quick-order/salla-quick-order.js +1 -1
  48. package/dist/collection/components/salla-quick-order/salla-quick-order.js.map +1 -1
  49. package/dist/components/salla-app-install-alert.js +9 -19
  50. package/dist/components/salla-app-install-alert.js.map +1 -1
  51. package/dist/components/salla-order-summary.d.ts +11 -0
  52. package/dist/components/salla-order-summary.js +137 -0
  53. package/dist/components/salla-order-summary.js.map +1 -0
  54. package/dist/components/salla-quick-order.js +1 -1
  55. package/dist/components/salla-quick-order.js.map +1 -1
  56. package/dist/esm/{camera-a379486d.js → camera-d0a93c12.js} +2 -9
  57. package/dist/esm/camera-d0a93c12.js.map +1 -0
  58. package/dist/esm/check-838f37a7.js +13 -0
  59. package/dist/esm/check-838f37a7.js.map +1 -0
  60. package/dist/esm/{index-e6c3f002.js → index-9a9b1e67.js} +12 -3
  61. package/dist/esm/index-9a9b1e67.js.map +1 -0
  62. package/dist/esm/loader.js +3 -3
  63. package/dist/esm/salla-add-product-button_47.entry.js +4 -3
  64. package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
  65. package/dist/esm/salla-advertisement.entry.js +1 -1
  66. package/dist/esm/salla-app-install-alert.entry.js +10 -20
  67. package/dist/esm/salla-app-install-alert.entry.js.map +1 -1
  68. package/dist/esm/salla-apps-icons.entry.js +1 -1
  69. package/dist/esm/salla-conditional-fields.entry.js +1 -1
  70. package/dist/esm/salla-contacts.entry.js +1 -1
  71. package/dist/esm/salla-filters-widget.entry.js +1 -1
  72. package/dist/esm/salla-filters.entry.js +1 -1
  73. package/dist/esm/salla-installment.entry.js +1 -1
  74. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  75. package/dist/esm/salla-notification-item.entry.js +1 -1
  76. package/dist/esm/salla-notifications.entry.js +1 -1
  77. package/dist/esm/salla-offer.entry.js +1 -1
  78. package/dist/esm/salla-order-summary.entry.js +103 -0
  79. package/dist/esm/salla-order-summary.entry.js.map +1 -0
  80. package/dist/esm/salla-payments.entry.js +1 -1
  81. package/dist/esm/salla-price-range.entry.js +1 -1
  82. package/dist/esm/salla-product-options.entry.js +3 -2
  83. package/dist/esm/salla-product-options.entry.js.map +1 -1
  84. package/dist/esm/salla-products-list.entry.js +1 -1
  85. package/dist/esm/salla-products-slider.entry.js +1 -1
  86. package/dist/esm/salla-social.entry.js +1 -1
  87. package/dist/esm/twilight.js +3 -3
  88. package/dist/esm-es5/camera-d0a93c12.js +5 -0
  89. package/dist/esm-es5/check-838f37a7.js +5 -0
  90. package/dist/esm-es5/{index-e6c3f002.js → index-9a9b1e67.js} +2 -2
  91. package/dist/esm-es5/index-9a9b1e67.js.map +1 -0
  92. package/dist/esm-es5/loader.js +1 -1
  93. package/dist/esm-es5/loader.js.map +1 -1
  94. package/dist/esm-es5/salla-add-product-button_47.entry.js +2 -2
  95. package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
  96. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  97. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  98. package/dist/esm-es5/salla-app-install-alert.entry.js.map +1 -1
  99. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  100. package/dist/esm-es5/salla-conditional-fields.entry.js +1 -1
  101. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  102. package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
  103. package/dist/esm-es5/salla-filters.entry.js +1 -1
  104. package/dist/esm-es5/salla-installment.entry.js +1 -1
  105. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  106. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  107. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  108. package/dist/esm-es5/salla-offer.entry.js +1 -1
  109. package/dist/esm-es5/salla-order-summary.entry.js +5 -0
  110. package/dist/esm-es5/salla-order-summary.entry.js.map +1 -0
  111. package/dist/esm-es5/salla-payments.entry.js +1 -1
  112. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  113. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  114. package/dist/esm-es5/salla-product-options.entry.js.map +1 -1
  115. package/dist/esm-es5/salla-products-list.entry.js +1 -1
  116. package/dist/esm-es5/salla-products-slider.entry.js +1 -1
  117. package/dist/esm-es5/salla-social.entry.js +1 -1
  118. package/dist/esm-es5/twilight.js +1 -1
  119. package/dist/esm-es5/twilight.js.map +1 -1
  120. package/dist/twilight/p-0186ffc1.js +5 -0
  121. package/dist/twilight/{p-b7b592bc.entry.js → p-06371bb0.entry.js} +2 -2
  122. package/dist/twilight/{p-3834f37c.entry.js → p-09708e69.entry.js} +2 -2
  123. package/dist/twilight/{p-06ee24b3.system.entry.js → p-0b502ded.system.entry.js} +2 -2
  124. package/dist/twilight/{p-6d939dd2.entry.js → p-1670ae9f.entry.js} +10 -10
  125. package/dist/twilight/{p-6d939dd2.entry.js.map → p-1670ae9f.entry.js.map} +1 -1
  126. package/dist/twilight/p-19338c46.entry.js +5 -0
  127. package/dist/twilight/p-19338c46.entry.js.map +1 -0
  128. package/dist/twilight/p-1d8dea0d.system.entry.js +5 -0
  129. package/dist/twilight/p-1d8dea0d.system.entry.js.map +1 -0
  130. package/dist/twilight/{p-bf4cc420.system.entry.js → p-244fdaa3.system.entry.js} +2 -2
  131. package/dist/twilight/p-26807b00.system.entry.js +5 -0
  132. package/dist/twilight/{p-3b9dc939.system.entry.js.map → p-26807b00.system.entry.js.map} +1 -1
  133. package/dist/twilight/{p-9d806602.system.entry.js → p-26ccfdb9.system.entry.js} +2 -2
  134. package/dist/twilight/{p-06d0f1fc.system.entry.js → p-27e67445.system.entry.js} +2 -2
  135. package/dist/twilight/{p-025d4f2d.system.entry.js → p-2919b445.system.entry.js} +2 -2
  136. package/dist/twilight/{p-dd9b5ccb.js → p-294dad80.js} +2 -2
  137. package/dist/twilight/p-294dad80.js.map +1 -0
  138. package/dist/twilight/{p-390ad22a.system.entry.js → p-4923a67f.system.entry.js} +2 -2
  139. package/dist/twilight/p-4f6a5307.js +5 -0
  140. package/dist/twilight/p-4f6a5307.js.map +1 -0
  141. package/dist/twilight/{p-6b22ed0e.system.entry.js → p-52e80e00.system.entry.js} +2 -2
  142. package/dist/twilight/{p-1868754d.system.entry.js → p-5ab9e320.system.entry.js} +2 -2
  143. package/dist/twilight/{p-8241fdbe.system.entry.js → p-5add79da.system.entry.js} +2 -2
  144. package/dist/twilight/{p-73543cab.entry.js → p-5cf571e0.entry.js} +2 -2
  145. package/dist/twilight/{p-ce624f5f.system.entry.js → p-5d8d9481.system.entry.js} +2 -2
  146. package/dist/twilight/p-61858adc.system.js +5 -0
  147. package/dist/twilight/p-61858adc.system.js.map +1 -0
  148. package/dist/twilight/{p-d4007670.system.entry.js → p-63de8456.system.entry.js} +10 -10
  149. package/dist/twilight/{p-d4007670.system.entry.js.map → p-63de8456.system.entry.js.map} +1 -1
  150. package/dist/twilight/{p-333ec93c.entry.js → p-65a4715d.entry.js} +2 -2
  151. package/dist/twilight/{p-4ce6ce88.entry.js → p-65f0067f.entry.js} +2 -2
  152. package/dist/twilight/{p-6d6256da.system.entry.js → p-66da3f43.system.entry.js} +2 -2
  153. package/dist/twilight/p-70434381.system.js +5 -0
  154. package/dist/twilight/p-70434381.system.js.map +1 -0
  155. package/dist/twilight/{p-54d6d3b2.system.entry.js → p-78b1292d.system.entry.js} +2 -2
  156. package/dist/twilight/{p-124dbc8a.entry.js → p-7ce64b51.entry.js} +2 -2
  157. package/dist/twilight/{p-c6bac58c.entry.js → p-7fc43537.entry.js} +2 -2
  158. package/dist/twilight/p-80f28677.system.js +5 -0
  159. package/dist/twilight/{p-22970c71.system.js.map → p-80f28677.system.js.map} +1 -1
  160. package/dist/twilight/{p-a576382e.entry.js → p-93a0c3f0.entry.js} +2 -2
  161. package/dist/twilight/{p-2196dcbb.entry.js → p-94ad2e62.entry.js} +2 -2
  162. package/dist/twilight/p-97a6c220.system.entry.js +5 -0
  163. package/dist/twilight/p-97a6c220.system.entry.js.map +1 -0
  164. package/dist/twilight/{p-878fc12c.system.entry.js → p-9afefe3a.system.entry.js} +2 -2
  165. package/dist/twilight/{p-2d5a5668.system.entry.js → p-bb77d0d9.system.entry.js} +2 -2
  166. package/dist/twilight/p-c7f23f03.entry.js +5 -0
  167. package/dist/twilight/{p-af0f70cd.entry.js.map → p-c7f23f03.entry.js.map} +1 -1
  168. package/dist/twilight/{p-25656ae8.entry.js → p-c8c265d7.entry.js} +2 -2
  169. package/dist/twilight/{p-9a7f3e65.system.entry.js → p-d1b7315f.system.entry.js} +2 -2
  170. package/dist/twilight/{p-041f94a6.entry.js → p-d41dfff7.entry.js} +2 -2
  171. package/dist/twilight/{p-3d58cecc.entry.js → p-d5e825e0.entry.js} +2 -2
  172. package/dist/twilight/{p-37d0c076.entry.js → p-e218f9e3.entry.js} +2 -2
  173. package/dist/twilight/{p-2768c606.entry.js → p-e6bb10f0.entry.js} +2 -2
  174. package/dist/twilight/{p-89564b2e.entry.js → p-e7aa06ff.entry.js} +2 -2
  175. package/dist/twilight/{p-a54fbc9b.system.entry.js → p-ed382e13.system.entry.js} +2 -2
  176. package/dist/twilight/{p-548cb28d.system.js → p-eebd57c0.system.js} +2 -2
  177. package/dist/twilight/p-eebd57c0.system.js.map +1 -0
  178. package/dist/twilight/{p-0c2748dd.entry.js → p-f30e7de2.entry.js} +2 -2
  179. package/dist/twilight/p-f5cd04ef.entry.js +5 -0
  180. package/dist/twilight/p-f5cd04ef.entry.js.map +1 -0
  181. package/dist/twilight/twilight.esm.js +1 -1
  182. package/dist/twilight/twilight.esm.js.map +1 -1
  183. package/dist/twilight/twilight.js +1 -1
  184. package/dist/types/components/salla-app-install-alert/interfaces.d.ts +6 -0
  185. package/dist/types/components/salla-app-install-alert/salla-app-install-alert.d.ts +5 -6
  186. package/dist/types/components/salla-order-summary/interfaces.d.ts +20 -0
  187. package/dist/types/components/salla-order-summary/salla-order-summary.d.ts +24 -0
  188. package/dist/types/components.d.ts +21 -0
  189. package/package.json +5 -5
  190. package/dist/cjs/camera-807a5122.js.map +0 -1
  191. package/dist/cjs/index-40f35e63.js.map +0 -1
  192. package/dist/esm/camera-a379486d.js.map +0 -1
  193. package/dist/esm/index-e6c3f002.js.map +0 -1
  194. package/dist/esm-es5/camera-a379486d.js +0 -5
  195. package/dist/esm-es5/index-e6c3f002.js.map +0 -1
  196. package/dist/twilight/p-22970c71.system.js +0 -5
  197. package/dist/twilight/p-3b9dc939.system.entry.js +0 -5
  198. package/dist/twilight/p-548cb28d.system.js.map +0 -1
  199. package/dist/twilight/p-59b293ab.system.entry.js +0 -5
  200. package/dist/twilight/p-59b293ab.system.entry.js.map +0 -1
  201. package/dist/twilight/p-af0f70cd.entry.js +0 -5
  202. package/dist/twilight/p-bcafcefb.system.js +0 -5
  203. package/dist/twilight/p-cbda894f.js +0 -5
  204. package/dist/twilight/p-dd9b5ccb.js.map +0 -1
  205. package/dist/twilight/p-f0a605cc.entry.js +0 -5
  206. package/dist/twilight/p-f0a605cc.entry.js.map +0 -1
  207. package/dist/types/global.d.ts +0 -20
  208. /package/dist/esm-es5/{camera-a379486d.js.map → camera-d0a93c12.js.map} +0 -0
  209. /package/dist/{twilight/p-bcafcefb.system.js.map → esm-es5/check-838f37a7.js.map} +0 -0
  210. /package/dist/twilight/{p-cbda894f.js.map → p-0186ffc1.js.map} +0 -0
  211. /package/dist/twilight/{p-b7b592bc.entry.js.map → p-06371bb0.entry.js.map} +0 -0
  212. /package/dist/twilight/{p-3834f37c.entry.js.map → p-09708e69.entry.js.map} +0 -0
  213. /package/dist/twilight/{p-06ee24b3.system.entry.js.map → p-0b502ded.system.entry.js.map} +0 -0
  214. /package/dist/twilight/{p-bf4cc420.system.entry.js.map → p-244fdaa3.system.entry.js.map} +0 -0
  215. /package/dist/twilight/{p-9d806602.system.entry.js.map → p-26ccfdb9.system.entry.js.map} +0 -0
  216. /package/dist/twilight/{p-06d0f1fc.system.entry.js.map → p-27e67445.system.entry.js.map} +0 -0
  217. /package/dist/twilight/{p-025d4f2d.system.entry.js.map → p-2919b445.system.entry.js.map} +0 -0
  218. /package/dist/twilight/{p-390ad22a.system.entry.js.map → p-4923a67f.system.entry.js.map} +0 -0
  219. /package/dist/twilight/{p-6b22ed0e.system.entry.js.map → p-52e80e00.system.entry.js.map} +0 -0
  220. /package/dist/twilight/{p-1868754d.system.entry.js.map → p-5ab9e320.system.entry.js.map} +0 -0
  221. /package/dist/twilight/{p-8241fdbe.system.entry.js.map → p-5add79da.system.entry.js.map} +0 -0
  222. /package/dist/twilight/{p-73543cab.entry.js.map → p-5cf571e0.entry.js.map} +0 -0
  223. /package/dist/twilight/{p-ce624f5f.system.entry.js.map → p-5d8d9481.system.entry.js.map} +0 -0
  224. /package/dist/twilight/{p-333ec93c.entry.js.map → p-65a4715d.entry.js.map} +0 -0
  225. /package/dist/twilight/{p-4ce6ce88.entry.js.map → p-65f0067f.entry.js.map} +0 -0
  226. /package/dist/twilight/{p-6d6256da.system.entry.js.map → p-66da3f43.system.entry.js.map} +0 -0
  227. /package/dist/twilight/{p-54d6d3b2.system.entry.js.map → p-78b1292d.system.entry.js.map} +0 -0
  228. /package/dist/twilight/{p-124dbc8a.entry.js.map → p-7ce64b51.entry.js.map} +0 -0
  229. /package/dist/twilight/{p-c6bac58c.entry.js.map → p-7fc43537.entry.js.map} +0 -0
  230. /package/dist/twilight/{p-a576382e.entry.js.map → p-93a0c3f0.entry.js.map} +0 -0
  231. /package/dist/twilight/{p-2196dcbb.entry.js.map → p-94ad2e62.entry.js.map} +0 -0
  232. /package/dist/twilight/{p-878fc12c.system.entry.js.map → p-9afefe3a.system.entry.js.map} +0 -0
  233. /package/dist/twilight/{p-2d5a5668.system.entry.js.map → p-bb77d0d9.system.entry.js.map} +0 -0
  234. /package/dist/twilight/{p-25656ae8.entry.js.map → p-c8c265d7.entry.js.map} +0 -0
  235. /package/dist/twilight/{p-9a7f3e65.system.entry.js.map → p-d1b7315f.system.entry.js.map} +0 -0
  236. /package/dist/twilight/{p-041f94a6.entry.js.map → p-d41dfff7.entry.js.map} +0 -0
  237. /package/dist/twilight/{p-3d58cecc.entry.js.map → p-d5e825e0.entry.js.map} +0 -0
  238. /package/dist/twilight/{p-37d0c076.entry.js.map → p-e218f9e3.entry.js.map} +0 -0
  239. /package/dist/twilight/{p-2768c606.entry.js.map → p-e6bb10f0.entry.js.map} +0 -0
  240. /package/dist/twilight/{p-89564b2e.entry.js.map → p-e7aa06ff.entry.js.map} +0 -0
  241. /package/dist/twilight/{p-a54fbc9b.system.entry.js.map → p-ed382e13.system.entry.js.map} +0 -0
  242. /package/dist/twilight/{p-0c2748dd.entry.js.map → p-f30e7de2.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function s(e){try{l(r.next(e))}catch(e){a(e)}}function o(e){try{l(r["throw"](e))}catch(e){a(e)}}function l(e){e.done?n(e.value):i(e.value).then(s,o)}l((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(o){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(n=0)),n)try{if(r=1,i&&(a=o[0]&2?i["return"]:o[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;if(i=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;i=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];i=0}finally{r=a=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
- */import{r as registerInstance,h,g as getElement}from"./index-e6c3f002.js";import{a as anime}from"./anime.es-6b92d9cd.js";var sallaAdvertisementCss=":host{display:block}";var SallaAdvertisement=function(){function e(e){var t=this;registerInstance(this,e);var n;this.position=undefined;this.advertisements=undefined;this.advertIcon=undefined;this.currentSlug=salla.config.get("page.slug");salla.onReady((function(){t.currentSlug=salla.config.get("page.slug")}));this.advSlot=((n=this.host.querySelector('[slot="adv"]'))===null||n===void 0?void 0:n.innerHTML)||'<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n '}e.prototype.isNotVisible=function(e){return!!salla.storage.get("statusAd-".concat(e.id))};e.prototype.setCanDisplayFlag=function(e,t){if(!t){salla.storage.set("statusAd-".concat(e.id),"dismissed");anime({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}};e.prototype.render=function(){var e=this;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((function(t){return h("div",{class:{"s-hidden":e.isNotVisible(t),"s-advertisement":true},"data-id":t.id,style:{"background-color":t.colors.bg,color:t.colors.text}},h("div",{id:"adv-slot",innerHTML:e.advSlot.replace("{iconElem}",'<i class="s-advertisement-content-icon '.concat(t.icon,'"></i>')).replace("{urlElem}",t.url?'<a href="'.concat(t.url,'" target="').concat(t.target,'">').concat(t.description,"</a>"):t.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",t.icon).replace("{url}",t.url).replace("{target}",t.target).replace("{description}",t.description).replace("{bg_color}",t.colors.bg).replace("{text_color}",t.colors.text)}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,salla.api.advertisement.fetch(this.currentSlug).then((function(t){var n=t.data;if(Array.isArray(n)&&n.length>0){for(var r=0,i=n;r<i.length;r++){var a=i[r];if(!salla.storage.get("statusAd-".concat(a.id))){e.advertisements=[a];break}}}}))];case 1:t.sent();return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this;var t;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((function(){var t=e.host.querySelector(".s-advertisement-action");if(t){t.addEventListener("click",(function(){return e.setCanDisplayFlag(e.advertisements[0],false)}))}}));this.host.querySelectorAll("#adv-slot").forEach((function(e){return e===null||e===void 0?void 0:e.replaceWith(e===null||e===void 0?void 0:e.firstChild)}));(t=this.host.querySelector('[slot="adv"]'))===null||t===void 0?void 0:t.remove();anime({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAdvertisement.style=sallaAdvertisementCss;export{SallaAdvertisement as salla_advertisement};
4
+ */import{r as registerInstance,h,g as getElement}from"./index-9a9b1e67.js";import{a as anime}from"./anime.es-6b92d9cd.js";var sallaAdvertisementCss=":host{display:block}";var SallaAdvertisement=function(){function e(e){var t=this;registerInstance(this,e);var n;this.position=undefined;this.advertisements=undefined;this.advertIcon=undefined;this.currentSlug=salla.config.get("page.slug");salla.onReady((function(){t.currentSlug=salla.config.get("page.slug")}));this.advSlot=((n=this.host.querySelector('[slot="adv"]'))===null||n===void 0?void 0:n.innerHTML)||'<div class="s-advertisement-content"><h2 class="s-advertisement-content-main">{iconElem}{urlElem}</h2>{closeElem}</div>\n '}e.prototype.isNotVisible=function(e){return!!salla.storage.get("statusAd-".concat(e.id))};e.prototype.setCanDisplayFlag=function(e,t){if(!t){salla.storage.set("statusAd-".concat(e.id),"dismissed");anime({targets:this.host,opacity:[1,0],duration:300,height:[this.host.clientHeight,0],easing:"easeInOutQuad"})}};e.prototype.render=function(){var e=this;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}return this.advertisements.map((function(t){return h("div",{class:{"s-hidden":e.isNotVisible(t),"s-advertisement":true},"data-id":t.id,style:{"background-color":t.colors.bg,color:t.colors.text}},h("div",{id:"adv-slot",innerHTML:e.advSlot.replace("{iconElem}",'<i class="s-advertisement-content-icon '.concat(t.icon,'"></i>')).replace("{urlElem}",t.url?'<a href="'.concat(t.url,'" target="').concat(t.target,'">').concat(t.description,"</a>"):t.description).replace("{closeElem}",'<button class="s-advertisement-action" aria-label="close-alert"><i class="sicon-cancel"></i></button>').replace("{icon}",t.icon).replace("{url}",t.url).replace("{target}",t.target).replace("{description}",t.description).replace("{bg_color}",t.colors.bg).replace("{text_color}",t.colors.text)}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:return[4,salla.api.advertisement.fetch(this.currentSlug).then((function(t){var n=t.data;if(Array.isArray(n)&&n.length>0){for(var r=0,i=n;r<i.length;r++){var a=i[r];if(!salla.storage.get("statusAd-".concat(a.id))){e.advertisements=[a];break}}}}))];case 1:t.sent();return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this;var t;if(Array.isArray(this.advertisements)&&!this.advertisements.length||!this.advertisements){return}setTimeout((function(){var t=e.host.querySelector(".s-advertisement-action");if(t){t.addEventListener("click",(function(){return e.setCanDisplayFlag(e.advertisements[0],false)}))}}));this.host.querySelectorAll("#adv-slot").forEach((function(e){return e===null||e===void 0?void 0:e.replaceWith(e===null||e===void 0?void 0:e.firstChild)}));(t=this.host.querySelector('[slot="adv"]'))===null||t===void 0?void 0:t.remove();anime({targets:this.host,opacity:[0,1],duration:300,height:[0,this.host.clientHeight],easing:"easeInOutQuad"})};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAdvertisement.style=sallaAdvertisementCss;export{SallaAdvertisement as salla_advertisement};
5
5
  //# sourceMappingURL=salla-advertisement.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";var sallaAppInstallAlertCss=":host{display:block}";var SallaAppInstallAlert=function(){function t(t){registerInstance(this,t);this.data=salla.config.get("store.app_install_prompt");this.ctaLink=undefined;this.open=false;this.closing=false}t.prototype.connectedCallback=function(){var t=this;salla.onReady((function(){t.data=salla.config.get("store.app_install_prompt");if(!t.isMobileOrTabletDevice()){return}t.ctaLink=salla.config.get("store.apps")[t.getMobileOS()==="iOS"?"appstore":"googleplay"];setTimeout((function(){return t.open=true}),3e3)}))};t.prototype.getMobileOS=function(){var t=navigator.userAgent;if(/android/i.test(t)){return"Android"}else if(/iPad|iPhone|iPod/.test(t)||/Macintosh/i.test(navigator.userAgent)&&"ontouchend"in document){return"iOS"}return"Other"};t.prototype.isMobileOrTabletDevice=function(t){if(t===void 0){t=1024}var a=window.innerWidth<=t;var e=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);var n="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return e&&a&&n};t.prototype.closeAlert=function(){var t=this;salla.storage.set("app_install_prompt_disabled",true);this.closing=true;this.host.addEventListener("animationend",(function(){t.closing=false;t.open=false}),{once:true})};t.prototype.render=function(){var t=this;return h(Host,{class:"s-app-install-alert-wrapper ".concat(this.open?"open":""," ").concat(this.closing?"closing":""),position:this.data.position},h("div",null,h("img",{src:this.data.icon,width:"58",height:"58",alt:"".concat(salla.config.get("store.name"))})),h("div",{class:"s-app-install-alert-content"},h("h2",{class:"s-app-install-alert-title"},this.data.title),h("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",h("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),h("button",{class:"s-app-install-alert-cancel-button",onClick:function(){return t.closeAlert()}},h("i",{class:"sicon-cancel"})))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaAppInstallAlert.style=sallaAppInstallAlertCss;export{SallaAppInstallAlert as salla_app_install_alert};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-9a9b1e67.js";var sallaAppInstallAlertCss=":host{display:block}";var SallaAppInstallAlert=function(){function t(t){registerInstance(this,t);this.alertDelay=null;this.data=salla.config.get("store.app_install_prompt");this.ctaLink=undefined;this.open=false;this.closing=false}t.prototype.connectedCallback=function(){var t=this;salla.onReady((function(){t.data=salla.config.get("store.app_install_prompt");if(!t.isMobileOrTabletDevice())return;if(!t.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");t.ctaLink=salla.url.get("app");t.alertDelay=setTimeout((function(){return t.open=true}),3e3)}))};t.prototype.disconnectedCallback=function(){clearTimeout(this.alertDelay)};t.prototype.isMobileOrTabletDevice=function(t){if(t===void 0){t=1024}var a=window.innerWidth<=t;var l=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);var e="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return l&&a&&e};t.prototype.closeAlert=function(){var t=this;salla.storage.set("app_install_prompt_disabled",true);this.closing=true;this.host.addEventListener("animationend",(function(){t.closing=false;t.open=false}),{once:true})};t.prototype.render=function(){var t=this;return this.data?h(Host,{class:"s-app-install-alert-wrapper ".concat(this.open?"open":""," ").concat(this.closing?"closing":""),position:this.data.position},h("div",null,h("img",{src:this.data.icon,width:"58",height:"58",alt:"".concat(salla.config.get("store.name"))})),h("div",{class:"s-app-install-alert-content"},h("h2",{class:"s-app-install-alert-title"},this.data.title),h("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",h("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),h("button",{class:"s-app-install-alert-cancel-button",onClick:function(){return t.closeAlert()}},h("i",{class:"sicon-cancel"}))):null};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaAppInstallAlert.style=sallaAppInstallAlertCss;export{SallaAppInstallAlert as salla_app_install_alert};
5
5
  //# sourceMappingURL=salla-app-install-alert.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["sallaAppInstallAlertCss","SallaAppInstallAlert","salla","config","get","prototype","connectedCallback","_this","this","onReady","data","isMobileOrTabletDevice","ctaLink","getMobileOS","setTimeout","open","ua","navigator","userAgent","test","document","screen","screenWidth","window","innerWidth","userAgentCheck","hasTouch","maxTouchPoints","closeAlert","storage","set","closing","host","addEventListener","once","render","h","Host","class","concat","position","src","icon","width","height","alt","title","sub_title","href","target","lang","getWithDefault","onClick"],"sources":["src/components/salla-app-install-alert/salla-app-install-alert.scss?tag=salla-app-install-alert","src/components/salla-app-install-alert/salla-app-install-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h, State, Element, Host } from '@stencil/core';\n\n@Component({\n tag: 'salla-app-install-alert',\n styleUrl: 'salla-app-install-alert.scss',\n})\nexport class SallaAppInstallAlert {\n connectedCallback() {\n salla.onReady(() => {\n this.data = salla.config.get('store.app_install_prompt');\n if (!this.isMobileOrTabletDevice()) {\n return;\n }\n\n this.ctaLink = salla.config.get('store.apps')[this.getMobileOS() === 'iOS' ? 'appstore' : 'googleplay'];\n setTimeout(() => (this.open = true), 3000);\n });\n }\n @State() data: any = salla.config.get('store.app_install_prompt');\n @State() ctaLink: string;\n @State() open: boolean = false;\n @State() closing: boolean = false;\n @Element() private host: HTMLElement;\n\n\n\n /**\n * Get the OS of device (android/ios).\n * @returns {string} returns iOS/Android/Other\n */\n private getMobileOS(): string {\n const ua = navigator.userAgent;\n if (/android/i.test(ua)) {\n return 'Android';\n } else if (\n /iPad|iPhone|iPod/.test(ua) ||\n (/Macintosh/i.test(navigator.userAgent) && 'ontouchend' in document)\n ) {\n return 'iOS';\n }\n return 'Other';\n }\n\n /**\n * Check if the website opens from mobile or tablet devices only (android/ios).\n *\n * @param {number} screen the width of the biggest screen to be checked\n * @returns {boolean} true if it is mobile or tablet else false\n */\n private isMobileOrTabletDevice(screen = 1024): boolean {\n const screenWidth = window.innerWidth <= screen;\n const userAgentCheck = /Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);\n const hasTouch =\n 'ontouchstart' in window ||\n 'ontouchend' in document ||\n navigator.maxTouchPoints > 0;\n\n return userAgentCheck && screenWidth && hasTouch;\n }\n\n closeAlert() {\n salla.storage.set('app_install_prompt_disabled', true);\n // handle closing animation first, then close the banner\n this.closing = true;\n this.host.addEventListener(\n 'animationend',\n () => {\n this.closing = false\n this.open = false;\n },\n { once: true }\n );\n }\n\n\n render() {\n return (\n <Host class={`s-app-install-alert-wrapper ${this.open ? 'open' : ''} ${this.closing ? 'closing' : ''}`} position={this.data.position}>\n <div>\n <img src={this.data.icon} width=\"58\" height=\"58\" alt={`${salla.config.get('store.name')}`} />\n </div>\n <div class=\"s-app-install-alert-content\">\n <h2 class=\"s-app-install-alert-title\">{this.data.title}</h2>\n <p class=\"s-app-install-alert-sub-title\">\n {this.data.sub_title} {\" \"}\n <a href={this.ctaLink} target=\"_blank\" aria-label=\"download app\" class=\"s-app-install-alert-cta\">\n {salla.lang.getWithDefault('blocks.footer.download_app_now', 'حمله الآن')}\n </a>\n </p>\n </div>\n <button class=\"s-app-install-alert-cancel-button\" onClick={() => this.closeAlert()}>\n <i class=\"sicon-cancel\"></i>\n </button>\n </Host>\n );\n }\n}\n"],"mappings":";;;mFAAA,IAAMA,wBAA0B,uB,ICMnBC,qBAAoB,W,iDAYVC,MAAMC,OAAOC,IAAI,4B,iCAEb,M,aACG,K,CAd5BH,EAAAI,UAAAC,kBAAA,eAAAC,EAAAC,KACEN,MAAMO,SAAQ,WACZF,EAAKG,KAAOR,MAAMC,OAAOC,IAAI,4BAC7B,IAAKG,EAAKI,yBAA0B,CAClC,M,CAGFJ,EAAKK,QAAUV,MAAMC,OAAOC,IAAI,cAAcG,EAAKM,gBAAkB,MAAQ,WAAa,cAC1FC,YAAW,kBAAOP,EAAKQ,KAAO,IAAnB,GAA0B,I,KAejCd,EAAAI,UAAAQ,YAAA,WACN,IAAMG,EAAKC,UAAUC,UACrB,GAAI,WAAWC,KAAKH,GAAK,CACvB,MAAO,S,MACF,GACL,mBAAmBG,KAAKH,IACvB,aAAaG,KAAKF,UAAUC,YAAc,eAAgBE,SAC3D,CACA,MAAO,K,CAET,MAAO,O,EASDnB,EAAAI,UAAAM,uBAAA,SAAuBU,GAAA,GAAAA,SAAA,GAAAA,EAAA,IAAa,CAC1C,IAAMC,EAAcC,OAAOC,YAAcH,EACzC,IAAMI,EAAiB,sCAAsCN,KAAKF,UAAUC,WAC5E,IAAMQ,EACJ,iBAAkBH,QAClB,eAAgBH,UAChBH,UAAUU,eAAiB,EAE7B,OAAOF,GAAkBH,GAAeI,C,EAG1CzB,EAAAI,UAAAuB,WAAA,eAAArB,EAAAC,KACEN,MAAM2B,QAAQC,IAAI,8BAA+B,MAEjDtB,KAAKuB,QAAU,KACfvB,KAAKwB,KAAKC,iBACR,gBACA,WACE1B,EAAKwB,QAAU,MACfxB,EAAKQ,KAAO,K,GAEd,CAAEmB,KAAM,M,EAKZjC,EAAAI,UAAA8B,OAAA,eAAA5B,EAAAC,KACE,OACE4B,EAACC,KAAI,CAACC,MAAO,+BAAAC,OAA+B/B,KAAKO,KAAO,OAAS,GAAE,KAAAwB,OAAI/B,KAAKuB,QAAU,UAAY,IAAMS,SAAUhC,KAAKE,KAAK8B,UAC1HJ,EAAA,WACEA,EAAA,OAAKK,IAAKjC,KAAKE,KAAKgC,KAAMC,MAAM,KAAKC,OAAO,KAAKC,IAAK,GAAAN,OAAGrC,MAAMC,OAAOC,IAAI,kBAE5EgC,EAAA,OAAKE,MAAM,+BACTF,EAAA,MAAIE,MAAM,6BAA6B9B,KAAKE,KAAKoC,OACjDV,EAAA,KAAGE,MAAM,iCACN9B,KAAKE,KAAKqC,UAAS,IAAG,IACvBX,EAAA,KAAGY,KAAMxC,KAAKI,QAASqC,OAAO,SAAQ,aAAY,eAAeX,MAAM,2BACpEpC,MAAMgD,KAAKC,eAAe,iCAAkC,gBAInEf,EAAA,UAAQE,MAAM,oCAAoCc,QAAS,WAAM,OAAA7C,EAAKqB,YAAL,GAC/DQ,EAAA,KAAGE,MAAM,kB,kIArFc,G"}
1
+ {"version":3,"names":["sallaAppInstallAlertCss","SallaAppInstallAlert","this","alertDelay","salla","config","get","prototype","connectedCallback","_this","onReady","data","isMobileOrTabletDevice","logger","error","ctaLink","url","setTimeout","open","disconnectedCallback","clearTimeout","screen","screenWidth","window","innerWidth","userAgentCheck","test","navigator","userAgent","hasTouch","document","maxTouchPoints","closeAlert","storage","set","closing","host","addEventListener","once","render","h","Host","class","concat","position","src","icon","width","height","alt","title","sub_title","href","target","lang","getWithDefault","onClick"],"sources":["src/components/salla-app-install-alert/salla-app-install-alert.scss?tag=salla-app-install-alert","src/components/salla-app-install-alert/salla-app-install-alert.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h, State, Element, Host } from '@stencil/core';\nimport { AppInstallAlertData } from './interfaces';\n\n@Component({\n tag: 'salla-app-install-alert',\n styleUrl: 'salla-app-install-alert.scss',\n})\nexport class SallaAppInstallAlert {\n\n alertDelay: NodeJS.Timeout = null\n\n connectedCallback() {\n salla.onReady(() => {\n this.data = salla.config.get('store.app_install_prompt')\n\n if (!this.isMobileOrTabletDevice()) return;\n\n if (!this.data) return salla.logger.error('Failed to retrieve salla-app-install-alert config')\n\n this.ctaLink = salla.url.get('app');\n this.alertDelay = setTimeout(() => (this.open = true), 3000);\n });\n }\n\n disconnectedCallback() {\n clearTimeout(this.alertDelay)\n }\n\n\n\n\n @State() data: AppInstallAlertData | null = salla.config.get('store.app_install_prompt');\n @State() ctaLink: string;\n @State() open: boolean = false;\n @State() closing: boolean = false;\n @Element() private host: HTMLElement;\n\n\n /**\n * Check if the website opens from mobile or tablet devices only (android/ios).\n *\n * @param {number} screen the width of the biggest screen to be checked\n * @returns {boolean} true if it is mobile or tablet else false\n */\n private isMobileOrTabletDevice(screen = 1024): boolean {\n const screenWidth = window.innerWidth <= screen;\n const userAgentCheck = /Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent);\n const hasTouch =\n 'ontouchstart' in window ||\n 'ontouchend' in document ||\n navigator.maxTouchPoints > 0;\n\n return userAgentCheck && screenWidth && hasTouch;\n }\n\n closeAlert() {\n salla.storage.set('app_install_prompt_disabled', true);\n // handle closing animation first, then close the banner\n this.closing = true;\n this.host.addEventListener(\n 'animationend',\n () => {\n this.closing = false\n this.open = false;\n },\n { once: true }\n );\n }\n\n\n render() {\n return this.data ? (\n <Host class={`s-app-install-alert-wrapper ${this.open ? 'open' : ''} ${this.closing ? 'closing' : ''}`} position={this.data.position}>\n <div>\n <img src={this.data.icon} width=\"58\" height=\"58\" alt={`${salla.config.get('store.name')}`} />\n </div>\n <div class=\"s-app-install-alert-content\">\n <h2 class=\"s-app-install-alert-title\">{this.data.title}</h2>\n <p class=\"s-app-install-alert-sub-title\">\n {this.data.sub_title} {\" \"}\n <a href={this.ctaLink} target=\"_blank\" aria-label=\"download app\" class=\"s-app-install-alert-cta\">\n {salla.lang.getWithDefault('blocks.footer.download_app_now', 'حمله الآن')}\n </a>\n </p>\n </div>\n <button class=\"s-app-install-alert-cancel-button\" onClick={() => this.closeAlert()}>\n <i class=\"sicon-cancel\"></i>\n </button>\n </Host>\n ) : null\n }\n}\n"],"mappings":";;;mFAAA,IAAMA,wBAA0B,uB,ICOnBC,qBAAoB,W,uCAE/BC,KAAAC,WAA6B,K,UAsBeC,MAAMC,OAAOC,IAAI,4B,iCAEpC,M,aACG,K,CAvB5BL,EAAAM,UAAAC,kBAAA,eAAAC,EAAAP,KACEE,MAAMM,SAAQ,WACZD,EAAKE,KAAOP,MAAMC,OAAOC,IAAI,4BAE7B,IAAKG,EAAKG,yBAA0B,OAEpC,IAAKH,EAAKE,KAAM,OAAOP,MAAMS,OAAOC,MAAM,qDAE1CL,EAAKM,QAAUX,MAAMY,IAAIV,IAAI,OAC7BG,EAAKN,WAAac,YAAW,kBAAOR,EAAKS,KAAO,IAAnB,GAA0B,I,KAI3DjB,EAAAM,UAAAY,qBAAA,WACEC,aAAalB,KAAKC,W,EAmBZF,EAAAM,UAAAK,uBAAA,SAAuBS,GAAA,GAAAA,SAAA,GAAAA,EAAA,IAAa,CAC1C,IAAMC,EAAcC,OAAOC,YAAcH,EACzC,IAAMI,EAAiB,sCAAsCC,KAAKC,UAAUC,WAC5E,IAAMC,EACJ,iBAAkBN,QAClB,eAAgBO,UAChBH,UAAUI,eAAiB,EAE7B,OAAON,GAAkBH,GAAeO,C,EAG1C5B,EAAAM,UAAAyB,WAAA,eAAAvB,EAAAP,KACEE,MAAM6B,QAAQC,IAAI,8BAA+B,MAEjDhC,KAAKiC,QAAU,KACfjC,KAAKkC,KAAKC,iBACR,gBACA,WACE5B,EAAK0B,QAAU,MACf1B,EAAKS,KAAO,K,GAEd,CAAEoB,KAAM,M,EAKZrC,EAAAM,UAAAgC,OAAA,eAAA9B,EAAAP,KACE,OAAOA,KAAKS,KACV6B,EAACC,KAAI,CAACC,MAAO,+BAAAC,OAA+BzC,KAAKgB,KAAO,OAAS,GAAE,KAAAyB,OAAIzC,KAAKiC,QAAU,UAAY,IAAMS,SAAU1C,KAAKS,KAAKiC,UAC1HJ,EAAA,WACEA,EAAA,OAAKK,IAAK3C,KAAKS,KAAKmC,KAAMC,MAAM,KAAKC,OAAO,KAAKC,IAAK,GAAAN,OAAGvC,MAAMC,OAAOC,IAAI,kBAE5EkC,EAAA,OAAKE,MAAM,+BACTF,EAAA,MAAIE,MAAM,6BAA6BxC,KAAKS,KAAKuC,OACjDV,EAAA,KAAGE,MAAM,iCACNxC,KAAKS,KAAKwC,UAAS,IAAG,IACvBX,EAAA,KAAGY,KAAMlD,KAAKa,QAASsC,OAAO,SAAQ,aAAY,eAAeX,MAAM,2BACpEtC,MAAMkD,KAAKC,eAAe,iCAAkC,gBAInEf,EAAA,UAAQE,MAAM,oCAAoCc,QAAS,WAAM,OAAA/C,EAAKuB,YAAL,GAC/DQ,EAAA,KAAGE,MAAM,mBAGX,I,kIAlFyB,G"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";var sallaAppsIconsCss=":host{display:block}";var SallaAppsIcons=function(){function e(e){var s=this;registerInstance(this,e);var t;this.apps=salla.config.get("store.apps");this.hideTitle=undefined;this.appsTitle=undefined;this.vertical=undefined;this.appSlot=((t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){s.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){s.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}e.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(e){var s=e[0],t=e[1];return{name:s,value:t}}))};e.prototype.render=function(){var e=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return h(Host,{class:"s-apps-icons"},!this.hideTitle&&h("h3",null,this.appsTitle),h("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,t){return h("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:e.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};e.prototype.componentDidRender=function(){var e;(e=this.host.querySelector('[slot="app"]'))===null||e===void 0?void 0:e.remove()};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAppsIcons.style=sallaAppsIconsCss;export{SallaAppsIcons as salla_apps_icons};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-9a9b1e67.js";var sallaAppsIconsCss=":host{display:block}";var SallaAppsIcons=function(){function e(e){var s=this;registerInstance(this,e);var t;this.apps=salla.config.get("store.apps");this.hideTitle=undefined;this.appsTitle=undefined;this.vertical=undefined;this.appSlot=((t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){s.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){s.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}e.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(e){var s=e[0],t=e[1];return{name:s,value:t}}))};e.prototype.render=function(){var e=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return h(Host,{class:"s-apps-icons"},!this.hideTitle&&h("h3",null,this.appsTitle),h("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,t){return h("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:e.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};e.prototype.componentDidRender=function(){var e;(e=this.host.querySelector('[slot="app"]'))===null||e===void 0?void 0:e.remove()};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaAppsIcons.style=sallaAppsIconsCss;export{SallaAppsIcons as salla_apps_icons};
5
5
  //# sourceMappingURL=salla-apps-icons.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";var SallaConditionalFields=function(){function e(e){registerInstance(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var o;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((o=e===null||e===void 0?void 0:e.target)===null||o===void 0?void 0:o.tagName)||"N/A"));return}var n=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",'[data-show-when^="'.concat(n,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(n,'"]')).forEach((function(o){var n=!(o===null||o===void 0?void 0:o.dataset.showWhen.includes("!="));var i=o===null||o===void 0?void 0:o.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var r;if(a){var l=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));r=l.includes(i.toString())}else{r=i===e.target.value}salla.log("The input is ",a?"Multiple":"Single"," value:",r);var s=n&&r||!n&&!r;if(s){o.classList.remove("hidden");o.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");var t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){var n=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(e.getAttribute("name"),'"]')));var a=n.some((function(e){return e.checked}));if(a){n.forEach((function(e){e.removeAttribute("required")}))}}if(!["checkbox"].includes(e.getAttribute("type"))&&o.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{t.hideAllOptions(o.dataset.optionId);o.classList.add("hidden");t.disableInputs(o)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var o;var n=(o=t===null||t===void 0?void 0:t.dataset)===null||o===void 0?void 0:o.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!n){return}e.changeHandler({target:e.host.querySelector('[name^="'+n+'"]')})}))};e.prototype.render=function(){return h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{SallaConditionalFields as salla_conditional_fields};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-9a9b1e67.js";var SallaConditionalFields=function(){function e(e){registerInstance(this,e)}e.prototype.hideAllOptions=function(e){var t=this;this.host.querySelectorAll('[data-show-when^="options['.concat(e,'"]')).forEach((function(e){e.classList.add("hidden");t.hideAllOptions(e.dataset.optionId);t.disableInputs(e)}))};e.prototype.disableInputs=function(e){e.querySelectorAll("[name]").forEach((function(e){var t;e.setAttribute("disabled","");e.removeAttribute("required");if(((t=e===null||e===void 0?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase())==="select"){e.value=""}if(["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")){e.checked=false}}))};e.prototype.changeHandler=function(e){var t=this;var o;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not support input: "+(((o=e===null||e===void 0?void 0:e.target)===null||o===void 0?void 0:o.tagName)||"N/A"));return}var n=e.target.name.replace("[]","");var a=e.target.getAttribute("type")==="checkbox";salla.log("Trying to find all the element with condition:",'[data-show-when^="'.concat(n,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(n,'"]')).forEach((function(o){var n=!(o===null||o===void 0?void 0:o.dataset.showWhen.includes("!="));var i=o===null||o===void 0?void 0:o.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var r;if(a){var l=Array.from(t.host.querySelectorAll('input[name="'.concat(e.target.name,'"]:checked')),(function(e){return e===null||e===void 0?void 0:e.value}));r=l.includes(i.toString())}else{r=i===e.target.value}salla.log("The input is ",a?"Multiple":"Single"," value:",r);var s=n&&r||!n&&!r;if(s){o.classList.remove("hidden");o.querySelectorAll("[name]").forEach((function(e){e.removeAttribute("disabled");var t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){var n=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(e.getAttribute("name"),'"]')));var a=n.some((function(e){return e.checked}));if(a){n.forEach((function(e){e.removeAttribute("required")}))}}if(!["checkbox"].includes(e.getAttribute("type"))&&o.getElementsByClassName("required").length){e.setAttribute("required","")}}))}else{t.hideAllOptions(o.dataset.optionId);o.classList.add("hidden");t.disableInputs(o)}}))};e.prototype.componentDidRender=function(){var e=this;this.host.querySelectorAll("[data-show-when]").forEach((function(t){var o;var n=(o=t===null||t===void 0?void 0:t.dataset)===null||o===void 0?void 0:o.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!n){return}e.changeHandler({target:e.host.querySelector('[name^="'+n+'"]')})}))};e.prototype.render=function(){return h(Host,null,h("slot",null))};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();export{SallaConditionalFields as salla_conditional_fields};
5
5
  //# sourceMappingURL=salla-conditional-fields.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{e as email}from"./mail-25533e3f.js";var mobile='\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>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var whatsapp='\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>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n';var phone='\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>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var telegram='\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>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var sallaContactsCss=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var SallaContacts=function(){function t(t){var e=this;registerInstance(this,t);var n;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:mobile,whatsapp:whatsapp,phone:phone,telegram:telegram,email:email};this.contactSlot=((n=this.host.querySelector('[slot="contact"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){e.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){e.contactsTitle=e.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var e=t[0],n=t[1];return n!==""})).map((function(t){var e=t[0],n=t[1];return{type:e,value:n}}))};t.prototype.getContactLink=function(t){switch(t){case"phone":return"tel:".concat(this.contacts[t]);case"mobile":return"tel:".concat(this.contacts[t]);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(this.contacts[t]);case"telegram":return"https://t.me/".concat(this.contacts[t]);default:return this.contacts[t]}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.render=function(){var t=this;var e=this.getContactsArray();if(this.isHeader&&e&&e.length>0){return h(Host,{class:"s-contacts s-contacts-header"},e.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(e,n){return h("a",{href:t.getContactLink(e.type),key:n,class:"s-contacts-topnav-link"},e.type==="email"?e.value:[h("span",null,t.contactsTitle,": "),h("a",{class:"unicode",href:t.iconsList[e.type]},e.value)])})))}return h(Host,{class:"s-contacts"},!this.hideTitle&&h("h3",{class:"s-contacts-title"},this.contactsTitle),h("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},e.map((function(e,n){return h("div",{key:n,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(e.type)).replace(/\{value\}/g,e.value.toString()).replace(/\{link\}/g,t.getContactLink(e.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaContacts.style=sallaContactsCss;export{SallaContacts as salla_contacts};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-9a9b1e67.js";import{e as email}from"./mail-25533e3f.js";var mobile='\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>iphone</title>\n<path d="M15.053 27.613c0.133 0.12 0.28 0.213 0.44 0.28s0.333 0.107 0.507 0.107c0.36 0 0.693-0.135 0.947-0.387 0.12-0.135 0.213-0.28 0.28-0.44 0.080-0.16 0.107-0.333 0.107-0.507 0-0.347-0.147-0.695-0.387-0.947-0.507-0.493-1.387-0.493-1.893 0-0.12 0.12-0.213 0.267-0.28 0.44-0.067 0.16-0.107 0.333-0.107 0.507s0.040 0.347 0.107 0.507 0.16 0.305 0.28 0.44zM24 0h-16c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h16c2.205 0 4-1.795 4-4v-24c0-2.205-1.795-4-4-4zM25.333 28c0 0.736-0.599 1.333-1.333 1.333h-16c-0.735 0-1.333-0.597-1.333-1.333v-4h18.667zM25.333 21.333h-18.667v-17.333c0-0.735 0.599-1.333 1.333-1.333h16c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n';var whatsapp='\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>whatsapp2</title>\n<path d="M27.281 4.65c-2.994-3-6.975-4.65-11.219-4.65-8.738 0-15.85 7.112-15.85 15.856 0 2.794 0.731 5.525 2.119 7.925l-2.25 8.219 8.406-2.206c2.319 1.262 4.925 1.931 7.575 1.931h0.006c0 0 0 0 0 0 8.738 0 15.856-7.113 15.856-15.856 0-4.238-1.65-8.219-4.644-11.219zM16.069 29.050v0c-2.369 0-4.688-0.637-6.713-1.837l-0.481-0.288-4.987 1.306 1.331-4.863-0.313-0.5c-1.325-2.094-2.019-4.519-2.019-7.012 0-7.269 5.912-13.181 13.188-13.181 3.519 0 6.831 1.375 9.319 3.862 2.488 2.494 3.856 5.8 3.856 9.325-0.006 7.275-5.919 13.188-13.181 13.188zM23.294 19.175c-0.394-0.2-2.344-1.156-2.706-1.288s-0.625-0.2-0.894 0.2c-0.262 0.394-1.025 1.288-1.256 1.556-0.231 0.262-0.462 0.3-0.856 0.1s-1.675-0.619-3.188-1.969c-1.175-1.050-1.975-2.35-2.206-2.744s-0.025-0.613 0.175-0.806c0.181-0.175 0.394-0.463 0.594-0.694s0.262-0.394 0.394-0.662c0.131-0.262 0.069-0.494-0.031-0.694s-0.894-2.15-1.219-2.944c-0.319-0.775-0.65-0.669-0.894-0.681-0.231-0.012-0.494-0.012-0.756-0.012s-0.694 0.1-1.056 0.494c-0.363 0.394-1.387 1.356-1.387 3.306s1.419 3.831 1.619 4.1c0.2 0.262 2.794 4.269 6.769 5.981 0.944 0.406 1.681 0.65 2.256 0.837 0.95 0.3 1.813 0.256 2.494 0.156 0.762-0.113 2.344-0.956 2.675-1.881s0.331-1.719 0.231-1.881c-0.094-0.175-0.356-0.275-0.756-0.475z"></path>\n</svg>\n';var phone='\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>phone</title>\n<path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>\n</svg>\n';var telegram='\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>paper-plane-o</title>\n<path d="M31.5 0.482c0.375 0.268 0.554 0.696 0.482 1.143l-4.571 27.429c-0.054 0.339-0.268 0.625-0.571 0.804-0.161 0.089-0.357 0.143-0.554 0.143-0.143 0-0.286-0.036-0.429-0.089l-9.411-3.839-5.321 5.839c-0.214 0.25-0.518 0.375-0.839 0.375-0.143 0-0.286-0.018-0.411-0.071-0.446-0.179-0.732-0.607-0.732-1.071v-8.071l-8.429-3.446c-0.411-0.161-0.679-0.536-0.714-0.982-0.036-0.429 0.196-0.839 0.571-1.054l29.714-17.143c0.375-0.232 0.857-0.214 1.214 0.036zM25.393 27.25l3.946-23.625-25.607 14.768 6 2.446 15.411-11.411-8.536 14.232z"></path>\n</svg>\n';var sallaContactsCss=".unicode{unicode-bidi:-webkit-plaintext;unicode-bidi:plaintext}";var SallaContacts=function(){function t(t){var e=this;registerInstance(this,t);var n;this.contactsTitle=undefined;this.hideTitle=undefined;this.isHeader=undefined;this.horizontal=undefined;this.iconsOnly=undefined;this.contacts=salla.config.get("store.contacts");this.iconsList={mobile:mobile,whatsapp:whatsapp,phone:phone,telegram:telegram,email:email};this.contactSlot=((n=this.host.querySelector('[slot="contact"]'))===null||n===void 0?void 0:n.innerHTML)||'<a href={link} class="s-contacts-item"><span class="s-contacts-icon">{icon}</span>'.concat(!this.iconsOnly&&"<span class='unicode'>{value}</span>","</a>");salla.onReady((function(){e.contacts=salla.config.get("store.contacts")}));salla.lang.onLoaded((function(){e.contactsTitle=e.contactsTitle||salla.lang.get("blocks.footer.social")}))}t.prototype.getContactsArray=function(){return Object.entries(this.contacts).filter((function(t){var e=t[0],n=t[1];return n!==""})).map((function(t){var e=t[0],n=t[1];return{type:e,value:n}}))};t.prototype.getContactLink=function(t){switch(t){case"phone":return"tel:".concat(this.contacts[t]);case"mobile":return"tel:".concat(this.contacts[t]);case"whatsapp":return salla.url.get("whatsapp/send");case"email":return"mailto:".concat(this.contacts[t]);case"telegram":return"https://t.me/".concat(this.contacts[t]);default:return this.contacts[t]}};t.prototype.getContactIcon=function(t){return this.iconsList[t]};t.prototype.render=function(){var t=this;var e=this.getContactsArray();if(this.isHeader&&e&&e.length>0){return h(Host,{class:"s-contacts s-contacts-header"},e.filter((function(t){return t.type=="phone"||t.type=="email"})).map((function(e,n){return h("a",{href:t.getContactLink(e.type),key:n,class:"s-contacts-topnav-link"},e.type==="email"?e.value:[h("span",null,t.contactsTitle,": "),h("a",{class:"unicode",href:t.iconsList[e.type]},e.value)])})))}return h(Host,{class:"s-contacts"},!this.hideTitle&&h("h3",{class:"s-contacts-title"},this.contactsTitle),h("div",{class:{"s-contacts-list":true,"s-contacts-list-horizontal":this.horizontal,"s-contacts-list-vertical":!this.horizontal,"s-contacts-list-icons-only":this.iconsOnly}},e.map((function(e,n){return h("div",{key:n,id:"contact-slot",innerHTML:t.contactSlot.replace(/\{icon\}/g,t.getContactIcon(e.type)).replace(/\{value\}/g,e.value.toString()).replace(/\{link\}/g,t.getContactLink(e.type))})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="contact"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaContacts.style=sallaContactsCss;export{SallaContacts as salla_contacts};
5
5
  //# sourceMappingURL=salla-contacts.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,e,i,n){function s(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function o(t){try{l(n.next(t))}catch(t){r(t)}}function a(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?i(t.value):s(t.value).then(o,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];s=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{H as Helper}from"./Helper-17531428.js";import{F as FilterOptionTypes}from"./interfaces-3159d022.js";var sallaFiltersWidgetCss=":host{display:block}";var SallaFiltersWidget=function(){function t(t){registerInstance(this,t);this.changed=createEvent(this,"changed",7);this.initHeight=195;this.withLoadMore=undefined;this.filtersData=undefined;this.option=undefined;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(t){if(t===void 0){t=250}return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=e.widgetContent.offsetHeight;e.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===FilterOptionTypes.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isOpen=!this.isOpen;Helper.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var e=this;if(![FilterOptionTypes.VALUES,FilterOptionTypes.MINIMUM,FilterOptionTypes.VARIANTS].includes(t.type)){return""}return t.values.map((function(i,n){var s=typeof i=="number"?i:i.key||i.value;return h("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(n)},h("input",{id:"".concat(t.key,"-option-").concat(n),name:t.key,type:"radio",checked:e.isSelectedOption(t,s),class:"s-filters-radio",onChange:function(i){return e.changed.emit({event:i,option:t,value:s})}}),e.getOptionLabel(t,i))}))};t.prototype.isSelectedOption=function(t,e){if(t.type===FilterOptionTypes.MINIMUM){return this.filtersData[t.key]==e}if(t.type===FilterOptionTypes.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==e}if(t.type===FilterOptionTypes.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==e.min&&this.filtersData[t.key].max==e.max}if(t.type===FilterOptionTypes.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(e)}return false};t.prototype.getOptionLabel=function(t,e){if(t.key=="rating"){return h("salla-rating-stars",{size:"small",value:e})}var i=e.value||"null";return h("span",{class:"s-filters-option-name"},i)};t.prototype.render=function(){var t=this;return h(Host,{class:"s-filters-widget-container"},h("h3",{class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},h("span",null,this.option.label),h("span",{class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),h("div",{class:"s-filters-widget-content",ref:function(e){return t.widgetContent=e}},h("div",{class:"s-filters-widget-values",ref:function(e){return t.widgetValues=e}},h("slot",null),this.option.type!==FilterOptionTypes.RANGE?this.renderFilterOption(this.option):h("salla-price-range",{onChanged:function(e){return t.changed.emit(e.detail)},ref:function(e){return t.priceRange=e},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&h("a",{class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFiltersWidget.style=sallaFiltersWidgetCss;export{SallaFiltersWidget as salla_filters_widget};
4
+ */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-9a9b1e67.js";import{H as Helper}from"./Helper-17531428.js";import{F as FilterOptionTypes}from"./interfaces-3159d022.js";var sallaFiltersWidgetCss=":host{display:block}";var SallaFiltersWidget=function(){function t(t){registerInstance(this,t);this.changed=createEvent(this,"changed",7);this.initHeight=195;this.withLoadMore=undefined;this.filtersData=undefined;this.option=undefined;this.isOpen=true;this.isShowMore=false;this.showMoreLabel="عرض المزيد";this.showLessLabel="عرض أقل";this.page=salla.config.get("page")}t.prototype.connectedCallback=function(){var t=this;this.withLoadMore=this.option.key!="price"&&Array.isArray(this.option.values)&&this.option.values.length>8;salla.onReady((function(){t.page=salla.config.get("page")}));salla.lang.onLoaded((function(){t.showMoreLabel=salla.lang.getWithDefault("common.titles.more",t.showMoreLabel);t.showLessLabel=salla.lang.getWithDefault("common.elements.show_less",t.showLessLabel)}))};t.prototype.componentDidLoad=function(){this.widgetValues.scrollHeight<this.initHeight&&(this.withLoadMore=false);this.withLoadMore&&this.widgetValues&&(this.widgetValues.style.maxHeight="".concat(this.initHeight,"px"));this.widgetContent.style.height="".concat(this.widgetContent.scrollHeight,"px")};t.prototype.setWidgetHeight=function(t){if(t===void 0){t=250}return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){this.widgetContent.removeAttribute("style");setTimeout((function(){var t=e.widgetContent.offsetHeight;e.widgetContent.style.height=t+"px"}),t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.option.type===FilterOptionTypes.RANGE){this.priceRange.reset()}Array.from(this.host.querySelectorAll("input")).forEach((function(t){return t.checked=false}));return[2]}))}))};t.prototype.showMore=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isShowMore=!this.isShowMore;this.widgetContent.style.height="auto";this.widgetValues.style.maxHeight=this.isShowMore?"".concat(this.widgetValues.scrollHeight,"px"):"".concat(this.initHeight,"px");setTimeout((function(){t.widgetContent.style.height="".concat(t.widgetContent.scrollHeight,"px")}),400);return[2]}))}))};t.prototype.toggleWidget=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.isOpen=!this.isOpen;Helper.toggleElementClassIf(this.widgetContent,"s-filters-widget-opened","s-filters-widget-closed",(function(){return t.isOpen}));return[2]}))}))};t.prototype.renderFilterOption=function(t){var e=this;if(![FilterOptionTypes.VALUES,FilterOptionTypes.MINIMUM,FilterOptionTypes.VARIANTS].includes(t.type)){return""}return t.values.map((function(i,n){var s=typeof i=="number"?i:i.key||i.value;return h("label",{class:"s-filters-label",htmlFor:"".concat(t.key,"-option-").concat(n)},h("input",{id:"".concat(t.key,"-option-").concat(n),name:t.key,type:"radio",checked:e.isSelectedOption(t,s),class:"s-filters-radio",onChange:function(i){return e.changed.emit({event:i,option:t,value:s})}}),e.getOptionLabel(t,i))}))};t.prototype.isSelectedOption=function(t,e){if(t.type===FilterOptionTypes.MINIMUM){return this.filtersData[t.key]==e}if(t.type===FilterOptionTypes.VARIANTS){return this.filtersData[t.type]&&this.filtersData[t.type][Object.keys(this.filtersData[t.type])[0]]==e}if(t.type===FilterOptionTypes.RANGE){return this.filtersData[t.key]&&this.filtersData[t.key].min==e.min&&this.filtersData[t.key].max==e.max}if(t.type===FilterOptionTypes.VALUES){return this.filtersData[t.key]&&Number(this.filtersData[t.key])==Number(e)}return false};t.prototype.getOptionLabel=function(t,e){if(t.key=="rating"){return h("salla-rating-stars",{size:"small",value:e})}var i=e.value||"null";return h("span",{class:"s-filters-option-name"},i)};t.prototype.render=function(){var t=this;return h(Host,{class:"s-filters-widget-container"},h("h3",{class:"s-filters-widget-title",onClick:function(){return t.toggleWidget()}},h("span",null,this.option.label),h("span",{class:"s-filters-widget-plusminus ".concat(this.isOpen?"s-filters-widget-plusminus-active":"")})),h("div",{class:"s-filters-widget-content",ref:function(e){return t.widgetContent=e}},h("div",{class:"s-filters-widget-values",ref:function(e){return t.widgetValues=e}},h("slot",null),this.option.type!==FilterOptionTypes.RANGE?this.renderFilterOption(this.option):h("salla-price-range",{onChanged:function(e){return t.changed.emit(e.detail)},ref:function(e){return t.priceRange=e},filtersData:this.filtersData,option:this.option})),this.withLoadMore&&h("a",{class:"s-filters-widget-more",onClick:function(){return t.showMore()}},!this.isShowMore?this.showMoreLabel:this.showLessLabel)))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFiltersWidget.style=sallaFiltersWidgetCss;export{SallaFiltersWidget as salla_filters_widget};
5
5
  //# sourceMappingURL=salla-filters-widget.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,e,r,a){function i(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function s(t){try{l(a.next(t))}catch(t){n(t)}}function o(t){try{l(a["throw"](t))}catch(t){n(t)}}function l(t){t.done?r(t.value):i(t.value).then(s,o)}l((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,i,n,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(t){return function(e){return l([t,e])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(r=0)),r)try{if(a=1,i&&(n=o[0]&2?i["return"]:o[0]?i["throw"]||((n=i["return"])&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;if(i=0,n)o=[o[0]&2,n.value];switch(o[0]){case 0:case 1:n=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!n||o[1]>n[0]&&o[1]<n[3])){r.label=o[1];break}if(o[0]===6&&r.label<n[1]){r.label=n[1];n=o;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(o);break}if(n[2])r.ops.pop();r.trys.pop();continue}o=e.call(t,r)}catch(t){o=[6,t];i=0}finally{a=n=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
- */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-e6c3f002.js";import{F as FilterOptionTypes}from"./interfaces-3159d022.js";import{H as Helper}from"./Helper-17531428.js";var sallaFiltersCss=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var SallaFilters=function(){function t(t){var e=this;registerInstance(this,t);this.changed=createEvent(this,"changed",7);this.isReady=false;this.filters=undefined;this.isSidebarOpen=undefined;this.filtersData={};this.apply=undefined;this.reset=undefined;salla.event.on("filters::hidden",(function(){return e.host.style.display="none"}));salla.lang.onLoaded((function(){e.apply=salla.lang.get("pages.checkout.apply");e.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;e.host.style.display="";var a={};e.filters=r.map((function(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=FilterOptionTypes.VALUES;var r=t.values,i=r.max,n=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=n||t<=i}))}if(e.filtersData.variants&&t.type==FilterOptionTypes.VARIANTS){a.variants=e.filtersData.variants}if(e.filtersData[t.key]&&t.type!==FilterOptionTypes.VARIANTS){a[t.key]=e.filtersData[t.key]}var s=new URLSearchParams(window.location.search);var o=false;for(var l=0,c=s.keys();l<c.length;l++){var f=c[l];if(f.includes("filters")){o=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(a).length==0&&!o){var u=window.location.href;var h=salla.config.get("page.id");var p=u.indexOf("?")!==-1?"&":"?";var d=u+p+"filters[category_id]="+h;a.category_id=h;window.history.pushState({path:d},"",d)}return t}));e.filtersData=a;e.host.childNodes.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:e=t.setWidgetHeight;if(!e)return[3,2];return[4,t.setWidgetHeight()];case 1:e=r.sent();r.label=2;case 2:return[2,e]}}))}))}))}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);t=new URLSearchParams(window.location.search);e=this;return[4,Helper.extractFiltersFromUrl(t)];case 1:e.filtersData=a.sent();return[3,3];case 2:r=a.sent();console.warn("failed to get filters from URL",r.message);return[3,3];case 3:return[2]}}))}))};t.prototype.getFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.filtersData]}))}))};t.prototype.applyFilters=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(r){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var r;if(t){var a=new URL(window.location.href);for(var i=0,n=a.searchParams.entries();i<n.length;i++){var s=n[i][0];if(s.startsWith("filters")){a.searchParams.delete(s)}}var o=e.encodeFilters(e.filtersData);var l=a.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(!!l){a.search=a.search.split("&filters")[0]+"&"+o}else{a.search="?".concat(o)}window.history.pushState({},"",a.href)}else{var a=new URL(window.location.href);(r=a.searchParams)===null||r===void 0?void 0:r.delete("filters");window.history.pushState({},"",a.toString())}salla.event.emit("salla-filters::changed",e.filtersData);e.changed.emit(e.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,e){if(e===void 0){e="filters"}var r=[];for(var a in t){if(Object.prototype.hasOwnProperty.call(t,a)){var i=t[a];var n=e?"".concat(e,"[").concat(a,"]"):a;if(Array.isArray(i)){for(var s=0;s<i.length;s++){r.push("".concat(n,"[").concat(s,"]=").concat(i[s]))}}else if(typeof i==="object"&&i!==null){r.push(this.encodeFilters(i,n))}else{var o="".concat(n,"=").concat(i);r.push(o)}}}return r.join("&")};t.prototype.resetFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((function(t){return t.reset&&t.reset()}));salla.event.emit("salla-filters::reset");return[2,this.applyFilters()]}))}))};t.prototype.removeFiltersQueryParams=function(){var t=new URLSearchParams(window.location.search);var e=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t.get(e)))})).join("&");var r=e?"".concat(window.location.pathname,"?").concat(e):window.location.pathname;window.history.pushState({},"",r)};t.prototype.handleOptionChange=function(t,e,r){if(e.type===FilterOptionTypes.RANGE){this.filtersData[e.key]=r}var a=t.target.checked;if(e.type===FilterOptionTypes.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};a&&(this.filtersData.variants[e.key]=r);a||delete this.filtersData.variants[e.key]}else if(t.target.type=="radio"){a&&(this.filtersData[e.key]=r);a||delete this.filtersData[e.key]}else if(t.target.type=="checkbox"){this.filtersData[e.key]=this.filtersData[e.key]||[];if(a){this.filtersData[e.key].push(r)}this.filtersData[e.key]=this.filtersData[e.key].filter((function(t){return t!=r}))}this.applyFilters()};t.prototype.render=function(){var t=this;var e,r;return h(Host,null,(e=this.filters)===null||e===void 0?void 0:e.map((function(e){return h("salla-filters-widget",{option:e,filtersData:t.filtersData,onChanged:function(e){var r=e.detail,a=r.event,i=r.option,n=r.value;return t.handleOptionChange(a,i,n)}})})),((r=this.filters)===null||r===void 0?void 0:r.length)?h("div",{class:"s-filters-footer"},h("salla-button",{color:"gray",fill:"outline",onClick:function(){return t.resetFilters()}},this.reset)):"")};t.prototype.componentDidLoad=function(){this.isReady=true};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFilters.style=sallaFiltersCss;export{SallaFilters as salla_filters};
4
+ */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-9a9b1e67.js";import{F as FilterOptionTypes}from"./interfaces-3159d022.js";import{H as Helper}from"./Helper-17531428.js";var sallaFiltersCss=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";var SallaFilters=function(){function t(t){var e=this;registerInstance(this,t);this.changed=createEvent(this,"changed",7);this.isReady=false;this.filters=undefined;this.isSidebarOpen=undefined;this.filtersData={};this.apply=undefined;this.reset=undefined;salla.event.on("filters::hidden",(function(){return e.host.style.display="none"}));salla.lang.onLoaded((function(){e.apply=salla.lang.get("pages.checkout.apply");e.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(function(t){var r=t.filters;e.host.style.display="";var a={};e.filters=r.map((function(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=FilterOptionTypes.VALUES;var r=t.values,i=r.max,n=r.min;t.values=[5,4,3,2,1].filter((function(t){return t>=n||t<=i}))}if(e.filtersData.variants&&t.type==FilterOptionTypes.VARIANTS){a.variants=e.filtersData.variants}if(e.filtersData[t.key]&&t.type!==FilterOptionTypes.VARIANTS){a[t.key]=e.filtersData[t.key]}var s=new URLSearchParams(window.location.search);var o=false;for(var l=0,c=s.keys();l<c.length;l++){var f=c[l];if(f.includes("filters")){o=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(a).length==0&&!o){var u=window.location.href;var h=salla.config.get("page.id");var p=u.indexOf("?")!==-1?"&":"?";var d=u+p+"filters[category_id]="+h;a.category_id=h;window.history.pushState({path:d},"",d)}return t}));e.filtersData=a;e.host.childNodes.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:e=t.setWidgetHeight;if(!e)return[3,2];return[4,t.setWidgetHeight()];case 1:e=r.sent();r.label=2;case 2:return[2,e]}}))}))}))}))}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);t=new URLSearchParams(window.location.search);e=this;return[4,Helper.extractFiltersFromUrl(t)];case 1:e.filtersData=a.sent();return[3,3];case 2:r=a.sent();console.warn("failed to get filters from URL",r.message);return[3,3];case 3:return[2]}}))}))};t.prototype.getFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.filtersData]}))}))};t.prototype.applyFilters=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(r){if(!this.isReady){return[2]}t=Object.keys(this.filtersData).length>0;setTimeout((function(){var r;if(t){var a=new URL(window.location.href);for(var i=0,n=a.searchParams.entries();i<n.length;i++){var s=n[i][0];if(s.startsWith("filters")){a.searchParams.delete(s)}}var o=e.encodeFilters(e.filtersData);var l=a.search.split("&").filter((function(t){return!t.includes("filters")})).join("&");if(!!l){a.search=a.search.split("&filters")[0]+"&"+o}else{a.search="?".concat(o)}window.history.pushState({},"",a.href)}else{var a=new URL(window.location.href);(r=a.searchParams)===null||r===void 0?void 0:r.delete("filters");window.history.pushState({},"",a.toString())}salla.event.emit("salla-filters::changed",e.filtersData);e.changed.emit(e.filtersData)}),300);return[2]}))}))};t.prototype.encodeFilters=function(t,e){if(e===void 0){e="filters"}var r=[];for(var a in t){if(Object.prototype.hasOwnProperty.call(t,a)){var i=t[a];var n=e?"".concat(e,"[").concat(a,"]"):a;if(Array.isArray(i)){for(var s=0;s<i.length;s++){r.push("".concat(n,"[").concat(s,"]=").concat(i[s]))}}else if(typeof i==="object"&&i!==null){r.push(this.encodeFilters(i,n))}else{var o="".concat(n,"=").concat(i);r.push(o)}}}return r.join("&")};t.prototype.resetFilters=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((function(t){return t.reset&&t.reset()}));salla.event.emit("salla-filters::reset");return[2,this.applyFilters()]}))}))};t.prototype.removeFiltersQueryParams=function(){var t=new URLSearchParams(window.location.search);var e=Array.from(t.keys()).filter((function(t){return!t.startsWith("filters[")})).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t.get(e)))})).join("&");var r=e?"".concat(window.location.pathname,"?").concat(e):window.location.pathname;window.history.pushState({},"",r)};t.prototype.handleOptionChange=function(t,e,r){if(e.type===FilterOptionTypes.RANGE){this.filtersData[e.key]=r}var a=t.target.checked;if(e.type===FilterOptionTypes.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};a&&(this.filtersData.variants[e.key]=r);a||delete this.filtersData.variants[e.key]}else if(t.target.type=="radio"){a&&(this.filtersData[e.key]=r);a||delete this.filtersData[e.key]}else if(t.target.type=="checkbox"){this.filtersData[e.key]=this.filtersData[e.key]||[];if(a){this.filtersData[e.key].push(r)}this.filtersData[e.key]=this.filtersData[e.key].filter((function(t){return t!=r}))}this.applyFilters()};t.prototype.render=function(){var t=this;var e,r;return h(Host,null,(e=this.filters)===null||e===void 0?void 0:e.map((function(e){return h("salla-filters-widget",{option:e,filtersData:t.filtersData,onChanged:function(e){var r=e.detail,a=r.event,i=r.option,n=r.value;return t.handleOptionChange(a,i,n)}})})),((r=this.filters)===null||r===void 0?void 0:r.length)?h("div",{class:"s-filters-footer"},h("salla-button",{color:"gray",fill:"outline",onClick:function(){return t.resetFilters()}},this.reset)):"")};t.prototype.componentDidLoad=function(){this.isReady=true};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaFilters.style=sallaFiltersCss;export{SallaFilters as salla_filters};
5
5
  //# sourceMappingURL=salla-filters.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";var sallaInstallmentCss='salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper{font-family:"Noto Sans Arabic", sans-serif;font-size:14px;text-align:right;padding:24px 20px 24px 0px;gap:42px;direction:rtl;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;border:1px solid var(--07--Light-Theme-Gray-color-gray-300, #EEE);margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin:15px !important}.s-installment-mispay-content-text{color:#292929;margin:0 16px 0 0;width:80%;position:absolute;left:14px;text-align:left}.s-installment-mispay-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto;position:absolute}.rtl .s-installment-mispay-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img{left:14px !important}.ltr .s-installment-mispay-content img{right:14px !important}';var SallaInstallment=function(){function t(t){var e=this;registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.price=undefined;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.tamaraIsActive=undefined;this.tabbyIsActive=undefined;this.spotiiIsActive=undefined;this.mispayActive=undefined;this.installment_sheria_text=function(t){return salla.lang.get("pages.products.installments",t)};salla.lang.onLoaded((function(){e.installment_sheria_text({payment:salla.money(parseFloat(e.price)),amount:salla.money(parseFloat(e.price)/3),installments:3});var t=salla.config.get("store.settings.installments");if(t){e.tamaraIsActive=t.includes("tamara_installment");e.tabbyIsActive=t.includes("tabby_installment");e.spotiiIsActive=t.includes("spotii_pay");e.mispayActive=t.includes("mispay_installment")}e.renderInstallments()}));salla.event.on("product::price.updated",(function(t){var a=t.data;if(!a.price||a.price==e.price){return}e.price=a.price;e.renderInstallments(true)}))}t.prototype.render=function(){return h(Host,null,this.tamaraIsActive?h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"",this.mispayActive?h("div",{class:"s-installment-mispay-wrapper"},h("div",{class:"s-installment-mispay-content"},h("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),h("span",{class:"s-installment-mispay-content-text"},this.installment_sheria_text({payment:salla.money(parseFloat(this.price)),amount:salla.money(parseFloat(this.price)/3),installments:3})))):"")};t.prototype.renderInstallments=function(t){var e=this;if(t===void 0){t=false}if(this.tamaraIsActive){if(t){var a=document.querySelector('script[src="https://cdn.tamara.co/widget/product-widget.min.js"]');if(a){a.remove()}}var i=document.createElement("script");i.setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js");document.head.appendChild(i);i.onload=function(){window.TamaraProductWidget.init({lang:e.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}}if(this.tabbyIsActive){if(t){var r=this.host.querySelector("#tabbyPromoWrapper");if(r){r.remove()}var o=document.createElement("div");o.setAttribute("id","tabbyPromoWrapper");var s=document.createElement("div");s.setAttribute("id","tabbyPromo");o.appendChild(s);this.host.appendChild(o);var n=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(n){n.remove()}}var p=document.createElement("script");p.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(p);p.onload=function(){var t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:e.currency,price:e.price,lang:e.language});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var l=this.host.querySelector(".spotii-wrapper");if(l){l.remove()}var b=document.createElement("div");b.classList.add("spotii-wrapper");var m=document.createElement("div");m.classList.add("spotii-promo");b.appendChild(m);this.host.appendChild(b);var d=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(d){d.remove()}}var c=salla.money((Number(this.price)/3).toFixed(2));var u=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+c+"${logo} ${info}",textOne:u?"جزء الدفع على":"Split it into",textTwo:u?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var g=document.createElement("script");g.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(g)}};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var e=document.querySelector("#tabbyPromo>div>div");e=e?e.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(e){e.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-9a9b1e67.js";var sallaInstallmentCss='salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;-webkit-box-shadow:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper{font-family:"Noto Sans Arabic", sans-serif;font-size:14px;text-align:right;padding:24px 20px 24px 0px;gap:42px;direction:rtl;line-height:22px;color:rgb(0, 0, 0);min-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;border:1px solid var(--07--Light-Theme-Gray-color-gray-300, #EEE);margin:15px 0;display:-ms-flexbox;display:flex;-webkit-transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1), -webkit-box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover{-webkit-box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922);box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin:15px !important}.s-installment-mispay-content-text{color:#292929;margin:0 16px 0 0;width:80%;position:absolute;left:14px;text-align:left}.s-installment-mispay-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto;position:absolute}.rtl .s-installment-mispay-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img{left:14px !important}.ltr .s-installment-mispay-content img{right:14px !important}';var SallaInstallment=function(){function t(t){var e=this;registerInstance(this,t);this.tabbyBorderRemoved=false;this.tabbyRemoveBorderTries=0;this.price=undefined;this.language=salla.config.get("user.language_code");this.currency=salla.config.get("user.currency_code");this.tamaraIsActive=undefined;this.tabbyIsActive=undefined;this.spotiiIsActive=undefined;this.mispayActive=undefined;this.installment_sheria_text=function(t){return salla.lang.get("pages.products.installments",t)};salla.lang.onLoaded((function(){e.installment_sheria_text({payment:salla.money(parseFloat(e.price)),amount:salla.money(parseFloat(e.price)/3),installments:3});var t=salla.config.get("store.settings.installments");if(t){e.tamaraIsActive=t.includes("tamara_installment");e.tabbyIsActive=t.includes("tabby_installment");e.spotiiIsActive=t.includes("spotii_pay");e.mispayActive=t.includes("mispay_installment")}e.renderInstallments()}));salla.event.on("product::price.updated",(function(t){var a=t.data;if(!a.price||a.price==e.price){return}e.price=a.price;e.renderInstallments(true)}))}t.prototype.render=function(){return h(Host,null,this.tamaraIsActive?h("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?h("div",{id:"tabbyPromoWrapper"},h("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?h("div",{class:"spotii-wrapper"},h("div",{class:"spotii-promo"})):"",this.mispayActive?h("div",{class:"s-installment-mispay-wrapper"},h("div",{class:"s-installment-mispay-content"},h("img",{src:salla.url.cdn("images/payment/png/mispay.png"),alt:"mispay"}),h("span",{class:"s-installment-mispay-content-text"},this.installment_sheria_text({payment:salla.money(parseFloat(this.price)),amount:salla.money(parseFloat(this.price)/3),installments:3})))):"")};t.prototype.renderInstallments=function(t){var e=this;if(t===void 0){t=false}if(this.tamaraIsActive){if(t){var a=document.querySelector('script[src="https://cdn.tamara.co/widget/product-widget.min.js"]');if(a){a.remove()}}var i=document.createElement("script");i.setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js");document.head.appendChild(i);i.onload=function(){window.TamaraProductWidget.init({lang:e.language});setTimeout((function(){window.TamaraProductWidget.render()}),300)}}if(this.tabbyIsActive){if(t){var r=this.host.querySelector("#tabbyPromoWrapper");if(r){r.remove()}var o=document.createElement("div");o.setAttribute("id","tabbyPromoWrapper");var s=document.createElement("div");s.setAttribute("id","tabbyPromo");o.appendChild(s);this.host.appendChild(o);var n=document.querySelector('script[src="https://checkout.tabby.ai/tabby-promo.js"]');if(n){n.remove()}}var p=document.createElement("script");p.setAttribute("src","https://checkout.tabby.ai/tabby-promo.js");document.head.appendChild(p);p.onload=function(){var t=window.TabbyPromo;new t({selector:"#tabbyPromo",currency:e.currency,price:e.price,lang:e.language});document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))};this.removeTabbyBorder()}if(this.spotiiIsActive){if(t){var l=this.host.querySelector(".spotii-wrapper");if(l){l.remove()}var b=document.createElement("div");b.classList.add("spotii-wrapper");var m=document.createElement("div");m.classList.add("spotii-promo");b.appendChild(m);this.host.appendChild(b);var d=document.querySelector('script[src="'+salla.url.cdn("js/price-widget-ar-salla.js")+'"]');if(d){d.remove()}}var c=salla.money((Number(this.price)/3).toFixed(2));var u=salla.config.get("theme.is_rtl",true);window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:3,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+c+"${logo} ${info}",textOne:u?"جزء الدفع على":"Split it into",textTwo:u?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price};var g=document.createElement("script");g.setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js"));document.head.appendChild(g)}};t.prototype.removeTabbyBorder=function(){var t=this;if(this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5){return}this.tabbyRemoveBorderTries++;setTimeout((function(){var e=document.querySelector("#tabbyPromo>div>div");e=e?e.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null;if(e){e.style="border: none; margin: 15px 0!important;";t.tabbyBorderRemoved=true}else{t.removeTabbyBorder()}}),this.tabbyRemoveBorderTries*500)};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaInstallment.style=sallaInstallmentCss;export{SallaInstallment as salla_installment};
5
5
  //# sourceMappingURL=salla-installment.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,c as createEvent,h,H as Host}from"./index-e6c3f002.js";var sallaLoyaltyPrizeItemCss="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 SallaLoyaltyPrizeItem=function(){function t(t){registerInstance(this,t);this.prizeItemSelected=createEvent(this,"prizeItemSelected",7);this.item=undefined}t.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};t.prototype.render=function(){return h(Host,null,h("div",{onClick:this.onPrizeItemClick.bind(this)},h("img",{class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),h("div",{class:"s-loyalty-prize-item-title"},this.item.name),h("div",{class:"s-loyalty-prize-item-subtitle"},this.item.description),h("div",{class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return t}();SallaLoyaltyPrizeItem.style=sallaLoyaltyPrizeItemCss;export{SallaLoyaltyPrizeItem as salla_loyalty_prize_item};
4
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9a9b1e67.js";var sallaLoyaltyPrizeItemCss="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 SallaLoyaltyPrizeItem=function(){function t(t){registerInstance(this,t);this.prizeItemSelected=createEvent(this,"prizeItemSelected",7);this.item=undefined}t.prototype.onPrizeItemClick=function(){this.prizeItemSelected.emit(this.item)};t.prototype.render=function(){return h(Host,null,h("div",{onClick:this.onPrizeItemClick.bind(this)},h("img",{class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),h("div",{class:"s-loyalty-prize-item-title"},this.item.name),h("div",{class:"s-loyalty-prize-item-subtitle"},this.item.description),h("div",{class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))};return t}();SallaLoyaltyPrizeItem.style=sallaLoyaltyPrizeItemCss;export{SallaLoyaltyPrizeItem as salla_loyalty_prize_item};
5
5
  //# sourceMappingURL=salla-loyalty-prize-item.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h}from"./index-e6c3f002.js";var sallaNotificationsCss="";var SallaNotificationItem=function(){function i(i){registerInstance(this,i);this.notification=undefined}i.prototype.render=function(){return h("a",{href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-read":!this.notification.is_new}},h("span",{class:"s-notifications-item-icon"},h("i",{class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),h("div",{class:"s-notifications-item-content"},h("div",{class:"s-notifications-item-content-leading"},h("h4",null,this.notification.title),h("p",null,this.notification.sub_title)),h("span",{class:"s-notifications-item-content-trailing"},h("i",{class:"sicon-time s-notifications-item-content-trailing-icon"}),h("span",null,this.notification.date))))};return i}();SallaNotificationItem.style=sallaNotificationsCss;export{SallaNotificationItem as salla_notification_item};
4
+ import{r as registerInstance,h}from"./index-9a9b1e67.js";var sallaNotificationsCss="";var SallaNotificationItem=function(){function i(i){registerInstance(this,i);this.notification=undefined}i.prototype.render=function(){return h("a",{href:this.notification.url,class:{"s-notifications-item":true,"s-notifications-item-read":!this.notification.is_new}},h("span",{class:"s-notifications-item-icon"},h("i",{class:{"s-notifications-item-icon sicon-bell-ring":true,"s-notifications-item-icon-new":this.notification.is_new}})),h("div",{class:"s-notifications-item-content"},h("div",{class:"s-notifications-item-content-leading"},h("h4",null,this.notification.title),h("p",null,this.notification.sub_title)),h("span",{class:"s-notifications-item-content-trailing"},h("i",{class:"sicon-time s-notifications-item-content-trailing-icon"}),h("span",null,this.notification.date))))};return i}();SallaNotificationItem.style=sallaNotificationsCss;export{SallaNotificationItem as salla_notification_item};
5
5
  //# sourceMappingURL=salla-notification-item.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,a){function r(t){try{s(i.next(t))}catch(t){a(t)}}function l(t){try{s(i["throw"](t))}catch(t){a(t)}}function s(t){t.done?e(t.value):o(t.value).then(r,l)}s((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,o,a,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(t){return function(n){return s([t,n])}}function s(l){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(e=0)),e)try{if(i=1,o&&(a=l[0]&2?o["return"]:l[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;if(o=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:e.label++;return{value:l[1],done:false};case 5:e.label++;o=l[1];l=[0];continue;case 7:l=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1];a=l;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(l);break}if(a[2])e.ops.pop();e.trys.pop();continue}l=n.call(t,e)}catch(t){l=[6,t];o=0}finally{i=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */import{r as registerInstance,h,g as getElement}from"./index-e6c3f002.js";import{H as Helper}from"./Helper-17531428.js";import{a as anime}from"./anime.es-6b92d9cd.js";var sallaNotificationsCss="";var SallaNotifications=function(){function t(t){var n=this;registerInstance(this,t);this.loadMoreText=undefined;this.itemPerPage=10;this.notifications=[];this.pagination=undefined;this.hasInfiniteScroll=undefined;this.total=undefined;this.showPlaceholder=undefined;this.nextPage=undefined;this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more");salla.lang.onLoaded((function(){n.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");n.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var n;var e=(n=this.status)===null||n===void 0?void 0:n.querySelector(".s-button-text");if(e){Helper.toggleElementClassIf(e,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.getNotificationCard=function(t){var n=document.createElement("salla-notification-item");n.notification=t;n.classList.add("s-block");return n};t.prototype.render=function(){var t=this;var n;if(this.showPlaceholder){return h("div",{class:"s-notifications-no-content"},h("salla-placeholder",{alignment:"center"},h("span",{slot:"title"},this.no_notifications_trans)))}return h("div",{class:"s-notifications-wrapper"},h("div",{class:"s-notifications-container",ref:function(n){return t.wrapper=n}}),this.hasInfiniteScroll&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(n){return t.status=n}},h("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},(n=this.loadMoreText)!==null&&n!==void 0?n:this.load_more_text_trans),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(n){return t.btnLoader=n},style:{display:"none"}}))))};t.prototype.handleResponse=function(t){var n=this;return t.map((function(t){return n.getNotificationCard(t)}))};t.prototype.initiateInfiniteScroll=function(){var t=this;var n,e,i;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false,status:this.status,button:this.status.querySelector(".s-infinite-scroll-btn")},true);(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("request",(function(n){t.loading()}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(n){var e;t.loading(false);t.pagination=n.pagination;t.nextPage=((e=n.pagination.links)===null||e===void 0?void 0:e.next)||null;t.handleResponse(n.data);var i=t.host.querySelectorAll("salla-notification-item:not(.animated)");t.animateItems(i)}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.animateItems=function(t){anime({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,n){return n*100},easing:"easeOutExpo",complete:function(n){t.forEach((function(t){t.classList.add("animated")}))}})};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.api.notifications.fetch({per_page:this.itemPerPage}).then((function(n){var e;t.notifications=n.data;t.hasInfiniteScroll=!!n.pagination.links.next;t.pagination=n.pagination;t.total=n.pagination.total;t.nextPage=((e=n.pagination.links)===null||e===void 0?void 0:e.next)||null;setTimeout((function(){t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));t.initiateInfiniteScroll();var e=t.wrapper.querySelectorAll("salla-notification-item:not(.animated)");t.animateItems(e)}),100)})).catch((function(n){salla.logger.error(n);t.showPlaceholder=true;t.loading(false)}))];case 1:n.sent();return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.loadInitialData()];case 1:t.sent();return[2]}}))}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaNotifications.style=sallaNotificationsCss;export{SallaNotifications as salla_notifications};
4
+ */import{r as registerInstance,h,g as getElement}from"./index-9a9b1e67.js";import{H as Helper}from"./Helper-17531428.js";import{a as anime}from"./anime.es-6b92d9cd.js";var sallaNotificationsCss="";var SallaNotifications=function(){function t(t){var n=this;registerInstance(this,t);this.loadMoreText=undefined;this.itemPerPage=10;this.notifications=[];this.pagination=undefined;this.hasInfiniteScroll=undefined;this.total=undefined;this.showPlaceholder=undefined;this.nextPage=undefined;this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more");salla.lang.onLoaded((function(){n.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");n.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var n;var e=(n=this.status)===null||n===void 0?void 0:n.querySelector(".s-button-text");if(e){Helper.toggleElementClassIf(e,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.getNotificationCard=function(t){var n=document.createElement("salla-notification-item");n.notification=t;n.classList.add("s-block");return n};t.prototype.render=function(){var t=this;var n;if(this.showPlaceholder){return h("div",{class:"s-notifications-no-content"},h("salla-placeholder",{alignment:"center"},h("span",{slot:"title"},this.no_notifications_trans)))}return h("div",{class:"s-notifications-wrapper"},h("div",{class:"s-notifications-container",ref:function(n){return t.wrapper=n}}),this.hasInfiniteScroll&&h("div",{class:"s-infinite-scroll-wrapper",ref:function(n){return t.status=n}},h("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},h("span",{class:"s-button-text s-infinite-scroll-btn-text"},(n=this.loadMoreText)!==null&&n!==void 0?n:this.load_more_text_trans),h("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(n){return t.btnLoader=n},style:{display:"none"}}))))};t.prototype.handleResponse=function(t){var n=this;return t.map((function(t){return n.getNotificationCard(t)}))};t.prototype.initiateInfiniteScroll=function(){var t=this;var n,e,i;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){return t.nextPage},history:true,nextPage:this.nextPage,scrollThreshold:false,status:this.status,button:this.status.querySelector(".s-infinite-scroll-btn")},true);(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("request",(function(n){t.loading()}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(n){var e;t.loading(false);t.pagination=n.pagination;t.nextPage=((e=n.pagination.links)===null||e===void 0?void 0:e.next)||null;t.handleResponse(n.data);var i=t.host.querySelectorAll("salla-notification-item:not(.animated)");t.animateItems(i)}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.animateItems=function(t){anime({targets:t,opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,n){return n*100},easing:"easeOutExpo",complete:function(n){t.forEach((function(t){t.classList.add("animated")}))}})};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.api.notifications.fetch({per_page:this.itemPerPage}).then((function(n){var e;t.notifications=n.data;t.hasInfiniteScroll=!!n.pagination.links.next;t.pagination=n.pagination;t.total=n.pagination.total;t.nextPage=((e=n.pagination.links)===null||e===void 0?void 0:e.next)||null;setTimeout((function(){t.handleResponse(n.data).forEach((function(n){return t.wrapper.append(n)}));t.initiateInfiniteScroll();var e=t.wrapper.querySelectorAll("salla-notification-item:not(.animated)");t.animateItems(e)}),100)})).catch((function(n){salla.logger.error(n);t.showPlaceholder=true;t.loading(false)}))];case 1:n.sent();return[2]}}))}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage();return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.loadInitialData()];case 1:t.sent();return[2]}}))}))};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaNotifications.style=sallaNotificationsCss;export{SallaNotifications as salla_notifications};
5
5
  //# sourceMappingURL=salla-notifications.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,g as getElement}from"./index-e6c3f002.js";var sallaOfferCss='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var SallaOffer=function(){function e(e){var t=this;registerInstance(this,e);var s;this.productId=undefined;this.offer=undefined;this.offersList=[];this.userCurrency=undefined;this.isMultipleBank=undefined;this.title=undefined;this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){t.offer_with_price_text=salla.lang.get("pages.offer.with_price");t.with_discount_text=salla.lang.get("pages.products.with_a_discount");t.product_discount_text=salla.lang.get("pages.products.discount");t.special_offer_text=salla.lang.get("pages.products.special_offer");t.buy_quantity_text("")}));salla.onReady((function(){t.productId=t.productId||(salla.url.is_page("product.single")?salla.config.get("page.id"):null);t.userCurrency=salla.config.get("user.currency")}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getCategoriesSection=function(e){var t=this;return e.map((function(e){return h("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:t.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon).replace(/\{name\}/g,e.name)})}))};e.prototype.getProductSection=function(e){return e.map((function(e){return h("div",{class:"s-offer-slide-one-fourth"},h("salla-product-card",{"shadow-on-hover":true,product:e}))}))};e.prototype.getBankSection=function(e,t,s){var r=this;return e.map((function(e){return h("div",{class:{"s-offer-slide-one-sixth":r.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!r.isMultipleBank}},h("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!r.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":r.isMultipleBank}},h("div",{class:"s-offer-bank-logo"},h("img",{src:e.logo||salla.url.cdn("images/s-empty.png"),"data-src":e.logo,alt:e.name+" offer"})),h("ul",{class:"s-offer-bank-payment-wrapper"},e.payments.map((function(e){return h("li",{class:"s-offer-bank-payment-single"},h("img",{src:salla.url.cdn("images/payment/"+e+"_mini.png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+"_mini.png"),alt:"payment"}))}))),r.isMultipleBank?h("p",{class:"s-offer-bank-payment-discount-percent"},r.product_discount_text+e.percent,"%"):""),!r.isMultipleBank?h("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},h("h2",null,t),h("p",null,s)):"")}))};e.prototype.getDiscountTableSection=function(e){var t=this;return e.map((function(e){var s;return h("div",{class:"s-offer-slide-one-fourth"},h("div",{class:"s-offer-slide-offer-entry"},h("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},h("p",{class:"s-offer-slide-offer-entry-quantity"},t.buy_quantity_text(e.quantity_text)),e.show_discounted_price?h("div",{class:"s-offer-slide-offer-entry-price"},h("span",null,t.offer_with_price_text),h("span",{class:"s-offer-slide-offer-entry-price-amount"},salla.helpers.money(e.price))," ",(s=t.userCurrency)===null||s===void 0?void 0:s.symbol):""),h("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},t.with_discount_text,"(",h("span",null,e.percent),")")))}))};e.prototype.render=function(){if(!this.productId){salla.logger.error("salla-offer::Can't render the component without product-id!");return}if(!this.offersList.length)return null;var e=this.offersList[0];this.isMultipleBank=!!e&&!!e.get.banks&&e.get.banks.length>1;return h("div",{class:"s-offer-wrapper"},h("p",{class:"s-offer-corner-badge"},this.special_offer_text),h("salla-slider",{type:"carousel","block-title":this.isMultipleBank?e.name:null,"block-subTitle":this.isMultipleBank?e.message:null,id:"offer-slider"},h("div",{slot:"items"},[!!e.get.categories?this.getCategoriesSection(e.get.categories):!!e.get.products?this.getProductSection(e.get.products):!!e.get.banks?this.getBankSection(e.get.banks,e.name,e.message):"",!!e.get.discounts_table?this.getDiscountTableSection(e.get.discounts_table):""])))};e.prototype.componentWillLoad=function(){var e=this;return this.productId?salla.api.product.offers(this.productId).then((function(t){return e.offersList=t.data})):null};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaOffer.style=sallaOfferCss;export{SallaOffer as salla_offer};
4
+ import{r as registerInstance,h,g as getElement}from"./index-9a9b1e67.js";var sallaOfferCss='.s-offer-wrapper .s-slider-block__title h2{font-size:1.125rem;line-height:1.75rem;color:#f87171}.s-offer-wrapper .s-slider-block__title h2::before{font-family:"sallaicons";content:"\\ee30" !important;position:absolute;top:1rem;font-size:3rem;font-weight:400;line-height:1;color:#fef2f2}.s-offer-bank-wrapper-sinlge-item{display:-ms-flexbox;display:flex;-ms-flex-align:center !important;align-items:center !important;gap:14px}.s-offer-bank-wrapper{display:-ms-flexbox !important;display:flex !important;width:100% !important}';var SallaOffer=function(){function e(e){var t=this;registerInstance(this,e);var s;this.productId=undefined;this.offer=undefined;this.offersList=[];this.userCurrency=undefined;this.isMultipleBank=undefined;this.title=undefined;this.offer_with_price_text=salla.lang.get("pages.offer.with_price",{price:""});this.with_discount_text=salla.lang.get("pages.products.with_a_discount");this.product_discount_text=salla.lang.get("pages.products.discount");this.special_offer_text=salla.lang.get("pages.products.special_offer");this.buy_quantity_text=function(e){return salla.lang.get("pages.offer.buy_quantity",{quantity:e})};salla.lang.onLoaded((function(){t.offer_with_price_text=salla.lang.get("pages.offer.with_price");t.with_discount_text=salla.lang.get("pages.products.with_a_discount");t.product_discount_text=salla.lang.get("pages.products.discount");t.special_offer_text=salla.lang.get("pages.products.special_offer");t.buy_quantity_text("")}));salla.onReady((function(){t.productId=t.productId||(salla.url.is_page("product.single")?salla.config.get("page.id"):null);t.userCurrency=salla.config.get("user.currency")}));this.categorySlot=((s=this.host.querySelector('[slot="category"]'))===null||s===void 0?void 0:s.innerHTML)||'<a href={url} class="s-offer-slide-cat-entry"><i class={icon}></i><h4>{name}</h4></a>'}e.prototype.getCategoriesSection=function(e){var t=this;return e.map((function(e){return h("div",{class:"s-offer-slide-one-sixth swiper-slide",innerHTML:t.categorySlot.replace(/\{url\}/g,e.url).replace(/\{icon\}/g,e.icon).replace(/\{name\}/g,e.name)})}))};e.prototype.getProductSection=function(e){return e.map((function(e){return h("div",{class:"s-offer-slide-one-fourth"},h("salla-product-card",{"shadow-on-hover":true,product:e}))}))};e.prototype.getBankSection=function(e,t,s){var r=this;return e.map((function(e){return h("div",{class:{"s-offer-slide-one-sixth":r.isMultipleBank,"s-offer-bank-wrapper-sinlge-item":!r.isMultipleBank}},h("div",{class:{"s-offer-bank-wrapper":true,"s-offer-slide-one-sixth":!r.isMultipleBank,"s-offer-bank-wrapper-multi-spacer":r.isMultipleBank}},h("div",{class:"s-offer-bank-logo"},h("img",{src:e.logo||salla.url.cdn("images/s-empty.png"),"data-src":e.logo,alt:e.name+" offer"})),h("ul",{class:"s-offer-bank-payment-wrapper"},e.payments.map((function(e){return h("li",{class:"s-offer-bank-payment-single"},h("img",{src:salla.url.cdn("images/payment/"+e+"_mini.png")||salla.url.cdn("images/s-empty.png"),"data-src":salla.url.cdn("images/payment/"+e+"_mini.png"),alt:"payment"}))}))),r.isMultipleBank?h("p",{class:"s-offer-bank-payment-discount-percent"},r.product_discount_text+e.percent,"%"):""),!r.isMultipleBank?h("div",{class:"s-offer-bank-message s-offer-slide-one-fourth"},h("h2",null,t),h("p",null,s)):"")}))};e.prototype.getDiscountTableSection=function(e){var t=this;return e.map((function(e){var s;return h("div",{class:"s-offer-slide-one-fourth"},h("div",{class:"s-offer-slide-offer-entry"},h("div",{class:"s-offer-slide-offer-entry-price-quantity-container"},h("p",{class:"s-offer-slide-offer-entry-quantity"},t.buy_quantity_text(e.quantity_text)),e.show_discounted_price?h("div",{class:"s-offer-slide-offer-entry-price"},h("span",null,t.offer_with_price_text),h("span",{class:"s-offer-slide-offer-entry-price-amount"},salla.helpers.money(e.price))," ",(s=t.userCurrency)===null||s===void 0?void 0:s.symbol):""),h("p",{class:"s-offer-slide-offer-entry-price-amount-percent"},t.with_discount_text,"(",h("span",null,e.percent),")")))}))};e.prototype.render=function(){if(!this.productId){salla.logger.error("salla-offer::Can't render the component without product-id!");return}if(!this.offersList.length)return null;var e=this.offersList[0];this.isMultipleBank=!!e&&!!e.get.banks&&e.get.banks.length>1;return h("div",{class:"s-offer-wrapper"},h("p",{class:"s-offer-corner-badge"},this.special_offer_text),h("salla-slider",{type:"carousel","block-title":this.isMultipleBank?e.name:null,"block-subTitle":this.isMultipleBank?e.message:null,id:"offer-slider"},h("div",{slot:"items"},[!!e.get.categories?this.getCategoriesSection(e.get.categories):!!e.get.products?this.getProductSection(e.get.products):!!e.get.banks?this.getBankSection(e.get.banks,e.name,e.message):"",!!e.get.discounts_table?this.getDiscountTableSection(e.get.discounts_table):""])))};e.prototype.componentWillLoad=function(){var e=this;return this.productId?salla.api.product.offers(this.productId).then((function(t){return e.offersList=t.data})):null};Object.defineProperty(e.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();SallaOffer.style=sallaOfferCss;export{SallaOffer as salla_offer};
5
5
  //# sourceMappingURL=salla-offer.entry.js.map
@@ -0,0 +1,5 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function i(e){try{s(n.next(e))}catch(e){a(e)}}function c(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?r(e.value):o(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];o=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};
2
+ /*!
3
+ * Crafted with ❤ by Salla
4
+ */import{r as registerInstance,h}from"./index-9a9b1e67.js";import{C as CheckCircleIcon}from"./check-838f37a7.js";var iconFileArchive='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-archive</title>\n<path d="M17.333 16h-5.333c-0.737 0-1.333 0.597-1.333 1.333v2.667c0 2.205 1.795 4 4 4s4-1.795 4-4v-2.667c0-0.736-0.596-1.333-1.333-1.333zM16 20c0 0.735-0.597 1.333-1.333 1.333s-1.333-0.599-1.333-1.333v-1.333h2.667zM17.333 12h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28.943 8.391l-8-8c-0.249-0.251-0.588-0.391-0.943-0.391h-13.333c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h18.667c2.205 0 4-1.795 4-4v-18.667c0-0.353-0.14-0.693-0.391-0.943zM26.667 28c0 0.735-0.597 1.333-1.333 1.333h-18.667c-0.736 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.597-1.333 1.333-1.333h12.781l7.219 7.219zM17.333 8h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM17.333 4h-5.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h5.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333z"></path>\n</svg>\n';var iconDownload='\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>download</title>\n<path d="M15.056 20.941c0.123 0.124 0.271 0.221 0.435 0.289 0.163 0.067 0.336 0.103 0.509 0.103s0.347-0.036 0.509-0.103c0.164-0.068 0.311-0.165 0.435-0.289l5.332-5.332c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-3.057 3.057v-12.781c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v12.781l-3.057-3.057c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885zM25.333 26.667h-18.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h18.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333z"></path>\n</svg>\n';var iconCopy='\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>swap-stroke</title>\n<path d="M6.667 18.667h-2.667c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333v2.667c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-2.667c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h2.667c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM28 10.667h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.597 1.333-1.333 1.333h-13.333c-0.736 0-1.333-0.597-1.333-1.333v-13.333c0-0.736 0.597-1.333 1.333-1.333h13.333c0.736 0 1.333 0.597 1.333 1.333z"></path>\n</svg>\n';var iconCreditCard='\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>debit-card-back</title>\n<path d="M30 28h-28c-1.105 0-2-0.895-2-2v0-18c0-1.105 0.895-2 2-2v0h28c1.105 0 2 0.895 2 2v0 18c0 1.105-0.895 2-2 2v0zM30 26v0zM2 8v18h28v-18zM31 14h-30c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h30c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM11 22h-6c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h6c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM24 24c-2.209 0-4-1.791-4-4s1.791-4 4-4c2.209 0 4 1.791 4 4v0c0 2.209-1.791 4-4 4v0zM24 18c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2v0c0-1.105-0.895-2-2-2v0zM20 24c-2.209 0-4-1.791-4-4s1.791-4 4-4v0c0.002 0 0.005 0 0.007 0 1.032 0 1.972 0.398 2.673 1.048l-0.003-0.002c0.191 0.183 0.311 0.439 0.311 0.724 0 0.552-0.448 1-1 1-0.257 0-0.492-0.097-0.669-0.257l0.001 0.001c-0.345-0.319-0.807-0.514-1.315-0.514-0.002 0-0.003 0-0.005 0h0c-1.105 0-2 0.895-2 2s0.895 2 2 2v0c0.002 0 0.004 0 0.007 0 0.508 0 0.971-0.195 1.317-0.515l-0.001 0.001c0.179-0.171 0.422-0.276 0.689-0.276 0.552 0 1 0.448 1 1 0 0.295-0.128 0.56-0.331 0.743l-0.001 0.001c-0.699 0.648-1.638 1.046-2.671 1.046-0.003 0-0.007 0-0.010 0h0.001z"></path>\n</svg>\n';var sallaOrderSummaryCss=":host{display:block}";var SallaOrderSummary=function(){function e(e){registerInstance(this,e);this.isDigitalCard=function(e){return e.product.type==="codes"};this.isDigitalProduct=function(e){return e.product.type==="digital"};this.orderId=undefined;this.codeCopied=null;this.noItemFound=true;this.order_items=[]}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){switch(t.label){case 0:salla.lang.onLoaded((function(){e.codes_text=salla.lang.get("pages.thank_you.codes");e.copy_text=salla.lang.get("common.elements.copy");e.files_text=salla.lang.get("pages.thank_you.files");e.download_text=salla.lang.get("pages.thank_you.download")}));return[4,this.getOrderItems()];case 1:return[2,t.sent()]}}))}))};e.prototype.copyToClipboardHandler=function(e){var t=this;if(navigator&&"clipboard"in navigator){try{navigator.clipboard.writeText(e).then((function(){t.codeCopied=e;t.copyCodeButtonTimeout=setTimeout((function(){t.codeCopied=null}),3e3)}))}catch(e){salla.loggers.error("copy functionality is not supported by the browser")}}};e.prototype.getOrderItems=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,o,a;var i=this;return __generator(this,(function(c){switch(c.label){case 0:e=this.orderId||salla.config.get("page.id");t="Failed to fetch order items";if(!e){salla.logger.error(t);throw new Error(t)}c.label=1;case 1:c.trys.push([1,3,,4]);return[4,salla.api.request("orders/".concat(e))];case 2:r=c.sent().data.items,n=r===void 0?[]:r;o=n.some((function(e){return i.isDigitalCard(e)||i.isDigitalProduct(e)}));if(o){this.order_items=n;this.noItemFound=false}return[3,4];case 3:a=c.sent();salla.logger.error(t);return[3,4];case 4:return[2]}}))}))};e.prototype.disconnectedCallback=function(){this.copyCodeButtonTimeout&&clearTimeout(this.copyCodeButtonTimeout)};e.prototype.render=function(){var e=this;return h("ul",{class:"s-order-summary-wrapper"},this.noItemFound?h("salla-placeholder",{alignment:"center"},h("span",{slot:"title"})):this.order_items.map((function(t){return e.isDigitalCard(t)?h("li",{key:t.product.id,class:"s-order-summary-item"},h("h2",{class:"s-order-summary-item-title"},e.codes_text," (",t.name,")"),t.codes.map((function(t){return h("div",{key:t.code,class:"s-order-summary-code-item-wrapper"},h("p",null,h("span",{innerHTML:iconCreditCard}),h("span",null,t.code)),h("salla-button",{class:"s-order-summary-item-copy-button ".concat(e.codeCopied===t.code?"copied":""),onClick:function(){return e.copyToClipboardHandler(t.code)},shape:"link"},h("span",{innerHTML:e.codeCopied===t.code?CheckCircleIcon:iconCopy}),h("span",null,e.copy_text)))}))):e.isDigitalProduct(t)?h("li",{key:t.product.id,class:"s-order-summary-item"},h("h2",{class:"s-order-summary-item-title"},e.files_text," (",t.name,")"),h("ul",null,t.files.map((function(t){return h("li",{class:"s-order-summary-digital-item-wrapper"},h("div",null,h("span",{innerHTML:iconFileArchive}),h("span",null,t.name)),h("a",{href:t.url,target:"_blank",class:"s-order-summary-item-download"},h("span",{innerHTML:iconDownload}),h("span",null,e.download_text)))})))):null})))};return e}();SallaOrderSummary.style=sallaOrderSummaryCss;export{SallaOrderSummary as salla_order_summary};
5
+ //# sourceMappingURL=salla-order-summary.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sallaOrderSummaryCss","SallaOrderSummary","this","isDigitalCard","item","product","type","isDigitalProduct","class_1","prototype","componentWillLoad","salla","lang","onLoaded","_this","codes_text","get","copy_text","files_text","download_text","getOrderItems","_a","sent","copyToClipboardHandler","code","navigator","clipboard","writeText","then","codeCopied","copyCodeButtonTimeout","setTimeout","error","loggers","orderId","config","errorMessage","logger","Error","api","request","concat","_b","data","items","validItems","some","order_items","noItemFound","disconnectedCallback","clearTimeout","render","h","class","alignment","slot","map","key","id","name","codes","innerHTML","iconCreditCard","onClick","shape","iconCheck","iconCopy","files","file","iconFileArchive","href","url","target","iconDownload"],"sources":["src/components/salla-order-summary/salla-order-summary.scss?tag=salla-order-summary","src/components/salla-order-summary/salla-order-summary.tsx"],"sourcesContent":[":host {\n display: block;\n}","import { Component, State, h, Prop } from '@stencil/core';\nimport { orderItem } from './interfaces';\n\nimport iconFileArchive from '../../assets/svg/file-archive.svg'\nimport iconDownload from '../../assets/svg/download.svg'\nimport iconCopy from '../../assets/svg/swap-stroke.svg'\nimport iconCheck from '../../assets/svg/check.svg'\nimport iconCreditCard from '../../assets/svg/debit-card-back.svg'\n\n@Component({\n tag: 'salla-order-summary',\n styleUrl: 'salla-order-summary.scss',\n})\nexport class SallaOrderSummary {\n\n copyCodeButtonTimeout: NodeJS.Timeout\n\n /**\n * @type {number}\n * order id to fetch items.\n */\n @Prop({ reflect: true }) orderId?: number;\n\n @State() codeCopied: string | null = null\n @State() noItemFound: boolean = true\n @State() order_items: orderItem[] = []\n\n private codes_text: string\n private copy_text: string\n private files_text: string\n private download_text: string\n\n private isDigitalCard = (item: orderItem) => item.product.type === 'codes'\n private isDigitalProduct = (item: orderItem) => item.product.type === 'digital'\n\n async componentWillLoad() {\n salla.lang.onLoaded(() => {\n this.codes_text = salla.lang.get('pages.thank_you.codes')\n this.copy_text = salla.lang.get('common.elements.copy')\n this.files_text = salla.lang.get('pages.thank_you.files')\n this.download_text = salla.lang.get('pages.thank_you.download')\n })\n return await this.getOrderItems()\n \n }\n\n private copyToClipboardHandler(code: string) {\n if (navigator && 'clipboard' in navigator) {\n try {\n navigator.clipboard.writeText(code).then(() => {\n this.codeCopied = code\n\n this.copyCodeButtonTimeout = setTimeout(() => {\n this.codeCopied = null\n }, 3000)\n\n })\n } catch (error) {\n salla.loggers.error('copy functionality is not supported by the browser')\n }\n }\n }\n\n private async getOrderItems() {\n\n const orderId = this.orderId || salla.config.get('page.id')\n const errorMessage = \"Failed to fetch order items\"\n\n if (!orderId) {\n salla.logger.error(errorMessage)\n throw new Error(errorMessage)\n }\n\n try {\n const { data: { items = [] } } = await salla.api.request(`orders/${orderId}`)\n\n const validItems = items.some((item) => (this.isDigitalCard(item) || this.isDigitalProduct(item)))\n\n if (validItems) {\n this.order_items = items\n this.noItemFound = false\n }\n } catch (error) {\n salla.logger.error(errorMessage)\n }\n }\n\n disconnectedCallback() {\n this.copyCodeButtonTimeout && clearTimeout(this.copyCodeButtonTimeout)\n }\n\n render() {\n return (\n\n <ul class=\"s-order-summary-wrapper\">\n {this.noItemFound ? <salla-placeholder alignment=\"center\">\n <span slot=\"title\" />\n </salla-placeholder> :\n this.order_items.map((item) => (\n this.isDigitalCard(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.codes_text} ({item.name})\n </h2>\n {item.codes.map((code) => (\n <div key={code.code} class=\"s-order-summary-code-item-wrapper\">\n <p>\n <span innerHTML={iconCreditCard} />\n <span>{code.code}</span>\n </p>\n <salla-button class={`s-order-summary-item-copy-button ${this.codeCopied === code.code ? 'copied' : ''}`} onClick={() => this.copyToClipboardHandler(code.code)} shape=\"link\">\n <span innerHTML={this.codeCopied === code.code ? iconCheck : iconCopy} />\n <span >{this.copy_text}</span>\n </salla-button >\n </div>\n ))}\n </li>\n ) :\n this.isDigitalProduct(item) ? (\n <li key={item.product.id} class=\"s-order-summary-item\">\n <h2 class=\"s-order-summary-item-title\">\n {this.files_text} ({item.name})\n </h2>\n <ul>\n {item.files.map((file) => (\n <li class=\"s-order-summary-digital-item-wrapper\">\n <div>\n <span innerHTML={iconFileArchive} />\n <span>{file.name}</span>\n </div>\n <a href={file.url} target=\"_blank\" class=\"s-order-summary-item-download\">\n <span innerHTML={iconDownload} />\n <span>{this.download_text}</span>\n </a>\n </li>\n ))}\n </ul>\n </li>\n ) : null\n ))\n }\n </ul>\n );\n }\n\n}\n\n\n"],"mappings":";;;q9HAAA,IAAMA,qBAAuB,uB,ICahBC,kBAAiB,W,uCAmBpBC,KAAAC,cAAgB,SAACC,GAAoB,OAAAA,EAAKC,QAAQC,OAAS,OAAtB,EACrCJ,KAAAK,iBAAmB,SAACH,GAAoB,OAAAA,EAAKC,QAAQC,OAAS,SAAtB,E,uCAVX,K,iBACL,K,iBACI,E,CAU9BE,EAAAC,UAAAC,kBAAN,W,uHACEC,MAAMC,KAAKC,UAAS,WAClBC,EAAKC,WAAaJ,MAAMC,KAAKI,IAAI,yBACjCF,EAAKG,UAAYN,MAAMC,KAAKI,IAAI,wBAChCF,EAAKI,WAAaP,MAAMC,KAAKI,IAAI,yBACjCF,EAAKK,cAAgBR,MAAMC,KAAKI,IAAI,2B,IAE/B,SAAMd,KAAKkB,iB,OAAlB,SAAOC,EAAAC,Q,QAIDd,EAAAC,UAAAc,uBAAA,SAAuBC,GAAvB,IAAAV,EAAAZ,KACN,GAAIuB,WAAa,cAAeA,UAAW,CACzC,IACEA,UAAUC,UAAUC,UAAUH,GAAMI,MAAK,WACvCd,EAAKe,WAAaL,EAElBV,EAAKgB,sBAAwBC,YAAW,WACtCjB,EAAKe,WAAa,I,GACjB,I,IAGL,MAAOG,GACPrB,MAAMsB,QAAQD,MAAM,qD,IAKZxB,EAAAC,UAAAW,cAAN,W,uIAEAc,EAAUhC,KAAKgC,SAAWvB,MAAMwB,OAAOnB,IAAI,WAC3CoB,EAAe,8BAErB,IAAKF,EAAS,CACZvB,MAAM0B,OAAOL,MAAMI,GACnB,MAAM,IAAIE,MAAMF,E,wCAIiB,SAAMzB,MAAM4B,IAAIC,QAAQ,UAAAC,OAAUP,K,OAAnDb,EAAiBqB,EAAApB,OAA4CqB,KAAAC,MAA7DA,EAAKvB,SAAA,EAAG,GAAEA,EAEpBwB,EAAaD,EAAME,MAAK,SAAC1C,GAAI,OAAMU,EAAKX,cAAcC,IAASU,EAAKP,iBAAiBH,EAAxD,IAEnC,GAAIyC,EAAY,CACd3C,KAAK6C,YAAcH,EACnB1C,KAAK8C,YAAc,K,+BAGrBrC,MAAM0B,OAAOL,MAAMI,G,qCAIvB5B,EAAAC,UAAAwC,qBAAA,WACE/C,KAAK4B,uBAAyBoB,aAAahD,KAAK4B,sB,EAGlDtB,EAAAC,UAAA0C,OAAA,eAAArC,EAAAZ,KACE,OAEEkD,EAAA,MAAIC,MAAM,2BACPnD,KAAK8C,YAAcI,EAAA,qBAAmBE,UAAU,UAC/CF,EAAA,QAAMG,KAAK,WAEXrD,KAAK6C,YAAYS,KAAI,SAACpD,GAAI,OACxBU,EAAKX,cAAcC,GACjBgD,EAAA,MAAIK,IAAKrD,EAAKC,QAAQqD,GAAIL,MAAM,wBAC9BD,EAAA,MAAIC,MAAM,8BACPvC,EAAKC,WAAU,KAAIX,EAAKuD,KAAI,KAE9BvD,EAAKwD,MAAMJ,KAAI,SAAChC,GAAI,OACnB4B,EAAA,OAAKK,IAAKjC,EAAKA,KAAM6B,MAAM,qCACzBD,EAAA,SACEA,EAAA,QAAMS,UAAWC,iBACjBV,EAAA,YAAO5B,EAAKA,OAEd4B,EAAA,gBAAcC,MAAO,oCAAAZ,OAAoC3B,EAAKe,aAAeL,EAAKA,KAAO,SAAW,IAAMuC,QAAS,WAAM,OAAAjD,EAAKS,uBAAuBC,EAAKA,KAAjC,EAAwCwC,MAAM,QACrKZ,EAAA,QAAMS,UAAW/C,EAAKe,aAAeL,EAAKA,KAAOyC,gBAAYC,WAC7Dd,EAAA,YAAQtC,EAAKG,YARE,KAcvBH,EAAKP,iBAAiBH,GACpBgD,EAAA,MAAIK,IAAKrD,EAAKC,QAAQqD,GAAIL,MAAM,wBAC9BD,EAAA,MAAIC,MAAM,8BACPvC,EAAKI,WAAU,KAAId,EAAKuD,KAAI,KAE/BP,EAAA,UACGhD,EAAK+D,MAAMX,KAAI,SAACY,GAAI,OACnBhB,EAAA,MAAIC,MAAM,wCACRD,EAAA,WACEA,EAAA,QAAMS,UAAWQ,kBACjBjB,EAAA,YAAOgB,EAAKT,OAEdP,EAAA,KAAGkB,KAAMF,EAAKG,IAAKC,OAAO,SAASnB,MAAM,iCACvCD,EAAA,QAAMS,UAAWY,eACjBrB,EAAA,YAAOtC,EAAKK,gBARG,MAcvB,IAxCkB,I,WArFN,G"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as registerInstance,h,H as Host,g as getElement}from"./index-e6c3f002.js";var sallaPaymentsCss=":host{display:block}";var SallaPayments=function(){function t(t){var e=this;registerInstance(this,t);var s,a,i;this.payments=salla.config.get("store.settings.payments");this.placeholderImage=salla.url.cdn("images/s-empty.png");this.withSbc=undefined;this.sbcId=undefined;this.withMadeInKsa=undefined;this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src="{image}" alt={name} /><li>');this.sbcSlot=((a=this.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');this.codSlot=((i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');salla.onReady((function(){e.payments=salla.config.get("store.settings.payments");e.placeholderImage=salla.url.cdn("images/s-empty.png")}))}t.prototype.render=function(){var t=this;return h(Host,{class:"s-payments-list"},this.withMadeInKsa&&h("li",{class:"s-payments-list-item"},h("img",{class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg"),alt:"made in KSA certified"})),this.payments.map((function(e){return h("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(e,"_mini.png"))).replace(/\{payment\}/g,e)})})),h("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png"))}),this.withSbc&&this.sbcId&&h("div",{id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png")).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(this.sbcId))}))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,e,s;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(e=this.host.querySelector('[slot="sbc"]'))===null||e===void 0?void 0:e.remove();(s=this.host.querySelector('[slot="cod"]'))===null||s===void 0?void 0:s.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaPayments.style=sallaPaymentsCss;export{SallaPayments as salla_payments};
4
+ import{r as registerInstance,h,H as Host,g as getElement}from"./index-9a9b1e67.js";var sallaPaymentsCss=":host{display:block}";var SallaPayments=function(){function t(t){var e=this;registerInstance(this,t);var s,a,i;this.payments=salla.config.get("store.settings.payments");this.placeholderImage=salla.url.cdn("images/s-empty.png");this.withSbc=undefined;this.sbcId=undefined;this.withMadeInKsa=undefined;this.paymentSlot=((s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src="{image}" alt={name} /><li>');this.sbcSlot=((a=this.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');this.codSlot=((i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(this.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');salla.onReady((function(){e.payments=salla.config.get("store.settings.payments");e.placeholderImage=salla.url.cdn("images/s-empty.png")}))}t.prototype.render=function(){var t=this;return h(Host,{class:"s-payments-list"},this.withMadeInKsa&&h("li",{class:"s-payments-list-item"},h("img",{class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg"),alt:"made in KSA certified"})),this.payments.map((function(e){return h("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(e,"_mini.png"))).replace(/\{payment\}/g,e)})})),h("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png"))}),this.withSbc&&this.sbcId&&h("div",{id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png")).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(this.sbcId))}))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,e,s;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(e=this.host.querySelector('[slot="sbc"]'))===null||e===void 0?void 0:e.remove();(s=this.host.querySelector('[slot="cod"]'))===null||s===void 0?void 0:s.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();SallaPayments.style=sallaPaymentsCss;export{SallaPayments as salla_payments};
5
5
  //# sourceMappingURL=salla-payments.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n["throw"](e))}catch(e){a(e)}}function l(e){e.done?i(e.value):r(e.value).then(o,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */import{r as registerInstance,c as createEvent,h,H as Host}from"./index-e6c3f002.js";var sallaPriceRangeCss=":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%}";var SallaPriceRange=function(){function e(e){registerInstance(this,e);this.changed=createEvent(this,"changed",7);this.filterValues=[];this.minPrice=undefined;this.maxPrice=undefined;this.option=undefined;this.filtersData=undefined;this.min=0;this.max=1e4;this.priceOptions=undefined;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.debounce=setTimeout((function(){return""}),1e3)}e.prototype.connectedCallback=function(){var e=this;var t;if(this.filtersData&&((t=this.filtersData)===null||t===void 0?void 0:t.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((function(){e.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",e.moreThanLabel);e.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",e.lessThanLabel);e.toLabel=salla.lang.getWithDefault("common.elements.to",e.toLabel);e.fromLabel=salla.lang.getWithDefault("common.elements.from",e.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}var i=Math.ceil(this.option.values.length/5);for(var n=0;n<this.option.values.length;n+=i){this.filterValues.push(this.option.values.slice(n,n+i).reduce((function(e,t){e.to=t.to;e.count+=t.count;return e})))}};e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.minInput.value=null;this.maxInput.value=null;return[2]}))}))};e.prototype.getPriceLabel=function(e){if(isNaN(e.from)||e.from<1){return"".concat(this.lessThanLabel," ").concat(salla.money(e.to))}if(isNaN(e.to)||e.to<1){return"".concat(this.moreThanLabel," ").concat(salla.money(e.from))}return"".concat(salla.money(e.from)," ").concat(this.toLabel," ").concat(salla.money(e.to))};e.prototype.handleMinMaxPrice=function(e,t){this.minPrice=t.from;this.maxPrice=t.to!="*"?t.to:"";this.changedEventHandler(e)};e.prototype.changedEventHandler=function(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(r){this.typing=true;salla.helpers.inputDigitsOnly(e.target);i=e?e.target.value*1:"";clearTimeout(this.debounce);this.debounce=setTimeout((function(){n.typing=false;if(t){if(!n.maxPrice&&i){n.maxPrice=""}n.minInputValidation(i)}else{if(!n.minPrice&&i){n.minPrice=0}n.maxInputValidation(i)}n.isReady&&n.changed.emit({event:e,option:n.option,value:{max:n.maxPrice,min:n.minPrice}})}),1e3);return[2]}))}))};e.prototype.minInputValidation=function(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}};e.prototype.maxInputValidation=function(e){if(e&&(e<this.min||this.minPrice&&e<this.minPrice)){return}if(e>this.max){this.maxPrice=this.max;return}if(e){this.maxPrice=e}};e.prototype.isChecked=function(e){if(!this.minPrice&&!this.maxPrice){return false}var t=(e.from<1||e.from=="*")&&this.minPrice==0||e.from==this.minPrice;var i=e.to=="*"||!e.to||e.to==this.maxPrice;return t&&i};e.prototype.render=function(){var e=this;return h(Host,null,this.filterValues.map((function(t,i){return h("label",{class:"s-filters-label",htmlFor:"".concat(e.option.key,"-").concat(i)},h("input",{id:"".concat(e.option.key,"-").concat(i),name:"price",type:"radio",checked:e.isChecked(t),class:"s-filters-radio",onChange:function(i){return e.handleMinMaxPrice(i,t)}}),e.getPriceLabel(t))})),h("div",{class:"flex justify-center items-center"},h("div",{class:"relative max-w-xl w-full"},h("div",{class:"s-price-range-inputs"},h("div",{class:"s-price-range-relative"},h("div",{class:"s-price-range-currency"}," ",salla.config.currency().symbol),h("input",{type:"number",maxlength:"5",ref:function(t){return e.minInput=t},onInput:function(t){return e.changedEventHandler(t,true)},value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),h("div",{class:"s-price-range-gray-text"}," -"),h("div",{class:"s-price-range-relative"},h("div",{class:"s-price-range-currency"}," ",salla.config.currency().symbol),h("input",{type:"number",maxlength:"5",placeholder:this.toLabel,ref:function(t){return e.maxInput=t},onInput:function(t){return e.changedEventHandler(t)},value:this.maxPrice,class:"s-price-range-number-input","aria-describedby":"price-currency"}))))))};e.prototype.componentDidLoad=function(){this.isReady=true};return e}();SallaPriceRange.style=sallaPriceRangeCss;export{SallaPriceRange as salla_price_range};
4
+ */import{r as registerInstance,c as createEvent,h,H as Host}from"./index-9a9b1e67.js";var sallaPriceRangeCss=":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%}";var SallaPriceRange=function(){function e(e){registerInstance(this,e);this.changed=createEvent(this,"changed",7);this.filterValues=[];this.minPrice=undefined;this.maxPrice=undefined;this.option=undefined;this.filtersData=undefined;this.min=0;this.max=1e4;this.priceOptions=undefined;this.moreThanLabel="أكثر من";this.lessThanLabel="أقل من";this.toLabel="الى";this.fromLabel="من";this.typing=false;this.debounce=setTimeout((function(){return""}),1e3)}e.prototype.connectedCallback=function(){var e=this;var t;if(this.filtersData&&((t=this.filtersData)===null||t===void 0?void 0:t.price)){this.minPrice=this.filtersData.price.min;this.maxPrice=this.filtersData.price.max}salla.lang.onLoaded((function(){e.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",e.moreThanLabel);e.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",e.lessThanLabel);e.toLabel=salla.lang.getWithDefault("common.elements.to",e.toLabel);e.fromLabel=salla.lang.getWithDefault("common.elements.from",e.fromLabel)}));if(this.option.values.length==1){return}if(this.option.values.length<=5){this.filterValues=this.option.values;return}var i=Math.ceil(this.option.values.length/5);for(var n=0;n<this.option.values.length;n+=i){this.filterValues.push(this.option.values.slice(n,n+i).reduce((function(e,t){e.to=t.to;e.count+=t.count;return e})))}};e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.minInput.value=null;this.maxInput.value=null;return[2]}))}))};e.prototype.getPriceLabel=function(e){if(isNaN(e.from)||e.from<1){return"".concat(this.lessThanLabel," ").concat(salla.money(e.to))}if(isNaN(e.to)||e.to<1){return"".concat(this.moreThanLabel," ").concat(salla.money(e.from))}return"".concat(salla.money(e.from)," ").concat(this.toLabel," ").concat(salla.money(e.to))};e.prototype.handleMinMaxPrice=function(e,t){this.minPrice=t.from;this.maxPrice=t.to!="*"?t.to:"";this.changedEventHandler(e)};e.prototype.changedEventHandler=function(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(r){this.typing=true;salla.helpers.inputDigitsOnly(e.target);i=e?e.target.value*1:"";clearTimeout(this.debounce);this.debounce=setTimeout((function(){n.typing=false;if(t){if(!n.maxPrice&&i){n.maxPrice=""}n.minInputValidation(i)}else{if(!n.minPrice&&i){n.minPrice=0}n.maxInputValidation(i)}n.isReady&&n.changed.emit({event:e,option:n.option,value:{max:n.maxPrice,min:n.minPrice}})}),1e3);return[2]}))}))};e.prototype.minInputValidation=function(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}};e.prototype.maxInputValidation=function(e){if(e&&(e<this.min||this.minPrice&&e<this.minPrice)){return}if(e>this.max){this.maxPrice=this.max;return}if(e){this.maxPrice=e}};e.prototype.isChecked=function(e){if(!this.minPrice&&!this.maxPrice){return false}var t=(e.from<1||e.from=="*")&&this.minPrice==0||e.from==this.minPrice;var i=e.to=="*"||!e.to||e.to==this.maxPrice;return t&&i};e.prototype.render=function(){var e=this;return h(Host,null,this.filterValues.map((function(t,i){return h("label",{class:"s-filters-label",htmlFor:"".concat(e.option.key,"-").concat(i)},h("input",{id:"".concat(e.option.key,"-").concat(i),name:"price",type:"radio",checked:e.isChecked(t),class:"s-filters-radio",onChange:function(i){return e.handleMinMaxPrice(i,t)}}),e.getPriceLabel(t))})),h("div",{class:"flex justify-center items-center"},h("div",{class:"relative max-w-xl w-full"},h("div",{class:"s-price-range-inputs"},h("div",{class:"s-price-range-relative"},h("div",{class:"s-price-range-currency"}," ",salla.config.currency().symbol),h("input",{type:"number",maxlength:"5",ref:function(t){return e.minInput=t},onInput:function(t){return e.changedEventHandler(t,true)},value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),h("div",{class:"s-price-range-gray-text"}," -"),h("div",{class:"s-price-range-relative"},h("div",{class:"s-price-range-currency"}," ",salla.config.currency().symbol),h("input",{type:"number",maxlength:"5",placeholder:this.toLabel,ref:function(t){return e.maxInput=t},onInput:function(t){return e.changedEventHandler(t)},value:this.maxPrice,class:"s-price-range-number-input","aria-describedby":"price-currency"}))))))};e.prototype.componentDidLoad=function(){this.isReady=true};return e}();SallaPriceRange.style=sallaPriceRangeCss;export{SallaPriceRange as salla_price_range};
5
5
  //# sourceMappingURL=salla-price-range.entry.js.map