@salla.sa/twilight-components 2.14.250 → 2.14.251

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/{app-globals-BgNFpKiG.js → app-globals-0qyY-ElC.js} +3 -3
  2. package/dist/cjs/{app-globals-BgNFpKiG.js.map → app-globals-0qyY-ElC.js.map} +1 -1
  3. package/dist/cjs/{index-DFk4JQs_.js → index-CxIOfeMA.js} +4 -4
  4. package/dist/cjs/{index-DFk4JQs_.js.map → index-CxIOfeMA.js.map} +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-accordion-body.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-accordion-head.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-accordion.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-product-options.cjs.entry.js +22 -1
  31. package/dist/cjs/salla-product-options.cjs.entry.js.map +1 -1
  32. package/dist/cjs/salla-product-options.entry.cjs.js.map +1 -1
  33. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  41. package/dist/cjs/twilight.cjs.js +2 -2
  42. package/dist/collection/components/salla-product-options/salla-product-options.js +21 -0
  43. package/dist/collection/components/salla-product-options/salla-product-options.js.map +1 -1
  44. package/dist/components/index.js +2 -2
  45. package/dist/components/index.js.map +1 -1
  46. package/dist/components/salla-product-options.js +21 -0
  47. package/dist/components/salla-product-options.js.map +1 -1
  48. package/dist/esm/{app-globals-DoDOGg4t.js → app-globals-BBUHVW9U.js} +3 -3
  49. package/dist/esm/{app-globals-DoDOGg4t.js.map → app-globals-BBUHVW9U.js.map} +1 -1
  50. package/dist/esm/{index-Fh3juwdj.js → index-aC-cHVMV.js} +4 -4
  51. package/dist/esm/{index-Fh3juwdj.js.map → index-aC-cHVMV.js.map} +1 -1
  52. package/dist/esm/loader.js +3 -3
  53. package/dist/esm/salla-accordion-body.entry.js +1 -1
  54. package/dist/esm/salla-accordion-head.entry.js +1 -1
  55. package/dist/esm/salla-accordion.entry.js +1 -1
  56. package/dist/esm/salla-add-product-button_51.entry.js +1 -1
  57. package/dist/esm/salla-advertisement.entry.js +1 -1
  58. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  59. package/dist/esm/salla-apps-icons.entry.js +1 -1
  60. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  61. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  62. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  63. package/dist/esm/salla-contacts.entry.js +1 -1
  64. package/dist/esm/salla-filters-widget.entry.js +1 -1
  65. package/dist/esm/salla-filters.entry.js +1 -1
  66. package/dist/esm/salla-installment.entry.js +1 -1
  67. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  68. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  69. package/dist/esm/salla-metadata.entry.js +1 -1
  70. package/dist/esm/salla-notification-item.entry.js +1 -1
  71. package/dist/esm/salla-notifications.entry.js +1 -1
  72. package/dist/esm/salla-offer.entry.js +1 -1
  73. package/dist/esm/salla-order-summary.entry.js +1 -1
  74. package/dist/esm/salla-orders.entry.js +1 -1
  75. package/dist/esm/salla-payments.entry.js +1 -1
  76. package/dist/esm/salla-price-range.entry.js +1 -1
  77. package/dist/esm/salla-product-options.entry.js +22 -1
  78. package/dist/esm/salla-product-options.entry.js.map +1 -1
  79. package/dist/esm/salla-review-card.entry.js +1 -1
  80. package/dist/esm/salla-reviews-page.entry.js +1 -1
  81. package/dist/esm/salla-reviews.entry.js +1 -1
  82. package/dist/esm/salla-social.entry.js +1 -1
  83. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  84. package/dist/esm/salla-tooltip.entry.js +1 -1
  85. package/dist/esm/salla-verify.entry.js +1 -1
  86. package/dist/esm/salla-wallet.entry.js +1 -1
  87. package/dist/esm/twilight.js +3 -3
  88. package/dist/esm-es5/{app-globals-DoDOGg4t.js → app-globals-BBUHVW9U.js} +2 -2
  89. package/dist/esm-es5/{app-globals-DoDOGg4t.js.map → app-globals-BBUHVW9U.js.map} +1 -1
  90. package/dist/esm-es5/{index-Fh3juwdj.js → index-aC-cHVMV.js} +3 -3
  91. package/dist/esm-es5/{index-Fh3juwdj.js.map → index-aC-cHVMV.js.map} +1 -1
  92. package/dist/esm-es5/loader.js +1 -1
  93. package/dist/esm-es5/salla-accordion-body.entry.js +1 -1
  94. package/dist/esm-es5/salla-accordion-head.entry.js +1 -1
  95. package/dist/esm-es5/salla-accordion.entry.js +1 -1
  96. package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
  97. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  98. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  99. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  100. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  101. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  102. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  103. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  104. package/dist/esm-es5/salla-filters-widget.entry.js +2 -2
  105. package/dist/esm-es5/salla-filters.entry.js +1 -1
  106. package/dist/esm-es5/salla-installment.entry.js +1 -1
  107. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  108. package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
  109. package/dist/esm-es5/salla-metadata.entry.js +1 -1
  110. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  111. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  112. package/dist/esm-es5/salla-offer.entry.js +1 -1
  113. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  114. package/dist/esm-es5/salla-orders.entry.js +1 -1
  115. package/dist/esm-es5/salla-payments.entry.js +1 -1
  116. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  117. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  118. package/dist/esm-es5/salla-product-options.entry.js.map +1 -1
  119. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  120. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  121. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  122. package/dist/esm-es5/salla-social.entry.js +1 -1
  123. package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
  124. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  125. package/dist/esm-es5/salla-verify.entry.js +1 -1
  126. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  127. package/dist/esm-es5/twilight.js +1 -1
  128. package/dist/twilight/p-03f5a937.entry.js +5 -0
  129. package/dist/twilight/{p-a4373a58.entry.js → p-0443edb2.entry.js} +2 -2
  130. package/dist/twilight/{p-15109abe.entry.js → p-04b3d375.entry.js} +2 -2
  131. package/dist/twilight/{p-2fc264a5.system.entry.js → p-08b3ea63.system.entry.js} +2 -2
  132. package/dist/twilight/{p-48c8c116.system.entry.js → p-09117f81.system.entry.js} +2 -2
  133. package/dist/twilight/{p-90b19a52.entry.js → p-0d0836f3.entry.js} +2 -2
  134. package/dist/twilight/{p-5aa8dd63.system.entry.js → p-0e931dd0.system.entry.js} +2 -2
  135. package/dist/twilight/{p-8e87d5bb.entry.js → p-18bd19bd.entry.js} +2 -2
  136. package/dist/twilight/{p-65e55582.system.entry.js → p-1b9e31b1.system.entry.js} +2 -2
  137. package/dist/twilight/{p-c143cae6.system.entry.js → p-1d08e23e.system.entry.js} +2 -2
  138. package/dist/twilight/{p-8422a030.entry.js → p-21c35fec.entry.js} +2 -2
  139. package/dist/twilight/{p-DFHtpaXy.system.js.map → p-24T5fnEM.system.js.map} +1 -1
  140. package/dist/twilight/{p-af947a45.system.entry.js → p-29440936.system.entry.js} +2 -2
  141. package/dist/twilight/{p-eab0ef43.system.entry.js → p-2d2fce30.system.entry.js} +2 -2
  142. package/dist/twilight/{p-0d5aa57d.system.entry.js → p-2f85174e.system.entry.js} +2 -2
  143. package/dist/twilight/{p-1d675685.entry.js → p-3407c5ef.entry.js} +2 -2
  144. package/dist/twilight/{p-d3177b59.entry.js → p-342eda73.entry.js} +2 -2
  145. package/dist/twilight/{p-dca1a091.entry.js → p-3438bc0c.entry.js} +2 -2
  146. package/dist/twilight/{p-4f532944.system.entry.js → p-3b207dc4.system.entry.js} +2 -2
  147. package/dist/twilight/{p-89bfcbd9.entry.js → p-3e82f611.entry.js} +2 -2
  148. package/dist/twilight/{p-yR-D_QVV.system.js.map → p-3etOZ9ok.system.js.map} +1 -1
  149. package/dist/twilight/{p-f4dd7c30.entry.js → p-3fb416fa.entry.js} +2 -2
  150. package/dist/twilight/{p-cc88bd11.entry.js → p-47fc4553.entry.js} +2 -2
  151. package/dist/twilight/{p-84efc4e5.system.entry.js → p-49051076.system.entry.js} +2 -2
  152. package/dist/twilight/{p-c5bdc891.system.entry.js → p-4a4cad07.system.entry.js} +3 -3
  153. package/dist/twilight/{p-0093b63c.system.entry.js → p-4d318ffc.system.entry.js} +2 -2
  154. package/dist/twilight/{p-31c2d596.entry.js → p-5054fc18.entry.js} +2 -2
  155. package/dist/twilight/{p-d6d41f95.entry.js → p-56074b1e.entry.js} +2 -2
  156. package/dist/twilight/{p-777970a0.system.entry.js → p-56628b3c.system.entry.js} +2 -2
  157. package/dist/twilight/{p-f8232bd5.entry.js → p-5dda0431.entry.js} +2 -2
  158. package/dist/twilight/p-61471a8d.system.entry.js +5 -0
  159. package/dist/twilight/{p-AKVBtuMk.system.js.map → p-63hxYOEG.system.js.map} +1 -1
  160. package/dist/twilight/{p-3011ae50.entry.js → p-65d9d657.entry.js} +2 -2
  161. package/dist/twilight/{p-2ae3f0e1.system.entry.js → p-6943af29.system.entry.js} +2 -2
  162. package/dist/twilight/{p-f0ad1f7a.system.entry.js → p-6a16b86d.system.entry.js} +2 -2
  163. package/dist/twilight/{p-07e383ed.entry.js → p-70688702.entry.js} +2 -2
  164. package/dist/twilight/{p-8c4ff806.entry.js → p-75203eae.entry.js} +2 -2
  165. package/dist/twilight/{p-72dbdf8a.entry.js → p-779536eb.entry.js} +2 -2
  166. package/dist/twilight/{p-CuT3SRo-.system.js.map → p-7HslI1sO.system.js.map} +1 -1
  167. package/dist/twilight/{p-3f5fc0ac.entry.js → p-7e1c3fd9.entry.js} +2 -2
  168. package/dist/twilight/{p-ef1c9026.system.entry.js → p-7f9f9400.system.entry.js} +2 -2
  169. package/dist/twilight/p-7f9f9400.system.entry.js.map +1 -0
  170. package/dist/twilight/{p-CQ0P5lf7.system.js.map → p-81UxRwTN.system.js.map} +1 -1
  171. package/dist/twilight/{p-67a30d9c.entry.js → p-8a55a076.entry.js} +2 -2
  172. package/dist/twilight/{p-feb47383.system.entry.js → p-8c2a97cf.system.entry.js} +2 -2
  173. package/dist/twilight/p-8d02af0b.system.entry.js +5 -0
  174. package/dist/twilight/{p-6e2c5013.system.entry.js → p-9297d5d0.system.entry.js} +2 -2
  175. package/dist/twilight/{p-5e07c206.system.entry.js → p-92a2ce11.system.entry.js} +2 -2
  176. package/dist/twilight/{p-12ec4275.entry.js → p-92fb3adc.entry.js} +2 -2
  177. package/dist/twilight/{p-c8409d01.system.entry.js → p-939b203a.system.entry.js} +2 -2
  178. package/dist/twilight/{p-b0342394.entry.js → p-94b99a34.entry.js} +2 -2
  179. package/dist/twilight/{p-41858b7a.entry.js → p-98ca67d7.entry.js} +2 -2
  180. package/dist/twilight/p-9b7b035c.entry.js +5 -0
  181. package/dist/twilight/{p-a74c3613.entry.js → p-9c2bf5c2.entry.js} +2 -2
  182. package/dist/twilight/{p-CXK1rNlC.system.js → p-9cvlynxW.system.js} +3 -3
  183. package/dist/twilight/{p-CXK1rNlC.system.js.map → p-9cvlynxW.system.js.map} +1 -1
  184. package/dist/twilight/{p-969a72ac.entry.js → p-9f75e64f.entry.js} +2 -2
  185. package/dist/twilight/{p-xqp4ddQE.system.js.map → p-B-6fJi1f.system.js.map} +1 -1
  186. package/dist/twilight/{p-D7rVz8w9.system.js.map → p-B6pAHU4P.system.js.map} +1 -1
  187. package/dist/twilight/{p-RTeyQLWy.system.js.map → p-BSHk_PNC.system.js.map} +1 -1
  188. package/dist/twilight/{p-0Yb-UePn.system.js.map → p-BZAlfa8A.system.js.map} +1 -1
  189. package/dist/twilight/{p-BGI8pwzX.system.js.map → p-BaUsKGrq.system.js.map} +1 -1
  190. package/dist/twilight/{p-CsNoOX-E.system.js → p-Bl7BRAvB.system.js} +2 -2
  191. package/dist/twilight/{p-CsNoOX-E.system.js.map → p-Bl7BRAvB.system.js.map} +1 -1
  192. package/dist/twilight/{p-F0k7g9iY.system.js.map → p-C3l3EpVC.system.js.map} +1 -1
  193. package/dist/twilight/{p-6K3EacFl.system.js → p-CBqvheHa.system.js} +2 -2
  194. package/dist/twilight/{p-6K3EacFl.system.js.map → p-CBqvheHa.system.js.map} +1 -1
  195. package/dist/twilight/{p-I3V9OjUh.system.js.map → p-CHKd1ZbK.system.js.map} +1 -1
  196. package/dist/twilight/{p-CJCijTkx.system.js.map → p-CbFmk86R.system.js.map} +1 -1
  197. package/dist/twilight/{p-C7pQcCCO.system.js.map → p-Chh9LXws.system.js.map} +1 -1
  198. package/dist/twilight/{p-DXIfbc_E.system.js.map → p-Cie2T8Bo.system.js.map} +1 -1
  199. package/dist/twilight/{p-B_e6C9C7.system.js.map → p-Craz4PUF.system.js.map} +1 -1
  200. package/dist/twilight/{p-BqsAYW_z.system.js.map → p-D1othg3r.system.js.map} +1 -1
  201. package/dist/twilight/{p-JqK0adg-.system.js.map → p-D74Dhmc1.system.js.map} +1 -1
  202. package/dist/twilight/{p-BeIXRKnY.system.js.map → p-DFTLMdWL.system.js.map} +1 -1
  203. package/dist/twilight/{p-C1ANpTev.system.js.map → p-DOCHKq2e.system.js.map} +1 -1
  204. package/dist/twilight/{p-kq1kexdS.system.js.map → p-DOHYAySQ.system.js.map} +1 -1
  205. package/dist/twilight/{p-C7zV68dE.system.js.map → p-DbkDylL6.system.js.map} +1 -1
  206. package/dist/twilight/{p-OPHJjNOp.system.js.map → p-De28Pl5h.system.js.map} +1 -1
  207. package/dist/twilight/{p-DDYb73x9.system.js.map → p-DobF7Qkv.system.js.map} +1 -1
  208. package/dist/twilight/{p-BEv7FXnl.system.js.map → p-Dohhf_R_.system.js.map} +1 -1
  209. package/dist/twilight/{p-oQO9FKN9.system.js.map → p-DoomSogT.system.js.map} +1 -1
  210. package/dist/twilight/{p-ClGf-mQe.system.js.map → p-QCD41AKz.system.js.map} +1 -1
  211. package/dist/twilight/{p-BlIQW2lO.system.js.map → p-Uzujt2uQ.system.js.map} +1 -1
  212. package/dist/twilight/{p-DL20L4sR.system.js.map → p-YRdrauTw.system.js.map} +1 -1
  213. package/dist/twilight/{p-51fff39f.entry.js → p-a3c00836.entry.js} +2 -2
  214. package/dist/twilight/{p-CV9enCHU.system.js.map → p-a3gxDXSb.system.js.map} +1 -1
  215. package/dist/twilight/{p-314b3b1d.system.entry.js → p-a5b4c38f.system.entry.js} +2 -2
  216. package/dist/twilight/{p-be0c1dee.entry.js → p-a94e5163.entry.js} +2 -2
  217. package/dist/twilight/{p-Fh3juwdj.js → p-aC-cHVMV.js} +3 -3
  218. package/dist/twilight/{p-Fh3juwdj.js.map → p-aC-cHVMV.js.map} +1 -1
  219. package/dist/twilight/p-af7ace10.entry.js +5 -0
  220. package/dist/twilight/p-af7ace10.entry.js.map +1 -0
  221. package/dist/twilight/{p-b07d4935.entry.js → p-b0584206.entry.js} +2 -2
  222. package/dist/twilight/{p-bcb8b7a7.system.entry.js → p-b1f25cb5.system.entry.js} +3 -3
  223. package/dist/twilight/{p-11c6d38a.system.entry.js → p-b75d729a.system.entry.js} +2 -2
  224. package/dist/twilight/{p-aa17ca75.system.entry.js → p-b7bb5a85.system.entry.js} +2 -2
  225. package/dist/twilight/{p-0ecc5067.system.entry.js → p-b9a992c8.system.entry.js} +2 -2
  226. package/dist/twilight/{p-C5ceUSVS.js → p-cW_hSk8i.js} +2 -2
  227. package/dist/twilight/{p-C5ceUSVS.js.map → p-cW_hSk8i.js.map} +1 -1
  228. package/dist/twilight/{p-9b377923.entry.js → p-d01c0575.entry.js} +2 -2
  229. package/dist/twilight/{p-ed74ff73.system.entry.js → p-e1a599fb.system.entry.js} +2 -2
  230. package/dist/twilight/{p-d2f4c095.system.entry.js → p-e29eb090.system.entry.js} +2 -2
  231. package/dist/twilight/{p-5b0c8164.system.entry.js → p-e5cd34c3.system.entry.js} +2 -2
  232. package/dist/twilight/{p-cbd8cbee.entry.js → p-efcf803a.entry.js} +2 -2
  233. package/dist/twilight/{p-b3e42e7f.system.entry.js → p-f777295c.system.entry.js} +2 -2
  234. package/dist/twilight/{p-caf5e9c0.system.entry.js → p-f9735e19.system.entry.js} +2 -2
  235. package/dist/twilight/{p-ea4cddf9.system.entry.js → p-fabacea5.system.entry.js} +2 -2
  236. package/dist/twilight/{p-CjFC0ce0.system.js.map → p-fkQosYiP.system.js.map} +1 -1
  237. package/dist/twilight/{p-Dm-9Eytr.system.js.map → p-gyc8toCS.system.js.map} +1 -1
  238. package/dist/twilight/p-o3nk7iqR.system.js.map +1 -0
  239. package/dist/twilight/{p-B5711wvS.system.js.map → p-sLrIToFR.system.js.map} +1 -1
  240. package/dist/twilight/salla-product-options.entry.esm.js.map +1 -1
  241. package/dist/twilight/twilight.esm.js +1 -1
  242. package/dist/twilight/twilight.js +1 -1
  243. package/dist/types/components/salla-product-options/salla-product-options.d.ts +1 -0
  244. package/package.json +5 -5
  245. package/dist/twilight/p-2c7106a0.entry.js +0 -5
  246. package/dist/twilight/p-3c7322ea.system.entry.js +0 -5
  247. package/dist/twilight/p-86a30b82.entry.js +0 -5
  248. package/dist/twilight/p-86a30b82.entry.js.map +0 -1
  249. package/dist/twilight/p-DydKtKGm.system.js.map +0 -1
  250. package/dist/twilight/p-ce2994fb.system.entry.js +0 -5
  251. package/dist/twilight/p-d8605d58.entry.js +0 -5
  252. package/dist/twilight/p-ef1c9026.system.entry.js.map +0 -1
  253. /package/dist/twilight/{p-d8605d58.entry.js.map → p-03f5a937.entry.js.map} +0 -0
  254. /package/dist/twilight/{p-a4373a58.entry.js.map → p-0443edb2.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-15109abe.entry.js.map → p-04b3d375.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-2fc264a5.system.entry.js.map → p-08b3ea63.system.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-48c8c116.system.entry.js.map → p-09117f81.system.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-90b19a52.entry.js.map → p-0d0836f3.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-5aa8dd63.system.entry.js.map → p-0e931dd0.system.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-8e87d5bb.entry.js.map → p-18bd19bd.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-65e55582.system.entry.js.map → p-1b9e31b1.system.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-c143cae6.system.entry.js.map → p-1d08e23e.system.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-8422a030.entry.js.map → p-21c35fec.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-af947a45.system.entry.js.map → p-29440936.system.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-eab0ef43.system.entry.js.map → p-2d2fce30.system.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-0d5aa57d.system.entry.js.map → p-2f85174e.system.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-1d675685.entry.js.map → p-3407c5ef.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-d3177b59.entry.js.map → p-342eda73.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-dca1a091.entry.js.map → p-3438bc0c.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-4f532944.system.entry.js.map → p-3b207dc4.system.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-89bfcbd9.entry.js.map → p-3e82f611.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-f4dd7c30.entry.js.map → p-3fb416fa.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-cc88bd11.entry.js.map → p-47fc4553.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-84efc4e5.system.entry.js.map → p-49051076.system.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-c5bdc891.system.entry.js.map → p-4a4cad07.system.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-0093b63c.system.entry.js.map → p-4d318ffc.system.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-31c2d596.entry.js.map → p-5054fc18.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-d6d41f95.entry.js.map → p-56074b1e.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-777970a0.system.entry.js.map → p-56628b3c.system.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-f8232bd5.entry.js.map → p-5dda0431.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-ce2994fb.system.entry.js.map → p-61471a8d.system.entry.js.map} +0 -0
  282. /package/dist/twilight/{p-3011ae50.entry.js.map → p-65d9d657.entry.js.map} +0 -0
  283. /package/dist/twilight/{p-2ae3f0e1.system.entry.js.map → p-6943af29.system.entry.js.map} +0 -0
  284. /package/dist/twilight/{p-f0ad1f7a.system.entry.js.map → p-6a16b86d.system.entry.js.map} +0 -0
  285. /package/dist/twilight/{p-07e383ed.entry.js.map → p-70688702.entry.js.map} +0 -0
  286. /package/dist/twilight/{p-8c4ff806.entry.js.map → p-75203eae.entry.js.map} +0 -0
  287. /package/dist/twilight/{p-72dbdf8a.entry.js.map → p-779536eb.entry.js.map} +0 -0
  288. /package/dist/twilight/{p-3f5fc0ac.entry.js.map → p-7e1c3fd9.entry.js.map} +0 -0
  289. /package/dist/twilight/{p-67a30d9c.entry.js.map → p-8a55a076.entry.js.map} +0 -0
  290. /package/dist/twilight/{p-feb47383.system.entry.js.map → p-8c2a97cf.system.entry.js.map} +0 -0
  291. /package/dist/twilight/{p-3c7322ea.system.entry.js.map → p-8d02af0b.system.entry.js.map} +0 -0
  292. /package/dist/twilight/{p-6e2c5013.system.entry.js.map → p-9297d5d0.system.entry.js.map} +0 -0
  293. /package/dist/twilight/{p-5e07c206.system.entry.js.map → p-92a2ce11.system.entry.js.map} +0 -0
  294. /package/dist/twilight/{p-12ec4275.entry.js.map → p-92fb3adc.entry.js.map} +0 -0
  295. /package/dist/twilight/{p-c8409d01.system.entry.js.map → p-939b203a.system.entry.js.map} +0 -0
  296. /package/dist/twilight/{p-b0342394.entry.js.map → p-94b99a34.entry.js.map} +0 -0
  297. /package/dist/twilight/{p-41858b7a.entry.js.map → p-98ca67d7.entry.js.map} +0 -0
  298. /package/dist/twilight/{p-2c7106a0.entry.js.map → p-9b7b035c.entry.js.map} +0 -0
  299. /package/dist/twilight/{p-a74c3613.entry.js.map → p-9c2bf5c2.entry.js.map} +0 -0
  300. /package/dist/twilight/{p-969a72ac.entry.js.map → p-9f75e64f.entry.js.map} +0 -0
  301. /package/dist/twilight/{p-51fff39f.entry.js.map → p-a3c00836.entry.js.map} +0 -0
  302. /package/dist/twilight/{p-314b3b1d.system.entry.js.map → p-a5b4c38f.system.entry.js.map} +0 -0
  303. /package/dist/twilight/{p-be0c1dee.entry.js.map → p-a94e5163.entry.js.map} +0 -0
  304. /package/dist/twilight/{p-b07d4935.entry.js.map → p-b0584206.entry.js.map} +0 -0
  305. /package/dist/twilight/{p-bcb8b7a7.system.entry.js.map → p-b1f25cb5.system.entry.js.map} +0 -0
  306. /package/dist/twilight/{p-11c6d38a.system.entry.js.map → p-b75d729a.system.entry.js.map} +0 -0
  307. /package/dist/twilight/{p-aa17ca75.system.entry.js.map → p-b7bb5a85.system.entry.js.map} +0 -0
  308. /package/dist/twilight/{p-0ecc5067.system.entry.js.map → p-b9a992c8.system.entry.js.map} +0 -0
  309. /package/dist/twilight/{p-9b377923.entry.js.map → p-d01c0575.entry.js.map} +0 -0
  310. /package/dist/twilight/{p-ed74ff73.system.entry.js.map → p-e1a599fb.system.entry.js.map} +0 -0
  311. /package/dist/twilight/{p-d2f4c095.system.entry.js.map → p-e29eb090.system.entry.js.map} +0 -0
  312. /package/dist/twilight/{p-5b0c8164.system.entry.js.map → p-e5cd34c3.system.entry.js.map} +0 -0
  313. /package/dist/twilight/{p-cbd8cbee.entry.js.map → p-efcf803a.entry.js.map} +0 -0
  314. /package/dist/twilight/{p-b3e42e7f.system.entry.js.map → p-f777295c.system.entry.js.map} +0 -0
  315. /package/dist/twilight/{p-caf5e9c0.system.entry.js.map → p-f9735e19.system.entry.js.map} +0 -0
  316. /package/dist/twilight/{p-ea4cddf9.system.entry.js.map → p-fabacea5.system.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- var __awaiter=this&&this.__awaiter||function(t,a,e,r){function n(t){return t instanceof e?t:new e((function(a){a(t)}))}return new(e||(e=Promise))((function(e,i){function s(t){try{o(r.next(t))}catch(t){i(t)}}function u(t){try{o(r["throw"](t))}catch(t){i(t)}}function o(t){t.done?e(t.value):n(t.value).then(s,u)}o((r=r.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(a){return o([t,a])}}function o(u){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(r=1,n&&(i=u[0]&2?n["return"]:u[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;if(n=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;n=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=a.call(t,e)}catch(t){u=[6,t];n=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
1
+ var __awaiter=this&&this.__awaiter||function(t,a,e,n){function r(t){return t instanceof e?t:new e((function(a){a(t)}))}return new(e||(e=Promise))((function(e,i){function s(t){try{o(n.next(t))}catch(t){i(t)}}function u(t){try{o(n["throw"](t))}catch(t){i(t)}}function o(t){t.done?e(t.value):r(t.value).then(s,u)}o((n=n.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(a){return o([t,a])}}function o(u){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(n=1,r&&(i=u[0]&2?r["return"]:u[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;if(r=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;r=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=a.call(t,e)}catch(t){u=[6,t];r=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-CXK1rNlC.system.js"],(function(t){"use strict";var a,e,r,n;return{setters:[function(t){a=t.r;e=t.h;r=t.H;n=t.g}],execute:function(){var i="";var s=t("salla_metadata",function(){function t(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var e=String(a.getDate()).padStart(2,"0");var r=String(a.getMonth()+1).padStart(2,"0");var n=a.getFullYear();var i="".concat(e,"/").concat(r,"/").concat(n);return i}return t.value};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,salla.onReady()];case 1:r.sent();if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){return[2,salla.logger.error("feature custom-fields is not activated")]}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return[2,salla.logger.error("can't render salla-metadata without enity-id prop!")]}return[4,salla.lang.onLoaded()];case 2:r.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=r.sent();this.specs=(a=e.data[0])===null||a===void 0?void 0:a.sections;return[2]}}))}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return e(r,{class:"s-metadata-wrapper"},this.specs.map((function(a){return e("div",{class:"s-metadata-box"},e("div",{class:"s-metadata-box-header"},e("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return e("div",{class:"s-metadata-row"},e("p",{class:"s-metadata-row-name"},a.name),e("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());s.style=i}}}));
5
- //# sourceMappingURL=p-c5bdc891.system.entry.js.map
4
+ */System.register(["./p-9cvlynxW.system.js"],(function(t){"use strict";var a,e,n,r;return{setters:[function(t){a=t.r;e=t.h;n=t.H;r=t.g}],execute:function(){var i="";var s=t("salla_metadata",function(){function t(t){a(this,t);this.entity="product";this.specs=[];this.download=salla.lang.get("pages.thank_you.download");if(this.entityId){try{this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId);return}catch(t){salla.log("Bad json passed via entityId prop")}}}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="url"){return'<a href="'.concat(t.value,'" class="text-blue-700 underline" target="_blank">').concat(t.value,"</a>")}if(t.type==="date"){var a=new Date(t.value);var e=String(a.getDate()).padStart(2,"0");var n=String(a.getMonth()+1).padStart(2,"0");var r=a.getFullYear();var i="".concat(e,"/").concat(n,"/").concat(r);return i}return t.value};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,a,e;return __generator(this,(function(n){switch(n.label){case 0:return[4,salla.onReady()];case 1:n.sent();if(!((t=salla.config.get("store.features"))===null||t===void 0?void 0:t.includes("custom-fields"))){return[2,salla.logger.error("feature custom-fields is not activated")]}if(!this.entityId&&(salla.url.is_page("product.single")||salla.url.is_page("product.showNewUrls"))){this.entityId=salla.config.get("page.id")}if(!this.entityId){return[2,salla.logger.error("can't render salla-metadata without enity-id prop!")]}return[4,salla.lang.onLoaded()];case 2:n.sent();this.download=salla.lang.get("pages.thank_you.download");return[4,Salla.api.metadata.fetchValues(this.entity,this.entityId)];case 3:e=n.sent();this.specs=(a=e.data[0])===null||a===void 0?void 0:a.sections;return[2]}}))}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return e(n,{class:"s-metadata-wrapper"},this.specs.map((function(a){return e("div",{class:"s-metadata-box"},e("div",{class:"s-metadata-box-header"},e("i",{class:"sicon-list"}),a.name),a.fields.map((function(a){return e("div",{class:"s-metadata-row"},e("p",{class:"s-metadata-row-name"},a.name),e("p",{class:"s-metadata-row-value",innerHTML:t.getValue(a)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());s.style=i}}}));
5
+ //# sourceMappingURL=p-4a4cad07.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js"],(function(t){"use strict";var s,a,i,e;return{setters:[function(t){s=t.r;a=t.h;i=t.H;e=t.g}],execute:function(){var l=":host{display:block}";var n=t("salla_payments",function(){function t(t){s(this,t);this.exclude=[]}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var s,a,i;if(typeof t.exclude==="string"){try{t.exclude=JSON.parse(t.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",t.exclude);t.exclude=[]}}t.placeholderImage=salla.url.cdn("images/s-empty.png");t.paymentSlot=((s=t.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src="{image}" alt={payment} /><li>');t.sbcSlot=((a=t.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');t.codSlot=((i=t.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');t.payments=salla.config.get("store.settings.payments")}))};t.prototype.render=function(){var t=this;var s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");var e=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return a(i,{key:"6c8a1fd050822882224ee1e419f6f6dbdbfaf12d",class:"s-payments-list-wrap"},a("ul",{key:"773195024ce6f616ad9b87091c8ddfd0e153f9ec",class:"s-payments-list"},s&&a("li",{key:"203bebb61c41ca108c0ec969661d5922db2ac378",class:"s-payments-list-item"},a("img",{key:"a687fac0d968f0485a0a59d1205a0f0db1f100f4",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((function(s){return s=="cod"?a("div",{id:"cod-slot",innerHTML:t.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}):a("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(s,"_mini.png"),58,58)).replace(/\{payment\}/g,s)})})),e&&a("div",{key:"f571920327b81c48f502c1d6e497955978634c08",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(e))})))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,s,a;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(s=this.host.querySelector('[slot="sbc"]'))===null||s===void 0?void 0:s.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());n.style=l}}}));
5
- //# sourceMappingURL=p-0093b63c.system.entry.js.map
4
+ System.register(["./p-9cvlynxW.system.js"],(function(t){"use strict";var s,a,i,e;return{setters:[function(t){s=t.r;a=t.h;i=t.H;e=t.g}],execute:function(){var l=":host{display:block}";var n=t("salla_payments",function(){function t(t){s(this,t);this.exclude=[]}t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){var s,a,i;if(typeof t.exclude==="string"){try{t.exclude=JSON.parse(t.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",t.exclude);t.exclude=[]}}t.placeholderImage=salla.url.cdn("images/s-empty.png");t.paymentSlot=((s=t.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.innerHTML)||'<li class="s-payments-list-item"><img class="lazy" width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src="{image}" alt={payment} /><li>');t.sbcSlot=((a=t.host.querySelector('[slot="sbc"]'))===null||a===void 0?void 0:a.innerHTML)||'<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy s-payments-sbc-image" alt="SBC"/></a><li>');t.codSlot=((i=t.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.innerHTML)||'<li class="s-payments-list-item"> <img width="100%" height="100%" src="'.concat(t.placeholderImage,'" data-src={image} class="lazy" alt="COD"/><li>');t.payments=salla.config.get("store.settings.payments")}))};t.prototype.render=function(){var t=this;var s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");var e=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return a(i,{key:"6c8a1fd050822882224ee1e419f6f6dbdbfaf12d",class:"s-payments-list-wrap"},a("ul",{key:"773195024ce6f616ad9b87091c8ddfd0e153f9ec",class:"s-payments-list"},s&&a("li",{key:"203bebb61c41ca108c0ec969661d5922db2ac378",class:"s-payments-list-item"},a("img",{key:"a687fac0d968f0485a0a59d1205a0f0db1f100f4",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.map((function(s){return s=="cod"?a("div",{id:"cod-slot",innerHTML:t.codSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/cod_mini.png",58,58))}):a("div",{id:"payment-slot",innerHTML:t.paymentSlot.replace(/\{image\}/g,salla.url.cdn("images/payment/".concat(s,"_mini.png"),58,58)).replace(/\{payment\}/g,s)})})),e&&a("div",{key:"f571920327b81c48f502c1d6e497955978634c08",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,"https://eauthenticate.saudibusiness.gov.sa/certificate-details/".concat(e))})))};t.prototype.componentDidLoad=function(){var t;(t=document.lazyLoadInstance)===null||t===void 0?void 0:t.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((function(t){t.addEventListener("load",(function(){t.setAttribute("width","100%");t.setAttribute("height","100%")}))}))};t.prototype.componentDidRender=function(){var t,s,a;this.host.querySelectorAll("#payment-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#sbc-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));this.host.querySelectorAll("#cod-slot").forEach((function(t){return t.replaceWith(t.firstChild)}));(t=this.host.querySelector('[slot="payment"]'))===null||t===void 0?void 0:t.remove();(s=this.host.querySelector('[slot="sbc"]'))===null||s===void 0?void 0:s.remove();(a=this.host.querySelector('[slot="cod"]'))===null||a===void 0?void 0:a.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());n.style=l}}}));
5
+ //# sourceMappingURL=p-4d318ffc.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as s,g as o}from"./p-Fh3juwdj.js";import{H as e}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const r=":host{display:block}";const a=class{constructor(s){t(this,s);this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more");this.languageCode=salla.lang.locale;this.orders=[];salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale;this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=true){var s;let o=(s=this.status)===null||s===void 0?void 0:s.querySelector(".s-button-text");if(o){e.toggleElementClassIf(o,"s-button-hide","s-button-show",(()=>t));this.btnLoader.style.display=t?"inherit":"none"}}initiateInfiniteScroll(){var t,s,o;if(!this.hasInfiniteScroll){return}if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:false,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(t=>{this.loading()}));(s=this.infiniteScroll)===null||s===void 0?void 0:s.on("load",(t=>{var s,o;this.loading(false);this.pagination=t.pagination;this.nextPage=((o=(s=t.pagination)===null||s===void 0?void 0:s.links)===null||o===void 0?void 0:o.next)||null;this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let r=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(r)}));(o=this.infiniteScroll)===null||o===void 0?void 0:o.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch(Object.assign(Object.assign({},this.params),{types:[""],feedback_status:t.searchParams.get("feedback_status")})).then((t=>{var s,o,r,a;this.orders=t.data;this.hasInfiniteScroll=!!((s=t.pagination)===null||s===void 0?void 0:s.links.next);this.pagination=t.pagination;this.total=(o=t.pagination)===null||o===void 0?void 0:o.total;this.nextPage=((a=(r=t.pagination)===null||r===void 0?void 0:r.links)===null||a===void 0?void 0:a.next)||null;if(!this.orders.length){this.showPlaceholder=true;return this.loading(false)}setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=true;this.loading(false);salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const r=document.createElement("div");r.classList.add("s-orders-table-tbody-tr-td-content");const a=document.createElement("span");a.classList.add("s-orders-mobile-title");a.textContent=this.orderNumberText+":";const i=document.createElement("span");i.classList.add("s-orders-reference-id");i.textContent="#"+t.reference_id;r.appendChild(a);r.appendChild(i);if(t.source=="buy_as_gift"){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon");r.appendChild(t)}const n=document.createElement("a");n.href=t.url;r.appendChild(n);const l=document.createElement("div");l.classList.add("s-orders-copy-to-clipboard-button");const d=document.createElement("salla-button");d.classList.add("relative");d.setAttribute("color","dark");d.setAttribute("shape","link");d.dataset.content=t.reference_id.toString();d.addEventListener("click",(t=>{e.copyToClipboard(t);e.toggleElementClassIf(d,"copied","code-to-copy",(()=>true));setTimeout((()=>{e.toggleElementClassIf(d,"code-to-copy","copied",(()=>true))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");let u=salla.config.get("theme.is_rtl",true);if(u){d.appendChild(h);d.appendChild(c)}else{d.appendChild(c);d.appendChild(h)}l.appendChild(d);r.appendChild(l);o.appendChild(r);s.appendChild(o);const b=document.createElement("td");b.classList.add("s-orders-table-tbody-tr-td");const m=document.createElement("div");m.classList.add("s-orders-table-tbody-tr-td-content");const p=document.createElement("span");p.classList.add("s-orders-mobile-title");p.textContent=this.totalOrderText+":";const v=document.createElement("div");v.innerHTML=salla.money(t.total);const f=document.createElement("a");f.href=t.url;m.appendChild(p);m.appendChild(v);m.appendChild(f);b.appendChild(m);s.appendChild(b);const y=document.createElement("td");y.classList.add("s-orders-table-tbody-tr-td");const g=document.createElement("div");g.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title");_.textContent=this.orderDateText+":";const k=document.createElement("div");k.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const w=document.createElement("a");w.href=t.url;g.appendChild(_);g.appendChild(k);g.appendChild(w);y.appendChild(g);s.appendChild(y);const x=document.createElement("td");x.classList.add("s-orders-table-tbody-tr-td");const j=document.createElement("div");j.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title");C.textContent=this.orderStatusText+":";const I=document.createElement("span");I.classList.add("s-orders-status-container");I.style.color=t.status.color;const O=document.createElement("i");O.classList.add(t.status.icon);const S=document.createElement("span");S.textContent=t.status.name;I.appendChild(O);I.appendChild(S);j.appendChild(C);j.appendChild(I);const T=document.createElement("i");T.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text");j.appendChild(T);const E=document.createElement("a");E.href=t.url;j.appendChild(E);x.appendChild(j);s.appendChild(x);return s}render(){var t;if(this.showPlaceholder){return s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText))}return s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},(t=this.loadMoreText)!==null&&t!==void 0?t:this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};a.style=r;export{a as salla_orders};
5
- //# sourceMappingURL=p-31c2d596.entry.js.map
4
+ import{r as t,h as s,g as o}from"./p-aC-cHVMV.js";import{H as e}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const r=":host{display:block}";const a=class{constructor(s){t(this,s);this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more");this.languageCode=salla.lang.locale;this.orders=[];salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale;this.orderNumberText=salla.lang.get("pages.thank_you.order_id");this.totalOrderText=salla.lang.get("pages.orders.total");this.orderDateText=salla.lang.get("pages.orders.date");this.orderStatusText=salla.lang.get("pages.orders.status");this.noOrderText=salla.lang.get("pages.orders.non_orders");this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=true){var s;let o=(s=this.status)===null||s===void 0?void 0:s.querySelector(".s-button-text");if(o){e.toggleElementClassIf(o,"s-button-hide","s-button-show",(()=>t));this.btnLoader.style.display=t?"inherit":"none"}}initiateInfiniteScroll(){var t,s,o;if(!this.hasInfiniteScroll){return}if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:false,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(t=>{this.loading()}));(s=this.infiniteScroll)===null||s===void 0?void 0:s.on("load",(t=>{var s,o;this.loading(false);this.pagination=t.pagination;this.nextPage=((o=(s=t.pagination)===null||s===void 0?void 0:s.links)===null||o===void 0?void 0:o.next)||null;this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let r=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(r)}));(o=this.infiniteScroll)===null||o===void 0?void 0:o.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch(Object.assign(Object.assign({},this.params),{types:[""],feedback_status:t.searchParams.get("feedback_status")})).then((t=>{var s,o,r,a;this.orders=t.data;this.hasInfiniteScroll=!!((s=t.pagination)===null||s===void 0?void 0:s.links.next);this.pagination=t.pagination;this.total=(o=t.pagination)===null||o===void 0?void 0:o.total;this.nextPage=((a=(r=t.pagination)===null||r===void 0?void 0:r.links)===null||a===void 0?void 0:a.next)||null;if(!this.orders.length){this.showPlaceholder=true;return this.loading(false)}setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=true;this.loading(false);salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const r=document.createElement("div");r.classList.add("s-orders-table-tbody-tr-td-content");const a=document.createElement("span");a.classList.add("s-orders-mobile-title");a.textContent=this.orderNumberText+":";const i=document.createElement("span");i.classList.add("s-orders-reference-id");i.textContent="#"+t.reference_id;r.appendChild(a);r.appendChild(i);if(t.source=="buy_as_gift"){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon");r.appendChild(t)}const n=document.createElement("a");n.href=t.url;r.appendChild(n);const l=document.createElement("div");l.classList.add("s-orders-copy-to-clipboard-button");const d=document.createElement("salla-button");d.classList.add("relative");d.setAttribute("color","dark");d.setAttribute("shape","link");d.dataset.content=t.reference_id.toString();d.addEventListener("click",(t=>{e.copyToClipboard(t);e.toggleElementClassIf(d,"copied","code-to-copy",(()=>true));setTimeout((()=>{e.toggleElementClassIf(d,"code-to-copy","copied",(()=>true))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");let u=salla.config.get("theme.is_rtl",true);if(u){d.appendChild(h);d.appendChild(c)}else{d.appendChild(c);d.appendChild(h)}l.appendChild(d);r.appendChild(l);o.appendChild(r);s.appendChild(o);const b=document.createElement("td");b.classList.add("s-orders-table-tbody-tr-td");const m=document.createElement("div");m.classList.add("s-orders-table-tbody-tr-td-content");const p=document.createElement("span");p.classList.add("s-orders-mobile-title");p.textContent=this.totalOrderText+":";const v=document.createElement("div");v.innerHTML=salla.money(t.total);const f=document.createElement("a");f.href=t.url;m.appendChild(p);m.appendChild(v);m.appendChild(f);b.appendChild(m);s.appendChild(b);const y=document.createElement("td");y.classList.add("s-orders-table-tbody-tr-td");const g=document.createElement("div");g.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title");_.textContent=this.orderDateText+":";const k=document.createElement("div");k.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const w=document.createElement("a");w.href=t.url;g.appendChild(_);g.appendChild(k);g.appendChild(w);y.appendChild(g);s.appendChild(y);const x=document.createElement("td");x.classList.add("s-orders-table-tbody-tr-td");const j=document.createElement("div");j.classList.add("s-orders-table-tbody-tr-td-content");const C=document.createElement("span");C.classList.add("s-orders-mobile-title");C.textContent=this.orderStatusText+":";const H=document.createElement("span");H.classList.add("s-orders-status-container");H.style.color=t.status.color;const I=document.createElement("i");I.classList.add(t.status.icon);const O=document.createElement("span");O.textContent=t.status.name;H.appendChild(I);H.appendChild(O);j.appendChild(C);j.appendChild(H);const S=document.createElement("i");S.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text");j.appendChild(S);const T=document.createElement("a");T.href=t.url;j.appendChild(T);x.appendChild(j);s.appendChild(x);return s}render(){var t;if(this.showPlaceholder){return s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText))}return s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},(t=this.loadMoreText)!==null&&t!==void 0?t:this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};a.style=r;export{a as salla_orders};
5
+ //# sourceMappingURL=p-5054fc18.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as r}from"./p-Fh3juwdj.js";var s;(function(e){e["PERCENTAGE"]="percentage";e["FIXED"]="fixed"})(s||(s={}));var i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>`;var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>`;var n=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>`;var l=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>`;const a={staticIcons:[i,o,n,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class d{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){var r;return(r=this.findTierByIndex(e,t))===null||r===void 0?void 0:r.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--){if(e>=t[r].threshold){return t[r].index}}return 0}}const f=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";const c=class{constructor(t){e(this,t);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=e=>{this.activeTabTier=e};salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");this.discountText=salla.lang.get("blocks.tiered_offer.discount");this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{await salla.onReady();if(!this.checkFeatureEnabled()){return}if(!this.checkCartExists()){return}this.isLoading=true;const e=await this.fetchTieredOfferData();if(!e){return}this.initializeComponent(e)}catch(e){this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=false}}checkFeatureEnabled(){var e;return(e=salla.config.get("store.features"))===null||e===void 0?void 0:e.includes("tiered-offer")}checkCartExists(){var e,t;return!!((t=(e=salla.storage.get("cart"))===null||e===void 0?void 0:e.summary)===null||t===void 0?void 0:t.count)}validateCouponCompatibility(e,t){var r;return!(t&&!((r=e.details)===null||r===void 0?void 0:r.applied_with_coupon))}async fetchTieredOfferData(){var e;try{const{data:t}=await salla.api.cart.offers();const r=t.find((e=>e.type==="tiered_offer"));if(!r){return null}if(!this.validateCouponCompatibility(r,(e=salla.storage.get("cart"))===null||e===void 0?void 0:e.coupon)){this.canRender=false;return null}return r}catch(e){throw e}}initializeComponent(e){var t;this.apiOfferData=e;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const r=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;const s=this.findCurrentTierIndex(r);if(s===0){this.canRender=false;return}this.currentTierIndex=s;this.currentTier=d.getTierNameByIndex(this.tieredOfferData.tiers,s);this.activeTabTier=this.currentTier;this.canRender=true}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();if(t){this.updateOfferValues(e,t)}}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend));const r=t.map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===s.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:a.staticIcons[t]||a.staticIcons[0],threshold:e.min_spend,text_color:a.staticColors[t],index:t+1})));return{current_tier:d.getTierNameByIndex(r,this.findCurrentTierIndex(e.details.current_value,r)),tiers:r}}findCurrentTierIndex(e,t){var r;if(t===void 0){t=(r=this.tieredOfferData)===null||r===void 0?void 0:r.tiers}return d.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){var r,s;if(!t||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(t,e.coupon)){this.canRender=false;return}this.canRender=true;if(((r=t.details)===null||r===void 0?void 0:r.with_current_cart)===false){return}const i=((s=t.details)===null||s===void 0?void 0:s.current_value)||0;this.apiOfferData=t;const o=this.findCurrentTierIndex(i);if(o===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=o;this.currentTier=d.getTierNameByIndex(this.tieredOfferData.tiers,o);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return d.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){var e;const t=((e=this.apiOfferData.details)===null||e===void 0?void 0:e.current_value)||0;const r=this.tieredOfferData.tiers.length;const s=this.findCurrentTierIndex(t);const i=s;return i/r*100}calculateMilestonePosition(e,t){if(t===1){return"calc(100% - 18px)"}const r=(e+1)/t*100;const s=8/t;return`${Math.max(2,Math.min(95,r-s))}%`}getMilestoneStyles(e,t,r){const s=document.documentElement.dir==="rtl";const i=this.calculateMilestonePosition(t,r);const o=e.name.length>6?"flex-end":"center";return{[s?"right":"left"]:i,alignItems:o,position:"absolute",transform:s?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){if(t){return{color:e.text_color}}if(r){return{color:"var(--color-primary)"}}return{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,s){const i=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",s?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:i,style:this.getMilestoneIconStyles(e,r,s)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){const s=r===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:s},this.tieredOfferData.tiers.map(((s,i)=>{const o=e>=s.threshold;const n=s.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(s,i,r)},this.renderMilestoneIcon(s,n,o),this.renderMilestoneName(s,n))}))))}renderProgressBar(){var e;const r=this.getProgressWidth();const s=this.tieredOfferData.tiers.length;const i=((e=this.apiOfferData.details)===null||e===void 0?void 0:e.current_value)||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(r),this.renderMilestones(i,s)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>{const r=e.tier_name===this.activeTabTier;return t("button",{class:`s-tiered-offer-tab-header ${r?"s-tiered-offer-tab-active":""}`,onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))}))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=d.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);if(!e)return null;return t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name))))})()))}render(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};c.style=f;export{c as salla_tiered_offer};
5
- //# sourceMappingURL=p-d6d41f95.entry.js.map
4
+ import{r as e,h as t,H as r}from"./p-aC-cHVMV.js";var s;(function(e){e["PERCENTAGE"]="percentage";e["FIXED"]="fixed"})(s||(s={}));var i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>`;var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M3 12C7.5 12 12 7.5 12 3C12 7.5 16.5 12 21 12C16.5 12 12 16.5 12 21C12 16.5 7.5 12 3 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M2 19.5C2.83333 19.5 4.5 17.8333 4.5 17C4.5 17.8333 6.16667 19.5 7 19.5C6.16667 19.5 4.5 21.1667 4.5 22C4.5 21.1667 2.83333 19.5 2 19.5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n <path d="M16 5C17 5 19 3 19 2C19 3 21 5 22 5C21 5 19 7 19 8C19 7 17 5 16 5Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"></path>\n</svg>`;var n=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="40" height="40" color="#000000" fill="none">\n <path d="M14.2644 18.3717C14.5806 17.407 14.7387 16.9247 15.0616 16.593C15.215 16.4354 15.3932 16.3048 15.5887 16.2066C16.0003 16 16.5003 16 17.5002 16C18.5001 16 19.0001 16 19.4116 16.2066C19.6072 16.3048 19.7853 16.4354 19.9388 16.593C20.2617 16.9247 20.4198 17.407 20.736 18.3717L21.0624 19.3675C21.4561 20.5688 21.653 21.1694 21.3587 21.5847C21.0643 22 20.4418 22 19.1966 22H15.8038C14.5586 22 13.936 22 13.6417 21.5847C13.3473 21.1694 13.5442 20.5688 13.938 19.3675L14.2644 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M8.76421 10.3717C9.08041 9.40705 9.23851 8.92471 9.56143 8.59298C9.71485 8.43537 9.89299 8.3048 10.0885 8.20663C10.5001 8 11.0001 8 12 8C12.9999 8 13.4999 8 13.9115 8.20663C14.107 8.3048 14.2851 8.43537 14.4386 8.59298C14.7615 8.92471 14.9196 9.40705 15.2358 10.3717L15.5622 11.3675C15.956 12.5688 16.1528 13.1694 15.8585 13.5847C15.5642 14 14.9416 14 13.6964 14H10.3036C9.05842 14 8.43585 14 8.1415 13.5847C7.84716 13.1694 8.04404 12.5688 8.43779 11.3675L8.76421 10.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M3.26439 18.3717C3.58059 17.407 3.73869 16.9247 4.06162 16.593C4.21504 16.4354 4.39317 16.3048 4.58872 16.2066C5.00031 16 5.50027 16 6.50018 16C7.5001 16 8.00006 16 8.41165 16.2066C8.6072 16.3048 8.78533 16.4354 8.93875 16.593C9.26167 16.9247 9.41977 17.407 9.73597 18.3717L10.0624 19.3675C10.4561 20.5688 10.653 21.1694 10.3587 21.5847C10.0643 22 9.44176 22 8.19661 22H4.80375C3.5586 22 2.93603 22 2.64169 21.5847C2.34735 21.1694 2.54422 20.5688 2.93797 19.3675L3.26439 18.3717Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M12 2V4M7.5 3.5L9 5M16.5 3.5L15 5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n</svg>`;var l=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" color="#000000" fill="none">\n <path d="M5.78223 4.18192C6.43007 3.68319 6.754 3.43383 7.12788 3.27323C7.29741 3.20041 7.47367 3.14158 7.65459 3.09741C8.0536 3 8.4767 3 9.32289 3H14.6771C15.5233 3 15.9464 3 16.3454 3.09741C16.5263 3.14158 16.7026 3.20041 16.8721 3.27323C17.246 3.43383 17.5699 3.68319 18.2178 4.18192C20.3644 5.83448 21.4378 6.66077 21.8057 7.73078C21.9694 8.20673 22.0305 8.70728 21.9858 9.20461C21.8852 10.3227 21.0379 11.346 19.3433 13.3925L15.3498 18.2153C13.8126 20.0718 13.044 21 12 21C10.956 21 10.1874 20.0718 8.65018 18.2153L4.65671 13.3925C2.96208 11.346 2.11476 10.3227 2.0142 9.20461C1.96947 8.70728 2.03064 8.20673 2.1943 7.73078C2.56224 6.66077 3.63557 5.83448 5.78223 4.18192Z" stroke="currentColor" stroke-width="1.5"></path>\n <path d="M10 8.5H14" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>\n</svg>`;const a={staticIcons:[i,o,n,l],staticColors:["#993018","#444444","#D18F36","#315F9C"]};class d{static findTierByIndex(e,t){return e.find((e=>e.index===t))||null}static findTierByName(e,t){return e.find((e=>e.tier_name===t))||null}static getTierNameByIndex(e,t){var r;return(r=this.findTierByIndex(e,t))===null||r===void 0?void 0:r.tier_name}static findCurrentTierIndex(e,t){if(!t)return 0;for(let r=t.length-1;r>=0;r--){if(e>=t[r].threshold){return t[r].index}}return 0}}const f=".s-tiered-offer-milestone-icon svg{color:currentColor}.s-tiered-offer-milestone-icon svg path{stroke:currentColor;fill:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg path{fill:currentColor;stroke:none}.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-active svg[fill=none] path,.s-tiered-offer-milestone-icon.s-tiered-offer-milestone-completed svg[fill=none] path{fill:none;stroke:currentColor}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-bg{-webkit-transform:scaleX(-1);transform:scaleX(-1)}[dir=rtl] .s-tiered-offer-progress-wrapper .s-tiered-offer-progress-fill{-webkit-transform:scaleX(-1);transform:scaleX(-1);left:auto}[dir=rtl] .flip-x{-webkit-transform:scaleX(-1);transform:scaleX(-1)}";const c=class{constructor(t){e(this,t);this.currentTierIndex=0;this.canRender=false;this.isLoading=false;this.handleTabClick=e=>{this.activeTabTier=e};salla.lang.onLoaded((()=>{this.loyaltyProgramText=salla.lang.get("blocks.tiered_offer.program_title");this.currentTierText=salla.lang.get("blocks.tiered_offer.current_tier");this.discountText=salla.lang.get("blocks.tiered_offer.discount");this.benefitText=salla.lang.get("blocks.tiered_offer.tier_description")}))}async componentWillLoad(){try{await salla.onReady();if(!this.checkFeatureEnabled()){return}if(!this.checkCartExists()){return}this.isLoading=true;const e=await this.fetchTieredOfferData();if(!e){return}this.initializeComponent(e)}catch(e){this.canRender=false;salla.logger.warn("salla-tiered-offer:: ",e)}finally{this.isLoading=false}}checkFeatureEnabled(){var e;return(e=salla.config.get("store.features"))===null||e===void 0?void 0:e.includes("tiered-offer")}checkCartExists(){var e,t;return!!((t=(e=salla.storage.get("cart"))===null||e===void 0?void 0:e.summary)===null||t===void 0?void 0:t.count)}validateCouponCompatibility(e,t){var r;return!(t&&!((r=e.details)===null||r===void 0?void 0:r.applied_with_coupon))}async fetchTieredOfferData(){var e;try{const{data:t}=await salla.api.cart.offers();const r=t.find((e=>e.type==="tiered_offer"));if(!r){return null}if(!this.validateCouponCompatibility(r,(e=salla.storage.get("cart"))===null||e===void 0?void 0:e.coupon)){this.canRender=false;return null}return r}catch(e){throw e}}initializeComponent(e){var t;this.apiOfferData=e;this.tieredOfferData=this.mapApiDataToTiers(this.apiOfferData);this.loyaltyProgramText=this.apiOfferData.title||this.loyaltyProgramText;const r=((t=this.apiOfferData.details)===null||t===void 0?void 0:t.current_value)||0;const s=this.findCurrentTierIndex(r);if(s===0){this.canRender=false;return}this.currentTierIndex=s;this.currentTier=d.getTierNameByIndex(this.tieredOfferData.tiers,s);this.activeTabTier=this.currentTier;this.canRender=true}componentDidLoad(){salla.event.on("cart::updated",(async e=>{const t=await this.fetchTieredOfferData();if(t){this.updateOfferValues(e,t)}}))}mapApiDataToTiers(e){const t=[...e.details.discounts].sort(((e,t)=>e.min_spend-t.min_spend));const r=t.map(((e,t)=>({name:e.name,tier_name:e.name,discount:e.type===s.PERCENTAGE?`${salla.helpers.number(e.value)}%`:salla.money(e.value),icon:a.staticIcons[t]||a.staticIcons[0],threshold:e.min_spend,text_color:a.staticColors[t],index:t+1})));return{current_tier:d.getTierNameByIndex(r,this.findCurrentTierIndex(e.details.current_value,r)),tiers:r}}findCurrentTierIndex(e,t){var r;if(t===void 0){t=(r=this.tieredOfferData)===null||r===void 0?void 0:r.tiers}return d.findCurrentTierIndex(e,t||[])}updateOfferValues(e,t){var r,s;if(!t||!this.tieredOfferData){return}if(!this.validateCouponCompatibility(t,e.coupon)){this.canRender=false;return}this.canRender=true;if(((r=t.details)===null||r===void 0?void 0:r.with_current_cart)===false){return}const i=((s=t.details)===null||s===void 0?void 0:s.current_value)||0;this.apiOfferData=t;const o=this.findCurrentTierIndex(i);if(o===0){this.canRender=false;return}this.canRender=true;this.currentTierIndex=o;this.currentTier=d.getTierNameByIndex(this.tieredOfferData.tiers,o);if(this.activeTabTier!==this.currentTier){this.activeTabTier=this.currentTier}}getLoadingSkeletonView(){return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-skeleton-wrapper"},t("div",{class:"s-tiered-offer-skeleton-title"},t("salla-skeleton",{height:"16px",width:"40%"})),t("div",{class:"s-tiered-offer-skeleton-subtitle"},t("salla-skeleton",{height:"20px",width:"60%"})),t("div",{class:"s-tiered-offer-skeleton-progress"},t("salla-skeleton",{height:"16px",width:"100%"})),t("div",{class:"s-tiered-offer-skeleton-tabs"},t("salla-skeleton",{height:"50px",width:"100%"})))))}getCurrentTierData(){return d.findTierByIndex(this.tieredOfferData.tiers,this.currentTierIndex)||this.tieredOfferData.tiers[0]}getProgressWidth(){var e;const t=((e=this.apiOfferData.details)===null||e===void 0?void 0:e.current_value)||0;const r=this.tieredOfferData.tiers.length;const s=this.findCurrentTierIndex(t);const i=s;return i/r*100}calculateMilestonePosition(e,t){if(t===1){return"calc(100% - 18px)"}const r=(e+1)/t*100;const s=8/t;return`${Math.max(2,Math.min(95,r-s))}%`}getMilestoneStyles(e,t,r){const s=document.documentElement.dir==="rtl";const i=this.calculateMilestonePosition(t,r);const o=e.name.length>6?"flex-end":"center";return{[s?"right":"left"]:i,alignItems:o,position:"absolute",transform:s?"translateX(50%)":"translateX(-50%)"}}getMilestoneIconStyles(e,t,r){if(t){return{color:e.text_color}}if(r){return{color:"var(--color-primary)"}}return{}}renderProgressBarBackground(e){return[t("div",{class:"s-tiered-offer-progress-bg"}),t("div",{class:"s-tiered-offer-progress-fill",style:{width:`${e}%`}})]}renderMilestoneIcon(e,r,s){const i=["s-tiered-offer-milestone-icon",r?"s-tiered-offer-milestone-active":"",s?"s-tiered-offer-milestone-completed":""].filter(Boolean).join(" ");return t("div",{class:i,style:this.getMilestoneIconStyles(e,r,s)},t("span",{innerHTML:e.icon}))}renderMilestoneName(e,r){return t("div",{class:"s-tiered-offer-milestone-name"},r&&t("span",{style:{color:e.text_color}},e.name))}renderMilestones(e,r){const s=r===1?"s-tiered-offer-single-milestone-justify-end":"s-tiered-offer-milestones";return t("div",{class:"s-tiered-offer-milestones-wrapper"},t("div",{class:s},this.tieredOfferData.tiers.map(((s,i)=>{const o=e>=s.threshold;const n=s.tier_name===this.currentTier;return t("div",{class:"s-tiered-offer-milestone",style:this.getMilestoneStyles(s,i,r)},this.renderMilestoneIcon(s,n,o),this.renderMilestoneName(s,n))}))))}renderProgressBar(){var e;const r=this.getProgressWidth();const s=this.tieredOfferData.tiers.length;const i=((e=this.apiOfferData.details)===null||e===void 0?void 0:e.current_value)||0;return t("div",{class:"s-tiered-offer-progress-container"},t("div",{class:"s-tiered-offer-progress-wrapper"},this.renderProgressBarBackground(r),this.renderMilestones(i,s)))}renderTabs(){return t("div",{class:"s-tiered-offer-tabs-container"},t("div",{class:"s-tiered-offer-tab-headers"},this.tieredOfferData.tiers.map((e=>{const r=e.tier_name===this.activeTabTier;return t("button",{class:`s-tiered-offer-tab-header ${r?"s-tiered-offer-tab-active":""}`,onClick:()=>this.handleTabClick(e.tier_name)},t("span",null,e.name))}))),t("div",{class:"s-tiered-offer-tab-content-wrapper"},(()=>{const e=d.findTierByName(this.tieredOfferData.tiers,this.activeTabTier);if(!e)return null;return t("div",{class:"s-tiered-offer-tab-content"},t("div",{class:"s-tiered-offer-tab-content-inner"},t("div",{class:"s-tiered-offer-discount-section"},t("p",{class:"s-tiered-offer-discount-title"},this.discountText," ",t("span",{innerHTML:e.discount})),t("p",{class:"s-tiered-offer-benefit-description"},this.benefitText," ",e.name))))})()))}render(){if(this.isLoading){return this.getLoadingSkeletonView()}if(!this.canRender||!this.tieredOfferData){return null}const e=this.getCurrentTierData();return t(r,null,t("div",{class:"s-tiered-offer-container"},t("div",{class:"s-tiered-offer-header"},t("div",{class:"s-tiered-offer-header-content"},t("p",{class:"s-tiered-offer-program-title"},this.loyaltyProgramText),t("div",{class:"s-tiered-offer-current-tier-name-wrapper"},t("h2",{class:"s-tiered-offer-current-tier"},this.currentTierText," ",t("span",{class:"s-tiered-offer-tier-name"},e.name)),t("span",{innerHTML:e.icon})))),this.renderProgressBar(),this.renderTabs()))}};c.style=f;export{c as salla_tiered_offer};
5
+ //# sourceMappingURL=p-56074b1e.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,i,n,e){function r(t){return t instanceof n?t:new n((function(i){i(t)}))}return new(n||(n=Promise))((function(n,s){function o(t){try{a(e.next(t))}catch(t){s(t)}}function u(t){try{a(e["throw"](t))}catch(t){s(t)}}function a(t){t.done?n(t.value):r(t.value).then(o,u)}a((e=e.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,r,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(i){return a([t,i])}}function a(u){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(n=0)),n)try{if(e=1,r&&(s=u[0]&2?r["return"]:u[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,u[1])).done)return s;if(r=0,s)u=[u[0]&2,s.value];switch(u[0]){case 0:case 1:s=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;r=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1];s=u;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(u);break}if(s[2])n.ops.pop();n.trys.pop();continue}u=i.call(t,n)}catch(t){u=[6,t];r=0}finally{e=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-CXK1rNlC.system.js","./p-Be8TJdpm.system.js"],(function(t){"use strict";var i,n,e,r,s,o;return{setters:[function(t){i=t.r;n=t.c;e=t.h;r=t.H;s=t.g},function(t){o=t.M}],execute:function(){var u='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n';var a="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";var f=t("salla_verify",function(){function t(t){var e=this;i(this,t);this.verified=n(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((function(){var t;e.translationLoaded=true;e.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+e.type);(t=e.modal)===null||t===void 0?void 0:t.setTitle(e.title)}));if(this.display=="inline"){this.modal={open:function(){return""},close:function(){return""},setTitle:function(){return""}};return}salla.event.on("profile::verification",(function(t){var i;var n=Array.isArray(t)?t[0]:t;e.isProfileVerify=true;e.open(n);e.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+n.type);(i=e.modal)===null||i===void 0?void 0:i.setTitle(e.title)}));salla.event.on("modalClosed",(function(){e.resendAfter=0;e.timer.innerHTML="30 : 00"}))}t.prototype.splitNumber=function(t){this.resetError();var i=t.data||t.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(t.target,i)};t.prototype.modifyNext=function(t,i){t.value=i[0];i=i.substring(1);if(t.nextElementSibling&&i.length){this.modifyNext(t.nextElementSibling,i)}else if(!t.nextElementSibling&&i.length===0){t.focus()}else if(t.nextElementSibling&&i.length===0){t.nextElementSibling.focus()}};t.prototype.checkAllInputs=function(){var t=true;for(var i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){t=false}}return t};t.prototype.handleKeyUp=function(t){var i,n,e,r;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(t.key)){return}var s=t.keyCode||t.charCode;if(t.target.value){(i=t.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(n=t.target.nextElementSibling)===null||n===void 0?void 0:n.select()}else if([8,46].includes(s)){(e=t.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(r=t.target.previousElementSibling)===null||r===void 0?void 0:r.select()}if(t.target.value.length>1){this.splitNumber(t)}};t.prototype.handlePaste=function(t){this.resetError();var i=salla.helpers.number(t.clipboardData.getData("text"))||"";var n=i.replace(/[^0-9]/g,"");n=n.substring(0,this.otpInputs.length);this.otpInputs.forEach((function(t){return t.value=""}));this.modifyNext(this.otpInputs[0],n)};t.prototype.handleInput=function(t){var i=this;this.resetError();salla.helpers.inputDigitsOnly(t.target);if(this.checkAllInputs()){setTimeout((function(){i.toggleOTPSubmit()}),100)}};t.prototype.resetError=function(){this.hasError=false;this.errorMessage=""};t.prototype.handleFocus=function(t){var i;if(t.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(t.target.previousElementSibling.value==""){t.target.previousElementSibling.focus()}};t.prototype.getCode=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.code.value]}))}))};t.prototype.open=function(t){return __awaiter(this,void 0,void 0,(function(){var i,n;var e=this;return __generator(this,(function(r){this.data=t;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(n=this.firstOtpInput)===null||n===void 0?void 0:n.addEventListener("input",(function(t){return e.splitNumber(t)}));setTimeout((function(){return e.otpInputs[0].focus()}),100);return[2]}))}))};t.prototype.toggleOTPSubmit=function(){var t=[];this.otpInputs.forEach((function(i){return i.value&&t.push(i.value)}));this.code.value=t.join("");if(t.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()};t.prototype.reset=function(){this.otpInputs.forEach((function(t){return t.value=""}));this.code.value="";this.otpInputs[0].focus()};t.prototype.resendTimer=function(){var t=this;this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;var i=setInterval((function(){if(t.resendAfter<=0){clearInterval(i);t.resend.style.display="block";t.resendMessage.style.display="none"}else{t.timer.innerHTML="".concat(t.resendAfter>=10?t.resendAfter:"0"+t.resendAfter," : 00");t.resendAfter--}}),1e3)};t.prototype.resendCode=function(){var t=this;return this.btn.stop().then((function(){return t.btn.disable()})).then((function(){t.otpInputs.forEach((function(t){return t.value=""}));t.otpInputs[0].focus()})).then((function(){return salla.api.auth.resend(t.data)})).finally((function(){return t.resendTimer()}))};t.prototype.submit=function(){var t=this;if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}var i=Object.assign({code:this.code.value},this.data);return this.btn.load().then((function(){return t.btn.disable()})).then((function(){return t.isProfileVerify?salla.profile.verify(i):salla.auth.verify(i,t.supportWebAuth)})).then((function(i){return t.verified.emit(i)})).then((function(){return t.btn.stop()&&t.btn.disable()})).then((function(){return t.modal.close()})).then((function(){return t.autoReload&&window.location.reload()})).catch((function(i){var n,e,r;t.hasError=true;t.errorMessage=((r=(e=(n=i.response)===null||n===void 0?void 0:n.data)===null||e===void 0?void 0:e.error)===null||r===void 0?void 0:r.message)||salla.lang.get("common.errors.error_occurred");if(!i.response){console.log("Unexpected error",i)}else{salla.logger.error(i)}t.btn.stop()&&t.btn.enable()&&t.reset()}))};t.prototype.render=function(){var t=this;return this.display=="inline"?e(r,null,this.myBody()):e("salla-modal",{width:"xs",class:"s-verify",ref:function(i){return t.modal=i},"modal-title":this.title},e("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?u:o}),this.myBody())};t.prototype.myBody=function(){var t=this;return e("div",{class:"s-verify-body",ref:function(i){return t.body=i}},e("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),e("slot",{name:"mobile"}),e("slot",{name:"email"}),e("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:function(i){return t.code=i}}),e("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((function(i){return e("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:"otp-".concat(i),class:{"s-verify-input":true,"s-has-error":t.hasError},onInput:function(i){return t.handleInput(i)},onPaste:function(i){return t.handlePaste(i)},onKeyUp:function(i){return t.handleKeyUp(i)},onFocus:function(i){return t.handleFocus(i)},required:true})}))),this.hasError&&this.errorMessage?e("span",{class:"s-verify-error-message"},this.errorMessage):"",e("div",{slot:"footer",class:"s-verify-footer"},e("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:function(){return t.submit()},ref:function(i){return t.btn=i}},salla.lang.get("pages.profile.verify")),e("p",{class:"s-verify-resend-message",ref:function(i){return t.resendMessage=i}},salla.lang.get("blocks.header.resend_after"),e("b",{class:"s-verify-timer",ref:function(i){return t.timer=i}})),e("a",{href:"#",class:"s-verify-resend",onClick:function(){return t.resendCode()},ref:function(i){return t.resend=i}},salla.lang.get("blocks.comments.submit"))),e("slot",{name:"after-footer"}))};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());f.style=a}}}));
5
- //# sourceMappingURL=p-777970a0.system.entry.js.map
4
+ */System.register(["./p-9cvlynxW.system.js","./p-Be8TJdpm.system.js"],(function(t){"use strict";var i,n,e,r,s,o;return{setters:[function(t){i=t.r;n=t.c;e=t.h;r=t.H;s=t.g},function(t){o=t.M}],execute:function(){var u='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n';var a="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";var f=t("salla_verify",function(){function t(t){var e=this;i(this,t);this.verified=n(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((function(){var t;e.translationLoaded=true;e.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+e.type);(t=e.modal)===null||t===void 0?void 0:t.setTitle(e.title)}));if(this.display=="inline"){this.modal={open:function(){return""},close:function(){return""},setTitle:function(){return""}};return}salla.event.on("profile::verification",(function(t){var i;var n=Array.isArray(t)?t[0]:t;e.isProfileVerify=true;e.open(n);e.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+n.type);(i=e.modal)===null||i===void 0?void 0:i.setTitle(e.title)}));salla.event.on("modalClosed",(function(){e.resendAfter=0;e.timer.innerHTML="30 : 00"}))}t.prototype.splitNumber=function(t){this.resetError();var i=t.data||t.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(t.target,i)};t.prototype.modifyNext=function(t,i){t.value=i[0];i=i.substring(1);if(t.nextElementSibling&&i.length){this.modifyNext(t.nextElementSibling,i)}else if(!t.nextElementSibling&&i.length===0){t.focus()}else if(t.nextElementSibling&&i.length===0){t.nextElementSibling.focus()}};t.prototype.checkAllInputs=function(){var t=true;for(var i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){t=false}}return t};t.prototype.handleKeyUp=function(t){var i,n,e,r;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(t.key)){return}var s=t.keyCode||t.charCode;if(t.target.value){(i=t.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(n=t.target.nextElementSibling)===null||n===void 0?void 0:n.select()}else if([8,46].includes(s)){(e=t.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(r=t.target.previousElementSibling)===null||r===void 0?void 0:r.select()}if(t.target.value.length>1){this.splitNumber(t)}};t.prototype.handlePaste=function(t){this.resetError();var i=salla.helpers.number(t.clipboardData.getData("text"))||"";var n=i.replace(/[^0-9]/g,"");n=n.substring(0,this.otpInputs.length);this.otpInputs.forEach((function(t){return t.value=""}));this.modifyNext(this.otpInputs[0],n)};t.prototype.handleInput=function(t){var i=this;this.resetError();salla.helpers.inputDigitsOnly(t.target);if(this.checkAllInputs()){setTimeout((function(){i.toggleOTPSubmit()}),100)}};t.prototype.resetError=function(){this.hasError=false;this.errorMessage=""};t.prototype.handleFocus=function(t){var i;if(t.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(t.target.previousElementSibling.value==""){t.target.previousElementSibling.focus()}};t.prototype.getCode=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.code.value]}))}))};t.prototype.open=function(t){return __awaiter(this,void 0,void 0,(function(){var i,n;var e=this;return __generator(this,(function(r){this.data=t;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(n=this.firstOtpInput)===null||n===void 0?void 0:n.addEventListener("input",(function(t){return e.splitNumber(t)}));setTimeout((function(){return e.otpInputs[0].focus()}),100);return[2]}))}))};t.prototype.toggleOTPSubmit=function(){var t=[];this.otpInputs.forEach((function(i){return i.value&&t.push(i.value)}));this.code.value=t.join("");if(t.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()};t.prototype.reset=function(){this.otpInputs.forEach((function(t){return t.value=""}));this.code.value="";this.otpInputs[0].focus()};t.prototype.resendTimer=function(){var t=this;this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;var i=setInterval((function(){if(t.resendAfter<=0){clearInterval(i);t.resend.style.display="block";t.resendMessage.style.display="none"}else{t.timer.innerHTML="".concat(t.resendAfter>=10?t.resendAfter:"0"+t.resendAfter," : 00");t.resendAfter--}}),1e3)};t.prototype.resendCode=function(){var t=this;return this.btn.stop().then((function(){return t.btn.disable()})).then((function(){t.otpInputs.forEach((function(t){return t.value=""}));t.otpInputs[0].focus()})).then((function(){return salla.api.auth.resend(t.data)})).finally((function(){return t.resendTimer()}))};t.prototype.submit=function(){var t=this;if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}var i=Object.assign({code:this.code.value},this.data);return this.btn.load().then((function(){return t.btn.disable()})).then((function(){return t.isProfileVerify?salla.profile.verify(i):salla.auth.verify(i,t.supportWebAuth)})).then((function(i){return t.verified.emit(i)})).then((function(){return t.btn.stop()&&t.btn.disable()})).then((function(){return t.modal.close()})).then((function(){return t.autoReload&&window.location.reload()})).catch((function(i){var n,e,r;t.hasError=true;t.errorMessage=((r=(e=(n=i.response)===null||n===void 0?void 0:n.data)===null||e===void 0?void 0:e.error)===null||r===void 0?void 0:r.message)||salla.lang.get("common.errors.error_occurred");if(!i.response){console.log("Unexpected error",i)}else{salla.logger.error(i)}t.btn.stop()&&t.btn.enable()&&t.reset()}))};t.prototype.render=function(){var t=this;return this.display=="inline"?e(r,null,this.myBody()):e("salla-modal",{width:"xs",class:"s-verify",ref:function(i){return t.modal=i},"modal-title":this.title},e("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?u:o}),this.myBody())};t.prototype.myBody=function(){var t=this;return e("div",{class:"s-verify-body",ref:function(i){return t.body=i}},e("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),e("slot",{name:"mobile"}),e("slot",{name:"email"}),e("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:function(i){return t.code=i}}),e("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((function(i){return e("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:"otp-".concat(i),class:{"s-verify-input":true,"s-has-error":t.hasError},onInput:function(i){return t.handleInput(i)},onPaste:function(i){return t.handlePaste(i)},onKeyUp:function(i){return t.handleKeyUp(i)},onFocus:function(i){return t.handleFocus(i)},required:true})}))),this.hasError&&this.errorMessage?e("span",{class:"s-verify-error-message"},this.errorMessage):"",e("div",{slot:"footer",class:"s-verify-footer"},e("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:function(){return t.submit()},ref:function(i){return t.btn=i}},salla.lang.get("pages.profile.verify")),e("p",{class:"s-verify-resend-message",ref:function(i){return t.resendMessage=i}},salla.lang.get("blocks.header.resend_after"),e("b",{class:"s-verify-timer",ref:function(i){return t.timer=i}})),e("a",{href:"#",class:"s-verify-resend",onClick:function(){return t.resendCode()},ref:function(i){return t.resend=i}},salla.lang.get("blocks.comments.submit"))),e("slot",{name:"after-footer"}))};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());f.style=a}}}));
5
+ //# sourceMappingURL=p-56628b3c.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as s,H as a,g as i}from"./p-Fh3juwdj.js";var n=`\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;var l=`\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>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(s){e(this,s);this.invalidInput=t(this,"invalidInput");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((()=>this.setTranslations()));Salla.event.on("booking::open",(e=>this.handleBookingOpen(e)))}async setTranslations(){const e=(e,t,s)=>new Promise((a=>{salla.helpers.setNested(salla.lang.messages[e],t,s);a(true)}));await e("ar.trans","pages.cart.book_an_appointment","حجز موعد");await e("en.trans","pages.cart.book_an_appointment","Book an Appointment");await e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await e("en.trans","pages.cart.booked_successfully","Booked Successfully");await e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await e("en.trans","pages.cart.select_appointment_date","Select appointment date");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(e,t=false){if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((e=>{if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:this.productId})})).catch((e=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))}handleBookingOpen(e){if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}setAfterReloadEvent(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})}emitAfterReloadEvent(){const e=salla.storage.get("afterReloadEvent");if(e&&e.event){const t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}componentDidLoad(){window.addEventListener("booking::open-after-reload",(e=>this.openBookingModal(e,true)));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(e=>this.invalidInput.emit(e)));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}handleMessageEvent(e){var t,s;if(e.data.source!=="booking")return;const a=e.data.type;const i=e.data.message;if(localStorage.getItem("debug"))console.log(`Received an action:${a}`,e.data);if(a==="error"){if((t=i.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(i.fields.reservation[0]);return}const e=Object.values(i.fields||[i.message]).flat().map((e=>`<li>${e}</li>`)).join("");salla.notify.error(`<ul>${e}</ul>`)}if(a==="success"){if(Number(i.productId)!==Number(this.productId))return;this.reservations=i.data.reservations.map((e=>{if(e.time&&e.time.length>0){const t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((e=>e!==null));salla.notify.success(this.bookedLabel);(s=this.modal)===null||s===void 0?void 0:s.close();setTimeout((()=>window.location.reload()))}if(a==="height"){this.iframe.height=(i===null||i===void 0?void 0:i.height)+"px"}}bookingModal(){return s("salla-modal",{class:"s-booking-field-modal",ref:e=>this.modal=e,width:"md",position:"middle",noPadding:true},s("iframe",{ref:e=>this.iframe=e,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(e){return s("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},s("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)}renderReservationTime(e){if(!e.from_timestamp)return"";return s("span",{class:"s-booking-field-reservations-time"},s("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),s("span",null,e.from_timestamp," - ",e.to_timestamp))}render(){return s(a,{key:"56540a5278d395485a411e712929f32cf76f637e"},s("div",{key:"63673b28b671596d47f4f014223e9c5012f3b671",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?s("div",{class:"s-booking-field-price"},s("span",{innerHTML:salla.money(this.option.price)})):"",s("salla-button",{key:"6d9ffa722391aa0234454fe9ddc90f3477268489",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{key:"dcc8a2b68be4596199e7c776f4501764fd25523f",class:"s-booking-field-book-now-content"},s("span",{key:"b4b2eaf369a5fa822c84b376808c7ee16d8d2598",innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{key:"2684b88bdaf47133dbcaaf6c96f1b81d4ee7ca70",class:"s-booking-field-reservations"},this.reservations.map(((e,t)=>s("div",{key:t,class:"s-booking-field-reservations-item"},this.renderReservationDate(e),this.renderReservationTime(e))))),s("input",{key:"3d20fcb5fbca8a9e340344d41c316619aec03050",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:e=>this.reservationsInput=e}),this.iframeReady&&this.bookingModal())}get host(){return i(this)}};c.style=r;const d=class{constructor(t){e(this,t)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden");this.hideAllOptions(e.dataset.optionId);this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((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}}))}changeHandler(e){var t;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox","radio"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.tagName)||"N/A"));return}let s=e.target.name.replace("[]","");let a=e.target.getAttribute("type")==="checkbox";let i=e.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",`[data-show-when^="${s}"]`);this.host.querySelectorAll(`[data-show-when^="${s}"]`).forEach((t=>{let s=!(t===null||t===void 0?void 0:t.dataset.showWhen.includes("!="));let n=t===null||t===void 0?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let o;if(a){let t=Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>e===null||e===void 0?void 0:e.value));o=t.includes(n.toString())}else if(i){o=e.target.checked&&e.target.value===n}else{o=n===e.target.value}salla.log("The input is ",a?"Multiple":i?"Radio":"Single"," value:",o);let l=s&&o||!s&&!o;if(l){t.classList.remove("hidden");t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled");const t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){const t=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${e.getAttribute("name")}"]`));const s=t.some((e=>e.checked));if(s){t.forEach((e=>{e.removeAttribute("required")}))}}}))}else{this.hideAllOptions(t.dataset.optionId);t.classList.add("hidden");this.disableInputs(t)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((e=>{var t;let s=(t=e===null||e===void 0?void 0:e.dataset)===null||t===void 0?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!s){return}this.changeHandler({target:this.host.querySelector('[name^="'+s+'"]')})}))}render(){return s(a,{key:"aed72d12357c54338c231d5d4c259a510f8b4e95"},s("slot",{key:"84c5af881a45cee9fa71f5e2e63ee9b92aad76c9"}))}get host(){return i(this)}};export{c as salla_booking_field,d as salla_conditional_fields};
5
- //# sourceMappingURL=p-f8232bd5.entry.js.map
4
+ import{r as e,c as t,h as s,H as a,g as i}from"./p-aC-cHVMV.js";var n=`\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>calendar-time</title>\n<path d="M22.667 17.333c-0.737 0-1.333 0.596-1.333 1.333v2.667h-2.667c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h4c0.737 0 1.333-0.596 1.333-1.333v-4c0-0.737-0.596-1.333-1.333-1.333zM28 2.667h-2.667v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h5.363c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-5.363c-0.736 0-1.333-0.597-1.333-1.333v-21.333c0-0.736 0.597-1.333 1.333-1.333h2.667v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333v2.696c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.696c0-2.205-1.795-4-4-4zM22 12c-5.515 0-10 4.485-10 10s4.485 10 10 10 10-4.485 10-10-4.485-10-10-10zM22 29.333c-4.043 0-7.333-3.291-7.333-7.333s3.291-7.333 7.333-7.333 7.333 3.291 7.333 7.333-3.291 7.333-7.333 7.333z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>calendar</title>\n<path d="M28 2.667h-2.667v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-13.333v-1.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333h-2.667c-2.205 0-4 1.795-4 4v21.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-21.333c0-2.205-1.795-4-4-4zM29.333 28c0 0.736-0.599 1.333-1.333 1.333h-24c-0.736 0-1.333-0.599-1.333-1.333v-13.333h26.667zM29.333 12h-26.667v-5.333c0-0.736 0.599-1.333 1.333-1.333h2.667v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h13.333v2.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.667h2.667c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n`;var l=`\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>time</title>\n<path d="M16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333zM16 8c-0.736 0-1.333 0.596-1.333 1.333v6.667h-4c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h5.333c0.736 0 1.333-0.596 1.333-1.333v-8c0-0.737-0.597-1.333-1.333-1.333z"></path>\n</svg>\n`;const r=":host{display:block}";const c=class{constructor(s){e(this,s);this.invalidInput=t(this,"invalidInput");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment","حجز موعد");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment","تعديل الموعد");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");this.selectDate=salla.lang.get("pages.cart.select_appointment_date","حدد تاريخ الموعد");this.bookingUrl="";this.iframeReady=false;this.reservations=[];salla.lang.onLoaded((()=>this.setTranslations()));Salla.event.on("booking::open",(e=>this.handleBookingOpen(e)))}async setTranslations(){const e=(e,t,s)=>new Promise((a=>{salla.helpers.setNested(salla.lang.messages[e],t,s);a(true)}));await e("ar.trans","pages.cart.book_an_appointment","حجز موعد");await e("en.trans","pages.cart.book_an_appointment","Book an Appointment");await e("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد");await e("en.trans","pages.cart.edit_an_appointment","Edit an Appointment");await e("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح");await e("en.trans","pages.cart.booked_successfully","Booked Successfully");await e("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد");await e("en.trans","pages.cart.select_appointment_date","Select appointment date");this.bookNowLabel=salla.lang.get("pages.cart.book_an_appointment");this.editLabel=salla.lang.get("pages.cart.edit_an_appointment");this.bookedLabel=salla.lang.get("pages.cart.booked_successfully");this.selectDate=salla.lang.get("pages.cart.select_appointment_date")}openBookingModal(e,t=false){if(t&&(!e.detail||typeof e.detail!=="number"||e.detail!==this.productId)){return}if(salla.config.isGuest()){this.setAfterReloadEvent("booking::open-after-reload",this.productId);salla.event.dispatch("login::open");return}salla.booking.add(this.productId,false).then((e=>{if(e.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:e.data.redirect.url,id:this.productId})})).catch((e=>{salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(e.response||e)}))}handleBookingOpen(e){if(e.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",e.id,e.url);this.iframeReady=true;setTimeout((()=>{this.modal.setTitle(this.selectDate);this.modal.open()}),100)}setAfterReloadEvent(e,t){salla.storage.set("afterReloadEvent",{event:e,payload:t})}emitAfterReloadEvent(){const e=salla.storage.get("afterReloadEvent");if(e&&e.event){const t=new CustomEvent(e.event,{detail:e.payload});window.dispatchEvent(t);salla.storage.remove("afterReloadEvent")}}componentWillLoad(){if(this.option&&this.option.details.length){this.reservations=this.option.details}}componentDidLoad(){window.addEventListener("booking::open-after-reload",(e=>this.openBookingModal(e,true)));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(e=>this.invalidInput.emit(e)));this.reservationsInput.addEventListener("input",(()=>{this.reservationsInput.setCustomValidity("");this.reservationsInput.reportValidity()}))}handleMessageEvent(e){var t,s;if(e.data.source!=="booking")return;const a=e.data.type;const i=e.data.message;if(localStorage.getItem("debug"))console.log(`Received an action:${a}`,e.data);if(a==="error"){if((t=i.fields)===null||t===void 0?void 0:t.reservation){salla.notify.error(i.fields.reservation[0]);return}const e=Object.values(i.fields||[i.message]).flat().map((e=>`<li>${e}</li>`)).join("");salla.notify.error(`<ul>${e}</ul>`)}if(a==="success"){if(Number(i.productId)!==Number(this.productId))return;this.reservations=i.data.reservations.map((e=>{if(e.time&&e.time.length>0){const t=e.time[0];return{date:e.date,day:e.day,from_timestamp:t.from,to_timestamp:t.to}}return null})).filter((e=>e!==null));salla.notify.success(this.bookedLabel);(s=this.modal)===null||s===void 0?void 0:s.close();setTimeout((()=>window.location.reload()))}if(a==="height"){this.iframe.height=(i===null||i===void 0?void 0:i.height)+"px"}}bookingModal(){return s("salla-modal",{class:"s-booking-field-modal",ref:e=>this.modal=e,width:"md",position:"middle",noPadding:true},s("iframe",{ref:e=>this.iframe=e,src:this.bookingUrl,frameborder:"0"}))}renderReservationDate(e){return s("span",{class:e.from_timestamp?"s-booking-field-reservations-has-time":""},s("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),e.date)}renderReservationTime(e){if(!e.from_timestamp)return"";return s("span",{class:"s-booking-field-reservations-time"},s("i",{class:"s-booking-field-reservations-icon",innerHTML:l}),s("span",null,e.from_timestamp," - ",e.to_timestamp))}render(){return s(a,{key:"56540a5278d395485a411e712929f32cf76f637e"},s("div",{key:"63673b28b671596d47f4f014223e9c5012f3b671",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?s("div",{class:"s-booking-field-price"},s("span",{innerHTML:salla.money(this.option.price)})):"",s("salla-button",{key:"6d9ffa722391aa0234454fe9ddc90f3477268489",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:e=>this.openBookingModal(e,false)},s("span",{key:"dcc8a2b68be4596199e7c776f4501764fd25523f",class:"s-booking-field-book-now-content"},s("span",{key:"b4b2eaf369a5fa822c84b376808c7ee16d8d2598",innerHTML:n}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&s("div",{key:"2684b88bdaf47133dbcaaf6c96f1b81d4ee7ca70",class:"s-booking-field-reservations"},this.reservations.map(((e,t)=>s("div",{key:t,class:"s-booking-field-reservations-item"},this.renderReservationDate(e),this.renderReservationTime(e))))),s("input",{key:"3d20fcb5fbca8a9e340344d41c316619aec03050",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:e=>this.reservationsInput=e}),this.iframeReady&&this.bookingModal())}get host(){return i(this)}};c.style=r;const d=class{constructor(t){e(this,t)}hideAllOptions(e){this.host.querySelectorAll(`[data-show-when^="options[${e}"]`).forEach((e=>{e.classList.add("hidden");this.hideAllOptions(e.dataset.optionId);this.disableInputs(e)}))}disableInputs(e){e.querySelectorAll("[name]").forEach((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}}))}changeHandler(e){var t;salla.event.emit("salla-onditional-fields::change",e);salla.log("Received the change event: ",e);if(!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox","radio"].includes(e.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((t=e===null||e===void 0?void 0:e.target)===null||t===void 0?void 0:t.tagName)||"N/A"));return}let s=e.target.name.replace("[]","");let a=e.target.getAttribute("type")==="checkbox";let i=e.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",`[data-show-when^="${s}"]`);this.host.querySelectorAll(`[data-show-when^="${s}"]`).forEach((t=>{let s=!(t===null||t===void 0?void 0:t.dataset.showWhen.includes("!="));let n=t===null||t===void 0?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();let o;if(a){let t=Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>e===null||e===void 0?void 0:e.value));o=t.includes(n.toString())}else if(i){o=e.target.checked&&e.target.value===n}else{o=n===e.target.value}salla.log("The input is ",a?"Multiple":i?"Radio":"Single"," value:",o);let l=s&&o||!s&&!o;if(l){t.classList.remove("hidden");t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled");const t=e.closest(".s-product-options-option");if(t.dataset.optionRequired==="true"){e.setAttribute("required","")}if(e.getAttribute("type")==="checkbox"){const t=Array.from(document.querySelectorAll(`input[type="checkbox"][name="${e.getAttribute("name")}"]`));const s=t.some((e=>e.checked));if(s){t.forEach((e=>{e.removeAttribute("required")}))}}}))}else{this.hideAllOptions(t.dataset.optionId);t.classList.add("hidden");this.disableInputs(t)}}))}componentDidRender(){this.host.querySelectorAll(`[data-show-when]`).forEach((e=>{var t;let s=(t=e===null||e===void 0?void 0:e.dataset)===null||t===void 0?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!s){return}this.changeHandler({target:this.host.querySelector('[name^="'+s+'"]')})}))}render(){return s(a,{key:"aed72d12357c54338c231d5d4c259a510f8b4e95"},s("slot",{key:"84c5af881a45cee9fa71f5e2e63ee9b92aad76c9"}))}get host(){return i(this)}};export{c as salla_booking_field,d as salla_conditional_fields};
5
+ //# sourceMappingURL=p-5dda0431.entry.js.map
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ System.register(["./p-9cvlynxW.system.js"],(function(c){"use strict";var e,n,t;return{setters:[function(c){e=c.r;n=c.h;t=c.H}],execute:function(){var r="";var b=c("salla_accordion_body",function(){function c(c){e(this,c)}c.prototype.render=function(){return n(t,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},n("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return c}());b.style=r}}}));
5
+ //# sourceMappingURL=p-61471a8d.system.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-AKVBtuMk.system.js","sources":["src/components/salla-tooltip/salla-tooltip.scss?tag=salla-tooltip","src/components/salla-tooltip/salla-tooltip.tsx"],"sourcesContent":[".s-tooltip {\n &-container {\n position: relative;\n display: inline-block;\n }\n\n &-item {\n position: absolute;\n transform: translateX(-39%);\n background-color: #baf3e6;\n color: #004d5a;\n bottom: 100%;\n left: 50%;\n text-align: center;\n border-radius: 5px;\n z-index: 1;\n white-space: nowrap;\n opacity: 0;\n transition: opacity 0.3s;\n pointer-events: none;\n margin: 0 0 16px 8px;\n padding: 12px;\n max-width: 150px;\n width: 190px;\n white-space: normal;\n opacity: 1;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -10px; // Position the arrow just below the tooltip\n left: 50%;\n margin-left: -5px; // Center the arrow\n border-width: 5px;\n border-style: solid;\n border-color: #baf3e6 transparent transparent transparent; // Arrow color and shape\n }\n &:dir(ltr) {\n transform: translateX(-72%);\n }\n }\n}\n","import { Component, Prop, h, State, Element, Listen } from '@stencil/core';\n\n@Component({\n tag: 'salla-tooltip',\n styleUrl: 'salla-tooltip.scss',\n shadow: false,\n})\nexport class SallaTooltip {\n /**\n * The text content to display in the tooltip\n */\n @Prop() text: string;\n /**\n * The ID of the target element to which the tooltip is attached\n */\n @Prop() targetId: string;\n @State() show: boolean = false;\n @Element() el: HTMLElement;\n\n private targetElement: HTMLElement | null = null;\n\n @Listen('mouseover', { target: 'window' })\n handleMouseOver(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = true;\n }\n }\n\n @Listen('mouseout', { target: 'window' })\n handleMouseOut(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = false;\n }\n }\n\n componentDidLoad() {\n // Find the target element based on the targetSelector prop\n this.targetElement = document.getElementById(this.targetId);\n }\n\n render() {\n return (\n <div class=\"s-tooltip-container\">\n <slot></slot>\n {this.show && <div class=\"s-tooltip-item\">{this.text}</div>}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,4tBAA4tB;;YCOvuB,YAAY,4BAAA,MAAA;MALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;MAcW,QAAA,IAAI,CAAA,IAAA,GAAY,KAAK;MAGtB,QAAA,IAAa,CAAA,aAAA,GAAuB,IAAI;MA6BjD;MA1BC,IAAA,eAAe,CAAC,KAAiB,EAAA;MAC/B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;;MAKpB,IAAA,cAAc,CAAC,KAAiB,EAAA;MAC9B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,KAAK;;;UAIrB,gBAAgB,GAAA;;cAEd,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;;UAG7D,MAAM,GAAA;cACJ,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,qBAAqB,EAAA,EAC9B,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,gBAAgB,EAAE,EAAA,IAAI,CAAC,IAAI,CAAO,CACvD;;;;;;;;;;;;"}
1
+ {"version":3,"file":"p-63hxYOEG.system.js","sources":["src/components/salla-tooltip/salla-tooltip.scss?tag=salla-tooltip","src/components/salla-tooltip/salla-tooltip.tsx"],"sourcesContent":[".s-tooltip {\n &-container {\n position: relative;\n display: inline-block;\n }\n\n &-item {\n position: absolute;\n transform: translateX(-39%);\n background-color: #baf3e6;\n color: #004d5a;\n bottom: 100%;\n left: 50%;\n text-align: center;\n border-radius: 5px;\n z-index: 1;\n white-space: nowrap;\n opacity: 0;\n transition: opacity 0.3s;\n pointer-events: none;\n margin: 0 0 16px 8px;\n padding: 12px;\n max-width: 150px;\n width: 190px;\n white-space: normal;\n opacity: 1;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -10px; // Position the arrow just below the tooltip\n left: 50%;\n margin-left: -5px; // Center the arrow\n border-width: 5px;\n border-style: solid;\n border-color: #baf3e6 transparent transparent transparent; // Arrow color and shape\n }\n &:dir(ltr) {\n transform: translateX(-72%);\n }\n }\n}\n","import { Component, Prop, h, State, Element, Listen } from '@stencil/core';\n\n@Component({\n tag: 'salla-tooltip',\n styleUrl: 'salla-tooltip.scss',\n shadow: false,\n})\nexport class SallaTooltip {\n /**\n * The text content to display in the tooltip\n */\n @Prop() text: string;\n /**\n * The ID of the target element to which the tooltip is attached\n */\n @Prop() targetId: string;\n @State() show: boolean = false;\n @Element() el: HTMLElement;\n\n private targetElement: HTMLElement | null = null;\n\n @Listen('mouseover', { target: 'window' })\n handleMouseOver(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = true;\n }\n }\n\n @Listen('mouseout', { target: 'window' })\n handleMouseOut(event: MouseEvent) {\n if (this.targetElement && this.targetElement.contains(event.target as Node)) {\n this.show = false;\n }\n }\n\n componentDidLoad() {\n // Find the target element based on the targetSelector prop\n this.targetElement = document.getElementById(this.targetId);\n }\n\n render() {\n return (\n <div class=\"s-tooltip-container\">\n <slot></slot>\n {this.show && <div class=\"s-tooltip-item\">{this.text}</div>}\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAAA,MAAM,eAAe,GAAG,4tBAA4tB;;YCOvuB,YAAY,4BAAA,MAAA;MALzB,IAAA,WAAA,CAAA,OAAA,EAAA;;MAcW,QAAA,IAAI,CAAA,IAAA,GAAY,KAAK;MAGtB,QAAA,IAAa,CAAA,aAAA,GAAuB,IAAI;MA6BjD;MA1BC,IAAA,eAAe,CAAC,KAAiB,EAAA;MAC/B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;;MAKpB,IAAA,cAAc,CAAC,KAAiB,EAAA;MAC9B,QAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE;MAC3E,YAAA,IAAI,CAAC,IAAI,GAAG,KAAK;;;UAIrB,gBAAgB,GAAA;;cAEd,IAAI,CAAC,aAAa,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC;;UAG7D,MAAM,GAAA;cACJ,QACE,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,qBAAqB,EAAA,EAC9B,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,IAAI,IAAI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,gBAAgB,EAAE,EAAA,IAAI,CAAC,IAAI,CAAO,CACvD;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i,g as a}from"./p-Fh3juwdj.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{var s,t,i;if(typeof this.exclude==="string"){try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude);this.exclude=[]}}this.placeholderImage=salla.url.cdn(`images/s-empty.png`);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="${this.placeholderImage}" data-src="{image}" alt={payment} /><li>`;this.sbcSlot=((t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="${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="${this.placeholderImage}" data-src={image} class="lazy" alt="COD"/><li>`;this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");const a=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(i,{key:"6c8a1fd050822882224ee1e419f6f6dbdbfaf12d",class:"s-payments-list-wrap"},t("ul",{key:"773195024ce6f616ad9b87091c8ddfd0e153f9ec",class:"s-payments-list"},s&&t("li",{key:"203bebb61c41ca108c0ec969661d5922db2ac378",class:"s-payments-list-item"},t("img",{key:"a687fac0d968f0485a0a59d1205a0f0db1f100f4",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn(`images/made-in-ksa.svg`,58,58),alt:"made in KSA certified"})),this.payments.map((s=>s=="cod"?t("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/cod_mini.png`,58,58))}):t("div",{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),a&&t("div",{key:"f571920327b81c48f502c1d6e497955978634c08",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn(`images/sbc.png`,58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${a}`)})))}componentDidLoad(){var s;(s=document.lazyLoadInstance)===null||s===void 0?void 0:s.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((s=>{s.addEventListener("load",(()=>{s.setAttribute("width","100%");s.setAttribute("height","100%")}))}))}componentDidRender(){var s,t,i;this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild)));(s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.remove();(t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.remove()}get host(){return a(this)}};l.style=e;export{l as salla_payments};
5
- //# sourceMappingURL=p-3011ae50.entry.js.map
4
+ import{r as s,h as t,H as i,g as a}from"./p-aC-cHVMV.js";const e=":host{display:block}";const l=class{constructor(t){s(this,t);this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{var s,t,i;if(typeof this.exclude==="string"){try{this.exclude=JSON.parse(this.exclude)}catch(s){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude);this.exclude=[]}}this.placeholderImage=salla.url.cdn(`images/s-empty.png`);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="${this.placeholderImage}" data-src="{image}" alt={payment} /><li>`;this.sbcSlot=((t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.innerHTML)||`<li class="s-payments-list-item"><a target="_blank" href="{link}"> <img width="100%" height="100%" src="${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="${this.placeholderImage}" data-src={image} class="lazy" alt="COD"/><li>`;this.payments=salla.config.get("store.settings.payments")}))}render(){const s=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa");const a=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return t(i,{key:"6c8a1fd050822882224ee1e419f6f6dbdbfaf12d",class:"s-payments-list-wrap"},t("ul",{key:"773195024ce6f616ad9b87091c8ddfd0e153f9ec",class:"s-payments-list"},s&&t("li",{key:"203bebb61c41ca108c0ec969661d5922db2ac378",class:"s-payments-list-item"},t("img",{key:"a687fac0d968f0485a0a59d1205a0f0db1f100f4",class:"lazy",width:"100%",height:"100%",decoding:"async",loading:"lazy","data-src":salla.url.cdn(`images/made-in-ksa.svg`,58,58),alt:"made in KSA certified"})),this.payments.map((s=>s=="cod"?t("div",{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/cod_mini.png`,58,58))}):t("div",{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,salla.url.cdn(`images/payment/${s}_mini.png`,58,58)).replace(/\{payment\}/g,s)}))),a&&t("div",{key:"f571920327b81c48f502c1d6e497955978634c08",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn(`images/sbc.png`,58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${a}`)})))}componentDidLoad(){var s;(s=document.lazyLoadInstance)===null||s===void 0?void 0:s.update(this.host.querySelectorAll(".lazy"));this.host.querySelectorAll(".lazy").forEach((s=>{s.addEventListener("load",(()=>{s.setAttribute("width","100%");s.setAttribute("height","100%")}))}))}componentDidRender(){var s,t,i;this.host.querySelectorAll("#payment-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#sbc-slot").forEach((s=>s.replaceWith(s.firstChild)));this.host.querySelectorAll("#cod-slot").forEach((s=>s.replaceWith(s.firstChild)));(s=this.host.querySelector('[slot="payment"]'))===null||s===void 0?void 0:s.remove();(t=this.host.querySelector('[slot="sbc"]'))===null||t===void 0?void 0:t.remove();(i=this.host.querySelector('[slot="cod"]'))===null||i===void 0?void 0:i.remove()}get host(){return a(this)}};l.style=e;export{l as salla_payments};
5
+ //# sourceMappingURL=p-65d9d657.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js"],(function(t){"use strict";var e,i,s,a;return{setters:[function(t){e=t.r;i=t.h;s=t.H;a=t.g}],execute:function(){var c="";var n=t("salla_accordion",function(){function t(t){e(this,t);this.collapsible=true;this.collapsed=true;this.dir=document.dir||"rtl"}t.prototype.directionChangedHandler=function(t){this.dir=t.detail.dir};t.prototype.handleCollapse=function(t){this.collapsed=t.detail.payload.collapsed};t.prototype.setcollapsibleProp=function(){var t=this.host.querySelector("salla-accordion-head");if(this.collapsible&&t){t.setAttribute("collapsible","true");t.setAttribute("collapsed",this.collapsed.toString())}};t.prototype.componentDidRender=function(){this.setcollapsibleProp();var t=this.host.querySelector("salla-accordion-body");if(this.collapsible){this.host.setAttribute("data-collapsed",this.collapsed.toString());t===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString())}};t.prototype.render=function(){return i(s,{key:"30e906d87cba59e197e71460bb24e578455f2d28",class:"s-accordion-wrapper ".concat(this.dir),"data-collapsed":this.collapsed.toString()},i("slot",{key:"8c26efc12856022567e5abe587c7537a5776285b"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());n.style=c}}}));
5
- //# sourceMappingURL=p-2ae3f0e1.system.entry.js.map
4
+ System.register(["./p-9cvlynxW.system.js"],(function(t){"use strict";var e,i,s,a;return{setters:[function(t){e=t.r;i=t.h;s=t.H;a=t.g}],execute:function(){var c="";var n=t("salla_accordion",function(){function t(t){e(this,t);this.collapsible=true;this.collapsed=true;this.dir=document.dir||"rtl"}t.prototype.directionChangedHandler=function(t){this.dir=t.detail.dir};t.prototype.handleCollapse=function(t){this.collapsed=t.detail.payload.collapsed};t.prototype.setcollapsibleProp=function(){var t=this.host.querySelector("salla-accordion-head");if(this.collapsible&&t){t.setAttribute("collapsible","true");t.setAttribute("collapsed",this.collapsed.toString())}};t.prototype.componentDidRender=function(){this.setcollapsibleProp();var t=this.host.querySelector("salla-accordion-body");if(this.collapsible){this.host.setAttribute("data-collapsed",this.collapsed.toString());t===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString())}};t.prototype.render=function(){return i(s,{key:"30e906d87cba59e197e71460bb24e578455f2d28",class:"s-accordion-wrapper ".concat(this.dir),"data-collapsed":this.collapsed.toString()},i("slot",{key:"8c26efc12856022567e5abe587c7537a5776285b"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());n.style=c}}}));
5
+ //# sourceMappingURL=p-6943af29.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-CXK1rNlC.system.js"],(function(t){"use strict";var e,i,n;return{setters:[function(t){e=t.r;i=t.h;n=t.g}],execute:function(){var o='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';var s=t("salla_tooltip",function(){function t(t){e(this,t);this.show=false;this.targetElement=null}t.prototype.handleMouseOver=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}};t.prototype.handleMouseOut=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}};t.prototype.componentDidLoad=function(){this.targetElement=document.getElementById(this.targetId)};t.prototype.render=function(){return i("div",{key:"87a485eeb144377502782b6a7ac61417349423e2",class:"s-tooltip-container"},i("slot",{key:"8329e929fce52cd2ef4f9258548770576e67ee96"}),this.show&&i("div",{key:"18f9cd55110713d0b472601dc0a9ef20dd31af19",class:"s-tooltip-item"},this.text))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());s.style=o}}}));
5
- //# sourceMappingURL=p-f0ad1f7a.system.entry.js.map
4
+ System.register(["./p-9cvlynxW.system.js"],(function(t){"use strict";var e,i,n;return{setters:[function(t){e=t.r;i=t.h;n=t.g}],execute:function(){var o='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;-webkit-transform:translateX(-39%);transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){-webkit-transform:translateX(-72%);transform:translateX(-72%)}';var s=t("salla_tooltip",function(){function t(t){e(this,t);this.show=false;this.targetElement=null}t.prototype.handleMouseOver=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=true}};t.prototype.handleMouseOut=function(t){if(this.targetElement&&this.targetElement.contains(t.target)){this.show=false}};t.prototype.componentDidLoad=function(){this.targetElement=document.getElementById(this.targetId)};t.prototype.render=function(){return i("div",{key:"87a485eeb144377502782b6a7ac61417349423e2",class:"s-tooltip-container"},i("slot",{key:"8329e929fce52cd2ef4f9258548770576e67ee96"}),this.show&&i("div",{key:"18f9cd55110713d0b472601dc0a9ef20dd31af19",class:"s-tooltip-item"},this.text))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());s.style=o}}}));
5
+ //# sourceMappingURL=p-6a16b86d.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t}from"./p-Fh3juwdj.js";import{S as i,A as e}from"./p-yRO-ZESF.js";import{G as c}from"./p-C0JNGIpa.js";var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n`;var a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n`;const l=":host{display:block}";const n=class{constructor(t){s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:o,GiftIcon:c,FireIcon:a,SpecialDiscountIcon:i,TagMoneyIcon:r};this.visibleOffersCount=3;this.handleCartItemUpdated=s=>{const t=s.data.cart.items.find((s=>s.id===this.itemId));if((t===null||t===void 0?void 0:t.id)===this.itemId){this.internalQuantity=t.quantity;this.internalOffers=t.detailed_offers||[];this.internalProductPrice=t.product_price}};this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady();await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam");this.receivedOffer=salla.lang.get("pages.cart.received_offer");this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}));this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice}componentDidLoad(){salla.event.on("cart::item.updated",(s=>this.handleCartItemUpdated(s)))}parseOffers(s){try{if(typeof s!=="string"){console.warn("Offers is not a string. Returning as-is.",s);return Array.isArray(s)?s:[]}return JSON.parse(s||"[]")}catch(s){console.error("Failed to parse offers",s);return[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(s,t){return s-t.free_quantity}renderOffer(s,i){const e=this.getPaidQty(s,i);return t("div",{class:"s-cart-item-offers-box"},i.free_quantity>0&&e>0&&t("div",{class:"s-cart-item-offers-paid-free"},t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",t("span",{innerHTML:salla.money(this.internalProductPrice)})),t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(i.free_quantity)," ×",t("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),t("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),t("div",{class:"s-cart-item-offers-details"},t("span",{class:`s-cart-item-offers-icon`,innerHTML:this.icons[i.discount_icon]||""}),t("div",null,t("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",i.offer_name)),t("p",{class:"s-cart-item-offers-discount"},t("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(i.discount_amount.toFixed(2)))})))))}render(){var s,i;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return t("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((s=>this.renderOffer(this.internalQuantity,s))),((i=this.internalOffers)===null||i===void 0?void 0:i.length)>this.visibleOffersCount&&t("div",{class:"s-cart-item-offers-show-more"},t("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},t("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,t("span",{innerHTML:e,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&t("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((s=>this.renderOffer(this.internalQuantity,s)))))}};n.style=l;export{n as salla_cart_item_offers};
5
- //# sourceMappingURL=p-07e383ed.entry.js.map
4
+ import{r as s,h as t}from"./p-aC-cHVMV.js";import{S as i,A as e}from"./p-yRO-ZESF.js";import{G as c}from"./p-C0JNGIpa.js";var a=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n`;var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n`;var o=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n`;const l=":host{display:block}";const n=class{constructor(t){s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:o,GiftIcon:c,FireIcon:r,SpecialDiscountIcon:i,TagMoneyIcon:a};this.visibleOffersCount=3;this.handleCartItemUpdated=s=>{const t=s.data.cart.items.find((s=>s.id===this.itemId));if((t===null||t===void 0?void 0:t.id)===this.itemId){this.internalQuantity=t.quantity;this.internalOffers=t.detailed_offers||[];this.internalProductPrice=t.product_price}};this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady();await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam");this.receivedOffer=salla.lang.get("pages.cart.received_offer");this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}));this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice}componentDidLoad(){salla.event.on("cart::item.updated",(s=>this.handleCartItemUpdated(s)))}parseOffers(s){try{if(typeof s!=="string"){console.warn("Offers is not a string. Returning as-is.",s);return Array.isArray(s)?s:[]}return JSON.parse(s||"[]")}catch(s){console.error("Failed to parse offers",s);return[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(s,t){return s-t.free_quantity}renderOffer(s,i){const e=this.getPaidQty(s,i);return t("div",{class:"s-cart-item-offers-box"},i.free_quantity>0&&e>0&&t("div",{class:"s-cart-item-offers-paid-free"},t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",t("span",{innerHTML:salla.money(this.internalProductPrice)})),t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(i.free_quantity)," ×",t("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),t("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),t("div",{class:"s-cart-item-offers-details"},t("span",{class:`s-cart-item-offers-icon`,innerHTML:this.icons[i.discount_icon]||""}),t("div",null,t("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",i.offer_name)),t("p",{class:"s-cart-item-offers-discount"},t("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(i.discount_amount.toFixed(2)))})))))}render(){var s,i;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return t("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((s=>this.renderOffer(this.internalQuantity,s))),((i=this.internalOffers)===null||i===void 0?void 0:i.length)>this.visibleOffersCount&&t("div",{class:"s-cart-item-offers-show-more"},t("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},t("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,t("span",{innerHTML:e,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&t("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((s=>this.renderOffer(this.internalQuantity,s)))))}};n.style=l;export{n as salla_cart_item_offers};
5
+ //# sourceMappingURL=p-70688702.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,c as i,h as t,H as e,g as h}from"./p-Fh3juwdj.js";import{M as l}from"./p-DmgxDvXL.js";var r=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n`;const o="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";const a=class{constructor(t){s(this,t);this.verified=i(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((()=>{var s;this.translationLoaded=true;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type);(s=this.modal)===null||s===void 0?void 0:s.setTitle(this.title)}));if(this.display=="inline"){this.modal={open:()=>"",close:()=>"",setTitle:()=>""};return}salla.event.on("profile::verification",(s=>{var i;let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=true;this.open(t);this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type);(i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title)}));salla.event.on("modalClosed",(()=>{this.resendAfter=0;this.timer.innerHTML="30 : 00"}))}splitNumber(s){this.resetError();let i=s.data||s.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(s.target,i)}modifyNext(s,i){s.value=i[0];i=i.substring(1);if(s.nextElementSibling&&i.length){this.modifyNext(s.nextElementSibling,i)}else if(!s.nextElementSibling&&i.length===0){s.focus()}else if(s.nextElementSibling&&i.length===0){s.nextElementSibling.focus()}}checkAllInputs(){let s=true;for(let i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){s=false}}return s}handleKeyUp(s){var i,t,e,h;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key)){return}let l=s.keyCode||s.charCode;if(s.target.value){(i=s.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(t=s.target.nextElementSibling)===null||t===void 0?void 0:t.select()}else if([8,46].includes(l)){(e=s.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(h=s.target.previousElementSibling)===null||h===void 0?void 0:h.select()}if(s.target.value.length>1){this.splitNumber(s)}}handlePaste(s){this.resetError();const i=salla.helpers.number(s.clipboardData.getData("text"))||"";let t=i.replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length);this.otpInputs.forEach((s=>s.value=""));this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError();salla.helpers.inputDigitsOnly(s.target);if(this.checkAllInputs()){setTimeout((()=>{this.toggleOTPSubmit()}),100)}}resetError(){this.hasError=false;this.errorMessage=""}handleFocus(s){var i;if(s.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(s.target.previousElementSibling.value==""){s.target.previousElementSibling.focus()}}async getCode(){return this.code.value}async open(s){var i,t;this.data=s;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(t=this.firstOtpInput)===null||t===void 0?void 0:t.addEventListener("input",(s=>this.splitNumber(s)));setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];this.otpInputs.forEach((i=>i.value&&s.push(i.value)));this.code.value=s.join("");if(s.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value=""));this.code.value="";this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;let s=setInterval((()=>{if(this.resendAfter<=0){clearInterval(s);this.resend.style.display="block";this.resendMessage.style.display="none"}else{this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`;this.resendAfter--}}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value=""));this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{var i,t,e;this.hasError=true;this.errorMessage=((e=(t=(i=s.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||e===void 0?void 0:e.message)||salla.lang.get("common.errors.error_occurred");if(!s.response){console.log("Unexpected error",s)}else{salla.logger.error(s)}this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return this.display=="inline"?t(e,null,this.myBody()):t("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},t("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?r:l}),this.myBody())}myBody(){return t("div",{class:"s-verify-body",ref:s=>this.body=s},t("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("slot",{name:"mobile"}),t("slot",{name:"email"}),t("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:s=>this.code=s}),t("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>t("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":true,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:true})))),this.hasError&&this.errorMessage?t("span",{class:"s-verify-error-message"},this.errorMessage):"",t("div",{slot:"footer",class:"s-verify-footer"},t("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return h(this)}};a.style=o;export{a as salla_verify};
5
- //# sourceMappingURL=p-8c4ff806.entry.js.map
4
+ import{r as s,c as i,h as t,H as e,g as l}from"./p-aC-cHVMV.js";import{M as r}from"./p-DmgxDvXL.js";var h=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n`;const o="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";const a=class{constructor(t){s(this,t);this.verified=i(this,"verified");this.translationLoaded=false;this.display="modal";this.type="mobile";this.autoReload=true;this.supportWebAuth=true;this.resendAfter=30;this.isProfileVerify=false;salla.lang.onLoaded((()=>{var s;this.translationLoaded=true;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type);(s=this.modal)===null||s===void 0?void 0:s.setTitle(this.title)}));if(this.display=="inline"){this.modal={open:()=>"",close:()=>"",setTitle:()=>""};return}salla.event.on("profile::verification",(s=>{var i;let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=true;this.open(t);this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type);(i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title)}));salla.event.on("modalClosed",(()=>{this.resendAfter=0;this.timer.innerHTML="30 : 00"}))}splitNumber(s){this.resetError();let i=s.data||s.target.value;if(!i)return;if(i.length===1)return;this.modifyNext(s.target,i)}modifyNext(s,i){s.value=i[0];i=i.substring(1);if(s.nextElementSibling&&i.length){this.modifyNext(s.nextElementSibling,i)}else if(!s.nextElementSibling&&i.length===0){s.focus()}else if(s.nextElementSibling&&i.length===0){s.nextElementSibling.focus()}}checkAllInputs(){let s=true;for(let i=0;i<this.otpInputs.length;i++){if(this.otpInputs[i].value===""){s=false}}return s}handleKeyUp(s){var i,t,e,l;this.resetError();if(["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key)){return}let r=s.keyCode||s.charCode;if(s.target.value){(i=s.target.nextElementSibling)===null||i===void 0?void 0:i.focus();(t=s.target.nextElementSibling)===null||t===void 0?void 0:t.select()}else if([8,46].includes(r)){(e=s.target.previousElementSibling)===null||e===void 0?void 0:e.focus();(l=s.target.previousElementSibling)===null||l===void 0?void 0:l.select()}if(s.target.value.length>1){this.splitNumber(s)}}handlePaste(s){this.resetError();const i=salla.helpers.number(s.clipboardData.getData("text"))||"";let t=i.replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length);this.otpInputs.forEach((s=>s.value=""));this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError();salla.helpers.inputDigitsOnly(s.target);if(this.checkAllInputs()){setTimeout((()=>{this.toggleOTPSubmit()}),100)}}resetError(){this.hasError=false;this.errorMessage=""}handleFocus(s){var i;if(s.target===this.firstOtpInput)return;if(((i=this.firstOtpInput)===null||i===void 0?void 0:i.value)==""){this.firstOtpInput.focus()}if(s.target.previousElementSibling.value==""){s.target.previousElementSibling.focus()}}async getCode(){return this.code.value}async open(s){var i,t;this.data=s;this.data.type=this.data.type||this.type;this.type=this.data.type;this.resendTimer();this.otpInputs=this.body.querySelectorAll(".s-verify-input");this.firstOtpInput=this.body.querySelector("#otp-1");this.reset();this.resetError();this.display=="modal"&&((i=this.modal)===null||i===void 0?void 0:i.setTitle(this.title));this.modal.open();(t=this.firstOtpInput)===null||t===void 0?void 0:t.addEventListener("input",(s=>this.splitNumber(s)));setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];this.otpInputs.forEach((i=>i.value&&s.push(i.value)));this.code.value=s.join("");if(s.length===4){this.btn.disable();this.btn.click();return}this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value=""));this.code.value="";this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block";this.resend.style.display="none";this.resendAfter=30;let s=setInterval((()=>{if(this.resendAfter<=0){clearInterval(s);this.resend.style.display="block";this.resendMessage.style.display="none"}else{this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`;this.resendAfter--}}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value=""));this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4){this.otpInputs[this.code.value.length].focus();salla.log("Trying to submit without 4 digits!");return}let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{var i,t,e;this.hasError=true;this.errorMessage=((e=(t=(i=s.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||e===void 0?void 0:e.message)||salla.lang.get("common.errors.error_occurred");if(!s.response){console.log("Unexpected error",s)}else{salla.logger.error(s)}this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return this.display=="inline"?t(e,null,this.myBody()):t("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},t("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:this.type=="mobile"?h:r}),this.myBody())}myBody(){return t("div",{class:"s-verify-body",ref:s=>this.body=s},t("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("slot",{name:"mobile"}),t("slot",{name:"email"}),t("input",{type:"hidden",name:"code",maxlength:"4",required:true,ref:s=>this.code=s}),t("div",{class:{"s-verify-codes":true,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>t("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":true,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:true})))),this.hasError&&this.errorMessage?t("span",{class:"s-verify-error-message"},this.errorMessage):"",t("div",{slot:"footer",class:"s-verify-footer"},t("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:true,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return l(this)}};a.style=o;export{a as salla_verify};
5
+ //# sourceMappingURL=p-75203eae.entry.js.map