@salla.sa/twilight-components 2.14.545 → 2.14.547

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 (350) hide show
  1. package/dist/cjs/{filepond-B5aWlI3l.js → filepond-DFvIrFhD.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BYq39KHd.js → filepond-plugin-file-poster-CHg39XJj.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-Bi3TAsJv.js → filepond-plugin-file-validate-size-kGmw5h8R.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-Ck6S5TuZ.js → filepond-plugin-file-validate-type-CQSi2A-P.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DbsdnH5j.js → filepond-plugin-image-edit-M4teY-We.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-x7TfJR-2.js → filepond-plugin-image-exif-orientation-gBQo0ofe.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CrU7vIRk.js → filepond-plugin-image-preview-DTmK0D_I.js} +1 -1
  8. package/dist/cjs/{index-DGpOR-TH.js → index-kkUUTdZu.js} +14 -14
  9. package/dist/cjs/{intlTelInput-DKAXRecW.js → intlTelInput-CVOJSgbc.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/{mail-C9D8MHae.js → mail-CO8cFZH7.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 +12 -5
  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-attachment-view_9.cjs.entry.js +10 -10
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/{salla-comment-form_8.cjs.entry.js → salla-comment-form_9.cjs.entry.js} +264 -4
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +7 -4
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  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.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +208 -103
  85. package/dist/cjs/salla-rating-modal.cjs.entry.js +23 -8
  86. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-social-share.cjs.entry.js +4 -4
  93. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  102. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  104. package/dist/cjs/twilight.cjs.js +2 -2
  105. package/dist/cjs/{vanilla-picker-DQDSSf6Q.js → vanilla-picker-itKa_-k9.js} +1 -1
  106. package/dist/collection/collection-manifest.json +14 -12
  107. package/dist/collection/components/salla-comments/interfaces.js +12 -0
  108. package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
  109. package/dist/collection/components/salla-comments/salla-comments.js +42 -5
  110. package/dist/collection/components/salla-gifting/salla-gifting.js +6 -3
  111. package/dist/collection/components/salla-modal/salla-modal.css +11 -0
  112. package/dist/collection/components/salla-modal/salla-modal.js +33 -6
  113. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +253 -104
  114. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +34 -21
  115. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +69 -10
  116. package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +5 -0
  117. package/dist/collection/components/salla-verified-review/salla-verified-review.css +162 -0
  118. package/dist/collection/components/salla-verified-review/salla-verified-review.js +264 -0
  119. package/dist/components/index.js +2 -2
  120. package/dist/components/salla-comment-item2.js +1 -1
  121. package/dist/components/salla-comments.js +44 -1
  122. package/dist/components/salla-gifting.js +6 -3
  123. package/dist/components/salla-modal2.js +12 -4
  124. package/dist/components/salla-rating-modal-v22.js +208 -101
  125. package/dist/components/salla-rating-modal.js +1 -591
  126. package/dist/components/salla-rating-modal2.js +613 -0
  127. package/dist/components/salla-rating-stars2.js +1 -1
  128. package/dist/components/salla-verified-review.d.ts +11 -0
  129. package/dist/components/salla-verified-review.js +325 -0
  130. package/dist/esm/{filepond-wd7_MQSV.js → filepond-VE8WYfjh.js} +1 -1
  131. package/dist/esm/{filepond-plugin-file-poster-CkWxCmZT.js → filepond-plugin-file-poster-B5RS-KUm.js} +1 -1
  132. package/dist/esm/{filepond-plugin-file-validate-size-DlWS-oUK.js → filepond-plugin-file-validate-size-BdgcVHpq.js} +1 -1
  133. package/dist/esm/{filepond-plugin-file-validate-type-mdpFM1TG.js → filepond-plugin-file-validate-type-CmH44b6j.js} +1 -1
  134. package/dist/esm/{filepond-plugin-image-edit-BqPLKgZU.js → filepond-plugin-image-edit-B-XPDjr0.js} +1 -1
  135. package/dist/esm/{filepond-plugin-image-exif-orientation-CMqFjPu7.js → filepond-plugin-image-exif-orientation-ENeGT6qs.js} +1 -1
  136. package/dist/esm/{filepond-plugin-image-preview-DjCwk-CI.js → filepond-plugin-image-preview-D9RKj5A_.js} +1 -1
  137. package/dist/esm/{index-CHZfg_a9.js → index-RGVg6FYq.js} +14 -14
  138. package/dist/esm/{intlTelInput-B5Q8rrU9.js → intlTelInput-ClLDqBrH.js} +1 -1
  139. package/dist/esm/loader.js +3 -3
  140. package/dist/esm/{mail-DzAIgzdz.js → mail-DmgxDvXL.js} +2 -2
  141. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  142. package/dist/esm/salla-accordion_6.entry.js +12 -5
  143. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  144. package/dist/esm/salla-advertisement.entry.js +1 -1
  145. package/dist/esm/salla-alert_2.entry.js +1 -1
  146. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  147. package/dist/esm/salla-apps-icons.entry.js +1 -1
  148. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  149. package/dist/esm/salla-badge.entry.js +1 -1
  150. package/dist/esm/salla-basket-gap.entry.js +1 -1
  151. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  152. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  153. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  154. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  155. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  156. package/dist/esm/salla-comment-factors.entry.js +1 -1
  157. package/dist/esm/{salla-comment-form_8.entry.js → salla-comment-form_9.entry.js} +264 -5
  158. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  159. package/dist/esm/salla-contacts.entry.js +3 -3
  160. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  161. package/dist/esm/salla-count-down.entry.js +1 -1
  162. package/dist/esm/salla-custom-fields.entry.js +1 -1
  163. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  164. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  165. package/dist/esm/salla-filters-widget.entry.js +1 -1
  166. package/dist/esm/salla-filters.entry.js +1 -1
  167. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  168. package/dist/esm/salla-gifting.entry.js +7 -4
  169. package/dist/esm/salla-hook.entry.js +1 -1
  170. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  171. package/dist/esm/salla-installment.entry.js +1 -1
  172. package/dist/esm/salla-list-tile.entry.js +1 -1
  173. package/dist/esm/salla-localization-modal.entry.js +1 -1
  174. package/dist/esm/salla-login-modal.entry.js +1 -1
  175. package/dist/esm/salla-loyalty-banner_10.entry.js +3 -3
  176. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  177. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  178. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  179. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  180. package/dist/esm/salla-loyalty.entry.js +1 -1
  181. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  182. package/dist/esm/salla-map_2.entry.js +1 -1
  183. package/dist/esm/salla-menu.entry.js +1 -1
  184. package/dist/esm/salla-metadata.entry.js +1 -1
  185. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  186. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  187. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  188. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  189. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  190. package/dist/esm/salla-offer-modal.entry.js +1 -1
  191. package/dist/esm/salla-offer.entry.js +1 -1
  192. package/dist/esm/salla-order-branch.entry.js +1 -1
  193. package/dist/esm/salla-order-cancel.entry.js +1 -1
  194. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  195. package/dist/esm/salla-order-details-options.entry.js +1 -1
  196. package/dist/esm/salla-order-details.entry.js +1 -1
  197. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  198. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  199. package/dist/esm/salla-order-edit.entry.js +1 -1
  200. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  201. package/dist/esm/salla-order-shipments.entry.js +1 -1
  202. package/dist/esm/salla-order-summary.entry.js +1 -1
  203. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  204. package/dist/esm/salla-orders.entry.js +1 -1
  205. package/dist/esm/salla-payments.entry.js +1 -1
  206. package/dist/esm/salla-placeholder.entry.js +1 -1
  207. package/dist/esm/salla-price-range.entry.js +1 -1
  208. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  209. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  210. package/dist/esm/salla-products-list.entry.js +1 -1
  211. package/dist/esm/salla-products-slider.entry.js +1 -1
  212. package/dist/esm/salla-quick-order.entry.js +3 -3
  213. package/dist/esm/salla-rating-modal-v2.entry.js +208 -103
  214. package/dist/esm/salla-rating-modal.entry.js +23 -8
  215. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  216. package/dist/esm/salla-review-order-item.entry.js +1 -1
  217. package/dist/esm/salla-scopes.entry.js +1 -1
  218. package/dist/esm/salla-search.entry.js +1 -1
  219. package/dist/esm/salla-skeleton.entry.js +1 -1
  220. package/dist/esm/salla-slider.entry.js +1 -1
  221. package/dist/esm/salla-social-share.entry.js +4 -4
  222. package/dist/esm/salla-social.entry.js +1 -1
  223. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  224. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  225. package/dist/esm/salla-tooltip.entry.js +1 -1
  226. package/dist/esm/salla-trust-badges.entry.js +1 -1
  227. package/dist/esm/salla-user-menu.entry.js +1 -1
  228. package/dist/esm/salla-user-profile.entry.js +1 -1
  229. package/dist/esm/salla-user-settings.entry.js +1 -1
  230. package/dist/esm/salla-verify.entry.js +3 -3
  231. package/dist/esm/salla-wallet.entry.js +1 -1
  232. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  233. package/dist/esm/twilight.js +3 -3
  234. package/dist/esm/{vanilla-picker-uNDULydX.js → vanilla-picker-DWGLcuLb.js} +1 -1
  235. package/dist/twilight/{p-f07bbbc7.entry.js → p-01dee064.entry.js} +1 -1
  236. package/dist/twilight/{p-72ee7071.entry.js → p-03de43a3.entry.js} +1 -1
  237. package/dist/twilight/{p-5d9a85b0.entry.js → p-067e7e32.entry.js} +1 -1
  238. package/dist/twilight/{p-c9146d50.entry.js → p-08fa1534.entry.js} +1 -1
  239. package/dist/twilight/{p-84380d4a.entry.js → p-0adea51c.entry.js} +1 -1
  240. package/dist/twilight/{p-8fc6e860.entry.js → p-15fea4e9.entry.js} +1 -1
  241. package/dist/twilight/{p-25d9f1b2.entry.js → p-1c40b212.entry.js} +1 -1
  242. package/dist/twilight/{p-63b01300.entry.js → p-1cef7ea2.entry.js} +1 -1
  243. package/dist/twilight/{p-346366ba.entry.js → p-1f7d964d.entry.js} +1 -1
  244. package/dist/twilight/{p-832f3a98.entry.js → p-25c61f91.entry.js} +1 -1
  245. package/dist/twilight/{p-12836275.entry.js → p-272857bd.entry.js} +1 -1
  246. package/dist/twilight/{p-6d961d73.entry.js → p-2ae585c9.entry.js} +1 -1
  247. package/dist/twilight/{p-766a3291.entry.js → p-2ba184be.entry.js} +1 -1
  248. package/dist/twilight/{p-788fd019.entry.js → p-2d2e29fe.entry.js} +1 -1
  249. package/dist/twilight/{p-8780a467.entry.js → p-3286bfc2.entry.js} +1 -1
  250. package/dist/twilight/{p-345532e5.entry.js → p-36359288.entry.js} +1 -1
  251. package/dist/twilight/{p-2d01a4f5.entry.js → p-3713dbff.entry.js} +1 -1
  252. package/dist/twilight/{p-dd823fde.entry.js → p-380b8531.entry.js} +1 -1
  253. package/dist/twilight/{p-391a2ec6.entry.js → p-3ffe6fa7.entry.js} +1 -1
  254. package/dist/twilight/{p-0495bfac.entry.js → p-44595831.entry.js} +1 -1
  255. package/dist/twilight/{p-0749cc55.entry.js → p-45734a3b.entry.js} +1 -1
  256. package/dist/twilight/{p-d0d3609c.entry.js → p-459ce78a.entry.js} +1 -1
  257. package/dist/twilight/{p-419499d6.entry.js → p-4663f4da.entry.js} +1 -1
  258. package/dist/twilight/{p-28248b6b.entry.js → p-4d12b009.entry.js} +1 -1
  259. package/dist/twilight/{p-74529abb.entry.js → p-4e904400.entry.js} +1 -1
  260. package/dist/twilight/{p-67b91397.entry.js → p-541bf8ef.entry.js} +1 -1
  261. package/dist/twilight/{p-32e3daa3.entry.js → p-57516065.entry.js} +1 -1
  262. package/dist/twilight/{p-5ded000f.entry.js → p-5819795e.entry.js} +1 -1
  263. package/dist/twilight/{p-51a062cd.entry.js → p-582d081e.entry.js} +1 -1
  264. package/dist/twilight/{p-c816b198.entry.js → p-5b6fd8b5.entry.js} +1 -1
  265. package/dist/twilight/p-61bc2e97.entry.js +4 -0
  266. package/dist/twilight/{p-93aa1b67.entry.js → p-6288de29.entry.js} +1 -1
  267. package/dist/twilight/{p-9d224252.entry.js → p-66ca510c.entry.js} +1 -1
  268. package/dist/twilight/{p-f1d8729d.entry.js → p-696cb80c.entry.js} +1 -1
  269. package/dist/twilight/{p-35557962.entry.js → p-6971174e.entry.js} +1 -1
  270. package/dist/twilight/{p-3672d4f7.entry.js → p-6cc61a70.entry.js} +1 -1
  271. package/dist/twilight/{p-90e5c3ab.entry.js → p-6ec304ac.entry.js} +1 -1
  272. package/dist/twilight/{p-c287e498.entry.js → p-70ef6b79.entry.js} +1 -1
  273. package/dist/twilight/{p-e36f62a9.entry.js → p-8f1e13c5.entry.js} +1 -1
  274. package/dist/twilight/{p-afb03ee5.entry.js → p-9340d397.entry.js} +1 -1
  275. package/dist/twilight/{p-b279e0bb.entry.js → p-93ac34c7.entry.js} +1 -1
  276. package/dist/twilight/{p-64efbb2c.entry.js → p-95519dae.entry.js} +1 -1
  277. package/dist/twilight/{p-235d7596.entry.js → p-97a7d4cf.entry.js} +1 -1
  278. package/dist/twilight/{p-1419a93d.entry.js → p-9a8a1b47.entry.js} +1 -1
  279. package/dist/twilight/{p-c948a8a8.entry.js → p-9b791c53.entry.js} +1 -1
  280. package/dist/twilight/{p-c603722c.entry.js → p-9fafcedd.entry.js} +1 -1
  281. package/dist/twilight/{p-PCp-0mbL.js → p-BFco-_Zl.js} +1 -1
  282. package/dist/twilight/{p-ryHWESoh.js → p-BVamrCNR.js} +1 -1
  283. package/dist/twilight/{p-DtV7npW9.js → p-B_QMCKVO.js} +1 -1
  284. package/dist/twilight/{p-BPkSO6gd.js → p-C8tT82U5.js} +1 -1
  285. package/dist/twilight/{p-CdgES2Of.js → p-CkrRlrjj.js} +1 -1
  286. package/dist/twilight/{p-D9VjvNQq.js → p-D42LpeIl.js} +2 -2
  287. package/dist/twilight/{p-BWvO3cE-.js → p-DT4oJGXj.js} +1 -1
  288. package/dist/twilight/{p-DzAIgzdz.js → p-DmgxDvXL.js} +1 -1
  289. package/dist/twilight/{p-DO7S0QBX.js → p-DqHR-XSp.js} +1 -1
  290. package/dist/twilight/{p-ZinKLSYw.js → p-DvDYmxRj.js} +1 -1
  291. package/dist/twilight/{p-CHZfg_a9.js → p-RGVg6FYq.js} +2 -2
  292. package/dist/twilight/{p-17d49c87.entry.js → p-a0543daf.entry.js} +1 -1
  293. package/dist/twilight/p-a32e7b62.entry.js +4 -0
  294. package/dist/twilight/{p-b33392c6.entry.js → p-a4e382fb.entry.js} +1 -1
  295. package/dist/twilight/{p-fb1ad954.entry.js → p-a56851b0.entry.js} +1 -1
  296. package/dist/twilight/{p-5933ba05.entry.js → p-a8af052d.entry.js} +1 -1
  297. package/dist/twilight/{p-88f50d7e.entry.js → p-a9476bc3.entry.js} +1 -1
  298. package/dist/twilight/p-acd88f45.entry.js +4 -0
  299. package/dist/twilight/{p-aa4daadf.entry.js → p-ad884517.entry.js} +1 -1
  300. package/dist/twilight/{p-06d9e1c5.entry.js → p-aea12a46.entry.js} +1 -1
  301. package/dist/twilight/{p-2db5e829.entry.js → p-af39795f.entry.js} +1 -1
  302. package/dist/twilight/{p-0573a498.entry.js → p-aff22960.entry.js} +1 -1
  303. package/dist/twilight/{p-c81bce54.entry.js → p-b02c4a37.entry.js} +1 -1
  304. package/dist/twilight/{p-2305edcc.entry.js → p-b164cb76.entry.js} +1 -1
  305. package/dist/twilight/p-b73e784e.entry.js +4 -0
  306. package/dist/twilight/{p-82fe9f82.entry.js → p-b9a8f977.entry.js} +1 -1
  307. package/dist/twilight/{p-72f54055.entry.js → p-bbc8f3dd.entry.js} +1 -1
  308. package/dist/twilight/{p-f168109d.entry.js → p-bc9585d0.entry.js} +1 -1
  309. package/dist/twilight/{p-87e10a68.entry.js → p-bef1df8a.entry.js} +1 -1
  310. package/dist/twilight/{p-b38c4e39.entry.js → p-c1be2f63.entry.js} +1 -1
  311. package/dist/twilight/{p-69119c00.entry.js → p-c353a96a.entry.js} +1 -1
  312. package/dist/twilight/{p-5074de7d.entry.js → p-c6859fd3.entry.js} +1 -1
  313. package/dist/twilight/{p-a785b49f.entry.js → p-c7abf516.entry.js} +1 -1
  314. package/dist/twilight/{p-1ea25389.entry.js → p-cdad8f41.entry.js} +1 -1
  315. package/dist/twilight/{p-25f51a7e.entry.js → p-cf488159.entry.js} +1 -1
  316. package/dist/twilight/{p-37163aef.entry.js → p-d02688da.entry.js} +1 -1
  317. package/dist/twilight/{p-c26043ff.entry.js → p-d03e6073.entry.js} +1 -1
  318. package/dist/twilight/{p-f1dfe18b.entry.js → p-d2c1f52b.entry.js} +1 -1
  319. package/dist/twilight/{p-54e2d320.entry.js → p-d40958e4.entry.js} +1 -1
  320. package/dist/twilight/{p-ec281904.entry.js → p-d46ef139.entry.js} +1 -1
  321. package/dist/twilight/{p-2de58591.entry.js → p-d67b4059.entry.js} +1 -1
  322. package/dist/twilight/{p-c92edd6f.entry.js → p-d6ea5ca7.entry.js} +1 -1
  323. package/dist/twilight/{p-2d62c947.entry.js → p-d835a5dd.entry.js} +1 -1
  324. package/dist/twilight/{p-6c18cc72.entry.js → p-dd507247.entry.js} +1 -1
  325. package/dist/twilight/{p-c2fe2dbe.entry.js → p-df8d9655.entry.js} +1 -1
  326. package/dist/twilight/{p-98108ebe.entry.js → p-e304b491.entry.js} +1 -1
  327. package/dist/twilight/{p-ffdf5f92.entry.js → p-e9b2c4a5.entry.js} +1 -1
  328. package/dist/twilight/{p-4ac9a3b6.entry.js → p-eab06e84.entry.js} +1 -1
  329. package/dist/twilight/{p-d9b0fa64.entry.js → p-eefcc343.entry.js} +1 -1
  330. package/dist/twilight/{p-a0561bd1.entry.js → p-ef10024f.entry.js} +1 -1
  331. package/dist/twilight/{p-989f2adb.entry.js → p-f5f420c4.entry.js} +1 -1
  332. package/dist/twilight/{p-3f5bc617.entry.js → p-f8609873.entry.js} +1 -1
  333. package/dist/twilight/{p-bead6e6f.entry.js → p-f8e6aaac.entry.js} +1 -1
  334. package/dist/twilight/{p-3a8be7df.entry.js → p-f93cab86.entry.js} +1 -1
  335. package/dist/twilight/{p-93dabb47.entry.js → p-fcc66e23.entry.js} +1 -1
  336. package/dist/twilight/{p-6ff53523.entry.js → p-fd94973d.entry.js} +1 -1
  337. package/dist/twilight/{p-279a1661.entry.js → p-fd9d7372.entry.js} +1 -1
  338. package/dist/twilight/twilight.esm.js +1 -1
  339. package/dist/types/components/salla-comments/interfaces.d.ts +15 -0
  340. package/dist/types/components/salla-comments/salla-comments.d.ts +5 -2
  341. package/dist/types/components/salla-modal/salla-modal.d.ts +7 -2
  342. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +20 -5
  343. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +10 -2
  344. package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +51 -0
  345. package/dist/types/components.d.ts +59 -16
  346. package/package.json +5 -5
  347. package/dist/twilight/p-0ae39262.entry.js +0 -4
  348. package/dist/twilight/p-12f61ae1.entry.js +0 -4
  349. package/dist/twilight/p-ab41d26c.entry.js +0 -4
  350. package/dist/twilight/p-e5a3b689.entry.js +0 -4
@@ -11,6 +11,7 @@ import WhatsappIcon from "../../assets/svg/whatsapp2.svg";
11
11
  import MailIcon from "../../assets/svg/mail.svg";
12
12
  import { buildMediaUploadAccept } from "../salla-file-upload/upload-limits";
13
13
  import { MAX_IMAGE_UPLOAD_LIMIT, MAX_PARALLEL_UPLOADS, MAX_VIDEO_DURATION, MAX_VIDEO_FILE_SIZE, MAX_VIDEO_UPLOAD_LIMIT, countMediaByType, createPreloadedMediaItem, getMediaUrlsByType, isVideoUrl, normalizeSubmittedMedia, parseMediaField, removeUploadedImage, splitMediaUrls, syncHiddenMediaInputs, } from "./rating-modal-media";
14
+ const MODAL_WIDTH = '600px';
14
15
  export class SallaRatingModalV2 {
15
16
  constructor() {
16
17
  this.hasError = false;
@@ -50,7 +51,7 @@ export class SallaRatingModalV2 {
50
51
  this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
51
52
  this.contactUsLabel = salla.lang.get('blocks.footer.social');
52
53
  this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
53
- this.overallProductRatingLabel = salla.lang.get('pages.rating.overall_product_rating');
54
+ this.rateTheFollowingLabel = salla.lang.get('pages.rating.rate_the_following_factors');
54
55
  this.loyaltyPointsForImagesLabel = salla.lang.get('pages.rating.loyalty_points_for_images', {
55
56
  points: ':points',
56
57
  });
@@ -70,83 +71,12 @@ export class SallaRatingModalV2 {
70
71
  this.MAX_VIDEO_DURATION = MAX_VIDEO_DURATION;
71
72
  this.MAX_PARALLEL_UPLOADS = MAX_PARALLEL_UPLOADS;
72
73
  this.scheduleWizardSetup = false;
73
- salla.lang.onLoaded(() => {
74
- this.contactUsLabel = salla.lang.get('blocks.footer.social');
75
- const setNestedAsync = (lang, key, value) => {
76
- return new Promise(resolve => {
77
- salla.helpers.setNested(salla.lang.messages[lang], key, value);
78
- resolve(true);
79
- });
80
- };
81
- const setTranslations = async () => {
82
- await setNestedAsync('ar.trans', 'common.uploader.drag_and_drop_files', 'اسحب الملفات وأفلتها هنا');
83
- await setNestedAsync('en.trans', 'common.uploader.drag_and_drop_files', 'Drag and drop files here');
84
- await setNestedAsync('ar.trans', 'common.uploader.allowed_images_types', ' .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة');
85
- await setNestedAsync('en.trans', 'common.uploader.allowed_images_types', 'Images in jpg, jpeg, or png format are allowed.');
86
- await setNestedAsync('ar.trans', 'pages.rating.add_images', 'اضافة صور');
87
- await setNestedAsync('en.trans', 'pages.rating.add_images', 'Add Images');
88
- await setNestedAsync('ar.trans', 'pages.rating.edit_images', 'تعديل الصور');
89
- await setNestedAsync('en.trans', 'pages.rating.edit_images', 'Edit Images');
90
- await setNestedAsync('ar.trans', 'pages.rating.edit_review', 'تعديل التقييم');
91
- await setNestedAsync('en.trans', 'pages.rating.edit_review', 'Edit review');
92
- await setNestedAsync('ar.trans', 'pages.rating.confirm_deletion', 'تأكيد حذف التقييم');
93
- await setNestedAsync('en.trans', 'pages.rating.confirm_deletion', 'Confirm review deletion');
94
- await setNestedAsync('ar.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'هل أنت متأكد من حذف تقييمك؟');
95
- await setNestedAsync('en.trans', 'pages.rating.are_you_sure_you_want_to_delete_review', 'Are you sure you want to delete your review?');
96
- await setNestedAsync('ar.trans', 'pages.rating.review_updated_successfully', 'تم تعديل التقييم بنجاح');
97
- await setNestedAsync('en.trans', 'pages.rating.review_updated_successfully', 'The review has been successfully updated.');
98
- await setNestedAsync('ar.trans', 'pages.rating.review_deleted_successfully', 'تم حذف التقييم بنجاح');
99
- await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
100
- await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
101
- await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
102
- await setNestedAsync('ar.trans', 'pages.rating.media_count', 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)');
103
- await setNestedAsync('en.trans', 'pages.rating.media_count', 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)');
104
- await setNestedAsync('ar.trans', 'common.uploader.allowed_videos_types', 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv');
105
- await setNestedAsync('en.trans', 'common.uploader.allowed_videos_types', 'Videos in mp4, mov, avi, or mkv format are allowed.');
106
- await setNestedAsync('ar.trans', 'pages.rating.videos_count', 'الفيديو ( :current من أصل :total )');
107
- await setNestedAsync('en.trans', 'pages.rating.videos_count', 'Videos ( :current of :total )');
108
- await setNestedAsync('ar.trans', 'common.uploader.allowed_media_types', 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv');
109
- await setNestedAsync('en.trans', 'common.uploader.allowed_media_types', 'Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed.');
110
- await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`);
111
- await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`);
112
- await setNestedAsync('ar.trans', 'common.uploader.max_images_count', 'أضف :count صور كحد أقصى');
113
- await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
114
- await setNestedAsync('ar.trans', 'common.uploader.max_videos_count', 'أضف :count فيديوهات كحد أقصى');
115
- await setNestedAsync('en.trans', 'common.uploader.max_videos_count', 'Add up to :count videos maximum.');
116
- await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
117
- await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
118
- await setNestedAsync('ar.trans', 'pages.rating.rate_required_factors', 'يرجى تقييم جميع المعايير لإتمام مراجعتك.');
119
- await setNestedAsync('en.trans', 'pages.rating.rate_required_factors', 'Please rate all required factors to complete your review.');
120
- await setNestedAsync('ar.trans', 'pages.rating.overall_product_rating', 'التقييم العام للمنتج');
121
- await setNestedAsync('en.trans', 'pages.rating.overall_product_rating', 'Overall product rating');
122
- await setNestedAsync('ar.trans', 'pages.rating.loyalty_points_for_images', 'اكسب :points نقطة ولاء عند إضافة صور لتقييمك!');
123
- await setNestedAsync('en.trans', 'pages.rating.loyalty_points_for_images', 'Earn :points loyalty points when adding photos to your review!');
124
- this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
125
- this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
126
- this.threeImagesMax = this.getMaxUploadHintLabel();
127
- this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
128
- this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
129
- this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
130
- this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
131
- this.cancelLabel = salla.lang.get('common.elements.cancel');
132
- this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
133
- this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
134
- this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
135
- this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
136
- this.overallProductRatingLabel = salla.lang.get('pages.rating.overall_product_rating');
137
- this.loyaltyPointsForImagesLabel = salla.lang.get('pages.rating.loyalty_points_for_images', {
138
- points: ':points',
139
- });
140
- this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_body', { store, id, customer });
141
- };
142
- setTranslations();
143
- });
144
74
  }
145
75
  /**
146
76
  * Show the rating modal
147
77
  */
148
78
  syncStoreSettings() {
149
- if (!this.orderId) {
79
+ if (this.orderId === undefined) {
150
80
  this.orderId = salla.config.get('page.id');
151
81
  }
152
82
  this.allowAttachImages = !!salla.config.get('store.settings.rating.allow_attach_images');
@@ -215,11 +145,15 @@ export class SallaRatingModalV2 {
215
145
  this.setUploaderProcessing(productId, !!detail.uploading);
216
146
  this.scheduleUploaderHeightRefresh();
217
147
  }
148
+ /** An eligible review with no order behind it — product-only, no store/shipping steps. */
149
+ isUnverifiedReview() {
150
+ return this.orderId === null && !!this.productId;
151
+ }
218
152
  /** Encrypted order id from page config / prop — used to fetch order details. */
219
153
  getRatingOrderId() {
220
154
  return this.orderId || salla.config.get('page.id');
221
155
  }
222
- /** Numeric order id from API response — used when submitting ratings. */
156
+ /** Numeric order id from API response — used when submitting ratings. Null when unverified. */
223
157
  getSubmitOrderId() {
224
158
  return this.orderId;
225
159
  }
@@ -288,6 +222,9 @@ export class SallaRatingModalV2 {
288
222
  return rating !== undefined && rating !== null && rating !== '' && Number(rating) > 0;
289
223
  }
290
224
  isTestimonialsEnabled(order = this.order) {
225
+ if (this.productId) {
226
+ return false;
227
+ }
291
228
  if (order?.testimonials_enabled === false) {
292
229
  return false;
293
230
  }
@@ -306,6 +243,9 @@ export class SallaRatingModalV2 {
306
243
  return this.getRateableProducts(order).length > 0;
307
244
  }
308
245
  isShippingEnabled(order = this.order) {
246
+ if (this.productId) {
247
+ return false;
248
+ }
309
249
  if (order?.shipping_enabled === false) {
310
250
  return false;
311
251
  }
@@ -327,7 +267,8 @@ export class SallaRatingModalV2 {
327
267
  return order.products.filter(item => item?.product?.id);
328
268
  }
329
269
  getRateableProducts(order = this.order) {
330
- return this.getOrderProducts(order).filter(item => !this.hasRatingFeedback(item?.feedback));
270
+ return this.getOrderProducts(order).filter(item => !this.hasRatingFeedback(item?.feedback) &&
271
+ (!this.productId || String(item.product.id) === String(this.productId)));
331
272
  }
332
273
  getStepsCount(order = this.order) {
333
274
  if (!order) {
@@ -350,6 +291,58 @@ export class SallaRatingModalV2 {
350
291
  this.scheduleWizardSetup = true;
351
292
  forceUpdate(this);
352
293
  }
294
+ /**
295
+ * Point the modal at a different order/product and invalidate any cached
296
+ * order so the next open() re-fetches instead of reusing stale data.
297
+ * Pass `orderId` as `null` for an eligible-but-unverified product review.
298
+ */
299
+ async setOrder(orderId, productId) {
300
+ this.orderId = orderId;
301
+ this.productId = productId;
302
+ this.order = undefined;
303
+ this.hasError = false;
304
+ this.errorMessage = undefined;
305
+ this.showContactWidget = true;
306
+ }
307
+ /** Builds a single-product, order-less feedback target for unverified reviews. */
308
+ async loadUnverifiedProductOrder() {
309
+ const response = await salla.api
310
+ .withoutNotifier(() => salla.product.api.getDetails(this.productId))
311
+ .catch(() => null);
312
+ const product = response?.data;
313
+ this.order = {
314
+ products: [
315
+ {
316
+ feedback: undefined,
317
+ product: {
318
+ id: Number(this.productId),
319
+ name: product?.name || '',
320
+ thumbnail: product?.image?.url || salla.url.cdn('images/s-empty.png'),
321
+ },
322
+ },
323
+ ],
324
+ products_enabled: true,
325
+ testimonials_enabled: false,
326
+ shipping_enabled: false,
327
+ thanks_message: '',
328
+ };
329
+ this.productReviewFactors = await this.fetchAllProductReviewFactors(this.order);
330
+ }
331
+ escapeHtml(str) {
332
+ return str
333
+ .replace(/&/g, '&')
334
+ .replace(/</g, '&lt;')
335
+ .replace(/>/g, '&gt;')
336
+ .replace(/"/g, '&quot;')
337
+ .replace(/'/g, '&#39;');
338
+ }
339
+ getModalTitle() {
340
+ if (this.isUnverifiedReview()) {
341
+ const productName = this.escapeHtml(this.getRateableProducts()[0]?.product?.name || '');
342
+ return `${salla.lang.get('pages.rating.rate')} ${productName}`.trim();
343
+ }
344
+ return `${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order?.id})</span>`;
345
+ }
353
346
  async open() {
354
347
  await salla.onReady();
355
348
  this.syncStoreSettings();
@@ -361,14 +354,16 @@ export class SallaRatingModalV2 {
361
354
  this.modal
362
355
  ?.open()
363
356
  .then(() => this.order ||
364
- salla.api
365
- .withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
366
- .then(async (res) => {
367
- this.order = res.data;
368
- this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
369
- }))
357
+ (this.isUnverifiedReview()
358
+ ? this.loadUnverifiedProductOrder()
359
+ : salla.api
360
+ .withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
361
+ .then(async (res) => {
362
+ this.order = res.data;
363
+ this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
364
+ })))
370
365
  .then(() => this.readyUpLoyaltyPoints())
371
- .then(() => this.modal?.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
366
+ .then(() => this.modal?.setTitle(this.getModalTitle()))
372
367
  .then(() => {
373
368
  // Initialize productImages for all products
374
369
  const initialImages = {};
@@ -803,7 +798,9 @@ export class SallaRatingModalV2 {
803
798
  Number(rating_product_with_image_points) + Number(rating_product_points);
804
799
  }
805
800
  loyaltyPointsNote() {
806
- if (!this.loyaltyImageRatingPoints || !this.loyaltyPointsForImagesLabel) {
801
+ if (!this.loyaltyImageRatingPoints ||
802
+ !this.loyaltyPointsForImagesLabel ||
803
+ this.isUnverifiedReview()) {
807
804
  return null;
808
805
  }
809
806
  const svgIcon = (h("svg", { width: "17", height: "17", viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z", fill: "#008C56" })));
@@ -964,7 +961,7 @@ export class SallaRatingModalV2 {
964
961
  this.userFilledFactorKeys[productId] = userFilled;
965
962
  }
966
963
  shouldAutofillFactors(mainRating) {
967
- return mainRating === 4 || mainRating === 5;
964
+ return mainRating >= 4;
968
965
  }
969
966
  autofillUnfilledFactors(productId, mainRating) {
970
967
  const factors = this.productReviewFactors[productId] || [];
@@ -1087,7 +1084,7 @@ export class SallaRatingModalV2 {
1087
1084
  }, {});
1088
1085
  }
1089
1086
  renderProductStep(item, index) {
1090
- return (h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-product-info-row" }, h("div", { class: "s-rating-modal-product-img-wrap" }, h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-product-title" }, item.product.name)), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), h("input", { type: "hidden", name: "product_id", value: item.product.id }), h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
1087
+ return (h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details", ref: el => el && this.setupProductRatingAutofill(el, item.product.id) }, h("div", { class: "s-rating-modal-step-wrap" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-title" }, item.product.name), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_product_rate')), this.renderProductMainRating(item.product.id, 0, { fieldPrefix: '' })), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), h("input", { type: "hidden", name: "product_id", value: item.product.id }), h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
1091
1088
  if (el)
1092
1089
  this.contentRefs[index] = el;
1093
1090
  } }, h("salla-file-upload", { name: "image", enableGallery: true, maxImagesCount: this.allowAttachImages ? this.MAX_IMAGE_UPLOAD_LIMIT : undefined, maxVideosCount: this.allowAttachVideos ? this.MAX_VIDEO_UPLOAD_LIMIT : undefined, maxVideoFileSize: this.allowAttachVideos ? this.MAX_VIDEO_FILE_SIZE : undefined, maxVideoDuration: this.allowAttachVideos ? this.MAX_VIDEO_DURATION : undefined, maxParallelUploads: this.MAX_PARALLEL_UPLOADS, imagePreviewHeight: 75, filePosterHeight: 75, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: this.getMediaUploadAccept(), url: salla.url.api('upload'), onUploaded: e => {
@@ -1123,17 +1120,21 @@ export class SallaRatingModalV2 {
1123
1120
  this.hiddenVideoInputs[index] = el;
1124
1121
  } })), this.renderUploadedImagesCount(item.product.id))))));
1125
1122
  }
1123
+ renderProductMainRating(productId, index, options = {}) {
1124
+ const fieldPrefix = options.fieldPrefix ?? `products[${index}]`;
1125
+ const mainRatingName = fieldPrefix ? `${fieldPrefix}[rating]` : 'rating';
1126
+ const normalizedMainRating = Number(options.mainRating ??
1127
+ (this.editMode ? this.editMainRating : this.productMainRatings[productId]));
1128
+ const hasMainRating = !Number.isNaN(normalizedMainRating);
1129
+ return (h("div", { class: "s-rating-modal-stars-product s-rating-modal-product-rating-row-main" }, h("salla-rating-stars", { size: "large", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true })));
1130
+ }
1126
1131
  renderProductReviewFactors(productId, index, options = {}) {
1127
1132
  const factors = this.productReviewFactors[productId] || [];
1128
1133
  const fieldPrefix = options.fieldPrefix ?? `products[${index}]`;
1129
- const mainRatingName = fieldPrefix ? `${fieldPrefix}[rating]` : 'rating';
1130
1134
  const factorRatings = {
1131
1135
  ...(this.editMode ? {} : this.productFactorRatings[productId] || {}),
1132
1136
  ...(options.factorRatings || {}),
1133
1137
  };
1134
- const normalizedMainRating = Number(options.mainRating ??
1135
- (this.editMode ? this.editMainRating : this.productMainRatings[productId]));
1136
- const hasMainRating = !Number.isNaN(normalizedMainRating);
1137
1138
  const getPrefilledFactorRating = (factor, factorIndex) => {
1138
1139
  const byId = factor.id !== undefined ? factorRatings[String(factor.id)] : undefined;
1139
1140
  const byName = factor.name ? factorRatings[factor.name.trim()] : undefined;
@@ -1141,8 +1142,12 @@ export class SallaRatingModalV2 {
1141
1142
  const normalized = Number(byId ?? byName ?? byIndex);
1142
1143
  return Number.isNaN(normalized) ? undefined : normalized;
1143
1144
  };
1144
- return (h("div", { class: "s-rating-modal-product-rating-rows", ref: el => el && this.setupProductRatingAutofill(el, productId) }, h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main" }, h("span", { class: "s-rating-modal-product-factor-name" }, this.overallProductRatingLabel, h("span", { class: "s-rating-modal-product-factor-required" }, "*")), 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) => (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) }, h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), h("span", { class: "s-rating-modal-product-factor-name" }, factor.name, factor.required ? h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), 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 ||
1145
- typeof getPrefilledFactorRating(factor, factorIndex) === 'number', withLabel: true, labelBeforeStars: true, tag: false }))))));
1145
+ if (!factors.length) {
1146
+ return null;
1147
+ }
1148
+ const hasRequiredFactor = factors.some(factor => factor.required);
1149
+ return (h("div", { class: "s-rating-modal-product-factors-card" }, h("div", { class: "s-rating-modal-product-factors-heading" }, this.rateTheFollowingLabel, hasRequiredFactor ? h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), h("div", { class: "s-rating-modal-product-rating-rows" }, factors.map((factor, factorIndex) => (h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), h("span", { class: "s-rating-modal-product-factor-name" }, factor.name), 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 ||
1150
+ typeof getPrefilledFactorRating(factor, factorIndex) === 'number', tag: false })))))));
1146
1151
  }
1147
1152
  handleSendEmail() {
1148
1153
  if (!this.order) {
@@ -1233,21 +1238,24 @@ export class SallaRatingModalV2 {
1233
1238
  return (h("salla-modal", { ref: modal => {
1234
1239
  if (modal)
1235
1240
  this.editModal = modal;
1236
- }, width: "md", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-edit-wrapper", ref: el => {
1241
+ }, width: "custom", customWidth: MODAL_WIDTH, onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-edit-wrapper", ref: el => {
1237
1242
  if (el)
1238
1243
  this.body = el;
1239
1244
  } }, this.editType === 'store' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => {
1240
1245
  if (currentTab)
1241
1246
  this.currentTab = currentTab;
1242
- } }, h("div", { class: "s-rating-modal-rounded-icon" }, 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" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => {
1247
+ } }, h("div", { class: "s-rating-modal-rounded-icon" }, 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" })), h("h2", { class: "s-rating-modal-title" }, salla.config.get('store.name')), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => {
1243
1248
  if (currentTab)
1244
1249
  this.currentTab = currentTab;
1245
- } }, this.editItem.shipping.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => {
1250
+ } }, this.editItem.shipping.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_shipping_rate')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => {
1246
1251
  if (currentTab)
1247
1252
  this.currentTab = currentTab;
1248
- } }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-product-info-row" }, h("div", { class: "s-rating-modal-product-img-wrap" }, h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-product-title" }, this.editItem.product.name)), this.renderProductReviewFactors(this.editItem.product.id, 0, {
1253
+ } }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details", ref: el => el && this.setupProductRatingAutofill(el, this.editItem.product.id) }, h("div", { class: "s-rating-modal-step-wrap" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-title" }, this.editItem.product.name), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_product_rate')), this.renderProductMainRating(this.editItem.product.id, 0, {
1254
+ fieldPrefix: '',
1255
+ mainRating: this.editMainRating ??
1256
+ Number(this.editItem.stars ?? this.editItem.rating),
1257
+ })), this.renderProductReviewFactors(this.editItem.product.id, 0, {
1249
1258
  fieldPrefix: '',
1250
- mainRating: this.editMainRating ?? Number(this.editItem.stars ?? this.editItem.rating),
1251
1259
  factorRatings: this.editFactorRatings,
1252
1260
  alwaysEditable: true,
1253
1261
  }), h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
@@ -1287,15 +1295,15 @@ export class SallaRatingModalV2 {
1287
1295
  return h(Host, { class: "s-rating-modal" }, this.getEditModal());
1288
1296
  }
1289
1297
  if (this.defaultMode) {
1290
- return (h(Host, { class: "s-rating-modal" }, h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "md", ref: modal => {
1298
+ return (h(Host, { class: "s-rating-modal" }, h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "custom", customWidth: MODAL_WIDTH, ref: modal => {
1291
1299
  if (modal)
1292
1300
  this.modal = modal;
1293
1301
  } }, h("div", { slot: "loading" }, h("div", { class: "s-rating-modal-skeleton" }, h("salla-skeleton", { type: "circle", height: "80px", width: "80px" }), h("salla-skeleton", { height: "15px", width: "60%" }), h("salla-skeleton", { height: "10px", width: "30%" }), h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map(v => (h("div", { key: v, innerHTML: Star })))), h("salla-skeleton", { height: "100px", width: "100%" }), h("div", { class: "s-rating-modal-skeleton-footer" }, h("salla-skeleton", { height: "40px", width: "30%" })))), !this.hasError && this.order ? ([
1294
1302
  h("div", { class: "s-rating-modal-wrapper", ref: el => {
1295
1303
  if (el)
1296
1304
  this.body = el;
1297
- } }, this.isTestimonialsEnabled() ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, h("div", { class: "s-rating-modal-rounded-icon" }, 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" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
1298
- this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => {
1305
+ } }, this.isTestimonialsEnabled() ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, h("div", { class: "s-rating-modal-rounded-icon" }, 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" })), h("h2", { class: "s-rating-modal-title" }, salla.config.get('store.name')), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
1306
+ this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), h("p", { class: "s-rating-modal-subtitle" }, salla.lang.get('pages.rating.write_shipping_rate')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => {
1299
1307
  if (el)
1300
1308
  this.thanksTab = el;
1301
1309
  } }, h("span", { class: "s-rating-modal-icon", innerHTML: CheckCircle2 }), h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), h("time", { class: "s-rating-modal-thanks-time", ref: el => {
@@ -1318,8 +1326,105 @@ export class SallaRatingModalV2 {
1318
1326
  }
1319
1327
  async componentWillLoad() {
1320
1328
  await salla.onReady();
1329
+ await salla.lang.onLoaded();
1330
+ this.registerTranslations();
1321
1331
  this.syncStoreSettings();
1322
1332
  }
1333
+ registerTranslations() {
1334
+ salla.lang.addBulk({
1335
+ 'common.uploader.drag_and_drop_files': {
1336
+ ar: 'اسحب الملفات وأفلتها هنا',
1337
+ en: 'Drag and drop files here',
1338
+ },
1339
+ 'common.uploader.allowed_images_types': {
1340
+ ar: ' .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة',
1341
+ en: 'Images in jpg, jpeg, or png format are allowed.',
1342
+ },
1343
+ 'pages.rating.add_images': { ar: 'اضافة صور', en: 'Add Images' },
1344
+ 'pages.rating.edit_images': { ar: 'تعديل الصور', en: 'Edit Images' },
1345
+ 'pages.rating.edit_review': { ar: 'تعديل التقييم', en: 'Edit review' },
1346
+ 'pages.rating.confirm_deletion': { ar: 'تأكيد حذف التقييم', en: 'Confirm review deletion' },
1347
+ 'pages.rating.are_you_sure_you_want_to_delete_review': {
1348
+ ar: 'هل أنت متأكد من حذف تقييمك؟',
1349
+ en: 'Are you sure you want to delete your review?',
1350
+ },
1351
+ 'pages.rating.review_updated_successfully': {
1352
+ ar: 'تم تعديل التقييم بنجاح',
1353
+ en: 'The review has been successfully updated.',
1354
+ },
1355
+ 'pages.rating.review_deleted_successfully': {
1356
+ ar: 'تم حذف التقييم بنجاح',
1357
+ en: 'The review has been successfully deleted.',
1358
+ },
1359
+ 'pages.rating.images_count': {
1360
+ ar: 'الصور ( :current من أصل :total )',
1361
+ en: 'Images ( :current of :total )',
1362
+ },
1363
+ 'pages.rating.media_count': {
1364
+ ar: 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)',
1365
+ en: 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)',
1366
+ },
1367
+ 'common.uploader.allowed_videos_types': {
1368
+ ar: 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv',
1369
+ en: 'Videos in mp4, mov, avi, or mkv format are allowed.',
1370
+ },
1371
+ 'pages.rating.videos_count': {
1372
+ ar: 'الفيديو ( :current من أصل :total )',
1373
+ en: 'Videos ( :current of :total )',
1374
+ },
1375
+ 'common.uploader.allowed_media_types': {
1376
+ ar: 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv',
1377
+ en: 'Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed.',
1378
+ },
1379
+ 'common.uploader.max_three_images': {
1380
+ ar: `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`,
1381
+ en: `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`,
1382
+ },
1383
+ 'common.uploader.max_images_count': {
1384
+ ar: 'أضف :count صور كحد أقصى',
1385
+ en: 'Add up to :count images maximum.',
1386
+ },
1387
+ 'common.uploader.max_videos_count': {
1388
+ ar: 'أضف :count فيديوهات كحد أقصى',
1389
+ en: 'Add up to :count videos maximum.',
1390
+ },
1391
+ 'common.elements.confirm_delete': { ar: 'تأكيد الحذف', en: 'Confirm deletion' },
1392
+ 'pages.rating.rate_required_factors': {
1393
+ ar: 'يرجى تقييم جميع المعايير لإتمام مراجعتك.',
1394
+ en: 'Please rate all required factors to complete your review.',
1395
+ },
1396
+ 'pages.rating.overall_product_rating': {
1397
+ ar: 'التقييم العام للمنتج',
1398
+ en: 'Overall product rating',
1399
+ },
1400
+ 'pages.rating.rate_the_following_factors': {
1401
+ ar: 'كيف تقيِّم التالي؟',
1402
+ en: 'How would you rate the following?',
1403
+ },
1404
+ 'pages.rating.loyalty_points_for_images': {
1405
+ ar: 'شاركنا صورة مع تقييمك للطلب واكسب :points نقطة ولاء',
1406
+ en: 'Share a photo with your order review and earn :points loyalty points',
1407
+ },
1408
+ });
1409
+ this.contactUsLabel = salla.lang.get('blocks.footer.social');
1410
+ this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
1411
+ this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
1412
+ this.threeImagesMax = this.getMaxUploadHintLabel();
1413
+ this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
1414
+ this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
1415
+ this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
1416
+ this.confirmDeletionLabel = salla.lang.get('pages.rating.confirm_deletion');
1417
+ this.cancelLabel = salla.lang.get('common.elements.cancel');
1418
+ this.updatedSuccessfullyLabel = salla.lang.get('pages.rating.review_updated_successfully');
1419
+ this.deletedSuccessfullyLabel = salla.lang.get('pages.rating.review_deleted_successfully');
1420
+ this.confirmDeleteBtn = salla.lang.get('common.elements.confirm_delete');
1421
+ this.requiredFactorsLabel = salla.lang.get('pages.rating.rate_required_factors');
1422
+ this.rateTheFollowingLabel = salla.lang.get('pages.rating.rate_the_following_factors');
1423
+ this.loyaltyPointsForImagesLabel = salla.lang.get('pages.rating.loyalty_points_for_images', {
1424
+ points: ':points',
1425
+ });
1426
+ this.contact_body = (store, id, customer) => salla.lang.get('pages.rating.contact_body', { store, id, customer });
1427
+ }
1323
1428
  componentDidRender() {
1324
1429
  if (!this.scheduleWizardSetup || !this.defaultMode || !this.order) {
1325
1430
  return;
@@ -1344,19 +1449,38 @@ export class SallaRatingModalV2 {
1344
1449
  static get properties() {
1345
1450
  return {
1346
1451
  "orderId": {
1347
- "type": "number",
1452
+ "type": "any",
1348
1453
  "attribute": "order-id",
1349
- "mutable": false,
1454
+ "mutable": true,
1350
1455
  "complexType": {
1351
- "original": "number",
1352
- "resolved": "number",
1456
+ "original": "number | string | null",
1457
+ "resolved": "number | string",
1353
1458
  "references": {}
1354
1459
  },
1355
1460
  "required": false,
1356
1461
  "optional": true,
1357
1462
  "docs": {
1358
1463
  "tags": [],
1359
- "text": "The order id, to rate on its products & shipping"
1464
+ "text": "The order id, to rate on its products & shipping.\nExplicitly `null` means an unverified (no order) product review."
1465
+ },
1466
+ "getter": false,
1467
+ "setter": false,
1468
+ "reflect": false
1469
+ },
1470
+ "productId": {
1471
+ "type": "any",
1472
+ "attribute": "product-id",
1473
+ "mutable": true,
1474
+ "complexType": {
1475
+ "original": "number | string",
1476
+ "resolved": "number | string",
1477
+ "references": {}
1478
+ },
1479
+ "required": false,
1480
+ "optional": true,
1481
+ "docs": {
1482
+ "tags": [],
1483
+ "text": ""
1360
1484
  },
1361
1485
  "getter": false,
1362
1486
  "setter": false,
@@ -1399,6 +1523,31 @@ export class SallaRatingModalV2 {
1399
1523
  }
1400
1524
  static get methods() {
1401
1525
  return {
1526
+ "setOrder": {
1527
+ "complexType": {
1528
+ "signature": "(orderId: number | string | null, productId?: number | string) => Promise<void>",
1529
+ "parameters": [{
1530
+ "name": "orderId",
1531
+ "type": "string | number",
1532
+ "docs": ""
1533
+ }, {
1534
+ "name": "productId",
1535
+ "type": "string | number",
1536
+ "docs": ""
1537
+ }],
1538
+ "references": {
1539
+ "Promise": {
1540
+ "location": "global",
1541
+ "id": "global::Promise"
1542
+ }
1543
+ },
1544
+ "return": "Promise<void>"
1545
+ },
1546
+ "docs": {
1547
+ "text": "Point the modal at a different order/product and invalidate any cached\norder so the next open() re-fetches instead of reusing stale data.\nPass `orderId` as `null` for an eligible-but-unverified product review.",
1548
+ "tags": []
1549
+ }
1550
+ },
1402
1551
  "open": {
1403
1552
  "complexType": {
1404
1553
  "signature": "() => Promise<unknown>",