@mercurjs/vendor 2.2.0-canary.9 → 2.2.0-rc.0
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/{[id]-T5ECVBPF.js → [id]-3LNKC5OJ.js} +38 -39
- package/dist/{[id]-A55T2ORL.js → [id]-4HO4S2PX.js} +481 -473
- package/dist/{[id]-FWCX5PTI.js → [id]-4LIIFGET.js} +13 -13
- package/dist/{[id]-GBT6VB4S.js → [id]-5EECCIRP.js} +148 -57
- package/dist/{[id]-YPCO3DJV.js → [id]-5P5LTATX.js} +2 -2
- package/dist/{[id]-J6BZG5PU.js → [id]-AQUUZFRX.js} +9 -9
- package/dist/{[id]-QOEO3JOV.js → [id]-CUBGVODE.js} +175 -85
- package/dist/{[id]-QQU5HVFU.js → [id]-DCGPICT3.js} +36 -37
- package/dist/{[id]-GC3ZYPK4.js → [id]-DT5YJVKG.js} +32 -33
- package/dist/{[id]-SHAJTJNZ.js → [id]-IEBZ6V3W.js} +46 -46
- package/dist/{[id]-ZCMSBEVM.js → [id]-N7JEZFXQ.js} +6 -6
- package/dist/[id]-U6FKX5UQ.js +975 -0
- package/dist/{[id]-BC7IKQTQ.js → [id]-XB45DY2D.js} +18 -18
- package/dist/[id]-XP5KEMNX.js +602 -0
- package/dist/{[location_id]-NUBXDDJC.js → [location_id]-I4HHUHWY.js} +14 -14
- package/dist/{[province_id]-6GUA4PV5.js → [province_id]-OYX4MOCF.js} +31 -32
- package/dist/{add-NTRYWOJF.js → add-3T4GBFMM.js} +59 -56
- package/dist/{add-RU3WL4YB.js → add-RPRJWCYU.js} +63 -30
- package/dist/{add-customer-groups-U5RZWW4B.js → add-customer-groups-FB5T6PQN.js} +43 -42
- package/dist/{add-products-Q4MMDQKT.js → add-products-F243SWGD.js} +38 -40
- package/dist/{add-promotions-KD2CWQPF.js → add-promotions-TJDK7HLW.js} +17 -17
- package/dist/{add-to-campaign-QKYQCSR2.js → add-to-campaign-Q6OAJMUJ.js} +6 -6
- package/dist/{address-77Y3AOQ3.js → address-XVBSNMFU.js} +24 -25
- package/dist/{adjust-inventory-AFJLWF5R.js → adjust-inventory-IZLRMQXV.js} +4 -4
- package/dist/allocate-items-Q3VALDYT.js +685 -0
- package/dist/{areas-XUC5V5UO.js → areas-IYGBRCRH.js} +13 -13
- package/dist/attributes-LGEM2JJW.js +353 -0
- package/dist/breadcrumb-BC6XN2SE.js +13 -0
- package/dist/{breadcrumb-THJ2HPRB.js → breadcrumb-BFNJWOJ4.js} +10 -9
- package/dist/{breadcrumb-FPWBT76A.js → breadcrumb-BXD3SRM7.js} +3 -3
- package/dist/{breadcrumb-PBR27GGX.js → breadcrumb-FEYGZFJU.js} +4 -4
- package/dist/{breadcrumb-KTARIL65.js → breadcrumb-H45Z2WNG.js} +3 -3
- package/dist/breadcrumb-ILEAQRW7.js +33 -0
- package/dist/breadcrumb-K4HBKZUE.js +28 -0
- package/dist/{breadcrumb-YBBYFQYG.js → breadcrumb-KZPOPXGG.js} +2 -2
- package/dist/{breadcrumb-F3BN5753.js → breadcrumb-L262VPBO.js} +2 -2
- package/dist/{breadcrumb-3Z7KZG62.js → breadcrumb-LEFHXFLT.js} +3 -3
- package/dist/{breadcrumb-D3UDTWGE.js → breadcrumb-MOA2DBOE.js} +2 -2
- package/dist/breadcrumb-NZYOCEEM.js +47 -0
- package/dist/breadcrumb-VY5DNTTJ.js +46 -0
- package/dist/{breadcrumb-UAUX7XCV.js → breadcrumb-WG6TIF4C.js} +2 -2
- package/dist/{breadcrumb-2XA2WOK7.js → breadcrumb-XEZCMI55.js} +2 -2
- package/dist/{breadcrumb-IK6XCQOQ.js → breadcrumb-XGXKCDYS.js} +4 -4
- package/dist/{breadcrumb-Y5UW3I4C.js → breadcrumb-YOY6Z36F.js} +2 -2
- package/dist/{campaigns-JAQTSA4Z.js → campaigns-DZKRNCA4.js} +7 -7
- package/dist/{categories-T4QJYX4R.js → categories-JZJA2IBQ.js} +11 -9
- package/dist/{chunk-3PMM6AMP.js → chunk-2KA4TGBQ.js} +2 -2
- package/dist/{chunk-X4GWB6AT.js → chunk-2NPD4S55.js} +4 -4
- package/dist/{chunk-M6GKMFTC.js → chunk-3ALBZK4M.js} +1 -1
- package/dist/{chunk-LKUW5SV4.js → chunk-3C2T27YW.js} +2 -2
- package/dist/{chunk-O7VOGTLX.js → chunk-3I6ZAMGN.js} +1 -1
- package/dist/{chunk-5QI3NDJG.js → chunk-3SH24DGG.js} +2 -2
- package/dist/{chunk-TF6V3TFG.js → chunk-3TST3EWQ.js} +2 -2
- package/dist/chunk-42R54Z2X.js +8 -0
- package/dist/{chunk-GAE6TKOR.js → chunk-4IRQSBA7.js} +5 -6
- package/dist/{chunk-LFX6WU4A.js → chunk-5ALC4Z2H.js} +0 -13
- package/dist/{chunk-VZUA5SRD.js → chunk-5BQO3YQP.js} +2 -2
- package/dist/{chunk-SPOHNK4X.js → chunk-5BYYDBLS.js} +7 -7
- package/dist/{chunk-4LVP635F.js → chunk-5FBQOAXU.js} +135 -126
- package/dist/{chunk-BXRNZS5K.js → chunk-5PAUN3PM.js} +3 -3
- package/dist/{chunk-E2HQPY32.js → chunk-5RMLLTR7.js} +5 -5
- package/dist/{chunk-3EF54XFY.js → chunk-634XVU3D.js} +1 -1
- package/dist/{chunk-Y2MQ5EMD.js → chunk-6FDPVW7Y.js} +12 -3
- package/dist/{chunk-6FUIK3PX.js → chunk-6Q3J6ZMM.js} +5 -5
- package/dist/{chunk-LARLBYU6.js → chunk-7BFQKYCJ.js} +2 -2
- package/dist/chunk-7EXKHL5L.js +30 -0
- package/dist/{chunk-M6N4ISXL.js → chunk-7MARNXFG.js} +1 -1
- package/dist/{chunk-TYESCFYW.js → chunk-AOLE7MBM.js} +1 -1
- package/dist/{chunk-TBYCZRZ7.js → chunk-BQHVM46E.js} +32 -55
- package/dist/{chunk-TW324MAT.js → chunk-CRYZK4NU.js} +2 -2
- package/dist/{chunk-463CNCJC.js → chunk-CUAGC54B.js} +33 -35
- package/dist/{chunk-KIFSQOM2.js → chunk-D76WZZSB.js} +5 -5
- package/dist/{chunk-QLBIBLOY.js → chunk-DQ7LZZJX.js} +5 -5
- package/dist/{chunk-UCYSCKZV.js → chunk-DSTHXHJ5.js} +2114 -1699
- package/dist/{chunk-UFFVRF4V.js → chunk-EAAZV3B7.js} +6 -11
- package/dist/chunk-EDV4MTTT.js +434 -0
- package/dist/chunk-EEBJYXWA.js +15 -0
- package/dist/{chunk-UORPTGV2.js → chunk-EPRYM3FA.js} +11 -15
- package/dist/{chunk-YQYRAD5C.js → chunk-FCZJAYMM.js} +1 -1
- package/dist/{chunk-BER45EYD.js → chunk-FDKFUIYV.js} +1 -1
- package/dist/{chunk-JAUZ73XE.js → chunk-G6YNCIVF.js} +21 -61
- package/dist/{chunk-PVZBDWLK.js → chunk-GRH7C3QN.js} +1 -1
- package/dist/chunk-GSH6ZGI6.js +353 -0
- package/dist/{chunk-IQWK723D.js → chunk-GZ4KTAWS.js} +1 -1
- package/dist/{chunk-MJCL3WID.js → chunk-H6LZ77GX.js} +1 -1
- package/dist/{chunk-2QTNCGKX.js → chunk-IEVN722X.js} +1 -1
- package/dist/{chunk-L4KBTV57.js → chunk-IMJ62GAP.js} +1 -3
- package/dist/{chunk-SGR4DMCW.js → chunk-INYLPVCG.js} +3 -3
- package/dist/{chunk-5T6UWTRU.js → chunk-IV57G2CB.js} +19 -11
- package/dist/{chunk-MZTDRBCR.js → chunk-JDNXS37G.js} +61 -62
- package/dist/{chunk-3B34B2M2.js → chunk-JJP6AKMV.js} +1 -1
- package/dist/{chunk-K6LOZ4S3.js → chunk-JK4M3ZKY.js} +5 -5
- package/dist/{chunk-VXMOPVRH.js → chunk-JR7AABT5.js} +2 -2
- package/dist/{chunk-DO4F5FIO.js → chunk-JTHDMXZV.js} +5 -5
- package/dist/{chunk-6K6EQOJF.js → chunk-JY2XON7H.js} +2 -2
- package/dist/{chunk-6OUPJNYO.js → chunk-KCHYLLVG.js} +2 -2
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-VCOQ7WQ2.js → chunk-KG2NUK4J.js} +6 -6
- package/dist/{chunk-VXWN37PT.js → chunk-KIURBTC4.js} +1 -1
- package/dist/{chunk-BENED3NB.js → chunk-KTJLJTFO.js} +545 -891
- package/dist/{chunk-PZEPOPMV.js → chunk-KZQFIPY2.js} +178 -81
- package/dist/{chunk-DQKK43PR.js → chunk-LWFBBTJ3.js} +5 -5
- package/dist/{chunk-RIN4CBRB.js → chunk-LXZXXOJ3.js} +1 -17
- package/dist/chunk-LYYM7H7H.js +59 -0
- package/dist/{chunk-MWQQVKRU.js → chunk-MAVQ636Y.js} +1 -1
- package/dist/{chunk-VDHW6H5F.js → chunk-MAW6ZT3D.js} +4 -4
- package/dist/{chunk-7CMRFP5Q.js → chunk-MJP5V3JN.js} +3 -3
- package/dist/{chunk-S7EKBD2C.js → chunk-MNHP6YRC.js} +3 -3
- package/dist/{chunk-7IPCLQ5V.js → chunk-MT6WOKIW.js} +4 -4
- package/dist/chunk-MUGQQY6P.js +315 -0
- package/dist/{chunk-S23FD6FA.js → chunk-MVEHWM7K.js} +1 -1
- package/dist/{chunk-VV6IKGCN.js → chunk-NTJ3BMOE.js} +1 -1
- package/dist/{chunk-DDJQRV6E.js → chunk-O7BGGWW6.js} +2 -2
- package/dist/{chunk-LWJF63JW.js → chunk-OYUJYPDF.js} +90 -15
- package/dist/{chunk-4S6XGIC6.js → chunk-PUAWN7SS.js} +1 -1
- package/dist/{chunk-U6PBLMXD.js → chunk-Q6SPIHFR.js} +8 -3
- package/dist/{chunk-F4OJN2F2.js → chunk-QIF4QE7T.js} +1 -1
- package/dist/{chunk-X22KTLZ7.js → chunk-QWJTJSIT.js} +1 -1
- package/dist/{chunk-2USXZSTK.js → chunk-QWW6RHZC.js} +5 -5
- package/dist/{chunk-NBKWY6XN.js → chunk-RILHLBKW.js} +3 -3
- package/dist/{chunk-EIZP3XL5.js → chunk-RPU4UOQK.js} +1 -1
- package/dist/{chunk-53SII3U2.js → chunk-RTMMO6IU.js} +6 -6
- package/dist/{chunk-IBEUR3J7.js → chunk-S7NGDLZ3.js} +3 -3
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/chunk-SPFLYPY6.js +6 -0
- package/dist/{chunk-SZBERGA4.js → chunk-TJKZ5QCJ.js} +4 -4
- package/dist/{chunk-YUKD5RCX.js → chunk-TPGIMZLI.js} +1 -1
- package/dist/{chunk-YHIJCI4U.js → chunk-UNE4VD5U.js} +3 -3
- package/dist/chunk-UX5UYDCY.js +33 -0
- package/dist/{chunk-6UZERVBI.js → chunk-V5K6HISS.js} +2 -2
- package/dist/{chunk-T5MJWWDX.js → chunk-VD27SL7H.js} +5 -5
- package/dist/{chunk-LRARA622.js → chunk-VE6GRIIN.js} +2 -2
- package/dist/{chunk-SSUUT5LK.js → chunk-W3UHAQCV.js} +5 -4
- package/dist/{chunk-U5G3AVED.js → chunk-WBCWER26.js} +1 -1
- package/dist/{chunk-OZ44ATGE.js → chunk-WCXFUBEF.js} +15 -15
- package/dist/{chunk-YQZBAP3S.js → chunk-WFE6CT6M.js} +76 -22
- package/dist/{chunk-PAVZ6FPK.js → chunk-WFHGJGCW.js} +5 -4
- package/dist/{chunk-LQD232FW.js → chunk-WJ5EU3KW.js} +1 -1
- package/dist/{chunk-XCIMOIX6.js → chunk-XBKWFLJG.js} +1 -1
- package/dist/chunk-XQUF3WIS.js +159 -0
- package/dist/{chunk-6SJTAE66.js → chunk-Y4PM3IDZ.js} +1 -1
- package/dist/{chunk-JQV7CXEC.js → chunk-YNGA3GRX.js} +17 -2
- package/dist/{chunk-BOZJOOGW.js → chunk-ZLHCZ5F2.js} +1 -1
- package/dist/{chunk-LHKHQAAY.js → chunk-ZLYGEART.js} +1 -1
- package/dist/{chunk-NBPMNUKZ.js → chunk-ZQCCVCHB.js} +1 -1
- package/dist/{chunk-ADGVQVHP.js → chunk-ZTOYVPGA.js} +3 -3
- package/dist/collections-XIHCTMSJ.js +70 -0
- package/dist/{configuration-C4IGBNXH.js → configuration-3GCBMM27.js} +3 -3
- package/dist/{configuration-7IYZ6GNP.js → configuration-FWZTMYXY.js} +5 -5
- package/dist/{create-MS6KKFSV.js → create-2RGNAVVY.js} +31 -32
- package/dist/{create-JF2OUZQA.js → create-32MXB6FD.js} +24 -25
- package/dist/create-3AMFYYI6.js +245 -0
- package/dist/create-AMNH3WXL.js +75 -0
- package/dist/{create-UPYB65PD.js → create-BV3QDTK2.js} +4 -4
- package/dist/{create-A7B3MLJX.js → create-FHIFVCSG.js} +47 -47
- package/dist/{create-ODOFJF5N.js → create-GO7APBBU.js} +30 -31
- package/dist/{create-F5R76QML.js → create-HEZYB7RF.js} +24 -23
- package/dist/{create-R7K3ECN6.js → create-K26SM34L.js} +3 -3
- package/dist/{create-MZYXMGKP.js → create-N534JQPH.js} +13 -13
- package/dist/{create-FKRYB7ZS.js → create-NEK6JCKR.js} +65 -51
- package/dist/{create-YBF4YGWG.js → create-NF2LPVXA.js} +3 -3
- package/dist/{create-JGYG5SBM.js → create-PJVLJ7T6.js} +47 -44
- package/dist/{create-O35JRZEF.js → create-RPBHXU32.js} +28 -29
- package/dist/{create-SFU3W3ZH.js → create-U64NEOEL.js} +3 -3
- package/dist/{create-GGACODDN.js → create-VL7LDTVE.js} +53 -36
- package/dist/{create-XVHOCZHJ.js → create-X5SOAPD3.js} +3 -3
- package/dist/{create-TKXH5KQY.js → create-XLYGW5PN.js} +61 -37
- package/dist/{create-5PSOIHIT.js → create-YKYLCEAK.js} +6 -6
- package/dist/customer-group-add-customers-2C53NFBJ.js +251 -0
- package/dist/customer-group-create-75QQEQZF.js +147 -0
- package/dist/customer-group-detail-AOQYYAOG.js +58 -0
- package/dist/customer-group-edit-N77RCW6I.js +138 -0
- package/dist/customer-groups-GNFV7VMT.js +284 -0
- package/dist/{customers-SOLJ2KQQ.js → customers-HNINO6YL.js} +9 -9
- package/dist/{edit-Y2U3KAVB.js → edit-3DUCWSLA.js} +34 -30
- package/dist/{edit-ORXS3A2Y.js → edit-3V34KJS2.js} +3 -3
- package/dist/{edit-2R5QCPTB.js → edit-4PWAJ7A3.js} +25 -26
- package/dist/{edit-5CROKEJE.js → edit-7CLOJ3UZ.js} +48 -48
- package/dist/{edit-ZAHCMF5U.js → edit-7SBPHN6P.js} +3 -3
- package/dist/edit-BSD6667Q.js +367 -0
- package/dist/{edit-Q3UQIOLS.js → edit-I2RJUPWV.js} +4 -4
- package/dist/{edit-FXNXTVIW.js → edit-IJ6DCBUU.js} +5 -5
- package/dist/{edit-ZMERG3L7.js → edit-JB7KVBOL.js} +5 -5
- package/dist/{edit-O4JLGKQR.js → edit-NHQJLCAK.js} +4 -4
- package/dist/edit-O65JD54W.js +103 -0
- package/dist/{edit-G2E5SNGU.js → edit-SIKOSSHF.js} +24 -25
- package/dist/{edit-VVLITC2E.js → edit-TD7QFM4Z.js} +36 -75
- package/dist/{edit-C4OCKQVU.js → edit-UNN3QTEJ.js} +3 -3
- package/dist/{edit-HTLLYECP.js → edit-WEUFBORT.js} +33 -35
- package/dist/{edit-KAKVPHZZ.js → edit-WN2Q3TOX.js} +4 -4
- package/dist/{edit-3E4ZO7HT.js → edit-ZGAOUZYP.js} +33 -35
- package/dist/{edit-522DG3BY.js → edit-ZOLSAIKF.js} +3 -3
- package/dist/{edit-OKU6FMHJ.js → edit-ZORE6RUD.js} +25 -26
- package/dist/{edit-budget-L3CCEWNF.js → edit-budget-D22WMVYR.js} +3 -3
- package/dist/{edit-inventory-item-ZKXXL3QK.js → edit-inventory-item-QMYWEBZ3.js} +3 -3
- package/dist/{edit-inventory-item-attributes-GSKUMORD.js → edit-inventory-item-attributes-HLG6JR6S.js} +3 -3
- package/dist/edit-price-F7ZWM3FN.js +197 -0
- package/dist/edit-stock-ITAZNHPU.js +230 -0
- package/dist/fulfillment-U2GRQ6DD.js +641 -0
- package/dist/{fulfillment-providers-G2L6LEVO.js → fulfillment-providers-CMU2JB5X.js} +39 -40
- package/dist/index.css +64 -33
- package/dist/index.js +334 -243
- package/dist/{offer-inventory-batch-page-BD6PMDLW.js → inventory-4JKLAZ2Q.js} +18 -18
- package/dist/{inventory-WSFLTA6Z.js → inventory-FKEXULLT.js} +8 -8
- package/dist/{invite-2673PU4I.js → invite-3R2CEWLN.js} +23 -24
- package/dist/{invite-HRXZ5YBP.js → invite-MNAX6EUC.js} +38 -39
- package/dist/loader-HTPUNIOS.js +34 -0
- package/dist/loader-MAAMUP2Z.js +33 -0
- package/dist/{locations-INS6FTMJ.js → locations-2VWSMWHL.js} +3 -3
- package/dist/login-YUWOWICV.js +39 -0
- package/dist/{manage-locations-XHH5DVIR.js → manage-locations-RWGDXXJQ.js} +3 -3
- package/dist/{media-J22P2DK4.js → media-P6WSFHY4.js} +31 -31
- package/dist/media-YB4G5CMV.js +316 -0
- package/dist/{metadata-Q74OJWUD.js → metadata-5Q6FLVX4.js} +27 -28
- package/dist/{metadata-D6M66NQK.js → metadata-6OYHLPLA.js} +25 -26
- package/dist/{metadata-YVHJPDLD.js → metadata-ADXGD4Y6.js} +25 -26
- package/dist/{metadata-REQIFWWH.js → metadata-J447GEBP.js} +27 -28
- package/dist/{metadata-NIDIBXJT.js → metadata-VTQ2CGZX.js} +27 -28
- package/dist/{offer-create-page-E4FLSDJQ.js → offer-create-page-ACPKTNHA.js} +244 -265
- package/dist/offer-detail-page-S4R4N5GL.js +584 -0
- package/dist/offer-variant-detail-page-XUMDXZUD.js +402 -0
- package/dist/offers-OTZJBW43.js +54 -0
- package/dist/{onboarding-MK2RIFD4.js → onboarding-TUGXFOA6.js} +23 -24
- package/dist/orders-PJSJNGZS.js +63 -0
- package/dist/{organization-XO3T2K2X.js → organization-YIOAVFHN.js} +26 -27
- package/dist/{organize-Z7JTTDH4.js → organize-BTA7NJD2.js} +4 -4
- package/dist/{organize-5XRZWD5C.js → organize-OWT5QSJR.js} +4 -4
- package/dist/pages/index.d.ts +232 -232
- package/dist/pages/index.js +81 -82
- package/dist/{payment-details-CFTX3QDL.js → payment-details-K2XFATEL.js} +24 -25
- package/dist/{payouts-7Q7D4FET.js → payouts-K5IDTJV3.js} +8 -8
- package/dist/{price-lists-6TFLA53G.js → price-lists-DNPIPDAW.js} +11 -11
- package/dist/{offer-pricing-edit-page-4TINK42V.js → pricing-5VUPPNKS.js} +21 -19
- package/dist/{pricing-ECXV6K7G.js → pricing-J5FIDZIY.js} +28 -29
- package/dist/{product-tags-5O7ZG6SA.js → product-tags-SJYIGXEV.js} +42 -42
- package/dist/{product-types-PKUEL7X5.js → product-types-4PTJW5DE.js} +8 -8
- package/dist/product-variant-detail-FO6J3RFA.js +371 -0
- package/dist/{product-variant-edit-WZNO4CQX.js → product-variant-edit-55TAIBZO.js} +45 -27
- package/dist/{products-BM3IIH5P.js → products-EQMANSO6.js} +39 -40
- package/dist/products-XM57LXJK.js +92 -0
- package/dist/{professional-details-ED4HNYXY.js → professional-details-WWZPTXSX.js} +24 -25
- package/dist/{profile-6TGCNNUU.js → profile-5IADQ727.js} +27 -28
- package/dist/{promotions-AZM7JQAJ.js → promotions-BYW6TZ5B.js} +10 -10
- package/dist/{receive-2GFZTVNC.js → receive-MTXKKPKZ.js} +62 -20
- package/dist/{refund-IGMSXQNX.js → refund-3IXGYA7W.js} +8 -8
- package/dist/{register-ADZCPWEV.js → register-U5PQZATC.js} +25 -26
- package/dist/{reset-password-RGWK33Q7.js → reset-password-SKUJJLSV.js} +3 -3
- package/dist/{return-reasons-QJRA2ZX6.js → return-reasons-QDPSIJG3.js} +16 -15
- package/dist/{sales-channels-U55MUDQP.js → sales-channels-GBSTCWVP.js} +10 -11
- package/dist/{sales-channels-CZDU7VTE.js → sales-channels-N4NE3FXP.js} +14 -15
- package/dist/{settings-2GCQQTO6.js → settings-ZUBBFS67.js} +49 -49
- package/dist/{shipment-HWQHMX2L.js → shipment-TKSCPC3M.js} +24 -25
- package/dist/shipping-DODEUYOQ.js +125 -0
- package/dist/{shipping-profile-ZP7M6VSS.js → shipping-profile-O4JMJLN7.js} +5 -9
- package/dist/shipping-profiles-4TJ4IH6U.js +46 -0
- package/dist/{stock-MQA7PRO6.js → stock-GYK2GHJN.js} +27 -28
- package/dist/{store-5ZHZR4JI.js → store-XWOALZ5Q.js} +34 -35
- package/dist/{store-closure-H5WHV3LA.js → store-closure-46B3XZ2I.js} +24 -25
- package/dist/{store-select-PZS556FB.js → store-select-E77E3ZY7.js} +24 -25
- package/dist/{tax-regions-HDLBFZVG.js → tax-regions-S2LFRTMP.js} +9 -9
- package/dist/{team-CLKJCZNH.js → team-N2C5JPSU.js} +35 -36
- package/package.json +12 -12
- package/dist/[id]-B4YZTANM.js +0 -1571
- package/dist/[id]-FE5GYYVZ.js +0 -481
- package/dist/allocate-items-TCM5A55Y.js +0 -548
- package/dist/attributes-SZP2MM5L.js +0 -278
- package/dist/breadcrumb-5NP23D6X.js +0 -34
- package/dist/breadcrumb-EVZIOB2G.js +0 -47
- package/dist/breadcrumb-TNJSGX4T.js +0 -48
- package/dist/chunk-27KRIXMQ.js +0 -71
- package/dist/chunk-BDZOSMAX.js +0 -23
- package/dist/chunk-CFRWIQIZ.js +0 -43
- package/dist/chunk-FP6U6BPH.js +0 -61
- package/dist/chunk-RXV7INUV.js +0 -426
- package/dist/chunk-T6LHVNWO.js +0 -27
- package/dist/collections-URH2TCWJ.js +0 -69
- package/dist/create-7R6CZU53.js +0 -215
- package/dist/create-Z5VPBELS.js +0 -76
- package/dist/edit-GQNIINRR.js +0 -192
- package/dist/edit-XSICGAVO.js +0 -176
- package/dist/fulfillment-76IVZ266.js +0 -567
- package/dist/loader-VDYPD3RI.js +0 -31
- package/dist/login-TWUBU6I6.js +0 -40
- package/dist/metadata-5BPOBBU2.js +0 -45
- package/dist/offer-detail-page-6SIBQTLP.js +0 -492
- package/dist/offer-edit-page-3MO566RP.js +0 -151
- package/dist/offers-GVN5LCK6.js +0 -32
- package/dist/orders-TVQDR4OJ.js +0 -64
- package/dist/product-variant-detail-PUWOMVHQ.js +0 -210
- package/dist/products-XE5YPQ66.js +0 -93
- package/dist/shipping-profiles-C5WBXWZ2.js +0 -47
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useCancelOrderEdit,
|
|
3
|
-
useConfirmOrderEdit
|
|
4
|
-
} from "./chunk-LARLBYU6.js";
|
|
5
1
|
import {
|
|
6
2
|
useCancelExchangeBegin,
|
|
7
3
|
useExchanges
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CRYZK4NU.js";
|
|
5
|
+
import {
|
|
6
|
+
useCancelClaimBegin,
|
|
7
|
+
useClaims
|
|
8
|
+
} from "./chunk-S7NGDLZ3.js";
|
|
9
|
+
import {
|
|
10
|
+
getReturnableQuantity
|
|
11
|
+
} from "./chunk-UM7ZR3VU.js";
|
|
12
|
+
import {
|
|
13
|
+
DEFAULT_FIELDS
|
|
14
|
+
} from "./chunk-IMJ62GAP.js";
|
|
15
|
+
import {
|
|
16
|
+
getReservationsLimitCount
|
|
17
|
+
} from "./chunk-EEBJYXWA.js";
|
|
9
18
|
import {
|
|
10
19
|
CLAIM_POLICY_DAYS,
|
|
11
20
|
EXCHANGE_POLICY_DAYS,
|
|
12
21
|
RETURN_POLICY_DAYS,
|
|
13
22
|
isOutsidePolicyWindow
|
|
14
23
|
} from "./chunk-VCUUITW6.js";
|
|
15
|
-
import {
|
|
16
|
-
useCancelClaimBegin,
|
|
17
|
-
useClaims
|
|
18
|
-
} from "./chunk-IBEUR3J7.js";
|
|
19
24
|
import {
|
|
20
25
|
useCancelReturn,
|
|
21
26
|
useCancelReturnRequest,
|
|
22
27
|
useReturns
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
getReturnableQuantity
|
|
26
|
-
} from "./chunk-UM7ZR3VU.js";
|
|
28
|
+
} from "./chunk-3TST3EWQ.js";
|
|
27
29
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
useCancelOrderEdit,
|
|
31
|
+
useConfirmOrderEdit
|
|
32
|
+
} from "./chunk-7BFQKYCJ.js";
|
|
31
33
|
import {
|
|
32
34
|
formatProvider
|
|
33
35
|
} from "./chunk-VW56KWO2.js";
|
|
36
|
+
import "./chunk-BCU3FKP2.js";
|
|
34
37
|
import {
|
|
35
38
|
getFormattedAddress,
|
|
36
39
|
isSameAddress
|
|
@@ -61,33 +64,36 @@ import {
|
|
|
61
64
|
TwoColumnPageSkeleton
|
|
62
65
|
} from "./chunk-INNFZYX2.js";
|
|
63
66
|
import {
|
|
64
|
-
|
|
65
|
-
} from "./chunk-
|
|
66
|
-
import "./chunk-
|
|
67
|
-
import "./chunk-
|
|
68
|
-
import "./chunk-
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import "./chunk-
|
|
71
|
-
import "./chunk-
|
|
72
|
-
import "./chunk-
|
|
73
|
-
import "./chunk-
|
|
74
|
-
import "./chunk-
|
|
67
|
+
ActionMenu
|
|
68
|
+
} from "./chunk-BDGZ4EQO.js";
|
|
69
|
+
import "./chunk-LAVHRER2.js";
|
|
70
|
+
import "./chunk-QHQWEERJ.js";
|
|
71
|
+
import "./chunk-Y7QKP6QU.js";
|
|
72
|
+
import "./chunk-BQHVM46E.js";
|
|
73
|
+
import "./chunk-QIF4QE7T.js";
|
|
74
|
+
import "./chunk-VE6GRIIN.js";
|
|
75
|
+
import "./chunk-7MARNXFG.js";
|
|
76
|
+
import "./chunk-MNHP6YRC.js";
|
|
77
|
+
import "./chunk-NTJ3BMOE.js";
|
|
78
|
+
import "./chunk-5PAUN3PM.js";
|
|
79
|
+
import "./chunk-ZLHCZ5F2.js";
|
|
80
|
+
import "./chunk-GZ4KTAWS.js";
|
|
81
|
+
import "./chunk-PUAWN7SS.js";
|
|
75
82
|
import {
|
|
76
83
|
useMember
|
|
77
|
-
} from "./chunk-
|
|
78
|
-
import "./chunk-IQWK723D.js";
|
|
79
|
-
import "./chunk-DDJQRV6E.js";
|
|
84
|
+
} from "./chunk-MVEHWM7K.js";
|
|
80
85
|
import {
|
|
81
86
|
useCustomer
|
|
82
|
-
} from "./chunk-
|
|
83
|
-
import "./chunk-
|
|
84
|
-
import "./chunk-
|
|
85
|
-
import "./chunk-
|
|
86
|
-
import "./chunk-
|
|
87
|
+
} from "./chunk-OYUJYPDF.js";
|
|
88
|
+
import "./chunk-O7BGGWW6.js";
|
|
89
|
+
import "./chunk-KIURBTC4.js";
|
|
90
|
+
import "./chunk-3SH24DGG.js";
|
|
91
|
+
import "./chunk-JR7AABT5.js";
|
|
87
92
|
import {
|
|
88
93
|
useStockLocation
|
|
89
|
-
} from "./chunk-
|
|
90
|
-
import "./chunk-
|
|
94
|
+
} from "./chunk-ZQCCVCHB.js";
|
|
95
|
+
import "./chunk-5BQO3YQP.js";
|
|
96
|
+
import "./chunk-EPRYM3FA.js";
|
|
91
97
|
import {
|
|
92
98
|
ordersQueryKeys,
|
|
93
99
|
useCancelOrder,
|
|
@@ -95,17 +101,12 @@ import {
|
|
|
95
101
|
useMarkOrderFulfillmentAsDelivered,
|
|
96
102
|
useOrder,
|
|
97
103
|
useOrderChanges,
|
|
104
|
+
useOrderCommissionLines,
|
|
98
105
|
useOrderPreview,
|
|
99
106
|
useReservationItems
|
|
100
|
-
} from "./chunk-
|
|
101
|
-
import "./chunk-
|
|
102
|
-
import
|
|
103
|
-
ActionMenu
|
|
104
|
-
} from "./chunk-BDGZ4EQO.js";
|
|
105
|
-
import "./chunk-LAVHRER2.js";
|
|
106
|
-
import "./chunk-QHQWEERJ.js";
|
|
107
|
-
import "./chunk-Y7QKP6QU.js";
|
|
108
|
-
import "./chunk-JAUZ73XE.js";
|
|
107
|
+
} from "./chunk-6FDPVW7Y.js";
|
|
108
|
+
import "./chunk-JJP6AKMV.js";
|
|
109
|
+
import "./chunk-G6YNCIVF.js";
|
|
109
110
|
import "./chunk-A5DJIOHN.js";
|
|
110
111
|
import {
|
|
111
112
|
queryClient
|
|
@@ -113,7 +114,7 @@ import {
|
|
|
113
114
|
import "./chunk-ZA2KFUFR.js";
|
|
114
115
|
import {
|
|
115
116
|
fetchQuery
|
|
116
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-LXZXXOJ3.js";
|
|
117
118
|
import "./chunk-NBMM2TZK.js";
|
|
118
119
|
|
|
119
120
|
// src/pages/orders/[id]/loader.tsx
|
|
@@ -1373,32 +1374,79 @@ var OrderActivitySection = ({ order }) => {
|
|
|
1373
1374
|
] });
|
|
1374
1375
|
};
|
|
1375
1376
|
|
|
1377
|
+
// src/pages/orders/[id]/_components/order-commission-section/order-commission-section.tsx
|
|
1378
|
+
import { Container as Container6, Heading as Heading6, Text as Text16 } from "@medusajs/ui";
|
|
1379
|
+
import { useMemo as useMemo4 } from "react";
|
|
1380
|
+
import { useTranslation as useTranslation16 } from "react-i18next";
|
|
1381
|
+
import { jsx as jsx17, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1382
|
+
var OrderCommissionSection = ({
|
|
1383
|
+
order
|
|
1384
|
+
}) => {
|
|
1385
|
+
const { t } = useTranslation16();
|
|
1386
|
+
const { commission_lines, isLoading } = useOrderCommissionLines(order.id);
|
|
1387
|
+
const itemTitleById = useMemo4(() => {
|
|
1388
|
+
const map = /* @__PURE__ */ new Map();
|
|
1389
|
+
order.items?.forEach((item) => {
|
|
1390
|
+
map.set(item.id, item.product_title ?? item.title);
|
|
1391
|
+
});
|
|
1392
|
+
return map;
|
|
1393
|
+
}, [order.items]);
|
|
1394
|
+
if (isLoading || !commission_lines.length) {
|
|
1395
|
+
return null;
|
|
1396
|
+
}
|
|
1397
|
+
const total = commission_lines.reduce(
|
|
1398
|
+
(acc, line) => acc + (line.amount ?? 0),
|
|
1399
|
+
0
|
|
1400
|
+
);
|
|
1401
|
+
return /* @__PURE__ */ jsxs18(Container6, { className: "divide-y p-0", "data-testid": "order-commission-section", children: [
|
|
1402
|
+
/* @__PURE__ */ jsx17("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx17(Heading6, { level: "h2", children: t("fields.commission", "Commission") }) }),
|
|
1403
|
+
/* @__PURE__ */ jsx17("div", { className: "divide-y", children: commission_lines.map((line) => {
|
|
1404
|
+
const label = line.shipping_method_id ? t("fields.shipping") : itemTitleById.get(line.item_id ?? "") ?? line.code;
|
|
1405
|
+
return /* @__PURE__ */ jsxs18(
|
|
1406
|
+
"div",
|
|
1407
|
+
{
|
|
1408
|
+
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-4 px-6 py-4",
|
|
1409
|
+
children: [
|
|
1410
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", children: label }),
|
|
1411
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", className: "text-right", children: getLocaleAmount(line.amount, order.currency_code) })
|
|
1412
|
+
]
|
|
1413
|
+
},
|
|
1414
|
+
line.id
|
|
1415
|
+
);
|
|
1416
|
+
}) }),
|
|
1417
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1418
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", weight: "plus", leading: "compact", children: t("orders.commission.total", "Total") }),
|
|
1419
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", weight: "plus", leading: "compact", children: getLocaleAmount(total, order.currency_code) })
|
|
1420
|
+
] })
|
|
1421
|
+
] });
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1376
1424
|
// src/pages/orders/[id]/_components/order-customer-section/order-customer-section.tsx
|
|
1377
|
-
import { Container as
|
|
1378
|
-
import { useTranslation as
|
|
1425
|
+
import { Container as Container7, Heading as Heading7 } from "@medusajs/ui";
|
|
1426
|
+
import { useTranslation as useTranslation18 } from "react-i18next";
|
|
1379
1427
|
|
|
1380
1428
|
// src/components/common/customer-info/customer-info.tsx
|
|
1381
|
-
import { Avatar as Avatar2, Copy as Copy2, Text as
|
|
1382
|
-
import { useTranslation as
|
|
1429
|
+
import { Avatar as Avatar2, Copy as Copy2, Text as Text17 } from "@medusajs/ui";
|
|
1430
|
+
import { useTranslation as useTranslation17 } from "react-i18next";
|
|
1383
1431
|
import { Link as Link2 } from "react-router-dom";
|
|
1384
|
-
import { jsx as
|
|
1432
|
+
import { jsx as jsx18, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1385
1433
|
var ID = ({ data }) => {
|
|
1386
|
-
const { t } =
|
|
1434
|
+
const { t } = useTranslation17();
|
|
1387
1435
|
const id = data.customer_id;
|
|
1388
1436
|
const name = getOrderCustomer(data);
|
|
1389
1437
|
const email = data.email;
|
|
1390
1438
|
const fallback = (name || email || "").charAt(0).toUpperCase();
|
|
1391
|
-
return /* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1440
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", weight: "plus", children: t("fields.id") }),
|
|
1441
|
+
/* @__PURE__ */ jsx18(
|
|
1394
1442
|
Link2,
|
|
1395
1443
|
{
|
|
1396
1444
|
to: `/customers/${id}`,
|
|
1397
1445
|
className: "focus:shadow-borders-focus rounded-[4px] outline-none transition-shadow",
|
|
1398
|
-
children: /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
|
|
1446
|
+
children: /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-x-2 overflow-hidden", children: [
|
|
1447
|
+
/* @__PURE__ */ jsx18(Avatar2, { size: "2xsmall", fallback }),
|
|
1448
|
+
/* @__PURE__ */ jsx18(
|
|
1449
|
+
Text17,
|
|
1402
1450
|
{
|
|
1403
1451
|
size: "small",
|
|
1404
1452
|
leading: "compact",
|
|
@@ -1412,26 +1460,26 @@ var ID = ({ data }) => {
|
|
|
1412
1460
|
] });
|
|
1413
1461
|
};
|
|
1414
1462
|
var Company = ({ data }) => {
|
|
1415
|
-
const { t } =
|
|
1463
|
+
const { t } = useTranslation17();
|
|
1416
1464
|
const company = data.shipping_address?.company || data.billing_address?.company;
|
|
1417
1465
|
if (!company) {
|
|
1418
1466
|
return null;
|
|
1419
1467
|
}
|
|
1420
|
-
return /* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1468
|
+
return /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1469
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", weight: "plus", children: t("fields.company") }),
|
|
1470
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", className: "truncate", children: company })
|
|
1423
1471
|
] });
|
|
1424
1472
|
};
|
|
1425
1473
|
var Contact = ({ data }) => {
|
|
1426
|
-
const { t } =
|
|
1474
|
+
const { t } = useTranslation17();
|
|
1427
1475
|
const phone = data.shipping_address?.phone || data.billing_address?.phone;
|
|
1428
1476
|
const email = data.email || "";
|
|
1429
|
-
return /* @__PURE__ */
|
|
1430
|
-
/* @__PURE__ */
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
/* @__PURE__ */
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
|
|
1477
|
+
return /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1478
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", weight: "plus", children: t("orders.customer.contactLabel") }),
|
|
1479
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-y-2", children: [
|
|
1480
|
+
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1481
|
+
/* @__PURE__ */ jsx18(
|
|
1482
|
+
Text17,
|
|
1435
1483
|
{
|
|
1436
1484
|
size: "small",
|
|
1437
1485
|
leading: "compact",
|
|
@@ -1439,11 +1487,11 @@ var Contact = ({ data }) => {
|
|
|
1439
1487
|
children: email
|
|
1440
1488
|
}
|
|
1441
1489
|
),
|
|
1442
|
-
/* @__PURE__ */
|
|
1490
|
+
/* @__PURE__ */ jsx18("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx18(Copy2, { content: email, className: "text-ui-fg-muted" }) })
|
|
1443
1491
|
] }),
|
|
1444
|
-
phone && /* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
|
|
1492
|
+
phone && /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1493
|
+
/* @__PURE__ */ jsx18(
|
|
1494
|
+
Text17,
|
|
1447
1495
|
{
|
|
1448
1496
|
size: "small",
|
|
1449
1497
|
leading: "compact",
|
|
@@ -1451,7 +1499,7 @@ var Contact = ({ data }) => {
|
|
|
1451
1499
|
children: phone
|
|
1452
1500
|
}
|
|
1453
1501
|
),
|
|
1454
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ jsx18("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx18(Copy2, { content: phone, className: "text-ui-fg-muted" }) })
|
|
1455
1503
|
] })
|
|
1456
1504
|
] })
|
|
1457
1505
|
] });
|
|
@@ -1460,33 +1508,33 @@ var AddressPrint = ({
|
|
|
1460
1508
|
address,
|
|
1461
1509
|
type
|
|
1462
1510
|
}) => {
|
|
1463
|
-
const { t } =
|
|
1464
|
-
return /* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
address ? /* @__PURE__ */
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
return /* @__PURE__ */
|
|
1511
|
+
const { t } = useTranslation17();
|
|
1512
|
+
return /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1513
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", weight: "plus", children: type === "shipping" ? t("addresses.shippingAddress.label") : t("addresses.billingAddress.label") }),
|
|
1514
|
+
address ? /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1515
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", children: getFormattedAddress({ address }).map((line, i) => {
|
|
1516
|
+
return /* @__PURE__ */ jsxs19("span", { className: "break-words", children: [
|
|
1469
1517
|
line,
|
|
1470
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ jsx18("br", {})
|
|
1471
1519
|
] }, i);
|
|
1472
1520
|
}) }),
|
|
1473
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx18("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx18(
|
|
1474
1522
|
Copy2,
|
|
1475
1523
|
{
|
|
1476
1524
|
content: getFormattedAddress({ address }).join("\n"),
|
|
1477
1525
|
className: "text-ui-fg-muted"
|
|
1478
1526
|
}
|
|
1479
1527
|
) })
|
|
1480
|
-
] }) : /* @__PURE__ */
|
|
1528
|
+
] }) : /* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", children: "-" })
|
|
1481
1529
|
] });
|
|
1482
1530
|
};
|
|
1483
1531
|
var Addresses = ({ data }) => {
|
|
1484
|
-
const { t } =
|
|
1485
|
-
return /* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
|
|
1532
|
+
const { t } = useTranslation17();
|
|
1533
|
+
return /* @__PURE__ */ jsxs19("div", { className: "divide-y", children: [
|
|
1534
|
+
/* @__PURE__ */ jsx18(AddressPrint, { address: data.shipping_address, type: "shipping" }),
|
|
1535
|
+
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */ jsx18(AddressPrint, { address: data.billing_address, type: "billing" }) : /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1536
|
+
/* @__PURE__ */ jsx18(
|
|
1537
|
+
Text17,
|
|
1490
1538
|
{
|
|
1491
1539
|
size: "small",
|
|
1492
1540
|
leading: "compact",
|
|
@@ -1495,7 +1543,7 @@ var Addresses = ({ data }) => {
|
|
|
1495
1543
|
children: t("addresses.billingAddress.label")
|
|
1496
1544
|
}
|
|
1497
1545
|
),
|
|
1498
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ jsx18(Text17, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: t("addresses.billingAddress.sameAsShipping") })
|
|
1499
1547
|
] })
|
|
1500
1548
|
] });
|
|
1501
1549
|
};
|
|
@@ -1520,61 +1568,61 @@ var getOrderCustomer = (obj) => {
|
|
|
1520
1568
|
};
|
|
1521
1569
|
|
|
1522
1570
|
// src/pages/orders/[id]/_components/order-customer-section/order-customer-section.tsx
|
|
1523
|
-
import { jsx as
|
|
1571
|
+
import { jsx as jsx19, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1524
1572
|
var OrderCustomerSection = ({ order }) => {
|
|
1525
|
-
return /* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
1573
|
+
return /* @__PURE__ */ jsxs20(Container7, { className: "divide-y p-0", children: [
|
|
1574
|
+
/* @__PURE__ */ jsx19(Header, {}),
|
|
1575
|
+
/* @__PURE__ */ jsx19(CustomerInfo.ID, { data: order }),
|
|
1576
|
+
/* @__PURE__ */ jsx19(CustomerInfo.Contact, { data: order }),
|
|
1577
|
+
/* @__PURE__ */ jsx19(CustomerInfo.Company, { data: order }),
|
|
1578
|
+
/* @__PURE__ */ jsx19(CustomerInfo.Addresses, { data: order })
|
|
1531
1579
|
] });
|
|
1532
1580
|
};
|
|
1533
1581
|
var Header = () => {
|
|
1534
|
-
const { t } =
|
|
1535
|
-
return /* @__PURE__ */
|
|
1582
|
+
const { t } = useTranslation18();
|
|
1583
|
+
return /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx19(Heading7, { level: "h2", children: t("fields.customer") }) });
|
|
1536
1584
|
};
|
|
1537
1585
|
|
|
1538
1586
|
// src/pages/orders/[id]/_components/order-fulfillment-section/order-fulfillment-section.tsx
|
|
1539
|
-
import { XCircle } from "@medusajs/icons";
|
|
1587
|
+
import { Buildings, XCircle } from "@medusajs/icons";
|
|
1540
1588
|
import {
|
|
1541
1589
|
Button as Button6,
|
|
1542
|
-
Container as
|
|
1590
|
+
Container as Container8,
|
|
1543
1591
|
Copy as Copy3,
|
|
1544
|
-
Heading as
|
|
1592
|
+
Heading as Heading8,
|
|
1545
1593
|
StatusBadge,
|
|
1546
|
-
Text as
|
|
1594
|
+
Text as Text18,
|
|
1547
1595
|
Tooltip as Tooltip2,
|
|
1548
1596
|
toast as toast5,
|
|
1549
1597
|
usePrompt as usePrompt2
|
|
1550
1598
|
} from "@medusajs/ui";
|
|
1551
1599
|
import { format } from "date-fns";
|
|
1552
|
-
import { useTranslation as
|
|
1600
|
+
import { useTranslation as useTranslation19 } from "react-i18next";
|
|
1553
1601
|
import { Link as Link3, useNavigate as useNavigate5 } from "react-router-dom";
|
|
1554
|
-
import { Fragment as Fragment2, jsx as
|
|
1602
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1555
1603
|
var OrderFulfillmentSection = ({
|
|
1556
1604
|
order
|
|
1557
1605
|
}) => {
|
|
1558
1606
|
const fulfillments = order.fulfillments || [];
|
|
1559
|
-
return /* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1561
|
-
fulfillments.map((f, index) => /* @__PURE__ */
|
|
1607
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-y-3", children: [
|
|
1608
|
+
/* @__PURE__ */ jsx20(UnfulfilledItemBreakdown, { order }),
|
|
1609
|
+
fulfillments.map((f, index) => /* @__PURE__ */ jsx20(Fulfillment, { index, fulfillment: f, order }, f.id))
|
|
1562
1610
|
] });
|
|
1563
1611
|
};
|
|
1564
1612
|
var UnfulfilledItem = ({
|
|
1565
1613
|
item,
|
|
1566
1614
|
currencyCode
|
|
1567
1615
|
}) => {
|
|
1568
|
-
return /* @__PURE__ */
|
|
1616
|
+
return /* @__PURE__ */ jsxs21(
|
|
1569
1617
|
"div",
|
|
1570
1618
|
{
|
|
1571
1619
|
className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4",
|
|
1572
1620
|
children: [
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
|
|
1621
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-x-4", children: [
|
|
1622
|
+
/* @__PURE__ */ jsx20(Thumbnail, { src: item.thumbnail }),
|
|
1623
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
1624
|
+
/* @__PURE__ */ jsx20(
|
|
1625
|
+
Text18,
|
|
1578
1626
|
{
|
|
1579
1627
|
size: "small",
|
|
1580
1628
|
leading: "compact",
|
|
@@ -1583,20 +1631,20 @@ var UnfulfilledItem = ({
|
|
|
1583
1631
|
children: item.title
|
|
1584
1632
|
}
|
|
1585
1633
|
),
|
|
1586
|
-
item.variant_sku && /* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1588
|
-
/* @__PURE__ */
|
|
1634
|
+
item.variant_sku && /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-x-1", children: [
|
|
1635
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", children: item.variant_sku }),
|
|
1636
|
+
/* @__PURE__ */ jsx20(Copy3, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
1589
1637
|
] }),
|
|
1590
|
-
/* @__PURE__ */
|
|
1638
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
1591
1639
|
] })
|
|
1592
1640
|
] }),
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1595
|
-
/* @__PURE__ */
|
|
1596
|
-
/* @__PURE__ */
|
|
1641
|
+
/* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
1642
|
+
/* @__PURE__ */ jsx20("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx20(Text18, { size: "small", children: getLocaleAmount(item.unit_price, currencyCode) }) }),
|
|
1643
|
+
/* @__PURE__ */ jsx20("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs21(Text18, { children: [
|
|
1644
|
+
/* @__PURE__ */ jsx20("span", { className: "tabular-nums", children: item.quantity - item.detail.fulfilled_quantity }),
|
|
1597
1645
|
"x"
|
|
1598
1646
|
] }) }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ jsx20("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx20(Text18, { size: "small", children: getLocaleAmount(item.subtotal || 0, currencyCode) }) })
|
|
1600
1648
|
] })
|
|
1601
1649
|
]
|
|
1602
1650
|
},
|
|
@@ -1610,8 +1658,8 @@ var UnfulfilledItemBreakdown = ({ order }) => {
|
|
|
1610
1658
|
const unfulfilledItemsWithoutShipping = order.items.filter(
|
|
1611
1659
|
(i) => !i.requires_shipping && i.detail && i.quantity && i.detail.fulfilled_quantity < i.quantity
|
|
1612
1660
|
);
|
|
1613
|
-
return /* @__PURE__ */
|
|
1614
|
-
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */
|
|
1661
|
+
return /* @__PURE__ */ jsxs21(Fragment2, { children: [
|
|
1662
|
+
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */ jsx20(
|
|
1615
1663
|
UnfulfilledItemDisplay,
|
|
1616
1664
|
{
|
|
1617
1665
|
order,
|
|
@@ -1619,7 +1667,7 @@ var UnfulfilledItemBreakdown = ({ order }) => {
|
|
|
1619
1667
|
requiresShipping: true
|
|
1620
1668
|
}
|
|
1621
1669
|
),
|
|
1622
|
-
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */
|
|
1670
|
+
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */ jsx20(
|
|
1623
1671
|
UnfulfilledItemDisplay,
|
|
1624
1672
|
{
|
|
1625
1673
|
order,
|
|
@@ -1634,33 +1682,42 @@ var UnfulfilledItemDisplay = ({
|
|
|
1634
1682
|
unfulfilledItems,
|
|
1635
1683
|
requiresShipping = false
|
|
1636
1684
|
}) => {
|
|
1637
|
-
const { t } =
|
|
1685
|
+
const { t } = useTranslation19();
|
|
1638
1686
|
if (order.status === "canceled") {
|
|
1639
1687
|
return;
|
|
1640
1688
|
}
|
|
1641
|
-
return /* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
-
requiresShipping && /* @__PURE__ */
|
|
1646
|
-
/* @__PURE__ */
|
|
1689
|
+
return /* @__PURE__ */ jsxs21(Container8, { className: "divide-y p-0", children: [
|
|
1690
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1691
|
+
/* @__PURE__ */ jsx20(Heading8, { level: "h2", children: t("orders.fulfillment.unfulfilledItems") }),
|
|
1692
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-x-4", children: [
|
|
1693
|
+
requiresShipping && /* @__PURE__ */ jsx20(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.requiresShipping") }),
|
|
1694
|
+
/* @__PURE__ */ jsx20(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.awaitingFulfillmentBadge") }),
|
|
1695
|
+
/* @__PURE__ */ jsx20(
|
|
1696
|
+
ActionMenu,
|
|
1697
|
+
{
|
|
1698
|
+
groups: [
|
|
1699
|
+
{
|
|
1700
|
+
actions: [
|
|
1701
|
+
{
|
|
1702
|
+
label: t("orders.fulfillment.fulfillItems"),
|
|
1703
|
+
icon: /* @__PURE__ */ jsx20(Buildings, {}),
|
|
1704
|
+
to: `/orders/${order.id}/fulfillment?requires_shipping=${requiresShipping}`
|
|
1705
|
+
}
|
|
1706
|
+
]
|
|
1707
|
+
}
|
|
1708
|
+
]
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1647
1711
|
] })
|
|
1648
1712
|
] }),
|
|
1649
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ jsx20("div", { children: unfulfilledItems.map((item) => /* @__PURE__ */ jsx20(
|
|
1650
1714
|
UnfulfilledItem,
|
|
1651
1715
|
{
|
|
1652
1716
|
item,
|
|
1653
1717
|
currencyCode: order.currency_code
|
|
1654
1718
|
},
|
|
1655
1719
|
item.id
|
|
1656
|
-
)) })
|
|
1657
|
-
/* @__PURE__ */ jsx19("div", { className: "px-6 py-4 flex justify-end", children: /* @__PURE__ */ jsx19(
|
|
1658
|
-
Link3,
|
|
1659
|
-
{
|
|
1660
|
-
to: `/orders/${order.id}/fulfillment?requires_shipping=${requiresShipping}`,
|
|
1661
|
-
children: /* @__PURE__ */ jsx19(Button6, { size: "small", children: t("orders.fulfillment.fulfillItems") })
|
|
1662
|
-
}
|
|
1663
|
-
) })
|
|
1720
|
+
)) })
|
|
1664
1721
|
] });
|
|
1665
1722
|
};
|
|
1666
1723
|
var Fulfillment = ({
|
|
@@ -1668,7 +1725,7 @@ var Fulfillment = ({
|
|
|
1668
1725
|
order,
|
|
1669
1726
|
index
|
|
1670
1727
|
}) => {
|
|
1671
|
-
const { t } =
|
|
1728
|
+
const { t } = useTranslation19();
|
|
1672
1729
|
const prompt = usePrompt2();
|
|
1673
1730
|
const navigate = useNavigate5();
|
|
1674
1731
|
const showLocation = !!fulfillment.location_id;
|
|
@@ -1703,6 +1760,7 @@ var Fulfillment = ({
|
|
|
1703
1760
|
);
|
|
1704
1761
|
const showShippingButton = !fulfillment.canceled_at && !fulfillment.shipped_at && !fulfillment.delivered_at && fulfillment.requires_shipping && !isPickUpFulfillment;
|
|
1705
1762
|
const showDeliveryButton = !fulfillment.canceled_at && !fulfillment.delivered_at;
|
|
1763
|
+
const cancelDisabled = !!fulfillment.canceled_at || !!fulfillment.shipped_at || !!fulfillment.delivered_at;
|
|
1706
1764
|
const handleMarkAsDelivered = async () => {
|
|
1707
1765
|
const res = await prompt({
|
|
1708
1766
|
title: t("general.areYouSure"),
|
|
@@ -1751,23 +1809,23 @@ var Fulfillment = ({
|
|
|
1751
1809
|
if (isError) {
|
|
1752
1810
|
throw error;
|
|
1753
1811
|
}
|
|
1754
|
-
return /* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ jsxs21(Container8, { className: "divide-y p-0", children: [
|
|
1813
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1814
|
+
/* @__PURE__ */ jsx20(Heading8, { level: "h2", children: t("orders.fulfillment.number", {
|
|
1757
1815
|
number: index + 1
|
|
1758
1816
|
}) }),
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-x-4", children: [
|
|
1818
|
+
/* @__PURE__ */ jsx20(
|
|
1761
1819
|
Tooltip2,
|
|
1762
1820
|
{
|
|
1763
1821
|
content: format(
|
|
1764
1822
|
new Date(statusTimestamp),
|
|
1765
1823
|
"dd MMM, yyyy, HH:mm:ss"
|
|
1766
1824
|
),
|
|
1767
|
-
children: /* @__PURE__ */
|
|
1825
|
+
children: /* @__PURE__ */ jsx20(StatusBadge, { color: statusColor, className: "text-nowrap", children: statusText })
|
|
1768
1826
|
}
|
|
1769
1827
|
),
|
|
1770
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ jsx20(
|
|
1771
1829
|
ActionMenu,
|
|
1772
1830
|
{
|
|
1773
1831
|
groups: [
|
|
@@ -1775,9 +1833,9 @@ var Fulfillment = ({
|
|
|
1775
1833
|
actions: [
|
|
1776
1834
|
{
|
|
1777
1835
|
label: t("actions.cancel"),
|
|
1778
|
-
icon: /* @__PURE__ */
|
|
1836
|
+
icon: /* @__PURE__ */ jsx20(XCircle, {}),
|
|
1779
1837
|
onClick: handleCancel,
|
|
1780
|
-
disabled:
|
|
1838
|
+
disabled: cancelDisabled
|
|
1781
1839
|
}
|
|
1782
1840
|
]
|
|
1783
1841
|
}
|
|
@@ -1786,50 +1844,50 @@ var Fulfillment = ({
|
|
|
1786
1844
|
)
|
|
1787
1845
|
] })
|
|
1788
1846
|
] }),
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ jsxs21("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1848
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.itemsLabel") }),
|
|
1849
|
+
/* @__PURE__ */ jsx20("ul", { children: (fulfillment.items || []).map((f_item) => /* @__PURE__ */ jsx20("li", { children: /* @__PURE__ */ jsxs21(Text18, { size: "small", leading: "compact", children: [
|
|
1792
1850
|
f_item.quantity,
|
|
1793
1851
|
"x ",
|
|
1794
1852
|
f_item.title
|
|
1795
1853
|
] }) }, f_item.line_item_id)) })
|
|
1796
1854
|
] }),
|
|
1797
|
-
showLocation && /* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
stock_location ? /* @__PURE__ */
|
|
1855
|
+
showLocation && /* @__PURE__ */ jsxs21("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1856
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.shippingFromLabel") }),
|
|
1857
|
+
stock_location ? /* @__PURE__ */ jsx20(
|
|
1800
1858
|
Link3,
|
|
1801
1859
|
{
|
|
1802
1860
|
to: `/settings/locations/${stock_location.id}`,
|
|
1803
1861
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1804
|
-
children: /* @__PURE__ */
|
|
1862
|
+
children: /* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", children: stock_location.name })
|
|
1805
1863
|
}
|
|
1806
|
-
) : /* @__PURE__ */
|
|
1864
|
+
) : /* @__PURE__ */ jsx20(Skeleton, { className: "w-16" })
|
|
1807
1865
|
] }),
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsxs21("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1867
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", weight: "plus", children: t("fields.provider") }),
|
|
1868
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", children: formatProvider(fulfillment.provider_id) })
|
|
1811
1869
|
] }),
|
|
1812
|
-
/* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ jsxs21("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1871
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.trackingLabel") }),
|
|
1872
|
+
/* @__PURE__ */ jsx20("div", { children: fulfillment.labels && fulfillment.labels.length > 0 ? /* @__PURE__ */ jsx20("ul", { children: fulfillment.labels.map((tlink) => {
|
|
1815
1873
|
const hasUrl = !!tlink.tracking_url?.length && tlink.tracking_url !== "#";
|
|
1816
1874
|
if (hasUrl) {
|
|
1817
|
-
return /* @__PURE__ */
|
|
1875
|
+
return /* @__PURE__ */ jsx20("li", { children: /* @__PURE__ */ jsx20(
|
|
1818
1876
|
"a",
|
|
1819
1877
|
{
|
|
1820
1878
|
href: tlink.tracking_url || "",
|
|
1821
1879
|
target: "_blank",
|
|
1822
1880
|
rel: "noopener noreferrer",
|
|
1823
1881
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1882
|
+
children: /* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", children: tlink.tracking_number })
|
|
1825
1883
|
}
|
|
1826
1884
|
) }, tlink.tracking_number);
|
|
1827
1885
|
}
|
|
1828
|
-
return /* @__PURE__ */
|
|
1829
|
-
}) }) : /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ jsx20("li", { children: /* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", children: tlink.tracking_number }) }, tlink.tracking_number);
|
|
1887
|
+
}) }) : /* @__PURE__ */ jsx20(Text18, { size: "small", leading: "compact", children: "-" }) })
|
|
1830
1888
|
] }),
|
|
1831
|
-
(showShippingButton || showDeliveryButton) && /* @__PURE__ */
|
|
1832
|
-
showDeliveryButton && /* @__PURE__ */
|
|
1889
|
+
(showShippingButton || showDeliveryButton) && /* @__PURE__ */ jsxs21("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
1890
|
+
showDeliveryButton && /* @__PURE__ */ jsx20(
|
|
1833
1891
|
Button6,
|
|
1834
1892
|
{
|
|
1835
1893
|
size: "small",
|
|
@@ -1840,7 +1898,7 @@ var Fulfillment = ({
|
|
|
1840
1898
|
)
|
|
1841
1899
|
}
|
|
1842
1900
|
),
|
|
1843
|
-
showShippingButton && /* @__PURE__ */
|
|
1901
|
+
showShippingButton && /* @__PURE__ */ jsx20(
|
|
1844
1902
|
Button6,
|
|
1845
1903
|
{
|
|
1846
1904
|
size: "small",
|
|
@@ -1856,18 +1914,18 @@ var Fulfillment = ({
|
|
|
1856
1914
|
// src/pages/orders/[id]/_components/order-general-section/order-general-section.tsx
|
|
1857
1915
|
import { XCircle as XCircle2 } from "@medusajs/icons";
|
|
1858
1916
|
import {
|
|
1859
|
-
Container as
|
|
1917
|
+
Container as Container9,
|
|
1860
1918
|
Copy as Copy4,
|
|
1861
|
-
Heading as
|
|
1919
|
+
Heading as Heading9,
|
|
1862
1920
|
StatusBadge as StatusBadge2,
|
|
1863
|
-
Text as
|
|
1921
|
+
Text as Text19,
|
|
1864
1922
|
toast as toast6,
|
|
1865
1923
|
usePrompt as usePrompt3
|
|
1866
1924
|
} from "@medusajs/ui";
|
|
1867
|
-
import { useTranslation as
|
|
1868
|
-
import { jsx as
|
|
1925
|
+
import { useTranslation as useTranslation20 } from "react-i18next";
|
|
1926
|
+
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1869
1927
|
var OrderGeneralSection = ({ order }) => {
|
|
1870
|
-
const { t } =
|
|
1928
|
+
const { t } = useTranslation20();
|
|
1871
1929
|
const prompt = usePrompt3();
|
|
1872
1930
|
const { getFullDate } = useDate();
|
|
1873
1931
|
const { mutateAsync: cancelOrder } = useCancelOrder(order.id);
|
|
@@ -1898,27 +1956,27 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
1898
1956
|
}
|
|
1899
1957
|
});
|
|
1900
1958
|
};
|
|
1901
|
-
return /* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
/* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ jsxs22(Container9, { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1960
|
+
/* @__PURE__ */ jsxs22("div", { children: [
|
|
1961
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-x-1", children: [
|
|
1962
|
+
/* @__PURE__ */ jsxs22(Heading9, { children: [
|
|
1905
1963
|
"#",
|
|
1906
1964
|
order.display_id
|
|
1907
1965
|
] }),
|
|
1908
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ jsx21(Copy4, { content: `#${order.display_id}`, className: "text-ui-fg-muted" })
|
|
1909
1967
|
] }),
|
|
1910
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", className: "text-ui-fg-subtle", children: t("orders.onDateFromSalesChannel", {
|
|
1911
1969
|
date: getFullDate({ date: order.created_at, includeTime: true }),
|
|
1912
1970
|
salesChannel: order.sales_channel?.name
|
|
1913
1971
|
}) })
|
|
1914
1972
|
] }),
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-x-4", children: [
|
|
1974
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-x-1.5", children: [
|
|
1975
|
+
/* @__PURE__ */ jsx21(OrderBadge, { order }),
|
|
1976
|
+
/* @__PURE__ */ jsx21(PaymentBadge, { order }),
|
|
1977
|
+
/* @__PURE__ */ jsx21(FulfillmentBadge, { order })
|
|
1920
1978
|
] }),
|
|
1921
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx21(
|
|
1922
1980
|
ActionMenu,
|
|
1923
1981
|
{
|
|
1924
1982
|
groups: [
|
|
@@ -1929,7 +1987,7 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
1929
1987
|
onClick: handleCancel,
|
|
1930
1988
|
disabled: cancelDisabled,
|
|
1931
1989
|
disabledTooltip: cancelDisabledTooltip,
|
|
1932
|
-
icon: /* @__PURE__ */
|
|
1990
|
+
icon: /* @__PURE__ */ jsx21(XCircle2, {})
|
|
1933
1991
|
}
|
|
1934
1992
|
]
|
|
1935
1993
|
}
|
|
@@ -1940,7 +1998,7 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
1940
1998
|
] });
|
|
1941
1999
|
};
|
|
1942
2000
|
var FulfillmentBadge = ({ order }) => {
|
|
1943
|
-
const { t } =
|
|
2001
|
+
const { t } = useTranslation20();
|
|
1944
2002
|
if (!order.fulfillment_status) {
|
|
1945
2003
|
return null;
|
|
1946
2004
|
}
|
|
@@ -1948,36 +2006,36 @@ var FulfillmentBadge = ({ order }) => {
|
|
|
1948
2006
|
t,
|
|
1949
2007
|
order.fulfillment_status
|
|
1950
2008
|
);
|
|
1951
|
-
return /* @__PURE__ */
|
|
2009
|
+
return /* @__PURE__ */ jsx21(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
1952
2010
|
};
|
|
1953
2011
|
var PaymentBadge = ({ order }) => {
|
|
1954
|
-
const { t } =
|
|
2012
|
+
const { t } = useTranslation20();
|
|
1955
2013
|
if (!order.payment_status) {
|
|
1956
2014
|
return null;
|
|
1957
2015
|
}
|
|
1958
2016
|
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
1959
|
-
return /* @__PURE__ */
|
|
2017
|
+
return /* @__PURE__ */ jsx21(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
1960
2018
|
};
|
|
1961
2019
|
var OrderBadge = ({ order }) => {
|
|
1962
|
-
const { t } =
|
|
2020
|
+
const { t } = useTranslation20();
|
|
1963
2021
|
const orderStatus = getCanceledOrderStatus(t, order.status);
|
|
1964
2022
|
if (!orderStatus) {
|
|
1965
2023
|
return null;
|
|
1966
2024
|
}
|
|
1967
|
-
return /* @__PURE__ */
|
|
2025
|
+
return /* @__PURE__ */ jsx21(StatusBadge2, { color: orderStatus.color, className: "text-nowrap", children: orderStatus.label });
|
|
1968
2026
|
};
|
|
1969
2027
|
|
|
1970
2028
|
// src/pages/orders/[id]/_components/order-payment-section/order-payment-section.tsx
|
|
1971
2029
|
import { ArrowUturnLeft as ArrowUturnLeft2, DocumentText } from "@medusajs/icons";
|
|
1972
2030
|
import {
|
|
1973
2031
|
Badge,
|
|
1974
|
-
Container as
|
|
1975
|
-
Heading as
|
|
2032
|
+
Container as Container10,
|
|
2033
|
+
Heading as Heading10,
|
|
1976
2034
|
StatusBadge as StatusBadge3,
|
|
1977
|
-
Text as
|
|
2035
|
+
Text as Text20,
|
|
1978
2036
|
Tooltip as Tooltip3
|
|
1979
2037
|
} from "@medusajs/ui";
|
|
1980
|
-
import { useTranslation as
|
|
2038
|
+
import { useTranslation as useTranslation21 } from "react-i18next";
|
|
1981
2039
|
|
|
1982
2040
|
// src/lib/payment.ts
|
|
1983
2041
|
var getTotalCaptured = (paymentCollections) => paymentCollections.reduce((acc, paymentCollection) => {
|
|
@@ -1990,23 +2048,23 @@ var getTotalPending = (paymentCollections) => paymentCollections.filter((pc) =>
|
|
|
1990
2048
|
}, 0);
|
|
1991
2049
|
|
|
1992
2050
|
// src/pages/orders/[id]/_components/order-payment-section/order-payment-section.tsx
|
|
1993
|
-
import { jsx as
|
|
2051
|
+
import { jsx as jsx22, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1994
2052
|
var getPaymentsFromOrder = (order) => {
|
|
1995
2053
|
return order.payment_collections?.map((collection) => collection.payments).flat(1).filter(Boolean);
|
|
1996
2054
|
};
|
|
1997
2055
|
var OrderPaymentSection = ({ order }) => {
|
|
1998
2056
|
const payments = getPaymentsFromOrder(order) ?? [];
|
|
1999
|
-
return /* @__PURE__ */
|
|
2000
|
-
/* @__PURE__ */
|
|
2001
|
-
payments.length > 0 && /* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ jsxs23(Container10, { className: "divide-y p-0", children: [
|
|
2058
|
+
/* @__PURE__ */ jsx22(Header2, { order }),
|
|
2059
|
+
payments.length > 0 && /* @__PURE__ */ jsx22("ul", { className: "divide-y", children: payments.map((payment) => /* @__PURE__ */ jsx22(PaymentRow, { order, payment }, payment.id)) }),
|
|
2060
|
+
/* @__PURE__ */ jsx22(Total, { order })
|
|
2003
2061
|
] });
|
|
2004
2062
|
};
|
|
2005
2063
|
var Header2 = ({ order }) => {
|
|
2006
|
-
const { t } =
|
|
2007
|
-
return /* @__PURE__ */
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
order.payment_status && /* @__PURE__ */
|
|
2064
|
+
const { t } = useTranslation21();
|
|
2065
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2066
|
+
/* @__PURE__ */ jsx22(Heading10, { level: "h2", children: t("orders.payment.title") }),
|
|
2067
|
+
order.payment_status && /* @__PURE__ */ jsx22(
|
|
2010
2068
|
StatusBadge3,
|
|
2011
2069
|
{
|
|
2012
2070
|
color: getOrderPaymentStatus(t, order.payment_status).color,
|
|
@@ -2017,7 +2075,7 @@ var Header2 = ({ order }) => {
|
|
|
2017
2075
|
] });
|
|
2018
2076
|
};
|
|
2019
2077
|
var Total = ({ order }) => {
|
|
2020
|
-
const { t } =
|
|
2078
|
+
const { t } = useTranslation21();
|
|
2021
2079
|
if (!order.payment_collections?.length) {
|
|
2022
2080
|
return null;
|
|
2023
2081
|
}
|
|
@@ -2028,18 +2086,18 @@ var Total = ({ order }) => {
|
|
|
2028
2086
|
(acc, pc) => acc + (pc.refunded_amount || 0),
|
|
2029
2087
|
0
|
|
2030
2088
|
);
|
|
2031
|
-
return /* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2089
|
+
return /* @__PURE__ */ jsxs23("div", { children: [
|
|
2090
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2091
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPaidByCustomer") }),
|
|
2092
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalCaptured, order.currency_code) })
|
|
2035
2093
|
] }),
|
|
2036
|
-
totalRefunded > 0 && /* @__PURE__ */
|
|
2037
|
-
/* @__PURE__ */
|
|
2038
|
-
/* @__PURE__ */
|
|
2094
|
+
totalRefunded > 0 && /* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2095
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalRefunded") }),
|
|
2096
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalRefunded, order.currency_code) })
|
|
2039
2097
|
] }),
|
|
2040
|
-
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2098
|
+
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2099
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPending") }),
|
|
2100
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalPending, order.currency_code) })
|
|
2043
2101
|
] })
|
|
2044
2102
|
] });
|
|
2045
2103
|
};
|
|
@@ -2049,24 +2107,24 @@ var getPaymentStatus = (payment) => {
|
|
|
2049
2107
|
0
|
|
2050
2108
|
);
|
|
2051
2109
|
if (payment.canceled_at) {
|
|
2052
|
-
return {
|
|
2110
|
+
return { labelKey: "orders.payment.status.canceled", color: "red" };
|
|
2053
2111
|
}
|
|
2054
2112
|
if (refundedAmount > 0 && refundedAmount >= payment.amount) {
|
|
2055
|
-
return {
|
|
2113
|
+
return { labelKey: "orders.payment.status.refunded", color: "grey" };
|
|
2056
2114
|
}
|
|
2057
2115
|
if (refundedAmount > 0) {
|
|
2058
|
-
return {
|
|
2116
|
+
return { labelKey: "orders.payment.status.partiallyRefunded", color: "orange" };
|
|
2059
2117
|
}
|
|
2060
2118
|
if (payment.captured_at) {
|
|
2061
|
-
return {
|
|
2119
|
+
return { labelKey: "orders.payment.status.captured", color: "green" };
|
|
2062
2120
|
}
|
|
2063
|
-
return {
|
|
2121
|
+
return { labelKey: "orders.payment.status.pending", color: "orange" };
|
|
2064
2122
|
};
|
|
2065
2123
|
var PaymentRow = ({
|
|
2066
2124
|
order,
|
|
2067
2125
|
payment
|
|
2068
2126
|
}) => {
|
|
2069
|
-
const { t } =
|
|
2127
|
+
const { t } = useTranslation21();
|
|
2070
2128
|
const { getFullDate } = useDate();
|
|
2071
2129
|
const status = getPaymentStatus(payment);
|
|
2072
2130
|
const refunds = payment.refunds ?? [];
|
|
@@ -2076,11 +2134,11 @@ var PaymentRow = ({
|
|
|
2076
2134
|
);
|
|
2077
2135
|
const isFullyRefunded = refundedAmount > 0 && refundedAmount >= payment.amount;
|
|
2078
2136
|
const canRefund = !!payment.captured_at && !payment.canceled_at && !isFullyRefunded;
|
|
2079
|
-
return /* @__PURE__ */
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2083
|
-
|
|
2137
|
+
return /* @__PURE__ */ jsxs23("li", { "data-testid": `payment-row-${payment.id}`, children: [
|
|
2138
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2139
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex min-w-0 flex-col", children: [
|
|
2140
|
+
/* @__PURE__ */ jsx22(Tooltip3, { content: payment.id, children: /* @__PURE__ */ jsx22(
|
|
2141
|
+
Text20,
|
|
2084
2142
|
{
|
|
2085
2143
|
size: "small",
|
|
2086
2144
|
weight: "plus",
|
|
@@ -2089,8 +2147,8 @@ var PaymentRow = ({
|
|
|
2089
2147
|
children: `#${payment.id.slice(-7)}`
|
|
2090
2148
|
}
|
|
2091
2149
|
) }),
|
|
2092
|
-
/* @__PURE__ */
|
|
2093
|
-
|
|
2150
|
+
/* @__PURE__ */ jsx22(
|
|
2151
|
+
Text20,
|
|
2094
2152
|
{
|
|
2095
2153
|
size: "xsmall",
|
|
2096
2154
|
leading: "compact",
|
|
@@ -2099,10 +2157,10 @@ var PaymentRow = ({
|
|
|
2099
2157
|
}
|
|
2100
2158
|
)
|
|
2101
2159
|
] }),
|
|
2102
|
-
/* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
|
|
2160
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-x-3", children: [
|
|
2161
|
+
/* @__PURE__ */ jsx22(StatusBadge3, { color: status.color, className: "text-nowrap", children: t(status.labelKey) }),
|
|
2162
|
+
/* @__PURE__ */ jsx22(
|
|
2163
|
+
Text20,
|
|
2106
2164
|
{
|
|
2107
2165
|
size: "small",
|
|
2108
2166
|
weight: "plus",
|
|
@@ -2111,7 +2169,7 @@ var PaymentRow = ({
|
|
|
2111
2169
|
children: getStylizedAmount(payment.amount, order.currency_code)
|
|
2112
2170
|
}
|
|
2113
2171
|
),
|
|
2114
|
-
/* @__PURE__ */
|
|
2172
|
+
/* @__PURE__ */ jsx22(
|
|
2115
2173
|
ActionMenu,
|
|
2116
2174
|
{
|
|
2117
2175
|
groups: [
|
|
@@ -2119,7 +2177,7 @@ var PaymentRow = ({
|
|
|
2119
2177
|
actions: [
|
|
2120
2178
|
{
|
|
2121
2179
|
label: t("orders.payment.createRefund"),
|
|
2122
|
-
icon: /* @__PURE__ */
|
|
2180
|
+
icon: /* @__PURE__ */ jsx22(ArrowUturnLeft2, {}),
|
|
2123
2181
|
to: `/orders/${order.id}/refund?payment_id=${payment.id}`,
|
|
2124
2182
|
disabled: !canRefund
|
|
2125
2183
|
}
|
|
@@ -2130,7 +2188,7 @@ var PaymentRow = ({
|
|
|
2130
2188
|
)
|
|
2131
2189
|
] })
|
|
2132
2190
|
] }),
|
|
2133
|
-
refunds.map((refund) => /* @__PURE__ */
|
|
2191
|
+
refunds.map((refund) => /* @__PURE__ */ jsx22(
|
|
2134
2192
|
RefundRow,
|
|
2135
2193
|
{
|
|
2136
2194
|
refund,
|
|
@@ -2144,32 +2202,32 @@ var RefundRow = ({
|
|
|
2144
2202
|
refund,
|
|
2145
2203
|
currencyCode
|
|
2146
2204
|
}) => {
|
|
2147
|
-
const { t } =
|
|
2205
|
+
const { t } = useTranslation21();
|
|
2148
2206
|
const { getFullDate } = useDate();
|
|
2149
2207
|
const reasonLabel = refund.refund_reason?.label ?? null;
|
|
2150
|
-
return /* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ jsxs23(
|
|
2151
2209
|
"div",
|
|
2152
2210
|
{
|
|
2153
2211
|
className: "flex items-center justify-between px-6 py-3 pl-12 bg-ui-bg-subtle",
|
|
2154
2212
|
"data-testid": `refund-row-${refund.id}`,
|
|
2155
2213
|
children: [
|
|
2156
|
-
/* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
reasonLabel && /* @__PURE__ */
|
|
2160
|
-
refund.note && /* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex min-w-0 flex-col", children: [
|
|
2215
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-x-2", children: [
|
|
2216
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("orders.payment.refund") }),
|
|
2217
|
+
reasonLabel && /* @__PURE__ */ jsx22(Badge, { size: "2xsmall", rounded: "full", children: reasonLabel }),
|
|
2218
|
+
refund.note && /* @__PURE__ */ jsx22(Tooltip3, { content: refund.note, children: /* @__PURE__ */ jsx22(DocumentText, { className: "text-ui-fg-subtle h-3 w-3" }) })
|
|
2161
2219
|
] }),
|
|
2162
|
-
refund.created_at && /* @__PURE__ */
|
|
2220
|
+
refund.created_at && /* @__PURE__ */ jsx22(Text20, { size: "xsmall", leading: "compact", className: "text-ui-fg-subtle", children: getFullDate({ date: refund.created_at, includeTime: true }) })
|
|
2163
2221
|
] }),
|
|
2164
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: `- ${getLocaleAmount(refund.amount ?? 0, currencyCode)}` })
|
|
2165
2223
|
]
|
|
2166
2224
|
}
|
|
2167
2225
|
);
|
|
2168
2226
|
};
|
|
2169
2227
|
|
|
2170
2228
|
// src/pages/orders/[id]/_components/order-summary-section/order-summary-section.tsx
|
|
2171
|
-
import { useMemo as
|
|
2172
|
-
import { useTranslation as
|
|
2229
|
+
import { useMemo as useMemo5, useState as useState5 } from "react";
|
|
2230
|
+
import { useTranslation as useTranslation24 } from "react-i18next";
|
|
2173
2231
|
import { Link as Link4 } from "react-router-dom";
|
|
2174
2232
|
import {
|
|
2175
2233
|
ArrowDownRightMini,
|
|
@@ -2185,34 +2243,23 @@ import {
|
|
|
2185
2243
|
Badge as Badge4,
|
|
2186
2244
|
Button as Button7,
|
|
2187
2245
|
clx as clx2,
|
|
2188
|
-
Container as
|
|
2246
|
+
Container as Container11,
|
|
2189
2247
|
Copy as Copy5,
|
|
2190
|
-
Heading as
|
|
2248
|
+
Heading as Heading11,
|
|
2191
2249
|
StatusBadge as StatusBadge4,
|
|
2192
|
-
Text as
|
|
2250
|
+
Text as Text22,
|
|
2193
2251
|
Tooltip as Tooltip5,
|
|
2194
2252
|
toast as toast7
|
|
2195
2253
|
} from "@medusajs/ui";
|
|
2196
2254
|
|
|
2197
|
-
// src/lib/orders.ts
|
|
2198
|
-
function getReservationsLimitCount(order) {
|
|
2199
|
-
if (!order?.items?.length) {
|
|
2200
|
-
return 0;
|
|
2201
|
-
}
|
|
2202
|
-
return order.items.reduce(
|
|
2203
|
-
(acc, item) => acc + (item.variant?.inventory_items?.length || 1),
|
|
2204
|
-
0
|
|
2205
|
-
);
|
|
2206
|
-
}
|
|
2207
|
-
|
|
2208
2255
|
// src/pages/orders/[id]/_components/order-summary-section/return-info-popover.tsx
|
|
2209
2256
|
import { useState as useState4 } from "react";
|
|
2210
|
-
import { useTranslation as
|
|
2257
|
+
import { useTranslation as useTranslation22 } from "react-i18next";
|
|
2211
2258
|
import { InformationCircleSolid } from "@medusajs/icons";
|
|
2212
|
-
import { Badge as Badge2, Popover as Popover3, Text as
|
|
2213
|
-
import { jsx as
|
|
2259
|
+
import { Badge as Badge2, Popover as Popover3, Text as Text21 } from "@medusajs/ui";
|
|
2260
|
+
import { jsx as jsx23, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2214
2261
|
function ReturnInfoPopover({ orderReturn }) {
|
|
2215
|
-
const { t } =
|
|
2262
|
+
const { t } = useTranslation22();
|
|
2216
2263
|
const { getFullDate } = useDate();
|
|
2217
2264
|
const [open, setOpen] = useState4(false);
|
|
2218
2265
|
if (typeof orderReturn !== "object") {
|
|
@@ -2228,8 +2275,8 @@ function ReturnInfoPopover({ orderReturn }) {
|
|
|
2228
2275
|
returnType = "Exchange";
|
|
2229
2276
|
returnTypeId = orderReturn.exchange_id;
|
|
2230
2277
|
}
|
|
2231
|
-
return /* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2278
|
+
return /* @__PURE__ */ jsxs24(Popover3, { open, children: [
|
|
2279
|
+
/* @__PURE__ */ jsx23(
|
|
2233
2280
|
Popover3.Trigger,
|
|
2234
2281
|
{
|
|
2235
2282
|
onMouseEnter: () => setOpen(true),
|
|
@@ -2237,31 +2284,31 @@ function ReturnInfoPopover({ orderReturn }) {
|
|
|
2237
2284
|
autoFocus: false,
|
|
2238
2285
|
className: "align-sub focus-visible:outline-none",
|
|
2239
2286
|
"data-testid": "order-summary-return-info-trigger",
|
|
2240
|
-
children: /* @__PURE__ */
|
|
2287
|
+
children: /* @__PURE__ */ jsx23(InformationCircleSolid, {})
|
|
2241
2288
|
}
|
|
2242
2289
|
),
|
|
2243
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ jsx23(
|
|
2244
2291
|
Popover3.Content,
|
|
2245
2292
|
{
|
|
2246
2293
|
align: "center",
|
|
2247
2294
|
side: "top",
|
|
2248
2295
|
className: "bg-ui-bg-component p-2 focus-visible:outline-none",
|
|
2249
|
-
children: /* @__PURE__ */
|
|
2250
|
-
/* @__PURE__ */
|
|
2296
|
+
children: /* @__PURE__ */ jsxs24("div", { children: [
|
|
2297
|
+
/* @__PURE__ */ jsxs24(Badge2, { size: "2xsmall", className: "mb-2", rounded: "full", children: [
|
|
2251
2298
|
returnType,
|
|
2252
2299
|
": #",
|
|
2253
2300
|
returnTypeId.slice(-7)
|
|
2254
2301
|
] }),
|
|
2255
|
-
/* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ jsxs24(Text21, { size: "xsmall", children: [
|
|
2303
|
+
/* @__PURE__ */ jsx23("span", { className: "text-ui-fg-subtle", children: t("orders.returns.returnRequested") }),
|
|
2257
2304
|
" \xB7 ",
|
|
2258
2305
|
getFullDate({
|
|
2259
2306
|
date: orderReturn.requested_at,
|
|
2260
2307
|
includeTime: true
|
|
2261
2308
|
})
|
|
2262
2309
|
] }),
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ jsxs24(Text21, { size: "xsmall", children: [
|
|
2311
|
+
/* @__PURE__ */ jsx23("span", { className: "text-ui-fg-subtle", children: t("orders.returns.itemReceived") }),
|
|
2265
2312
|
" \xB7 ",
|
|
2266
2313
|
orderReturn.received_at ? getFullDate({
|
|
2267
2314
|
date: orderReturn.received_at,
|
|
@@ -2278,10 +2325,10 @@ var return_info_popover_default = ReturnInfoPopover;
|
|
|
2278
2325
|
// src/pages/orders/[id]/_components/order-summary-section/shipping-info-popover.tsx
|
|
2279
2326
|
import { InformationCircleSolid as InformationCircleSolid2 } from "@medusajs/icons";
|
|
2280
2327
|
import { Badge as Badge3, Tooltip as Tooltip4 } from "@medusajs/ui";
|
|
2281
|
-
import { useTranslation as
|
|
2282
|
-
import { jsx as
|
|
2328
|
+
import { useTranslation as useTranslation23 } from "react-i18next";
|
|
2329
|
+
import { jsx as jsx24, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2283
2330
|
function ShippingInfoPopover({ shippingMethod }) {
|
|
2284
|
-
const { t } =
|
|
2331
|
+
const { t } = useTranslation23();
|
|
2285
2332
|
const shippingDetail = shippingMethod?.detail;
|
|
2286
2333
|
if (!shippingDetail) {
|
|
2287
2334
|
return;
|
|
@@ -2299,26 +2346,26 @@ function ShippingInfoPopover({ shippingMethod }) {
|
|
|
2299
2346
|
if (!rmaId) {
|
|
2300
2347
|
return;
|
|
2301
2348
|
}
|
|
2302
|
-
return /* @__PURE__ */
|
|
2349
|
+
return /* @__PURE__ */ jsx24(
|
|
2303
2350
|
Tooltip4,
|
|
2304
2351
|
{
|
|
2305
|
-
content: /* @__PURE__ */
|
|
2352
|
+
content: /* @__PURE__ */ jsxs25(Badge3, { size: "2xsmall", rounded: "full", children: [
|
|
2306
2353
|
rmaType,
|
|
2307
2354
|
": #",
|
|
2308
2355
|
rmaId.slice(-7)
|
|
2309
2356
|
] }),
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2357
|
+
children: /* @__PURE__ */ jsx24(InformationCircleSolid2, { className: "inline-block text-ui-fg-muted ml-1" })
|
|
2311
2358
|
}
|
|
2312
2359
|
);
|
|
2313
2360
|
}
|
|
2314
2361
|
var shipping_info_popover_default = ShippingInfoPopover;
|
|
2315
2362
|
|
|
2316
2363
|
// src/pages/orders/[id]/_components/order-summary-section/order-summary-section.tsx
|
|
2317
|
-
import { Fragment as Fragment3, jsx as
|
|
2364
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2318
2365
|
var OrderSummarySection = ({
|
|
2319
2366
|
order
|
|
2320
2367
|
}) => {
|
|
2321
|
-
const { t } =
|
|
2368
|
+
const { t } = useTranslation24();
|
|
2322
2369
|
const { reservations } = useReservationItems(
|
|
2323
2370
|
{
|
|
2324
2371
|
line_item_id: order?.items?.map((i) => i.id),
|
|
@@ -2327,7 +2374,7 @@ var OrderSummarySection = ({
|
|
|
2327
2374
|
{ enabled: Array.isArray(order?.items) }
|
|
2328
2375
|
);
|
|
2329
2376
|
const { order: orderPreview } = useOrderPreview(order.id);
|
|
2330
|
-
const reservationList =
|
|
2377
|
+
const reservationList = useMemo5(
|
|
2331
2378
|
() => reservations ?? [],
|
|
2332
2379
|
[reservations]
|
|
2333
2380
|
);
|
|
@@ -2336,12 +2383,12 @@ var OrderSummarySection = ({
|
|
|
2336
2383
|
order_id: order.id,
|
|
2337
2384
|
fields: "+received_at"
|
|
2338
2385
|
});
|
|
2339
|
-
const receivableReturns =
|
|
2386
|
+
const receivableReturns = useMemo5(
|
|
2340
2387
|
() => receivableReturnsList.filter((r) => !r.canceled_at),
|
|
2341
2388
|
[receivableReturnsList]
|
|
2342
2389
|
);
|
|
2343
2390
|
const showReturns = !!receivableReturns.length;
|
|
2344
|
-
const showAllocateButton =
|
|
2391
|
+
const showAllocateButton = useMemo5(() => {
|
|
2345
2392
|
if (!reservations) {
|
|
2346
2393
|
return false;
|
|
2347
2394
|
}
|
|
@@ -2369,19 +2416,19 @@ var OrderSummarySection = ({
|
|
|
2369
2416
|
order.currency_code
|
|
2370
2417
|
);
|
|
2371
2418
|
const showRefund = unpaidPaymentCollection && pendingDifference < 0 && isAmountSignificant;
|
|
2372
|
-
return /* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
/* @__PURE__ */
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
(showReturns || showRefund || showAllocateButton) && /* @__PURE__ */
|
|
2378
|
-
showReturns && (receivableReturns.length === 1 ? /* @__PURE__ */
|
|
2419
|
+
return /* @__PURE__ */ jsxs26(Container11, { className: "divide-y p-0", children: [
|
|
2420
|
+
/* @__PURE__ */ jsx25(Header3, { order, orderPreview }),
|
|
2421
|
+
/* @__PURE__ */ jsx25(ItemBreakdown, { order, reservations: reservationList }),
|
|
2422
|
+
/* @__PURE__ */ jsx25(CostBreakdown, { order }),
|
|
2423
|
+
/* @__PURE__ */ jsx25(Total2, { order }),
|
|
2424
|
+
(showReturns || showRefund || showAllocateButton) && /* @__PURE__ */ jsxs26("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
2425
|
+
showReturns && (receivableReturns.length === 1 ? /* @__PURE__ */ jsx25(Button7, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ jsx25(
|
|
2379
2426
|
Link4,
|
|
2380
2427
|
{
|
|
2381
2428
|
to: `/orders/${order.id}/returns/${receivableReturns[0].id}/receive`,
|
|
2382
2429
|
children: t("orders.returns.receive.action")
|
|
2383
2430
|
}
|
|
2384
|
-
) }) : /* @__PURE__ */
|
|
2431
|
+
) }) : /* @__PURE__ */ jsx25(
|
|
2385
2432
|
ActionMenu,
|
|
2386
2433
|
{
|
|
2387
2434
|
groups: [
|
|
@@ -2402,40 +2449,40 @@ var OrderSummarySection = ({
|
|
|
2402
2449
|
id: `#${id?.slice(-7)}`,
|
|
2403
2450
|
returnType
|
|
2404
2451
|
}),
|
|
2405
|
-
icon: /* @__PURE__ */
|
|
2452
|
+
icon: /* @__PURE__ */ jsx25(ArrowLongRight, {}),
|
|
2406
2453
|
to: `/orders/${order.id}/returns/${r.id}/receive`
|
|
2407
2454
|
};
|
|
2408
2455
|
})
|
|
2409
2456
|
}
|
|
2410
2457
|
],
|
|
2411
|
-
children: /* @__PURE__ */
|
|
2458
|
+
children: /* @__PURE__ */ jsx25(Button7, { variant: "secondary", size: "small", children: t("orders.returns.receive.action") })
|
|
2412
2459
|
}
|
|
2413
2460
|
)),
|
|
2414
|
-
showAllocateButton && /* @__PURE__ */
|
|
2461
|
+
showAllocateButton && /* @__PURE__ */ jsx25(
|
|
2415
2462
|
Button7,
|
|
2416
2463
|
{
|
|
2417
2464
|
asChild: true,
|
|
2418
2465
|
variant: "secondary",
|
|
2419
2466
|
size: "small",
|
|
2420
2467
|
"data-testid": "order-summary-allocate-items-cta",
|
|
2421
|
-
children: /* @__PURE__ */
|
|
2468
|
+
children: /* @__PURE__ */ jsx25(Link4, { to: "allocate-items", children: t("orders.allocateItems.action") })
|
|
2422
2469
|
}
|
|
2423
2470
|
),
|
|
2424
|
-
showRefund && /* @__PURE__ */
|
|
2471
|
+
showRefund && /* @__PURE__ */ jsx25(Button7, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx25(Link4, { to: `/orders/${order.id}/refund`, children: t("orders.payment.refundAmount", {
|
|
2425
2472
|
amount: getStylizedAmount(
|
|
2426
2473
|
pendingDifference * -1,
|
|
2427
2474
|
order?.currency_code
|
|
2428
2475
|
)
|
|
2429
2476
|
}) }) })
|
|
2430
2477
|
] }),
|
|
2431
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ jsx25(OutstandingActions, { order })
|
|
2432
2479
|
] });
|
|
2433
2480
|
};
|
|
2434
2481
|
var Header3 = ({
|
|
2435
2482
|
order,
|
|
2436
2483
|
orderPreview
|
|
2437
2484
|
}) => {
|
|
2438
|
-
const { t } =
|
|
2485
|
+
const { t } = useTranslation24();
|
|
2439
2486
|
const isCanceled = !!order.canceled_at;
|
|
2440
2487
|
const returnOutOfPolicy = isOutsidePolicyWindow(order, RETURN_POLICY_DAYS);
|
|
2441
2488
|
const exchangeOutOfPolicy = isOutsidePolicyWindow(
|
|
@@ -2453,9 +2500,9 @@ var Header3 = ({
|
|
|
2453
2500
|
const returnDisabledByChange = isOrderEditActive || !!orderChange?.exchange_id || !!orderChange?.claim_id;
|
|
2454
2501
|
const exchangeDisabledByChange = isOrderEditActive || !!orderChange?.return_id && !orderChange?.exchange_id || !!orderChange?.claim_id;
|
|
2455
2502
|
const claimDisabledByChange = isOrderEditActive || !!orderChange?.return_id && !orderChange?.claim_id || !!orderChange?.exchange_id;
|
|
2456
|
-
return /* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2503
|
+
return /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2504
|
+
/* @__PURE__ */ jsx25(Heading11, { level: "h2", children: t("fields.summary") }),
|
|
2505
|
+
/* @__PURE__ */ jsx25(
|
|
2459
2506
|
ActionMenu,
|
|
2460
2507
|
{
|
|
2461
2508
|
groups: [
|
|
@@ -2467,7 +2514,7 @@ var Header3 = ({
|
|
|
2467
2514
|
),
|
|
2468
2515
|
to: "edit",
|
|
2469
2516
|
disabled: editDisabled,
|
|
2470
|
-
icon: /* @__PURE__ */
|
|
2517
|
+
icon: /* @__PURE__ */ jsx25(PencilSquare, {})
|
|
2471
2518
|
}
|
|
2472
2519
|
]
|
|
2473
2520
|
},
|
|
@@ -2480,7 +2527,7 @@ var Header3 = ({
|
|
|
2480
2527
|
disabledTooltip: returnOutOfPolicy ? t("orders.returns.outOfPolicy", {
|
|
2481
2528
|
days: RETURN_POLICY_DAYS
|
|
2482
2529
|
}) : void 0,
|
|
2483
|
-
icon: /* @__PURE__ */
|
|
2530
|
+
icon: /* @__PURE__ */ jsx25(ArrowUturnLeft3, {})
|
|
2484
2531
|
},
|
|
2485
2532
|
{
|
|
2486
2533
|
label: orderChange?.id && orderChange?.exchange_id ? t("orders.exchanges.manage") : t("orders.exchanges.create"),
|
|
@@ -2489,7 +2536,7 @@ var Header3 = ({
|
|
|
2489
2536
|
disabledTooltip: exchangeOutOfPolicy ? t("orders.exchanges.outOfPolicy", {
|
|
2490
2537
|
days: EXCHANGE_POLICY_DAYS
|
|
2491
2538
|
}) : void 0,
|
|
2492
|
-
icon: /* @__PURE__ */
|
|
2539
|
+
icon: /* @__PURE__ */ jsx25(ArrowPath2, {})
|
|
2493
2540
|
},
|
|
2494
2541
|
{
|
|
2495
2542
|
label: orderChange?.id && orderChange?.claim_id ? t("orders.claims.manage") : t("orders.claims.create"),
|
|
@@ -2498,7 +2545,7 @@ var Header3 = ({
|
|
|
2498
2545
|
disabledTooltip: claimOutOfPolicy ? t("orders.claims.outOfPolicy", {
|
|
2499
2546
|
days: CLAIM_POLICY_DAYS
|
|
2500
2547
|
}) : void 0,
|
|
2501
|
-
icon: /* @__PURE__ */
|
|
2548
|
+
icon: /* @__PURE__ */ jsx25(ExclamationCircle2, {})
|
|
2502
2549
|
}
|
|
2503
2550
|
]
|
|
2504
2551
|
}
|
|
@@ -2513,7 +2560,7 @@ var Item = ({
|
|
|
2513
2560
|
returns,
|
|
2514
2561
|
reservation
|
|
2515
2562
|
}) => {
|
|
2516
|
-
const { t } =
|
|
2563
|
+
const { t } = useTranslation24();
|
|
2517
2564
|
const original_price = item.variant?.prices?.find((price2) => price2.currency_code === currencyCode)?.amount || 0;
|
|
2518
2565
|
const price = item.unit_price;
|
|
2519
2566
|
const offerInventoryLinks = item.offer?.inventory_item_link ?? [];
|
|
@@ -2521,17 +2568,17 @@ var Item = ({
|
|
|
2521
2568
|
const hasUnfulfilledItems = item.quantity - (item.detail?.fulfilled_quantity ?? 0) > 0;
|
|
2522
2569
|
const offerSku = item.offer?.sku ?? null;
|
|
2523
2570
|
const captionSku = offerSku ?? item.variant_sku ?? null;
|
|
2524
|
-
return /* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
2572
|
+
/* @__PURE__ */ jsxs26(
|
|
2526
2573
|
"div",
|
|
2527
2574
|
{
|
|
2528
2575
|
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-x-4 px-6 py-4",
|
|
2529
2576
|
children: [
|
|
2530
|
-
/* @__PURE__ */
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2533
|
-
/* @__PURE__ */
|
|
2534
|
-
|
|
2577
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-start gap-x-4", children: [
|
|
2578
|
+
/* @__PURE__ */ jsx25(Thumbnail, { src: item.thumbnail }),
|
|
2579
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
2580
|
+
/* @__PURE__ */ jsx25(
|
|
2581
|
+
Text22,
|
|
2535
2582
|
{
|
|
2536
2583
|
size: "small",
|
|
2537
2584
|
leading: "compact",
|
|
@@ -2540,24 +2587,24 @@ var Item = ({
|
|
|
2540
2587
|
children: item.title || item.product_title
|
|
2541
2588
|
}
|
|
2542
2589
|
),
|
|
2543
|
-
captionSku && /* @__PURE__ */
|
|
2544
|
-
/* @__PURE__ */
|
|
2545
|
-
/* @__PURE__ */
|
|
2590
|
+
captionSku && /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-x-1", children: [
|
|
2591
|
+
/* @__PURE__ */ jsx25(Text22, { size: "small", children: captionSku }),
|
|
2592
|
+
/* @__PURE__ */ jsx25(Copy5, { content: captionSku, className: "text-ui-fg-muted" })
|
|
2546
2593
|
] }),
|
|
2547
|
-
/* @__PURE__ */
|
|
2594
|
+
/* @__PURE__ */ jsx25(Text22, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
2548
2595
|
] })
|
|
2549
2596
|
] }),
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
original_price !== price && /* @__PURE__ */
|
|
2597
|
+
/* @__PURE__ */ jsxs26("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
2598
|
+
/* @__PURE__ */ jsx25("div", { className: "flex items-center justify-end gap-x-4", children: /* @__PURE__ */ jsxs26(Text22, { size: "small", children: [
|
|
2599
|
+
original_price !== price && /* @__PURE__ */ jsx25("span", { className: "line-through text-ui-fg-muted text-xs mr-1", children: getLocaleAmount(original_price, currencyCode) }),
|
|
2553
2600
|
getLocaleAmount(price, currencyCode)
|
|
2554
2601
|
] }) }),
|
|
2555
|
-
/* @__PURE__ */
|
|
2556
|
-
/* @__PURE__ */
|
|
2557
|
-
/* @__PURE__ */
|
|
2602
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-x-2", children: [
|
|
2603
|
+
/* @__PURE__ */ jsx25("div", { className: "w-fit min-w-[27px]", children: /* @__PURE__ */ jsxs26(Text22, { size: "small", children: [
|
|
2604
|
+
/* @__PURE__ */ jsx25("span", { className: "tabular-nums", children: item.quantity }),
|
|
2558
2605
|
"x"
|
|
2559
2606
|
] }) }),
|
|
2560
|
-
/* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ jsx25("div", { className: "overflow-visible", children: isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx25(
|
|
2561
2608
|
StatusBadge4,
|
|
2562
2609
|
{
|
|
2563
2610
|
color: reservation ? "green" : "orange",
|
|
@@ -2566,13 +2613,13 @@ var Item = ({
|
|
|
2566
2613
|
}
|
|
2567
2614
|
) })
|
|
2568
2615
|
] }),
|
|
2569
|
-
/* @__PURE__ */
|
|
2616
|
+
/* @__PURE__ */ jsx25("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx25(Text22, { size: "small", className: "pt-[1px]", children: getLocaleAmount(item.original_total || 0, currencyCode) }) })
|
|
2570
2617
|
] })
|
|
2571
2618
|
]
|
|
2572
2619
|
},
|
|
2573
2620
|
item.id
|
|
2574
2621
|
),
|
|
2575
|
-
returns.map((r) => /* @__PURE__ */
|
|
2622
|
+
returns.map((r) => /* @__PURE__ */ jsx25(ReturnBreakdown, { orderReturn: r, itemId: item.id }, r.id))
|
|
2576
2623
|
] });
|
|
2577
2624
|
};
|
|
2578
2625
|
var ItemBreakdown = ({
|
|
@@ -2583,16 +2630,16 @@ var ItemBreakdown = ({
|
|
|
2583
2630
|
order_id: order.id,
|
|
2584
2631
|
fields: "*items,*items.reason"
|
|
2585
2632
|
});
|
|
2586
|
-
const returns =
|
|
2633
|
+
const returns = useMemo5(
|
|
2587
2634
|
() => returnsList.filter((r) => !r.canceled_at),
|
|
2588
2635
|
[returnsList]
|
|
2589
2636
|
);
|
|
2590
|
-
const reservationsMap =
|
|
2637
|
+
const reservationsMap = useMemo5(
|
|
2591
2638
|
() => new Map(reservations.map((r) => [r.line_item_id, r])),
|
|
2592
2639
|
[reservations]
|
|
2593
2640
|
);
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
return /* @__PURE__ */
|
|
2641
|
+
return /* @__PURE__ */ jsx25("div", { children: order.items?.map((item) => {
|
|
2642
|
+
return /* @__PURE__ */ jsx25(
|
|
2596
2643
|
Item,
|
|
2597
2644
|
{
|
|
2598
2645
|
item,
|
|
@@ -2608,24 +2655,24 @@ var ReturnBreakdownWithDamages = ({
|
|
|
2608
2655
|
orderReturn,
|
|
2609
2656
|
itemId
|
|
2610
2657
|
}) => {
|
|
2611
|
-
const { t } =
|
|
2658
|
+
const { t } = useTranslation24();
|
|
2612
2659
|
const item = orderReturn.items?.find((ri) => ri.item_id === itemId);
|
|
2613
2660
|
const damagedQuantity = item?.damaged_quantity || 0;
|
|
2614
2661
|
if (!item || damagedQuantity <= 0) {
|
|
2615
2662
|
return null;
|
|
2616
2663
|
}
|
|
2617
|
-
return /* @__PURE__ */
|
|
2664
|
+
return /* @__PURE__ */ jsxs26(
|
|
2618
2665
|
"div",
|
|
2619
2666
|
{
|
|
2620
2667
|
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4",
|
|
2621
2668
|
children: [
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */
|
|
2669
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2", children: [
|
|
2670
|
+
/* @__PURE__ */ jsx25(ArrowDownRightMini, { className: "text-ui-fg-muted" }),
|
|
2671
|
+
/* @__PURE__ */ jsx25(Text22, { size: "small", children: t("orders.returns.damagedItemsReturned", {
|
|
2625
2672
|
quantity: damagedQuantity
|
|
2626
2673
|
}) }),
|
|
2627
|
-
item.note && /* @__PURE__ */
|
|
2628
|
-
item.reason && /* @__PURE__ */
|
|
2674
|
+
item.note && /* @__PURE__ */ jsx25(Tooltip5, { content: item.note, children: /* @__PURE__ */ jsx25(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
2675
|
+
item.reason && /* @__PURE__ */ jsx25(
|
|
2629
2676
|
Badge4,
|
|
2630
2677
|
{
|
|
2631
2678
|
size: "2xsmall",
|
|
@@ -2635,9 +2682,9 @@ var ReturnBreakdownWithDamages = ({
|
|
|
2635
2682
|
}
|
|
2636
2683
|
)
|
|
2637
2684
|
] }),
|
|
2638
|
-
/* @__PURE__ */
|
|
2685
|
+
/* @__PURE__ */ jsxs26(Text22, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
2639
2686
|
t("orders.returns.damagedItemReceived"),
|
|
2640
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx25("span", { className: "ml-2", children: /* @__PURE__ */ jsx25(return_info_popover_default, { orderReturn }) })
|
|
2641
2688
|
] })
|
|
2642
2689
|
]
|
|
2643
2690
|
},
|
|
@@ -2648,7 +2695,7 @@ var ReturnBreakdown = ({
|
|
|
2648
2695
|
orderReturn,
|
|
2649
2696
|
itemId
|
|
2650
2697
|
}) => {
|
|
2651
|
-
const { t } =
|
|
2698
|
+
const { t } = useTranslation24();
|
|
2652
2699
|
const { getRelativeDate } = useDate();
|
|
2653
2700
|
if (!["requested", "received", "partially_received"].includes(
|
|
2654
2701
|
orderReturn.status || ""
|
|
@@ -2661,29 +2708,29 @@ var ReturnBreakdown = ({
|
|
|
2661
2708
|
return null;
|
|
2662
2709
|
}
|
|
2663
2710
|
const damagedQuantity = item.damaged_quantity || 0;
|
|
2664
|
-
return /* @__PURE__ */
|
|
2665
|
-
damagedQuantity > 0 && /* @__PURE__ */
|
|
2711
|
+
return /* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
2712
|
+
damagedQuantity > 0 && /* @__PURE__ */ jsx25(
|
|
2666
2713
|
ReturnBreakdownWithDamages,
|
|
2667
2714
|
{
|
|
2668
2715
|
orderReturn,
|
|
2669
2716
|
itemId
|
|
2670
2717
|
}
|
|
2671
2718
|
),
|
|
2672
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsxs26(
|
|
2673
2720
|
"div",
|
|
2674
2721
|
{
|
|
2675
2722
|
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4",
|
|
2676
2723
|
children: [
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2", children: [
|
|
2725
|
+
/* @__PURE__ */ jsx25(ArrowDownRightMini, { className: "text-ui-fg-muted" }),
|
|
2726
|
+
/* @__PURE__ */ jsx25(Text22, { size: "small", children: t(
|
|
2680
2727
|
`orders.returns.${isRequested ? "returnRequestedInfo" : "returnReceivedInfo"}`,
|
|
2681
2728
|
{
|
|
2682
2729
|
requestedItemsCount: isRequested ? item.quantity : item.received_quantity
|
|
2683
2730
|
}
|
|
2684
2731
|
) }),
|
|
2685
|
-
item.note && /* @__PURE__ */
|
|
2686
|
-
item.reason && /* @__PURE__ */
|
|
2732
|
+
item.note && /* @__PURE__ */ jsx25(Tooltip5, { content: item.note, children: /* @__PURE__ */ jsx25(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
2733
|
+
item.reason && /* @__PURE__ */ jsx25(
|
|
2687
2734
|
Badge4,
|
|
2688
2735
|
{
|
|
2689
2736
|
size: "2xsmall",
|
|
@@ -2693,12 +2740,12 @@ var ReturnBreakdown = ({
|
|
|
2693
2740
|
}
|
|
2694
2741
|
)
|
|
2695
2742
|
] }),
|
|
2696
|
-
isRequested ? /* @__PURE__ */
|
|
2743
|
+
isRequested ? /* @__PURE__ */ jsxs26(Text22, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
2697
2744
|
getRelativeDate(orderReturn.created_at),
|
|
2698
|
-
/* @__PURE__ */
|
|
2699
|
-
] }) : /* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ jsx25("span", { className: "ml-2", children: /* @__PURE__ */ jsx25(return_info_popover_default, { orderReturn }) })
|
|
2746
|
+
] }) : /* @__PURE__ */ jsxs26(Text22, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
2700
2747
|
t("orders.returns.itemReceived"),
|
|
2701
|
-
/* @__PURE__ */
|
|
2748
|
+
/* @__PURE__ */ jsx25("span", { className: "ml-2", children: /* @__PURE__ */ jsx25(return_info_popover_default, { orderReturn }) })
|
|
2702
2749
|
] })
|
|
2703
2750
|
]
|
|
2704
2751
|
},
|
|
@@ -2711,29 +2758,22 @@ var Cost = ({
|
|
|
2711
2758
|
value,
|
|
2712
2759
|
secondaryValue,
|
|
2713
2760
|
tooltip
|
|
2714
|
-
}) => /* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2761
|
+
}) => /* @__PURE__ */ jsxs26("div", { className: "grid grid-cols-3 items-center", children: [
|
|
2762
|
+
/* @__PURE__ */ jsxs26(Text22, { size: "small", leading: "compact", children: [
|
|
2716
2763
|
label,
|
|
2717
2764
|
" ",
|
|
2718
2765
|
tooltip
|
|
2719
2766
|
] }),
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ jsx25("div", { className: "text-right", children: /* @__PURE__ */ jsx25(Text22, { size: "small", leading: "compact", children: secondaryValue }) }),
|
|
2768
|
+
/* @__PURE__ */ jsx25("div", { className: "text-right", children: /* @__PURE__ */ jsx25(Text22, { size: "small", leading: "compact", children: value }) })
|
|
2722
2769
|
] });
|
|
2723
2770
|
var CostBreakdown = ({
|
|
2724
2771
|
order
|
|
2725
2772
|
}) => {
|
|
2726
|
-
const { t } =
|
|
2773
|
+
const { t } = useTranslation24();
|
|
2727
2774
|
const [isTaxOpen, setIsTaxOpen] = useState5(false);
|
|
2728
2775
|
const [isShippingOpen, setIsShippingOpen] = useState5(false);
|
|
2729
|
-
const
|
|
2730
|
-
return order.items.reduce((acc, item) => {
|
|
2731
|
-
const lines = item.commission_lines;
|
|
2732
|
-
if (!lines) return acc;
|
|
2733
|
-
return acc + lines.reduce((sum, line) => sum + (line.amount ?? 0), 0);
|
|
2734
|
-
}, 0);
|
|
2735
|
-
}, [order.items]);
|
|
2736
|
-
const discountCodes = useMemo4(() => {
|
|
2776
|
+
const discountCodes = useMemo5(() => {
|
|
2737
2777
|
const codes = /* @__PURE__ */ new Set();
|
|
2738
2778
|
order.items.forEach(
|
|
2739
2779
|
(item) => item.adjustments?.forEach((adj) => {
|
|
@@ -2742,7 +2782,7 @@ var CostBreakdown = ({
|
|
|
2742
2782
|
);
|
|
2743
2783
|
return Array.from(codes).sort();
|
|
2744
2784
|
}, [order]);
|
|
2745
|
-
const taxCodes =
|
|
2785
|
+
const taxCodes = useMemo5(() => {
|
|
2746
2786
|
const taxCodeMap = {};
|
|
2747
2787
|
order.items.forEach((item) => {
|
|
2748
2788
|
item.tax_lines?.forEach((line) => {
|
|
@@ -2759,8 +2799,8 @@ var CostBreakdown = ({
|
|
|
2759
2799
|
const automaticTaxesOn = !!order.region?.automatic_taxes;
|
|
2760
2800
|
const hasTaxLines = !!Object.keys(taxCodes).length;
|
|
2761
2801
|
const discountTotal = automaticTaxesOn ? order.discount_total : order.discount_subtotal;
|
|
2762
|
-
return /* @__PURE__ */
|
|
2763
|
-
/* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ jsxs26("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
|
|
2803
|
+
/* @__PURE__ */ jsx25(
|
|
2764
2804
|
Cost,
|
|
2765
2805
|
{
|
|
2766
2806
|
label: t(
|
|
@@ -2769,21 +2809,21 @@ var CostBreakdown = ({
|
|
|
2769
2809
|
value: getLocaleAmount(order.item_total, order.currency_code)
|
|
2770
2810
|
}
|
|
2771
2811
|
),
|
|
2772
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ jsx25(
|
|
2773
2813
|
Cost,
|
|
2774
2814
|
{
|
|
2775
2815
|
label: (
|
|
2776
2816
|
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
2777
|
-
/* @__PURE__ */
|
|
2817
|
+
/* @__PURE__ */ jsxs26(
|
|
2778
2818
|
"span",
|
|
2779
2819
|
{
|
|
2780
2820
|
onClick: () => setIsShippingOpen((o) => !o),
|
|
2781
2821
|
className: "flex cursor-pointer items-center gap-1",
|
|
2782
2822
|
children: [
|
|
2783
|
-
/* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ jsx25("span", { children: t(
|
|
2784
2824
|
automaticTaxesOn ? "orders.summary.shippingTotal" : "orders.summary.shippingSubtotal"
|
|
2785
2825
|
) }),
|
|
2786
|
-
/* @__PURE__ */
|
|
2826
|
+
/* @__PURE__ */ jsx25(
|
|
2787
2827
|
TriangleDownMini,
|
|
2788
2828
|
{
|
|
2789
2829
|
style: {
|
|
@@ -2801,22 +2841,22 @@ var CostBreakdown = ({
|
|
|
2801
2841
|
)
|
|
2802
2842
|
}
|
|
2803
2843
|
),
|
|
2804
|
-
isShippingOpen && /* @__PURE__ */
|
|
2844
|
+
isShippingOpen && /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-1 pl-5", children: (order.shipping_methods || []).sort(
|
|
2805
2845
|
(m1, m2) => m1.created_at.localeCompare(m2.created_at)
|
|
2806
2846
|
).map((sm, i) => {
|
|
2807
|
-
return /* @__PURE__ */
|
|
2847
|
+
return /* @__PURE__ */ jsxs26(
|
|
2808
2848
|
"div",
|
|
2809
2849
|
{
|
|
2810
2850
|
className: "flex items-center justify-between gap-x-2",
|
|
2811
2851
|
children: [
|
|
2812
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsx25("div", { children: /* @__PURE__ */ jsxs26("span", { className: "txt-small text-ui-fg-subtle font-medium", children: [
|
|
2813
2853
|
sm.name,
|
|
2814
2854
|
sm.detail?.return_id && ` (${t("fields.returnShipping")})`,
|
|
2815
2855
|
" ",
|
|
2816
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ jsx25(shipping_info_popover_default, { shippingMethod: sm }, i)
|
|
2817
2857
|
] }) }),
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2858
|
+
/* @__PURE__ */ jsx25("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx25("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
2859
|
+
/* @__PURE__ */ jsx25("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
|
|
2820
2860
|
automaticTaxesOn ? sm.total : sm.subtotal,
|
|
2821
2861
|
order.currency_code
|
|
2822
2862
|
) })
|
|
@@ -2825,7 +2865,7 @@ var CostBreakdown = ({
|
|
|
2825
2865
|
sm.id
|
|
2826
2866
|
);
|
|
2827
2867
|
}) }),
|
|
2828
|
-
/* @__PURE__ */
|
|
2868
|
+
/* @__PURE__ */ jsx25(
|
|
2829
2869
|
Cost,
|
|
2830
2870
|
{
|
|
2831
2871
|
label: t(
|
|
@@ -2835,9 +2875,9 @@ var CostBreakdown = ({
|
|
|
2835
2875
|
value: discountTotal > 0 ? `- ${getLocaleAmount(discountTotal, order.currency_code)}` : "-"
|
|
2836
2876
|
}
|
|
2837
2877
|
),
|
|
2838
|
-
/* @__PURE__ */
|
|
2839
|
-
/* @__PURE__ */
|
|
2840
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsxs26(Fragment3, { children: [
|
|
2879
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex justify-between", children: [
|
|
2880
|
+
/* @__PURE__ */ jsxs26(
|
|
2841
2881
|
"div",
|
|
2842
2882
|
{
|
|
2843
2883
|
onClick: () => hasTaxLines && setIsTaxOpen((o) => !o),
|
|
@@ -2845,10 +2885,10 @@ var CostBreakdown = ({
|
|
|
2845
2885
|
"cursor-pointer": hasTaxLines
|
|
2846
2886
|
}),
|
|
2847
2887
|
children: [
|
|
2848
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ jsx25("span", { className: "txt-small select-none", children: t(
|
|
2849
2889
|
automaticTaxesOn ? "orders.summary.taxTotalIncl" : "orders.summary.taxTotal"
|
|
2850
2890
|
) }),
|
|
2851
|
-
hasTaxLines && /* @__PURE__ */
|
|
2891
|
+
hasTaxLines && /* @__PURE__ */ jsx25(
|
|
2852
2892
|
TriangleDownMini,
|
|
2853
2893
|
{
|
|
2854
2894
|
style: {
|
|
@@ -2859,40 +2899,33 @@ var CostBreakdown = ({
|
|
|
2859
2899
|
]
|
|
2860
2900
|
}
|
|
2861
2901
|
),
|
|
2862
|
-
/* @__PURE__ */
|
|
2902
|
+
/* @__PURE__ */ jsx25("div", { className: "text-right", children: /* @__PURE__ */ jsx25(Text22, { size: "small", leading: "compact", children: getLocaleAmount(order.tax_total, order.currency_code) }) })
|
|
2863
2903
|
] }),
|
|
2864
|
-
isTaxOpen && /* @__PURE__ */
|
|
2865
|
-
return /* @__PURE__ */
|
|
2904
|
+
isTaxOpen && /* @__PURE__ */ jsx25("div", { className: "flex flex-col gap-1 pl-5", children: Object.entries(taxCodes).map(([code, total]) => {
|
|
2905
|
+
return /* @__PURE__ */ jsxs26(
|
|
2866
2906
|
"div",
|
|
2867
2907
|
{
|
|
2868
2908
|
className: "flex items-center justify-between gap-x-2",
|
|
2869
2909
|
children: [
|
|
2870
|
-
/* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2872
|
-
/* @__PURE__ */
|
|
2910
|
+
/* @__PURE__ */ jsx25("div", { children: /* @__PURE__ */ jsx25("span", { className: "txt-small text-ui-fg-subtle font-medium", children: code }) }),
|
|
2911
|
+
/* @__PURE__ */ jsx25("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx25("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
2912
|
+
/* @__PURE__ */ jsx25("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
2873
2913
|
]
|
|
2874
2914
|
},
|
|
2875
2915
|
code
|
|
2876
2916
|
);
|
|
2877
2917
|
}) })
|
|
2878
|
-
] })
|
|
2879
|
-
commissionTotal > 0 && /* @__PURE__ */ jsx24(
|
|
2880
|
-
Cost,
|
|
2881
|
-
{
|
|
2882
|
-
label: t("fields.commission"),
|
|
2883
|
-
value: getLocaleAmount(commissionTotal, order.currency_code)
|
|
2884
|
-
}
|
|
2885
|
-
)
|
|
2918
|
+
] })
|
|
2886
2919
|
] });
|
|
2887
2920
|
};
|
|
2888
2921
|
var Total2 = ({ order }) => {
|
|
2889
|
-
const { t } =
|
|
2922
|
+
const { t } = useTranslation24();
|
|
2890
2923
|
const totalCaptured = getTotalCaptured(order.payment_collections || []);
|
|
2891
2924
|
const outstanding = Math.max(0, order.total - totalCaptured);
|
|
2892
|
-
return /* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
2894
|
-
/* @__PURE__ */
|
|
2895
|
-
|
|
2925
|
+
return /* @__PURE__ */ jsxs26("div", { className: " flex flex-col gap-y-2 px-6 py-4", children: [
|
|
2926
|
+
/* @__PURE__ */ jsxs26("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
2927
|
+
/* @__PURE__ */ jsx25(
|
|
2928
|
+
Text22,
|
|
2896
2929
|
{
|
|
2897
2930
|
weight: "plus",
|
|
2898
2931
|
className: "text-ui-fg-subtle",
|
|
@@ -2901,8 +2934,8 @@ var Total2 = ({ order }) => {
|
|
|
2901
2934
|
children: t("fields.total")
|
|
2902
2935
|
}
|
|
2903
2936
|
),
|
|
2904
|
-
/* @__PURE__ */
|
|
2905
|
-
|
|
2937
|
+
/* @__PURE__ */ jsx25(
|
|
2938
|
+
Text22,
|
|
2906
2939
|
{
|
|
2907
2940
|
weight: "plus",
|
|
2908
2941
|
className: "text-ui-fg-subtle",
|
|
@@ -2912,9 +2945,9 @@ var Total2 = ({ order }) => {
|
|
|
2912
2945
|
}
|
|
2913
2946
|
)
|
|
2914
2947
|
] }),
|
|
2915
|
-
/* @__PURE__ */
|
|
2916
|
-
/* @__PURE__ */
|
|
2917
|
-
|
|
2948
|
+
/* @__PURE__ */ jsxs26("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
2949
|
+
/* @__PURE__ */ jsx25(
|
|
2950
|
+
Text22,
|
|
2918
2951
|
{
|
|
2919
2952
|
weight: "plus",
|
|
2920
2953
|
className: "text-ui-fg-subtle",
|
|
@@ -2923,8 +2956,8 @@ var Total2 = ({ order }) => {
|
|
|
2923
2956
|
children: t("fields.paidTotal")
|
|
2924
2957
|
}
|
|
2925
2958
|
),
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
|
|
2959
|
+
/* @__PURE__ */ jsx25(
|
|
2960
|
+
Text22,
|
|
2928
2961
|
{
|
|
2929
2962
|
weight: "plus",
|
|
2930
2963
|
className: "text-ui-fg-subtle",
|
|
@@ -2934,32 +2967,27 @@ var Total2 = ({ order }) => {
|
|
|
2934
2967
|
}
|
|
2935
2968
|
)
|
|
2936
2969
|
] }),
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
2939
|
-
/* @__PURE__ */
|
|
2970
|
+
/* @__PURE__ */ jsxs26("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
2971
|
+
/* @__PURE__ */ jsx25(Text22, { weight: "plus", size: "small", leading: "compact", children: t("orders.payment.outstandingAmount") }),
|
|
2972
|
+
/* @__PURE__ */ jsx25(Text22, { weight: "plus", size: "small", leading: "compact", children: getStylizedAmount(outstanding, order.currency_code) })
|
|
2940
2973
|
] })
|
|
2941
2974
|
] });
|
|
2942
2975
|
};
|
|
2943
2976
|
var OutstandingActions = ({ order }) => {
|
|
2944
|
-
const { t } =
|
|
2977
|
+
const { t } = useTranslation24();
|
|
2945
2978
|
const unpaidCollection = order.payment_collections?.find(
|
|
2946
2979
|
(pc) => pc.status !== "captured" && pc.status !== "canceled"
|
|
2947
2980
|
);
|
|
2948
2981
|
const pendingDifference = order.summary?.pending_difference || 0;
|
|
2949
2982
|
const isOutstanding = pendingDifference > 5e-3 && order.status !== "canceled" && !!unpaidCollection;
|
|
2950
|
-
const markAsPaid = useMarkPaymentCollectionAsPaid(
|
|
2951
|
-
order.id,
|
|
2952
|
-
unpaidCollection?.id ?? ""
|
|
2953
|
-
);
|
|
2954
2983
|
if (!isOutstanding || !unpaidCollection) {
|
|
2955
2984
|
return null;
|
|
2956
2985
|
}
|
|
2957
2986
|
const paymentLink = unpaidCollection.payment_sessions?.[0]?.data?.url ?? null;
|
|
2987
|
+
if (!paymentLink) {
|
|
2988
|
+
return null;
|
|
2989
|
+
}
|
|
2958
2990
|
const handleCopyLink = async () => {
|
|
2959
|
-
if (!paymentLink) {
|
|
2960
|
-
toast7.error(t("orders.payment.copyLinkMissing"));
|
|
2961
|
-
return;
|
|
2962
|
-
}
|
|
2963
2991
|
try {
|
|
2964
2992
|
await navigator.clipboard.writeText(paymentLink);
|
|
2965
2993
|
toast7.success(t("orders.payment.copyLinkSuccess"));
|
|
@@ -2967,34 +2995,13 @@ var OutstandingActions = ({ order }) => {
|
|
|
2967
2995
|
toast7.error(t("orders.payment.copyLinkError"));
|
|
2968
2996
|
}
|
|
2969
2997
|
};
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
{
|
|
2974
|
-
onSuccess: () => toast7.success(t("orders.payment.markAsPaidSuccess")),
|
|
2975
|
-
onError: (e) => toast7.error(e.message)
|
|
2976
|
-
}
|
|
2977
|
-
);
|
|
2978
|
-
};
|
|
2979
|
-
return /* @__PURE__ */ jsxs25("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
2980
|
-
paymentLink && /* @__PURE__ */ jsx24(Button7, { size: "small", variant: "secondary", onClick: handleCopyLink, children: t("orders.payment.copyPaymentLink", {
|
|
2981
|
-
amount: getStylizedAmount(pendingDifference, order.currency_code)
|
|
2982
|
-
}) }),
|
|
2983
|
-
/* @__PURE__ */ jsx24(
|
|
2984
|
-
Button7,
|
|
2985
|
-
{
|
|
2986
|
-
size: "small",
|
|
2987
|
-
variant: "secondary",
|
|
2988
|
-
onClick: handleMarkAsPaid,
|
|
2989
|
-
isLoading: markAsPaid.isPending,
|
|
2990
|
-
children: t("orders.payment.markAsPaid")
|
|
2991
|
-
}
|
|
2992
|
-
)
|
|
2993
|
-
] });
|
|
2998
|
+
return /* @__PURE__ */ jsx25("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: /* @__PURE__ */ jsx25(Button7, { size: "small", variant: "secondary", onClick: handleCopyLink, children: t("orders.payment.copyPaymentLink", {
|
|
2999
|
+
amount: getStylizedAmount(pendingDifference, order.currency_code)
|
|
3000
|
+
}) }) });
|
|
2994
3001
|
};
|
|
2995
3002
|
|
|
2996
3003
|
// src/pages/orders/[id]/order-detail-page.tsx
|
|
2997
|
-
import { Fragment as Fragment4, jsx as
|
|
3004
|
+
import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2998
3005
|
var Root = ({ children }) => {
|
|
2999
3006
|
const initialData = useLoaderData();
|
|
3000
3007
|
const { id } = useParams();
|
|
@@ -3022,27 +3029,28 @@ var Root = ({ children }) => {
|
|
|
3022
3029
|
});
|
|
3023
3030
|
}
|
|
3024
3031
|
if (isLoading || !order || isPreviewLoading) {
|
|
3025
|
-
return /* @__PURE__ */
|
|
3032
|
+
return /* @__PURE__ */ jsx26(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 2, showJSON: true });
|
|
3026
3033
|
}
|
|
3027
3034
|
if (isError) {
|
|
3028
3035
|
throw error;
|
|
3029
3036
|
}
|
|
3030
|
-
return /* @__PURE__ */
|
|
3031
|
-
/* @__PURE__ */
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
orderPreview && /* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
3037
|
+
return /* @__PURE__ */ jsx26(Fragment4, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs27(TwoColumnPage, { data: order, hasOutlet: true, showMetadata: true, showJSON: true, children: [
|
|
3038
|
+
/* @__PURE__ */ jsxs27(TwoColumnPage.Main, { children: [
|
|
3039
|
+
/* @__PURE__ */ jsx26(OrderActiveEditSection, { order }),
|
|
3040
|
+
orderPreview && /* @__PURE__ */ jsxs27(Fragment4, { children: [
|
|
3041
|
+
/* @__PURE__ */ jsx26(ActiveOrderClaimSection, { orderPreview }),
|
|
3042
|
+
/* @__PURE__ */ jsx26(ActiveOrderExchangeSection, { orderPreview }),
|
|
3043
|
+
/* @__PURE__ */ jsx26(ActiveOrderReturnSection, { orderPreview })
|
|
3037
3044
|
] }),
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsx26(OrderGeneralSection, { order }),
|
|
3046
|
+
/* @__PURE__ */ jsx26(OrderSummarySection, { order }),
|
|
3047
|
+
/* @__PURE__ */ jsx26(OrderCommissionSection, { order }),
|
|
3048
|
+
/* @__PURE__ */ jsx26(OrderPaymentSection, { order }),
|
|
3049
|
+
/* @__PURE__ */ jsx26(OrderFulfillmentSection, { order })
|
|
3042
3050
|
] }),
|
|
3043
|
-
/* @__PURE__ */
|
|
3044
|
-
/* @__PURE__ */
|
|
3045
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ jsxs27(TwoColumnPage.Sidebar, { children: [
|
|
3052
|
+
/* @__PURE__ */ jsx26(OrderCustomerSection, { order }),
|
|
3053
|
+
/* @__PURE__ */ jsx26(OrderActivitySection, { order })
|
|
3046
3054
|
] })
|
|
3047
3055
|
] }) });
|
|
3048
3056
|
};
|