@salla.sa/twilight-components 2.14.254 → 2.14.255

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 (303) hide show
  1. package/dist/cjs/{app-globals-Byh413hm.js → app-globals-CRbtFdLh.js} +3 -3
  2. package/dist/cjs/{app-globals-Byh413hm.js.map → app-globals-CRbtFdLh.js.map} +1 -1
  3. package/dist/cjs/{index-BRms9nAM.js → index-CiB3mE81.js} +4 -4
  4. package/dist/cjs/index-CiB3mE81.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/salla-accordion_4.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-add-product-button_51.cjs.entry.js +1 -1
  8. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  9. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  10. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  11. package/dist/cjs/salla-booking-field_2.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-product-options.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  39. package/dist/cjs/twilight.cjs.js +2 -2
  40. package/dist/components/index.js +2 -2
  41. package/dist/components/index.js.map +1 -1
  42. package/dist/esm/{app-globals-DBmHcYZg.js → app-globals-CXaqPW0W.js} +3 -3
  43. package/dist/esm/{app-globals-DBmHcYZg.js.map → app-globals-CXaqPW0W.js.map} +1 -1
  44. package/dist/esm/{index-6RnqFOTM.js → index-Cmh2bDlu.js} +4 -4
  45. package/dist/esm/index-Cmh2bDlu.js.map +1 -0
  46. package/dist/esm/loader.js +3 -3
  47. package/dist/esm/salla-accordion_4.entry.js +1 -1
  48. package/dist/esm/salla-add-product-button_51.entry.js +1 -1
  49. package/dist/esm/salla-advertisement.entry.js +1 -1
  50. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  51. package/dist/esm/salla-apps-icons.entry.js +1 -1
  52. package/dist/esm/salla-booking-field_2.entry.js +1 -1
  53. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  54. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  55. package/dist/esm/salla-contacts.entry.js +1 -1
  56. package/dist/esm/salla-filters-widget.entry.js +1 -1
  57. package/dist/esm/salla-filters.entry.js +1 -1
  58. package/dist/esm/salla-installment.entry.js +1 -1
  59. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  60. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  61. package/dist/esm/salla-metadata.entry.js +1 -1
  62. package/dist/esm/salla-notification-item.entry.js +1 -1
  63. package/dist/esm/salla-notifications.entry.js +1 -1
  64. package/dist/esm/salla-offer.entry.js +1 -1
  65. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  66. package/dist/esm/salla-order-details.entry.js +1 -1
  67. package/dist/esm/salla-order-summary.entry.js +1 -1
  68. package/dist/esm/salla-orders.entry.js +1 -1
  69. package/dist/esm/salla-payments.entry.js +1 -1
  70. package/dist/esm/salla-price-range.entry.js +1 -1
  71. package/dist/esm/salla-product-options.entry.js +1 -1
  72. package/dist/esm/salla-review-card.entry.js +1 -1
  73. package/dist/esm/salla-reviews-page.entry.js +1 -1
  74. package/dist/esm/salla-reviews.entry.js +1 -1
  75. package/dist/esm/salla-social.entry.js +1 -1
  76. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  77. package/dist/esm/salla-tooltip.entry.js +1 -1
  78. package/dist/esm/salla-verify.entry.js +1 -1
  79. package/dist/esm/salla-wallet.entry.js +1 -1
  80. package/dist/esm/twilight.js +3 -3
  81. package/dist/esm-es5/{app-globals-DBmHcYZg.js → app-globals-CXaqPW0W.js} +2 -2
  82. package/dist/esm-es5/{app-globals-DBmHcYZg.js.map → app-globals-CXaqPW0W.js.map} +1 -1
  83. package/dist/esm-es5/{index-6RnqFOTM.js → index-Cmh2bDlu.js} +3 -3
  84. package/dist/esm-es5/index-Cmh2bDlu.js.map +1 -0
  85. package/dist/esm-es5/loader.js +1 -1
  86. package/dist/esm-es5/salla-accordion_4.entry.js +1 -1
  87. package/dist/esm-es5/salla-add-product-button_51.entry.js +1 -1
  88. package/dist/esm-es5/salla-advertisement.entry.js +1 -1
  89. package/dist/esm-es5/salla-app-install-alert.entry.js +1 -1
  90. package/dist/esm-es5/salla-apps-icons.entry.js +1 -1
  91. package/dist/esm-es5/salla-booking-field_2.entry.js +1 -1
  92. package/dist/esm-es5/salla-cart-item-offers.entry.js +1 -1
  93. package/dist/esm-es5/salla-conditional-offer.entry.js +1 -1
  94. package/dist/esm-es5/salla-contacts.entry.js +1 -1
  95. package/dist/esm-es5/salla-filters-widget.entry.js +1 -1
  96. package/dist/esm-es5/salla-filters.entry.js +1 -1
  97. package/dist/esm-es5/salla-installment.entry.js +1 -1
  98. package/dist/esm-es5/salla-loyalty-prize-item.entry.js +1 -1
  99. package/dist/esm-es5/salla-loyalty-program.entry.js +1 -1
  100. package/dist/esm-es5/salla-metadata.entry.js +2 -2
  101. package/dist/esm-es5/salla-notification-item.entry.js +1 -1
  102. package/dist/esm-es5/salla-notifications.entry.js +1 -1
  103. package/dist/esm-es5/salla-offer.entry.js +1 -1
  104. package/dist/esm-es5/salla-order-details-multiple-bundle-product.entry.js +1 -1
  105. package/dist/esm-es5/salla-order-details.entry.js +1 -1
  106. package/dist/esm-es5/salla-order-summary.entry.js +1 -1
  107. package/dist/esm-es5/salla-orders.entry.js +1 -1
  108. package/dist/esm-es5/salla-payments.entry.js +1 -1
  109. package/dist/esm-es5/salla-price-range.entry.js +1 -1
  110. package/dist/esm-es5/salla-product-options.entry.js +1 -1
  111. package/dist/esm-es5/salla-review-card.entry.js +1 -1
  112. package/dist/esm-es5/salla-reviews-page.entry.js +1 -1
  113. package/dist/esm-es5/salla-reviews.entry.js +1 -1
  114. package/dist/esm-es5/salla-social.entry.js +1 -1
  115. package/dist/esm-es5/salla-tiered-offer.entry.js +1 -1
  116. package/dist/esm-es5/salla-tooltip.entry.js +1 -1
  117. package/dist/esm-es5/salla-verify.entry.js +1 -1
  118. package/dist/esm-es5/salla-wallet.entry.js +1 -1
  119. package/dist/esm-es5/twilight.js +1 -1
  120. package/dist/twilight/{p-f1fe7386.system.entry.js → p-02187d79.system.entry.js} +2 -2
  121. package/dist/twilight/{p-6a9916f4.system.entry.js → p-02b2de19.system.entry.js} +2 -2
  122. package/dist/twilight/{p-9b074242.entry.js → p-059379d0.entry.js} +2 -2
  123. package/dist/twilight/{p-1fca98a6.system.entry.js → p-13a215f8.system.entry.js} +2 -2
  124. package/dist/twilight/{p-3bba12f2.system.entry.js → p-231440bc.system.entry.js} +2 -2
  125. package/dist/twilight/{p-e8eeddc4.system.entry.js → p-2ac46fd5.system.entry.js} +2 -2
  126. package/dist/twilight/{p-361c68e9.entry.js → p-2f228be7.entry.js} +2 -2
  127. package/dist/twilight/{p-a6919fd1.system.entry.js → p-302eb45d.system.entry.js} +2 -2
  128. package/dist/twilight/{p-29b9016f.system.entry.js → p-3099db22.system.entry.js} +2 -2
  129. package/dist/twilight/{p-e2e632ae.entry.js → p-419eb9a7.entry.js} +2 -2
  130. package/dist/twilight/{p-48435856.system.entry.js → p-41a7a590.system.entry.js} +2 -2
  131. package/dist/twilight/{p-ed455631.entry.js → p-44206730.entry.js} +2 -2
  132. package/dist/twilight/{p-3696d5ed.system.entry.js → p-459fff65.system.entry.js} +2 -2
  133. package/dist/twilight/{p-1c459b68.entry.js → p-468a7324.entry.js} +2 -2
  134. package/dist/twilight/{p-15b4c829.entry.js → p-470e16b4.entry.js} +2 -2
  135. package/dist/twilight/{p-adf637ae.entry.js → p-4710f397.entry.js} +2 -2
  136. package/dist/twilight/{p-f13903b4.entry.js → p-471d0c2a.entry.js} +2 -2
  137. package/dist/twilight/{p-2367c263.entry.js → p-47f2e097.entry.js} +2 -2
  138. package/dist/twilight/{p-90c6efd9.entry.js → p-4f1f3a1a.entry.js} +2 -2
  139. package/dist/twilight/{p-57af4a31.entry.js → p-4f3c5294.entry.js} +2 -2
  140. package/dist/twilight/{p-c9e41a8f.entry.js → p-51915628.entry.js} +2 -2
  141. package/dist/twilight/{p-63c04570.system.entry.js → p-53fdce47.system.entry.js} +2 -2
  142. package/dist/twilight/{p-934dd993.entry.js → p-55a9da25.entry.js} +2 -2
  143. package/dist/twilight/{p-6d7667a3.entry.js → p-56a2493e.entry.js} +2 -2
  144. package/dist/twilight/{p-a05bd636.entry.js → p-67c93900.entry.js} +2 -2
  145. package/dist/twilight/{p-1a9b7199.system.entry.js → p-6868caa4.system.entry.js} +2 -2
  146. package/dist/twilight/{p-3eb1f223.system.entry.js → p-68cbea08.system.entry.js} +2 -2
  147. package/dist/twilight/{p-af0c3637.entry.js → p-6bd4f5dd.entry.js} +2 -2
  148. package/dist/twilight/{p-2f351136.system.entry.js → p-6bd9b65d.system.entry.js} +2 -2
  149. package/dist/twilight/{p-eb51e405.entry.js → p-6c2ffbdb.entry.js} +2 -2
  150. package/dist/twilight/{p-c62f9443.system.entry.js → p-6ef02abc.system.entry.js} +2 -2
  151. package/dist/twilight/{p-37b98407.entry.js → p-6fd8031a.entry.js} +2 -2
  152. package/dist/twilight/{p-7824e441.entry.js → p-72a5b284.entry.js} +2 -2
  153. package/dist/twilight/{p-e8b2ec6f.system.entry.js → p-78715871.system.entry.js} +3 -3
  154. package/dist/twilight/{p-7c6bacd4.system.entry.js → p-78bf11f2.system.entry.js} +2 -2
  155. package/dist/twilight/{p-c2e6934e.system.entry.js → p-7cdfb2ff.system.entry.js} +2 -2
  156. package/dist/twilight/{p-53507406.entry.js → p-7d060cdd.entry.js} +2 -2
  157. package/dist/twilight/{p-881cd90a.system.entry.js → p-7e3906fc.system.entry.js} +2 -2
  158. package/dist/twilight/{p-bb26f888.entry.js → p-7f0e3435.entry.js} +2 -2
  159. package/dist/twilight/{p-1ecb5b3b.entry.js → p-8277f14f.entry.js} +2 -2
  160. package/dist/twilight/{p-d31f25e6.entry.js → p-84b61e25.entry.js} +2 -2
  161. package/dist/twilight/{p-60030ed5.system.entry.js → p-85b17c34.system.entry.js} +2 -2
  162. package/dist/twilight/{p-38e35ba9.system.entry.js → p-889ec51e.system.entry.js} +2 -2
  163. package/dist/twilight/{p-d8787047.entry.js → p-8e14e730.entry.js} +2 -2
  164. package/dist/twilight/{p-5df10c86.system.entry.js → p-93bc2972.system.entry.js} +2 -2
  165. package/dist/twilight/{p-46d0b8df.entry.js → p-9470463b.entry.js} +2 -2
  166. package/dist/twilight/{p-f2f86bc0.system.entry.js → p-963ba76e.system.entry.js} +2 -2
  167. package/dist/twilight/{p-d4b0466e.system.entry.js → p-9cf6cc9f.system.entry.js} +2 -2
  168. package/dist/twilight/{p-DlSTTu3d.system.js.map → p-BLd878to.system.js.map} +1 -1
  169. package/dist/twilight/{p-7zmqPng_.system.js.map → p-BPogbRgc.system.js.map} +1 -1
  170. package/dist/twilight/{p-BGg8YJ-3.system.js → p-BTHt_nZ5.system.js} +2 -2
  171. package/dist/twilight/{p-BGg8YJ-3.system.js.map → p-BTHt_nZ5.system.js.map} +1 -1
  172. package/dist/twilight/{p-qjoWx0F3.system.js.map → p-BVYqexVV.system.js.map} +1 -1
  173. package/dist/twilight/{p-DzGH6Pth.system.js.map → p-BhewmKn2.system.js.map} +1 -1
  174. package/dist/twilight/{p-MBe2K6Cl.system.js.map → p-BpfPcg3W.system.js.map} +1 -1
  175. package/dist/twilight/{p-Cj6B3rZy.system.js.map → p-BrKg9FB7.system.js.map} +1 -1
  176. package/dist/twilight/{p-U5WE8YSF.system.js.map → p-By_R4wyt.system.js.map} +1 -1
  177. package/dist/twilight/{p-B1M54MeY.js → p-C3pcK7CB.js} +2 -2
  178. package/dist/twilight/{p-B1M54MeY.js.map → p-C3pcK7CB.js.map} +1 -1
  179. package/dist/twilight/{p-C6iNVfue.system.js.map → p-C8tnyQ_B.system.js.map} +1 -1
  180. package/dist/twilight/{p-C6n00tHk.system.js.map → p-CCrcmQ6i.system.js.map} +1 -1
  181. package/dist/twilight/{p-Dm4vaVPW.system.js.map → p-CKwOWJLk.system.js.map} +1 -1
  182. package/dist/twilight/{p-BKfsgAvG.system.js.map → p-CXiTCFrN.system.js.map} +1 -1
  183. package/dist/twilight/{p-DQDOpQC8.system.js.map → p-CYB_tFv0.system.js.map} +1 -1
  184. package/dist/twilight/{p-GwDpu8M4.system.js.map → p-C_ju2ao2.system.js.map} +1 -1
  185. package/dist/twilight/{p-D1gaAPRH.system.js.map → p-CaIXPRFW.system.js.map} +1 -1
  186. package/dist/twilight/{p-DiAHk-lZ.system.js → p-CbJXYJ5O.system.js} +3 -3
  187. package/dist/twilight/p-CbJXYJ5O.system.js.map +1 -0
  188. package/dist/twilight/{p-B3dwJCVE.system.js.map → p-Ccypd_SM.system.js.map} +1 -1
  189. package/dist/twilight/{p-DzINj8LX.system.js.map → p-Ceb-eX-0.system.js.map} +1 -1
  190. package/dist/twilight/{p-6RnqFOTM.js → p-Cmh2bDlu.js} +3 -3
  191. package/dist/twilight/p-Cmh2bDlu.js.map +1 -0
  192. package/dist/twilight/{p-CMbrIrB7.system.js.map → p-CsF4wF5j.system.js.map} +1 -1
  193. package/dist/twilight/{p-CtYe5QQE.system.js → p-CzmyZ_Nd.system.js} +2 -2
  194. package/dist/twilight/{p-CtYe5QQE.system.js.map → p-CzmyZ_Nd.system.js.map} +1 -1
  195. package/dist/twilight/{p-CLJwbgSv.system.js.map → p-D5AOZnju.system.js.map} +1 -1
  196. package/dist/twilight/{p-D2oQHY3j.system.js.map → p-D9CSx3Wz.system.js.map} +1 -1
  197. package/dist/twilight/{p-DIZ88uz3.system.js.map → p-DBkWclyq.system.js.map} +1 -1
  198. package/dist/twilight/{p-DRCHhB2S.system.js.map → p-DDduzQA-.system.js.map} +1 -1
  199. package/dist/twilight/{p-Dt-Djk7g.system.js.map → p-DDgmoM0z.system.js.map} +1 -1
  200. package/dist/twilight/{p-DQf2y2uW.system.js.map → p-DGWMlRvt.system.js.map} +1 -1
  201. package/dist/twilight/{p-FnNT7hdc.system.js.map → p-DJvU6sZZ.system.js.map} +1 -1
  202. package/dist/twilight/{p-Ri5PwVxp.system.js.map → p-DRcmoz10.system.js.map} +1 -1
  203. package/dist/twilight/{p-wcHiF5TF.system.js.map → p-Dk6V-4d2.system.js.map} +1 -1
  204. package/dist/twilight/{p-B1S_WbiL.system.js.map → p-DoENPAoP.system.js.map} +1 -1
  205. package/dist/twilight/{p-BhX3rYLg.system.js.map → p-DsgPAMoP.system.js.map} +1 -1
  206. package/dist/twilight/{p-CAZDBDvT.system.js.map → p-DvzE4oQS.system.js.map} +1 -1
  207. package/dist/twilight/{p-C7XW5VQp.system.js.map → p-EEU49bnm.system.js.map} +1 -1
  208. package/dist/twilight/{p-1mkRwJ9u.system.js.map → p-KFQPthVf.system.js.map} +1 -1
  209. package/dist/twilight/{p-DfxoOw4H.system.js.map → p-aI0YGy91.system.js.map} +1 -1
  210. package/dist/twilight/{p-d309e915.system.entry.js → p-ad83b353.system.entry.js} +2 -2
  211. package/dist/twilight/{p-e8cab8f7.entry.js → p-b1266dbc.entry.js} +2 -2
  212. package/dist/twilight/{p-3389fc3f.entry.js → p-b6c991e2.entry.js} +2 -2
  213. package/dist/twilight/{p-30022be7.system.entry.js → p-bd97e5ea.system.entry.js} +2 -2
  214. package/dist/twilight/{p-6bd3e8c2.system.entry.js → p-bef4449d.system.entry.js} +2 -2
  215. package/dist/twilight/{p-9fe5bbbc.system.entry.js → p-c4741c01.system.entry.js} +2 -2
  216. package/dist/twilight/{p-93684e71.system.entry.js → p-c93aca68.system.entry.js} +2 -2
  217. package/dist/twilight/{p-766a000c.entry.js → p-c9736f8b.entry.js} +2 -2
  218. package/dist/twilight/{p-ed217c2e.entry.js → p-cdadd220.entry.js} +2 -2
  219. package/dist/twilight/{p-faa04f76.system.entry.js → p-cfe9931b.system.entry.js} +2 -2
  220. package/dist/twilight/{p-3a154637.system.entry.js → p-d54d7cd7.system.entry.js} +2 -2
  221. package/dist/twilight/{p-aae512ee.entry.js → p-dade84c6.entry.js} +2 -2
  222. package/dist/twilight/{p-ee74bc5f.entry.js → p-e53e006e.entry.js} +2 -2
  223. package/dist/twilight/{p-f8789882.system.entry.js → p-e574830f.system.entry.js} +2 -2
  224. package/dist/twilight/{p-b7442220.entry.js → p-e5ff9041.entry.js} +2 -2
  225. package/dist/twilight/{p-5e66fc93.entry.js → p-f0e1cc94.entry.js} +2 -2
  226. package/dist/twilight/{p-61a03c21.system.entry.js → p-fb5d9736.system.entry.js} +2 -2
  227. package/dist/twilight/{p-e39626cc.system.entry.js → p-fc7c940d.system.entry.js} +2 -2
  228. package/dist/twilight/{p-BkrKDbhc.system.js.map → p-smRaSeBI.system.js.map} +1 -1
  229. package/dist/twilight/{p-DIFUBbJt.system.js.map → p-uNkJ2LZM.system.js.map} +1 -1
  230. package/dist/twilight/twilight.esm.js +1 -1
  231. package/dist/twilight/twilight.js +1 -1
  232. package/package.json +5 -5
  233. package/dist/cjs/index-BRms9nAM.js.map +0 -1
  234. package/dist/esm/index-6RnqFOTM.js.map +0 -1
  235. package/dist/esm-es5/index-6RnqFOTM.js.map +0 -1
  236. package/dist/twilight/p-6RnqFOTM.js.map +0 -1
  237. package/dist/twilight/p-DiAHk-lZ.system.js.map +0 -1
  238. /package/dist/twilight/{p-f1fe7386.system.entry.js.map → p-02187d79.system.entry.js.map} +0 -0
  239. /package/dist/twilight/{p-6a9916f4.system.entry.js.map → p-02b2de19.system.entry.js.map} +0 -0
  240. /package/dist/twilight/{p-9b074242.entry.js.map → p-059379d0.entry.js.map} +0 -0
  241. /package/dist/twilight/{p-1fca98a6.system.entry.js.map → p-13a215f8.system.entry.js.map} +0 -0
  242. /package/dist/twilight/{p-3bba12f2.system.entry.js.map → p-231440bc.system.entry.js.map} +0 -0
  243. /package/dist/twilight/{p-e8eeddc4.system.entry.js.map → p-2ac46fd5.system.entry.js.map} +0 -0
  244. /package/dist/twilight/{p-361c68e9.entry.js.map → p-2f228be7.entry.js.map} +0 -0
  245. /package/dist/twilight/{p-a6919fd1.system.entry.js.map → p-302eb45d.system.entry.js.map} +0 -0
  246. /package/dist/twilight/{p-29b9016f.system.entry.js.map → p-3099db22.system.entry.js.map} +0 -0
  247. /package/dist/twilight/{p-e2e632ae.entry.js.map → p-419eb9a7.entry.js.map} +0 -0
  248. /package/dist/twilight/{p-48435856.system.entry.js.map → p-41a7a590.system.entry.js.map} +0 -0
  249. /package/dist/twilight/{p-ed455631.entry.js.map → p-44206730.entry.js.map} +0 -0
  250. /package/dist/twilight/{p-3696d5ed.system.entry.js.map → p-459fff65.system.entry.js.map} +0 -0
  251. /package/dist/twilight/{p-1c459b68.entry.js.map → p-468a7324.entry.js.map} +0 -0
  252. /package/dist/twilight/{p-15b4c829.entry.js.map → p-470e16b4.entry.js.map} +0 -0
  253. /package/dist/twilight/{p-adf637ae.entry.js.map → p-4710f397.entry.js.map} +0 -0
  254. /package/dist/twilight/{p-f13903b4.entry.js.map → p-471d0c2a.entry.js.map} +0 -0
  255. /package/dist/twilight/{p-2367c263.entry.js.map → p-47f2e097.entry.js.map} +0 -0
  256. /package/dist/twilight/{p-90c6efd9.entry.js.map → p-4f1f3a1a.entry.js.map} +0 -0
  257. /package/dist/twilight/{p-57af4a31.entry.js.map → p-4f3c5294.entry.js.map} +0 -0
  258. /package/dist/twilight/{p-c9e41a8f.entry.js.map → p-51915628.entry.js.map} +0 -0
  259. /package/dist/twilight/{p-63c04570.system.entry.js.map → p-53fdce47.system.entry.js.map} +0 -0
  260. /package/dist/twilight/{p-934dd993.entry.js.map → p-55a9da25.entry.js.map} +0 -0
  261. /package/dist/twilight/{p-6d7667a3.entry.js.map → p-56a2493e.entry.js.map} +0 -0
  262. /package/dist/twilight/{p-a05bd636.entry.js.map → p-67c93900.entry.js.map} +0 -0
  263. /package/dist/twilight/{p-1a9b7199.system.entry.js.map → p-6868caa4.system.entry.js.map} +0 -0
  264. /package/dist/twilight/{p-3eb1f223.system.entry.js.map → p-68cbea08.system.entry.js.map} +0 -0
  265. /package/dist/twilight/{p-af0c3637.entry.js.map → p-6bd4f5dd.entry.js.map} +0 -0
  266. /package/dist/twilight/{p-2f351136.system.entry.js.map → p-6bd9b65d.system.entry.js.map} +0 -0
  267. /package/dist/twilight/{p-eb51e405.entry.js.map → p-6c2ffbdb.entry.js.map} +0 -0
  268. /package/dist/twilight/{p-c62f9443.system.entry.js.map → p-6ef02abc.system.entry.js.map} +0 -0
  269. /package/dist/twilight/{p-37b98407.entry.js.map → p-6fd8031a.entry.js.map} +0 -0
  270. /package/dist/twilight/{p-7824e441.entry.js.map → p-72a5b284.entry.js.map} +0 -0
  271. /package/dist/twilight/{p-e8b2ec6f.system.entry.js.map → p-78715871.system.entry.js.map} +0 -0
  272. /package/dist/twilight/{p-7c6bacd4.system.entry.js.map → p-78bf11f2.system.entry.js.map} +0 -0
  273. /package/dist/twilight/{p-c2e6934e.system.entry.js.map → p-7cdfb2ff.system.entry.js.map} +0 -0
  274. /package/dist/twilight/{p-53507406.entry.js.map → p-7d060cdd.entry.js.map} +0 -0
  275. /package/dist/twilight/{p-881cd90a.system.entry.js.map → p-7e3906fc.system.entry.js.map} +0 -0
  276. /package/dist/twilight/{p-bb26f888.entry.js.map → p-7f0e3435.entry.js.map} +0 -0
  277. /package/dist/twilight/{p-1ecb5b3b.entry.js.map → p-8277f14f.entry.js.map} +0 -0
  278. /package/dist/twilight/{p-d31f25e6.entry.js.map → p-84b61e25.entry.js.map} +0 -0
  279. /package/dist/twilight/{p-60030ed5.system.entry.js.map → p-85b17c34.system.entry.js.map} +0 -0
  280. /package/dist/twilight/{p-38e35ba9.system.entry.js.map → p-889ec51e.system.entry.js.map} +0 -0
  281. /package/dist/twilight/{p-d8787047.entry.js.map → p-8e14e730.entry.js.map} +0 -0
  282. /package/dist/twilight/{p-5df10c86.system.entry.js.map → p-93bc2972.system.entry.js.map} +0 -0
  283. /package/dist/twilight/{p-46d0b8df.entry.js.map → p-9470463b.entry.js.map} +0 -0
  284. /package/dist/twilight/{p-f2f86bc0.system.entry.js.map → p-963ba76e.system.entry.js.map} +0 -0
  285. /package/dist/twilight/{p-d4b0466e.system.entry.js.map → p-9cf6cc9f.system.entry.js.map} +0 -0
  286. /package/dist/twilight/{p-d309e915.system.entry.js.map → p-ad83b353.system.entry.js.map} +0 -0
  287. /package/dist/twilight/{p-e8cab8f7.entry.js.map → p-b1266dbc.entry.js.map} +0 -0
  288. /package/dist/twilight/{p-3389fc3f.entry.js.map → p-b6c991e2.entry.js.map} +0 -0
  289. /package/dist/twilight/{p-30022be7.system.entry.js.map → p-bd97e5ea.system.entry.js.map} +0 -0
  290. /package/dist/twilight/{p-6bd3e8c2.system.entry.js.map → p-bef4449d.system.entry.js.map} +0 -0
  291. /package/dist/twilight/{p-9fe5bbbc.system.entry.js.map → p-c4741c01.system.entry.js.map} +0 -0
  292. /package/dist/twilight/{p-93684e71.system.entry.js.map → p-c93aca68.system.entry.js.map} +0 -0
  293. /package/dist/twilight/{p-766a000c.entry.js.map → p-c9736f8b.entry.js.map} +0 -0
  294. /package/dist/twilight/{p-ed217c2e.entry.js.map → p-cdadd220.entry.js.map} +0 -0
  295. /package/dist/twilight/{p-faa04f76.system.entry.js.map → p-cfe9931b.system.entry.js.map} +0 -0
  296. /package/dist/twilight/{p-3a154637.system.entry.js.map → p-d54d7cd7.system.entry.js.map} +0 -0
  297. /package/dist/twilight/{p-aae512ee.entry.js.map → p-dade84c6.entry.js.map} +0 -0
  298. /package/dist/twilight/{p-ee74bc5f.entry.js.map → p-e53e006e.entry.js.map} +0 -0
  299. /package/dist/twilight/{p-f8789882.system.entry.js.map → p-e574830f.system.entry.js.map} +0 -0
  300. /package/dist/twilight/{p-b7442220.entry.js.map → p-e5ff9041.entry.js.map} +0 -0
  301. /package/dist/twilight/{p-5e66fc93.entry.js.map → p-f0e1cc94.entry.js.map} +0 -0
  302. /package/dist/twilight/{p-61a03c21.system.entry.js.map → p-fb5d9736.system.entry.js.map} +0 -0
  303. /package/dist/twilight/{p-e39626cc.system.entry.js.map → p-fc7c940d.system.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,s,e,n){function i(t){return t instanceof e?t:new e((function(s){s(t)}))}return new(e||(e=Promise))((function(e,r){function c(t){try{a(n.next(t))}catch(t){r(t)}}function o(t){try{a(n["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):i(t.value).then(c,o)}a((n=n.apply(t,s||[])).next())}))};var __generator=this&&this.__generator||function(t,s){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,c;return c={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(s){return a([t,s])}}function a(o){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,o[0]&&(e=0)),e)try{if(n=1,i&&(r=o[0]&2?i["return"]:o[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;if(i=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;i=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){e.label=o[1];break}if(o[0]===6&&e.label<r[1]){e.label=r[1];r=o;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(o);break}if(r[2])e.ops.pop();e.trys.pop();continue}o=s.call(t,e)}catch(t){o=[6,t];i=0}finally{n=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-DiAHk-lZ.system.js","./p-BAa1Mtv9.system.js","./p-Ik1kuM1-.system.js"],(function(t){"use strict";var s,e,n,i,r;return{setters:[function(t){s=t.r;e=t.h},function(t){n=t.S;i=t.A},function(t){r=t.G}],execute:function(){var c='\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 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>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 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>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';var l=":host{display:block}";var f=t("salla_cart_item_offers",function(){function t(t){var e=this;s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:a,GiftIcon:r,FireIcon:o,SpecialDiscountIcon:n,TagMoneyIcon:c};this.visibleOffersCount=3;this.handleCartItemUpdated=function(t){var s=t.data.cart.items.find((function(t){return t.id===e.itemId}));if((s===null||s===void 0?void 0:s.id)===e.itemId){e.internalQuantity=s.quantity;e.internalOffers=s.detailed_offers||[];e.internalProductPrice=s.product_price}};this.toggleShowAll=function(){e.showAll=!e.showAll}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,Salla.onReady()];case 1:s.sent();return[4,salla.lang.onLoaded((function(){t.freeLabel=salla.lang.get("common.elements.freeExclam");t.receivedOffer=salla.lang.get("pages.cart.received_offer");t.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");t.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))];case 2:s.sent();this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice;return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;salla.event.on("cart::item.updated",(function(s){return t.handleCartItemUpdated(s)}))};t.prototype.parseOffers=function(t){try{if(typeof t!=="string"){console.warn("Offers is not a string. Returning as-is.",t);return Array.isArray(t)?t:[]}return JSON.parse(t||"[]")}catch(t){console.error("Failed to parse offers",t);return[]}};Object.defineProperty(t.prototype,"visibleOffers",{get:function(){return this.internalOffers.slice(0,this.visibleOffersCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hiddenOffers",{get:function(){return this.internalOffers.slice(this.visibleOffersCount)},enumerable:false,configurable:true});t.prototype.getPaidQty=function(t,s){return t-s.free_quantity};t.prototype.renderOffer=function(t,s){var n=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&n>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(n)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))};t.prototype.render=function(){var t=this;var s,n;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return e("div",{class:"s-cart-item-offers-container",id:"offers_list_".concat(this.itemId)},this.visibleOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)})),((n=this.internalOffers)===null||n===void 0?void 0:n.length)>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:i,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:"offers_".concat(this.itemId)},this.hiddenOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)}))))};return t}());f.style=l}}}));
5
- //# sourceMappingURL=p-1a9b7199.system.entry.js.map
4
+ */System.register(["./p-CbJXYJ5O.system.js","./p-BAa1Mtv9.system.js","./p-Ik1kuM1-.system.js"],(function(t){"use strict";var s,e,n,i,r;return{setters:[function(t){s=t.r;e=t.h},function(t){n=t.S;i=t.A},function(t){r=t.G}],execute:function(){var c='\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 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>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 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>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';var l=":host{display:block}";var f=t("salla_cart_item_offers",function(){function t(t){var e=this;s(this,t);this.internalOffers=[];this.showAll=false;this.freeLabel="";this.receivedOffer="";this.discountAmountLabel="";this.showMoreOffers="";this.icons={DiscountCouponIcon:a,GiftIcon:r,FireIcon:o,SpecialDiscountIcon:n,TagMoneyIcon:c};this.visibleOffersCount=3;this.handleCartItemUpdated=function(t){var s=t.data.cart.items.find((function(t){return t.id===e.itemId}));if((s===null||s===void 0?void 0:s.id)===e.itemId){e.internalQuantity=s.quantity;e.internalOffers=s.detailed_offers||[];e.internalProductPrice=s.product_price}};this.toggleShowAll=function(){e.showAll=!e.showAll}}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,Salla.onReady()];case 1:s.sent();return[4,salla.lang.onLoaded((function(){t.freeLabel=salla.lang.get("common.elements.freeExclam");t.receivedOffer=salla.lang.get("pages.cart.received_offer");t.discountAmountLabel=salla.lang.get("pages.cart.discount_amount");t.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")}))];case 2:s.sent();this.internalQuantity=this.quantity;this.internalOffers=this.parseOffers(this.offers);this.internalProductPrice=this.productPrice;return[2]}}))}))};t.prototype.componentDidLoad=function(){var t=this;salla.event.on("cart::item.updated",(function(s){return t.handleCartItemUpdated(s)}))};t.prototype.parseOffers=function(t){try{if(typeof t!=="string"){console.warn("Offers is not a string. Returning as-is.",t);return Array.isArray(t)?t:[]}return JSON.parse(t||"[]")}catch(t){console.error("Failed to parse offers",t);return[]}};Object.defineProperty(t.prototype,"visibleOffers",{get:function(){return this.internalOffers.slice(0,this.visibleOffersCount)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hiddenOffers",{get:function(){return this.internalOffers.slice(this.visibleOffersCount)},enumerable:false,configurable:true});t.prototype.getPaidQty=function(t,s){return t-s.free_quantity};t.prototype.renderOffer=function(t,s){var n=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&n>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(n)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))};t.prototype.render=function(){var t=this;var s,n;if(!((s=this.internalOffers)===null||s===void 0?void 0:s.length)){return null}return e("div",{class:"s-cart-item-offers-container",id:"offers_list_".concat(this.itemId)},this.visibleOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)})),((n=this.internalOffers)===null||n===void 0?void 0:n.length)>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:i,class:{"s-cart-item-offers-arrow-icon":true,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:"offers_".concat(this.itemId)},this.hiddenOffers.map((function(s){return t.renderOffer(t.internalQuantity,s)}))))};return t}());f.style=l}}}));
5
+ //# sourceMappingURL=p-6868caa4.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(r,t,e,i){function n(r){return r instanceof e?r:new e((function(t){t(r)}))}return new(e||(e=Promise))((function(e,a){function s(r){try{o(i.next(r))}catch(r){a(r)}}function u(r){try{o(i["throw"](r))}catch(r){a(r)}}function o(r){r.done?e(r.value):n(r.value).then(s,u)}o((i=i.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(r){return function(t){return o([r,t])}}function o(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,n&&(a=u[0]&2?n["return"]:u[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;if(n=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=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(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1];a=u;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(u);break}if(a[2])e.ops.pop();e.trys.pop();continue}u=t.call(r,e)}catch(r){u=[6,r];n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var i=0,n=t.length,a;i<n;i++){if(a||!(i in t)){if(!a)a=Array.prototype.slice.call(t,0,i);a[i]=t[i]}}return r.concat(a||Array.prototype.slice.call(t))};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-DiAHk-lZ.system.js","./p-B8FGqfEh.system.js","./p-CzwwMHuN.system.js","./p-CLqFzsVe.system.js"],(function(r){"use strict";var t,e,i,n,a,s,u,o,f;return{setters:[function(r){t=r.a;e=r.d;i=r.e;n=r.f;a=r.r;s=r.h;u=r.g},function(r){o=r.S},function(r){f=r.H},null],execute:function(){var l;var c;function v(){if(c)return l;c=1;var r=t();var e=function(){return r.Date.now()};l=e;return l}var h;var d;function p(){if(d)return h;d=1;var r=/\s/;function t(t){var e=t.length;while(e--&&r.test(t.charAt(e))){}return e}h=t;return h}var w;var g;function m(){if(g)return w;g=1;var r=p();var t=/^\s+/;function e(e){return e?e.slice(0,r(e)+1).replace(t,""):e}w=e;return w}var y;var b;function _(){if(b)return y;b=1;var r=m(),t=e(),n=i();var a=0/0;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var o=/^0o[0-7]+$/i;var f=parseInt;function l(e){if(typeof e=="number"){return e}if(n(e)){return a}if(t(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=t(i)?i+"":i}if(typeof e!="string"){return e===0?e:+e}e=r(e);var l=u.test(e);return l||o.test(e)?f(e.slice(2),l?2:8):s.test(e)?a:+e}y=l;return y}var k;var A;function T(){if(A)return k;A=1;var r=e(),t=v(),i=_();var n="Expected a function";var a=Math.max,s=Math.min;function u(e,u,o){var f,l,c,v,h,d,p=0,w=false,g=false,m=true;if(typeof e!="function"){throw new TypeError(n)}u=i(u)||0;if(r(o)){w=!!o.leading;g="maxWait"in o;c=g?a(i(o.maxWait)||0,u):c;m="trailing"in o?!!o.trailing:m}function y(r){var t=f,i=l;f=l=undefined;p=r;v=e.apply(i,t);return v}function b(r){p=r;h=setTimeout(A,u);return w?y(r):v}function _(r){var t=r-d,e=r-p,i=u-t;return g?s(i,c-e):i}function k(r){var t=r-d,e=r-p;return d===undefined||t>=u||t<0||g&&e>=c}function A(){var r=t();if(k(r)){return T(r)}h=setTimeout(A,_(r))}function T(r){h=undefined;if(m&&f){return y(r)}f=l=undefined;return v}function E(){if(h!==undefined){clearTimeout(h)}p=0;f=d=l=h=undefined}function x(){return h===undefined?v:T(t())}function M(){var r=t(),e=k(r);f=arguments;l=this;d=r;if(e){if(h===undefined){return b(d)}if(g){clearTimeout(h);h=setTimeout(A,u);return y(d)}}if(h===undefined){h=setTimeout(A,u)}return v}M.cancel=E;M.flush=x;return M}k=u;return k}var E;var x;function M(){if(x)return E;x=1;var r=T(),t=e();var i="Expected a function";function n(e,n,a){var s=true,u=true;if(typeof e!="function"){throw new TypeError(i)}if(t(a)){s="leading"in a?!!a.leading:s;u="trailing"in a?!!a.trailing:u}return r(e,n,{leading:s,maxWait:n,trailing:u})}E=n;return E}var S=M();var j=n(S);var C=function(){function r(r){var t=this;this.grid=r;this.create=function(){t.mutationObserver.observe(t.grid,{childList:true});for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];t.resizeObserver.observe(i)}};this.onContainerMutation=function(r){var e=r.flatMap((function(r){return Array.from(r.removedNodes)}));var i=r.flatMap((function(r){return Array.from(r.addedNodes)}));for(var n=0,a=e;n<a.length;n++){var s=a[n];if(s instanceof Element){t.resizeObserver.unobserve(s)}}for(var u=0,o=i;u<o.length;u++){var s=o[u];if(s instanceof Element){t.resizeObserver.observe(s)}}if(e.length>0&&i.length===0){t.update()}};this.onChildrenResize=function(r){var e=r.filter((function(r){return r.target.parentElement!==null}));if(e.length>0){t.update()}};this.update=j((function(){var r=window.getComputedStyle(t.grid);if(r.getPropertyValue("display").includes("grid")===false){t.clean();return}var e=z(t.grid);if(e.length<=1){t.clean();return}var i=Number.parseFloat(r.getPropertyValue("row-gap").trim())||0;var n=Array.from(t.grid.children);for(var a=0;a<e.length;a++){var s=n[a];s===null||s===void 0?void 0:s.style.removeProperty("margin-top")}for(var u=0;u<n.length;u++){var o=n[u-e.length];var f=n[u];if(o!==undefined&&f!==undefined){var l=o.getBoundingClientRect().bottom;f.style.removeProperty("margin-top");var c=f.getBoundingClientRect().top;if(c-i!==l){var v=Math.round((l-(c-i)+Number.EPSILON)*100)/100;f.style.setProperty("margin-top","".concat(v,"px"))}}}}),32);this.destroy=function(){t.resizeObserver.disconnect();t.mutationObserver.disconnect();t.clean()};this.clean=function(){for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];i.style.removeProperty("margin-top")}};this.mutationObserver=new MutationObserver(this.onContainerMutation);this.resizeObserver=new ResizeObserver(this.onChildrenResize);if(CSS.supports("grid-template-rows","masonry")===false){this.create()}}r.prototype[Symbol.dispose]=function(){this.destroy()};return r}();function z(r){var t=window.getComputedStyle(r);var e=t.getPropertyValue("grid-template-columns");return e.trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}var L=":host{display:block}";var q=r("salla_reviews_page",function(){function r(r){a(this,r);this.reviews=[];this.isLoading=false;this.pagination=null;this.sort="latest"}r.prototype.getUrlParams=function(){var r=new URLSearchParams(window.location.search);return{sort:r.get("sort")||null,page:Number.parseInt(r.get("page"))||1}};r.prototype.updateUrlParams=function(r){var t=new URL(window.location.href);for(var e=0,i=Object.entries(r);e<i.length;e++){var n=i[e],a=n[0],s=n[1];if(s){t.searchParams.set(a,s.toString())}else{t.searchParams.delete(a)}}window.history.replaceState({},"",t.toString())};r.prototype.fetchReviews=function(r,t){var e=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:t||e.page||1,sort:r||e.sort||null}})};r.prototype.initializeMasonry=function(){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){r=this.el.querySelector(".s-reviews-page-grid");if(!r)return[2];try{new C(r);salla.logger.info("Masonry initialized successfully")}catch(r){salla.logger.error("Masonry initialization failed:",r)}return[2]}))}))};r.prototype.animateReviewCards=function(){var r=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");f.animateItems(r)};r.prototype.initiateInfiniteScroll=function(){var r=this;var t,e,i;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){var t,e;return((e=(t=r.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)||null},history:false,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(function(){r.isLoading=true}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(t){r.pagination=t.pagination;r.reviews=__spreadArray(__spreadArray([],r.reviews,true),t.data,true);r.isLoading=false;r.updateUrlParams({page:t.pagination.current_page})}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("error",(function(t){salla.logger.error("Error loading more reviews:",t);r.isLoading=false}))};r.prototype.componentDidRender=function(){var r=this;setTimeout((function(){requestAnimationFrame(r.animateReviewCards.bind(r))}),176)};r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t,e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,salla.onReady()];case 1:n.sent();this.langTitlesReviews=salla.lang.get("common.titles.reviews");this.langSorting=salla.lang.get("pages.categories.sorting");this.placeholderText=salla.lang.choice("pages.rating.reviews",0);this.langLoadMore=salla.lang.get("common.elements.load_more");this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc");this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc");this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc");this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");t=this.getUrlParams();return[4,this.fetchReviews(t.sort)];case 2:e=n.sent();this.sort=t.sort;this.reviews=e.data;this.pagination=e.pagination;this.langRatingReviews=salla.lang.choice("pages.rating.reviews",(r=this.pagination)===null||r===void 0?void 0:r.total);return[3,4];case 3:i=n.sent();salla.logger.error("Error loading reviews:",i);return[3,4];case 4:return[2]}}))}))};r.prototype.handleSorting=function(r){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:t=r.target.value;this.sort=t;this.updateUrlParams({sort:t,page:1});return[4,this.fetchReviews(t,1)];case 1:e=i.sent();this.reviews=e.data;this.pagination=e.pagination;return[2]}}))}))};r.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.initializeMasonry()];case 1:r.sent();this.initiateInfiniteScroll();this.sort=this.getUrlParams().sort||"latest";this.updateUrlParams({sort:this.sort,page:1});return[2]}}))}))};r.prototype.disconnectedCallback=function(){if(this.infiniteScroll){this.infiniteScroll.destroy()}};r.prototype.renderSortingOptions=function(){var r=this;var t=[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}];return t.map((function(t){return s("option",{key:t.value,value:t.value,selected:t.value===r.sort},t.label)}))};r.prototype.render=function(){var r=this;var t,e;return s("host",{key:"f3b06307322a56ad320374a50e13161be4e7cc8a"},s("div",{key:"3dcabdae4ee87de5c62873f327657991a56bc0e1",class:"s-reviews-page-header-wrapper"},s("h2",{key:"61bca34f24c52440fd8f736f9a6ab2b37be65c34",class:"s-reviews-page-title"},this.langTitlesReviews,s("span",{key:"c29228eaa51e9c202c6031e5f69b95905aa5485a",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),s("div",{key:"81f964be39231e21cd7c994e7e241e755af54c86",class:"s-reviews-page-filter-wrapper"},s("label",{key:"d408952ef5ffba3bedd5e01b5c6edec1aeb34f28",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),s("select",{key:"5138fdf478aed6fea544dd1adf4d32f715f89532",onChange:function(t){return r.handleSorting(t)},disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?s("main",{class:"s-reviews-page-grid",ref:function(t){r.wrapper=t}},this.reviews.map((function(r){return s("salla-review-card",{key:r.id,review:r})}))):s("div",{class:"s-products-list-placeholder"},s("span",{innerHTML:o}),s("p",null,this.placeholderText)),((e=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)&&this.reviews.length?s("div",{class:"s-reviews-page-load-more-container"},s("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()},onKeyUp:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}},this.langLoadMore)):null)};Object.defineProperty(r.prototype,"el",{get:function(){return u(this)},enumerable:false,configurable:true});return r}());q.style=L}}}));
5
- //# sourceMappingURL=p-3eb1f223.system.entry.js.map
4
+ */System.register(["./p-CbJXYJ5O.system.js","./p-B8FGqfEh.system.js","./p-CzwwMHuN.system.js","./p-CLqFzsVe.system.js"],(function(r){"use strict";var t,e,i,n,a,s,u,o,f;return{setters:[function(r){t=r.a;e=r.d;i=r.e;n=r.f;a=r.r;s=r.h;u=r.g},function(r){o=r.S},function(r){f=r.H},null],execute:function(){var l;var c;function v(){if(c)return l;c=1;var r=t();var e=function(){return r.Date.now()};l=e;return l}var h;var d;function p(){if(d)return h;d=1;var r=/\s/;function t(t){var e=t.length;while(e--&&r.test(t.charAt(e))){}return e}h=t;return h}var w;var g;function m(){if(g)return w;g=1;var r=p();var t=/^\s+/;function e(e){return e?e.slice(0,r(e)+1).replace(t,""):e}w=e;return w}var y;var b;function _(){if(b)return y;b=1;var r=m(),t=e(),n=i();var a=0/0;var s=/^[-+]0x[0-9a-f]+$/i;var u=/^0b[01]+$/i;var o=/^0o[0-7]+$/i;var f=parseInt;function l(e){if(typeof e=="number"){return e}if(n(e)){return a}if(t(e)){var i=typeof e.valueOf=="function"?e.valueOf():e;e=t(i)?i+"":i}if(typeof e!="string"){return e===0?e:+e}e=r(e);var l=u.test(e);return l||o.test(e)?f(e.slice(2),l?2:8):s.test(e)?a:+e}y=l;return y}var k;var T;function A(){if(T)return k;T=1;var r=e(),t=v(),i=_();var n="Expected a function";var a=Math.max,s=Math.min;function u(e,u,o){var f,l,c,v,h,d,p=0,w=false,g=false,m=true;if(typeof e!="function"){throw new TypeError(n)}u=i(u)||0;if(r(o)){w=!!o.leading;g="maxWait"in o;c=g?a(i(o.maxWait)||0,u):c;m="trailing"in o?!!o.trailing:m}function y(r){var t=f,i=l;f=l=undefined;p=r;v=e.apply(i,t);return v}function b(r){p=r;h=setTimeout(T,u);return w?y(r):v}function _(r){var t=r-d,e=r-p,i=u-t;return g?s(i,c-e):i}function k(r){var t=r-d,e=r-p;return d===undefined||t>=u||t<0||g&&e>=c}function T(){var r=t();if(k(r)){return A(r)}h=setTimeout(T,_(r))}function A(r){h=undefined;if(m&&f){return y(r)}f=l=undefined;return v}function E(){if(h!==undefined){clearTimeout(h)}p=0;f=d=l=h=undefined}function x(){return h===undefined?v:A(t())}function M(){var r=t(),e=k(r);f=arguments;l=this;d=r;if(e){if(h===undefined){return b(d)}if(g){clearTimeout(h);h=setTimeout(T,u);return y(d)}}if(h===undefined){h=setTimeout(T,u)}return v}M.cancel=E;M.flush=x;return M}k=u;return k}var E;var x;function M(){if(x)return E;x=1;var r=A(),t=e();var i="Expected a function";function n(e,n,a){var s=true,u=true;if(typeof e!="function"){throw new TypeError(i)}if(t(a)){s="leading"in a?!!a.leading:s;u="trailing"in a?!!a.trailing:u}return r(e,n,{leading:s,maxWait:n,trailing:u})}E=n;return E}var C=M();var S=n(C);var j=function(){function r(r){var t=this;this.grid=r;this.create=function(){t.mutationObserver.observe(t.grid,{childList:true});for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];t.resizeObserver.observe(i)}};this.onContainerMutation=function(r){var e=r.flatMap((function(r){return Array.from(r.removedNodes)}));var i=r.flatMap((function(r){return Array.from(r.addedNodes)}));for(var n=0,a=e;n<a.length;n++){var s=a[n];if(s instanceof Element){t.resizeObserver.unobserve(s)}}for(var u=0,o=i;u<o.length;u++){var s=o[u];if(s instanceof Element){t.resizeObserver.observe(s)}}if(e.length>0&&i.length===0){t.update()}};this.onChildrenResize=function(r){var e=r.filter((function(r){return r.target.parentElement!==null}));if(e.length>0){t.update()}};this.update=S((function(){var r=window.getComputedStyle(t.grid);if(r.getPropertyValue("display").includes("grid")===false){t.clean();return}var e=z(t.grid);if(e.length<=1){t.clean();return}var i=Number.parseFloat(r.getPropertyValue("row-gap").trim())||0;var n=Array.from(t.grid.children);for(var a=0;a<e.length;a++){var s=n[a];s===null||s===void 0?void 0:s.style.removeProperty("margin-top")}for(var u=0;u<n.length;u++){var o=n[u-e.length];var f=n[u];if(o!==undefined&&f!==undefined){var l=o.getBoundingClientRect().bottom;f.style.removeProperty("margin-top");var c=f.getBoundingClientRect().top;if(c-i!==l){var v=Math.round((l-(c-i)+Number.EPSILON)*100)/100;f.style.setProperty("margin-top","".concat(v,"px"))}}}}),32);this.destroy=function(){t.resizeObserver.disconnect();t.mutationObserver.disconnect();t.clean()};this.clean=function(){for(var r=0,e=Array.from(t.grid.children);r<e.length;r++){var i=e[r];i.style.removeProperty("margin-top")}};this.mutationObserver=new MutationObserver(this.onContainerMutation);this.resizeObserver=new ResizeObserver(this.onChildrenResize);if(CSS.supports("grid-template-rows","masonry")===false){this.create()}}r.prototype[Symbol.dispose]=function(){this.destroy()};return r}();function z(r){var t=window.getComputedStyle(r);var e=t.getPropertyValue("grid-template-columns");return e.trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}var L=":host{display:block}";var O=r("salla_reviews_page",function(){function r(r){a(this,r);this.reviews=[];this.isLoading=false;this.pagination=null;this.sort="latest"}r.prototype.getUrlParams=function(){var r=new URLSearchParams(window.location.search);return{sort:r.get("sort")||null,page:Number.parseInt(r.get("page"))||1}};r.prototype.updateUrlParams=function(r){var t=new URL(window.location.href);for(var e=0,i=Object.entries(r);e<i.length;e++){var n=i[e],a=n[0],s=n[1];if(s){t.searchParams.set(a,s.toString())}else{t.searchParams.delete(a)}}window.history.replaceState({},"",t.toString())};r.prototype.fetchReviews=function(r,t){var e=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:t||e.page||1,sort:r||e.sort||null}})};r.prototype.initializeMasonry=function(){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(t){r=this.el.querySelector(".s-reviews-page-grid");if(!r)return[2];try{new j(r);salla.logger.info("Masonry initialized successfully")}catch(r){salla.logger.error("Masonry initialization failed:",r)}return[2]}))}))};r.prototype.animateReviewCards=function(){var r=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");f.animateItems(r)};r.prototype.initiateInfiniteScroll=function(){var r=this;var t,e,i;if(!this.wrapper){salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.");return}this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:function(){var t,e;return((e=(t=r.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)||null},history:false,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(function(){r.isLoading=true}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(t){r.pagination=t.pagination;r.reviews=__spreadArray(__spreadArray([],r.reviews,true),t.data,true);r.isLoading=false;r.updateUrlParams({page:t.pagination.current_page})}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("error",(function(t){salla.logger.error("Error loading more reviews:",t);r.isLoading=false}))};r.prototype.componentDidRender=function(){var r=this;setTimeout((function(){requestAnimationFrame(r.animateReviewCards.bind(r))}),176)};r.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var r,t,e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,salla.onReady()];case 1:n.sent();this.langTitlesReviews=salla.lang.get("common.titles.reviews");this.langSorting=salla.lang.get("pages.categories.sorting");this.placeholderText=salla.lang.choice("pages.rating.reviews",0);this.langLoadMore=salla.lang.get("common.elements.load_more");this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc");this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc");this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc");this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");t=this.getUrlParams();return[4,this.fetchReviews(t.sort)];case 2:e=n.sent();this.sort=t.sort;this.reviews=e.data;this.pagination=e.pagination;this.langRatingReviews=salla.lang.choice("pages.rating.reviews",(r=this.pagination)===null||r===void 0?void 0:r.total);return[3,4];case 3:i=n.sent();salla.logger.error("Error loading reviews:",i);return[3,4];case 4:return[2]}}))}))};r.prototype.handleSorting=function(r){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:t=r.target.value;this.sort=t;this.updateUrlParams({sort:t,page:1});return[4,this.fetchReviews(t,1)];case 1:e=i.sent();this.reviews=e.data;this.pagination=e.pagination;return[2]}}))}))};r.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.initializeMasonry()];case 1:r.sent();this.initiateInfiniteScroll();this.sort=this.getUrlParams().sort||"latest";this.updateUrlParams({sort:this.sort,page:1});return[2]}}))}))};r.prototype.disconnectedCallback=function(){if(this.infiniteScroll){this.infiniteScroll.destroy()}};r.prototype.renderSortingOptions=function(){var r=this;var t=[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}];return t.map((function(t){return s("option",{key:t.value,value:t.value,selected:t.value===r.sort},t.label)}))};r.prototype.render=function(){var r=this;var t,e;return s("host",{key:"f3b06307322a56ad320374a50e13161be4e7cc8a"},s("div",{key:"3dcabdae4ee87de5c62873f327657991a56bc0e1",class:"s-reviews-page-header-wrapper"},s("h2",{key:"61bca34f24c52440fd8f736f9a6ab2b37be65c34",class:"s-reviews-page-title"},this.langTitlesReviews,s("span",{key:"c29228eaa51e9c202c6031e5f69b95905aa5485a",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),s("div",{key:"81f964be39231e21cd7c994e7e241e755af54c86",class:"s-reviews-page-filter-wrapper"},s("label",{key:"d408952ef5ffba3bedd5e01b5c6edec1aeb34f28",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),s("select",{key:"5138fdf478aed6fea544dd1adf4d32f715f89532",onChange:function(t){return r.handleSorting(t)},disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?s("main",{class:"s-reviews-page-grid",ref:function(t){r.wrapper=t}},this.reviews.map((function(r){return s("salla-review-card",{key:r.id,review:r})}))):s("div",{class:"s-products-list-placeholder"},s("span",{innerHTML:o}),s("p",null,this.placeholderText)),((e=(t=this.pagination)===null||t===void 0?void 0:t.links)===null||e===void 0?void 0:e.next)&&this.reviews.length?s("div",{class:"s-reviews-page-load-more-container"},s("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()},onKeyUp:function(){var t;return(t=r.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}},this.langLoadMore)):null)};Object.defineProperty(r.prototype,"el",{get:function(){return u(this)},enumerable:false,configurable:true});return r}());O.style=L}}}));
5
+ //# sourceMappingURL=p-68cbea08.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as e,H as i,g as l}from"./p-6RnqFOTM.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";const n=class{constructor(e){t(this,e);this.changed=s(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(()=>this.host.style.display="none"));salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply");this.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=a.VALUES;let{max:s,min:e}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=e||t<=s))}if(this.filtersData.variants&&t.type==a.VARIANTS){s.variants=this.filtersData.variants}if(this.filtersData[t.key]&&t.type!==a.VARIANTS){s[t.key]=this.filtersData[t.key]}let e=new URLSearchParams(window.location.search);let i=false;for(let t of e.keys()){if(t.includes("filters")){i=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(s).length==0&&!i){let t=window.location.href;let e=salla.config.get("page.id");let i=t.indexOf("?")!==-1?"&":"?";let l=t+i+"filters[category_id]="+e;s.category_id=e;window.history.pushState({path:l},"",l)}return t}));this.filtersData=s;this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady){return}let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{var s;if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries()){if(s.startsWith("filters")){t.searchParams.delete(s)}}let s=this.encodeFilters(this.filtersData);let e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");if(e){t.search=t.search.split("&filters")[0]+"&"+s}else{t.search=`?${s}`}window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);(s=t.searchParams)===null||s===void 0?void 0:s.delete("filters");window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData);this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const e=[];for(const i in t){if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i];const a=s?`${s}[${i}]`:i;if(Array.isArray(l)){for(let t=0;t<l.length;t++){e.push(`${a}[${t}]=${l[t]}`)}}else if(typeof l==="object"&&l!==null){e.push(this.encodeFilters(l,a))}else{let t=`${a}=${l}`;e.push(t)}}}return e.join("&")}async resetFilters(){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((t=>t.reset&&t.reset()));salla.event.emit("salla-filters::reset");return this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search);const s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&");const e=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,s,e){if(s.type===a.RANGE){this.filtersData[s.key]=e}let i=t.target.checked;if(s.type===a.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[s.key]=e);i||delete this.filtersData.variants[s.key]}else if(t.target.type=="radio"){i&&(this.filtersData[s.key]=e);i||delete this.filtersData[s.key]}else if(t.target.type=="checkbox"){this.filtersData[s.key]=this.filtersData[s.key]||[];if(i){this.filtersData[s.key].push(e)}this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=e))}this.applyFilters()}render(){var t,s;return e(i,{key:"54a625522588215230f1eb5a3ca94b8280b18040"},(t=this.filters)===null||t===void 0?void 0:t.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:e}})=>{this.handleOptionChange(t,s,e)}}))),((s=this.filters)===null||s===void 0?void 0:s.length)?e("div",{class:"s-filters-footer"},e("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=true}get host(){return l(this)}};n.style=o;export{n as salla_filters};
5
- //# sourceMappingURL=p-af0c3637.entry.js.map
4
+ import{r as t,c as s,h as e,H as i,g as l}from"./p-Cmh2bDlu.js";import{F as a}from"./p-DL4h2bc3.js";import{H as r}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o=":host{display:block}.s-rating-stars-small{line-height:12px}.s-filters-radio{background-image:none !important}";const n=class{constructor(e){t(this,e);this.changed=s(this,"changed");this.isReady=false;this.filtersData={};salla.event.on("filters::hidden",(()=>this.host.style.display="none"));salla.lang.onLoaded((()=>{this.apply=salla.lang.get("pages.checkout.apply");this.reset=salla.lang.get("pages.categories.filters_reset")}));salla.event.on("filters::fetched",(({filters:t})=>{this.host.style.display="";let s={};this.filters=t.map((t=>{t.label={category_id:salla.lang.get("common.titles.categories"),brand_id:salla.lang.get("common.titles.brands"),rating:salla.lang.get("pages.categories.filter_rating"),price:salla.lang.get("pages.categories.filter_price")}[t.key]||t.label;if(t.key=="rating"){t.type=a.VALUES;let{max:s,min:e}=t.values;t.values=[5,4,3,2,1].filter((t=>t>=e||t<=s))}if(this.filtersData.variants&&t.type==a.VARIANTS){s.variants=this.filtersData.variants}if(this.filtersData[t.key]&&t.type!==a.VARIANTS){s[t.key]=this.filtersData[t.key]}let e=new URLSearchParams(window.location.search);let i=false;for(let t of e.keys()){if(t.includes("filters")){i=true;break}}if(salla.config.get("page.slug")=="product.index"&&Object.keys(s).length==0&&!i){let t=window.location.href;let e=salla.config.get("page.id");let i=t.indexOf("?")!==-1?"&":"?";let l=t+i+"filters[category_id]="+e;s.category_id=e;window.history.pushState({path:l},"",l)}return t}));this.filtersData=s;this.host.childNodes.forEach((async t=>t.setWidgetHeight&&await t.setWidgetHeight()))}))}async componentWillLoad(){try{const t=new URLSearchParams(window.location.search);this.filtersData=await r.extractFiltersFromUrl(t)}catch(t){console.warn("failed to get filters from URL",t.message)}}async getFilters(){return this.filtersData}async applyFilters(){if(!this.isReady){return}let t=Object.keys(this.filtersData).length>0;setTimeout((()=>{var s;if(t){let t=new URL(window.location.href);for(const[s]of t.searchParams.entries()){if(s.startsWith("filters")){t.searchParams.delete(s)}}let s=this.encodeFilters(this.filtersData);let e=t.search.split("&").filter((t=>!t.includes("filters"))).join("&");if(e){t.search=t.search.split("&filters")[0]+"&"+s}else{t.search=`?${s}`}window.history.pushState({},"",t.href)}else{let t=new URL(window.location.href);(s=t.searchParams)===null||s===void 0?void 0:s.delete("filters");window.history.pushState({},"",t.toString())}salla.event.emit("salla-filters::changed",this.filtersData);this.changed.emit(this.filtersData)}),300)}encodeFilters(t,s="filters"){const e=[];for(const i in t){if(Object.prototype.hasOwnProperty.call(t,i)){const l=t[i];const a=s?`${s}[${i}]`:i;if(Array.isArray(l)){for(let t=0;t<l.length;t++){e.push(`${a}[${t}]=${l[t]}`)}}else if(typeof l==="object"&&l!==null){e.push(this.encodeFilters(l,a))}else{let t=`${a}=${l}`;e.push(t)}}}return e.join("&")}async resetFilters(){this.removeFiltersQueryParams();this.filtersData={};this.host.childNodes.forEach((t=>t.reset&&t.reset()));salla.event.emit("salla-filters::reset");return this.applyFilters()}removeFiltersQueryParams(){const t=new URLSearchParams(window.location.search);const s=Array.from(t.keys()).filter((t=>!t.startsWith("filters["))).map((s=>`${encodeURIComponent(s)}=${encodeURIComponent(t.get(s))}`)).join("&");const e=s?`${window.location.pathname}?${s}`:window.location.pathname;window.history.pushState({},"",e)}handleOptionChange(t,s,e){if(s.type===a.RANGE){this.filtersData[s.key]=e}let i=t.target.checked;if(s.type===a.VARIANTS){this.filtersData.variants=this.filtersData.variants||{};i&&(this.filtersData.variants[s.key]=e);i||delete this.filtersData.variants[s.key]}else if(t.target.type=="radio"){i&&(this.filtersData[s.key]=e);i||delete this.filtersData[s.key]}else if(t.target.type=="checkbox"){this.filtersData[s.key]=this.filtersData[s.key]||[];if(i){this.filtersData[s.key].push(e)}this.filtersData[s.key]=this.filtersData[s.key].filter((t=>t!=e))}this.applyFilters()}render(){var t,s;return e(i,{key:"54a625522588215230f1eb5a3ca94b8280b18040"},(t=this.filters)===null||t===void 0?void 0:t.map((t=>e("salla-filters-widget",{option:t,filtersData:this.filtersData,onChanged:({detail:{event:t,option:s,value:e}})=>{this.handleOptionChange(t,s,e)}}))),((s=this.filters)===null||s===void 0?void 0:s.length)?e("div",{class:"s-filters-footer"},e("salla-button",{color:"gray",fill:"outline",onClick:()=>this.resetFilters()},this.reset)):"")}componentDidLoad(){this.isReady=true}get host(){return l(this)}};n.style=o;export{n as salla_filters};
5
+ //# sourceMappingURL=p-6bd4f5dd.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-DiAHk-lZ.system.js","./p-C2rVu_Jb.system.js"],(function(t){"use strict";var s,e,i,a,o,n,r;return{setters:[function(t){s=t.r;e=t.h;i=t.H;a=t.g;o=t.c},function(t){n=t.p;r=t.m}],execute:function(){var c="";var l=t("salla_accordion",function(){function t(t){s(this,t);this.collapsible=true;this.bordered=false;this.size="md";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 e(i,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:"s-accordion-wrapper ".concat(this.dir," ").concat(this.bordered?"s-accordion-wrapper-bordered":""," ").concat(this.size?"size-".concat(this.size):""),"data-collapsed":this.collapsed.toString()},e("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());l.style=c;var d="";var h=t("salla_accordion_body",function(){function t(t){s(this,t)}t.prototype.render=function(){return e(i,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},e("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return t}());h.style=d;var u="";var f=t("salla_accordion_head",function(){function t(t){s(this,t);this.accordionToggle=o(this,"accordionToggle");this.collapsible=false;this.collapsed=true}t.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};t.prototype.toggleCollapse=function(){var t,s,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(t=this.host.parentElement)===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString());(e=(s=this.host.parentElement)===null||s===void 0?void 0:s.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};t.prototype.render=function(){var t=this;return e(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return t.toggleCollapse()},class:"s-accordion-head-wrapper"},e("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},e("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),e("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"}),e("slot",{key:"adc2122dce76eee34653bc3f47324188c89d80f1",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&e("div",{key:"f61363b6836fb857a0e832de99175936ec4bce29",class:"s-accordion-head-wrapper-end"},e("slot",{key:"15ee81e943714b30bfbaf718364f5d34b14617eb",name:"note"}),this.collapsible&&e("button",{key:"c5f8d32af544ddfba7b2fc2f273ae5b2e8cb7ae5",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(s){s.stopPropagation();t.toggleCollapse()}},e("span",{key:"4c4e3fa6ddeda1a59f65ba47665a9203356037a6",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?n:r}))))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());f.style=u;var p='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n';var b="";var v=t("salla_order_details_options",function(){function t(t){s(this,t);this.bordered=true;this.placeholderImage="images/placeholder.png";this.optionsData=[]}t.prototype.componentWillLoad=function(){this.parseOptionsData()};t.prototype.componentWillUpdate=function(){this.parseOptionsData()};t.prototype.parseOptionsData=function(){if(!this.options){this.optionsData=[];return}if(typeof this.options==="string"){try{this.optionsData=JSON.parse(this.options)}catch(t){this.optionsData=[]}}else{this.optionsData=Array.isArray(this.options)?this.options:[]}};t.prototype.renderOptionValue=function(t){var s=this;if(t.is_image){return e("div",{class:"s-order-details-option-image-container"},e("a",{href:t.value,target:"_blank"},e("img",{class:"s-order-details-option-image",src:t.value||this.placeholderImage,alt:t.name})))}if(t.color){return e("span",{title:t.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:t.color}})}if(t.is_file){return e("a",{href:t.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments")}if(t.is_color_picker){return e("div",{class:"s-order-details-option-color-picker"},e("div",{class:"s-order-details-option-color-picker-content"},e("span",{class:"s-order-details-option-color-picker-text"},t.value),e("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:t.value,width:"1rem"}})),e("salla-button",{onClick:function(e){return s.copyToClipboard(e,t.value)},shape:"link",class:"s-order-details-option-color-picker-button"},e("span",{class:"s-order-details-option-color-copy-icon",innerHTML:p})))}if(t.is_map&&t.latitude&&t.longitude){return e("salla-map",{id:"location_map_".concat(t.id),class:"map_".concat(t.id),zoom:15,readonly:true,lat:t.latitude,lng:t.longitude},e("div",{slot:"button"},e("button",{type:"button",class:"s-order-details-option-map-button",onClick:function(){return s.openMap(t.id)}},"Show Location")))}return e("span",{class:"s-order-details-option-default-text"},t.display_value||t.value)};t.prototype.copyToClipboard=function(t,s){t.preventDefault();if(navigator.clipboard){navigator.clipboard.writeText(s)}};t.prototype.openMap=function(t){var s=document.querySelector("salla-map.map_".concat(t));if(s&&s.open){s.open()}};t.prototype.render=function(){var t=this;if(!this.optionsData.length){return null}var s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return e(i,{class:"s-order-details-options-wrapper"},e("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),e("div",{class:s},e("dl",{class:"s-order-details-options-list"},this.optionsData.map((function(s){return e("div",{key:s.id,class:"s-order-details-options-item"},e("dt",{class:"s-order-details-options-item-name"},s.name,":"),e("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},t.renderOptionValue(s)))})))))};return t}());v.style=b}}}));
5
- //# sourceMappingURL=p-2f351136.system.entry.js.map
4
+ System.register(["./p-CbJXYJ5O.system.js","./p-C2rVu_Jb.system.js"],(function(t){"use strict";var s,e,i,a,o,n,r;return{setters:[function(t){s=t.r;e=t.h;i=t.H;a=t.g;o=t.c},function(t){n=t.p;r=t.m}],execute:function(){var c="";var l=t("salla_accordion",function(){function t(t){s(this,t);this.collapsible=true;this.bordered=false;this.size="md";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 e(i,{key:"ed8e4c0f24fa4462654e94fa46706e892c141351",class:"s-accordion-wrapper ".concat(this.dir," ").concat(this.bordered?"s-accordion-wrapper-bordered":""," ").concat(this.size?"size-".concat(this.size):""),"data-collapsed":this.collapsed.toString()},e("slot",{key:"1dbda01c073f3018a55ebcf5d8613a82a5dc6b27"}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());l.style=c;var d="";var h=t("salla_accordion_body",function(){function t(t){s(this,t)}t.prototype.render=function(){return e(i,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},e("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))};return t}());h.style=d;var u="";var f=t("salla_accordion_head",function(){function t(t){s(this,t);this.accordionToggle=o(this,"accordionToggle");this.collapsible=false;this.collapsed=true}t.prototype.emitCollapsePanel=function(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})};t.prototype.toggleCollapse=function(){var t,s,e;if(!this.collapsible)return;this.collapsed=!this.collapsed;(t=this.host.parentElement)===null||t===void 0?void 0:t.setAttribute("data-collapsed",this.collapsed.toString());(e=(s=this.host.parentElement)===null||s===void 0?void 0:s.querySelector("salla-accordion-body"))===null||e===void 0?void 0:e.setAttribute("data-collapsed",this.collapsed.toString());this.emitCollapsePanel()};t.prototype.render=function(){var t=this;return e(i,{key:"9bb7ad4ad615f5316968b48839b2433619bd3850","data-collapsed":this.collapsed.toString(),onClick:function(){return t.toggleCollapse()},class:"s-accordion-head-wrapper"},e("div",{key:"6826492e1c552440d6407435dfe4e0ca3915cdf4",class:"s-accordion-head-wrapper-start"},e("slot",{key:"2c19c500b57444ac8f69c2f64616904a819f54da",name:"title"}),e("slot",{key:"a6ed0daccd969ec94128f5f749ccddfa9f62e5d3",name:"subtitle"}),e("slot",{key:"adc2122dce76eee34653bc3f47324188c89d80f1",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&e("div",{key:"f61363b6836fb857a0e832de99175936ec4bce29",class:"s-accordion-head-wrapper-end"},e("slot",{key:"15ee81e943714b30bfbaf718364f5d34b14617eb",name:"note"}),this.collapsible&&e("button",{key:"c5f8d32af544ddfba7b2fc2f273ae5b2e8cb7ae5",class:{"s-accordion-head-wrapper-toggle":true,active:!this.collapsed},onClick:function(s){s.stopPropagation();t.toggleCollapse()}},e("span",{key:"4c4e3fa6ddeda1a59f65ba47665a9203356037a6",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?n:r}))))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());f.style=u;var p='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n';var b="";var v=t("salla_order_details_options",function(){function t(t){s(this,t);this.bordered=true;this.placeholderImage="images/placeholder.png";this.optionsData=[]}t.prototype.componentWillLoad=function(){this.parseOptionsData()};t.prototype.componentWillUpdate=function(){this.parseOptionsData()};t.prototype.parseOptionsData=function(){if(!this.options){this.optionsData=[];return}if(typeof this.options==="string"){try{this.optionsData=JSON.parse(this.options)}catch(t){this.optionsData=[]}}else{this.optionsData=Array.isArray(this.options)?this.options:[]}};t.prototype.renderOptionValue=function(t){var s=this;if(t.is_image){return e("div",{class:"s-order-details-option-image-container"},e("a",{href:t.value,target:"_blank"},e("img",{class:"s-order-details-option-image",src:t.value||this.placeholderImage,alt:t.name})))}if(t.color){return e("span",{title:t.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:t.color}})}if(t.is_file){return e("a",{href:t.value,target:"_blank",class:"s-order-details-option-file-link"},"Attachments")}if(t.is_color_picker){return e("div",{class:"s-order-details-option-color-picker"},e("div",{class:"s-order-details-option-color-picker-content"},e("span",{class:"s-order-details-option-color-picker-text"},t.value),e("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:t.value,width:"1rem"}})),e("salla-button",{onClick:function(e){return s.copyToClipboard(e,t.value)},shape:"link",class:"s-order-details-option-color-picker-button"},e("span",{class:"s-order-details-option-color-copy-icon",innerHTML:p})))}if(t.is_map&&t.latitude&&t.longitude){return e("salla-map",{id:"location_map_".concat(t.id),class:"map_".concat(t.id),zoom:15,readonly:true,lat:t.latitude,lng:t.longitude},e("div",{slot:"button"},e("button",{type:"button",class:"s-order-details-option-map-button",onClick:function(){return s.openMap(t.id)}},"Show Location")))}return e("span",{class:"s-order-details-option-default-text"},t.display_value||t.value)};t.prototype.copyToClipboard=function(t,s){t.preventDefault();if(navigator.clipboard){navigator.clipboard.writeText(s)}};t.prototype.openMap=function(t){var s=document.querySelector("salla-map.map_".concat(t));if(s&&s.open){s.open()}};t.prototype.render=function(){var t=this;if(!this.optionsData.length){return null}var s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return e(i,{class:"s-order-details-options-wrapper"},e("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),e("div",{class:s},e("dl",{class:"s-order-details-options-list"},this.optionsData.map((function(s){return e("div",{key:s.id,class:"s-order-details-options-item"},e("dt",{class:"s-order-details-options-item-name"},s.name,":"),e("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},t.renderOptionValue(s)))})))))};return t}());v.style=b}}}));
5
+ //# sourceMappingURL=p-6bd9b65d.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as i,h as o,H as s,g as n}from"./p-6RnqFOTM.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
5
- //# sourceMappingURL=p-eb51e405.entry.js.map
4
+ import{r as t,c as i,h as o,H as s,g as n}from"./p-Cmh2bDlu.js";import{I as e}from"./p-uTyAzPSy.js";import{C as a}from"./p-C6jIkM-X.js";var l;(function(t){t["COLOR"]="color";t["DATE"]="date";t["DATETIME"]="datetime";t["DONATION"]="donation";t["IMAGE"]="image";t["MULTIPLE_OPTIONS"]="multiple-options";t["NUMBER"]="number";t["SINGLE_OPTION"]="single-option";t["DIGITAL_CARD_VALUE"]="digital-code-value";t["COUNTRY"]="country";t["SPLITTER"]="splitter";t["TEXT"]="text";t["TEXTAREA"]="textarea";t["THUMBNAIL"]="thumbnail";t["TIME"]="time";t["RADIO"]="radio";t["CHECKBOX"]="checkbox";t["MAP"]="map";t["FILE"]="file";t["COLOR_PICKER"]="color_picker";t["BOOKING"]="booking"})(l||(l={}));var r;(function(t){t["Sar"]="SAR"})(r||(r={}));var d=`\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>file-upload</title>\n<path d="M21.333 24c0.341 0 0.683-0.131 0.943-0.391 0.521-0.521 0.521-1.364 0-1.885l-5.333-5.333c-0.123-0.123-0.271-0.22-0.433-0.288-0.327-0.135-0.693-0.135-1.019 0-0.163 0.068-0.311 0.165-0.433 0.288l-5.333 5.333c-0.521 0.521-0.521 1.364 0 1.885s1.364 0.521 1.885 0l3.057-3.057v10.115c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-10.115l3.057 3.057c0.26 0.26 0.601 0.391 0.943 0.391zM28.943 9.724l-9.333-9.333c-0.249-0.251-0.589-0.391-0.943-0.391h-12c-2.205 0-4 1.795-4 4v24c0 2.205 1.795 4 4 4h4c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-4c-0.735 0-1.333-0.599-1.333-1.333v-24c0-0.735 0.599-1.333 1.333-1.333h11.448l8.552 8.552v16.781c0 0.735-0.599 1.333-1.333 1.333h-4c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h4c2.205 0 4-1.795 4-4v-17.333c0-0.353-0.14-0.693-0.391-0.943z"></path>\n</svg>\n`;const p="";const c=class{constructor(s){t(this,s);this.changed=i(this,"changed");this.fileTypes={pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",word:"application/doc,application/ms-doc,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",exl:"application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",txt:"text/plain"};this.outOfStockText="";this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ");this.isCustomDonation=false;this.selectedOptions=[];this.disableCardValue=true;this.availableDigitalCardValues=[];this.outSkus=[];this.ignoreDefaultCardValue=false;this.productId=salla.config.get("page.id");this.handleDonationOptions=(t,i,o)=>{if(i==="custom"&&o==="input"){salla.helpers.inputDigitsOnly(t.target);salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value});return}t.preventDefault();t.stopPropagation();this.isCustomDonation=t.target.value==="custom";if(this.donationInput){if(t.target.value==="custom"){this.donationInput.value="";this.donationInput.focus()}else{this.donationInput.value=t.target.value}if(i==="custom"){return}salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}};this.hideLabel=t=>{if(t.type===l.DONATION&&(t.donation&&!t.donation.can_donate)){return true}return false};this.getExpireDonationMessage=t=>{if(!t.donation){return}const i=t.donation.target_amount<=t.donation.collected_amount;return o("div",{class:{"s-product-options-donation-message":true,"s-product-options-donation-completed":i,"s-product-options-donation-expired":!i}},o("p",null,t.donation.target_message),o("span",{innerHTML:i?salla.money(t.donation.target_amount):""}))};this.canDisabled=!salla.config.get("store.settings.product.notify_options_availability")||salla.url.is_page("cart");salla.lang.onLoaded((()=>{this.outOfStockText=salla.lang.get("pages.products.out_of_stock");this.donationAmount=salla.lang.get("pages.products.donation_amount");this.selectDonationAmount=salla.lang.getWithDefault("pages.products.select_donation_amount","تحديد مبلغ التبرع");this.selectAmount=salla.lang.getWithDefault("pages.products.select_amount","اختر المبلغ")}));if(this.options){try{this.setOptionsData(Array.isArray(this.options)?this.options:JSON.parse(this.options));return}catch(t){salla.log("Bad json passed via options prop")}}if(!Array.isArray(this.optionsData)){salla.log("Options is not an array[] ---\x3e ",this.optionsData);this.setOptionsData([])}if(this.productId&&!salla.url.is_page("cart")){salla.api.product.getDetails(this.productId,["options"]).then((t=>this.setOptionsData(t.data.options)))}}async setOptionsData(t){var i,o;this.optionsData=t;const s=this;(o=(i=this.optionsData[0])===null||i===void 0?void 0:i.details)===null||o===void 0?void 0:o.forEach((function(t){Object.entries(t.skus_availability||{}).filter((t=>!t[1])).map((t=>s.outSkus.push(Number(t[0]))))}))}async getSelectedOptionsData(){const t={};const i=this.host.getElementSallaData();i.forEach(((i,o)=>{if(o.startsWith("options[")){t[o.replace("options[","").replace("]","")]=i}}));return t}async reportValidity(){const t=this.host.querySelectorAll("[required]");let i=true;for(let o=0;o<t.length;o++){if("reportValidity"in t[o]&&!t[o].reportValidity()){i=false}}return i}async hasOutOfStockOption(){var t,i;return this.selectedOptions.some((t=>t.is_out))||((t=this.selectedSkus)===null||t===void 0?void 0:t.length)&&((i=this.selectedSkus)===null||i===void 0?void 0:i.every((t=>this.outSkus.includes(t))))}async getSelectedOptions(){return this.selectedOptions}async getOption(t){return this.optionsData.find((i=>i.id===t))}invalidHandler(t,i){const o=t.target.closest(".s-product-options-option");if(!o.classList.contains("s-product-options-option-error")){o.classList.add("s-product-options-option-error")}if(!salla.url.is_page("cart")){const t=this.host.querySelector(".s-product-options-option-error");if(t===o){this.scrollToElement(o)}}}scrollToElement(t){if(t){t.scrollIntoView({behavior:"smooth",block:"center"})}}changedHandler(t,i,o=true){const s={event:t,option:i,detail:null,productId:this.productId};if(i.details){const o=i.details.find((i=>Number(i.id)===Number(t.target.value)));s.detail=o}if(i.type==="country"){this.handleCountryOptionChange(t,s.detail)}const n=t.target.closest(".s-product-options-option");if(t.target.value||(i.type===l.FILE||i.type===l.IMAGE)&&t.type==="added"||i.type===l.MAP&&t.type==="selected"&&(t.target.lat&&t.target.lng)){setTimeout((()=>{n.classList.remove("s-product-options-option-error")}),200)}if(i.type===l.DONATION){salla.event.emit("product-options::donation-changed",{id:this.productId,price:t.target.value})}this.setSelectedSkus();this.handleRequiredMultipleOptions(i);const e=this.selectedOptions.findIndex((t=>t.option_id===s.option.id));if(s.option.type===l.MULTIPLE_OPTIONS){const t=this.selectedOptions.findIndex((t=>{var i;return t.option_id===s.option.id&&(t===null||t===void 0?void 0:t.id)===((i=s.detail)===null||i===void 0?void 0:i.id)}));if(t>-1){this.selectedOptions.splice(t,1)}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}else{if(!s.detail||Object.keys(s.detail).length===0){if(e>-1){this.selectedOptions.splice(e,1)}}else{if(e>-1){this.selectedOptions[e]=Object.assign(Object.assign({},s.detail),{option_id:s.option.id})}else{this.selectedOptions.push(Object.assign(Object.assign({},s.detail),{option_id:s.option.id}))}}}this.optionsData=this.optionsData.map((t=>{if(t.id===s.option.id){return Object.assign(Object.assign({},t),{details:t.details.map((t=>{var i,o;return Object.assign(Object.assign({},t),{is_selected:s.option.type===l.MULTIPLE_OPTIONS?this.selectedOptions.some((i=>i.id===t.id)):Number(t.id)===Number((i=s.detail)===null||i===void 0?void 0:i.id),value:(o=s.detail)===null||o===void 0?void 0:o.value})}))})}return t}));if(o){this.changed.emit(s);salla.event.emit("product-options::change",s)}}setSelectedSkus(){this.selectedSkus=this.selectedOptions.map((t=>Object.keys(t.skus_availability||{}))).reduce(((t,i)=>t.filter((t=>i.includes(t)))),[]).map((t=>Number(t)))}handleRequiredMultipleOptions(t){if(t.type!==l.MULTIPLE_OPTIONS||!t.required){return}const i=this.host.querySelector(`[data-option-id="${t.id}"]`);const o=i.querySelectorAll("input:checked").length;i.querySelectorAll("input").forEach((t=>t.toggleAttribute("required",!o)))}getLatLng(t,i){return t?t.split(",")[i==="lat"?0:1]:""}getDisplayForType(t){if(this[`${t.type}Option`]){return this[`${t.type}Option`](t)}if(t.type===l.COLOR_PICKER){return this.colorPickerOption(t)}if(t.type===l.MULTIPLE_OPTIONS){return this.multipleOptions(t)}if(t.type===l.SINGLE_OPTION){return this.singleOption(t)}if(t.type===l.DIGITAL_CARD_VALUE){return this.digitalCardValuesOption(t)}if(t.type===l.COUNTRY){return this.countryOption(t)}if(t.type===l.BOOKING&&salla.url.is_page("cart")){return o("salla-booking-field",{onInvalidInput:i=>this.invalidHandler(i,t),option:t,productId:t.value})}salla.log(`Couldn't find options type(${t.type})😢`);return""}getOptionShownWhen(t){return t.visibility_condition?{"data-show-when":`options[${t.visibility_condition.option}] ${t.visibility_condition.operator} ${t.visibility_condition.value}`}:{}}getAvailableDigitalCardSKUs(t){const i=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!i)throw new Error("product-options:: No digital card options found");const o=Object.keys(t.skus_availability).filter((i=>t.skus_availability[i]===false));this.availableDigitalCardValues=i.details.filter((t=>!Object.keys(t.skus_availability).filter((t=>o.includes(t))).length))}handleCountryOptionChange(t,i){t.stopImmediatePropagation();this.ignoreDefaultCardValue=true;const o=this.host.querySelector("input[data-code-value]:checked");if(o)o.checked=false;const s=this.optionsData.find((({type:t})=>t==="digital-code-value"));if(!s)throw new Error("product-options:: No digital card options found");this.getAvailableDigitalCardSKUs(i)}getSelectedDigitalCardOptions(t){const i=t.details.find((t=>t.is_selected));const o=t.details.find((t=>!!t.is_default))||t.details[0];if(!["digital-code-value","country"].includes(t.type))return;return i||o}async componentWillLoad(){if(salla.url.is_page("cart")){this.disableCardValue=false;this.fillSelectedOptions()}if(this.config){try{this.optionConfig=typeof this.config==="string"?JSON.parse(this.config):this.config}catch(t){console.error("Failed to parse JSON in config prop:",t)}}const t=this.optionsData.filter((({type:t})=>["country","digital-card-value"].includes(t))).length>0&&salla.url.is_page("cart");if(t){const t=this.optionsData.find((t=>t.type==="country"));const i=t&&this.getSelectedDigitalCardOptions(t);if(i){this.getAvailableDigitalCardSKUs(i)}}this.outOfStockText=salla.lang.get("pages.products.out_of_stock");await salla.onReady();document.addEventListener("paste",this.handlePaste.bind(this));const i=!salla.storage.get("cart.id")&&this.optionsData.some((t=>["file","image"].includes(t.type)));return i?salla.api.cart.getCurrentCartId(false,"salla-product-options"):null}handlePaste(t){var i;const o=t.target;if(!Salla.config.get("store.settings.content_copyright")||!Salla.helpers.hasApplePay()||!(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)||!o.classList.contains("s-form-control")||!o.name.startsWith("options[")){return}t.preventDefault();const s=((i=t.clipboardData)===null||i===void 0?void 0:i.getData("text"))||"";const n=o.selectionStart;const e=o.selectionEnd;const a=o.value.slice(0,n)+s+o.value.slice(e);o.value=a;o.setSelectionRange(n+s.length,n+s.length)}hideDigitalCardsOptions(t){return this.disableCardValue&&t.type===l.DIGITAL_CARD_VALUE&&!salla.url.is_page("cart")}render(){var t;if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0){return}return o(s,{class:"s-product-options-wrapper"},o("salla-conditional-fields",null,this.optionsData.map((t=>o("div",Object.assign({key:t.id,class:`s-product-options-option-container${t.visibility_condition||this.hideDigitalCardsOptions(t)?" hidden":""}`,"data-option-id":t.id},this.getOptionShownWhen(t)),t.name==="splitter"?this.splitterOption():o("div",{class:{"s-product-options-option":true,"s-product-options-option-booking":t.type===l.BOOKING&&salla.url.is_page("cart")},"data-option-type":t.type,"data-option-required":`${t.required}`},o("label",{htmlFor:`options[${t.id}]`,class:`s-product-options-option-label ${this.hideLabel(t)?"s-product-options-option-label-hidden":""}`},o("b",null,t.name,t.required&&o("span",null," * ")," "),o("small",null,t.placeholder)),o("div",{class:`s-product-options-option-content ${this.hideLabel(t)||t.type===l.BOOKING&&salla.url.is_page("cart")?"s-product-options-option-content-full-width":""}`},this.getDisplayForType(t))))))))}generateUniqueKey(t){return this.uniqueKey?`${t}-${this.uniqueKey}`:t}fillSelectedOptions(){this.selectedOptions=this.optionsData.reduce(((t,i)=>{const o=i.details.filter((t=>t.is_selected));const s=o.map((t=>Object.assign(Object.assign({},t),{option_id:i.id})));return t.concat(s)}),[])}triggerProductFormSelectionEvents(){const t=t=>["change","input"].forEach((i=>t.dispatchEvent(new window.Event(i,{bubbles:true}))));const i=this.host.closest("form");if(i){t(i)}else{const i=new MutationObserver((()=>{const o=this.host.closest("form");if(o){t(o);i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true})}}componentDidLoad(){var t,i;if(salla.url.is_page("product.single")){this.triggerProductFormSelectionEvents()}if(((t=this.optionsData)===null||t===void 0?void 0:t.length)===0&&!this.optionsData.some((t=>t.type===l.DONATION))){return}const o=(i=this.optionsData.find((t=>t.type===l.DONATION)))===null||i===void 0?void 0:i.details.find((t=>t.is_selected));if(!o){return}setTimeout((()=>{salla.event.emit("product-options::donation-changed",{id:this.productId,price:o.additional_price})}),1e3)}donationOption(t,i){var s,n;return o("div",{class:"s-product-options-donation-wrapper"},((s=t.donation)===null||s===void 0?void 0:s.can_donate)?[t.donation?o("div",{key:t.id,class:"s-product-options-donation-progress"},o("salla-progress-bar",{donation:t.donation})):"",t.details.length?[o("h4",{key:t.id},this.selectAmount),o("div",{key:t.id,class:"s-product-options-donation-options"},t.details.map(((i,s)=>o("div",{key:t.id,class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey(`donation-option-${s}`),type:"radio",name:"donating_option",checked:i.is_selected,value:i.additional_price,onChange:t=>this.handleDonationOptions(t,i,"option")}),o("label",{htmlFor:this.generateUniqueKey(`donation-option-${s}`)},o("span",{innerHTML:salla.money(i.name)}))))),((n=t.donation)===null||n===void 0?void 0:n.custom_amount_enabled)?o("div",{class:"s-product-options-donation-options-item"},o("input",{id:this.generateUniqueKey("donation-option-custom"),type:"radio",name:"donating_option",value:"custom",onChange:t=>this.handleDonationOptions(t,"custom","option")}),o("label",{htmlFor:this.generateUniqueKey("donation-option-custom")},o("span",null," ",this.selectDonationAmount," "))):"")]:"",o("div",{key:t.id,class:{"s-product-options-donation-input-group":true,shown:!t.details.length||t.details.length&&this.isCustomDonation}},o("input",{type:"text",id:"donating-amount",name:"donation_amount",class:"s-form-control",ref:t=>{this.donationInput=t},value:t.details.length&&t.details.some((t=>t.is_selected))?t.details.find((t=>t.is_selected)).additional_price:t.value,placeholder:t.placeholder,onInput:t=>this.handleDonationOptions(t,"custom","input"),onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t)}),o("span",{class:"s-product-options-donation-amount-currency"},salla.config.currency(salla.config.get("user.currency_code")).symbol))]:this.getExpireDonationMessage(t))}fileUploader(t,i=null){var s;return o("salla-file-upload",Object.assign({},i||{},{"payload-name":"file",value:t.value,"instant-upload":true,name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,height:"120px",onAdded:i=>this.changedHandler(i,t),url:salla.cart.api.getUploadImageEndpoint(),"form-data":{cart_item_id:this.productId,product_id:this.productId},onInvalidInput:i=>this.invalidHandler(i,t),class:{"s-product-options-image-input":true,required:t.required}}),o("div",{class:"s-product-options-filepond-placeholder"},o("span",{class:"s-product-options-filepond-placeholder-icon",innerHTML:((s=i.accept)===null||s===void 0?void 0:s.split(",").every((t=>t.includes("image"))))?a:d}),o("p",{class:"s-product-options-filepond-placeholder-text"},salla.lang.get("common.uploader.drag_and_drop")),o("span",{class:"filepond--label-action"},salla.lang.get("common.uploader.browse"))))}imageOption(t){return this.fileUploader(t,{accept:"image/png,image/jpeg,image/jpg,image/gif"})}fileOption(t){const i=t.details.map((t=>this.fileTypes[t.name])).filter(Boolean);return(i===null||i===void 0?void 0:i.length)?this.fileUploader(t,{accept:i.join(",")}):"File types not selected."}numberOption(t){return o("input",{type:"text",value:t.value,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onBlur:i=>this.changedHandler(i,t),onInvalid:i=>this.invalidHandler(i,t),onInput:t=>salla.helpers.inputDigitsOnly(t.target)})}splitterOption(){return o("div",{class:"s-product-options-splitter"})}textOption(t){return o("div",{class:"s-product-options-text"},o("input",{type:"text",value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}))}textareaOption(t){return o("div",{class:"s-product-options-textarea"},o("div",{class:"mt-1"},o("textarea",{rows:4,value:t.value,maxLength:t===null||t===void 0?void 0:t.length,class:"s-form-control",required:!t.visibility_condition&&t.required,id:`options[${t.id}]`,name:`options[${t.id}]`,placeholder:t.placeholder,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)})))}mapOption(t){return o("salla-map",{zoom:15,lat:this.getLatLng(t.value,"lat"),lng:this.getLatLng(t.value,"lng"),name:`options[${t.id}]`,searchable:true,required:t.required,onInvalidInput:i=>this.invalidHandler(i,t),onSelected:i=>this.changedHandler(i,t)})}colorPickerOption(t){return o("salla-color-picker",{onSubmitted:i=>this.changedHandler(i,t),name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,onInvalidInput:i=>this.invalidHandler(i,t),color:t.value})}timeOption(t){return o("salla-datetime-picker",{noCalendar:true,enableTime:true,dateFormat:"h:i K",value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,class:"s-product-options-time-element",onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)})}dateOption(t){return o("div",{class:"s-product-options-date-element"},o("salla-datetime-picker",{value:t.value,placeholder:t.name,required:!t.visibility_condition&&t.required,minDate:new Date,name:`options[${t.id}]`,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}datetimeOption(t){return o("div",{class:"s-product-options-datetime-element"},o("salla-datetime-picker",{enableTime:true,value:t.value,dateFormat:"Y-m-d G:i:K",placeholder:t.name,required:!t.visibility_condition&&t.required,name:`options[${t.id}]`,maxDate:t.to_date_time,minDate:t.from_date_time,onInvalidInput:i=>this.invalidHandler(i,t),onPicked:i=>this.changedHandler(i,t)}))}getOptionDetailName(t,i=true,o){var s;let n;if(o&&o===l.COLOR){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` <br/> <p> ${this.outOfStockText} </p>`:"")+(t.additional_price?` <p> (${salla.money(t.additional_price,false)}) </p>`:"")}if(!n){n=t.name+(i&&this.isOptionDetailOut(t)&&!salla.url.is_page("cart")&&!this.hideOutLabel?` - ${this.outOfStockText}`:"")+(t.additional_price?` (${salla.money(t.additional_price,false)})`:"")}return n.replace("<i class=sicon-sar></i>",((s=salla.config.currency())===null||s===void 0?void 0:s.symbol)||"ر.س")}isOptionDetailOut(t){var i;if(t.is_out||!t.skus_availability||!((i=this.selectedSkus)===null||i===void 0?void 0:i.length)){return t.is_out}const o=this.selectedOptions.filter((i=>i.id===t.id)).length;if(o&&this.selectedOptions.length===1){return false}if(o){const i=this.selectedSkus.filter((t=>this.outSkus.includes(t)));return Object.keys(t.skus_availability).some((t=>i.includes(Number(t))))}return this.selectedOptions.some((i=>i.is_out&&i.option_id!==t.option_id))}renderInput(t,i,s,n,e,a){const l=this.generateUniqueKey(`${t}-${s.id}-${i.id}`);const r=this.isOptionDetailOut(i);return o("label",{class:{"s-product-options-disabled":r}},o("input",{id:l,type:t,name:e,value:i.id,disabled:r,required:n,checked:i.is_selected,onInvalid:t=>this.invalidHandler(t,s),onChange:t=>this.changedHandler(t,s)}),o("div",{class:{"s-product-options-grid-mode-span":a,"s-product-options-disabled":r}},this.getOptionDetailName(i)))}renderOptionDetails(t,i,o,s=false){const n=t==="radio"?`options[${i.id}]`:`options[${i.id}][]`;return i===null||i===void 0?void 0:i.details.map((e=>this.renderInput(t,e,i,o,n,s)))}renderSelect(t){return o("div",null,o("select",{name:`options[${t.id}]`,required:!t.visibility_condition&&t.required,class:"s-form-control",onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)},o("option",{value:""},t.placeholder),t===null||t===void 0?void 0:t.details.map((t=>o("option",{key:t.id,value:t.id,disabled:this.canDisabled&&this.isOptionDetailOut(t),selected:t.is_selected},this.getOptionDetailName(t))))))}renderButtonStyle(t,i,s){return o("div",{class:"s-product-options-grid-mode"},this.renderOptionDetails(t,i,s,true))}singleOption(t){var i,o;const s=((o=(i=this.optionConfig)===null||i===void 0?void 0:i["single-option"])===null||o===void 0?void 0:o.type)==="button";const n=!t.visibility_condition&&t.required;return s?this.renderButtonStyle("radio",t,n):this.renderSelect(t)}multipleOptions(t){var i,s;const n=((s=(i=this.optionConfig)===null||i===void 0?void 0:i["multiple-option"])===null||s===void 0?void 0:s.type)==="button";const e=t.required&&!t.details.some((t=>t.is_selected))&&!t.visibility_condition;return n?this.renderButtonStyle("checkbox",t,e):o("div",{class:{"s-product-options-multiple-options-wrapper":true,required:t.required}},this.renderOptionDetails("checkbox",t,e))}colorOption(t){return o("fieldset",{class:"s-product-options-colors-wrapper"},t===null||t===void 0?void 0:t.details.map((i=>o("div",{class:"s-product-options-colors-item",key:i.id},o("input",{type:"radio",value:i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`color-${this.productId}-${t.id}-${i.id}`)},o("span",{style:{backgroundColor:i.color}}),o("div",{innerHTML:this.getOptionDetailName(i,true,t.type)}))))))}thumbnailOption(t){return o("div",{class:"s-product-options-thumbnails-wrapper"},t.details.map((i=>o("div",{key:i.id},o("input",{type:"radio",value:i.id,"data-itemid":i.id,required:!t.visibility_condition&&t.required,checked:i.is_selected,name:`options[${t.id}]`,"data-img-id":i.option_value,disabled:this.canDisabled&&this.isOptionDetailOut(i),id:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t)}),o("label",{htmlFor:this.generateUniqueKey(`option_${this.productId}-${t.id}_${i.id}`),"data-img-id":i.option_value,class:"go-to-slide"},o("img",{"data-src":i.image,src:i.image,title:i.name,alt:i.name}),o("span",{innerHTML:e,class:"s-product-options-thumbnails-icon"}),this.isOptionDetailOut(i)?[o("small",{key:i.id,class:"s-product-options-thumbnails-stock-badge"},this.outOfStockText),this.canDisabled?o("div",{key:i.id,class:"s-product-options-thumbnails-badge-overlay"}):""]:""),o("p",null,this.getOptionDetailName(i,false)," ")))))}digitalCardValuesOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},this.availableDigitalCardValues.length>0?this.availableDigitalCardValues.map((i=>{var s,n,e;const a=String(i.id);return o("label",{htmlFor:this.generateUniqueKey(a.toString()),key:a,class:"s-product-options-digital-card-option"},o("input",Object.assign({type:"radio","data-code-value":true,class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,id:this.generateUniqueKey(a.toString()),required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t)},!this.ignoreDefaultCardValue?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("span",null,i.name," ",(e=(n=salla.config)===null||n===void 0?void 0:n.currency())===null||e===void 0?void 0:e.symbol))})):o("div",{class:"s-product-options-digital-card-out-of-stock"}))}countryOption(t){return o("div",{class:"s-product-options-digital-card-wrapper"},t.details.map((i=>{var s;return o("label",{htmlFor:this.generateUniqueKey(i.id.toString()),key:i.id,class:{"s-product-options-digital-card-option":true,"s-product-options-digital-card-option-stock-out":i.is_out}},o("input",Object.assign({id:this.generateUniqueKey(i.id.toString()),type:"radio",class:"s-form-control s-product-options-digital-card-input",value:i.id,name:`options[${t.id}]`,disabled:i.is_out,required:!t.visibility_condition&&t.required,onInvalid:i=>this.invalidHandler(i,t),onChange:i=>this.changedHandler(i,t),onClick:()=>{this.disableCardValue=false}},salla.url.is_page("cart")?{defaultChecked:((s=this.getSelectedDigitalCardOptions(t))===null||s===void 0?void 0:s.id)===i.id}:{})),o("img",{loading:"lazy",alt:i.code,height:24,width:24,class:"s-product-options-country-flag",src:`https://cdn.assets.salla.network/prod/admin/cp/assets/flags/1x1/${String(i.code).toLocaleLowerCase()}.svg`}),o("span",null,i.name))})))}get host(){return n(this)}};c.style=p;export{c as salla_product_options};
5
+ //# sourceMappingURL=p-6c2ffbdb.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- System.register(["./p-DiAHk-lZ.system.js"],(function(t){"use strict";var s,n,a,i;return{setters:[function(t){s=t.r;n=t.h;a=t.H;i=t.g}],execute:function(){var r=":host{display:block}";var e=t("salla_apps_icons",function(){function t(t){var n=this;s(this,t);var a;this.apps=salla.config.get("store.apps");this.appSlot=((a=this.host.querySelector('[slot="app"]'))===null||a===void 0?void 0:a.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){n.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){n.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}t.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(t){var s=t[0],n=t[1];return{name:s,value:n}}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return n(a,{class:"s-apps-icons"},!this.hideTitle&&n("h3",null,this.appsTitle),n("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,a){return n("a",{key:a,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:t.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());e.style=r}}}));
5
- //# sourceMappingURL=p-c62f9443.system.entry.js.map
4
+ System.register(["./p-CbJXYJ5O.system.js"],(function(t){"use strict";var s,n,a,i;return{setters:[function(t){s=t.r;n=t.h;a=t.H;i=t.g}],execute:function(){var r=":host{display:block}";var e=t("salla_apps_icons",function(){function t(t){var n=this;s(this,t);var a;this.apps=salla.config.get("store.apps");this.appSlot=((a=this.host.querySelector('[slot="app"]'))===null||a===void 0?void 0:a.innerHTML)||"<img alt={name} src={icon} />";salla.onReady((function(){n.apps=salla.config.get("store.apps")}));salla.lang.onLoaded((function(){n.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}t.prototype.getAppsArray=function(){return Object.entries(this.apps).map((function(t){var s=t[0],n=t[1];return{name:s,value:n}}))};t.prototype.componentWillLoad=function(){return new Promise((function(t){return salla.onReady(t)}))};t.prototype.render=function(){var t=this;var s=this.getAppsArray();if(Array.isArray(s)&&!s.length){return}return n(a,{class:"s-apps-icons"},!this.hideTitle&&n("h3",null,this.appsTitle),n("div",{class:{"s-apps-icons-list":true,vertical:this.vertical}},s.map((function(s,a){return n("a",{key:a,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:t.appSlot.replace(/\{icon\}/g,salla.url.cdn("images/".concat(s.name,".png"))).replace(/\{name\}/g,s.name)})}))))};t.prototype.componentDidRender=function(){var t;(t=this.host.querySelector('[slot="app"]'))===null||t===void 0?void 0:t.remove()};Object.defineProperty(t.prototype,"host",{get:function(){return i(this)},enumerable:false,configurable:true});return t}());e.style=r}}}));
5
+ //# sourceMappingURL=p-6ef02abc.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as e,h as i,H as s}from"./p-6RnqFOTM.js";const a="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";const c=class{constructor(i){t(this,i);this.prizeItemSelected=e(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return i(s,{key:"5ca09a4202a344b0483bdfec61051430c6804143"},i("div",{key:"685bab3cdebcc0ebb8899bf41af4864dc613835b",onClick:this.onPrizeItemClick.bind(this)},i("img",{key:"412d27faaf4fdb3df213806613ce0ce362f86f63",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),i("div",{key:"9de2b85059c3db4cf750303e549938a577995d92",class:"s-loyalty-prize-item-title"},this.item.name),i("div",{key:"9ecf6845d0edf53937476a8bebfc36372ab1b4d9",class:"s-loyalty-prize-item-subtitle"},this.item.description),i("div",{key:"0c5f1cd8d22bc90178063c06eaf32bbac9f167ff",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};c.style=a;export{c as salla_loyalty_prize_item};
5
- //# sourceMappingURL=p-37b98407.entry.js.map
4
+ import{r as t,c as e,h as i,H as s}from"./p-Cmh2bDlu.js";const a="salla-loyalty-prize-item:hover{-webkit-box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important;box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";const c=class{constructor(i){t(this,i);this.prizeItemSelected=e(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return i(s,{key:"5ca09a4202a344b0483bdfec61051430c6804143"},i("div",{key:"685bab3cdebcc0ebb8899bf41af4864dc613835b",onClick:this.onPrizeItemClick.bind(this)},i("img",{key:"412d27faaf4fdb3df213806613ce0ce362f86f63",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),i("div",{key:"9de2b85059c3db4cf750303e549938a577995d92",class:"s-loyalty-prize-item-title"},this.item.name),i("div",{key:"9ecf6845d0edf53937476a8bebfc36372ab1b4d9",class:"s-loyalty-prize-item-subtitle"},this.item.description),i("div",{key:"0c5f1cd8d22bc90178063c06eaf32bbac9f167ff",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};c.style=a;export{c as salla_loyalty_prize_item};
5
+ //# sourceMappingURL=p-6fd8031a.entry.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as i,g as s}from"./p-6RnqFOTM.js";import{H as n}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o="";const a=class{constructor(i){t(this,i);this.itemPerPage=10;this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more");salla.lang.onLoaded((()=>{this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=true){var i;let s=(i=this.status)===null||i===void 0?void 0:i.querySelector(".s-button-text");if(s){n.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t));this.btnLoader.style.display=t?"inherit":"none"}}getNotificationCard(t){const i=document.createElement("salla-notification-item");i.notification=t;i.classList.add("s-block");return i}render(){var t;if(this.showPlaceholder){return i("div",{class:"s-notifications-no-content"},i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.no_notifications_trans)))}return i("div",{class:"s-notifications-wrapper"},i("div",{class:"s-notifications-container",ref:t=>this.wrapper=t}),this.nextPage&&i("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},(t=this.loadMoreText)!==null&&t!==void 0?t:this.load_more_text_trans),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}handleResponse(t){return t.map((t=>this.getNotificationCard(t)))}initiateInfiniteScroll(){var t,i,s;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:true,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(t=>{this.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(t=>{var i;this.loading(false);this.pagination=t.pagination;this.nextPage=((i=t.pagination.links)===null||i===void 0?void 0:i.next)||null;this.handleResponse(t.data).forEach((t=>this.wrapper.append(t)));let s=this.host.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)}));(s=this.infiniteScroll)===null||s===void 0?void 0:s.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadInitialData(){await salla.api.notifications.fetch({per_page:this.itemPerPage}).then((t=>{var i;this.pagination=t.pagination;this.total=t.pagination.total;this.nextPage=((i=t.pagination.links)===null||i===void 0?void 0:i.next)||null;setTimeout((()=>{if(!t.data.length){return this.showPlaceholder=true}this.handleResponse(t.data).forEach((t=>this.wrapper.append(t)));this.initiateInfiniteScroll();let i=this.wrapper.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(i)}),100)})).catch((t=>{salla.logger.error(t);this.showPlaceholder=true;this.loading(false)}))}async loadMore(){var t;(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}async componentWillLoad(){await this.loadInitialData()}get host(){return s(this)}};a.style=o;export{a as salla_notifications};
5
- //# sourceMappingURL=p-7824e441.entry.js.map
4
+ import{r as t,h as i,g as s}from"./p-Cmh2bDlu.js";import{H as n}from"./p-CGaH6V1S.js";import"./p-CgtvEd63.js";const o="";const a=class{constructor(i){t(this,i);this.itemPerPage=10;this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more");salla.lang.onLoaded((()=>{this.no_notifications_trans=salla.lang.get("blocks.header.no_notifications");this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=true){var i;let s=(i=this.status)===null||i===void 0?void 0:i.querySelector(".s-button-text");if(s){n.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t));this.btnLoader.style.display=t?"inherit":"none"}}getNotificationCard(t){const i=document.createElement("salla-notification-item");i.notification=t;i.classList.add("s-block");return i}render(){var t;if(this.showPlaceholder){return i("div",{class:"s-notifications-no-content"},i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.no_notifications_trans)))}return i("div",{class:"s-notifications-wrapper"},i("div",{class:"s-notifications-container",ref:t=>this.wrapper=t}),this.nextPage&&i("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},(t=this.loadMoreText)!==null&&t!==void 0?t:this.load_more_text_trans),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}handleResponse(t){return t.map((t=>this.getNotificationCard(t)))}initiateInfiniteScroll(){var t,i,s;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:true,nextPage:this.nextPage,scrollThreshold:false},true);(t=this.infiniteScroll)===null||t===void 0?void 0:t.on("request",(t=>{this.loading()}));(i=this.infiniteScroll)===null||i===void 0?void 0:i.on("load",(t=>{var i;this.loading(false);this.pagination=t.pagination;this.nextPage=((i=t.pagination.links)===null||i===void 0?void 0:i.next)||null;this.handleResponse(t.data).forEach((t=>this.wrapper.append(t)));let s=this.host.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(s)}));(s=this.infiniteScroll)===null||s===void 0?void 0:s.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))}async loadInitialData(){await salla.api.notifications.fetch({per_page:this.itemPerPage}).then((t=>{var i;this.pagination=t.pagination;this.total=t.pagination.total;this.nextPage=((i=t.pagination.links)===null||i===void 0?void 0:i.next)||null;setTimeout((()=>{if(!t.data.length){return this.showPlaceholder=true}this.handleResponse(t.data).forEach((t=>this.wrapper.append(t)));this.initiateInfiniteScroll();let i=this.wrapper.querySelectorAll("salla-notification-item:not(.animated)");n.animateItems(i)}),100)})).catch((t=>{salla.logger.error(t);this.showPlaceholder=true;this.loading(false)}))}async loadMore(){var t;(t=this.infiniteScroll)===null||t===void 0?void 0:t.loadNextPage()}async componentWillLoad(){await this.loadInitialData()}get host(){return s(this)}};a.style=o;export{a as salla_notifications};
5
+ //# sourceMappingURL=p-72a5b284.entry.js.map
@@ -1,5 +1,5 @@
1
- var __awaiter=this&&this.__awaiter||function(t,r,e,n){function s(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function i(t){try{l(n["throw"](t))}catch(t){o(t)}}function l(t){t.done?e(t.value):s(t.value).then(a,i)}l((n=n.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(t){return function(r){return l([t,r])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,i[0]&&(e=0)),e)try{if(n=1,s&&(o=i[0]&2?s["return"]:i[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,i[1])).done)return o;if(s=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:e.label++;return{value:i[1],done:false};case 5:e.label++;s=i[1];i=[0];continue;case 7:i=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){e.label=i[1];break}if(i[0]===6&&e.label<o[1]){e.label=o[1];o=i;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(i);break}if(o[2])e.ops.pop();e.trys.pop();continue}i=r.call(t,e)}catch(t){i=[6,t];s=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};
1
+ var __awaiter=this&&this.__awaiter||function(t,r,e,n){function s(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function i(t){try{u(n["throw"](t))}catch(t){o(t)}}function u(t){t.done?e(t.value):s(t.value).then(a,i)}u((n=n.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,s,o,a;return a={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function i(t){return function(r){return u([t,r])}}function u(i){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,i[0]&&(e=0)),e)try{if(n=1,s&&(o=i[0]&2?s["return"]:i[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,i[1])).done)return o;if(s=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:e.label++;return{value:i[1],done:false};case 5:e.label++;s=i[1];i=[0];continue;case 7:i=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){e.label=i[1];break}if(i[0]===6&&e.label<o[1]){e.label=o[1];o=i;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(i);break}if(o[2])e.ops.pop();e.trys.pop();continue}i=r.call(t,e)}catch(t){i=[6,t];s=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-DiAHk-lZ.system.js","./p-CzwwMHuN.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var r,e,n,s;return{setters:[function(t){r=t.r;e=t.h;n=t.g},function(t){s=t.H},null],execute:function(){var o=":host{display:block}";var a=t("salla_orders",function(){function t(t){var e=this;r(this,t);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((function(){e.languageCode=salla.lang.locale;e.orderNumberText=salla.lang.get("pages.thank_you.order_id");e.totalOrderText=salla.lang.get("pages.orders.total");e.orderDateText=salla.lang.get("pages.orders.date");e.orderStatusText=salla.lang.get("pages.orders.status");e.noOrderText=salla.lang.get("pages.orders.non_orders");e.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var r;var e=(r=this.status)===null||r===void 0?void 0:r.querySelector(".s-button-text");if(e){s.toggleElementClassIf(e,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.initiateInfiniteScroll=function(){var t=this;var r,e,n;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:function(){return t.nextPage},history:false,nextPage:this.nextPage,scrollThreshold:false},true);(r=this.infiniteScroll)===null||r===void 0?void 0:r.on("request",(function(r){t.loading()}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(r){var e,n;t.loading(false);t.pagination=r.pagination;t.nextPage=((n=(e=r.pagination)===null||e===void 0?void 0:e.links)===null||n===void 0?void 0:n.next)||null;t.handleResponse(r.data).forEach((function(r){t.wrapper.append(r)}));var o=t.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");s.animateItems(o)}));(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.infiniteScroll.loadNextPage();return[2]}))}))};t.prototype.handleResponse=function(t){var r=this;return t.map((function(t){return r.getSingleOrderItem(t)}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t;var r=this;return __generator(this,(function(e){switch(e.label){case 0:t=new URL(window.location.href);return[4,salla.order.api.fetch(Object.assign(Object.assign({},this.params),{types:[""],feedback_status:t.searchParams.get("feedback_status")})).then((function(t){var e,n,o,a;r.orders=t.data;r.hasInfiniteScroll=!!((e=t.pagination)===null||e===void 0?void 0:e.links.next);r.pagination=t.pagination;r.total=(n=t.pagination)===null||n===void 0?void 0:n.total;r.nextPage=((a=(o=t.pagination)===null||o===void 0?void 0:o.links)===null||a===void 0?void 0:a.next)||null;if(!r.orders.length){r.showPlaceholder=true;return r.loading(false)}setTimeout((function(){r.handleResponse(t.data).forEach((function(t){r.wrapper.append(t)}));r.initiateInfiniteScroll();var e=r.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");s.animateItems(e)}),100)})).catch((function(t){r.showPlaceholder=true;r.loading(false);salla.logger.error(t)}))];case 1:e.sent();return[2]}}))}))};t.prototype.getSingleOrderItem=function(t){var r=document.createElement("tr");r.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");var e=document.createElement("td");e.classList.add("s-orders-table-tbody-tr-td");var n=document.createElement("div");n.classList.add("s-orders-table-tbody-tr-td-content");var o=document.createElement("span");o.classList.add("s-orders-mobile-title");o.textContent=this.orderNumberText+":";var a=document.createElement("span");a.classList.add("s-orders-reference-id");a.textContent="#"+t.reference_id;n.appendChild(o);n.appendChild(a);if(t.source=="buy_as_gift"){var i=document.createElement("i");i.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon");n.appendChild(i)}var l=document.createElement("a");l.href=t.url;n.appendChild(l);var u=document.createElement("div");u.classList.add("s-orders-copy-to-clipboard-button");var 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",(function(t){s.copyToClipboard(t);s.toggleElementClassIf(d,"copied","code-to-copy",(function(){return true}));setTimeout((function(){s.toggleElementClassIf(d,"code-to-copy","copied",(function(){return true}))}),1e3)}));var c=document.createElement("span");c.textContent="#"+t.reference_id;var f=document.createElement("i");f.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");var h=salla.config.get("theme.is_rtl",true);if(h){d.appendChild(f);d.appendChild(c)}else{d.appendChild(c);d.appendChild(f)}u.appendChild(d);n.appendChild(u);e.appendChild(n);r.appendChild(e);var v=document.createElement("td");v.classList.add("s-orders-table-tbody-tr-td");var b=document.createElement("div");b.classList.add("s-orders-table-tbody-tr-td-content");var m=document.createElement("span");m.classList.add("s-orders-mobile-title");m.textContent=this.totalOrderText+":";var p=document.createElement("div");p.innerHTML=salla.money(t.total);var y=document.createElement("a");y.href=t.url;b.appendChild(m);b.appendChild(p);b.appendChild(y);v.appendChild(b);r.appendChild(v);var _=document.createElement("td");_.classList.add("s-orders-table-tbody-tr-td");var w=document.createElement("div");w.classList.add("s-orders-table-tbody-tr-td-content");var g=document.createElement("span");g.classList.add("s-orders-mobile-title");g.textContent=this.orderDateText+":";var k=document.createElement("div");k.textContent=s.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);var x=document.createElement("a");x.href=t.url;w.appendChild(g);w.appendChild(k);w.appendChild(x);_.appendChild(w);r.appendChild(_);var j=document.createElement("td");j.classList.add("s-orders-table-tbody-tr-td");var C=document.createElement("div");C.classList.add("s-orders-table-tbody-tr-td-content");var T=document.createElement("span");T.classList.add("s-orders-mobile-title");T.textContent=this.orderStatusText+":";var O=document.createElement("span");O.classList.add("s-orders-status-container");O.style.color=t.status.color;var S=document.createElement("i");S.classList.add(t.status.icon);var q=document.createElement("span");q.textContent=t.status.name;O.appendChild(S);O.appendChild(q);C.appendChild(T);C.appendChild(O);var z=document.createElement("i");z.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text");C.appendChild(z);var E=document.createElement("a");E.href=t.url;C.appendChild(E);j.appendChild(C);r.appendChild(j);return r};t.prototype.render=function(){var t=this;var r;if(this.showPlaceholder){return e("div",{class:"s-orders-no-content"},e("i",{class:"sicon-packed-box icon"}),e("p",null,this.noOrderText))}return e("div",{class:"s-orders-wrapper"},e("table",{class:"s-orders-table"},e("thead",{class:"s-orders-table-head"},e("tr",{class:"s-orders-table-head-tr"},e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),e("tbody",{class:"s-orders-table-tbody",ref:function(r){return t.wrapper=r}})),this.nextPage&&e("div",{class:"s-infinite-scroll-wrapper",ref:function(r){return t.status=r}},e("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},e("span",{class:"s-button-text s-infinite-scroll-btn-text"},(r=this.loadMoreText)!==null&&r!==void 0?r:this.load_more_text_trans),e("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(r){return t.btnLoader=r},style:{display:"none"}}))))};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){return t.loadInitialData()})).then((function(){return t.initiateInfiniteScroll()}))};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());a.style=o}}}));
5
- //# sourceMappingURL=p-e8b2ec6f.system.entry.js.map
4
+ */System.register(["./p-CbJXYJ5O.system.js","./p-CzwwMHuN.system.js","./p-CLqFzsVe.system.js"],(function(t){"use strict";var r,e,n,s;return{setters:[function(t){r=t.r;e=t.h;n=t.g},function(t){s=t.H},null],execute:function(){var o=":host{display:block}";var a=t("salla_orders",function(){function t(t){var e=this;r(this,t);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((function(){e.languageCode=salla.lang.locale;e.orderNumberText=salla.lang.get("pages.thank_you.order_id");e.totalOrderText=salla.lang.get("pages.orders.total");e.orderDateText=salla.lang.get("pages.orders.date");e.orderStatusText=salla.lang.get("pages.orders.status");e.noOrderText=salla.lang.get("pages.orders.non_orders");e.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}t.prototype.loading=function(t){if(t===void 0){t=true}var r;var e=(r=this.status)===null||r===void 0?void 0:r.querySelector(".s-button-text");if(e){s.toggleElementClassIf(e,"s-button-hide","s-button-show",(function(){return t}));this.btnLoader.style.display=t?"inherit":"none"}};t.prototype.initiateInfiniteScroll=function(){var t=this;var r,e,n;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:function(){return t.nextPage},history:false,nextPage:this.nextPage,scrollThreshold:false},true);(r=this.infiniteScroll)===null||r===void 0?void 0:r.on("request",(function(r){t.loading()}));(e=this.infiniteScroll)===null||e===void 0?void 0:e.on("load",(function(r){var e,n;t.loading(false);t.pagination=r.pagination;t.nextPage=((n=(e=r.pagination)===null||e===void 0?void 0:e.links)===null||n===void 0?void 0:n.next)||null;t.handleResponse(r.data).forEach((function(r){t.wrapper.append(r)}));var o=t.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");s.animateItems(o)}));(n=this.infiniteScroll)===null||n===void 0?void 0:n.on("error",(function(t){salla.logger.error("Error loading more comments:",t)}))};t.prototype.loadMore=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.infiniteScroll.loadNextPage();return[2]}))}))};t.prototype.handleResponse=function(t){var r=this;return t.map((function(t){return r.getSingleOrderItem(t)}))};t.prototype.loadInitialData=function(){return __awaiter(this,void 0,void 0,(function(){var t;var r=this;return __generator(this,(function(e){switch(e.label){case 0:t=new URL(window.location.href);return[4,salla.order.api.fetch(Object.assign(Object.assign({},this.params),{types:[""],feedback_status:t.searchParams.get("feedback_status")})).then((function(t){var e,n,o,a;r.orders=t.data;r.hasInfiniteScroll=!!((e=t.pagination)===null||e===void 0?void 0:e.links.next);r.pagination=t.pagination;r.total=(n=t.pagination)===null||n===void 0?void 0:n.total;r.nextPage=((a=(o=t.pagination)===null||o===void 0?void 0:o.links)===null||a===void 0?void 0:a.next)||null;if(!r.orders.length){r.showPlaceholder=true;return r.loading(false)}setTimeout((function(){r.handleResponse(t.data).forEach((function(t){r.wrapper.append(t)}));r.initiateInfiniteScroll();var e=r.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");s.animateItems(e)}),100)})).catch((function(t){r.showPlaceholder=true;r.loading(false);salla.logger.error(t)}))];case 1:e.sent();return[2]}}))}))};t.prototype.getSingleOrderItem=function(t){var r=document.createElement("tr");r.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");var e=document.createElement("td");e.classList.add("s-orders-table-tbody-tr-td");var n=document.createElement("div");n.classList.add("s-orders-table-tbody-tr-td-content");var o=document.createElement("span");o.classList.add("s-orders-mobile-title");o.textContent=this.orderNumberText+":";var a=document.createElement("span");a.classList.add("s-orders-reference-id");a.textContent="#"+t.reference_id;n.appendChild(o);n.appendChild(a);if(t.source=="buy_as_gift"){var i=document.createElement("i");i.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon");n.appendChild(i)}var u=document.createElement("a");u.href=t.url;n.appendChild(u);var l=document.createElement("div");l.classList.add("s-orders-copy-to-clipboard-button");var 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",(function(t){s.copyToClipboard(t);s.toggleElementClassIf(d,"copied","code-to-copy",(function(){return true}));setTimeout((function(){s.toggleElementClassIf(d,"code-to-copy","copied",(function(){return true}))}),1e3)}));var c=document.createElement("span");c.textContent="#"+t.reference_id;var f=document.createElement("i");f.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon");var h=salla.config.get("theme.is_rtl",true);if(h){d.appendChild(f);d.appendChild(c)}else{d.appendChild(c);d.appendChild(f)}l.appendChild(d);n.appendChild(l);e.appendChild(n);r.appendChild(e);var v=document.createElement("td");v.classList.add("s-orders-table-tbody-tr-td");var b=document.createElement("div");b.classList.add("s-orders-table-tbody-tr-td-content");var m=document.createElement("span");m.classList.add("s-orders-mobile-title");m.textContent=this.totalOrderText+":";var p=document.createElement("div");p.innerHTML=salla.money(t.total);var y=document.createElement("a");y.href=t.url;b.appendChild(m);b.appendChild(p);b.appendChild(y);v.appendChild(b);r.appendChild(v);var _=document.createElement("td");_.classList.add("s-orders-table-tbody-tr-td");var w=document.createElement("div");w.classList.add("s-orders-table-tbody-tr-td-content");var g=document.createElement("span");g.classList.add("s-orders-mobile-title");g.textContent=this.orderDateText+":";var k=document.createElement("div");k.textContent=s.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);var x=document.createElement("a");x.href=t.url;w.appendChild(g);w.appendChild(k);w.appendChild(x);_.appendChild(w);r.appendChild(_);var j=document.createElement("td");j.classList.add("s-orders-table-tbody-tr-td");var C=document.createElement("div");C.classList.add("s-orders-table-tbody-tr-td-content");var O=document.createElement("span");O.classList.add("s-orders-mobile-title");O.textContent=this.orderStatusText+":";var T=document.createElement("span");T.classList.add("s-orders-status-container");T.style.color=t.status.color;var S=document.createElement("i");S.classList.add(t.status.icon);var q=document.createElement("span");q.textContent=t.status.name;T.appendChild(S);T.appendChild(q);C.appendChild(O);C.appendChild(T);var z=document.createElement("i");z.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text");C.appendChild(z);var E=document.createElement("a");E.href=t.url;C.appendChild(E);j.appendChild(C);r.appendChild(j);return r};t.prototype.render=function(){var t=this;var r;if(this.showPlaceholder){return e("div",{class:"s-orders-no-content"},e("i",{class:"sicon-packed-box icon"}),e("p",null,this.noOrderText))}return e("div",{class:"s-orders-wrapper"},e("table",{class:"s-orders-table"},e("thead",{class:"s-orders-table-head"},e("tr",{class:"s-orders-table-head-tr"},e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),e("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),e("tbody",{class:"s-orders-table-tbody",ref:function(r){return t.wrapper=r}})),this.nextPage&&e("div",{class:"s-infinite-scroll-wrapper",ref:function(r){return t.status=r}},e("button",{onClick:function(){return t.loadMore()},class:"s-infinite-scroll-btn s-button-btn s-button-primary"},e("span",{class:"s-button-text s-infinite-scroll-btn-text"},(r=this.loadMoreText)!==null&&r!==void 0?r:this.load_more_text_trans),e("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:function(r){return t.btnLoader=r},style:{display:"none"}}))))};t.prototype.componentWillLoad=function(){var t=this;return salla.onReady().then((function(){return t.loadInitialData()})).then((function(){return t.initiateInfiniteScroll()}))};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());a.style=o}}}));
5
+ //# sourceMappingURL=p-78715871.system.entry.js.map
@@ -1,5 +1,5 @@
1
1
  var __awaiter=this&&this.__awaiter||function(t,e,n,i){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,s){function r(t){try{c(i.next(t))}catch(t){s(t)}}function o(t){try{c(i["throw"](t))}catch(t){s(t)}}function c(t){t.done?n(t.value):a(t.value).then(r,o)}c((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,r;return r={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function o(t){return function(e){return c([t,e])}}function c(o){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,o[0]&&(n=0)),n)try{if(i=1,a&&(s=o[0]&2?a["return"]:o[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,o[1])).done)return s;if(a=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;a=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(o[0]===6&&n.label<s[1]){n.label=s[1];s=o;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(o);break}if(s[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t];a=0}finally{i=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * Crafted with ❤ by Salla
4
- */System.register(["./p-DiAHk-lZ.system.js"],(function(t){"use strict";var e,n,i,a,s;return{setters:[function(t){e=t.r;n=t.c;i=t.h;a=t.H;s=t.g}],execute:function(){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>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 c='\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';var l=":host{display:block}";var u=t("salla_booking_field",function(){function t(t){var i=this;e(this,t);this.invalidInput=n(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((function(){return i.setTranslations()}));Salla.event.on("booking::open",(function(t){return i.handleBookingOpen(t)}))}t.prototype.setTranslations=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=function(t,e,n){return new Promise((function(i){salla.helpers.setNested(salla.lang.messages[t],e,n);i(true)}))};return[4,t("ar.trans","pages.cart.book_an_appointment","حجز موعد")];case 1:e.sent();return[4,t("en.trans","pages.cart.book_an_appointment","Book an Appointment")];case 2:e.sent();return[4,t("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد")];case 3:e.sent();return[4,t("en.trans","pages.cart.edit_an_appointment","Edit an Appointment")];case 4:e.sent();return[4,t("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح")];case 5:e.sent();return[4,t("en.trans","pages.cart.booked_successfully","Booked Successfully")];case 6:e.sent();return[4,t("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد")];case 7:e.sent();return[4,t("en.trans","pages.cart.select_appointment_date","Select appointment date")];case 8:e.sent();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");return[2]}}))}))};t.prototype.openBookingModal=function(t,e){var n=this;if(e===void 0){e=false}if(e&&(!t.detail||typeof t.detail!=="number"||t.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((function(t){if(t.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:t.data.redirect.url,id:n.productId})})).catch((function(t){salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(t.response||t)}))};t.prototype.handleBookingOpen=function(t){var e=this;if(t.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",t.id,t.url);this.iframeReady=true;setTimeout((function(){e.modal.setTitle(e.selectDate);e.modal.open()}),100)};t.prototype.setAfterReloadEvent=function(t,e){salla.storage.set("afterReloadEvent",{event:t,payload:e})};t.prototype.emitAfterReloadEvent=function(){var t=salla.storage.get("afterReloadEvent");if(t&&t.event){var e=new CustomEvent(t.event,{detail:t.payload});window.dispatchEvent(e);salla.storage.remove("afterReloadEvent")}};t.prototype.componentWillLoad=function(){if(this.option&&this.option.details.length){this.reservations=this.option.details}};t.prototype.componentDidLoad=function(){var t=this;window.addEventListener("booking::open-after-reload",(function(e){return t.openBookingModal(e,true)}));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(function(e){return t.invalidInput.emit(e)}));this.reservationsInput.addEventListener("input",(function(){t.reservationsInput.setCustomValidity("");t.reservationsInput.reportValidity()}))};t.prototype.handleMessageEvent=function(t){var e,n;if(t.data.source!=="booking")return;var i=t.data.type;var a=t.data.message;if(localStorage.getItem("debug"))console.log("Received an action:".concat(i),t.data);if(i==="error"){if((e=a.fields)===null||e===void 0?void 0:e.reservation){salla.notify.error(a.fields.reservation[0]);return}var s=Object.values(a.fields||[a.message]).flat().map((function(t){return"<li>".concat(t,"</li>")})).join("");salla.notify.error("<ul>".concat(s,"</ul>"))}if(i==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((function(t){if(t.time&&t.time.length>0){var e=t.time[0];return{date:t.date,day:t.day,from_timestamp:e.from,to_timestamp:e.to}}return null})).filter((function(t){return t!==null}));salla.notify.success(this.bookedLabel);(n=this.modal)===null||n===void 0?void 0:n.close();setTimeout((function(){return window.location.reload()}))}if(i==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}};t.prototype.bookingModal=function(){var t=this;return i("salla-modal",{class:"s-booking-field-modal",ref:function(e){return t.modal=e},width:"md",position:"middle",noPadding:true},i("iframe",{ref:function(e){return t.iframe=e},src:this.bookingUrl,frameborder:"0"}))};t.prototype.renderReservationDate=function(t){return i("span",{class:t.from_timestamp?"s-booking-field-reservations-has-time":""},i("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),t.date)};t.prototype.renderReservationTime=function(t){if(!t.from_timestamp)return"";return i("span",{class:"s-booking-field-reservations-time"},i("i",{class:"s-booking-field-reservations-icon",innerHTML:c}),i("span",null,t.from_timestamp," - ",t.to_timestamp))};t.prototype.render=function(){var t=this;return i(a,{key:"04c9e3dc3dc825bd6905221d858c260f7ca34748"},i("div",{key:"07ec38cec1bd1798640dd7ea9592bb3b17d945c6",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?i("div",{class:"s-booking-field-price"},i("span",{innerHTML:salla.money(this.option.price)})):"",i("salla-button",{key:"6b71889cfc0429d15c466a6f194df31549f09786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:function(e){return t.openBookingModal(e,false)}},i("span",{key:"a16f8db6f52c7751ea605efcae04057ca0dc5b61",class:"s-booking-field-book-now-content"},i("span",{key:"95f6086a599bcc620c87ece6c6ae9620dba15581",innerHTML:r}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&i("div",{key:"b3615100bbfff3d98d0ac99145aaf53449790c94",class:"s-booking-field-reservations"},this.reservations.map((function(e,n){return i("div",{key:n,class:"s-booking-field-reservations-item"},t.renderReservationDate(e),t.renderReservationTime(e))}))),i("input",{key:"126f14f2e520b8696bc7450e209bad30b267878b",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:function(e){return t.reservationsInput=e}}),this.iframeReady&&this.bookingModal())};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());u.style=l;var f=t("salla_conditional_fields",function(){function t(t){e(this,t)}t.prototype.hideAllOptions=function(t){var e=this;this.host.querySelectorAll('[data-show-when^="options['.concat(t,'"]')).forEach((function(t){t.classList.add("hidden");e.hideAllOptions(t.dataset.optionId);e.disableInputs(t)}))};t.prototype.disableInputs=function(t){t.querySelectorAll("[name]").forEach((function(t){var e;t.setAttribute("disabled","");t.removeAttribute("required");if(((e=t===null||t===void 0?void 0:t.tagName)===null||e===void 0?void 0:e.toLowerCase())==="select"){t.value=""}if(["checkbox"].includes(t.getAttribute("type"))&&t.hasOwnProperty("checked")){t.checked=false}}))};t.prototype.changeHandler=function(t){var e=this;var n;salla.event.emit("salla-onditional-fields::change",t);salla.log("Received the change event: ",t);if(!t.target||!["SELECT"].includes(t.target.tagName)&&!["checkbox","radio"].includes(t.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((n=t===null||t===void 0?void 0:t.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var i=t.target.name.replace("[]","");var a=t.target.getAttribute("type")==="checkbox";var s=t.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",'[data-show-when^="'.concat(i,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(i,'"]')).forEach((function(n){var i=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var r=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var o;if(a){var c=Array.from(e.host.querySelectorAll('input[name="'.concat(t.target.name,'"]:checked')),(function(t){return t===null||t===void 0?void 0:t.value}));o=c.includes(r.toString())}else if(s){o=t.target.checked&&t.target.value===r}else{o=r===t.target.value}salla.log("The input is ",a?"Multiple":s?"Radio":"Single"," value:",o);var l=i&&o||!i&&!o;if(l){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(t){t.removeAttribute("disabled");var e=t.closest(".s-product-options-option");if(e.dataset.optionRequired==="true"){t.setAttribute("required","")}if(t.getAttribute("type")==="checkbox"){var n=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(t.getAttribute("name"),'"]')));var i=n.some((function(t){return t.checked}));if(i){n.forEach((function(t){t.removeAttribute("required")}))}}}))}else{e.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");e.disableInputs(n)}}))};t.prototype.componentDidRender=function(){var t=this;this.host.querySelectorAll("[data-show-when]").forEach((function(e){var n;var i=(n=e===null||e===void 0?void 0:e.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!i){return}t.changeHandler({target:t.host.querySelector('[name^="'+i+'"]')})}))};t.prototype.render=function(){return i(a,{key:"405156ba83b8731039c2dd0ff800f617150cc722"},i("slot",{key:"2bff17ce7b49fef9b028d673992d256b00e9481b"}))};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}())}}}));
5
- //# sourceMappingURL=p-7c6bacd4.system.entry.js.map
4
+ */System.register(["./p-CbJXYJ5O.system.js"],(function(t){"use strict";var e,n,i,a,s;return{setters:[function(t){e=t.r;n=t.c;i=t.h;a=t.H;s=t.g}],execute:function(){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>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 c='\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';var l=":host{display:block}";var u=t("salla_booking_field",function(){function t(t){var i=this;e(this,t);this.invalidInput=n(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((function(){return i.setTranslations()}));Salla.event.on("booking::open",(function(t){return i.handleBookingOpen(t)}))}t.prototype.setTranslations=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:t=function(t,e,n){return new Promise((function(i){salla.helpers.setNested(salla.lang.messages[t],e,n);i(true)}))};return[4,t("ar.trans","pages.cart.book_an_appointment","حجز موعد")];case 1:e.sent();return[4,t("en.trans","pages.cart.book_an_appointment","Book an Appointment")];case 2:e.sent();return[4,t("ar.trans","pages.cart.edit_an_appointment","تعديل الموعد")];case 3:e.sent();return[4,t("en.trans","pages.cart.edit_an_appointment","Edit an Appointment")];case 4:e.sent();return[4,t("ar.trans","pages.cart.booked_successfully","تمت اضافة الموعد بنجاح")];case 5:e.sent();return[4,t("en.trans","pages.cart.booked_successfully","Booked Successfully")];case 6:e.sent();return[4,t("ar.trans","pages.cart.select_appointment_date","حدد تاريخ الموعد")];case 7:e.sent();return[4,t("en.trans","pages.cart.select_appointment_date","Select appointment date")];case 8:e.sent();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");return[2]}}))}))};t.prototype.openBookingModal=function(t,e){var n=this;if(e===void 0){e=false}if(e&&(!t.detail||typeof t.detail!=="number"||t.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((function(t){if(t.data.redirect.to!=="booking"){throw new Error("Unexpected redirect!")}salla.event.dispatch("booking::open",{url:t.data.redirect.url,id:n.productId})})).catch((function(t){salla.error(salla.lang.get("common.errors.error_occurred"));salla.logger.error(t.response||t)}))};t.prototype.handleBookingOpen=function(t){var e=this;if(t.id!==this.productId)return;this.bookingUrl=salla.url.addParamToUrl("product_id",t.id,t.url);this.iframeReady=true;setTimeout((function(){e.modal.setTitle(e.selectDate);e.modal.open()}),100)};t.prototype.setAfterReloadEvent=function(t,e){salla.storage.set("afterReloadEvent",{event:t,payload:e})};t.prototype.emitAfterReloadEvent=function(){var t=salla.storage.get("afterReloadEvent");if(t&&t.event){var e=new CustomEvent(t.event,{detail:t.payload});window.dispatchEvent(e);salla.storage.remove("afterReloadEvent")}};t.prototype.componentWillLoad=function(){if(this.option&&this.option.details.length){this.reservations=this.option.details}};t.prototype.componentDidLoad=function(){var t=this;window.addEventListener("booking::open-after-reload",(function(e){return t.openBookingModal(e,true)}));this.emitAfterReloadEvent();window.addEventListener("message",this.handleMessageEvent.bind(this));this.reservationsInput.addEventListener("invalid",(function(e){return t.invalidInput.emit(e)}));this.reservationsInput.addEventListener("input",(function(){t.reservationsInput.setCustomValidity("");t.reservationsInput.reportValidity()}))};t.prototype.handleMessageEvent=function(t){var e,n;if(t.data.source!=="booking")return;var i=t.data.type;var a=t.data.message;if(localStorage.getItem("debug"))console.log("Received an action:".concat(i),t.data);if(i==="error"){if((e=a.fields)===null||e===void 0?void 0:e.reservation){salla.notify.error(a.fields.reservation[0]);return}var s=Object.values(a.fields||[a.message]).flat().map((function(t){return"<li>".concat(t,"</li>")})).join("");salla.notify.error("<ul>".concat(s,"</ul>"))}if(i==="success"){if(Number(a.productId)!==Number(this.productId))return;this.reservations=a.data.reservations.map((function(t){if(t.time&&t.time.length>0){var e=t.time[0];return{date:t.date,day:t.day,from_timestamp:e.from,to_timestamp:e.to}}return null})).filter((function(t){return t!==null}));salla.notify.success(this.bookedLabel);(n=this.modal)===null||n===void 0?void 0:n.close();setTimeout((function(){return window.location.reload()}))}if(i==="height"){this.iframe.height=(a===null||a===void 0?void 0:a.height)+"px"}};t.prototype.bookingModal=function(){var t=this;return i("salla-modal",{class:"s-booking-field-modal",ref:function(e){return t.modal=e},width:"md",position:"middle",noPadding:true},i("iframe",{ref:function(e){return t.iframe=e},src:this.bookingUrl,frameborder:"0"}))};t.prototype.renderReservationDate=function(t){return i("span",{class:t.from_timestamp?"s-booking-field-reservations-has-time":""},i("i",{class:"s-booking-field-reservations-icon",innerHTML:o}),t.date)};t.prototype.renderReservationTime=function(t){if(!t.from_timestamp)return"";return i("span",{class:"s-booking-field-reservations-time"},i("i",{class:"s-booking-field-reservations-icon",innerHTML:c}),i("span",null,t.from_timestamp," - ",t.to_timestamp))};t.prototype.render=function(){var t=this;return i(a,{key:"04c9e3dc3dc825bd6905221d858c260f7ca34748"},i("div",{key:"07ec38cec1bd1798640dd7ea9592bb3b17d945c6",class:"s-booking-field-main"},this.option.required||this.reservations.length>0?i("div",{class:"s-booking-field-price"},i("span",{innerHTML:salla.money(this.option.price)})):"",i("salla-button",{key:"6b71889cfc0429d15c466a6f194df31549f09786",class:"s-booking-field-book-now",size:"small",loaderPosition:"center",fill:"outline",onClick:function(e){return t.openBookingModal(e,false)}},i("span",{key:"a16f8db6f52c7751ea605efcae04057ca0dc5b61",class:"s-booking-field-book-now-content"},i("span",{key:"95f6086a599bcc620c87ece6c6ae9620dba15581",innerHTML:r}),this.reservations.length?this.editLabel:this.bookNowLabel))),this.reservations.length>0&&i("div",{key:"b3615100bbfff3d98d0ac99145aaf53449790c94",class:"s-booking-field-reservations"},this.reservations.map((function(e,n){return i("div",{key:n,class:"s-booking-field-reservations-item"},t.renderReservationDate(e),t.renderReservationTime(e))}))),i("input",{key:"126f14f2e520b8696bc7450e209bad30b267878b",class:"s-hidden",name:this.option.name,required:this.option.required,value:JSON.stringify(this.reservations)==="[]"?"":JSON.stringify(this.reservations),ref:function(e){return t.reservationsInput=e}}),this.iframeReady&&this.bookingModal())};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());u.style=l;var f=t("salla_conditional_fields",function(){function t(t){e(this,t)}t.prototype.hideAllOptions=function(t){var e=this;this.host.querySelectorAll('[data-show-when^="options['.concat(t,'"]')).forEach((function(t){t.classList.add("hidden");e.hideAllOptions(t.dataset.optionId);e.disableInputs(t)}))};t.prototype.disableInputs=function(t){t.querySelectorAll("[name]").forEach((function(t){var e;t.setAttribute("disabled","");t.removeAttribute("required");if(((e=t===null||t===void 0?void 0:t.tagName)===null||e===void 0?void 0:e.toLowerCase())==="select"){t.value=""}if(["checkbox"].includes(t.getAttribute("type"))&&t.hasOwnProperty("checked")){t.checked=false}}))};t.prototype.changeHandler=function(t){var e=this;var n;salla.event.emit("salla-onditional-fields::change",t);salla.log("Received the change event: ",t);if(!t.target||!["SELECT"].includes(t.target.tagName)&&!["checkbox","radio"].includes(t.target.getAttribute("type"))){salla.log("Ignore the change because is not a supported input: "+(((n=t===null||t===void 0?void 0:t.target)===null||n===void 0?void 0:n.tagName)||"N/A"));return}var i=t.target.name.replace("[]","");var a=t.target.getAttribute("type")==="checkbox";var s=t.target.getAttribute("type")==="radio";salla.log("Trying to find all elements with condition:",'[data-show-when^="'.concat(i,'"]'));this.host.querySelectorAll('[data-show-when^="'.concat(i,'"]')).forEach((function(n){var i=!(n===null||n===void 0?void 0:n.dataset.showWhen.includes("!="));var r=n===null||n===void 0?void 0:n.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();var o;if(a){var c=Array.from(e.host.querySelectorAll('input[name="'.concat(t.target.name,'"]:checked')),(function(t){return t===null||t===void 0?void 0:t.value}));o=c.includes(r.toString())}else if(s){o=t.target.checked&&t.target.value===r}else{o=r===t.target.value}salla.log("The input is ",a?"Multiple":s?"Radio":"Single"," value:",o);var l=i&&o||!i&&!o;if(l){n.classList.remove("hidden");n.querySelectorAll("[name]").forEach((function(t){t.removeAttribute("disabled");var e=t.closest(".s-product-options-option");if(e.dataset.optionRequired==="true"){t.setAttribute("required","")}if(t.getAttribute("type")==="checkbox"){var n=Array.from(document.querySelectorAll('input[type="checkbox"][name="'.concat(t.getAttribute("name"),'"]')));var i=n.some((function(t){return t.checked}));if(i){n.forEach((function(t){t.removeAttribute("required")}))}}}))}else{e.hideAllOptions(n.dataset.optionId);n.classList.add("hidden");e.disableInputs(n)}}))};t.prototype.componentDidRender=function(){var t=this;this.host.querySelectorAll("[data-show-when]").forEach((function(e){var n;var i=(n=e===null||e===void 0?void 0:e.dataset)===null||n===void 0?void 0:n.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();if(!i){return}t.changeHandler({target:t.host.querySelector('[name^="'+i+'"]')})}))};t.prototype.render=function(){return i(a,{key:"405156ba83b8731039c2dd0ff800f617150cc722"},i("slot",{key:"2bff17ce7b49fef9b028d673992d256b00e9481b"}))};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}())}}}));
5
+ //# sourceMappingURL=p-78bf11f2.system.entry.js.map