@salla.sa/twilight-theme-engine 1.0.62 → 1.0.64
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.
- package/dist/{AddToCartForm-HC24EPIH.js → AddToCartForm-QDOLIEJQ.js} +3 -3
- package/dist/{AddToCartForm-HC24EPIH.js.map → AddToCartForm-QDOLIEJQ.js.map} +1 -1
- package/dist/{BlogAuthorPage-BYPC2H3B.js → BlogAuthorPage-3PXTTKD2.js} +11 -11
- package/dist/{BlogAuthorPage-BYPC2H3B.js.map → BlogAuthorPage-3PXTTKD2.js.map} +1 -1
- package/dist/{BlogCategoryPage-SDOHIF4O.js → BlogCategoryPage-ELIZ66NZ.js} +11 -11
- package/dist/{BlogCategoryPage-SDOHIF4O.js.map → BlogCategoryPage-ELIZ66NZ.js.map} +1 -1
- package/dist/{BlogPage-WMFITGI7.js → BlogPage-QP5FYB6W.js} +9 -9
- package/dist/{BlogPage-WMFITGI7.js.map → BlogPage-QP5FYB6W.js.map} +1 -1
- package/dist/{BlogSinglePage-32GR3ARO.js → BlogSinglePage-WML62TEH.js} +9 -9
- package/dist/{BlogSinglePage-32GR3ARO.js.map → BlogSinglePage-WML62TEH.js.map} +1 -1
- package/dist/{BlogTagPage-FMH7YMYW.js → BlogTagPage-UYB62N2A.js} +11 -11
- package/dist/{BlogTagPage-FMH7YMYW.js.map → BlogTagPage-UYB62N2A.js.map} +1 -1
- package/dist/{BrandsPage-QLO4XO5V.js → BrandsPage-I7TW2URN.js} +10 -10
- package/dist/{BrandsPage-QLO4XO5V.js.map → BrandsPage-I7TW2URN.js.map} +1 -1
- package/dist/{Breadcrumb-6I4ZXJP6.js → Breadcrumb-EH55PVNJ.js} +9 -9
- package/dist/{Breadcrumb-6I4ZXJP6.js.map → Breadcrumb-EH55PVNJ.js.map} +1 -1
- package/dist/{CartItem-FLPJREOC.js → CartItem-N4XSKQTB.js} +9 -9
- package/dist/{CartItem-FLPJREOC.js.map → CartItem-N4XSKQTB.js.map} +1 -1
- package/dist/{CartSummary-4LVQXTO2.js → CartSummary-OM4X2NLC.js} +9 -9
- package/dist/{CartSummary-4LVQXTO2.js.map → CartSummary-OM4X2NLC.js.map} +1 -1
- package/dist/{Copyright-DHXKJXS3.js → Copyright-XE5XNMYG.js} +3 -3
- package/dist/{Copyright-DHXKJXS3.js.map → Copyright-XE5XNMYG.js.map} +1 -1
- package/dist/{CustomerLayout-RIJ2KLKV.js → CustomerLayout-HQAWJ4CV.js} +27 -11
- package/dist/CustomerLayout-HQAWJ4CV.js.map +1 -0
- package/dist/{Footer-OAUEPXMT.js → Footer-4KM2TX4Q.js} +9 -9
- package/dist/{Footer-OAUEPXMT.js.map → Footer-4KM2TX4Q.js.map} +1 -1
- package/dist/{Header-SLIN3ZSS.js → Header-NNACXS5F.js} +6 -6
- package/dist/{Header-SLIN3ZSS.js.map → Header-NNACXS5F.js.map} +1 -1
- package/dist/LoyaltyPage-DIU7FAEL.js +61 -0
- package/dist/LoyaltyPage-DIU7FAEL.js.map +1 -0
- package/dist/LoyaltyPointsPage-EMJEFBLA.js +16 -0
- package/dist/LoyaltyPointsPage-EMJEFBLA.js.map +1 -0
- package/dist/{MainMenu-EHFPPGYJ.js → MainMenu-7W5ENSPK.js} +3 -3
- package/dist/{MainMenu-EHFPPGYJ.js.map → MainMenu-7W5ENSPK.js.map} +1 -1
- package/dist/{MasterLayout-K737DLVH.js → MasterLayout-QCCMRBYA.js} +9 -9
- package/dist/{MasterLayout-K737DLVH.js.map → MasterLayout-QCCMRBYA.js.map} +1 -1
- package/dist/{MobileMenu-S5CBPTOC.js → MobileMenu-QFOL5UPI.js} +9 -9
- package/dist/{MobileMenu-S5CBPTOC.js.map → MobileMenu-QFOL5UPI.js.map} +1 -1
- package/dist/{NotificationsPage-W2N5QD5U.js → NotificationsPage-VOUFKNUQ.js} +9 -9
- package/dist/{NotificationsPage-W2N5QD5U.js.map → NotificationsPage-VOUFKNUQ.js.map} +1 -1
- package/dist/OrderSinglePage-WYNWGJ6N.js +719 -0
- package/dist/OrderSinglePage-WYNWGJ6N.js.map +1 -0
- package/dist/OrdersPage-BAPUFN4I.js +68 -0
- package/dist/OrdersPage-BAPUFN4I.js.map +1 -0
- package/dist/{PageSingle-6HBQPKK5.js → PageSingle-WPU4OJF4.js} +4 -4
- package/dist/{PageSingle-6HBQPKK5.js.map → PageSingle-WPU4OJF4.js.map} +1 -1
- package/dist/{ProductDetails-HLSACRJJ.js → ProductDetails-NKNCR5QX.js} +10 -3
- package/dist/ProductDetails-NKNCR5QX.js.map +1 -0
- package/dist/{ProfilePage-Z3CXGXWV.js → ProfilePage-ENSVDCJI.js} +9 -9
- package/dist/{ProfilePage-Z3CXGXWV.js.map → ProfilePage-ENSVDCJI.js.map} +1 -1
- package/dist/{SeoCartWidget-SUXBLTDW.js → SeoCartWidget-H7IY2ZR4.js} +12 -12
- package/dist/SeoCartWidget-H7IY2ZR4.js.map +1 -0
- package/dist/{SettingsPage-BNELVWPX.js → SettingsPage-HEWBMFUI.js} +9 -9
- package/dist/{SettingsPage-BNELVWPX.js.map → SettingsPage-HEWBMFUI.js.map} +1 -1
- package/dist/{StoreClosedNotification-PLPV6EJS.js → StoreClosedNotification-VIS7RAEH.js} +10 -10
- package/dist/{StoreClosedNotification-PLPV6EJS.js.map → StoreClosedNotification-VIS7RAEH.js.map} +1 -1
- package/dist/{TestimonialsPage-LRITI3DU.js → TestimonialsPage-TNL7CM6X.js} +4 -4
- package/dist/{TestimonialsPage-LRITI3DU.js.map → TestimonialsPage-TNL7CM6X.js.map} +1 -1
- package/dist/{ThankYouPage-IR2ZJJ47.js → ThankYouPage-VFVXLL6Q.js} +13 -12
- package/dist/ThankYouPage-VFVXLL6Q.js.map +1 -0
- package/dist/{WalletPage-RDG4DJ75.js → WalletPage-CINZCGTU.js} +9 -9
- package/dist/{WalletPage-RDG4DJ75.js.map → WalletPage-CINZCGTU.js.map} +1 -1
- package/dist/{WishlistPage-TCI3MFCX.js → WishlistPage-M37MPJBY.js} +149 -26
- package/dist/WishlistPage-M37MPJBY.js.map +1 -0
- package/dist/api/brands.js +3 -3
- package/dist/api/cart.d.ts +7 -6
- package/dist/api/cart.d.ts.map +1 -1
- package/dist/api/cart.js +3 -3
- package/dist/api/category.js +3 -3
- package/dist/api/loyalty.js +3 -3
- package/dist/api/order.d.ts +22 -0
- package/dist/api/order.d.ts.map +1 -1
- package/dist/api/order.js +3 -3
- package/dist/api/page.js +3 -3
- package/dist/api/product.js +3 -3
- package/dist/api/store.d.ts +12 -0
- package/dist/api/store.d.ts.map +1 -1
- package/dist/api/store.js +1 -1
- package/dist/api/wishlist.js +4 -4
- package/dist/{chunk-2SDIXR52.js → chunk-3A4ZJP5S.js} +4 -4
- package/dist/{chunk-2SDIXR52.js.map → chunk-3A4ZJP5S.js.map} +1 -1
- package/dist/{chunk-DPWX5WRB.js → chunk-6J33ZJB6.js} +12 -10
- package/dist/chunk-6J33ZJB6.js.map +1 -0
- package/dist/{chunk-QVLEF2GR.js → chunk-7ZYIBWZM.js} +16 -12
- package/dist/chunk-7ZYIBWZM.js.map +1 -0
- package/dist/{chunk-6HJLG7KF.js → chunk-ABOMCRUW.js} +6 -6
- package/dist/{chunk-6HJLG7KF.js.map → chunk-ABOMCRUW.js.map} +1 -1
- package/dist/{chunk-OET4G4XC.js → chunk-BE3JDKE2.js} +19 -3
- package/dist/chunk-BE3JDKE2.js.map +1 -0
- package/dist/chunk-EHEXX43T.js +21 -0
- package/dist/chunk-EHEXX43T.js.map +1 -0
- package/dist/{chunk-7OIP65ER.js → chunk-EQ32CL4D.js} +7 -4
- package/dist/chunk-EQ32CL4D.js.map +1 -0
- package/dist/{chunk-PK7EU5TM.js → chunk-GD26FI4J.js} +2 -2
- package/dist/chunk-GD26FI4J.js.map +1 -0
- package/dist/{chunk-YMVLYYLU.js → chunk-GOPUP26T.js} +4 -4
- package/dist/chunk-GOPUP26T.js.map +1 -0
- package/dist/{chunk-WH225GEC.js → chunk-I62RENKM.js} +3 -3
- package/dist/{chunk-WH225GEC.js.map → chunk-I62RENKM.js.map} +1 -1
- package/dist/{chunk-TDZSHACC.js → chunk-IC7YN4OQ.js} +3 -3
- package/dist/{chunk-TDZSHACC.js.map → chunk-IC7YN4OQ.js.map} +1 -1
- package/dist/{chunk-4DHLIY6V.js → chunk-IIYK56TI.js} +4 -3
- package/dist/chunk-IIYK56TI.js.map +1 -0
- package/dist/{chunk-W2B5P54C.js → chunk-KHRIGLYL.js} +3 -3
- package/dist/{chunk-W2B5P54C.js.map → chunk-KHRIGLYL.js.map} +1 -1
- package/dist/{chunk-ZQGMVUPE.js → chunk-KWHCKGLL.js} +3 -3
- package/dist/{chunk-ZQGMVUPE.js.map → chunk-KWHCKGLL.js.map} +1 -1
- package/dist/{chunk-J3WIGP64.js → chunk-LJ525OCU.js} +4 -4
- package/dist/{chunk-J3WIGP64.js.map → chunk-LJ525OCU.js.map} +1 -1
- package/dist/{chunk-VJHDE6UT.js → chunk-N6TNEM5G.js} +12 -3
- package/dist/chunk-N6TNEM5G.js.map +1 -0
- package/dist/{chunk-YH4O3H4R.js → chunk-NPEI4SAZ.js} +3 -3
- package/dist/{chunk-YH4O3H4R.js.map → chunk-NPEI4SAZ.js.map} +1 -1
- package/dist/{chunk-Y7EOX2OE.js → chunk-PDDMAWWF.js} +3 -3
- package/dist/{chunk-Y7EOX2OE.js.map → chunk-PDDMAWWF.js.map} +1 -1
- package/dist/{chunk-JVGZDLFP.js → chunk-PE3LLBNR.js} +3 -3
- package/dist/{chunk-JVGZDLFP.js.map → chunk-PE3LLBNR.js.map} +1 -1
- package/dist/{chunk-3U26OMNO.js → chunk-PWBMSGMU.js} +24 -17
- package/dist/chunk-PWBMSGMU.js.map +1 -0
- package/dist/{chunk-VSJLPWFI.js → chunk-Q5UYV2EN.js} +3 -3
- package/dist/{chunk-VSJLPWFI.js.map → chunk-Q5UYV2EN.js.map} +1 -1
- package/dist/{chunk-GUGZ4CEG.js → chunk-S3CC2YGF.js} +3 -3
- package/dist/{chunk-GUGZ4CEG.js.map → chunk-S3CC2YGF.js.map} +1 -1
- package/dist/{chunk-E2JXP2PP.js → chunk-T6YSHLAI.js} +6 -6
- package/dist/{chunk-E2JXP2PP.js.map → chunk-T6YSHLAI.js.map} +1 -1
- package/dist/{chunk-H5CFMW4M.js → chunk-VKY5OTIN.js} +4 -4
- package/dist/{chunk-H5CFMW4M.js.map → chunk-VKY5OTIN.js.map} +1 -1
- package/dist/{chunk-3ITQB3PY.js → chunk-VLBQPVHM.js} +3 -3
- package/dist/{chunk-3ITQB3PY.js.map → chunk-VLBQPVHM.js.map} +1 -1
- package/dist/{chunk-TLO2M5TJ.js → chunk-W66OHTSM.js} +3 -3
- package/dist/{chunk-TLO2M5TJ.js.map → chunk-W66OHTSM.js.map} +1 -1
- package/dist/{chunk-OIH4XW47.js → chunk-XCS3HZNM.js} +49 -56
- package/dist/chunk-XCS3HZNM.js.map +1 -0
- package/dist/chunk-YZHHK5IP.js +14 -0
- package/dist/{chunk-JSV64SPM.js.map → chunk-YZHHK5IP.js.map} +1 -1
- package/dist/{chunk-TFB3QXYH.js → chunk-ZGHRSRDO.js} +3 -2
- package/dist/chunk-ZGHRSRDO.js.map +1 -0
- package/dist/{chunk-MSMFH6BM.js → chunk-ZJ5KWIEB.js} +5 -5
- package/dist/{chunk-MSMFH6BM.js.map → chunk-ZJ5KWIEB.js.map} +1 -1
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +7 -7
- package/dist/components/home/index.js +10 -10
- package/dist/components/layout/CustomerLayout.d.ts.map +1 -1
- package/dist/components/layout/index.js +1 -18
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/product/ProductDetails.d.ts.map +1 -1
- package/dist/components/product/index.js +8 -8
- package/dist/components/store/index.js +9 -9
- package/dist/{document-class-5KOR5KVY.js → document-class-37KI2E52.js} +9 -9
- package/dist/{document-class-5KOR5KVY.js.map → document-class-37KI2E52.js.map} +1 -1
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/useComments.js +1 -1
- package/dist/hooks/useGtm.js +7 -7
- package/dist/hooks/useMoney.d.ts +3 -3
- package/dist/hooks/useMoney.d.ts.map +1 -1
- package/dist/hooks/useMoney.js +7 -7
- package/dist/hooks/useProduct.d.ts.map +1 -1
- package/dist/hooks/useProduct.js +1 -1
- package/dist/hooks/useStore.js +7 -7
- package/dist/index.js +7 -7
- package/dist/{navigation-QMBOIYJI.js → navigation-ESPAHRXM.js} +5 -5
- package/dist/{navigation-QMBOIYJI.js.map → navigation-ESPAHRXM.js.map} +1 -1
- package/dist/{navigation-XZJCQXY3.js → navigation-YKRXGGSL.js} +4 -4
- package/dist/{navigation-XZJCQXY3.js.map → navigation-YKRXGGSL.js.map} +1 -1
- package/dist/{not-found-ZJXJJYD3.js → not-found-UXBV4766.js} +10 -10
- package/dist/{not-found-ZJXJJYD3.js.map → not-found-UXBV4766.js.map} +1 -1
- package/dist/providers/TwilightProvider.d.ts.map +1 -1
- package/dist/providers/index.js +7 -7
- package/dist/providers/twilight-init.d.ts.map +1 -1
- package/dist/router/route-ids.d.ts +1 -0
- package/dist/router/route-ids.d.ts.map +1 -1
- package/dist/routes/account/orders/OrderSinglePage.d.ts +7 -1
- package/dist/routes/account/orders/OrderSinglePage.d.ts.map +1 -1
- package/dist/routes/account/orders/OrdersPage.d.ts +2 -1
- package/dist/routes/account/orders/OrdersPage.d.ts.map +1 -1
- package/dist/routes/account/orders/loader.d.ts.map +1 -1
- package/dist/routes/account/orders/single/OrderActions.d.ts +7 -0
- package/dist/routes/account/orders/single/OrderActions.d.ts.map +1 -0
- package/dist/routes/account/orders/single/OrderHeader.d.ts +8 -0
- package/dist/routes/account/orders/single/OrderHeader.d.ts.map +1 -0
- package/dist/routes/account/orders/single/OrderItemRow.d.ts +9 -0
- package/dist/routes/account/orders/single/OrderItemRow.d.ts.map +1 -0
- package/dist/routes/account/orders/single/OrderSections.d.ts +23 -0
- package/dist/routes/account/orders/single/OrderSections.d.ts.map +1 -0
- package/dist/routes/account/orders/single/types.d.ts +53 -0
- package/dist/routes/account/orders/single/types.d.ts.map +1 -0
- package/dist/routes/account/orders/types.d.ts +3 -0
- package/dist/routes/account/orders/types.d.ts.map +1 -1
- package/dist/routes/account/orders.js +4 -4
- package/dist/routes/account/wishlist/WishlistPage.d.ts +1 -1
- package/dist/routes/account/wishlist/WishlistPage.d.ts.map +1 -1
- package/dist/routes/account/wishlist/WishlistShare.d.ts +1 -0
- package/dist/routes/account/wishlist/WishlistShare.d.ts.map +1 -1
- package/dist/routes/account.js +11 -11
- package/dist/routes/blog.js +8 -8
- package/dist/routes/brands.js +4 -4
- package/dist/routes/cart/CartPage.d.ts.map +1 -1
- package/dist/routes/cart.js +16 -16
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +11 -11
- package/dist/routes/index.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +3 -3
- package/dist/routes/loyalty/LoyaltyPage.d.ts +1 -1
- package/dist/routes/loyalty/LoyaltyPage.d.ts.map +1 -1
- package/dist/routes/loyalty/LoyaltyPointsPage.d.ts +3 -0
- package/dist/routes/loyalty/LoyaltyPointsPage.d.ts.map +1 -0
- package/dist/routes/loyalty/index.d.ts +15 -3
- package/dist/routes/loyalty/index.d.ts.map +1 -1
- package/dist/routes/loyalty/loader.d.ts +2 -1
- package/dist/routes/loyalty/loader.d.ts.map +1 -1
- package/dist/routes/loyalty/types.d.ts +3 -0
- package/dist/routes/loyalty/types.d.ts.map +1 -1
- package/dist/routes/loyalty.js +62 -11
- package/dist/routes/loyalty.js.map +1 -1
- package/dist/routes/page.js +4 -4
- package/dist/routes/product/index.d.ts.map +1 -1
- package/dist/routes/product-listing/index.d.ts.map +1 -1
- package/dist/routes/product-listing.js +22 -19
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +15 -13
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/seo-redirects.js +3 -3
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you/ThankYouPage.d.ts.map +1 -1
- package/dist/routes/thank-you.js +4 -4
- package/dist/skeleton.js +11 -11
- package/dist/tanstack/document-class.d.ts.map +1 -1
- package/dist/tanstack/head.d.ts +1 -4
- package/dist/tanstack/head.d.ts.map +1 -1
- package/dist/tanstack/router.d.ts.map +1 -1
- package/dist/tanstack/templates/locale-wrapper.d.ts.map +1 -1
- package/dist/tanstack.js +10 -10
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/head.d.ts +3 -0
- package/dist/utils/head.d.ts.map +1 -1
- package/dist/utils/head.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/vite/adapters/tanstack.adapter.d.ts.map +1 -1
- package/dist/vite/index.js +88 -11
- package/dist/vite/index.js.map +1 -1
- package/dist/vite/plugins/best-practices/hooks-registry.d.ts.map +1 -1
- package/dist/vite/plugins/component-deps.d.ts +5 -0
- package/dist/vite/plugins/component-deps.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/CustomerLayout-RIJ2KLKV.js.map +0 -1
- package/dist/LoyaltyPage-BQB7BDUO.js +0 -195
- package/dist/LoyaltyPage-BQB7BDUO.js.map +0 -1
- package/dist/OrderSinglePage-GOGNRVPM.js +0 -502
- package/dist/OrderSinglePage-GOGNRVPM.js.map +0 -1
- package/dist/OrdersPage-YB7WU5QV.js +0 -252
- package/dist/OrdersPage-YB7WU5QV.js.map +0 -1
- package/dist/ProductDetails-HLSACRJJ.js.map +0 -1
- package/dist/SeoCartWidget-SUXBLTDW.js.map +0 -1
- package/dist/ThankYouPage-IR2ZJJ47.js.map +0 -1
- package/dist/WishlistPage-TCI3MFCX.js.map +0 -1
- package/dist/chunk-3U26OMNO.js.map +0 -1
- package/dist/chunk-4DHLIY6V.js.map +0 -1
- package/dist/chunk-7OIP65ER.js.map +0 -1
- package/dist/chunk-DPWX5WRB.js.map +0 -1
- package/dist/chunk-JSV64SPM.js +0 -14
- package/dist/chunk-OET4G4XC.js.map +0 -1
- package/dist/chunk-OIH4XW47.js.map +0 -1
- package/dist/chunk-PK7EU5TM.js.map +0 -1
- package/dist/chunk-QVLEF2GR.js.map +0 -1
- package/dist/chunk-TFB3QXYH.js.map +0 -1
- package/dist/chunk-VJHDE6UT.js.map +0 -1
- package/dist/chunk-YMVLYYLU.js.map +0 -1
|
@@ -0,0 +1,719 @@
|
|
|
1
|
+
import { order } from './chunk-N6TNEM5G.js';
|
|
2
|
+
import { usePageConfig, useMoney, useDate, useNumber } from './chunk-XCS3HZNM.js';
|
|
3
|
+
import './chunk-ABOMCRUW.js';
|
|
4
|
+
import './chunk-JKIRRMBU.js';
|
|
5
|
+
import './chunk-2JV6WZ6O.js';
|
|
6
|
+
import './chunk-UIOLSYKV.js';
|
|
7
|
+
import './chunk-VVZNW5CB.js';
|
|
8
|
+
import './chunk-2XGQSJKH.js';
|
|
9
|
+
import { useNavigate, useLocation } from './chunk-I62RENKM.js';
|
|
10
|
+
import './chunk-ZGHRSRDO.js';
|
|
11
|
+
import './chunk-GOPUP26T.js';
|
|
12
|
+
import './chunk-C5X6CVXC.js';
|
|
13
|
+
import { useUser } from './chunk-UZKTK6YV.js';
|
|
14
|
+
import './chunk-5X2UFNKY.js';
|
|
15
|
+
import './chunk-P3OPJL6I.js';
|
|
16
|
+
import './chunk-WY4IYO3G.js';
|
|
17
|
+
import './chunk-TYLKNVQA.js';
|
|
18
|
+
import './chunk-SR4OTLTJ.js';
|
|
19
|
+
import './chunk-N2S25NXP.js';
|
|
20
|
+
import './chunk-TP3LCGE7.js';
|
|
21
|
+
import './chunk-Z653O7MX.js';
|
|
22
|
+
import './chunk-ZCH7W7DZ.js';
|
|
23
|
+
import './chunk-PWBMSGMU.js';
|
|
24
|
+
import './chunk-JWXJPJBO.js';
|
|
25
|
+
import './chunk-CW625T2E.js';
|
|
26
|
+
import './chunk-7V36I5GT.js';
|
|
27
|
+
import './chunk-BVSJPBJ6.js';
|
|
28
|
+
import './chunk-GBWCXUPD.js';
|
|
29
|
+
import './chunk-OAMIDZKW.js';
|
|
30
|
+
import { useTranslation } from './chunk-TYNZ5B2B.js';
|
|
31
|
+
import './chunk-T72DAX7R.js';
|
|
32
|
+
import './chunk-RJPPO3ET.js';
|
|
33
|
+
import { HookSlot, useIsClient } from './chunk-Q7VWURUR.js';
|
|
34
|
+
import './chunk-GU2KUQVD.js';
|
|
35
|
+
import './chunk-PDDMAWWF.js';
|
|
36
|
+
import './chunk-AXW67SY7.js';
|
|
37
|
+
import './chunk-BYMOPN2S.js';
|
|
38
|
+
import './chunk-SKLEJJ6M.js';
|
|
39
|
+
import { useAsyncFn } from './chunk-6BZ5TKEV.js';
|
|
40
|
+
import './chunk-FZKRSGLP.js';
|
|
41
|
+
import './chunk-CUG6VOLM.js';
|
|
42
|
+
import './chunk-HX3YKS5W.js';
|
|
43
|
+
import './chunk-OBSAH7K6.js';
|
|
44
|
+
import { useTwilight } from './chunk-DF6FBKDN.js';
|
|
45
|
+
import './chunk-DGUM43GV.js';
|
|
46
|
+
import { SallaButton } from '@salla.sa/twilight-components-react/button';
|
|
47
|
+
import { SallaRatingModal } from '@salla.sa/twilight-components-react/rating-modal';
|
|
48
|
+
import { SallaEditOrderButton } from '@salla.sa/twilight-components-react/edit-order-button';
|
|
49
|
+
import { SallaOrderBranch } from '@salla.sa/twilight-components-react/order-branch';
|
|
50
|
+
import { SallaOrderTotalsCard } from '@salla.sa/twilight-components-react/order-totals-card';
|
|
51
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
52
|
+
import { createElement, useState } from 'react';
|
|
53
|
+
import { SallaOrderDetails } from '@salla.sa/twilight-components-react/order-details';
|
|
54
|
+
import { SallaModal } from '@salla.sa/twilight-components-react/modal';
|
|
55
|
+
import { SallaRatingStars } from '@salla.sa/twilight-components-react/rating-stars';
|
|
56
|
+
import { useQuery } from '@tanstack/react-query';
|
|
57
|
+
|
|
58
|
+
var PRINT_WINDOW = "toolbar=yes, scrollbars=yes, resizable=yes, width=900, height=700";
|
|
59
|
+
function OrderStatus({ order: order2, paymentExpired }) {
|
|
60
|
+
const { t } = useTranslation();
|
|
61
|
+
if (paymentExpired) {
|
|
62
|
+
return /* @__PURE__ */ jsx("span", { className: "text-red-500", children: t("pages.orders.pending_payment_expired") });
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsxs(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
className: "text-primary inline-flex items-center rtl:space-x-reverse space-x-1",
|
|
68
|
+
style: { color: order2.status.color },
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx("i", { className: `mt-1 ${order2.status.icon}` }),
|
|
71
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
72
|
+
" ",
|
|
73
|
+
order2.status.name
|
|
74
|
+
] })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function OrderHeader({
|
|
80
|
+
order: order2,
|
|
81
|
+
links,
|
|
82
|
+
paymentExpired
|
|
83
|
+
}) {
|
|
84
|
+
const { t, direction } = useTranslation();
|
|
85
|
+
const { format: formatDate } = useDate();
|
|
86
|
+
const { format: formatNumber } = useNumber();
|
|
87
|
+
return /* @__PURE__ */ jsx("table", { className: "min-w-full rounded-md overflow-hidden", children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { className: "bg-white overflow-hidden flex md:table-row flex-row md:flex-row flex-wrap md:flex-no-wrap py-1.5 md:py-0", children: [
|
|
88
|
+
/* @__PURE__ */ jsxs(
|
|
89
|
+
"td",
|
|
90
|
+
{
|
|
91
|
+
"data-testid": "store-order-status",
|
|
92
|
+
className: "single-order-header-item w-full md:w-auto px-3 md:px-6 py-2 md:py-4 md:h-20 whitespace-nowrap text-sm ",
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx("div", { className: "rtl:ml-2 ltr:mr-2 font-normal text-gray-400", children: t("pages.orders.date") }),
|
|
95
|
+
/* @__PURE__ */ jsx("b", { children: formatNumber(formatDate(order2.created_at.date)) })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsxs("td", { className: "single-order-header-item flex justify-between items-center w-full md:w-auto px-3 md:px-6 py-2 md:py-4 md:h-20 whitespace-nowrap text-sm ", children: [
|
|
100
|
+
/* @__PURE__ */ jsx(OrderStatus, { order: order2, paymentExpired }),
|
|
101
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
102
|
+
order2.type === "quote" && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-4", children: t("pages.orders.your_order_is_under_review") }),
|
|
103
|
+
!!links?.length && /* @__PURE__ */ jsx("div", { className: "flex space-x-2 rtl:space-x-reverse text-start flex-none px-2", children: links.map((link) => /* @__PURE__ */ jsxs(
|
|
104
|
+
"a",
|
|
105
|
+
{
|
|
106
|
+
href: link.url,
|
|
107
|
+
className: "text-primary-reverse bg-primary px-4 py-2 rounded",
|
|
108
|
+
target: "_blank",
|
|
109
|
+
rel: "noreferrer",
|
|
110
|
+
children: [
|
|
111
|
+
link.label,
|
|
112
|
+
" ",
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
"i",
|
|
115
|
+
{
|
|
116
|
+
className: direction === "rtl" ? "sicon-arrow-up-left" : "sicon-arrow-up-right"
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
link.url
|
|
122
|
+
)) }),
|
|
123
|
+
order2.urls.receipt && /* @__PURE__ */ jsxs(
|
|
124
|
+
SallaButton,
|
|
125
|
+
{
|
|
126
|
+
fill: "outline",
|
|
127
|
+
size: "small",
|
|
128
|
+
onClick: () => window.open(order2.urls.receipt, "_blank", PRINT_WINDOW),
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsx("i", { className: "sicon-printer2 v-align" }),
|
|
131
|
+
" ",
|
|
132
|
+
t("pages.orders.print")
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] })
|
|
137
|
+
] })
|
|
138
|
+
] }) }) });
|
|
139
|
+
}
|
|
140
|
+
function ItemAttachments({ item }) {
|
|
141
|
+
const { t } = useTranslation();
|
|
142
|
+
if (!item.attachments?.length) return null;
|
|
143
|
+
return /* @__PURE__ */ jsx("div", { className: "flow-root rounded-md px-4 border border-gray-200", children: /* @__PURE__ */ jsx("dl", { className: "text-sm text-dark divide-y divide-border-color", children: item.attachments.map((attachment) => /* @__PURE__ */ jsxs(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: "py-3.5 md:flex items-center justify-between",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsx("dt", { className: "mb-2 md:mb-0", children: t("pages.products.attachments") }),
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
"dd",
|
|
151
|
+
{
|
|
152
|
+
className: `font-medium ${attachment.type === "image" ? "text-gray-900" : "text-xs"}`,
|
|
153
|
+
children: attachment.type === "image" ? /* @__PURE__ */ jsx("div", { className: "flex rtl:space-x-reverse space-x-2.5", children: /* @__PURE__ */ jsx("a", { href: attachment.url, target: "_blank", rel: "noreferrer", children: /* @__PURE__ */ jsx(
|
|
154
|
+
"img",
|
|
155
|
+
{
|
|
156
|
+
className: "h-7 w-7 object-cover rounded-md",
|
|
157
|
+
src: attachment.url,
|
|
158
|
+
alt: item.name
|
|
159
|
+
}
|
|
160
|
+
) }) }) : /* @__PURE__ */ jsx("a", { href: attachment.url, children: t("pages.orders.file_url") })
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
]
|
|
164
|
+
},
|
|
165
|
+
`${attachment.type}:${attachment.url}`
|
|
166
|
+
)) }) });
|
|
167
|
+
}
|
|
168
|
+
function calendarDay(day) {
|
|
169
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(day));
|
|
170
|
+
return match ? new Date(+match[1], +match[2] - 1, +match[3]) : String(day);
|
|
171
|
+
}
|
|
172
|
+
function ItemReservations({ item, productType }) {
|
|
173
|
+
const { t } = useTranslation();
|
|
174
|
+
const { format: formatDate } = useDate();
|
|
175
|
+
const { format: formatNumber, useArabicNumerals } = useNumber();
|
|
176
|
+
const reservations = item.product_reservations ?? [];
|
|
177
|
+
if (productType !== "booking" || !reservations.length) return null;
|
|
178
|
+
const time = (value) => useArabicNumerals ? formatNumber(String(value)).replace(/PM/g, "\u0645").replace(/AM/g, "\u0635") : String(value);
|
|
179
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
180
|
+
item.booking_location && /* @__PURE__ */ jsx("ul", { className: "font-medium text-xs text-gray-600", children: /* @__PURE__ */ jsxs("li", { className: "py-1 flex justify-between items-baseline", children: [
|
|
181
|
+
/* @__PURE__ */ jsx("span", { className: "mt-5 mb-3.5 text-sm font-bold", children: t("common.elements.location") }),
|
|
182
|
+
/* @__PURE__ */ jsx("span", { className: "text-unicode", children: item.booking_location })
|
|
183
|
+
] }) }),
|
|
184
|
+
/* @__PURE__ */ jsx("h2", { className: "mt-5 mb-3.5 text-sm font-bold", children: reservations.length > 1 ? t("pages.cart.reservations") : t("pages.cart.item_options") }),
|
|
185
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-md p-4 border border-gray-200 mb-2", children: /* @__PURE__ */ jsx("ul", { className: "font-medium text-xs text-gray-600", children: reservations.map((reservation) => /* @__PURE__ */ jsx("li", { className: "py-1", children: /* @__PURE__ */ jsxs("span", { className: "text-unicode", children: [
|
|
186
|
+
formatNumber(formatDate(calendarDay(reservation.day))),
|
|
187
|
+
reservation.from_timestamp ? ` (${time(reservation.from)} - ${time(reservation.to)})` : ""
|
|
188
|
+
] }) }, `${reservation.day}:${reservation.from}`)) }) })
|
|
189
|
+
] });
|
|
190
|
+
}
|
|
191
|
+
function ItemSummary({
|
|
192
|
+
item,
|
|
193
|
+
twigItem,
|
|
194
|
+
money,
|
|
195
|
+
currency
|
|
196
|
+
}) {
|
|
197
|
+
const { t } = useTranslation();
|
|
198
|
+
const product = twigItem?.product;
|
|
199
|
+
const image = product?.image?.url || item.image || item.thumbnail;
|
|
200
|
+
const price = item.amounts.amount ?? { amount: 0, currency };
|
|
201
|
+
const priceText = money(price.amount, price.currency);
|
|
202
|
+
const total = item.amounts.total ?? { amount: 0, currency };
|
|
203
|
+
return /* @__PURE__ */ jsxs("div", { className: "mb-5 last:mb-0", children: [
|
|
204
|
+
product ? /* @__PURE__ */ jsxs("div", { className: "flex rtl:space-x-reverse space-x-5 mb-4", children: [
|
|
205
|
+
/* @__PURE__ */ jsx("a", { href: product.url, className: "shrink-0", children: /* @__PURE__ */ jsx(
|
|
206
|
+
"img",
|
|
207
|
+
{
|
|
208
|
+
src: image || "/images/placeholder.png",
|
|
209
|
+
alt: item.name,
|
|
210
|
+
className: `w-18 h-14 object-${image ? "cover" : "contain"} rounded-md`
|
|
211
|
+
}
|
|
212
|
+
) }),
|
|
213
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
"a",
|
|
216
|
+
{
|
|
217
|
+
href: product.url,
|
|
218
|
+
className: "block leading-5 mb-1.5 md:text-base font-semibold transition-colors text-gray-500 hover:text-primary",
|
|
219
|
+
children: item.name
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ jsx("b", { children: priceText })
|
|
223
|
+
] })
|
|
224
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "w-full flex justify-between text-sm py-2.5", children: [
|
|
225
|
+
/* @__PURE__ */ jsx("span", { className: "w-40 inline-block font-normal", children: item.name }),
|
|
226
|
+
/* @__PURE__ */ jsx("b", { children: priceText })
|
|
227
|
+
] }),
|
|
228
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full flex justify-between text-sm py-2.5", children: [
|
|
229
|
+
/* @__PURE__ */ jsx("span", { className: "w-40 inline-block font-normal", children: t("pages.products.quantity") }),
|
|
230
|
+
/* @__PURE__ */ jsx("b", { children: item.quantity })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm py-2.5", children: [
|
|
233
|
+
/* @__PURE__ */ jsx("span", { className: " w-40 inline-block font-normal", children: t("pages.products.price") }),
|
|
234
|
+
/* @__PURE__ */ jsx("b", { children: priceText })
|
|
235
|
+
] }),
|
|
236
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between text-sm py-2.5", children: [
|
|
237
|
+
/* @__PURE__ */ jsx("span", { className: "w-40 inline-block font-normal", children: t("pages.orders.total") }),
|
|
238
|
+
/* @__PURE__ */ jsx("b", { children: money(total.amount, total.currency) })
|
|
239
|
+
] })
|
|
240
|
+
] });
|
|
241
|
+
}
|
|
242
|
+
function OrderItemRow({
|
|
243
|
+
item,
|
|
244
|
+
twigItem,
|
|
245
|
+
money,
|
|
246
|
+
currency
|
|
247
|
+
}) {
|
|
248
|
+
const { t } = useTranslation();
|
|
249
|
+
const productId = twigItem?.product?.id;
|
|
250
|
+
return /* @__PURE__ */ jsxs(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
"data-testid": `store-order-item-${item.id}`,
|
|
254
|
+
"data-order-item-id": item.id,
|
|
255
|
+
"data-order-item-product-id": productId,
|
|
256
|
+
className: "order-item bg-white p-5 border-b border-gray-100 first:rounded-t-md last:rounded-b-md last:border-none",
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsx(ItemSummary, { item, twigItem, money, currency }),
|
|
259
|
+
item.availability_date && /* @__PURE__ */ jsxs("div", { className: "flex gap-2 text-sm py-2.5 text-blue-500", children: [
|
|
260
|
+
/* @__PURE__ */ jsx("i", { className: "sicon-info" }),
|
|
261
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
262
|
+
t("pages.products.expected_to_be"),
|
|
263
|
+
":",
|
|
264
|
+
" ",
|
|
265
|
+
/* @__PURE__ */ jsx("b", { children: String(item.availability_date).slice(0, 10) })
|
|
266
|
+
] })
|
|
267
|
+
] }),
|
|
268
|
+
/* @__PURE__ */ jsx(ItemReservations, { item, productType: twigItem?.product?.type ?? item.product?.type }),
|
|
269
|
+
/* @__PURE__ */ jsx(SallaOrderDetails, { orderDetails: JSON.stringify(twigItem ?? item) }),
|
|
270
|
+
item.note && /* @__PURE__ */ jsxs("p", { className: "mt-3 text-sm text-gray-500", children: [
|
|
271
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
272
|
+
t("common.elements.note"),
|
|
273
|
+
" : "
|
|
274
|
+
] }),
|
|
275
|
+
item.note
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ jsx(ItemAttachments, { item }),
|
|
278
|
+
productId && createElement("salla-review-order-item", {
|
|
279
|
+
"product-id": productId,
|
|
280
|
+
suppressHydrationWarning: true
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
function ConfirmModal({
|
|
287
|
+
visible,
|
|
288
|
+
onVisibleChange,
|
|
289
|
+
title,
|
|
290
|
+
subTitle,
|
|
291
|
+
iconStyle,
|
|
292
|
+
confirmColor,
|
|
293
|
+
onConfirm,
|
|
294
|
+
busy
|
|
295
|
+
}) {
|
|
296
|
+
const { t } = useTranslation();
|
|
297
|
+
const isClient = useIsClient();
|
|
298
|
+
if (!isClient) return null;
|
|
299
|
+
return /* @__PURE__ */ jsx(
|
|
300
|
+
SallaModal,
|
|
301
|
+
{
|
|
302
|
+
width: "sm",
|
|
303
|
+
visible,
|
|
304
|
+
onModalVisibilityChanged: (e) => onVisibleChange(Boolean(e.detail)),
|
|
305
|
+
...{ "modal-title": title },
|
|
306
|
+
subTitle,
|
|
307
|
+
iconStyle,
|
|
308
|
+
children: /* @__PURE__ */ jsxs("div", { slot: "footer", className: "grid grid-cols-2 gap-3", children: [
|
|
309
|
+
/* @__PURE__ */ jsx(
|
|
310
|
+
SallaButton,
|
|
311
|
+
{
|
|
312
|
+
width: "wide",
|
|
313
|
+
color: confirmColor,
|
|
314
|
+
className: "w-full cursor-pointer",
|
|
315
|
+
onClick: onConfirm,
|
|
316
|
+
disabled: busy,
|
|
317
|
+
children: t("common.elements.ok")
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
/* @__PURE__ */ jsx(
|
|
321
|
+
SallaButton,
|
|
322
|
+
{
|
|
323
|
+
className: "w-full",
|
|
324
|
+
fill: "outline",
|
|
325
|
+
color: "light",
|
|
326
|
+
onClick: () => onVisibleChange(false),
|
|
327
|
+
disabled: busy,
|
|
328
|
+
children: t("common.elements.cancel")
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
] })
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
function PaymentOrReorder({
|
|
336
|
+
order: order2,
|
|
337
|
+
paymentExpired,
|
|
338
|
+
canReorder,
|
|
339
|
+
onReorder,
|
|
340
|
+
busy
|
|
341
|
+
}) {
|
|
342
|
+
const { t } = useTranslation();
|
|
343
|
+
if (order2.actions.payable) {
|
|
344
|
+
return paymentExpired || !order2.urls.checkout ? /* @__PURE__ */ jsx("span", { className: "text-red-500", children: t("pages.orders.pending_payment_expired") }) : /* @__PURE__ */ jsxs(SallaButton, { width: "wide", href: order2.urls.checkout, children: [
|
|
345
|
+
/* @__PURE__ */ jsx("i", { className: "sicon sicon-wallet rtl:ml-2 ltr:mr-2" }),
|
|
346
|
+
/* @__PURE__ */ jsx("span", { children: t("pages.orders.finish_payment") })
|
|
347
|
+
] });
|
|
348
|
+
}
|
|
349
|
+
if (!canReorder) return null;
|
|
350
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
351
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
|
|
352
|
+
/* @__PURE__ */ jsx("h3", { className: "font-bold text-lg leading-none mb-1", children: t("pages.orders.reorder") }),
|
|
353
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.orders.reorder_description") })
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ jsxs(
|
|
356
|
+
SallaButton,
|
|
357
|
+
{
|
|
358
|
+
"data-testid": "store-order-reorder-btn",
|
|
359
|
+
shape: "link",
|
|
360
|
+
onClick: onReorder,
|
|
361
|
+
disabled: busy,
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ jsx("i", { className: "sicon sicon-rotate rtl:ml-2 ltr:mr-2" }),
|
|
364
|
+
/* @__PURE__ */ jsx("span", { children: t("pages.orders.reorder") })
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] });
|
|
369
|
+
}
|
|
370
|
+
function OrderActions({ order: order2, paymentExpired }) {
|
|
371
|
+
const { t } = useTranslation();
|
|
372
|
+
const { isLoggedIn } = useUser();
|
|
373
|
+
const navigate = useNavigate();
|
|
374
|
+
const location = useLocation();
|
|
375
|
+
const [showReorder, setShowReorder] = useState(false);
|
|
376
|
+
const [showCancel, setShowCancel] = useState(false);
|
|
377
|
+
const { reorderable, cancellable, payable } = order2.actions;
|
|
378
|
+
const canReorder = isLoggedIn && reorderable;
|
|
379
|
+
const [reorderState, handleReorder] = useAsyncFn(async () => {
|
|
380
|
+
await window.salla?.order.createCartFromOrder(Number(order2.id));
|
|
381
|
+
setShowReorder(false);
|
|
382
|
+
navigate("/cart");
|
|
383
|
+
}, [navigate, order2.id]);
|
|
384
|
+
const [cancelState, handleCancel] = useAsyncFn(async () => {
|
|
385
|
+
await window.salla?.order.cancel(Number(order2.id));
|
|
386
|
+
setShowCancel(false);
|
|
387
|
+
navigate(location.pathname, { replace: true });
|
|
388
|
+
}, [navigate, order2.id, location.pathname]);
|
|
389
|
+
if (!reorderable && !cancellable && !payable) return null;
|
|
390
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
391
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-white rounded-md p-5 divide-y divide-border-color space-y-4", children: [
|
|
392
|
+
(reorderable || payable) && /* @__PURE__ */ jsx("div", { className: payable ? "flex-center" : "center-between", children: /* @__PURE__ */ jsx(
|
|
393
|
+
PaymentOrReorder,
|
|
394
|
+
{
|
|
395
|
+
order: order2,
|
|
396
|
+
paymentExpired,
|
|
397
|
+
canReorder: !!canReorder,
|
|
398
|
+
onReorder: () => setShowReorder(true),
|
|
399
|
+
busy: reorderState.loading
|
|
400
|
+
}
|
|
401
|
+
) }),
|
|
402
|
+
cancellable && /* @__PURE__ */ jsxs("div", { className: "center-between pt-4", children: [
|
|
403
|
+
/* @__PURE__ */ jsxs("div", { className: "text-sm", children: [
|
|
404
|
+
/* @__PURE__ */ jsx("h3", { className: "font-bold text-lg leading-none mb-1", children: t("pages.orders.cancel") }),
|
|
405
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-500", children: t("pages.order.order_cancelation_desc") })
|
|
406
|
+
] }),
|
|
407
|
+
/* @__PURE__ */ jsxs(
|
|
408
|
+
SallaButton,
|
|
409
|
+
{
|
|
410
|
+
"data-testid": "store-order-cancel-btn",
|
|
411
|
+
shape: "link",
|
|
412
|
+
color: "danger",
|
|
413
|
+
onClick: () => setShowCancel(true),
|
|
414
|
+
disabled: cancelState.loading,
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx("i", { className: "sicon sicon-cancel-circle rtl:ml-2 ltr:mr-2" }),
|
|
417
|
+
/* @__PURE__ */ jsx("span", { children: t("pages.orders.cancel") })
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
)
|
|
421
|
+
] })
|
|
422
|
+
] }),
|
|
423
|
+
canReorder && /* @__PURE__ */ jsx(
|
|
424
|
+
ConfirmModal,
|
|
425
|
+
{
|
|
426
|
+
visible: showReorder,
|
|
427
|
+
onVisibleChange: setShowReorder,
|
|
428
|
+
title: t("pages.orders.reorder"),
|
|
429
|
+
subTitle: t("pages.orders.reorder_confirmation"),
|
|
430
|
+
iconStyle: "success",
|
|
431
|
+
onConfirm: handleReorder,
|
|
432
|
+
busy: reorderState.loading
|
|
433
|
+
}
|
|
434
|
+
),
|
|
435
|
+
cancellable && /* @__PURE__ */ jsx(
|
|
436
|
+
ConfirmModal,
|
|
437
|
+
{
|
|
438
|
+
visible: showCancel,
|
|
439
|
+
onVisibleChange: setShowCancel,
|
|
440
|
+
title: t("common.elements.warning"),
|
|
441
|
+
subTitle: t("pages.orders.cancel_confirmation"),
|
|
442
|
+
iconStyle: "error",
|
|
443
|
+
confirmColor: "danger",
|
|
444
|
+
onConfirm: handleCancel,
|
|
445
|
+
busy: cancelState.loading
|
|
446
|
+
}
|
|
447
|
+
)
|
|
448
|
+
] });
|
|
449
|
+
}
|
|
450
|
+
function RatingAction({
|
|
451
|
+
disabled,
|
|
452
|
+
endedKey,
|
|
453
|
+
color,
|
|
454
|
+
fill,
|
|
455
|
+
icon,
|
|
456
|
+
onClick
|
|
457
|
+
}) {
|
|
458
|
+
const { t } = useTranslation();
|
|
459
|
+
return /* @__PURE__ */ jsxs("div", { className: "tooltip-toggle tooltip-toggle--hover icon-trigger mobile-shifted", children: [
|
|
460
|
+
disabled && /* @__PURE__ */ jsx("div", { className: "tooltip-content shadow-md rounded", children: /* @__PURE__ */ jsxs("small", { children: [
|
|
461
|
+
" ",
|
|
462
|
+
t(endedKey),
|
|
463
|
+
"."
|
|
464
|
+
] }) }),
|
|
465
|
+
/* @__PURE__ */ jsx(
|
|
466
|
+
SallaButton,
|
|
467
|
+
{
|
|
468
|
+
loaderPosition: "center",
|
|
469
|
+
disabled,
|
|
470
|
+
shape: "icon",
|
|
471
|
+
fill,
|
|
472
|
+
color,
|
|
473
|
+
size: "medium",
|
|
474
|
+
onClick: disabled ? void 0 : onClick,
|
|
475
|
+
children: /* @__PURE__ */ jsx("i", { className: `${icon} text-xl` })
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
] });
|
|
479
|
+
}
|
|
480
|
+
function RatingSection({
|
|
481
|
+
title,
|
|
482
|
+
rating,
|
|
483
|
+
type,
|
|
484
|
+
allowUpdate
|
|
485
|
+
}) {
|
|
486
|
+
const dispatch = (event, payload) => window.salla?.event?.dispatch(event, payload);
|
|
487
|
+
const locked = !rating.can_update;
|
|
488
|
+
return /* @__PURE__ */ jsxs("section", { className: "flex justify-between items-start bg-white p-5 rounded-md", children: [
|
|
489
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
490
|
+
/* @__PURE__ */ jsx("h2", { className: "text-lg font-bold mb-5", children: title }),
|
|
491
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2", children: rating.content }),
|
|
492
|
+
/* @__PURE__ */ jsx(SallaRatingStars, { withLabel: true, value: rating.stars })
|
|
493
|
+
] }),
|
|
494
|
+
/* @__PURE__ */ jsx("div", { className: "rating-actions", children: allowUpdate && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
495
|
+
/* @__PURE__ */ jsx(
|
|
496
|
+
RatingAction,
|
|
497
|
+
{
|
|
498
|
+
disabled: locked,
|
|
499
|
+
endedKey: "pages.order.edit_period_ended",
|
|
500
|
+
color: "dark",
|
|
501
|
+
fill: "outline",
|
|
502
|
+
icon: "sicon-format-border-color",
|
|
503
|
+
onClick: () => dispatch("rating::edit", { type, feedback_id: String(rating.id) })
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
/* @__PURE__ */ jsx(
|
|
507
|
+
RatingAction,
|
|
508
|
+
{
|
|
509
|
+
disabled: locked,
|
|
510
|
+
endedKey: "pages.order.delete_period_ended",
|
|
511
|
+
color: "danger",
|
|
512
|
+
fill: "outline",
|
|
513
|
+
icon: "sicon-trash-2",
|
|
514
|
+
onClick: () => dispatch("rating::delete", { feedback_id: String(rating.id) })
|
|
515
|
+
}
|
|
516
|
+
)
|
|
517
|
+
] }) })
|
|
518
|
+
] });
|
|
519
|
+
}
|
|
520
|
+
function ShippingRow({ shipment }) {
|
|
521
|
+
const { t } = useTranslation();
|
|
522
|
+
const hasNumber = !!shipment.number && shipment.number !== "0";
|
|
523
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row justify-between md:items-center bg-white px-5 py-3 border-b border-gray-100 rounded-t-md text-sm space-y-4 md:space-y-0", children: [
|
|
524
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 rtl:space-x-reverse", children: [
|
|
525
|
+
shipment.logo && /* @__PURE__ */ jsx("img", { src: shipment.logo, className: "max-w-16 max-h-8", alt: shipment.name }),
|
|
526
|
+
/* @__PURE__ */ jsx("span", { children: shipment.name })
|
|
527
|
+
] }),
|
|
528
|
+
/* @__PURE__ */ jsxs("div", { className: "flex space-x-5 rtl:space-x-reverse", children: [
|
|
529
|
+
hasNumber && /* @__PURE__ */ jsxs("span", { children: [
|
|
530
|
+
t("pages.orders.shipment_no"),
|
|
531
|
+
": ",
|
|
532
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold", children: shipment.number })
|
|
533
|
+
] }),
|
|
534
|
+
shipment.tracking && /* @__PURE__ */ jsxs(
|
|
535
|
+
"a",
|
|
536
|
+
{
|
|
537
|
+
className: "font-bold text-primary hover:opacity-80 flex items-center",
|
|
538
|
+
href: shipment.tracking,
|
|
539
|
+
target: "_blank",
|
|
540
|
+
rel: "noreferrer",
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ jsx("span", { className: "sicon-shipping rtl:ml-1 ltr:mr-1" }),
|
|
543
|
+
t("pages.orders.tracking_url")
|
|
544
|
+
]
|
|
545
|
+
}
|
|
546
|
+
)
|
|
547
|
+
] })
|
|
548
|
+
] });
|
|
549
|
+
}
|
|
550
|
+
function ShippingHeader({ twig, order: order2 }) {
|
|
551
|
+
const { data } = useQuery({
|
|
552
|
+
...order.queries.shipments(String(order2.id)),
|
|
553
|
+
enabled: order2.features.shippable && !twig.is_pickable
|
|
554
|
+
});
|
|
555
|
+
if (twig.is_pickable) return null;
|
|
556
|
+
const shipments = data?.length ? data.map((shipment) => ({ ...shipment, tracking: shipment.tracking_url })) : twig.shipping ? [{ ...twig.shipping, tracking: twig.shipping.tracing_link }] : [];
|
|
557
|
+
return /* @__PURE__ */ jsx(Fragment, { children: shipments.map((shipment) => /* @__PURE__ */ jsx(ShippingRow, { shipment }, shipment.id ?? shipment.name)) });
|
|
558
|
+
}
|
|
559
|
+
var optionPrice = (price) => typeof price === "number" ? price : price?.amount ?? 0;
|
|
560
|
+
function OrderOptionsTable({
|
|
561
|
+
options,
|
|
562
|
+
money,
|
|
563
|
+
currency
|
|
564
|
+
}) {
|
|
565
|
+
const { t } = useTranslation();
|
|
566
|
+
return /* @__PURE__ */ jsxs("div", { className: "bg-white p-5 rounded-md", children: [
|
|
567
|
+
/* @__PURE__ */ jsx("h2", { className: "mb-3.5 text-sm font-bold", children: t("pages.checkout.cart_options_title") }),
|
|
568
|
+
/* @__PURE__ */ jsxs("table", { className: "table-fixed w-full border border-gray-200", children: [
|
|
569
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-gray-200", children: [
|
|
570
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "p-3 text-start text-sm", children: t("pages.order.option_name") }),
|
|
571
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "p-3 text-sm", children: t("pages.order.option_content") }),
|
|
572
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "p-3 rtl:text-left ltr:text-right text-sm", children: t("pages.products.price") })
|
|
573
|
+
] }) }),
|
|
574
|
+
/* @__PURE__ */ jsx("tbody", { children: options.flatMap(
|
|
575
|
+
(option) => (option.options ?? []).map((value) => /* @__PURE__ */ jsxs(
|
|
576
|
+
"tr",
|
|
577
|
+
{
|
|
578
|
+
className: "border-b last:border-b-0 border-gray-200",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ jsxs("td", { className: "text-sm p-3", children: [
|
|
581
|
+
value.name,
|
|
582
|
+
" :"
|
|
583
|
+
] }),
|
|
584
|
+
/* @__PURE__ */ jsx("td", { className: "text-center p-3 font-medium text-xs", children: value.value }),
|
|
585
|
+
/* @__PURE__ */ jsx("td", { className: "rtl:text-start ltr:text-end p-3 font-medium text-xs", children: /* @__PURE__ */ jsx("strong", { children: money(optionPrice(value.price), currency) }) })
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
`${value.name}:${value.value}`
|
|
589
|
+
))
|
|
590
|
+
) })
|
|
591
|
+
] })
|
|
592
|
+
] });
|
|
593
|
+
}
|
|
594
|
+
function TitleRow({ order: order2 }) {
|
|
595
|
+
const { t } = useTranslation();
|
|
596
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
|
|
597
|
+
order2.type === "buy_as_gift" || order2.source?.type === "buy_as_gift" ? /* @__PURE__ */ jsxs("span", { className: "inline-block text-primary", children: [
|
|
598
|
+
/* @__PURE__ */ jsx("i", { className: "sicon-gift-sharing" }),
|
|
599
|
+
"\xA0",
|
|
600
|
+
t("pages.orders.gift_tag")
|
|
601
|
+
] }) : /* @__PURE__ */ jsx("span", {}),
|
|
602
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-wrap", children: /* @__PURE__ */ jsx(SallaEditOrderButton, { "data-testid": "store-order-edit-btn", orderId: String(order2.id) }) })
|
|
603
|
+
] });
|
|
604
|
+
}
|
|
605
|
+
function RefundMessage({ message }) {
|
|
606
|
+
if (!message) return null;
|
|
607
|
+
return /* @__PURE__ */ jsx("div", { className: "min-w-full rounded-md overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "bg-white flex items-center gap-1 rounded-md px-3 py-5 md:px-5", children: [
|
|
608
|
+
/* @__PURE__ */ jsx("i", { className: "sicon-refund h-6 w-6" }),
|
|
609
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-base", dangerouslySetInnerHTML: { __html: message } })
|
|
610
|
+
] }) });
|
|
611
|
+
}
|
|
612
|
+
function RatingNotices({ twig }) {
|
|
613
|
+
const { t } = useTranslation();
|
|
614
|
+
const { store } = useTwilight();
|
|
615
|
+
const settings = store?.settings?.rating;
|
|
616
|
+
const rated = !!twig.rating && !Array.isArray(twig.rating);
|
|
617
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
618
|
+
settings?.allow_update && rated && /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 bg-blue-50 border border-blue-200 text-blue-500 px-2 py-3 rounded-md text-sm", children: [
|
|
619
|
+
/* @__PURE__ */ jsx("i", { className: "sicon-info" }),
|
|
620
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
621
|
+
t("pages.order.can_edit_or_delete_your_review_within"),
|
|
622
|
+
" ",
|
|
623
|
+
settings.update_period,
|
|
624
|
+
" ",
|
|
625
|
+
t("pages.order.days_since_added"),
|
|
626
|
+
"."
|
|
627
|
+
] })
|
|
628
|
+
] }),
|
|
629
|
+
twig.can_rate && /* @__PURE__ */ jsxs("div", { className: "rating-header gradient-bg center-between", children: [
|
|
630
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
631
|
+
/* @__PURE__ */ jsx("h2", { className: "font-bold mb-1", children: t("pages.order.order_rating_title") }),
|
|
632
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm", children: t("pages.order.order_rating_message") })
|
|
633
|
+
] }),
|
|
634
|
+
/* @__PURE__ */ jsx(
|
|
635
|
+
SallaButton,
|
|
636
|
+
{
|
|
637
|
+
"data-testid": "store-order-rate-btn",
|
|
638
|
+
color: "light",
|
|
639
|
+
className: "btn--rounded-full !text-primary",
|
|
640
|
+
onClick: () => window.salla?.event?.dispatch("rating::open"),
|
|
641
|
+
children: t("pages.rating.rate")
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
] })
|
|
645
|
+
] });
|
|
646
|
+
}
|
|
647
|
+
function OrderRatings({ twig }) {
|
|
648
|
+
const { t } = useTranslation();
|
|
649
|
+
const { store } = useTwilight();
|
|
650
|
+
const allowUpdate = !!store?.settings?.rating?.allow_update;
|
|
651
|
+
const rating = Array.isArray(twig.rating) ? void 0 : twig.rating;
|
|
652
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
653
|
+
rating?.store?.stars ? /* @__PURE__ */ jsx(
|
|
654
|
+
RatingSection,
|
|
655
|
+
{
|
|
656
|
+
title: t("pages.rating.rate_the_store"),
|
|
657
|
+
rating: rating.store,
|
|
658
|
+
type: "store",
|
|
659
|
+
allowUpdate
|
|
660
|
+
}
|
|
661
|
+
) : null,
|
|
662
|
+
rating?.shipping?.stars ? /* @__PURE__ */ jsx(
|
|
663
|
+
RatingSection,
|
|
664
|
+
{
|
|
665
|
+
title: t("pages.rating.rate_shipping"),
|
|
666
|
+
rating: rating.shipping,
|
|
667
|
+
type: "shipping",
|
|
668
|
+
allowUpdate
|
|
669
|
+
}
|
|
670
|
+
) : null
|
|
671
|
+
] });
|
|
672
|
+
}
|
|
673
|
+
function OrderSinglePage({ order: order2, page, componentsOrder }) {
|
|
674
|
+
usePageConfig(page);
|
|
675
|
+
const { store } = useTwilight();
|
|
676
|
+
const { format } = useMoney();
|
|
677
|
+
const twig = componentsOrder ?? { items: [] };
|
|
678
|
+
const paymentExpired = order2.actions.payable && (order2.payment?.pending_payment_ends_at ?? 0) === 0;
|
|
679
|
+
const money = (amount, currency) => format(amount, { currency });
|
|
680
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
681
|
+
/* @__PURE__ */ jsx(TitleRow, { order: order2 }),
|
|
682
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "customer:orders.single.details.start" }),
|
|
683
|
+
/* @__PURE__ */ jsx(OrderHeader, { order: order2, links: twig.links, paymentExpired }),
|
|
684
|
+
twig.is_pickable && /* @__PURE__ */ jsx(SallaOrderBranch, { "data-testid": "store-order-branch", stackCards: true }),
|
|
685
|
+
/* @__PURE__ */ jsx(RefundMessage, { message: order2.refund_message }),
|
|
686
|
+
/* @__PURE__ */ jsx(RatingNotices, { twig }),
|
|
687
|
+
/* @__PURE__ */ jsxs("div", { className: "overflow-hidden space-y-5", children: [
|
|
688
|
+
/* @__PURE__ */ jsxs("div", { className: "shipping-orders", children: [
|
|
689
|
+
/* @__PURE__ */ jsx(ShippingHeader, { twig, order: order2 }),
|
|
690
|
+
order2.items.map((item, index) => /* @__PURE__ */ jsx(
|
|
691
|
+
OrderItemRow,
|
|
692
|
+
{
|
|
693
|
+
item,
|
|
694
|
+
twigItem: twig.items[index],
|
|
695
|
+
money,
|
|
696
|
+
currency: order2.currency
|
|
697
|
+
},
|
|
698
|
+
item.id
|
|
699
|
+
))
|
|
700
|
+
] }),
|
|
701
|
+
!!twig.options?.length && /* @__PURE__ */ jsx(OrderOptionsTable, { options: twig.options, money, currency: order2.currency })
|
|
702
|
+
] }),
|
|
703
|
+
componentsOrder && /* @__PURE__ */ jsx(
|
|
704
|
+
SallaOrderTotalsCard,
|
|
705
|
+
{
|
|
706
|
+
"data-testid": "store-order-totals",
|
|
707
|
+
order: JSON.stringify(componentsOrder)
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
/* @__PURE__ */ jsx(OrderActions, { order: order2, paymentExpired }),
|
|
711
|
+
/* @__PURE__ */ jsx(OrderRatings, { twig }),
|
|
712
|
+
/* @__PURE__ */ jsx(HookSlot, { name: "customer:orders.single.details.end" }),
|
|
713
|
+
(twig.can_rate || store?.settings?.rating?.allow_update) && /* @__PURE__ */ jsx(SallaRatingModal, { "data-testid": "store-order-rating-modal" })
|
|
714
|
+
] });
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export { OrderSinglePage };
|
|
718
|
+
//# sourceMappingURL=OrderSinglePage-WYNWGJ6N.js.map
|
|
719
|
+
//# sourceMappingURL=OrderSinglePage-WYNWGJ6N.js.map
|