@salla.sa/twilight-components 2.14.459 → 2.14.461

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 (316) hide show
  1. package/dist/cjs/{filepond-DGjKsL4Z.js → filepond-DDAGSiBu.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-Q5BPSEn_.js → filepond-plugin-file-poster-nmHjxMAB.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DqTmfsfu.js → filepond-plugin-file-validate-size-BtQEm835.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-D526i3dm.js → filepond-plugin-file-validate-type-DZh74oiy.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BDgIU9Go.js → filepond-plugin-image-edit-CTGzmH1f.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-Da6QG4_J.js → filepond-plugin-image-exif-orientation-D851LeUg.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CPb3lB8x.js → filepond-plugin-image-preview-BcbCu3xH.js} +1 -1
  8. package/dist/cjs/{functions-DIZLPj6n.js → functions-JSbmlqCR.js} +1 -1
  9. package/dist/cjs/{index-C5VZF2SB.js → index-B382wYR4.js} +1 -1
  10. package/dist/cjs/{index-DFPCRma5.js → index-BbEaNgXt.js} +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-localization-modal.cjs.entry.js +20 -4
  42. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  49. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  50. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-trust-badges.cjs.entry.js +11 -4
  94. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  99. package/dist/cjs/{tracked-promise-DcTnHHuS.js → tracked-promise-B0hsrPu_.js} +1 -1
  100. package/dist/cjs/twilight.cjs.js +1 -1
  101. package/dist/cjs/{vanilla-picker-dGiAD7ic.js → vanilla-picker-CuSFaj7m.js} +1 -1
  102. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +19 -3
  103. package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +10 -3
  104. package/dist/components/index.js +2 -2
  105. package/dist/components/salla-localization-modal.js +19 -3
  106. package/dist/components/salla-trust-badges.js +10 -3
  107. package/dist/esm/{filepond-DcMHeT3j.js → filepond-n7Tk1X1s.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-poster-KBxuLEbb.js → filepond-plugin-file-poster-BSnp0vvZ.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-size-BK-MtfMA.js → filepond-plugin-file-validate-size-CoYRMYw6.js} +1 -1
  110. package/dist/esm/{filepond-plugin-file-validate-type-crBUzoNT.js → filepond-plugin-file-validate-type-qCOXsTrd.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-edit-BTOgfYiD.js → filepond-plugin-image-edit-DXpVwYXm.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-exif-orientation-Dooy1jA0.js → filepond-plugin-image-exif-orientation-BWH5RIuD.js} +1 -1
  113. package/dist/esm/{filepond-plugin-image-preview-ln9g6gwR.js → filepond-plugin-image-preview-D2-j0VSU.js} +1 -1
  114. package/dist/esm/{functions-BuD3yG-5.js → functions-C0YAccvF.js} +1 -1
  115. package/dist/esm/{index-D47JMPpe.js → index-CWoBHtob.js} +1 -1
  116. package/dist/esm/{index-LFMpXt4w.js → index-DZJfoSMn.js} +2 -2
  117. package/dist/esm/loader.js +2 -2
  118. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  119. package/dist/esm/salla-accordion_6.entry.js +1 -1
  120. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  121. package/dist/esm/salla-advertisement.entry.js +1 -1
  122. package/dist/esm/salla-alert_2.entry.js +1 -1
  123. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  124. package/dist/esm/salla-apps-icons.entry.js +1 -1
  125. package/dist/esm/salla-badge.entry.js +1 -1
  126. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  127. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  128. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  129. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  130. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  131. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  132. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  133. package/dist/esm/salla-contacts.entry.js +1 -1
  134. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  135. package/dist/esm/salla-count-down.entry.js +1 -1
  136. package/dist/esm/salla-custom-fields.entry.js +1 -1
  137. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  138. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  139. package/dist/esm/salla-filters-widget.entry.js +1 -1
  140. package/dist/esm/salla-filters.entry.js +1 -1
  141. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  142. package/dist/esm/salla-gifting.entry.js +1 -1
  143. package/dist/esm/salla-hook.entry.js +1 -1
  144. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  145. package/dist/esm/salla-installment.entry.js +1 -1
  146. package/dist/esm/salla-list-tile.entry.js +1 -1
  147. package/dist/esm/salla-localization-modal.entry.js +20 -4
  148. package/dist/esm/salla-login-modal.entry.js +1 -1
  149. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  150. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  151. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  152. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  153. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  154. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  155. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  156. package/dist/esm/salla-loyalty.entry.js +1 -1
  157. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  158. package/dist/esm/salla-map.entry.js +1 -1
  159. package/dist/esm/salla-menu.entry.js +1 -1
  160. package/dist/esm/salla-metadata.entry.js +1 -1
  161. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  162. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  163. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  164. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  165. package/dist/esm/salla-notification-item.entry.js +1 -1
  166. package/dist/esm/salla-notifications.entry.js +1 -1
  167. package/dist/esm/salla-offer-modal.entry.js +1 -1
  168. package/dist/esm/salla-offer.entry.js +1 -1
  169. package/dist/esm/salla-order-branch.entry.js +1 -1
  170. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  171. package/dist/esm/salla-order-details-options.entry.js +1 -1
  172. package/dist/esm/salla-order-details.entry.js +1 -1
  173. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  174. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  175. package/dist/esm/salla-order-edit.entry.js +1 -1
  176. package/dist/esm/salla-order-summary.entry.js +1 -1
  177. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  178. package/dist/esm/salla-orders.entry.js +1 -1
  179. package/dist/esm/salla-payments.entry.js +1 -1
  180. package/dist/esm/salla-placeholder.entry.js +1 -1
  181. package/dist/esm/salla-price-range.entry.js +1 -1
  182. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  183. package/dist/esm/salla-product-card_2.entry.js +1 -1
  184. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  185. package/dist/esm/salla-products-list.entry.js +1 -1
  186. package/dist/esm/salla-progress-bar.entry.js +1 -1
  187. package/dist/esm/salla-quick-order.entry.js +1 -1
  188. package/dist/esm/salla-rating-modal.entry.js +1 -1
  189. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  190. package/dist/esm/salla-scopes.entry.js +1 -1
  191. package/dist/esm/salla-search.entry.js +1 -1
  192. package/dist/esm/salla-skeleton.entry.js +1 -1
  193. package/dist/esm/salla-slider.entry.js +1 -1
  194. package/dist/esm/salla-social-share.entry.js +1 -1
  195. package/dist/esm/salla-social.entry.js +1 -1
  196. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  197. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  198. package/dist/esm/salla-tooltip.entry.js +1 -1
  199. package/dist/esm/salla-trust-badges.entry.js +11 -4
  200. package/dist/esm/salla-user-menu.entry.js +1 -1
  201. package/dist/esm/salla-user-profile.entry.js +1 -1
  202. package/dist/esm/salla-user-settings.entry.js +1 -1
  203. package/dist/esm/salla-verify.entry.js +1 -1
  204. package/dist/esm/salla-wallet.entry.js +1 -1
  205. package/dist/esm/{tracked-promise-DPbO0QsO.js → tracked-promise-GcOA8b3a.js} +1 -1
  206. package/dist/esm/twilight.js +2 -2
  207. package/dist/esm/{vanilla-picker-DAQGFAt4.js → vanilla-picker-BpADmZjj.js} +1 -1
  208. package/dist/twilight/{p-f4ecb099.entry.js → p-0377ee4a.entry.js} +1 -1
  209. package/dist/twilight/{p-289e48d4.entry.js → p-04755a75.entry.js} +1 -1
  210. package/dist/twilight/{p-fc9573b3.entry.js → p-05f84e06.entry.js} +1 -1
  211. package/dist/twilight/{p-80141f08.entry.js → p-0707d2f3.entry.js} +1 -1
  212. package/dist/twilight/{p-78276ba5.entry.js → p-098f1fae.entry.js} +1 -1
  213. package/dist/twilight/{p-c1ab48f6.entry.js → p-0bba3324.entry.js} +1 -1
  214. package/dist/twilight/{p-b92bb0e6.entry.js → p-154982a2.entry.js} +1 -1
  215. package/dist/twilight/{p-a70406d4.entry.js → p-15674f9e.entry.js} +1 -1
  216. package/dist/twilight/{p-e2044262.entry.js → p-173db748.entry.js} +1 -1
  217. package/dist/twilight/{p-e35e0f54.entry.js → p-17d10d15.entry.js} +1 -1
  218. package/dist/twilight/{p-e5631806.entry.js → p-20ccbbe4.entry.js} +1 -1
  219. package/dist/twilight/{p-046159e7.entry.js → p-23d3fe72.entry.js} +1 -1
  220. package/dist/twilight/{p-5d16469d.entry.js → p-23de0e4d.entry.js} +1 -1
  221. package/dist/twilight/p-28472b7d.entry.js +4 -0
  222. package/dist/twilight/{p-80c8cff1.entry.js → p-28654655.entry.js} +1 -1
  223. package/dist/twilight/{p-04e86cc4.entry.js → p-2a900c4e.entry.js} +1 -1
  224. package/dist/twilight/{p-a76b17e2.entry.js → p-30532b9c.entry.js} +1 -1
  225. package/dist/twilight/{p-2e11c53e.entry.js → p-3355b043.entry.js} +1 -1
  226. package/dist/twilight/{p-cd24514a.entry.js → p-348ba7bc.entry.js} +1 -1
  227. package/dist/twilight/{p-adfecc83.entry.js → p-36b19d00.entry.js} +1 -1
  228. package/dist/twilight/{p-be894841.entry.js → p-38e27a00.entry.js} +1 -1
  229. package/dist/twilight/{p-a6734e3a.entry.js → p-3c726469.entry.js} +1 -1
  230. package/dist/twilight/{p-f349772e.entry.js → p-3cea9d02.entry.js} +1 -1
  231. package/dist/twilight/{p-ce75d101.entry.js → p-3d72203e.entry.js} +1 -1
  232. package/dist/twilight/{p-c74934e9.entry.js → p-4391b061.entry.js} +1 -1
  233. package/dist/twilight/{p-11f1a28b.entry.js → p-457c98ed.entry.js} +1 -1
  234. package/dist/twilight/{p-52ac44c5.entry.js → p-4bd6e04e.entry.js} +1 -1
  235. package/dist/twilight/{p-5b197d71.entry.js → p-4e1dd088.entry.js} +1 -1
  236. package/dist/twilight/{p-17970285.entry.js → p-4f28f97c.entry.js} +1 -1
  237. package/dist/twilight/{p-f32fa56d.entry.js → p-57b49cdf.entry.js} +1 -1
  238. package/dist/twilight/{p-035ea236.entry.js → p-5d8e2e4e.entry.js} +1 -1
  239. package/dist/twilight/{p-01f84b1c.entry.js → p-60d8f39b.entry.js} +1 -1
  240. package/dist/twilight/{p-4b55ed30.entry.js → p-60ed6a43.entry.js} +1 -1
  241. package/dist/twilight/{p-fc27afea.entry.js → p-6585f570.entry.js} +1 -1
  242. package/dist/twilight/{p-356bbb4f.entry.js → p-6deac135.entry.js} +1 -1
  243. package/dist/twilight/{p-7bd6623d.entry.js → p-6fcbb71a.entry.js} +1 -1
  244. package/dist/twilight/{p-6b2c7fd9.entry.js → p-723fd41b.entry.js} +1 -1
  245. package/dist/twilight/{p-01ae33ac.entry.js → p-72cac49f.entry.js} +1 -1
  246. package/dist/twilight/{p-85ca0b80.entry.js → p-759ec1b2.entry.js} +1 -1
  247. package/dist/twilight/{p-40716039.entry.js → p-78ea4116.entry.js} +1 -1
  248. package/dist/twilight/{p-525c6230.entry.js → p-7cdd0edd.entry.js} +1 -1
  249. package/dist/twilight/{p-3d83750f.entry.js → p-7f8842a6.entry.js} +1 -1
  250. package/dist/twilight/{p-619bd683.entry.js → p-8494470d.entry.js} +1 -1
  251. package/dist/twilight/{p-db5c545a.entry.js → p-8640b282.entry.js} +1 -1
  252. package/dist/twilight/{p-7cf69f2f.entry.js → p-8bdb3374.entry.js} +1 -1
  253. package/dist/twilight/{p-a119c0b5.entry.js → p-8e0cb0b4.entry.js} +1 -1
  254. package/dist/twilight/{p-a9a5c8fa.entry.js → p-8e29f889.entry.js} +1 -1
  255. package/dist/twilight/{p-628d1673.entry.js → p-92a92648.entry.js} +1 -1
  256. package/dist/twilight/{p-da736b50.entry.js → p-92bdfae5.entry.js} +1 -1
  257. package/dist/twilight/p-95916068.entry.js +4 -0
  258. package/dist/twilight/{p-Dh7EHj7d.js → p-AfEAfJ98.js} +1 -1
  259. package/dist/twilight/{p-CjEmeOim.js → p-BGvyt9d0.js} +1 -1
  260. package/dist/twilight/{p-BeSwpz9O.js → p-BJydaLla.js} +2 -2
  261. package/dist/twilight/p-BuQQcHl4.js +4 -0
  262. package/dist/twilight/{p-CUtmSDDB.js → p-CL6oN_Q7.js} +1 -1
  263. package/dist/twilight/{p-CgrzPzoa.js → p-CzKVU0uc.js} +1 -1
  264. package/dist/twilight/p-D1YyLASn.js +9 -0
  265. package/dist/twilight/{p-wLMN58-n.js → p-D3Knumjd.js} +1 -1
  266. package/dist/twilight/{p-CZckMsJI.js → p-DPrVo6nK.js} +1 -1
  267. package/dist/twilight/{p-LFMpXt4w.js → p-DZJfoSMn.js} +1 -1
  268. package/dist/twilight/{p-C60CVu0N.js → p-DtRKnFMd.js} +1 -1
  269. package/dist/twilight/{p-8b37e9f6.entry.js → p-a2ef6d82.entry.js} +1 -1
  270. package/dist/twilight/{p-4519a7bc.entry.js → p-a77699f6.entry.js} +1 -1
  271. package/dist/twilight/{p-6ab24467.entry.js → p-aa6980d3.entry.js} +1 -1
  272. package/dist/twilight/{p-5ffdd593.entry.js → p-aaa589b3.entry.js} +1 -1
  273. package/dist/twilight/{p-84bbc5f0.entry.js → p-ab681e13.entry.js} +1 -1
  274. package/dist/twilight/{p-2e7a103f.entry.js → p-ac27db7b.entry.js} +1 -1
  275. package/dist/twilight/{p-53663091.entry.js → p-adb26a1f.entry.js} +1 -1
  276. package/dist/twilight/{p-eea3ae1c.entry.js → p-b17dff86.entry.js} +1 -1
  277. package/dist/twilight/{p-303b4348.entry.js → p-b8879670.entry.js} +6 -6
  278. package/dist/twilight/{p-426ea2e9.entry.js → p-c177ec39.entry.js} +1 -1
  279. package/dist/twilight/{p-4e4dfff9.entry.js → p-c443a332.entry.js} +1 -1
  280. package/dist/twilight/{p-627c326c.entry.js → p-c74ccdee.entry.js} +1 -1
  281. package/dist/twilight/{p-5834f1e5.entry.js → p-c785365c.entry.js} +1 -1
  282. package/dist/twilight/{p-cdc6db50.entry.js → p-c8376047.entry.js} +1 -1
  283. package/dist/twilight/{p-ff0ce619.entry.js → p-ce20b220.entry.js} +1 -1
  284. package/dist/twilight/{p-34b5b7d5.entry.js → p-d04feb4a.entry.js} +1 -1
  285. package/dist/twilight/{p-37291b15.entry.js → p-d369971e.entry.js} +1 -1
  286. package/dist/twilight/{p-9774320f.entry.js → p-d4bf9b9a.entry.js} +1 -1
  287. package/dist/twilight/{p-770d84fb.entry.js → p-d88387cf.entry.js} +1 -1
  288. package/dist/twilight/{p-adab7f42.entry.js → p-d993f567.entry.js} +1 -1
  289. package/dist/twilight/{p-6e1478a1.entry.js → p-d9bc10fa.entry.js} +1 -1
  290. package/dist/twilight/{p-8ae1064c.entry.js → p-dc85db79.entry.js} +1 -1
  291. package/dist/twilight/{p-795f5e87.entry.js → p-e18d93d6.entry.js} +1 -1
  292. package/dist/twilight/{p-068ab5b3.entry.js → p-e3c42341.entry.js} +1 -1
  293. package/dist/twilight/{p-8c679c7b.entry.js → p-e8514ae6.entry.js} +1 -1
  294. package/dist/twilight/{p-355b31ee.entry.js → p-e9029b24.entry.js} +1 -1
  295. package/dist/twilight/{p-b5083002.entry.js → p-ebfbda5f.entry.js} +1 -1
  296. package/dist/twilight/p-ed061a5a.entry.js +4 -0
  297. package/dist/twilight/{p-bde5b9ac.entry.js → p-ed4a6e2d.entry.js} +1 -1
  298. package/dist/twilight/{p-c2ec7224.entry.js → p-ef824ee1.entry.js} +1 -1
  299. package/dist/twilight/p-f3a8ffbe.entry.js +4 -0
  300. package/dist/twilight/{p-d4780439.entry.js → p-f44362e9.entry.js} +1 -1
  301. package/dist/twilight/{p-05989724.entry.js → p-f4c8cace.entry.js} +1 -1
  302. package/dist/twilight/{p-2b3591c9.entry.js → p-f7c7dd70.entry.js} +1 -1
  303. package/dist/twilight/{p-c7376a3d.entry.js → p-fbea393e.entry.js} +1 -1
  304. package/dist/twilight/{p-96b69cc2.entry.js → p-fcb5ea5d.entry.js} +1 -1
  305. package/dist/twilight/{p-e49e893c.entry.js → p-fe4866b6.entry.js} +1 -1
  306. package/dist/twilight/{p-BoSXpmeB.js → p-q7sRVQkm.js} +1 -1
  307. package/dist/twilight/twilight.esm.js +1 -1
  308. package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +1 -0
  309. package/dist/types/components/salla-trust-badges/salla-trust-badges.d.ts +2 -2
  310. package/package.json +5 -5
  311. package/dist/twilight/p-2d0bbec1.entry.js +0 -4
  312. package/dist/twilight/p-6b58eb2d.entry.js +0 -4
  313. package/dist/twilight/p-Ck4ltJzi.js +0 -9
  314. package/dist/twilight/p-DILJJ674.js +0 -4
  315. package/dist/twilight/p-ca1140a4.entry.js +0 -4
  316. package/dist/twilight/p-e682012f.entry.js +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.14.459",
3
+ "version": "2.14.461",
4
4
  "license": "GPL-3.0",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -81,9 +81,9 @@
81
81
  },
82
82
  "dependencies": {
83
83
  "@googlemaps/markerclusterer": "2.6.2",
84
- "@salla.sa/applepay": "2.14.459",
85
- "@salla.sa/twilight": "2.14.459",
86
- "@salla.sa/twilight-tailwind-theme": "2.14.459",
84
+ "@salla.sa/applepay": "2.14.461",
85
+ "@salla.sa/twilight": "2.14.461",
86
+ "@salla.sa/twilight-tailwind-theme": "2.14.461",
87
87
  "@salla.sa/ui-address-autocomplete-widget": "1.2.1",
88
88
  "@salla.sa/ui-google-map-render": "1.2.1",
89
89
  "@types/node": "^20.4.8",
@@ -104,5 +104,5 @@
104
104
  "vanilla-lazyload": "^17.8.5",
105
105
  "vanilla-picker": "^2.12.2"
106
106
  },
107
- "gitHead": "41766862d8256301a1ef8bc2ca6724d59fae50cc"
107
+ "gitHead": "919fe7cfdd97bdc99957d30034a37d5c466900cf"
108
108
  }
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{h as s,r as a}from"./p-LFMpXt4w.js";import{s as l}from"./p-dn_hTofo.js";import{n as o,a as t,c as r}from"./p-CZckMsJI.js";import{S as e,a as i}from"./p-Bs6JxDkg.js";import{S as p}from"./p-CZRcMGA9.js";import{S as n}from"./p-D1s2kXqL.js";import{S as c}from"./p-QpH8MU22.js";import{S as y}from"./p-0-eTJXSD.js";import{S as m}from"./p-CXRKXFgT.js";import{T as g}from"./p-DILJJ674.js";import{a as d}from"./p-CgtvEd63.js";var h=function(s,a,l,o){var t,r=arguments.length,e=r<3?a:null===o?o=Object.getOwnPropertyDescriptor(a,l):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)e=Reflect.decorate(s,a,l,o);else for(var i=s.length-1;i>=0;i--)(t=s[i])&&(e=(r<3?t(e):r>3?t(a,l,e):t(a,l))||e);return r>3&&e&&Object.defineProperty(a,l,e),e};const u={all:s("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:i}),free_shipping:s("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:p}),coupon_discount:s("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:e}),free_product:s("span",{class:"s-loyalty-program-rewards-tab-icon",innerHTML:n})},f=class{constructor(s){a(this,s),this.currentPrize=null,this.collapsed=!0,this.animatedPoints=0,this.handleExchangeSucceeded=()=>{this.points(),this.program()}}componentWillLoad(){return salla.onReady().then((()=>salla.lang.onLoaded())).then((()=>l())).then((()=>{this.program(),this.points(),salla.event.on("loyalty::exchange.succeeded",this.handleExchangeSucceeded)})).catch((s=>salla.logger.error(s)))}disconnectedCallback(){salla.event.off("loyalty::exchange.succeeded",this.handleExchangeSucceeded)}getOutlineItem(a,l,o){const t={1:s("span",{innerHTML:c}),2:s("span",{innerHTML:y}),3:s("span",{innerHTML:'\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>cart-upload</title>\n<path d="M14.545 7.669l3.121-2.732v9.729c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-9.728l3.121 2.732c0.253 0.22 0.567 0.329 0.879 0.329 0.371 0 0.74-0.155 1.004-0.455 0.485-0.555 0.429-1.396-0.125-1.881l-5.333-4.667c-0.503-0.44-1.253-0.44-1.756 0l-5.333 4.667c-0.555 0.484-0.611 1.327-0.125 1.881 0.484 0.552 1.325 0.609 1.881 0.124zM30.647 5.371c-0.713-0.171-1.436 0.267-1.609 0.983l-2.744 11.363c-0.171 0.568-0.684 0.951-1.277 0.951h-12.136c-0.563 0-1.067-0.356-1.256-0.885l-6.035-16.896c-0.189-0.531-0.692-0.885-1.256-0.885h-2.667c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.727l5.719 16.012c0.567 1.588 2.081 2.655 3.768 2.655h12.136c1.78 0 3.32-1.145 3.851-2.92l2.763-11.433c0.173-0.716-0.267-1.436-0.983-1.609zM13.667 24c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM13.667 29.333c-0.735 0-1.333-0.599-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.599 1.333-1.333 1.333zM24.333 24c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM24.333 29.333c-0.735 0-1.333-0.599-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.599 1.333 1.333-0.599 1.333-1.333 1.333z"></path>\n</svg>\n'})};return s("li",{class:"s-loyalty-program-item"},s("div",{class:"s-loyalty-program-content"},s("span",{class:"s-loyalty-program-icon-container"},s("span",{class:"s-loyalty-program-text-gradient"},a),s("span",{class:"s-loyalty-program-icon"},t[a])),s("div",{class:"s-loyalty-program-title"},l),s("div",{class:"s-loyalty-program-description"},o)))}render(){if("error"===this.program.status)return s("p",null,salla.lang.get("common.errors.error_occured"));const a=this.program.data.points.slice(0,this.collapsed?t(this.program.data.points.length):this.program.data.points.length),l=this.program.data.prizes,o=this.program.data.prizes_count;return s("div",{class:"s-loyalty-program-container"},s("salla-loyalty-hero",{name:this.program.data.name,description:this.program.data.description,image:this.program.data.image},salla.config.isUser()?s("div",{slot:"crosspoint",class:"s-loyalty-program-profile-wrapper"},s("div",{class:"s-loyalty-program-profile-container"},s("div",{class:"s-loyalty-program-profile-points-section"},s("h2",{class:"s-loyalty-program-profile-label"},salla.lang.get("pages.loyalty_program.your_points")),s("p",{class:"s-loyalty-program-profile-points"},s("span",{class:"s-loyalty-program-profile-points-value"},this.animatedPoints?this.animatedPoints:this.points.data)," ",salla.lang.get("pages.loyalty_program.point"))),s("div",{class:"s-loyalty-program-profile-icon"},s("span",{innerHTML:m})))):s("button",{slot:"action",onClick:()=>salla.event.dispatch("login::open"),class:{"s-loyalty-program-login-action":!0,"s-loyalty-program-login-action-dark":!this.program.data.image,"s-loyalty-program-login-action-light":!!this.program.data.image}},salla.lang.get("blocks.header.login"))),s("div",{class:"s-loyalty-program-outline-section"},s("section",{class:"s-loyalty-program-section"},s("header",{class:"s-loyalty-program-header"},s("h1",{class:"s-loyalty-program-main-title"},salla.lang.get("pages.loyalty_program.how_to_start")),s("p",{class:"s-loyalty-program-subtitle"},salla.lang.get("pages.loyalty_program.three_simple_steps"))),s("ol",{class:"s-loyalty-program-list"},this.getOutlineItem(1,salla.lang.get("pages.loyalty_program.register"),salla.lang.get("pages.loyalty_program.create_account")),this.getOutlineItem(2,salla.lang.get("pages.loyalty_program.earn_points"),salla.lang.get("pages.loyalty_program.complete_tasks")),this.getOutlineItem(3,salla.lang.get("pages.loyalty_program.redeem_rewards"),salla.lang.get("pages.loyalty_program.enjoy_rewards"))))),s("div",{class:"s-loyalty-program-points-wrapper"},s("section",{class:"s-loyalty-program-points-section"},s("header",{class:"s-loyalty-program-points-header"},s("h1",{class:"s-loyalty-program-points-title"},this.program.data.promotion_title),s("p",{class:"s-loyalty-program-points-description"},this.program.data.promotion_description)),s("div",{class:"s-loyalty-program-points-spacer"}),s("ul",{class:{"s-loyalty-program-points-list-one":1===this.program.data.points.length,"s-loyalty-program-points-list-two":2===this.program.data.points.length,"s-loyalty-program-points-list-multi":this.program.data.points.length>2}},a.map((a=>s("li",null,s("salla-loyalty-point",{point:a}))))),s("div",{class:"s-loyalty-program-points-spacer"}),t(this.program.data.points.length)!==this.program.data.points.length&&s("button",{class:"s-loyalty-program-points-more-button",onClick:()=>this.collapsed=!this.collapsed},this.collapsed?s("span",null,salla.lang.get("pages.loyalty_program.show_more"),"  ",s("span",{style:{fontSize:"1.2rem",fontWeight:"300"}},"+")):s("span",null,salla.lang.get("pages.loyalty_program.show_less"),"  ",s("span",{style:{fontSize:"1.2rem",fontWeight:"300"}},"-"))))),"success"!==this.program.status?"":s("div",{class:"s-loyalty-program-rewards-container s-loyalty-program-slider-arrows-edges"},s("section",{class:{"s-loyalty-program-tabs-hider":l.length<=2||o<=4}},s("h1",{class:"s-loyalty-program-rewards-heading-mobile"},salla.lang.get("pages.loyalty_program.rewards")),s("salla-tabs",null,s("div",{slot:"header",class:"s-loyalty-program-rewards-tab-items"},l.map((a=>s("salla-tab-header",{slot:"header",name:a.type},u[a.type],s("span",null,a.title))))),s("h1",{slot:"header",class:"s-loyalty-program-rewards-heading-desktop"},salla.lang.get("pages.loyalty_program.rewards")),l.map((a=>s("salla-tab-content",{slot:"content",name:a.type},s("salla-slider",{id:a.type,type:"default","slider-config":'{"loop":false,"slidesPerView":"auto","freeMode":true,"spaceBetween":12,"breakpoints":{"768":{"slidesPerView":4,"spaceBetween":24,"freeMode":false,"speed":300}}}'},s("div",{slot:"items"},a.items.map((a=>s("salla-reward-card",{prize:a,onAreaClick:()=>{this.currentPrize=a,r((()=>this.detailsModal.open()))},onActionClick:()=>{this.currentPrize=a,r((()=>this.detailsModal.open()))}}))))))))),s("salla-modal",{ref:s=>this.detailsModal=s,class:"s-loyalty-program-modal",width:"md",noPadding:!0},this.currentPrize?s("salla-reward-details",{onActionClick:()=>r((()=>this.exchangeModal.open())),prize:this.currentPrize}):""),s("salla-modal",{ref:s=>this.exchangeModal=s,class:"s-loyalty-program-modal",width:"sm"},this.currentPrize?s("salla-reward-exchange",{prize:this.currentPrize}):""))))}};h([g((async function(){const{data:s}=await salla.loyalty.getProgram();return o(s)}),{initialData:{points:[],prizes:[],prizes_count:0}})],f.prototype,"program",void 0),h([g((async function(){const{data:s}=await salla.loyalty.getPoints();return d({targets:{value:0},value:s.points??0,round:1,easing:"easeOutQuad",duration:2e3,update:s=>{this.animatedPoints=s.animations[0].currentValue}}),s.points}))],f.prototype,"points",void 0),f.style="";export{f as salla_loyalty_program}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as s,h as t,a as e}from"./p-LFMpXt4w.js";var o,i;!function(s){s.ProductDetail="product.single",s.Cart="cart"}(o||(o={})),function(s){s.Conditional="conditional",s.PercentageOrFixed="fixed",s.DiscountsTable="discounts_table",s.Bank="bank",s.BuyXGetY="buy_x_get_y",s.SpecialPrice="special_price",s.Percentage="percentage",s.FixedAmount="fixed_amount"}(i||(i={}));const r=class{constructor(t){s(this,t),this.productCardComponent="salla-product-card",this.offersList=[],this.canRender=!1,this.showOffer=salla.config.get("store.settings.product.show_special_offers"),this.showAllOffersModal=!1,this.showProductsModal=!1,this.selectedOfferProducts=[],this.collapsedOffers={},this.expandedCategories={},this.productsLoaded=!1,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=s=>salla.lang.get("pages.offer.buy_quantity",{quantity:s}),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,t)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:t},`بحد أدنى ${s} ${t} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج"),salla.lang.onLoaded((()=>{this.offer_with_price_text=salla.lang.get("pages.offer.with_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(0),this.products_link_text=salla.lang.get("pages.offer.included_products","المنتجات المشمولة"),this.min_spend_text=(s,t)=>salla.lang.get("pages.offer.min_spend_amount",{amount:s,currency:t},`بحد أدنى ${s} ${t} من مبلغ الشراء`),this.min_items_text=s=>salla.lang.get("pages.offer.min_items",{items:s},`بحد أدنى ${s} منتجات`),this.product_text=salla.lang.get("common.elements.product","منتج")})),salla.onReady((()=>{this.currentPage=salla.config.get("page.slug");const s=salla.config.get("currencies")||{},t=salla.config.get("user.currency_code");this.userCurrency=s[t]||{symbol:"",code:t||"SAR",name:""}}))}async getEndpointByPageName(){return this.currentPage==o.Cart?`offers/cart/${await Salla.cart.getCurrentCartId()}`:this.currentPage==o.ProductDetail?`offers/product/${salla.config.get("page.id")}`:"offers"}emitPromotionViewed(){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const s=this.offersList.slice(0,5).map(((s,t)=>({id:s.id,name:s.title,creative:s.description||"",position:t+1})));salla.event.emit("salla::offer.promotion.viewed",s)}emitPromotionClicked(s,t=1){if(!(this.offersList.length&&this.canRender&&this.showOffer))return;const e=s||this.offersList[0];salla.event.emit("salla::offer.promotion.clicked",[{id:e.id,name:e.title,creative:e.description||"",position:t}])}componentWillLoad(){return this.hasCustomComponent=!!customElements.get(this.productCardComponent),new Promise((s=>salla.onReady(s))).then((()=>{if(this.showOffer=!salla.url.is_page("product.single")||salla.config.get("store.settings.product.show_special_offers"),!this.showOffer)throw new Error("Merchant disabled showing the offers on product page")})).then((async()=>this.currentPage==o.Cart?salla.api.cart.offers():salla.api.request(await this.getEndpointByPageName()))).then((async s=>{if(!(this.offersList=s.data).length)throw new Error("salla-offers:: There is no offers!");if(this.offersList=this.offersList.filter((s=>[i.SpecialPrice,i.Bank,i.BuyXGetY,i.DiscountsTable,i.PercentageOrFixed,i.Percentage,i.FixedAmount].includes(s.type))),!this.offersList.length)throw new Error("salla-offers:: No supported offer types found!");let t=null;this.offersList.some((s=>{const t=s.details;return"category"===t.apply_to&&t.targets||"categories"===t.apply_to&&t.targets||s.type===i.BuyXGetY&&("categories"===t.get?.source||"category"===t.get?.source)}))&&(t=(await salla.product.api.categories()).data);const e=new Set;for(const s of this.offersList){const t=s.details;"product"!==t.apply_to&&"products"!==t.apply_to||!t.targets||t.targets.forEach((s=>e.add(s))),s.type===i.BuyXGetY&&"products"===t.get?.source&&t.get?.source_value&&t.get.source_value.forEach((s=>e.add(s))),s.type!==i.BuyXGetY||"products"!==t.buy?.source&&"product"!==t.buy?.source||!t.buy?.source_value||t.buy.source_value.forEach((s=>e.add(s)))}let o={};if(e.size>0)try{const s=await salla.product.api.fetch({source:"selected",source_value:Array.from(e)});o=Object.fromEntries(s.data.map((s=>[s.id,s])))}catch(s){o={}}for(const s of this.offersList){const e=s.details;if(("category"===e.apply_to&&e.targets||"categories"===e.apply_to&&e.targets)&&t&&(e.categories=this.findCategories(t,e.targets)),"product"!==e.apply_to&&"products"!==e.apply_to||!e.targets||(e.products=e.targets.map((s=>o[s])).filter(Boolean)),"brand"===e.apply_to&&e.targets&&(e.brands=e.targets),"tag"===e.apply_to&&e.targets&&(e.tags=e.targets),s.type===i.BuyXGetY&&e.get){const s=e.get;"products"===s.source&&s.source_value?s.products=s.source_value.map((s=>o[s])).filter(Boolean):("categories"===s.source||"category"===s.source)&&t&&s.source_value&&(s.categories=this.findCategories(t,s.source_value),e.categories=s.categories)}if(s.type===i.BuyXGetY&&e.buy){const s=e.buy;"products"!==s.source&&"product"!==s.source||!s.source_value||(s.products=s.source_value.map((s=>o[s])).filter(Boolean))}}return this.offersList})).then((()=>{this.canRender=!0})).catch((s=>{salla.logger.warn(s)}))}componentDidLoad(){let s=this.host.querySelector(".s-slider-block__title-nav");s?.classList.add("s-offer-bank-payment-nav"),this.emitPromotionViewed()}findCategories(s,t){let e=[];for(const o of s)t.includes(o.id_||o.id)&&e.push(o),o.sub_categories?.length>0&&(e=e.concat(this.findCategories(o.sub_categories,t)));return e}render(){if(!this.offersList.length||!this.canRender||!this.showOffer)return null;const s=salla.lang.get("pages.offer.offers_title","عروض المنتج"),e=salla.lang.get("pages.offer.offers_subtitle","احصل على المنتج بسعر مخفض مع أفضل العروض");return[t("div",{class:"s-offer-wrapper"},t("salla-slider",{type:"carousel",id:"offers-slider","block-title":s,"block-subTitle":e,"show-controls":this.offersList.length>1},t("div",{slot:"items"},this.offersList.slice(0,5).map(((s,t)=>this.renderOfferCard(s,t+1))),this.offersList.length>5&&this.renderShowMoreCard()))),this.renderAllOffersModal(),this.renderProductsModal()]}renderShowMoreCard(){return t("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:s=>{s.preventDefault(),s.stopPropagation(),this.openAllOffersModal()}},t("div",{class:"s-offer-card s-offer-show-more-card"},t("i",{class:"sicon-add s-offer-show-more-icon"}),t("h3",{class:"s-offer-show-more-title"},salla.lang.get("pages.offer.show_more_offers","عرض المزيد من العروض"))))}openAllOffersModal(){this.showAllOffersModal=!0}closeAllOffersModal(){this.showAllOffersModal=!1}closeProductsModal(){this.showProductsModal=!1,this.selectedOfferProducts=[],this.productsLoaded=!1}handleAccordionToggle(s,t){this.collapsedOffers={...this.collapsedOffers,[s]:t}}getOfferProducts(s){const t=s.details;return t.products&&t.products.length>0?t.products:s.type===i.BuyXGetY&&t.get?.products?t.get.products:[]}renderProductsLinkForModalCard(s,e){const o=this.getOfferProducts(s);return o&&0!==o.length?t("div",{class:"s-offer-products-link",onClick:s=>{s.stopPropagation(),this.selectedOfferProducts=o,this.showProductsModal=!0}},t("span",{class:"s-offer-products-link-text"},this.products_link_text),e&&t("i",{class:"sicon-keyboard_arrow_down s-offer-products-link-icon"})):null}renderAllOffersModal(){return t("salla-drawer",{visible:this.showAllOffersModal,position:"right",width:"md","no-padding":!0,"drawer-title":salla.lang.get("pages.offer.all_offers_title","جميع العروض"),onDrawerVisibilityChanged:s=>!s.detail&&this.closeAllOffersModal()},t("div",{class:"s-offer-drawer-content"},this.offersList.map(((s,t)=>this.renderModalOfferCard(s,t+1)))))}renderProductsModal(){return t("salla-drawer",{visible:this.showProductsModal,width:"md",position:"right","no-padding":!0,"drawer-title":this.products_link_text,onDrawerVisibilityChanged:s=>!s.detail&&this.closeProductsModal()},t("div",{class:"s-offer-products-drawer-content"},this.selectedOfferProducts?.length>0?t("div",null,!this.productsLoaded&&t("div",{class:"flex items-center justify-center p-8"},t("salla-loading",{size:"24"})),t("salla-products-list",{source:"selected","source-value":JSON.stringify(this.selectedOfferProducts.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"],onProductsFetched:()=>this.productsLoaded=!0})):t("div",{class:"p-4 text-center text-gray-500"},salla.lang.get("blocks.products.no_products_found","لا توجد منتجات"))))}renderModalOfferCard(s,e=1){const o=this.getOfferProducts(s),r=o&&o.length>0,a=!1!==this.collapsedOffers[s.id];return t("div",{class:"s-offer-drawer-card"},t("div",{class:"s-offer-card-main",onClick:()=>this.emitPromotionClicked(s,e)},t("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),t("div",{class:"s-offer-card-content"},t("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&t("p",{class:"s-offer-card-description"},s.description),s.type===i.DiscountsTable?t("div",{class:"s-offer-card-details"},this.renderDiscountTableOfferContent(s)):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?t("div",{class:"s-offer-card-details"},this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)):t("div",{class:"s-offer-card-details"},this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)))),r&&t("salla-accordion",{collapsed:a,collapsible:!0,size:"sm",onClick:s=>s.stopPropagation(),onAccordionToggle:t=>this.handleAccordionToggle(s.id,t.detail.payload.collapsed)},t("salla-accordion-head",{collapsible:!0,collapsed:a},t("div",{slot:"title",class:"s-offer-products-thumbnails"},t("span",{class:"s-offer-products-title"},this.products_link_text,t("i",{class:`sicon-keyboard_arrow_${a?"down":"up"} s-offer-products-link-icon`})),t("div",{class:"s-offer-products-thumbnails-stack"},o.slice(0,3).map(((s,e)=>t("div",{class:"s-offer-product-thumbnail",style:{zIndex:`${e+1}`}},t("img",{src:s.thumbnail||s.image?.url||salla.url.cdn("images/s-empty.png"),alt:s.name})))),o.length>3&&t("div",{class:"s-offer-products-more-count",style:{zIndex:"7"}},"+",o.length-3)))),t("salla-accordion-body",null,t("div",{class:"s-offer-products-content"},t("salla-products-list",{source:"selected","source-value":JSON.stringify(o.map((s=>s.id))),"product-card-component":this.productCardComponent,"horizontal-cards":!0,"compact-cards":!0,includes:["images"]})))))}renderOfferCard(s,e=1){return t("div",{class:"s-offer-slide-one-fourth swiper-slide",onClick:()=>this.emitPromotionClicked(s,e)},t("div",{class:"s-offer-card"},t("div",{class:"s-offer-card-icon"},this.getOfferIcon(s.type)),t("div",{class:"s-offer-card-content"},t("h3",{class:"s-offer-card-title",title:s.title},s.title),s.description&&t("p",{class:"s-offer-card-description"},s.description),t("div",{class:"s-offer-card-details"},s.type===i.DiscountsTable?this.renderDiscountTableOfferContent(s):s.type===i.PercentageOrFixed||s.type===i.Percentage||s.type===i.FixedAmount?[this.renderPercentageOrFixedOfferContent(s),this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)]:[this.renderOfferCategories(s),this.renderOfferBrands(s),this.renderOfferTags(s)],this.renderProductsLinkForModalCard(s,!1)))))}getOfferIcon(s){return t("i",{class:{[i.DiscountsTable]:"sicon-discount-calculator",[i.Bank]:"sicon-bank",[i.SpecialPrice]:"sicon-fire",[i.BuyXGetY]:"sicon-gift",[i.PercentageOrFixed]:"sicon-special-discount",[i.Percentage]:"sicon-special-discount",[i.FixedAmount]:"sicon-special-discount"}[s]||"sicon-discount"})}renderDiscountTableOfferContent(s){const e=s.details.discounts||[];return e.length?t("div",null,t("div",{class:"s-offer-card-description"},salla.lang.get("pages.offer.discount_table_subtitle","وفر اكتر بشراء منتجات أكثر")),t("table",{class:"s-offer-discount-table"},t("tbody",null,this.groupDiscountsByRows(e,3).map(((s,e)=>t("tr",{key:e},s.map(((s,e)=>t("td",{key:e},t("div",{class:"s-offer-discount-percentage"},s.percentage,"%"),t("div",{class:"s-offer-discount-condition"},this.formatDiscountCondition(s))))))))))):null}renderPercentageOrFixedOfferContent(s){const e=s.details;return e.discount_value||e.min_spend>0||e.min_items>0?t("div",{class:"s-offer-percentage-fixed-content"},e.min_spend>0&&t("div",{class:"s-offer-min-spend"},this.min_spend_text(e.min_spend,this.userCurrency?.symbol||"")),e.min_items>0&&t("div",{class:"s-offer-min-items"},this.min_items_text(e.min_items))):null}groupDiscountsByRows(s,t){const e=[];for(let o=0;o<s.length;o+=t)e.push(s.slice(o,o+t));return e}formatDiscountCondition(s){return s.discounted_amount?`${s.discounted_amount} ${this.userCurrency?.symbol||""}`:null!=s.quantity?this.buy_quantity_text(s.quantity):`1 ${this.product_text}`}renderOfferCategories(s){const e=s.details;let o=e.categories||[];if(s.type===i.BuyXGetY&&e.get?.categories&&(o=e.get.categories),!o.length)return null;const r=this.expandedCategories[s.id],a=o.length>3,l=r?o:o.slice(0,3);return t("div",{class:"s-offer-categories"},t("div",{class:"s-offer-categories-list"},l.map(((s,e)=>t("a",{key:e,class:"s-offer-category-item",href:s.url||salla.url.create("categories",s.id||s.id_)},s.name))),a&&t("span",{class:"s-offer-categories-toggle",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.toggleCategoryExpansion(s.id)}},r?t("span",null,t("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):t("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(o.length-3)," ",t("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferBrands(s){const e=s.details.brands||[];if(!e.length)return null;const o=this.expandedCategories[s.id],i=e.length>3,r=o?e:e.slice(0,3);return t("div",{class:"s-offer-categories"},t("div",{class:"s-offer-categories-list"},r.map(((s,e)=>t("a",{key:e,class:"s-offer-category-item",href:s.url},s.name))),i&&t("span",{class:"s-offer-categories-toggle",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.toggleCategoryExpansion(s.id)}},o?t("span",null,t("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):t("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(e.length-3)," ",t("i",{class:"sicon-keyboard_arrow_down"})))))}renderOfferTags(s){const e=s.details.tags||[];if(!e.length)return null;const o=this.expandedCategories[s.id],i=e.length>3,r=o?e:e.slice(0,3);return t("div",{class:"s-offer-categories"},t("div",{class:"s-offer-categories-list"},r.map(((s,e)=>t("a",{key:e,class:"s-offer-category-item",href:s.url||salla.url.create("tags",s.id)},s.name))),i&&t("span",{class:"s-offer-categories-toggle",onClick:t=>{t.preventDefault(),t.stopPropagation(),this.toggleCategoryExpansion(s.id)}},o?t("span",null,t("i",{class:"sicon-keyboard_arrow_up"})," ",salla.lang.get("common.elements.hide","إخفاء")):t("span",null,salla.lang.get("common.elements.show","عرض")," ","+"+(e.length-3)," ",t("i",{class:"sicon-keyboard_arrow_down"})))))}toggleCategoryExpansion(s){this.expandedCategories={...this.expandedCategories,[s]:!this.expandedCategories[s]}}get host(){return e(this)}};r.style=":host .s-drawer-close:where([dir=rtl],[dir=rtl] *){left:0}";export{r as salla_offer}
@@ -1,9 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{d as e}from"./p-LFMpXt4w.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var n,i,E={exports:{}},r=n?E.exports:(n=1,E.exports=(i=function(e){var t=e.addFilter,n=e.utils,i=n.Type,E=n.isString,r=n.replaceInString,T=n.guesstimateMimeType,u=n.getExtensionFromFilename,o=n.getFilenameFromURL,_=function(e,t){return e.some((function(e){return/\*$/.test(e)?(n=e,(/^[^/]+/.exec(t)||[]).pop()===n.slice(0,-2)):e===t;var n}))},a=function(e,t,n){if(0===t.length)return!0;var i=function(e){var t="";if(E(e)){var n=o(e),i=u(n);i&&(t=T(i))}else t=e.type;return t}(e);return n?new Promise((function(E,r){n(e,i).then((function(e){_(t,e)?E():r()})).catch(r)})):_(t,i)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var n=t.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||a(e,n("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var n=t.query;return new Promise((function(t,i){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var E=n("GET_ACCEPTED_FILE_TYPES"),T=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),u=a(e,E,T),o=function(){var e,t=E.map((e=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(t){return null!==e[t]&&(e[t]||t)})).filter((function(e){return!1!==e})),T=t.filter((function(e,n){return t.indexOf(e)===n}));i({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:r(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:T.join(", "),allButLastType:T.slice(0,-1).join(", "),lastType:T[T.length-1]})}})};if("boolean"==typeof u)return u?t(e):o();u.then((function(){t(e)})).catch(o)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i)),T=t({__proto__:null,default:e(r)},[r]);
5
- /*!
6
- * FilePondPluginFileValidateType 1.2.9
7
- * Licensed under MIT, https://opensource.org/licenses/MIT/
8
- * Please visit https://pqina.nl/filepond/ for details.
9
- */export{T as f}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{f as t}from"./p-LFMpXt4w.js";function r(r,s={}){return s=Object.assign({initialData:void 0,initialStatus:"idle"},s),(i,e)=>{const o=Object.assign((function(...s){const i=r=>{Object.assign(this[e],r),t(this)};return i({status:"pending",error:void 0}),r.call(this,...s).then((t=>(i({status:"success",data:t,error:void 0}),t)),(t=>(i({status:"error",error:t}),Promise.reject(t))))}),{status:s.initialStatus,data:s.initialData,error:void 0});Object.defineProperty(i,e,{value:o})}}export{r as T}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as e,H as s,a as i}from"./p-LFMpXt4w.js";const r=class{constructor(e){t(this,e),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel="",this.cachedChain=[],this.enforceVisibility=()=>{const t=this.hostEl;if(!t||!t.isConnected)return;const e=this.getBadgeData();if(e&&!this.isHostVisible(t)){for(const e of this.getAncestorChain(t)){const t=getComputedStyle(e);"none"===t.display&&e.style.setProperty("display","flex","important"),"hidden"!==t.visibility&&"collapse"!==t.visibility||e.style.setProperty("visibility","visible","important"),parseFloat(t.opacity)<r.OPACITY_THRESHOLD&&e.style.setProperty("opacity","1","important"),"hidden"===t.contentVisibility&&e.style.setProperty("content-visibility","visible","important")}this.logHidePreventedOnce(e.type)}},this.runEnforce=()=>{this.clearEnforceTimers(),this.enforceVisibility()}}componentWillLoad(){this.initializeTranslations()}connectedCallback(){this.setupVisibilityGuard()}componentDidLoad(){this.scheduleEnforce()}componentDidRender(){this.scheduleEnforce()}disconnectedCallback(){this.attrObserver?.disconnect(),this.attrObserver=void 0,this.moveObserver?.disconnect(),this.moveObserver=void 0,this.cachedChain=[],this.clearEnforceTimers()}getAncestorChain(t){const e=[];let s=t;for(;s&&(e.push(s),s!==document.documentElement);)s=s.parentElement;return e}didChainChange(t){const e=this.getAncestorChain(t);if(e.length!==this.cachedChain.length)return!0;for(let t=0;t<e.length;t++)if(e[t]!==this.cachedChain[t])return!0;return!1}isHostVisible(t){return"function"==typeof t.checkVisibility?t.checkVisibility({contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0}):this.isVisibleFallback(t)}isVisibleFallback(t){let e=t;for(;e;){const t=getComputedStyle(e);if("none"===t.display)return!1;if("hidden"===t.visibility||"collapse"===t.visibility)return!1;if(parseFloat(t.opacity)<r.OPACITY_THRESHOLD)return!1;if("hidden"===t.contentVisibility)return!1;if(e===document.documentElement)break;e=e.parentElement}return!0}logHidePreventedOnce(t){try{if(salla.storage.get(r.HIDE_PREVENTED_LOGGED_KEY))return;salla.analytics?.log("salla::trust-badges.hide-prevented",{type:t}),salla.storage.set(r.HIDE_PREVENTED_LOGGED_KEY,!0)}catch{}}clearEnforceTimers(){void 0!==this.enforceTimer&&(clearTimeout(this.enforceTimer),this.enforceTimer=void 0),void 0!==this.maxWaitTimer&&(clearTimeout(this.maxWaitTimer),this.maxWaitTimer=void 0)}scheduleEnforce(){void 0!==this.enforceTimer&&clearTimeout(this.enforceTimer),this.enforceTimer=setTimeout(this.runEnforce,r.ENFORCE_DEBOUNCE_MS),void 0===this.maxWaitTimer&&(this.maxWaitTimer=setTimeout(this.runEnforce,r.ENFORCE_MAX_WAIT_MS))}setupVisibilityGuard(){const t=this.hostEl;t&&"undefined"!=typeof MutationObserver&&(this.attrObserver?.disconnect(),this.moveObserver?.disconnect(),this.attrObserver=new MutationObserver((()=>{const t=this.hostEl;t&&t.isConnected&&(this.isHostVisible(t)||this.scheduleEnforce())})),this.attachAttrObserver(t),this.moveObserver=new MutationObserver((()=>{const t=this.hostEl;t&&t.isConnected&&this.didChainChange(t)&&(this.attachAttrObserver(t),this.scheduleEnforce())})),this.moveObserver.observe(document.documentElement,{childList:!0,subtree:!0}))}attachAttrObserver(t){if(this.attrObserver){this.attrObserver.disconnect(),this.cachedChain=this.getAncestorChain(t);for(const t of this.cachedChain)this.attrObserver.observe(t,{attributes:!0,attributeFilter:["style","class","hidden"]})}}initializeTranslations(){salla.lang.onLoaded((()=>{const t=(t,e,s)=>{salla.helpers.setNested(salla.lang.messages[t],e,s)};t("ar.trans","blocks.footer.commercial_register","السجل التجاري"),t("en.trans","blocks.footer.commercial_register","Commercial Register"),t("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),t("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const t=salla.config.get("store.settings.commercial_number"),e=salla.config.get("store.settings.freelance_number");return t?{number:t,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:e?{number:e,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const t=this.getBadgeData();return t?e(s,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},e("img",{class:"s-trust-badges-image",width:"55",height:"55",src:t.imageUrl,alt:t.label}),e("div",{class:"s-trust-badges-content"},e("p",{class:"s-trust-badges-label"},t.label),e("b",{class:"s-trust-badges-number"},t.number))):null}get hostEl(){return i(this)}};r.OPACITY_THRESHOLD=.1,r.ENFORCE_DEBOUNCE_MS=1500,r.ENFORCE_MAX_WAIT_MS=3e3,r.HIDE_PREVENTED_LOGGED_KEY="salla::trust-badges-hide-prevented-logged",r.style="";export{r as salla_trust_badges}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as a,h as l,a as s}from"./p-LFMpXt4w.js";const i=class{constructor(l){a(this,l),this.languageNames={ar:"العربية",en:"English",sq:"shqip",hy:"հայերէն",bg:"български",zh:"汉语",hr:"hrvatski",cs:"čeština",da:"dansk",nl:"dutch",et:"eesti keel",fi:"suomen kieli",fr:"Français",de:"Deutsch",el:"Ελληνικά",hi:"हिन्दी",hu:"magyar",ind:"bahasa Indonesia",ga:"Gaeilge",it:"Italiano",ja:"日本語",ko:"한국어",lv:"latviešu",mt:"Maltese",fa:"فارسی",pl:"Polish",pt:"português",ro:"română",ru:"русский",sl:"slovenščina",es:"Español",sv:"svenska",tl:"Tagalog (Filipino)",tr:"Türkçe",uk:"украї́нська",ur:"اُردُو",ms:"Bahasa Malaysia"},this.currenciesList={SAR:{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"},USD:{en:"US Dollar",ar:"دولار أمريكي",symbol:"$"},EUR:{en:"Euro",ar:"يورو",symbol:"€"},AED:{en:"UAE Dirham",ar:"درهم اماراتي",symbol:"د.إ"},KWD:{en:"Kuwaiti Dinar",ar:"دينار كويتي",symbol:"د.ك"},BHD:{en:"Bahraini Dinar",ar:"دينار بحريني",symbol:"د.ب"},QAR:{en:"Qatari Riyal",ar:"ريال قطري",symbol:"ر.ق"},OMR:{en:"Omani Rial",ar:"ريال عماني",symbol:"ر.ع"},AUD:{en:"Australian Dollar",ar:"دولار استرالي",symbol:"$"},CAD:{en:"Canadian Dollar",ar:"دولار كندي",symbol:"$"},CNY:{en:"Renminbi",ar:"رنمينبي",symbol:"¥"},EGP:{en:"Egyptian Pound",ar:"جنيه مصري",symbol:"ج.م"},GBP:{en:"Pound Sterling",ar:"جنيه استرليني",symbol:"£"},IDR:{en:"Indonesian Rupiah",ar:"روبية إندونيسية",symbol:"Rp"},INR:{en:"Indian Rupee",ar:"روبية هندية",symbol:"₹"},JPY:{en:"Japanese Yen",ar:"ين ياباني",symbol:"¥"},MYR:{en:"Malaysian Ringgit",ar:"رينغيت ماليزي",symbol:"RM"},PKR:{en:"Pakistani Rupee",ar:"روبية باكستانية",symbol:"Rs."},SEK:{en:"Swedish Krona",ar:"كرونة سويدية",symbol:"kr"},SGD:{en:"Singapore Dollar",ar:"دولار سنغافوري",symbol:"$"},TRY:{en:"Turkish Lira",ar:"ليرة تركية",symbol:"₺"},IQD:{en:"Iraqi Dinar",ar:"دينار عراقي",symbol:"د.ع"},LBP:{en:"Lebanese Pound",ar:"ليرة لبنانية",symbol:"ل.ل"},MRO:{en:"Mauritanian Ouguiya",ar:"أوقية موريتانية",symbol:"UM"},SDG:{en:"Sudanese Pound",ar:"جنيه سوداني",symbol:"SDG"},SYP:{en:"Syrian Pound",ar:"ليرة سورية",symbol:"ل.س"},TND:{en:"Tunisian Dinar",ar:"دينار تونسي",symbol:"د.ت"},JOD:{en:"Jordanian Dinar",ar:"دينار أردني",symbol:"JOD"},DZD:{en:"Algerian Dinar",ar:"دينار جزائري",symbol:"دج"},MAD:{en:"Moroccan Dirham",ar:"درهم مغربي",symbol:"د.م."},LYD:{en:"Libyan Dinar",ar:"دينار ليبي",symbol:"LD"},YER:{en:"Yemeni Riyal",ar:"ريال يمني",symbol:"ر.ي"}},this.arabicCurrencies=["SAR","AED","KWD","BHD","QAR","OMR","EGP","IQD","LBP","SYP","TND","DZD","MAD","YER"],this.languages=[],this.currencies=[],this.hasError=!1,this.showTrigger=!1,this.languageSlot=this.host.querySelector('[slot="language"]')?.innerHTML||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span></label>',this.currencySlot=this.host.querySelector('[slot="currency"]')?.innerHTML||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{symbol}</small></label>'}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.event.on("localization::open",(()=>this.open())),this.language||(this.language=Salla.config.get("user.language_code")),this.currency||(this.currency=Salla.config.get("user.currency_code"))}async open(){return this.modal.open(),await Salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>{this.languages.length<2&&this.currencies.length<2&&this.modal.close()})).catch((a=>{console.log(a),this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}getCurrency(a){return this.currenciesList[a||this.currency]||{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"}}getLanguageName(){return this.languageNames[this.language]||this.language||""}getCurrencySymbol(a){return"SAR"===(a=a||this.currency)?'<i class="sicon-sar"></i>':"ar"!==this.language&&this.arabicCurrencies.includes(a)?a:this.getCurrency(a).symbol}getCurrencyName(a){return"ar"===this.language?this.getCurrency(a).ar:this.getCurrency(a).en}async getLanguages(){return this.languages.length>1?null:await Salla.config.languages().then((a=>this.languages=a))}async getCurrencies(){return this.currencies.length>1?null:await Salla.config.currencies().then((a=>this.currencies=Object.values(a||{})))}onChangeCurrency(a){this.currency=a.target.value}onChangeLanguage(a){this.language=a.target.value}async submit(){let a;this.btn.load().then((()=>{if(this.currency){if(this.currency!==Salla.config.get("user.currency_code","SAR"))return a=window.location.href,Salla.currency.api.change(this.currency)}else Salla.log("There is no currency!")})).then((()=>{this.language!==Salla.config.get("user.language_code","ar")&&(a=Salla.helpers.addParamToUrl("lang",this.language))})).then((()=>{Salla.cookie.set("s-lang",this.language),Salla.cookie.set("s-curr",this.currency)})).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>{a&&(window.location.href=a.replace(`/${Salla.config.get("user.language_code")}/`,`/${this.language}/`))}))}render(){return[this.showTrigger?l("button",{type:"button",onClick:()=>this.open(),class:"s-localization-modal-trigger-btn"},l("span",null,this.getLanguageName()),l("span",{class:"s-localization-modal-trigger-separator"},"|")," ",l("span",{innerHTML:this.getCurrencySymbol()})):"",l("salla-modal",{key:"862b768f3a0f9abe079703030bb686178d418ca7",isLoading:!0,class:"s-hidden",ref:a=>this.modal=a,width:"xs"},l("div",{key:"96ce8b449b2c96718de083df1b39bf19d18e4543",slot:"loading"},l("div",{key:"44ba3efdf44d8758b9824dfbee98081549aad41f",class:"s-localization-modal-skeleton"},l("salla-skeleton",{key:"66c85016f14871d05eb296691962ddf0e5b8a512",width:"25%",height:"15px"}),l("div",{key:"e3e0a9cf51572f13456f82d9b08a14a132a01657",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"4c60b249bd54e0850471967d176a789f38f95841",width:"25%",height:"15px"}),l("div",{key:"7da8613b052a1dab1b34cf54fad755f703b68e5a",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"b465504898a6861d5cce2456444cc81e7bc61376",height:"40px",width:"100%"}))),this.hasError?l("salla-placeholder",{alignment:"center"},l("span",{slot:"description"},this.errorMessage)):l("div",{class:"s-localization-modal-inner"},this.languages.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},Salla.lang.get("common.titles.language")),l("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==a.iso_code,onChange:()=>this.language=a.iso_code,name:"language",id:"lang-"+a.code.toLowerCase(),value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,a.name).replace(/\{code\}/g,a.code).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"language",onChange:a=>this.onChangeLanguage(a)},this.languages.map((a=>l("option",{value:a.code,selected:this.language==a.code},a.name)))))):"",this.currencies.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},Salla.lang.get("common.titles.currency")),l("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==a.code,onChange:()=>this.currency=a.code,id:"currency-"+a.code,value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,this.getCurrencyName(a.code)).replace(/\{code\}/g,a.code).replace(/\{symbol\}/g,this.getCurrencySymbol(a.code)).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"currency",onChange:a=>this.onChangeCurrency(a)},this.currencies.map((a=>l("option",{value:a.code,selected:this.currency==a.code},a.name)))))):"",l("salla-button",{width:"wide",ref:a=>this.btn=a,onClick:()=>this.submit()},Salla.lang.get("common.elements.ok"))))]}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((a=>a.replaceWith(a.firstChild))),this.host.querySelectorAll("#language-slot").forEach((a=>a.replaceWith(a.firstChild)))}get host(){return s(this)}};export{i as salla_localization_modal}