@salla.sa/twilight-components 2.14.488 → 2.14.490

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 (402) hide show
  1. package/dist/cjs/{filepond-05NO31dc.js → filepond-DMNwZGDe.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BSzyn1DL.js → filepond-plugin-file-poster-CwJqn9cv.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DJKsosMa.js → filepond-plugin-file-validate-size-D8HCq_yt.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-C0xLud1P.js → filepond-plugin-file-validate-type-DZHIztrf.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-Dq1zXDYS.js → filepond-plugin-image-edit-DtW6aab5.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-B84Q7JSN.js → filepond-plugin-image-exif-orientation-DlHuggE7.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-BaE9P79l.js → filepond-plugin-image-preview-rSt0R5Fs.js} +1 -1
  8. package/dist/cjs/{functions-B-_Pnqnt.js → functions-Cl4vQLXn.js} +1 -1
  9. package/dist/cjs/{index-f6loD1zL.js → index-CfrGmYJa.js} +17 -5
  10. package/dist/cjs/{index-BsvV4QQg.js → index-CrTL2nRh.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +5 -5
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-factors.cjs.entry.js +45 -0
  27. package/dist/cjs/salla-comment-form_8.cjs.entry.js +112 -30
  28. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  52. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  53. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-options-modal_3.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1060 -0
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +38 -14
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +127 -0
  88. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +6 -6
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-social.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +4 -4
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +2 -2
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +2 -2
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +2 -2
  105. package/dist/cjs/shipping-fast-CsqEQE78.js +13 -0
  106. package/dist/{esm/star-ZT7ehBBk.js → cjs/star-DMzrN05M.js} +4 -2
  107. package/dist/cjs/{tracked-promise-We1h_qB4.js → tracked-promise-ClJBjg9o.js} +1 -1
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/{vanilla-picker-Ck8OFt14.js → vanilla-picker-um8NlppX.js} +1 -1
  110. package/dist/collection/collection-manifest.json +3 -0
  111. package/dist/collection/components/salla-comments/salla-comment-factors.js +76 -0
  112. package/dist/collection/components/salla-comments/salla-comment-item.js +20 -6
  113. package/dist/collection/components/salla-comments/salla-comments.css +110 -0
  114. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +1203 -0
  115. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +112 -1
  116. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +33 -2
  117. package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +34 -1
  118. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +117 -16
  119. package/dist/collection/components/salla-review-factors-tags/helpers.js +86 -0
  120. package/dist/collection/components/salla-review-factors-tags/interfaces.js +1 -0
  121. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.css +41 -0
  122. package/dist/collection/components/salla-review-factors-tags/salla-review-factors-tags.js +135 -0
  123. package/dist/collection/components/salla-reviews/salla-reviews.js +1 -1
  124. package/dist/collection/components/salla-reviews-page/salla-reviews-page.js +1 -1
  125. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.css +60 -0
  126. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +12 -2
  127. package/dist/collection/components/salla-search/salla-search.js +5 -5
  128. package/dist/collection/components/salla-searchable-dropdown/salla-searchable-dropdown.js +4 -4
  129. package/dist/collection/components/salla-skeleton/salla-skeleton.js +1 -1
  130. package/dist/collection/components/salla-social/salla-social.js +1 -1
  131. package/dist/collection/components/salla-social-share/salla-social-share.js +1 -1
  132. package/dist/collection/components/salla-tabs/salla-tab-content.js +1 -1
  133. package/dist/collection/components/salla-tabs/salla-tab-header.js +1 -1
  134. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  135. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  136. package/dist/collection/components/salla-tooltip/salla-tooltip.js +1 -1
  137. package/dist/collection/components/salla-user-settings/salla-user-settings.js +1 -1
  138. package/dist/collection/components/salla-wishlist-actions/salla-wishlist-actions.js +1 -1
  139. package/dist/components/index.js +3 -3
  140. package/dist/components/salla-comment-factors.d.ts +11 -0
  141. package/dist/components/salla-comment-factors.js +9 -0
  142. package/dist/components/salla-comment-factors2.js +66 -0
  143. package/dist/components/salla-comment-item2.js +29 -9
  144. package/dist/components/salla-comments.js +9 -3
  145. package/dist/components/salla-rating-modal-v2.d.ts +11 -0
  146. package/dist/components/salla-rating-modal-v2.js +9 -0
  147. package/dist/components/salla-rating-modal-v22.js +1149 -0
  148. package/dist/components/salla-rating-modal.js +49 -19
  149. package/dist/components/salla-rating-stars2.js +80 -17
  150. package/dist/components/salla-review-factors-tags.d.ts +11 -0
  151. package/dist/components/salla-review-factors-tags.js +149 -0
  152. package/dist/components/salla-reviews-page.js +1 -1
  153. package/dist/components/salla-reviews-summary2.js +13 -3
  154. package/dist/components/salla-reviews.js +1 -1
  155. package/dist/components/salla-search.js +5 -5
  156. package/dist/components/salla-searchable-dropdown2.js +4 -4
  157. package/dist/components/salla-skeleton2.js +1 -1
  158. package/dist/components/salla-social-share2.js +1 -1
  159. package/dist/components/salla-social.js +1 -1
  160. package/dist/components/salla-tab-content2.js +1 -1
  161. package/dist/components/salla-tab-header2.js +1 -1
  162. package/dist/components/salla-tabs2.js +1 -1
  163. package/dist/components/salla-tel-input2.js +1 -1
  164. package/dist/components/salla-tooltip2.js +1 -1
  165. package/dist/components/salla-user-settings.js +1 -1
  166. package/dist/components/salla-wishlist-actions.js +1 -1
  167. package/dist/esm/{filepond-2lHD_yVt.js → filepond-Cg7o_vnN.js} +1 -1
  168. package/dist/esm/{filepond-plugin-file-poster-DIjVVIwh.js → filepond-plugin-file-poster-BJ1q5i_Q.js} +1 -1
  169. package/dist/esm/{filepond-plugin-file-validate-size-CfcICNJA.js → filepond-plugin-file-validate-size-KAp2gG4p.js} +1 -1
  170. package/dist/esm/{filepond-plugin-file-validate-type-DsvYMiJr.js → filepond-plugin-file-validate-type-D6KC6aKt.js} +1 -1
  171. package/dist/esm/{filepond-plugin-image-edit-B7K5Ib7q.js → filepond-plugin-image-edit-CsviUA8z.js} +1 -1
  172. package/dist/esm/{filepond-plugin-image-exif-orientation-9iz6i-up.js → filepond-plugin-image-exif-orientation-DORQxh2z.js} +1 -1
  173. package/dist/esm/{filepond-plugin-image-preview-C89IBH1s.js → filepond-plugin-image-preview-DiN_MPtQ.js} +1 -1
  174. package/dist/esm/{functions-CJdqLH4P.js → functions-ChcWts7Y.js} +1 -1
  175. package/dist/esm/{index-K0OclOPO.js → index-DkTbP5UX.js} +17 -5
  176. package/dist/esm/{index-D1YskPUH.js → index-nv62Rr6s.js} +1 -1
  177. package/dist/esm/loader.js +3 -3
  178. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  179. package/dist/esm/salla-accordion_6.entry.js +1 -1
  180. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  181. package/dist/esm/salla-advertisement.entry.js +1 -1
  182. package/dist/esm/salla-alert_2.entry.js +1 -1
  183. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  184. package/dist/esm/salla-apps-icons.entry.js +1 -1
  185. package/dist/esm/salla-badge.entry.js +1 -1
  186. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  187. package/dist/esm/salla-bullet-delivery_2.entry.js +5 -5
  188. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  189. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  190. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  191. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  192. package/dist/esm/salla-comment-factors.entry.js +43 -0
  193. package/dist/esm/salla-comment-form_8.entry.js +112 -30
  194. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  195. package/dist/esm/salla-contacts.entry.js +1 -1
  196. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  197. package/dist/esm/salla-count-down.entry.js +1 -1
  198. package/dist/esm/salla-custom-fields.entry.js +1 -1
  199. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  200. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  201. package/dist/esm/salla-filters-widget.entry.js +1 -1
  202. package/dist/esm/salla-filters.entry.js +1 -1
  203. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  204. package/dist/esm/salla-gifting.entry.js +1 -1
  205. package/dist/esm/salla-hook.entry.js +1 -1
  206. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  207. package/dist/esm/salla-installment.entry.js +1 -1
  208. package/dist/esm/salla-list-tile.entry.js +1 -1
  209. package/dist/esm/salla-localization-modal.entry.js +1 -1
  210. package/dist/esm/salla-login-modal.entry.js +1 -1
  211. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  212. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  213. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  214. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  215. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  216. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  217. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  218. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  219. package/dist/esm/salla-loyalty.entry.js +1 -1
  220. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  221. package/dist/esm/salla-map_2.entry.js +1 -1
  222. package/dist/esm/salla-menu.entry.js +1 -1
  223. package/dist/esm/salla-metadata.entry.js +1 -1
  224. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  225. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  226. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  227. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  228. package/dist/esm/salla-notification-item.entry.js +1 -1
  229. package/dist/esm/salla-notifications.entry.js +1 -1
  230. package/dist/esm/salla-offer-modal.entry.js +1 -1
  231. package/dist/esm/salla-offer.entry.js +1 -1
  232. package/dist/esm/salla-order-branch.entry.js +1 -1
  233. package/dist/esm/salla-order-cancel.entry.js +1 -1
  234. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  235. package/dist/esm/salla-order-details-options.entry.js +1 -1
  236. package/dist/esm/salla-order-details.entry.js +1 -1
  237. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  238. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  239. package/dist/esm/salla-order-edit.entry.js +1 -1
  240. package/dist/esm/salla-order-options-modal_3.entry.js +1 -1
  241. package/dist/esm/salla-order-summary.entry.js +1 -1
  242. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  243. package/dist/esm/salla-orders.entry.js +1 -1
  244. package/dist/esm/salla-payments.entry.js +1 -1
  245. package/dist/esm/salla-placeholder.entry.js +1 -1
  246. package/dist/esm/salla-price-range.entry.js +1 -1
  247. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  248. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  249. package/dist/esm/salla-products-list.entry.js +1 -1
  250. package/dist/esm/salla-quick-order.entry.js +1 -1
  251. package/dist/esm/salla-rating-modal-v2.entry.js +1058 -0
  252. package/dist/esm/salla-rating-modal.entry.js +36 -12
  253. package/dist/esm/salla-review-factors-tags.entry.js +125 -0
  254. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  255. package/dist/esm/salla-scopes.entry.js +1 -1
  256. package/dist/esm/salla-search.entry.js +6 -6
  257. package/dist/esm/salla-skeleton.entry.js +2 -2
  258. package/dist/esm/salla-slider.entry.js +1 -1
  259. package/dist/esm/salla-social-share.entry.js +2 -2
  260. package/dist/esm/salla-social.entry.js +2 -2
  261. package/dist/esm/salla-tab-content_3.entry.js +4 -4
  262. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  263. package/dist/esm/salla-tooltip.entry.js +2 -2
  264. package/dist/esm/salla-trust-badges.entry.js +1 -1
  265. package/dist/esm/salla-user-menu.entry.js +5 -5
  266. package/dist/esm/salla-user-profile.entry.js +1 -1
  267. package/dist/esm/salla-user-settings.entry.js +2 -2
  268. package/dist/esm/salla-verify.entry.js +1 -1
  269. package/dist/esm/salla-wallet.entry.js +1 -1
  270. package/dist/esm/salla-wishlist-actions.entry.js +2 -2
  271. package/dist/esm/shipping-fast-lMgMt31Q.js +11 -0
  272. package/dist/{cjs/star-DGcH7Yso.js → esm/star-CeFAfcTv.js} +2 -4
  273. package/dist/esm/{tracked-promise-yWzlErXb.js → tracked-promise-BhGtlRVb.js} +1 -1
  274. package/dist/esm/twilight.js +3 -3
  275. package/dist/esm/{vanilla-picker-Bwq5IBwq.js → vanilla-picker-CBI_4fLe.js} +1 -1
  276. package/dist/twilight/{p-997a1fdf.entry.js → p-01240db4.entry.js} +1 -1
  277. package/dist/twilight/{p-4df90b34.entry.js → p-01cd2407.entry.js} +1 -1
  278. package/dist/twilight/{p-917bae25.entry.js → p-02b365bd.entry.js} +1 -1
  279. package/dist/twilight/p-03ab9920.entry.js +4 -0
  280. package/dist/twilight/{p-1ec309ad.entry.js → p-03cc6665.entry.js} +1 -1
  281. package/dist/twilight/{p-416e7ea9.entry.js → p-0a32b0d6.entry.js} +1 -1
  282. package/dist/twilight/{p-52df99a3.entry.js → p-0de58301.entry.js} +1 -1
  283. package/dist/twilight/{p-c6026f2e.entry.js → p-0e0db003.entry.js} +1 -1
  284. package/dist/twilight/p-0f853d19.entry.js +4 -0
  285. package/dist/twilight/{p-0f6a9e5e.entry.js → p-0f859745.entry.js} +1 -1
  286. package/dist/twilight/{p-680e0dca.entry.js → p-0ff0a5cd.entry.js} +1 -1
  287. package/dist/twilight/{p-b2a12062.entry.js → p-111e8bd4.entry.js} +1 -1
  288. package/dist/twilight/{p-bd50d1c4.entry.js → p-1182a8df.entry.js} +1 -1
  289. package/dist/twilight/{p-eeb0e354.entry.js → p-121dc015.entry.js} +1 -1
  290. package/dist/twilight/{p-df6739de.entry.js → p-15bc19e7.entry.js} +1 -1
  291. package/dist/twilight/{p-387e06ce.entry.js → p-18dada14.entry.js} +1 -1
  292. package/dist/twilight/{p-c1e7fe98.entry.js → p-1a3e548c.entry.js} +1 -1
  293. package/dist/twilight/{p-12d485db.entry.js → p-1f43ed62.entry.js} +1 -1
  294. package/dist/twilight/{p-ccbf4eea.entry.js → p-2414aef5.entry.js} +1 -1
  295. package/dist/twilight/{p-363417b6.entry.js → p-25bfec19.entry.js} +1 -1
  296. package/dist/twilight/{p-8a274920.entry.js → p-26211933.entry.js} +1 -1
  297. package/dist/twilight/{p-f97717b9.entry.js → p-2656742a.entry.js} +1 -1
  298. package/dist/twilight/{p-8b45c13a.entry.js → p-26594c13.entry.js} +1 -1
  299. package/dist/twilight/{p-5dbdf0e7.entry.js → p-271b69a0.entry.js} +1 -1
  300. package/dist/twilight/{p-c01100d0.entry.js → p-27ae0022.entry.js} +1 -1
  301. package/dist/twilight/{p-9efc4b59.entry.js → p-28318fdf.entry.js} +1 -1
  302. package/dist/twilight/{p-9dc6f28e.entry.js → p-28636b6b.entry.js} +1 -1
  303. package/dist/twilight/{p-28eea468.entry.js → p-2b6f45d9.entry.js} +1 -1
  304. package/dist/twilight/{p-04612ed4.entry.js → p-2bcfed29.entry.js} +1 -1
  305. package/dist/twilight/{p-95c6ca83.entry.js → p-2e2d9a86.entry.js} +1 -1
  306. package/dist/twilight/{p-72bc40b3.entry.js → p-31c63840.entry.js} +1 -1
  307. package/dist/twilight/{p-8878ec9e.entry.js → p-38e6442f.entry.js} +1 -1
  308. package/dist/twilight/p-3956807e.entry.js +4 -0
  309. package/dist/twilight/{p-CJRTPVPy.js → p-495aeIVH.js} +1 -1
  310. package/dist/twilight/{p-c497fa37.entry.js → p-4b659dd8.entry.js} +1 -1
  311. package/dist/twilight/{p-5dc0f3c0.entry.js → p-51be1247.entry.js} +1 -1
  312. package/dist/twilight/{p-f6c20f25.entry.js → p-556550d6.entry.js} +1 -1
  313. package/dist/twilight/{p-507e04b3.entry.js → p-57926552.entry.js} +1 -1
  314. package/dist/twilight/{p-cd11cafc.entry.js → p-583b37a5.entry.js} +1 -1
  315. package/dist/twilight/{p-fe6e676c.entry.js → p-5932a5aa.entry.js} +1 -1
  316. package/dist/twilight/{p-2ea6c5c6.entry.js → p-5cd89a8e.entry.js} +1 -1
  317. package/dist/twilight/{p-3cee41e1.entry.js → p-6c74b5a4.entry.js} +1 -1
  318. package/dist/twilight/{p-8f204414.entry.js → p-7092d5e9.entry.js} +1 -1
  319. package/dist/twilight/{p-75345728.entry.js → p-7331a7d0.entry.js} +1 -1
  320. package/dist/twilight/{p-0be72b27.entry.js → p-75b9780f.entry.js} +1 -1
  321. package/dist/twilight/{p-44819d23.entry.js → p-75d071f5.entry.js} +1 -1
  322. package/dist/twilight/{p-868b6dcc.entry.js → p-78364b26.entry.js} +1 -1
  323. package/dist/twilight/{p-d6ace1e8.entry.js → p-7869e2b4.entry.js} +1 -1
  324. package/dist/twilight/{p-62e99802.entry.js → p-789ede46.entry.js} +1 -1
  325. package/dist/twilight/{p-168bfefc.entry.js → p-7cb04076.entry.js} +1 -1
  326. package/dist/twilight/{p-1abccd80.entry.js → p-7fa40598.entry.js} +1 -1
  327. package/dist/twilight/{p-f4b040f0.entry.js → p-8430e33c.entry.js} +1 -1
  328. package/dist/twilight/p-8549ed85.entry.js +4 -0
  329. package/dist/twilight/{p-d1b3e98b.entry.js → p-88bc9aff.entry.js} +1 -1
  330. package/dist/twilight/{p-8ba7b32d.entry.js → p-8d83987b.entry.js} +1 -1
  331. package/dist/twilight/{p-54047fdd.entry.js → p-956be35f.entry.js} +1 -1
  332. package/dist/twilight/{p-d5bbdd47.entry.js → p-9c27c468.entry.js} +1 -1
  333. package/dist/twilight/{p-4Xs3NevL.js → p-B4xPvvKC.js} +1 -1
  334. package/dist/twilight/{p-BgI56yKL.js → p-Bp81rq7T.js} +1 -1
  335. package/dist/twilight/{p-ZT7ehBBk.js → p-CeFAfcTv.js} +1 -1
  336. package/dist/twilight/{p-BF7QVpUp.js → p-CszkocSp.js} +2 -2
  337. package/dist/twilight/{p-3Yh5uCQZ.js → p-CvcP7d1k.js} +1 -1
  338. package/dist/twilight/{p-DTwxTvVu.js → p-D1tp_3zr.js} +1 -1
  339. package/dist/twilight/{p-6iwUgroX.js → p-D3lg7_WR.js} +1 -1
  340. package/dist/twilight/{p-Bnnviqjp.js → p-D68AOZPQ.js} +1 -1
  341. package/dist/twilight/{p-K0OclOPO.js → p-DkTbP5UX.js} +2 -2
  342. package/dist/twilight/{p-327d33c2.entry.js → p-a104a885.entry.js} +1 -1
  343. package/dist/twilight/{p-8b2fb172.entry.js → p-a5310ab5.entry.js} +1 -1
  344. package/dist/twilight/{p-30796ada.entry.js → p-ab8ffcbf.entry.js} +1 -1
  345. package/dist/twilight/{p-9d51f43d.entry.js → p-acf6a8f0.entry.js} +1 -1
  346. package/dist/twilight/{p-4bdd0eab.entry.js → p-ad8111fa.entry.js} +1 -1
  347. package/dist/twilight/{p-fb9f7001.entry.js → p-af41ebe4.entry.js} +1 -1
  348. package/dist/twilight/{p-cdfe32c9.entry.js → p-b4fc5871.entry.js} +1 -1
  349. package/dist/twilight/{p-f5242092.entry.js → p-b7916db2.entry.js} +1 -1
  350. package/dist/twilight/{p-c19cdf96.entry.js → p-b87ac43c.entry.js} +1 -1
  351. package/dist/twilight/{p-7cfe5dbf.entry.js → p-bdca0d7a.entry.js} +1 -1
  352. package/dist/twilight/{p-6e6f4879.entry.js → p-be44f2e4.entry.js} +1 -1
  353. package/dist/twilight/{p-18c99d79.entry.js → p-bf50723d.entry.js} +1 -1
  354. package/dist/twilight/{p-283b7a09.entry.js → p-c0dd76e3.entry.js} +1 -1
  355. package/dist/twilight/{p-7ab11977.entry.js → p-c3c9b136.entry.js} +1 -1
  356. package/dist/twilight/{p-cb475d27.entry.js → p-c583ab13.entry.js} +1 -1
  357. package/dist/twilight/p-c71a6e9c.entry.js +4 -0
  358. package/dist/twilight/{p-24eb59ac.entry.js → p-c774a729.entry.js} +1 -1
  359. package/dist/twilight/p-c80b8b30.entry.js +4 -0
  360. package/dist/twilight/{p-76f06b0a.entry.js → p-c9dcf28b.entry.js} +1 -1
  361. package/dist/twilight/{p-DZu6rifA.js → p-cUujZ85s.js} +1 -1
  362. package/dist/twilight/{p-5effd85b.entry.js → p-ca1c1c50.entry.js} +2 -2
  363. package/dist/twilight/{p-e9439252.entry.js → p-cbbfec66.entry.js} +1 -1
  364. package/dist/twilight/{p-3f1913e0.entry.js → p-ce0d56c1.entry.js} +1 -1
  365. package/dist/twilight/{p-906dfda7.entry.js → p-d0eb0e3d.entry.js} +1 -1
  366. package/dist/twilight/{p-7a738892.entry.js → p-d27c3758.entry.js} +1 -1
  367. package/dist/twilight/p-d617bb3f.entry.js +4 -0
  368. package/dist/twilight/{p-e30f415c.entry.js → p-d7633d87.entry.js} +1 -1
  369. package/dist/twilight/{p-bb7d240f.entry.js → p-d981255b.entry.js} +1 -1
  370. package/dist/twilight/{p-2368ab21.entry.js → p-d9e7a2a9.entry.js} +1 -1
  371. package/dist/twilight/{p-cb9501dc.entry.js → p-dca909c8.entry.js} +1 -1
  372. package/dist/twilight/{p-90976775.entry.js → p-df9267ca.entry.js} +1 -1
  373. package/dist/twilight/{p-44ed9315.entry.js → p-eba770b4.entry.js} +1 -1
  374. package/dist/twilight/{p-9cb07624.entry.js → p-ee67787c.entry.js} +1 -1
  375. package/dist/twilight/{p-c1b56f08.entry.js → p-f303739b.entry.js} +1 -1
  376. package/dist/twilight/{p-3e9bba4f.entry.js → p-f834ded2.entry.js} +1 -1
  377. package/dist/twilight/{p-b69cc47d.entry.js → p-f855ad35.entry.js} +1 -1
  378. package/dist/twilight/{p-1695dd23.entry.js → p-faf369b8.entry.js} +1 -1
  379. package/dist/twilight/{p-4e16be16.entry.js → p-fc26088c.entry.js} +1 -1
  380. package/dist/twilight/{p-BHY6Sj5y.js → p-jgiIvZFz.js} +1 -1
  381. package/dist/twilight/p-lMgMt31Q.js +4 -0
  382. package/dist/twilight/{p-BZ24UYWJ.js → p-qT0_dvbw.js} +1 -1
  383. package/dist/twilight/twilight.esm.js +1 -1
  384. package/dist/types/components/salla-comments/interfaces.d.ts +6 -0
  385. package/dist/types/components/salla-comments/salla-comment-factors.d.ts +6 -0
  386. package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -0
  387. package/dist/types/components/salla-comments/salla-comments.d.ts +2 -2
  388. package/dist/types/components/salla-rating-modal/order-feedback-response.d.ts +32 -0
  389. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +151 -0
  390. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +5 -1
  391. package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +13 -0
  392. package/dist/types/components/salla-review-factors-tags/helpers.d.ts +16 -0
  393. package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +17 -0
  394. package/dist/types/components/salla-review-factors-tags/salla-review-factors-tags.d.ts +24 -0
  395. package/dist/types/components/salla-reviews-summary/interfaces.d.ts +5 -0
  396. package/dist/types/components/salla-reviews-summary/salla-reviews-summary.d.ts +2 -0
  397. package/dist/types/components.d.ts +114 -2
  398. package/package.json +5 -5
  399. package/dist/twilight/p-38c82b5b.entry.js +0 -4
  400. package/dist/twilight/p-db3da75c.entry.js +0 -4
  401. package/dist/twilight/p-e10eed6e.entry.js +0 -4
  402. package/dist/twilight/p-e52bbc5f.entry.js +0 -4
@@ -0,0 +1,1060 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ 'use strict';
5
+
6
+ var index = require('./index-CfrGmYJa.js');
7
+ var star = require('./star-DMzrN05M.js');
8
+ var shippingFast = require('./shipping-fast-CsqEQE78.js');
9
+ var checkCircle2 = require('./check-circle2-BDvlT4_n.js');
10
+ var Helper = require('./Helper-B2B-kxAI.js');
11
+ var image = require('./image-BoZ6Hums.js');
12
+ var whatsapp2 = require('./whatsapp2-BdMd5Gx1.js');
13
+ var mail = require('./mail-C9D8MHae.js');
14
+ require('./anime.es-BqW8JHZi.js');
15
+
16
+ const sallaRatingModalCss = ".s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{display:block;width:100%;height:100%;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-rating-row-main{margin-bottom:0.35rem;padding:0.5rem 0.6rem;border:1px solid #d1d5db;border-radius:0.45rem;background:transparent}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name{font-size:1rem;color:#5b6470}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{width:5rem;min-width:5rem;height:3.5rem;flex-shrink:0;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible !important;pointer-events:auto !important;margin-bottom:1rem}";
17
+
18
+ const SallaRatingModalV2 = class {
19
+ constructor(hostRef) {
20
+ index.registerInstance(this, hostRef);
21
+ this.hasError = false;
22
+ this.showContactWidget = true;
23
+ this.images = [];
24
+ this.productImages = {};
25
+ this.editItemImages = [];
26
+ this.productReviewFactors = {};
27
+ this.editFactorRatings = {};
28
+ this.productMainRatings = {};
29
+ this.productFactorRatings = {};
30
+ this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_subject', { store, id, customer });
31
+ this.editMode = false;
32
+ this.defaultMode = false;
33
+ this.deleteMode = false;
34
+ this.shouldOpenDeleteModal = false;
35
+ this.editItem = null;
36
+ this.allowAttachImages = false;
37
+ this.allowContactSupport = false;
38
+ this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
39
+ this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
40
+ this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
41
+ this.allowedImagesTypesLabel = salla.lang.get('common.uploader.allowed_images_types');
42
+ this.threeImagesMax = salla.lang.get('common.uploader.max_three_images');
43
+ this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
44
+ this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
45
+ this.cancelLabel = salla.lang.get('common.elements.cancel');
46
+ this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
47
+ this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
48
+ this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
49
+ this.contactUsLabel = salla.lang.get('blocks.footer.social');
50
+ this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
51
+ this.overallProductRatingLabel = salla.lang.get('pages.rating.overall_product_rating');
52
+ this.contentRefs = [];
53
+ this.hiddenInputs = [];
54
+ this.userFilledFactorKeys = {};
55
+ this.boundRatingRows = new WeakSet();
56
+ this.stepsCount = 0;
57
+ this.currentIndex = 0;
58
+ this.submitted = [];
59
+ this.MAX_UPLOAD_LIMIT = 3;
60
+ this.thanksCountdownInterval = null;
61
+ this.scheduleWizardSetup = false;
62
+ salla.lang.onLoaded(() => {
63
+ this.contactUsLabel = salla.lang.get('blocks.footer.social');
64
+ const setNestedAsync = (lang, key, value) => {
65
+ return new Promise(resolve => {
66
+ salla.helpers.setNested(salla.lang.messages[lang], key, value);
67
+ resolve(true);
68
+ });
69
+ };
70
+ const setTranslations = async () => {
71
+ await setNestedAsync('ar.trans', 'common.uploader.drag_and_drop_files', 'اسحب الملفات وأفلتها هنا');
72
+ await setNestedAsync('en.trans', 'common.uploader.drag_and_drop_files', 'Drag and drop files here');
73
+ await setNestedAsync('ar.trans', 'common.uploader.allowed_images_types', ' .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة');
74
+ await setNestedAsync('en.trans', 'common.uploader.allowed_images_types', 'Images in jpg, jpeg, or png format are allowed.');
75
+ await setNestedAsync('ar.trans', 'pages.rating.add_images', 'اضافة صور');
76
+ await setNestedAsync('en.trans', 'pages.rating.add_images', 'Add Images');
77
+ await setNestedAsync('ar.trans', 'pages.rating.edit_images', 'تعديل الصور');
78
+ await setNestedAsync('en.trans', 'pages.rating.edit_images', 'Edit Images');
79
+ await setNestedAsync('ar.trans', 'pages.rating.edit_review', 'تعديل التقييم');
80
+ await setNestedAsync('en.trans', 'pages.rating.edit_review', 'Edit review');
81
+ await setNestedAsync('ar.trans', 'pages.rating.confirm_deletion', 'تأكيد حذف التقييم');
82
+ await setNestedAsync('en.trans', 'pages.rating.confirm_deletion', 'Confirm review deletion');
83
+ await setNestedAsync('ar.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'هل أنت متأكد من حذف تقييمك؟');
84
+ await setNestedAsync('en.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'Are you sure you want to delete your review?');
85
+ await setNestedAsync('ar.trans', 'pages.rating.review_updated_successfully', 'تم تعديل التقييم بنجاح');
86
+ await setNestedAsync('en.trans', 'pages.rating.review_updated_successfully', 'The review has been successfully updated.');
87
+ await setNestedAsync('ar.trans', 'pages.rating.review_deleted_successfully', 'تم حذف التقييم بنجاح');
88
+ await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
89
+ await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
90
+ await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
91
+ await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`);
92
+ await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`);
93
+ await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
94
+ await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
95
+ await setNestedAsync('ar.trans', 'pages.rating.rate_required_factors', 'يرجى تقييم جميع المعايير لإتمام مراجعتك.');
96
+ await setNestedAsync('en.trans', 'pages.rating.rate_required_factors', 'Please rate all required factors to complete your review.');
97
+ await setNestedAsync('ar.trans', 'pages.rating.overall_product_rating', 'التقييم العام للمنتج');
98
+ await setNestedAsync('en.trans', 'pages.rating.overall_product_rating', 'Overall product rating');
99
+ this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
100
+ this.allowedImagesTypesLabel = salla.lang.get('common.uploader.allowed_images_types');
101
+ this.threeImagesMax = salla.lang.get('common.uploader.max_three_images');
102
+ this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
103
+ this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
104
+ this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
105
+ this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
106
+ this.cancelLabel = salla.lang.get('common.elements.cancel');
107
+ this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
108
+ this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
109
+ this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
110
+ this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
111
+ this.overallProductRatingLabel = salla.lang.get('pages.rating.overall_product_rating');
112
+ this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_body', { store, id, customer });
113
+ };
114
+ setTranslations();
115
+ });
116
+ }
117
+ /**
118
+ * Show the rating modal
119
+ */
120
+ syncStoreSettings() {
121
+ if (!this.orderId) {
122
+ this.orderId = salla.config.get('page.id');
123
+ }
124
+ this.allowAttachImages = !!salla.config.get('store.settings.rating.allow_attach_images');
125
+ this.allowContactSupport = !!salla.config.get('store.settings.rating.allow_contact_support');
126
+ }
127
+ /** Encrypted order id from page config / prop — used to fetch order details. */
128
+ getRatingOrderId() {
129
+ return this.orderId || salla.config.get('page.id');
130
+ }
131
+ /** Numeric order id from API response — used when submitting ratings. */
132
+ getSubmitOrderId() {
133
+ return this.orderId;
134
+ }
135
+ isCustomerOrderShape(value) {
136
+ if (!value || typeof value !== 'object') {
137
+ return false;
138
+ }
139
+ const record = value;
140
+ return (!!record.rating &&
141
+ (Array.isArray(record.items) ||
142
+ Array.isArray(record.products) ||
143
+ Array.isArray(record.rating?.product) ||
144
+ Array.isArray(record.rating?.products)));
145
+ }
146
+ getBootstrapOrder() {
147
+ const page = salla.config.get('page');
148
+ if (this.isCustomerOrderShape(page)) {
149
+ return page;
150
+ }
151
+ if (page && typeof page === 'object') {
152
+ const pageRecord = page;
153
+ if (Array.isArray(pageRecord.products)) {
154
+ return page;
155
+ }
156
+ const nestedOrder = pageRecord.order;
157
+ if (this.isCustomerOrderShape(nestedOrder)) {
158
+ return nestedOrder;
159
+ }
160
+ }
161
+ return undefined;
162
+ }
163
+ async loadCustomerOrderForEdit() {
164
+ const bootstrapOrder = this.getBootstrapOrder();
165
+ if (bootstrapOrder?.rating?.product || bootstrapOrder?.rating?.products) {
166
+ this.order = bootstrapOrder;
167
+ return;
168
+ }
169
+ try {
170
+ const response = await salla.api.withoutNotifier(() => salla.order.api.getDetails(this.getRatingOrderId()));
171
+ if (response?.data) {
172
+ this.order = response.data;
173
+ }
174
+ }
175
+ catch (_error) {
176
+ if (!this.order) {
177
+ const orderResponse = await salla.api.withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()));
178
+ this.order = orderResponse.data;
179
+ }
180
+ }
181
+ }
182
+ getOrderProductRatings(order = this.order) {
183
+ if (!order?.rating) {
184
+ return [];
185
+ }
186
+ return [
187
+ ...this.normalizeToArray(order.rating.product),
188
+ ...this.normalizeToArray(order.rating.products),
189
+ ];
190
+ }
191
+ getMatchedProductRating(order = this.order, productId, feedbackId) {
192
+ return this.getOrderProductRatings(order).find(entry => Number(entry?.id ?? entry?.feedback_id) === Number(feedbackId) ||
193
+ Number(entry?.product_id ?? entry?.product?.id) === Number(productId));
194
+ }
195
+ hasRatingFeedback(feedback) {
196
+ const rating = feedback?.rating;
197
+ return rating !== undefined && rating !== null && rating !== '' && Number(rating) > 0;
198
+ }
199
+ isTestimonialsEnabled(order = this.order) {
200
+ if (order?.testimonials_enabled === false) {
201
+ return false;
202
+ }
203
+ if (this.hasRatingFeedback(order?.store?.feedback)) {
204
+ return false;
205
+ }
206
+ if (order?.testimonials_enabled === true) {
207
+ return true;
208
+ }
209
+ return !!order?.allowed_ratings?.testimonials_enabled;
210
+ }
211
+ isProductsEnabled(order = this.order) {
212
+ if (order?.products_enabled === false) {
213
+ return false;
214
+ }
215
+ return this.getRateableProducts(order).length > 0;
216
+ }
217
+ isShippingEnabled(order = this.order) {
218
+ if (order?.shipping_enabled === false) {
219
+ return false;
220
+ }
221
+ if (this.hasRatingFeedback(order?.shipping?.feedback)) {
222
+ return false;
223
+ }
224
+ if (!order?.shipping?.company) {
225
+ return false;
226
+ }
227
+ if (order?.shipping_enabled === true) {
228
+ return true;
229
+ }
230
+ return !!order?.allowed_ratings?.shipping_enabled;
231
+ }
232
+ getOrderProducts(order = this.order) {
233
+ if (!Array.isArray(order?.products)) {
234
+ return [];
235
+ }
236
+ return order.products.filter(item => item?.product?.id);
237
+ }
238
+ getRateableProducts(order = this.order) {
239
+ return this.getOrderProducts(order).filter(item => !this.hasRatingFeedback(item?.feedback));
240
+ }
241
+ getStepsCount(order = this.order) {
242
+ if (!order) {
243
+ return 0;
244
+ }
245
+ let count = 0;
246
+ if (this.isTestimonialsEnabled(order)) {
247
+ count++;
248
+ }
249
+ if (this.isProductsEnabled(order)) {
250
+ count += this.getRateableProducts(order).length;
251
+ }
252
+ if (this.isShippingEnabled(order) && order.shipping?.company) {
253
+ count++;
254
+ }
255
+ return count;
256
+ }
257
+ afterOrderLoaded() {
258
+ this.stepsCount = this.getStepsCount();
259
+ this.scheduleWizardSetup = true;
260
+ index.forceUpdate(this);
261
+ }
262
+ async open() {
263
+ await salla.onReady();
264
+ this.syncStoreSettings();
265
+ this.defaultMode = true;
266
+ this.currentIndex = 0;
267
+ this.submitted = [];
268
+ return new Promise(resolve => {
269
+ setTimeout(() => {
270
+ this.modal
271
+ .open()
272
+ .then(() => this.order ||
273
+ salla.api
274
+ .withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
275
+ .then(async (res) => {
276
+ this.order = res.data;
277
+ this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
278
+ }))
279
+ .then(() => this.modal.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
280
+ .then(() => {
281
+ // Initialize productImages for all products
282
+ const initialImages = {};
283
+ for (const item of this.getRateableProducts()) {
284
+ initialImages[item.product.id] = [];
285
+ }
286
+ this.productImages = initialImages;
287
+ })
288
+ .then(() => this.modal.stopLoading())
289
+ .then(() => this.afterOrderLoaded())
290
+ .catch(e => {
291
+ resolve(false);
292
+ this.hasError = true;
293
+ this.errorMessage = e.response?.data?.error?.message || e.response?.data;
294
+ this.modal.stopLoading();
295
+ });
296
+ resolve(true);
297
+ }, 50);
298
+ });
299
+ }
300
+ async openEditModal(params) {
301
+ await salla.onReady();
302
+ this.syncStoreSettings();
303
+ this.defaultMode = false;
304
+ this.editMode = true;
305
+ this.editType = params.type;
306
+ this.editFeedbackId = params.feedback_id;
307
+ try {
308
+ await this.fetchEditItem(params.feedback_id);
309
+ if (this.editType === 'product' && this.editItem?.product?.id) {
310
+ await this.loadCustomerOrderForEdit();
311
+ await this.ensureProductFactorsLoaded(this.editItem.product.id);
312
+ this.editFactorRatings = { ...this.buildEditFactorRatings(this.editItem.product.id) };
313
+ this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id, this.editFactorRatings);
314
+ }
315
+ this.editModal.open();
316
+ }
317
+ catch (e) {
318
+ this.hasError = true;
319
+ this.errorMessage = e.response?.data?.error?.message || e.response?.data;
320
+ }
321
+ }
322
+ async fetchEditItem(feedbackId) {
323
+ const endpoint = `rating/${feedbackId}/show`;
324
+ const response = await salla.api.request(endpoint);
325
+ this.editItem = response.data;
326
+ if (this.allowAttachImages && this.editType == 'product' && this.editItem.images.length) {
327
+ this.editItemImages = this.editItem.images.map(img => {
328
+ return { id: `${Math.floor(100 + Math.random() * 900)}`, url: img };
329
+ });
330
+ }
331
+ }
332
+ async editReview() {
333
+ const endpoint = `rating/${this.editFeedbackId}`;
334
+ let data;
335
+ if (this.editType === 'product') {
336
+ const container = this.editModal.querySelector('[data-type="products"]') || this.currentTab;
337
+ data = this.buildProductRatingPayload(this.collectFormData(container), container);
338
+ if (!data.product_id && this.editItem?.product?.id) {
339
+ data.product_id = String(this.editItem.product.id);
340
+ }
341
+ }
342
+ else {
343
+ data = this.collectFormData(this.editModal);
344
+ data.images && (data.images = data.images.split(','));
345
+ }
346
+ await salla.api.request(endpoint, data, 'put').then(res => {
347
+ this.editModal.close();
348
+ salla.notify.success(res.message || this.updatedSuccessfullyLabel);
349
+ setTimeout(() => {
350
+ window.location.reload();
351
+ }, 500);
352
+ });
353
+ }
354
+ async openDeleteModal(params) {
355
+ this.defaultMode = false;
356
+ this.deleteMode = true;
357
+ this.deleteFeedbackId = params.feedback_id;
358
+ this.shouldOpenDeleteModal = true;
359
+ return new Promise(resolve => {
360
+ setTimeout(() => {
361
+ this.deleteModal.open().then(() => resolve(true));
362
+ }, 50);
363
+ });
364
+ }
365
+ async deleteReview() {
366
+ const endpoint = `rating/${this.deleteFeedbackId}`;
367
+ await salla.api.request(endpoint, null, 'delete').then(() => {
368
+ this.deleteModal.close();
369
+ salla.notify.success(this.deletedSuccessfullyLabel);
370
+ setTimeout(() => {
371
+ window.location.reload();
372
+ }, 500);
373
+ });
374
+ }
375
+ /**
376
+ * Show the rating modal
377
+ */
378
+ async close() {
379
+ return this.modal.close();
380
+ }
381
+ // handle wizard
382
+ handleWizard() {
383
+ this.steps = this.modal.querySelectorAll('.s-rating-modal-step');
384
+ this.dots = this.modal.querySelectorAll('.s-rating-modal-step-dot');
385
+ if (this.stepsCount === 0) {
386
+ this.showThankYou();
387
+ return;
388
+ }
389
+ this.showActiveStep();
390
+ }
391
+ refreshWizardRefs() {
392
+ if (!this.modal) {
393
+ return;
394
+ }
395
+ this.steps = this.modal.querySelectorAll('.s-rating-modal-step');
396
+ this.dots = this.modal.querySelectorAll('.s-rating-modal-step-dot');
397
+ }
398
+ showActiveStep(current = null) {
399
+ this.refreshWizardRefs();
400
+ this.currentTab = current || this.steps[this.currentIndex];
401
+ if (!this.currentTab) {
402
+ return;
403
+ }
404
+ Helper.Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', dot => dot != this.dots[this.currentIndex]).toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', tab => tab == this.currentTab);
405
+ if (this.currentIndex !== 0) {
406
+ // the animation
407
+ Helper.Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
408
+ setTimeout(() => Helper.Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
409
+ }
410
+ // Btn text
411
+ const nextType = this.steps[this.currentIndex + 1]?.dataset.type;
412
+ this.nextBtn?.setText(nextType
413
+ ? `${salla.lang.get('pages.rating.rate')} ${salla.lang.get(`pages.rating.${nextType}`)}`
414
+ : salla.lang.get('pages.rating.send_ratings'));
415
+ setTimeout(() => this.updateBodyHeight(), 0);
416
+ setTimeout(() => this.updateBodyHeight(), 150);
417
+ }
418
+ updateBodyHeight() {
419
+ if (!this.body || !this.currentTab) {
420
+ return;
421
+ }
422
+ // Product step contains async uploader mount; keep height auto to prevent clipping.
423
+ if (this.currentTab.dataset.type === 'products') {
424
+ this.body.style.height = 'auto';
425
+ return;
426
+ }
427
+ const extraHeight = this.editMode ? 60 : 0;
428
+ this.body.style.height = `${this.currentTab.offsetHeight + extraHeight}px`;
429
+ }
430
+ previousTab() {
431
+ this.currentIndex > 0 && this.currentIndex--;
432
+ Helper.Helper.toggleElementClassIf(this.backBtn, 's-rating-modal-unvisiable', 'block', () => this.currentIndex == 0);
433
+ this.showActiveStep();
434
+ }
435
+ async submit() {
436
+ this.refreshWizardRefs();
437
+ try {
438
+ if (!this.submittedBefore()) {
439
+ this.validate();
440
+ }
441
+ salla.config.canLeave = false;
442
+ await this.nextBtn.load();
443
+ if (!this.submittedBefore()) {
444
+ await this.sendFeedback();
445
+ }
446
+ this.currentTab
447
+ ?.querySelectorAll('[name],.s-rating-modal-btn-star')
448
+ .forEach(el => el.setAttribute('disabled', ''));
449
+ if (this.currentIndex < this.stepsCount) {
450
+ this.currentIndex++;
451
+ }
452
+ this.showActiveStep();
453
+ Helper.Helper.toggleClassIf('#prev-btn', 'block', 's-rating-modal-unvisiable', () => true);
454
+ if (this.currentIndex === this.stepsCount) {
455
+ this.showThankYou();
456
+ this.showContactWidget = false;
457
+ }
458
+ }
459
+ finally {
460
+ this.nextBtn.stop();
461
+ salla.config.canLeave = true;
462
+ }
463
+ }
464
+ submittedBefore() {
465
+ return this.submitted.includes(this.currentIndex);
466
+ }
467
+ getRatingHiddenInput(container) {
468
+ const element = container;
469
+ const directInput = element.querySelector?.('.rating_hidden_input');
470
+ if (directInput?.name) {
471
+ return directInput;
472
+ }
473
+ const starsComponent = element.querySelector?.('salla-rating-stars');
474
+ return (starsComponent?.shadowRoot?.querySelector('.rating_hidden_input') ||
475
+ null);
476
+ }
477
+ collectNamedInputs(container) {
478
+ const seen = new Set();
479
+ const inputs = [];
480
+ const addInput = (input) => {
481
+ if (!input?.name || seen.has(input)) {
482
+ return;
483
+ }
484
+ seen.add(input);
485
+ inputs.push(input);
486
+ };
487
+ container.querySelectorAll('[name]').forEach((input) => {
488
+ addInput(input);
489
+ });
490
+ container.querySelectorAll('salla-rating-stars').forEach((stars) => {
491
+ addInput(this.getRatingHiddenInput(stars));
492
+ });
493
+ return inputs;
494
+ }
495
+ normalizeFactorsList(factors) {
496
+ if (!factors) {
497
+ return [];
498
+ }
499
+ if (Array.isArray(factors)) {
500
+ return factors;
501
+ }
502
+ if (typeof factors === 'object') {
503
+ return Object.values(factors).filter(entry => entry && typeof entry === 'object');
504
+ }
505
+ return [];
506
+ }
507
+ validate(rating = null, type = null) {
508
+ if (!rating && this.currentTab.dataset.type === 'products') {
509
+ const ratingForms = this.currentTab.querySelectorAll('.rating-outer-form');
510
+ ratingForms.forEach(ratingForm => this.validate(ratingForm, 'product'));
511
+ return;
512
+ }
513
+ rating = rating || this.currentTab;
514
+ const mainRatingRow = rating.querySelector('.s-rating-modal-product-rating-row-main');
515
+ const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || rating);
516
+ const stars = mainRatingInput?.value;
517
+ const validationMessage = rating.querySelector('.s-rating-modal-validation-msg');
518
+ type = type || rating.dataset.type;
519
+ if (!stars) {
520
+ validationMessage.innerHTML = salla.lang
521
+ .get(`pages.rating.rate_${type}_stars`)
522
+ .replace(' (:item)', '');
523
+ throw new Error(validationMessage.innerHTML);
524
+ }
525
+ if (type === 'product') {
526
+ const requiredFactorRows = Array.from(rating.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]'));
527
+ const hasMissingRequiredFactor = requiredFactorRows.some((row) => {
528
+ const factorStarsInput = this.getRatingHiddenInput(row);
529
+ return !factorStarsInput?.value;
530
+ });
531
+ if (hasMissingRequiredFactor) {
532
+ validationMessage.innerHTML = this.requiredFactorsLabel;
533
+ throw new Error(validationMessage.innerHTML);
534
+ }
535
+ }
536
+ validationMessage.innerHTML = '';
537
+ }
538
+ collectFormData(container = this.currentTab) {
539
+ const data = {};
540
+ this.collectNamedInputs(container).forEach((input) => {
541
+ const inputData = salla.helpers.inputData(input.name, input.value, data);
542
+ data[inputData.name] = inputData.value;
543
+ });
544
+ return data;
545
+ }
546
+ buildProductRatingPayload(data, container = this.currentTab) {
547
+ if (!data.rating) {
548
+ const mainRatingRow = container.querySelector('.s-rating-modal-product-rating-row-main');
549
+ const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || container);
550
+ if (mainRatingInput?.value) {
551
+ data.rating = mainRatingInput.value;
552
+ }
553
+ }
554
+ const productId = Number(data.product_id);
555
+ let images = [];
556
+ if (data.images) {
557
+ images =
558
+ typeof data.images === 'string' ? data.images.split(',').filter(Boolean) : data.images;
559
+ }
560
+ else if (this.editMode && this.allowAttachImages && productId) {
561
+ images = this.editItemImages.map(img => img.url);
562
+ }
563
+ else if (this.allowAttachImages && productId) {
564
+ images = (this.productImages[productId] || []).map(img => img.url);
565
+ }
566
+ const factors = this.normalizeFactorsList(data.factors)
567
+ .filter(factor => factor?.id && factor?.rating)
568
+ .map(factor => ({
569
+ id: String(factor.id),
570
+ rating: String(factor.rating),
571
+ }));
572
+ return {
573
+ order_id: this.getSubmitOrderId(),
574
+ product_id: String(data.product_id),
575
+ rating: String(data.rating),
576
+ comment: data.comment || data.content || '',
577
+ images,
578
+ factors,
579
+ type: 'products',
580
+ };
581
+ }
582
+ async sendFeedback() {
583
+ this.refreshWizardRefs();
584
+ const stepType = this.currentTab?.dataset?.type;
585
+ if (stepType === 'products') {
586
+ const data = this.collectFormData(this.currentTab);
587
+ const payload = this.buildProductRatingPayload(data, this.currentTab);
588
+ if (!payload.product_id || !payload.rating) {
589
+ throw new Error('Missing product rating data');
590
+ }
591
+ const res = await salla.rating.api.products(payload);
592
+ this.submitted.push(this.currentIndex);
593
+ return res;
594
+ }
595
+ const data = this.collectFormData(this.currentTab);
596
+ if (Object.keys(data).length === 0) {
597
+ return;
598
+ }
599
+ data.order_id = this.getSubmitOrderId();
600
+ data.type = stepType;
601
+ const res = await salla.rating.api[stepType](data);
602
+ this.submitted.push(this.currentIndex);
603
+ return res;
604
+ }
605
+ clearThanksCountdown() {
606
+ if (this.thanksCountdownInterval !== null) {
607
+ clearInterval(this.thanksCountdownInterval);
608
+ this.thanksCountdownInterval = null;
609
+ }
610
+ }
611
+ showThankYou() {
612
+ let seconds = 10;
613
+ this.clearThanksCountdown();
614
+ this.thanksCountdownInterval = setInterval(() => {
615
+ this.thanksTime.innerHTML = `00:0${seconds--}`;
616
+ if (seconds > 0) {
617
+ return;
618
+ }
619
+ this.clearThanksCountdown();
620
+ this.thanksTime.remove();
621
+ this.close().then(() => window.location.reload());
622
+ }, 1000);
623
+ this.modal.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
624
+ this.showActiveStep(this.thanksTab);
625
+ }
626
+ getFilepondPlaceholder() {
627
+ return `<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${image.ImageIcon}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>
628
+ <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`;
629
+ }
630
+ getCustomerName() {
631
+ let firstName = salla.config.get('user.first_name') || salla.storage.get('user.first_name') || '';
632
+ let lasName = salla.config.get('user.last_name') || salla.storage.get('user.last_name') || '';
633
+ return `${firstName} ${lasName}`;
634
+ }
635
+ normalizeReviewFactorsPayload(payload) {
636
+ const data = payload?.data ?? payload?.factors;
637
+ if (!Array.isArray(data)) {
638
+ return [];
639
+ }
640
+ return data.flatMap(entry => {
641
+ const items = Array.isArray(entry?.items) ? [...entry.items] : null;
642
+ // Nested form shape: only use items[].id, ignore parent entry id
643
+ if (items?.length) {
644
+ items.sort((a, b) => (Number(a?.sort) || 0) - (Number(b?.sort) || 0));
645
+ const isRequired = !!entry?.is_required;
646
+ return items
647
+ .filter(item => item?.id != null && item?.id !== '')
648
+ .map(item => ({
649
+ id: item.id,
650
+ name: item?.name,
651
+ required: isRequired,
652
+ }));
653
+ }
654
+ // Legacy flat shape (no items array)
655
+ if (entry?.id == null || entry?.id === '') {
656
+ return [];
657
+ }
658
+ return [
659
+ {
660
+ id: entry.id,
661
+ name: entry?.name,
662
+ required: entry?.required ?? entry?.is_required ?? false,
663
+ },
664
+ ];
665
+ });
666
+ }
667
+ async fetchProductReviewFactors(productId) {
668
+ try {
669
+ const response = await salla.api.request(`review/factors/${productId}/form`);
670
+ return this.normalizeReviewFactorsPayload(response);
671
+ }
672
+ catch (_error) {
673
+ return [];
674
+ }
675
+ }
676
+ async fetchAllProductReviewFactors(order) {
677
+ const products = this.getRateableProducts(order);
678
+ if (!products.length) {
679
+ return {};
680
+ }
681
+ const pairs = await Promise.all(products.map(async (item) => {
682
+ const factors = await this.fetchProductReviewFactors(item.product.id);
683
+ return [item.product.id, factors];
684
+ }));
685
+ return Object.fromEntries(pairs);
686
+ }
687
+ async ensureProductFactorsLoaded(productId) {
688
+ if (!productId || this.productReviewFactors[productId]) {
689
+ return;
690
+ }
691
+ const factors = await this.fetchProductReviewFactors(productId);
692
+ this.productReviewFactors = {
693
+ ...this.productReviewFactors,
694
+ [productId]: factors,
695
+ };
696
+ }
697
+ getFactorFieldName(prefix, factorIndex, field) {
698
+ return prefix
699
+ ? `${prefix}[factors][${factorIndex}][${field}]`
700
+ : `factors[${factorIndex}][${field}]`;
701
+ }
702
+ normalizeToArray(value) {
703
+ if (value === null || value === undefined) {
704
+ return [];
705
+ }
706
+ return Array.isArray(value) ? value : [value];
707
+ }
708
+ isFactorReviewsList(value) {
709
+ return (Array.isArray(value) &&
710
+ value.length > 0 &&
711
+ value.every(item => item &&
712
+ typeof item === 'object' &&
713
+ (item['rating'] !== undefined ||
714
+ item['stars'] !== undefined ||
715
+ item['value'] !== undefined)));
716
+ }
717
+ getFactorReviewsFromRecord(record) {
718
+ if (!record) {
719
+ return [];
720
+ }
721
+ for (const key of ['factor_reviews', 'review_factors', 'factors']) {
722
+ const value = record[key];
723
+ if (this.isFactorReviewsList(value)) {
724
+ return value;
725
+ }
726
+ }
727
+ return [];
728
+ }
729
+ getEditFactorReviewsList(productId) {
730
+ const orderSources = [this.order, this.getBootstrapOrder()].filter(Boolean);
731
+ for (const order of orderSources) {
732
+ const matchedRating = this.getMatchedProductRating(order, productId, this.editFeedbackId);
733
+ const reviews = this.getFactorReviewsFromRecord(matchedRating);
734
+ if (reviews.length) {
735
+ return reviews;
736
+ }
737
+ }
738
+ const matchedOrderProduct = this.getOrderProducts(this.order).find(item => Number(item.product?.id) === Number(productId));
739
+ const sources = [
740
+ this.editItem?.factor_reviews,
741
+ this.editItem?.review_factors,
742
+ this.editItem?.product?.review_factors,
743
+ this.editItem?.product?.factor_reviews,
744
+ this.editItem?.factors,
745
+ matchedOrderProduct?.factor_reviews,
746
+ matchedOrderProduct?.review_factors,
747
+ matchedOrderProduct?.feedback?.factor_reviews,
748
+ ];
749
+ for (const source of sources) {
750
+ if (Array.isArray(source) && source.length > 0) {
751
+ return source;
752
+ }
753
+ }
754
+ return [];
755
+ }
756
+ getFactorKey(factor, factorIndex) {
757
+ if (factor.id !== undefined && factor.id !== null && factor.id !== '') {
758
+ return `id:${factor.id}`;
759
+ }
760
+ if (factor.name) {
761
+ return `name:${factor.name.trim()}`;
762
+ }
763
+ return `index:${factorIndex}`;
764
+ }
765
+ getFactorRatingsForProduct(productId) {
766
+ return this.editMode ? this.editFactorRatings : this.productFactorRatings[productId] || {};
767
+ }
768
+ setFactorRatingsForProduct(productId, ratings) {
769
+ if (this.editMode) {
770
+ this.editFactorRatings = ratings;
771
+ return;
772
+ }
773
+ this.productFactorRatings = { ...this.productFactorRatings, [productId]: ratings };
774
+ }
775
+ markExistingFactorRatingsAsUserFilled(productId, factorRatings) {
776
+ const factors = this.productReviewFactors[productId] || [];
777
+ const userFilled = new Set();
778
+ factors.forEach((factor, index) => {
779
+ const key = this.getFactorKey(factor, index);
780
+ const byId = factor.id !== undefined ? factorRatings[String(factor.id)] : undefined;
781
+ const byName = factor.name ? factorRatings[factor.name.trim()] : undefined;
782
+ const byIndex = factorRatings[`__index_${index}`];
783
+ if (byId !== undefined || byName !== undefined || byIndex !== undefined) {
784
+ userFilled.add(key);
785
+ }
786
+ });
787
+ this.userFilledFactorKeys[productId] = userFilled;
788
+ }
789
+ shouldAutofillFactors(mainRating) {
790
+ return mainRating === 4 || mainRating === 5;
791
+ }
792
+ autofillUnfilledFactors(productId, mainRating) {
793
+ const factors = this.productReviewFactors[productId] || [];
794
+ if (!factors.length) {
795
+ return;
796
+ }
797
+ const userFilled = this.userFilledFactorKeys[productId] || new Set();
798
+ const currentRatings = { ...this.getFactorRatingsForProduct(productId) };
799
+ const shouldAutofill = this.shouldAutofillFactors(mainRating);
800
+ let updated = false;
801
+ factors.forEach((factor, index) => {
802
+ const key = this.getFactorKey(factor, index);
803
+ if (userFilled.has(key)) {
804
+ return;
805
+ }
806
+ if (shouldAutofill) {
807
+ if (factor.id !== undefined) {
808
+ currentRatings[String(factor.id)] = mainRating;
809
+ }
810
+ if (factor.name) {
811
+ currentRatings[factor.name.trim()] = mainRating;
812
+ }
813
+ currentRatings[`__index_${index}`] = mainRating;
814
+ updated = true;
815
+ return;
816
+ }
817
+ if (factor.id !== undefined && currentRatings[String(factor.id)] !== undefined) {
818
+ delete currentRatings[String(factor.id)];
819
+ updated = true;
820
+ }
821
+ if (factor.name && currentRatings[factor.name.trim()] !== undefined) {
822
+ delete currentRatings[factor.name.trim()];
823
+ updated = true;
824
+ }
825
+ if (currentRatings[`__index_${index}`] !== undefined) {
826
+ delete currentRatings[`__index_${index}`];
827
+ updated = true;
828
+ }
829
+ });
830
+ if (updated) {
831
+ this.setFactorRatingsForProduct(productId, currentRatings);
832
+ }
833
+ }
834
+ handleMainRatingChange(productId, rating) {
835
+ if (this.editMode) {
836
+ this.editMainRating = rating;
837
+ }
838
+ else {
839
+ this.productMainRatings = { ...this.productMainRatings, [productId]: rating };
840
+ }
841
+ this.autofillUnfilledFactors(productId, rating);
842
+ }
843
+ handleFactorRatingChange(productId, factorKey, rating) {
844
+ if (!this.userFilledFactorKeys[productId]) {
845
+ this.userFilledFactorKeys[productId] = new Set();
846
+ }
847
+ this.userFilledFactorKeys[productId].add(factorKey);
848
+ const factors = this.productReviewFactors[productId] || [];
849
+ const factorIndex = factors.findIndex((factor, index) => this.getFactorKey(factor, index) === factorKey);
850
+ if (factorIndex < 0) {
851
+ return;
852
+ }
853
+ const factor = factors[factorIndex];
854
+ const currentRatings = { ...this.getFactorRatingsForProduct(productId) };
855
+ if (factor.id !== undefined) {
856
+ currentRatings[String(factor.id)] = rating;
857
+ }
858
+ if (factor.name) {
859
+ currentRatings[factor.name.trim()] = rating;
860
+ }
861
+ currentRatings[`__index_${factorIndex}`] = rating;
862
+ this.setFactorRatingsForProduct(productId, currentRatings);
863
+ }
864
+ setupProductRatingAutofill(container, productId) {
865
+ if (!container || this.boundRatingRows.has(container)) {
866
+ return;
867
+ }
868
+ this.boundRatingRows.add(container);
869
+ container.addEventListener('click', event => {
870
+ const target = event.target;
871
+ if (!target.closest('.s-rating-stars-btn-star')) {
872
+ return;
873
+ }
874
+ const mainRow = target.closest('.s-rating-modal-product-rating-row-main');
875
+ const factorRow = target.closest('.s-rating-modal-product-factor-row');
876
+ requestAnimationFrame(() => {
877
+ if (mainRow && container.contains(mainRow)) {
878
+ const rating = Number(this.getRatingHiddenInput(mainRow)?.value);
879
+ if (rating > 0) {
880
+ this.handleMainRatingChange(productId, rating);
881
+ }
882
+ return;
883
+ }
884
+ if (factorRow && container.contains(factorRow)) {
885
+ const factorKey = factorRow.getAttribute('data-factor-key');
886
+ const rating = Number(this.getRatingHiddenInput(factorRow)?.value);
887
+ if (factorKey && rating > 0) {
888
+ this.handleFactorRatingChange(productId, factorKey, rating);
889
+ }
890
+ }
891
+ });
892
+ });
893
+ }
894
+ buildEditFactorRatings(productId) {
895
+ const factorReviews = this.getEditFactorReviewsList(productId);
896
+ return factorReviews.reduce((acc, factor, index) => {
897
+ const rating = Number(factor?.rating ?? factor?.stars ?? factor?.value);
898
+ if (Number.isNaN(rating)) {
899
+ return acc;
900
+ }
901
+ const factorId = factor?.id ?? factor?.factor_id;
902
+ if (factorId !== undefined && factorId !== null && factorId !== '') {
903
+ acc[String(factorId)] = rating;
904
+ }
905
+ if (factor?.name) {
906
+ acc[factor.name.trim()] = rating;
907
+ }
908
+ acc[`__index_${index}`] = rating;
909
+ return acc;
910
+ }, {});
911
+ }
912
+ renderProductStep(item, index$1) {
913
+ return (index.h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, index.h("div", { class: "s-rating-modal-product" }, index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-info-row" }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), index.h("h3", { class: "s-rating-modal-product-title" }, item.product.name)), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), index.h("input", { type: "hidden", name: "product_id", value: item.product.id }), index.h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.allowAttachImages && (index.h("div", { class: "s-rating-modal-uploader is-opened", ref: el => (this.contentRefs[index$1] = el) }, index.h("salla-file-upload", { name: "image", maxFilesCount: this.MAX_UPLOAD_LIMIT, imagePreviewHeight: 117, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: "image/png, image/jpeg, image/jpg", url: salla.url.api('upload'), onUploaded: e => {
914
+ this.productImages = {
915
+ ...this.productImages,
916
+ [item.product.id]: [...(this.productImages[item.product.id] || []), e.detail],
917
+ };
918
+ this.hiddenInputs[index$1].value = this.productImages[item.product.id]
919
+ .map(img => img.url)
920
+ .join(',');
921
+ }, onRemoved: e => {
922
+ const removedId = e.detail;
923
+ if (!removedId || !this.productImages[item.product.id])
924
+ return;
925
+ this.productImages = {
926
+ ...this.productImages,
927
+ [item.product.id]: this.productImages[item.product.id].filter(img => img.id !== removedId),
928
+ };
929
+ this.hiddenInputs[index$1].value = this.productImages[item.product.id]
930
+ .map(img => img.url)
931
+ .join(',');
932
+ }, labelIdle: this.getFilepondPlaceholder() }), index.h("input", { type: "hidden", name: "images", value: (this.productImages[item.product.id] || []).map(img => img.url).join(','), ref: el => (this.hiddenInputs[index$1] = el) }), this.renderUploadedImagesCount(item.product.id))))));
933
+ }
934
+ renderProductReviewFactors(productId, index$1, options = {}) {
935
+ const factors = this.productReviewFactors[productId] || [];
936
+ const fieldPrefix = options.fieldPrefix ?? `products[${index$1}]`;
937
+ const mainRatingName = fieldPrefix ? `${fieldPrefix}[rating]` : 'rating';
938
+ const factorRatings = {
939
+ ...(this.editMode ? {} : this.productFactorRatings[productId] || {}),
940
+ ...(options.factorRatings || {}),
941
+ };
942
+ const normalizedMainRating = Number(options.mainRating ??
943
+ (this.editMode ? this.editMainRating : this.productMainRatings[productId]));
944
+ const hasMainRating = !Number.isNaN(normalizedMainRating);
945
+ const getPrefilledFactorRating = (factor, factorIndex) => {
946
+ const byId = factor.id !== undefined ? factorRatings[String(factor.id)] : undefined;
947
+ const byName = factor.name ? factorRatings[factor.name.trim()] : undefined;
948
+ const byIndex = factorRatings[`__index_${factorIndex}`];
949
+ const normalized = Number(byId ?? byName ?? byIndex);
950
+ return Number.isNaN(normalized) ? undefined : normalized;
951
+ };
952
+ return (index.h("div", { class: "s-rating-modal-product-rating-rows", ref: el => this.setupProductRatingAutofill(el, productId) }, index.h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main" }, index.h("span", { class: "s-rating-modal-product-factor-name" }, this.overallProductRatingLabel, index.h("span", { class: "s-rating-modal-product-factor-required" }, "*")), index.h("salla-rating-stars", { size: "medium", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true, labelBeforeStars: true, tag: false })), factors.map((factor, factorIndex) => (index.h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row px-3", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, index.h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (index.h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), index.h("span", { class: "s-rating-modal-product-factor-name" }, factor.name, factor.required ? index.h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), index.h("salla-rating-stars", { size: "medium", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'rating'), key: `factor-rating-${factor.id ?? factorIndex}-${getPrefilledFactorRating(factor, factorIndex) ?? 0}`, value: getPrefilledFactorRating(factor, factorIndex), editable: options.alwaysEditable ||
953
+ typeof getPrefilledFactorRating(factor, factorIndex) === 'number', withLabel: true, labelBeforeStars: true, tag: false }))))));
954
+ }
955
+ handleSendEmail() {
956
+ const subject = `${this.contactSubjectLabel} #${this.order.id}`;
957
+ const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
958
+ const mailtoLink = `mailto:${salla.config.get('store.contacts.email')}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
959
+ window.open(mailtoLink, '_blank');
960
+ }
961
+ handleSendWhatsApp() {
962
+ const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
963
+ const whatsappLink = `https://wa.me/${salla.config.get('store.contacts.whatsapp')}?text=${encodeURIComponent(body)}`;
964
+ window.open(whatsappLink, '_blank');
965
+ }
966
+ resetData(isOpen) {
967
+ if (isOpen.detail) {
968
+ return;
969
+ }
970
+ this.clearThanksCountdown();
971
+ this.modal?.close();
972
+ this.editItem = null;
973
+ this.editItemImages = [];
974
+ this.editFactorRatings = {};
975
+ this.productMainRatings = {};
976
+ this.productFactorRatings = {};
977
+ this.editMainRating = undefined;
978
+ this.userFilledFactorKeys = {};
979
+ this.hiddenInputs[1] && (this.hiddenInputs[1].value = '');
980
+ this.deleteFeedbackId = null;
981
+ this.editFeedbackId = null;
982
+ this.shouldOpenDeleteModal = false;
983
+ this.editMode = false;
984
+ this.deleteMode = false;
985
+ this.defaultMode = false;
986
+ this.currentIndex = 0;
987
+ this.submitted = [];
988
+ this.scheduleWizardSetup = false;
989
+ }
990
+ getDeleteModal() {
991
+ return (index.h("salla-modal", { ref: modal => (this.deleteModal = modal), width: "xs", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, index.h("div", { class: "s-rating-modal-delete-wrapper", ref: el => (this.body = el) }, index.h("h3", null, this.confirmDeletionLabel), index.h("p", null, this.areYouSureLabel), index.h("div", { class: "s-rating-modal-delete-actions" }, index.h("salla-button", { loaderPosition: "center", onClick: () => this.deleteReview() }, this.confirmDeleteBtn), index.h("salla-button", { color: "danger", fill: "outline", onClick: () => this.deleteModal.close() }, this.cancelLabel)))));
992
+ }
993
+ renderUploadedImagesCount(productId) {
994
+ // In edit mode, use editItemImages; in default mode, use productImages
995
+ const imageCount = this.editMode
996
+ ? this.editItemImages.length
997
+ : (this.productImages[productId] || []).length;
998
+ return (index.h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.images_count', imageCount, {
999
+ current: imageCount,
1000
+ total: this.MAX_UPLOAD_LIMIT,
1001
+ })));
1002
+ }
1003
+ getEditModal() {
1004
+ return (index.h("salla-modal", { ref: modal => (this.editModal = modal), width: "md", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, index.h("div", { class: "s-rating-modal-edit-wrapper", ref: el => (this.body = el) }, this.editType === 'store' && this.editItem ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => (this.currentTab = currentTab) }, index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), index.h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), index.h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => (this.currentTab = currentTab) }, this.editItem.shipping.logo ? (index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (index.h("span", { class: "s-rating-modal-icon", innerHTML: shippingFast.ShippingFast })), index.h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), index.h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (index.h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => (this.currentTab = currentTab) }, index.h("div", { class: "s-rating-modal-product" }, index.h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, index.h("div", { class: "s-rating-modal-product-details" }, index.h("div", { class: "s-rating-modal-product-info-row" }, index.h("div", { class: "s-rating-modal-product-img-wrap" }, index.h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), index.h("h3", { class: "s-rating-modal-product-title" }, this.editItem.product.name)), this.renderProductReviewFactors(this.editItem.product.id, 0, {
1005
+ fieldPrefix: '',
1006
+ mainRating: this.editMainRating ?? Number(this.editItem.stars ?? this.editItem.rating),
1007
+ factorRatings: this.editFactorRatings,
1008
+ alwaysEditable: true,
1009
+ }), index.h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), index.h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), index.h("small", { class: "s-rating-modal-validation-msg" }))), this.allowAttachImages && (index.h("div", { class: "s-rating-modal-uploader is-opened", ref: el => (this.contentRefs[1] = el) }, index.h("salla-file-upload", { name: "images", allowMultiple: true, maxFilesCount: this.MAX_UPLOAD_LIMIT, imagePreviewHeight: 117, filePosterHeight: 117, "instant-upload": true, type: "feedback", files: JSON.stringify(this.editItemImages), payloadName: "files[]", id: `file-${this.editItem.product.id}`, title: this.editItem.product.name, instantUpload: true, accept: "image/png, image/jpeg, image/jpg", url: salla.url.api('upload'), onUploaded: e => {
1010
+ this.editItemImages = [
1011
+ ...this.editItemImages,
1012
+ e.detail,
1013
+ ];
1014
+ this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
1015
+ }, onRemoved: e => {
1016
+ const removedId = e.detail;
1017
+ if (!removedId)
1018
+ return;
1019
+ this.editItemImages = this.editItemImages.filter(img => img.id !== removedId);
1020
+ this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
1021
+ }, labelIdle: this.getFilepondPlaceholder() }), index.h("input", { type: "hidden", name: "images", value: this.editItemImages.map(img => img.url).join(','), ref: el => (this.hiddenInputs[1] = el) }), this.renderUploadedImagesCount(this.editItem.product.id)))))) : null, index.h("div", { class: "s-rating-modal-footer s-rating-modal-footer-end" }, index.h("salla-button", { "loader-position": "center", onClick: () => this.editReview() }, this.editReviewLabel)))));
1022
+ }
1023
+ render() {
1024
+ if (this.deleteMode) {
1025
+ return index.h(index.Host, { class: "s-rating-modal" }, this.getDeleteModal());
1026
+ }
1027
+ if (this.editMode) {
1028
+ return index.h(index.Host, { class: "s-rating-modal" }, this.getEditModal());
1029
+ }
1030
+ if (this.defaultMode) {
1031
+ return (index.h(index.Host, { class: "s-rating-modal" }, index.h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "md", ref: modal => (this.modal = modal) }, index.h("div", { slot: "loading" }, index.h("div", { class: "s-rating-modal-skeleton" }, index.h("salla-skeleton", { type: "circle", height: "80px", width: "80px" }), index.h("salla-skeleton", { height: "15px", width: "60%" }), index.h("salla-skeleton", { height: "10px", width: "30%" }), index.h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map(v => (index.h("div", { key: v, innerHTML: star.Star })))), index.h("salla-skeleton", { height: "100px", width: "100%" }), index.h("div", { class: "s-rating-modal-skeleton-footer" }, index.h("salla-skeleton", { height: "40px", width: "30%" })))), !this.hasError && this.order ? ([
1032
+ index.h("div", { class: "s-rating-modal-wrapper", ref: el => (this.body = el) }, this.isTestimonialsEnabled() ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: salla.config.get('store.logo', 'https://assets.salla.sa/cp/assets/images/logo-new.png'), alt: "store name", class: "s-rating-modal-store-logo" })), index.h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large" })), index.h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
1033
+ this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (index.h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, index.h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (index.h("div", { class: "s-rating-modal-rounded-icon" }, index.h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (index.h("span", { class: "s-rating-modal-icon", innerHTML: shippingFast.ShippingFast })), index.h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), index.h("div", { class: "s-rating-modal-stars-company" }, index.h("salla-rating-stars", { withLabel: true, size: "large" })), index.h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), index.h("small", { class: "s-rating-modal-validation-msg" }))) : (''), index.h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => (this.thanksTab = el) }, index.h("span", { class: "s-rating-modal-icon", innerHTML: checkCircle2.CheckCircle2 }), index.h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), index.h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), index.h("time", { class: "s-rating-modal-thanks-time", ref: el => (this.thanksTime = el) }))),
1034
+ this.allowContactSupport &&
1035
+ this.showContactWidget &&
1036
+ (salla.config.get('store.contacts.whatsapp') ||
1037
+ salla.config.get('store.contacts.email')) ? (index.h("div", { class: "s-rating-modal-contact" }, index.h("p", null, this.contactUsLabel), index.h("div", { class: "s-rating-modal-contact-icons" }, salla.config.get('store.contacts.whatsapp') && (index.h("span", { onClick: () => this.handleSendWhatsApp(), innerHTML: whatsapp2.WhatsappIcon })), salla.config.get('store.contacts.email') && (index.h("span", { onClick: () => this.handleSendEmail(), innerHTML: mail.email }))))) : (''),
1038
+ index.h("div", { class: "s-rating-modal-footer" }, index.h("button", { ref: el => (this.backBtn = el), onClick: () => this.previousTab(), class: "s-rating-modal-btn s-rating-modal-unvisiable" }, salla.lang.get('common.elements.back')), this.stepsCount > 1 ? (index.h("ul", { class: "s-rating-modal-dots" }, [...Array(this.stepsCount)].map((_, v) => (index.h("li", { key: v, class: "s-rating-modal-bg-gray s-rating-modal-step-dot" }))))) : (''), index.h("salla-button", { "loader-position": "center", ref: el => (this.nextBtn = el), onClick: () => this.submit() }, salla.lang.get('common.elements.next'))),
1039
+ ]) : (index.h("salla-placeholder", { alignment: "center" })))));
1040
+ }
1041
+ }
1042
+ async componentWillLoad() {
1043
+ await salla.onReady();
1044
+ this.syncStoreSettings();
1045
+ }
1046
+ componentDidRender() {
1047
+ if (!this.scheduleWizardSetup || !this.defaultMode || !this.order) {
1048
+ return;
1049
+ }
1050
+ this.scheduleWizardSetup = false;
1051
+ requestAnimationFrame(() => this.handleWizard());
1052
+ }
1053
+ disconnectedCallback() {
1054
+ this.clearThanksCountdown();
1055
+ }
1056
+ get host() { return index.getElement(this); }
1057
+ };
1058
+ SallaRatingModalV2.style = sallaRatingModalCss;
1059
+
1060
+ exports.salla_rating_modal_v2 = SallaRatingModalV2;