@mercurjs/vendor 2.2.0-canary.8 → 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]-GMJAPZPU.js → [id]-3LNKC5OJ.js} +41 -40
- package/dist/[id]-4HO4S2PX.js +3074 -0
- package/dist/{[id]-QWL6SUOB.js → [id]-4LIIFGET.js} +14 -14
- package/dist/{[id]-5ADOHZ45.js → [id]-5EECCIRP.js} +151 -58
- package/dist/{[id]-K2CT7BXQ.js → [id]-5P5LTATX.js} +3 -3
- package/dist/{[id]-T7USGHIY.js → [id]-AQUUZFRX.js} +11 -11
- package/dist/{[id]-BTGQJ3UD.js → [id]-CUBGVODE.js} +177 -85
- package/dist/{[id]-ZAQYATGN.js → [id]-DCGPICT3.js} +39 -38
- package/dist/{[id]-IWCWVNVI.js → [id]-DT5YJVKG.js} +32 -32
- package/dist/{[id]-L6FD7BRE.js → [id]-IEBZ6V3W.js} +51 -48
- package/dist/{[id]-ZCMSBEVM.js → [id]-N7JEZFXQ.js} +6 -6
- package/dist/[id]-U6FKX5UQ.js +975 -0
- package/dist/{[id]-BPAZLOLW.js → [id]-XB45DY2D.js} +19 -19
- package/dist/[id]-XP5KEMNX.js +602 -0
- package/dist/{[location_id]-NUBXDDJC.js → [location_id]-I4HHUHWY.js} +14 -14
- package/dist/{[province_id]-5KZGMQER.js → [province_id]-OYX4MOCF.js} +31 -31
- package/dist/{add-KMHJ6OC6.js → add-3T4GBFMM.js} +63 -57
- package/dist/{add-Y6GMGLYX.js → add-RPRJWCYU.js} +99 -34
- package/dist/{add-customer-groups-NXSWICFI.js → add-customer-groups-FB5T6PQN.js} +44 -42
- package/dist/{add-products-LXYF57BK.js → add-products-F243SWGD.js} +40 -40
- package/dist/{add-promotions-VTYAEDCN.js → add-promotions-TJDK7HLW.js} +18 -18
- package/dist/{add-to-campaign-DLP7PSQB.js → add-to-campaign-Q6OAJMUJ.js} +6 -6
- package/dist/{address-JFXH3M7D.js → address-XVBSNMFU.js} +24 -24
- package/dist/{adjust-inventory-V2V7NWWH.js → adjust-inventory-IZLRMQXV.js} +4 -4
- package/dist/allocate-items-Q3VALDYT.js +685 -0
- package/dist/{areas-FB63OQAI.js → areas-IYGBRCRH.js} +14 -14
- 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-S4V7MJUM.js → breadcrumb-BXD3SRM7.js} +3 -3
- package/dist/{breadcrumb-HV67K43U.js → breadcrumb-FEYGZFJU.js} +4 -4
- package/dist/{breadcrumb-EG3ANCVO.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-7R6E6G2X.js → breadcrumb-XEZCMI55.js} +2 -2
- package/dist/{breadcrumb-FES7EKUR.js → breadcrumb-XGXKCDYS.js} +4 -4
- package/dist/{breadcrumb-Y5UW3I4C.js → breadcrumb-YOY6Z36F.js} +2 -2
- package/dist/{campaigns-JAQTSA4Z.js → campaigns-DZKRNCA4.js} +9 -9
- package/dist/{categories-6TVMTN62.js → categories-JZJA2IBQ.js} +13 -11
- package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
- package/dist/{chunk-U5XDKYZG.js → chunk-2KA4TGBQ.js} +3 -3
- package/dist/{chunk-6RH3VDF7.js → chunk-2NPD4S55.js} +4 -4
- package/dist/{chunk-M6GKMFTC.js → chunk-3ALBZK4M.js} +1 -1
- package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
- package/dist/{chunk-X4INVIWL.js → chunk-3C2T27YW.js} +3 -3
- package/dist/{chunk-QXLRABYH.js → chunk-3I6ZAMGN.js} +1 -1
- package/dist/{chunk-THMXGEZU.js → chunk-3SH24DGG.js} +2 -2
- package/dist/chunk-3TST3EWQ.js +438 -0
- package/dist/chunk-42R54Z2X.js +8 -0
- package/dist/{chunk-UDJ2I5A2.js → chunk-4IRQSBA7.js} +5 -6
- package/dist/chunk-5ALC4Z2H.js +23 -0
- package/dist/chunk-5BQO3YQP.js +62 -0
- package/dist/{chunk-QGGMG3OU.js → chunk-5BYYDBLS.js} +7 -7
- package/dist/{chunk-4LVP635F.js → chunk-5FBQOAXU.js} +135 -126
- package/dist/{chunk-2BCAQ4BB.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-LJO34DKJ.js → chunk-6FDPVW7Y.js} +35 -21
- package/dist/{chunk-3X3LUKDM.js → chunk-6Q3J6ZMM.js} +5 -5
- package/dist/chunk-7BFQKYCJ.js +127 -0
- package/dist/chunk-7EXKHL5L.js +30 -0
- package/dist/{chunk-M6N4ISXL.js → chunk-7MARNXFG.js} +1 -1
- package/dist/{chunk-WHSE47DM.js → chunk-AOLE7MBM.js} +1 -1
- package/dist/{chunk-YIZK67RW.js → chunk-BQHVM46E.js} +29 -49
- package/dist/chunk-CRYZK4NU.js +185 -0
- package/dist/{chunk-JYPPXAJG.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-L7QKFC5N.js → chunk-E6W57UP3.js} +32 -122
- 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-JMRWREVE.js → chunk-FDKFUIYV.js} +23 -36
- package/dist/chunk-FWPGOIFA.js +22 -0
- package/dist/{chunk-B234IELY.js → chunk-G6YNCIVF.js} +24 -41
- 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-WLT7K7K7.js → chunk-HDEOZN2Q.js} +21 -24
- package/dist/{chunk-FDR22JMM.js → chunk-HFRHHT36.js} +8 -63
- package/dist/{chunk-GNDFMMC6.js → chunk-IEVN722X.js} +1 -1
- package/dist/{chunk-DARJTN4I.js → chunk-IMJ62GAP.js} +10 -5
- package/dist/{chunk-SGR4DMCW.js → chunk-INYLPVCG.js} +3 -3
- package/dist/{chunk-5T6UWTRU.js → chunk-IV57G2CB.js} +19 -11
- package/dist/chunk-J6XCRFBW.js +30 -0
- package/dist/{chunk-BLRZB63H.js → chunk-JDNXS37G.js} +61 -62
- package/dist/{chunk-3B34B2M2.js → chunk-JJP6AKMV.js} +1 -1
- package/dist/{chunk-XEU5ZLSB.js → chunk-JK4M3ZKY.js} +5 -5
- package/dist/{chunk-VXMOPVRH.js → chunk-JR7AABT5.js} +2 -2
- package/dist/{chunk-PBD36EZJ.js → chunk-JTHDMXZV.js} +5 -5
- package/dist/{chunk-Q75AC3DZ.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-VPKMBJ5B.js → chunk-KG2NUK4J.js} +6 -6
- package/dist/{chunk-VXWN37PT.js → chunk-KIURBTC4.js} +1 -1
- package/dist/{chunk-7LVNAFEI.js → chunk-KTJLJTFO.js} +547 -882
- package/dist/{chunk-FCJ7MLQK.js → chunk-KZQFIPY2.js} +264 -76
- package/dist/chunk-L57USMYC.js +39 -0
- package/dist/{chunk-4KNL46BT.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-QZJIDKQR.js → chunk-MT6WOKIW.js} +4 -4
- package/dist/chunk-MUGQQY6P.js +315 -0
- package/dist/{chunk-QT7YFHCA.js → chunk-MVEHWM7K.js} +13 -1
- package/dist/{chunk-VV6IKGCN.js → chunk-NTJ3BMOE.js} +1 -1
- package/dist/{chunk-JXQJQYGD.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-TODJFRLH.js → chunk-RILHLBKW.js} +3 -3
- package/dist/{chunk-PP754CO7.js → chunk-RPU4UOQK.js} +1 -1
- package/dist/{chunk-AVOZ7TX2.js → chunk-RTMMO6IU.js} +6 -6
- package/dist/chunk-S7NGDLZ3.js +173 -0
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/chunk-SPFLYPY6.js +6 -0
- package/dist/{chunk-EIUYXS7E.js → chunk-TJKZ5QCJ.js} +4 -4
- package/dist/{chunk-WCSQDWMS.js → chunk-TPGIMZLI.js} +1 -1
- package/dist/chunk-UM7ZR3VU.js +14 -0
- package/dist/{chunk-PGW3VYK4.js → chunk-UNE4VD5U.js} +3 -3
- package/dist/chunk-UX5UYDCY.js +33 -0
- package/dist/{chunk-IXAQNTE7.js → chunk-V5K6HISS.js} +2 -2
- package/dist/chunk-VCUUITW6.js +35 -0
- 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-PXI47JL5.js → chunk-WCXFUBEF.js} +13 -13
- package/dist/{chunk-AVOIZO63.js → chunk-WFE6CT6M.js} +77 -21
- package/dist/{chunk-E2L5EX5A.js → chunk-WFHGJGCW.js} +7 -6
- package/dist/{chunk-LQD232FW.js → chunk-WJ5EU3KW.js} +1 -1
- package/dist/{chunk-6YA3C4NB.js → chunk-XBKWFLJG.js} +4 -13
- package/dist/chunk-XQUF3WIS.js +159 -0
- package/dist/{chunk-SS46VQJA.js → chunk-Y4PM3IDZ.js} +1 -1
- package/dist/chunk-YBF45CX5.js +23 -0
- package/dist/{chunk-JQV7CXEC.js → chunk-YNGA3GRX.js} +17 -2
- package/dist/chunk-ZHFFTT3I.js +17 -0
- 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-JI22M76Z.js → configuration-FWZTMYXY.js} +5 -5
- package/dist/{create-OXR7WG5F.js → create-2RGNAVVY.js} +32 -32
- package/dist/{create-5QLYFVEK.js → create-32MXB6FD.js} +24 -24
- 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-POK6SJSZ.js → create-FHIFVCSG.js} +52 -49
- package/dist/{create-EATFT5AB.js → create-GO7APBBU.js} +31 -31
- package/dist/create-HEZYB7RF.js +1179 -0
- package/dist/{create-R7K3ECN6.js → create-K26SM34L.js} +3 -3
- package/dist/{create-6I43IPLO.js → create-N534JQPH.js} +14 -14
- package/dist/create-NEK6JCKR.js +1798 -0
- package/dist/{create-YBF4YGWG.js → create-NF2LPVXA.js} +3 -3
- package/dist/{create-F7IDSSTP.js → create-PJVLJ7T6.js} +50 -45
- package/dist/{create-CK4X357V.js → create-RPBHXU32.js} +28 -28
- package/dist/{create-SFU3W3ZH.js → create-U64NEOEL.js} +3 -3
- package/dist/create-VL7LDTVE.js +1931 -0
- package/dist/{create-XVHOCZHJ.js → create-X5SOAPD3.js} +3 -3
- package/dist/{create-2XZLOG5Z.js → create-XLYGW5PN.js} +69 -41
- package/dist/{create-GB3ZA4LH.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} +11 -11
- package/dist/{edit-TZ4EXLKJ.js → edit-3DUCWSLA.js} +62 -46
- package/dist/{edit-ORXS3A2Y.js → edit-3V34KJS2.js} +3 -3
- package/dist/{edit-RJ3EZ5CD.js → edit-4PWAJ7A3.js} +25 -25
- package/dist/{edit-ZQP4MNJU.js → edit-7CLOJ3UZ.js} +50 -47
- 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-UUP3BQV3.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-4OEBCCXJ.js → edit-SIKOSSHF.js} +24 -24
- package/dist/edit-TD7QFM4Z.js +871 -0
- package/dist/{edit-C4OCKQVU.js → edit-UNN3QTEJ.js} +3 -3
- package/dist/{edit-PFAJZUWI.js → edit-WEUFBORT.js} +33 -34
- package/dist/{edit-KAKVPHZZ.js → edit-WN2Q3TOX.js} +4 -4
- package/dist/{edit-QPPMI7MU.js → edit-ZGAOUZYP.js} +33 -34
- package/dist/{edit-522DG3BY.js → edit-ZOLSAIKF.js} +3 -3
- package/dist/{edit-2LGAEKH6.js → edit-ZORE6RUD.js} +25 -25
- package/dist/{edit-budget-L3CCEWNF.js → edit-budget-D22WMVYR.js} +3 -3
- package/dist/{edit-inventory-item-A7KAPATR.js → edit-inventory-item-QMYWEBZ3.js} +3 -3
- package/dist/{edit-inventory-item-attributes-RNBOJR66.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-6WDXCGAI.js → fulfillment-providers-CMU2JB5X.js} +40 -40
- package/dist/index.css +120 -24
- package/dist/index.js +355 -235
- package/dist/{offer-inventory-batch-page-4QNXDUWN.js → inventory-4JKLAZ2Q.js} +20 -20
- package/dist/{inventory-IOVM7GDU.js → inventory-FKEXULLT.js} +10 -10
- package/dist/{invite-HRKSQI4B.js → invite-3R2CEWLN.js} +23 -23
- package/dist/{invite-UBH7PYSH.js → invite-MNAX6EUC.js} +39 -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-TIYOCOZU.js → manage-locations-RWGDXXJQ.js} +3 -3
- package/dist/{media-EXWUWWNB.js → media-P6WSFHY4.js} +31 -30
- package/dist/media-YB4G5CMV.js +316 -0
- package/dist/{metadata-JIMHXPKE.js → metadata-5Q6FLVX4.js} +27 -27
- package/dist/{metadata-T6MLCEZ2.js → metadata-6OYHLPLA.js} +25 -25
- package/dist/{metadata-JCNPERR3.js → metadata-ADXGD4Y6.js} +25 -25
- package/dist/{metadata-ITS3VPE3.js → metadata-J447GEBP.js} +27 -27
- package/dist/{metadata-YOQEXEGO.js → metadata-VTQ2CGZX.js} +27 -27
- package/dist/{offer-create-page-6YTTQAXZ.js → offer-create-page-ACPKTNHA.js} +245 -266
- 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-GCRT6P6M.js → onboarding-TUGXFOA6.js} +23 -23
- package/dist/orders-PJSJNGZS.js +63 -0
- package/dist/{organization-5AFVFFZQ.js → organization-YIOAVFHN.js} +26 -26
- package/dist/{organize-QXDKGP2X.js → organize-BTA7NJD2.js} +4 -4
- package/dist/{organize-AZYAANZM.js → organize-OWT5QSJR.js} +4 -4
- package/dist/pages/index.d.ts +232 -232
- package/dist/pages/index.js +89 -87
- package/dist/{payment-details-ENUWDVGI.js → payment-details-K2XFATEL.js} +24 -24
- package/dist/{payouts-2QBQSNDR.js → payouts-K5IDTJV3.js} +11 -11
- package/dist/{price-lists-2WBNENE7.js → price-lists-DNPIPDAW.js} +13 -13
- package/dist/{offer-pricing-edit-page-WZNP3TWV.js → pricing-5VUPPNKS.js} +21 -19
- package/dist/{pricing-4Y73YJHP.js → pricing-J5FIDZIY.js} +32 -32
- package/dist/{product-tags-DE32PERU.js → product-tags-SJYIGXEV.js} +47 -44
- package/dist/{product-types-PKUEL7X5.js → product-types-4PTJW5DE.js} +10 -10
- package/dist/product-variant-detail-FO6J3RFA.js +371 -0
- package/dist/{product-variant-edit-ESLPI5ES.js → product-variant-edit-55TAIBZO.js} +45 -27
- package/dist/{products-WLGCX6Z7.js → products-EQMANSO6.js} +41 -40
- package/dist/products-XM57LXJK.js +92 -0
- package/dist/{professional-details-OCVQO2MV.js → professional-details-WWZPTXSX.js} +24 -24
- package/dist/{profile-2HW5NX6K.js → profile-5IADQ727.js} +30 -30
- package/dist/{promotions-FPV6QOEQ.js → promotions-BYW6TZ5B.js} +12 -12
- package/dist/receive-MTXKKPKZ.js +578 -0
- package/dist/refund-3IXGYA7W.js +268 -0
- package/dist/{register-PZOHGO7N.js → register-U5PQZATC.js} +25 -25
- package/dist/{reset-password-Q7BNWHHO.js → reset-password-SKUJJLSV.js} +3 -3
- package/dist/{return-reasons-J2WFZOQH.js → return-reasons-QDPSIJG3.js} +22 -19
- package/dist/{sales-channels-I3PR34U5.js → sales-channels-GBSTCWVP.js} +12 -13
- package/dist/{sales-channels-HPG2ND4W.js → sales-channels-N4NE3FXP.js} +14 -15
- package/dist/{settings-RZNYWACF.js → settings-ZUBBFS67.js} +54 -51
- package/dist/shipment-TKSCPC3M.js +241 -0
- package/dist/shipping-DODEUYOQ.js +125 -0
- package/dist/{shipping-profile-M3GGADFI.js → shipping-profile-O4JMJLN7.js} +5 -9
- package/dist/shipping-profiles-4TJ4IH6U.js +46 -0
- package/dist/{stock-3HVQ6FYP.js → stock-GYK2GHJN.js} +27 -27
- package/dist/{store-LDVMG7CV.js → store-XWOALZ5Q.js} +36 -36
- package/dist/{store-closure-EZ2YPOPL.js → store-closure-46B3XZ2I.js} +24 -24
- package/dist/{store-select-AM4AE7AL.js → store-select-E77E3ZY7.js} +24 -24
- package/dist/{tax-regions-HDLBFZVG.js → tax-regions-S2LFRTMP.js} +9 -9
- package/dist/{team-6NTDISM4.js → team-N2C5JPSU.js} +37 -37
- package/package.json +12 -12
- package/dist/[id]-MOOCGOWO.js +0 -480
- package/dist/[id]-UVQXCYXD.js +0 -1219
- package/dist/[id]-VUX4FUOO.js +0 -1557
- package/dist/allocate-items-OK5PVJGR.js +0 -533
- package/dist/attributes-TRAUBTCO.js +0 -278
- package/dist/breadcrumb-6FV7PWEN.js +0 -33
- package/dist/breadcrumb-EX4C3AZY.js +0 -47
- package/dist/breadcrumb-Q3XSG7B2.js +0 -46
- package/dist/chunk-27KRIXMQ.js +0 -71
- package/dist/chunk-432S4FGR.js +0 -0
- package/dist/chunk-BDZOSMAX.js +0 -23
- package/dist/chunk-CFRWIQIZ.js +0 -43
- package/dist/chunk-G7BL4L3L.js +0 -66
- package/dist/chunk-RXV7INUV.js +0 -426
- package/dist/chunk-T6LHVNWO.js +0 -27
- package/dist/collections-DS63FT2E.js +0 -68
- package/dist/create-HR4I33SE.js +0 -73
- package/dist/create-UFHLPXET.js +0 -215
- package/dist/edit-GQNIINRR.js +0 -192
- package/dist/fulfillment-OIIPL7B7.js +0 -559
- package/dist/loader-VDYPD3RI.js +0 -31
- package/dist/login-HON44E3S.js +0 -39
- package/dist/metadata-5BPOBBU2.js +0 -45
- package/dist/offer-detail-page-OMZN2NTA.js +0 -492
- package/dist/offer-edit-page-3MO566RP.js +0 -151
- package/dist/offers-GVN5LCK6.js +0 -32
- package/dist/orders-CHSS4ASB.js +0 -63
- package/dist/product-variant-detail-MWUBPCOP.js +0 -209
- package/dist/products-XOHAQHUJ.js +0 -91
- package/dist/shipment-KWUXQZWK.js +0 -176
- package/dist/shipping-profiles-L27STQ7K.js +0 -46
package/dist/[id]-UVQXCYXD.js
DELETED
|
@@ -1,1219 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_FIELDS
|
|
3
|
-
} from "./chunk-DARJTN4I.js";
|
|
4
|
-
import "./chunk-BCU3FKP2.js";
|
|
5
|
-
import {
|
|
6
|
-
formatProvider
|
|
7
|
-
} from "./chunk-VW56KWO2.js";
|
|
8
|
-
import {
|
|
9
|
-
getFormattedAddress,
|
|
10
|
-
isSameAddress
|
|
11
|
-
} from "./chunk-W6Y3PPU5.js";
|
|
12
|
-
import {
|
|
13
|
-
getCanceledOrderStatus,
|
|
14
|
-
getOrderFulfillmentStatus,
|
|
15
|
-
getOrderPaymentStatus
|
|
16
|
-
} from "./chunk-LQSLDDPT.js";
|
|
17
|
-
import {
|
|
18
|
-
getLocaleAmount,
|
|
19
|
-
getStylizedAmount,
|
|
20
|
-
isAmountLessThenRoundingError
|
|
21
|
-
} from "./chunk-PXYDR7WQ.js";
|
|
22
|
-
import "./chunk-JRTZWK77.js";
|
|
23
|
-
import "./chunk-IQPN4PZJ.js";
|
|
24
|
-
import {
|
|
25
|
-
TwoColumnPage
|
|
26
|
-
} from "./chunk-YV6MK4PZ.js";
|
|
27
|
-
import {
|
|
28
|
-
useDate
|
|
29
|
-
} from "./chunk-LRD242C7.js";
|
|
30
|
-
import "./chunk-QHQWEERJ.js";
|
|
31
|
-
import {
|
|
32
|
-
Thumbnail
|
|
33
|
-
} from "./chunk-WIYFXWRI.js";
|
|
34
|
-
import {
|
|
35
|
-
Skeleton,
|
|
36
|
-
TwoColumnPageSkeleton
|
|
37
|
-
} from "./chunk-INNFZYX2.js";
|
|
38
|
-
import {
|
|
39
|
-
useStockLocation
|
|
40
|
-
} from "./chunk-NBPMNUKZ.js";
|
|
41
|
-
import {
|
|
42
|
-
ordersQueryKeys,
|
|
43
|
-
useCancelOrder,
|
|
44
|
-
useCancelOrderFulfillment,
|
|
45
|
-
useCompleteOrder,
|
|
46
|
-
useMarkOrderFulfillmentAsDelivered,
|
|
47
|
-
useOrder
|
|
48
|
-
} from "./chunk-LJO34DKJ.js";
|
|
49
|
-
import {
|
|
50
|
-
ActionMenu
|
|
51
|
-
} from "./chunk-BDGZ4EQO.js";
|
|
52
|
-
import "./chunk-LAVHRER2.js";
|
|
53
|
-
import "./chunk-Y7QKP6QU.js";
|
|
54
|
-
import "./chunk-B234IELY.js";
|
|
55
|
-
import "./chunk-A5DJIOHN.js";
|
|
56
|
-
import {
|
|
57
|
-
queryClient
|
|
58
|
-
} from "./chunk-RHKRREUU.js";
|
|
59
|
-
import "./chunk-ZA2KFUFR.js";
|
|
60
|
-
import {
|
|
61
|
-
fetchQuery
|
|
62
|
-
} from "./chunk-RIN4CBRB.js";
|
|
63
|
-
import "./chunk-NBMM2TZK.js";
|
|
64
|
-
|
|
65
|
-
// src/pages/orders/[id]/loader.tsx
|
|
66
|
-
var orderDetailQuery = (id) => ({
|
|
67
|
-
queryKey: ordersQueryKeys.detail(id),
|
|
68
|
-
queryFn: async () => fetchQuery(`/vendor/orders/${id}`, {
|
|
69
|
-
method: "GET",
|
|
70
|
-
query: { fields: DEFAULT_FIELDS }
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
var loader = async ({ params }) => {
|
|
74
|
-
const id = params.id;
|
|
75
|
-
const query = orderDetailQuery(id);
|
|
76
|
-
return queryClient.ensureQueryData(query);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// src/pages/orders/[id]/order-detail-page.tsx
|
|
80
|
-
import { Children } from "react";
|
|
81
|
-
import { useLoaderData, useParams } from "react-router-dom";
|
|
82
|
-
|
|
83
|
-
// src/pages/orders/[id]/_components/order-customer-section/order-customer-section.tsx
|
|
84
|
-
import { Container, Heading } from "@medusajs/ui";
|
|
85
|
-
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
86
|
-
|
|
87
|
-
// src/components/common/customer-info/customer-info.tsx
|
|
88
|
-
import { Avatar, Copy, Text } from "@medusajs/ui";
|
|
89
|
-
import { useTranslation } from "react-i18next";
|
|
90
|
-
import { Link } from "react-router-dom";
|
|
91
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
92
|
-
var ID = ({ data }) => {
|
|
93
|
-
const { t } = useTranslation();
|
|
94
|
-
const id = data.customer_id;
|
|
95
|
-
const name = getOrderCustomer(data);
|
|
96
|
-
const email = data.email;
|
|
97
|
-
const fallback = (name || email || "").charAt(0).toUpperCase();
|
|
98
|
-
return /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
99
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.id") }),
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
101
|
-
Link,
|
|
102
|
-
{
|
|
103
|
-
to: `/customers/${id}`,
|
|
104
|
-
className: "focus:shadow-borders-focus rounded-[4px] outline-none transition-shadow",
|
|
105
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2 overflow-hidden", children: [
|
|
106
|
-
/* @__PURE__ */ jsx(Avatar, { size: "2xsmall", fallback }),
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
108
|
-
Text,
|
|
109
|
-
{
|
|
110
|
-
size: "small",
|
|
111
|
-
leading: "compact",
|
|
112
|
-
className: "text-ui-fg-subtle hover:text-ui-fg-base transition-fg truncate",
|
|
113
|
-
children: name || email
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
] })
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
] });
|
|
120
|
-
};
|
|
121
|
-
var Company = ({ data }) => {
|
|
122
|
-
const { t } = useTranslation();
|
|
123
|
-
const company = data.shipping_address?.company || data.billing_address?.company;
|
|
124
|
-
if (!company) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
return /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
128
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.company") }),
|
|
129
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "truncate", children: company })
|
|
130
|
-
] });
|
|
131
|
-
};
|
|
132
|
-
var Contact = ({ data }) => {
|
|
133
|
-
const { t } = useTranslation();
|
|
134
|
-
const phone = data.shipping_address?.phone || data.billing_address?.phone;
|
|
135
|
-
const email = data.email || "";
|
|
136
|
-
return /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
137
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("orders.customer.contactLabel") }),
|
|
138
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-2", children: [
|
|
139
|
-
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
140
|
-
/* @__PURE__ */ jsx(
|
|
141
|
-
Text,
|
|
142
|
-
{
|
|
143
|
-
size: "small",
|
|
144
|
-
leading: "compact",
|
|
145
|
-
className: "text-pretty break-all",
|
|
146
|
-
children: email
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Copy, { content: email, className: "text-ui-fg-muted" }) })
|
|
150
|
-
] }),
|
|
151
|
-
phone && /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
153
|
-
Text,
|
|
154
|
-
{
|
|
155
|
-
size: "small",
|
|
156
|
-
leading: "compact",
|
|
157
|
-
className: "text-pretty break-all",
|
|
158
|
-
children: phone
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Copy, { content: phone, className: "text-ui-fg-muted" }) })
|
|
162
|
-
] })
|
|
163
|
-
] })
|
|
164
|
-
] });
|
|
165
|
-
};
|
|
166
|
-
var AddressPrint = ({
|
|
167
|
-
address,
|
|
168
|
-
type
|
|
169
|
-
}) => {
|
|
170
|
-
const { t } = useTranslation();
|
|
171
|
-
return /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
172
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: type === "shipping" ? t("addresses.shippingAddress.label") : t("addresses.billingAddress.label") }),
|
|
173
|
-
address ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
174
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: getFormattedAddress({ address }).map((line, i) => {
|
|
175
|
-
return /* @__PURE__ */ jsxs("span", { className: "break-words", children: [
|
|
176
|
-
line,
|
|
177
|
-
/* @__PURE__ */ jsx("br", {})
|
|
178
|
-
] }, i);
|
|
179
|
-
}) }),
|
|
180
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(
|
|
181
|
-
Copy,
|
|
182
|
-
{
|
|
183
|
-
content: getFormattedAddress({ address }).join("\n"),
|
|
184
|
-
className: "text-ui-fg-muted"
|
|
185
|
-
}
|
|
186
|
-
) })
|
|
187
|
-
] }) : /* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: "-" })
|
|
188
|
-
] });
|
|
189
|
-
};
|
|
190
|
-
var Addresses = ({ data }) => {
|
|
191
|
-
const { t } = useTranslation();
|
|
192
|
-
return /* @__PURE__ */ jsxs("div", { className: "divide-y", children: [
|
|
193
|
-
/* @__PURE__ */ jsx(AddressPrint, { address: data.shipping_address, type: "shipping" }),
|
|
194
|
-
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */ jsx(AddressPrint, { address: data.billing_address, type: "billing" }) : /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
195
|
-
/* @__PURE__ */ jsx(
|
|
196
|
-
Text,
|
|
197
|
-
{
|
|
198
|
-
size: "small",
|
|
199
|
-
leading: "compact",
|
|
200
|
-
weight: "plus",
|
|
201
|
-
className: "text-ui-fg-subtle",
|
|
202
|
-
children: t("addresses.billingAddress.label")
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: t("addresses.billingAddress.sameAsShipping") })
|
|
206
|
-
] })
|
|
207
|
-
] });
|
|
208
|
-
};
|
|
209
|
-
var CustomerInfo = Object.assign(
|
|
210
|
-
{},
|
|
211
|
-
{
|
|
212
|
-
ID,
|
|
213
|
-
Company,
|
|
214
|
-
Contact,
|
|
215
|
-
Addresses
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
var getOrderCustomer = (obj) => {
|
|
219
|
-
const { first_name: sFirstName, last_name: sLastName } = obj.shipping_address || {};
|
|
220
|
-
const { first_name: bFirstName, last_name: bLastName } = obj.billing_address || {};
|
|
221
|
-
const { first_name: cFirstName, last_name: cLastName } = obj.customer || {};
|
|
222
|
-
const customerName = [cFirstName, cLastName].filter(Boolean).join(" ");
|
|
223
|
-
const shippingName = [sFirstName, sLastName].filter(Boolean).join(" ");
|
|
224
|
-
const billingName = [bFirstName, bLastName].filter(Boolean).join(" ");
|
|
225
|
-
const name = customerName || shippingName || billingName;
|
|
226
|
-
return name;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
// src/pages/orders/[id]/_components/order-customer-section/order-customer-section.tsx
|
|
230
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
231
|
-
var OrderCustomerSection = ({ order }) => {
|
|
232
|
-
return /* @__PURE__ */ jsxs2(Container, { className: "divide-y p-0", children: [
|
|
233
|
-
/* @__PURE__ */ jsx2(Header, {}),
|
|
234
|
-
/* @__PURE__ */ jsx2(CustomerInfo.ID, { data: order }),
|
|
235
|
-
/* @__PURE__ */ jsx2(CustomerInfo.Contact, { data: order }),
|
|
236
|
-
/* @__PURE__ */ jsx2(CustomerInfo.Company, { data: order }),
|
|
237
|
-
/* @__PURE__ */ jsx2(CustomerInfo.Addresses, { data: order })
|
|
238
|
-
] });
|
|
239
|
-
};
|
|
240
|
-
var Header = () => {
|
|
241
|
-
const { t } = useTranslation2();
|
|
242
|
-
return /* @__PURE__ */ jsx2("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx2(Heading, { level: "h2", children: t("fields.customer") }) });
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
// src/pages/orders/[id]/_components/order-fulfillment-section/order-fulfillment-section.tsx
|
|
246
|
-
import { XCircle } from "@medusajs/icons";
|
|
247
|
-
import {
|
|
248
|
-
Button,
|
|
249
|
-
Container as Container2,
|
|
250
|
-
Copy as Copy2,
|
|
251
|
-
Heading as Heading2,
|
|
252
|
-
StatusBadge,
|
|
253
|
-
Text as Text2,
|
|
254
|
-
Tooltip,
|
|
255
|
-
toast,
|
|
256
|
-
usePrompt
|
|
257
|
-
} from "@medusajs/ui";
|
|
258
|
-
import { format } from "date-fns";
|
|
259
|
-
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
260
|
-
import { Link as Link2, useNavigate } from "react-router-dom";
|
|
261
|
-
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
262
|
-
var OrderFulfillmentSection = ({
|
|
263
|
-
order
|
|
264
|
-
}) => {
|
|
265
|
-
const fulfillments = order.fulfillments || [];
|
|
266
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-3", children: [
|
|
267
|
-
/* @__PURE__ */ jsx3(UnfulfilledItemBreakdown, { order }),
|
|
268
|
-
fulfillments.map((f, index) => /* @__PURE__ */ jsx3(Fulfillment, { index, fulfillment: f, order }, f.id))
|
|
269
|
-
] });
|
|
270
|
-
};
|
|
271
|
-
var UnfulfilledItem = ({
|
|
272
|
-
item,
|
|
273
|
-
currencyCode
|
|
274
|
-
}) => {
|
|
275
|
-
return /* @__PURE__ */ jsxs3(
|
|
276
|
-
"div",
|
|
277
|
-
{
|
|
278
|
-
className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4",
|
|
279
|
-
children: [
|
|
280
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-x-4", children: [
|
|
281
|
-
/* @__PURE__ */ jsx3(Thumbnail, { src: item.thumbnail }),
|
|
282
|
-
/* @__PURE__ */ jsxs3("div", { children: [
|
|
283
|
-
/* @__PURE__ */ jsx3(
|
|
284
|
-
Text2,
|
|
285
|
-
{
|
|
286
|
-
size: "small",
|
|
287
|
-
leading: "compact",
|
|
288
|
-
weight: "plus",
|
|
289
|
-
className: "text-ui-fg-base",
|
|
290
|
-
children: item.title
|
|
291
|
-
}
|
|
292
|
-
),
|
|
293
|
-
item.variant_sku && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-1", children: [
|
|
294
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", children: item.variant_sku }),
|
|
295
|
-
/* @__PURE__ */ jsx3(Copy2, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
296
|
-
] }),
|
|
297
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
298
|
-
] })
|
|
299
|
-
] }),
|
|
300
|
-
/* @__PURE__ */ jsxs3("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
301
|
-
/* @__PURE__ */ jsx3("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx3(Text2, { size: "small", children: getLocaleAmount(item.unit_price, currencyCode) }) }),
|
|
302
|
-
/* @__PURE__ */ jsx3("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs3(Text2, { children: [
|
|
303
|
-
/* @__PURE__ */ jsx3("span", { className: "tabular-nums", children: item.quantity - item.detail.fulfilled_quantity }),
|
|
304
|
-
"x"
|
|
305
|
-
] }) }),
|
|
306
|
-
/* @__PURE__ */ jsx3("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx3(Text2, { size: "small", children: getLocaleAmount(item.subtotal || 0, currencyCode) }) })
|
|
307
|
-
] })
|
|
308
|
-
]
|
|
309
|
-
},
|
|
310
|
-
item.id
|
|
311
|
-
);
|
|
312
|
-
};
|
|
313
|
-
var UnfulfilledItemBreakdown = ({ order }) => {
|
|
314
|
-
const unfulfilledItemsWithShipping = order.items.filter(
|
|
315
|
-
(i) => i.requires_shipping && i.detail && i.quantity && i.detail.fulfilled_quantity < i.quantity
|
|
316
|
-
);
|
|
317
|
-
const unfulfilledItemsWithoutShipping = order.items.filter(
|
|
318
|
-
(i) => !i.requires_shipping && i.detail && i.quantity && i.detail.fulfilled_quantity < i.quantity
|
|
319
|
-
);
|
|
320
|
-
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
321
|
-
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */ jsx3(
|
|
322
|
-
UnfulfilledItemDisplay,
|
|
323
|
-
{
|
|
324
|
-
order,
|
|
325
|
-
unfulfilledItems: unfulfilledItemsWithShipping,
|
|
326
|
-
requiresShipping: true
|
|
327
|
-
}
|
|
328
|
-
),
|
|
329
|
-
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */ jsx3(
|
|
330
|
-
UnfulfilledItemDisplay,
|
|
331
|
-
{
|
|
332
|
-
order,
|
|
333
|
-
unfulfilledItems: unfulfilledItemsWithoutShipping,
|
|
334
|
-
requiresShipping: false
|
|
335
|
-
}
|
|
336
|
-
)
|
|
337
|
-
] });
|
|
338
|
-
};
|
|
339
|
-
var UnfulfilledItemDisplay = ({
|
|
340
|
-
order,
|
|
341
|
-
unfulfilledItems,
|
|
342
|
-
requiresShipping = false
|
|
343
|
-
}) => {
|
|
344
|
-
const { t } = useTranslation3();
|
|
345
|
-
if (order.status === "canceled") {
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
return /* @__PURE__ */ jsxs3(Container2, { className: "divide-y p-0", children: [
|
|
349
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
350
|
-
/* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("orders.fulfillment.unfulfilledItems") }),
|
|
351
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-4", children: [
|
|
352
|
-
requiresShipping && /* @__PURE__ */ jsx3(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.requiresShipping") }),
|
|
353
|
-
/* @__PURE__ */ jsx3(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.awaitingFulfillmentBadge") })
|
|
354
|
-
] })
|
|
355
|
-
] }),
|
|
356
|
-
/* @__PURE__ */ jsx3("div", { children: unfulfilledItems.map((item) => /* @__PURE__ */ jsx3(
|
|
357
|
-
UnfulfilledItem,
|
|
358
|
-
{
|
|
359
|
-
item,
|
|
360
|
-
currencyCode: order.currency_code
|
|
361
|
-
},
|
|
362
|
-
item.id
|
|
363
|
-
)) }),
|
|
364
|
-
/* @__PURE__ */ jsx3("div", { className: "px-6 py-4 flex justify-end", children: /* @__PURE__ */ jsx3(
|
|
365
|
-
Link2,
|
|
366
|
-
{
|
|
367
|
-
to: `/orders/${order.id}/fulfillment?requires_shipping=${requiresShipping}`,
|
|
368
|
-
children: /* @__PURE__ */ jsx3(Button, { children: t("orders.fulfillment.fulfillItems") })
|
|
369
|
-
}
|
|
370
|
-
) })
|
|
371
|
-
] });
|
|
372
|
-
};
|
|
373
|
-
var Fulfillment = ({
|
|
374
|
-
fulfillment,
|
|
375
|
-
order,
|
|
376
|
-
index
|
|
377
|
-
}) => {
|
|
378
|
-
const { t } = useTranslation3();
|
|
379
|
-
const prompt = usePrompt();
|
|
380
|
-
const navigate = useNavigate();
|
|
381
|
-
const showLocation = !!fulfillment.location_id;
|
|
382
|
-
const isPickUpFulfillment = fulfillment.shipping_option?.service_zone.fulfillment_set.type === "pickup" /* Pickup */;
|
|
383
|
-
const { stock_location, isError, error } = useStockLocation(
|
|
384
|
-
fulfillment.location_id,
|
|
385
|
-
void 0,
|
|
386
|
-
{
|
|
387
|
-
enabled: showLocation
|
|
388
|
-
}
|
|
389
|
-
);
|
|
390
|
-
let statusText = fulfillment.requires_shipping ? isPickUpFulfillment ? t("orders.fulfillment.status.awaitingPickup") : t("orders.fulfillment.status.awaitingShipping") : t("orders.fulfillment.status.awaitingDelivery");
|
|
391
|
-
let statusColor = "blue";
|
|
392
|
-
let statusTimestamp = fulfillment.created_at;
|
|
393
|
-
if (fulfillment.canceled_at) {
|
|
394
|
-
statusText = t("orders.fulfillment.status.canceled");
|
|
395
|
-
statusColor = "red";
|
|
396
|
-
statusTimestamp = fulfillment.canceled_at;
|
|
397
|
-
} else if (fulfillment.delivered_at) {
|
|
398
|
-
statusText = t("orders.fulfillment.status.delivered");
|
|
399
|
-
statusColor = "green";
|
|
400
|
-
statusTimestamp = fulfillment.delivered_at;
|
|
401
|
-
} else if (fulfillment.shipped_at) {
|
|
402
|
-
statusText = t("orders.fulfillment.status.shipped");
|
|
403
|
-
statusColor = "green";
|
|
404
|
-
statusTimestamp = fulfillment.shipped_at;
|
|
405
|
-
}
|
|
406
|
-
const { mutateAsync } = useCancelOrderFulfillment(order.id, fulfillment.id);
|
|
407
|
-
const { mutateAsync: markAsDelivered } = useMarkOrderFulfillmentAsDelivered(
|
|
408
|
-
order.id,
|
|
409
|
-
fulfillment.id
|
|
410
|
-
);
|
|
411
|
-
const showShippingButton = !fulfillment.canceled_at && !fulfillment.shipped_at && !fulfillment.delivered_at && fulfillment.requires_shipping && !isPickUpFulfillment;
|
|
412
|
-
const showDeliveryButton = !fulfillment.canceled_at && !fulfillment.delivered_at;
|
|
413
|
-
const handleMarkAsDelivered = async () => {
|
|
414
|
-
const res = await prompt({
|
|
415
|
-
title: t("general.areYouSure"),
|
|
416
|
-
description: t("orders.fulfillment.markAsDeliveredWarning"),
|
|
417
|
-
confirmText: t("actions.continue"),
|
|
418
|
-
cancelText: t("actions.cancel"),
|
|
419
|
-
variant: "confirmation"
|
|
420
|
-
});
|
|
421
|
-
if (res) {
|
|
422
|
-
await markAsDelivered(void 0, {
|
|
423
|
-
onSuccess: () => {
|
|
424
|
-
toast.success(
|
|
425
|
-
t(
|
|
426
|
-
isPickUpFulfillment ? "orders.fulfillment.toast.fulfillmentPickedUp" : "orders.fulfillment.toast.fulfillmentDelivered"
|
|
427
|
-
)
|
|
428
|
-
);
|
|
429
|
-
},
|
|
430
|
-
onError: (e) => {
|
|
431
|
-
toast.error(e.message);
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
const handleCancel = async () => {
|
|
437
|
-
if (fulfillment.shipped_at) {
|
|
438
|
-
toast.warning(t("orders.fulfillment.toast.fulfillmentShipped"));
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
const res = await prompt({
|
|
442
|
-
title: t("general.areYouSure"),
|
|
443
|
-
description: t("orders.fulfillment.cancelWarning"),
|
|
444
|
-
confirmText: t("actions.continue"),
|
|
445
|
-
cancelText: t("actions.cancel")
|
|
446
|
-
});
|
|
447
|
-
if (res) {
|
|
448
|
-
await mutateAsync(void 0, {
|
|
449
|
-
onSuccess: () => {
|
|
450
|
-
toast.success(t("orders.fulfillment.toast.canceled"));
|
|
451
|
-
},
|
|
452
|
-
onError: (e) => {
|
|
453
|
-
toast.error(e.message);
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
if (isError) {
|
|
459
|
-
throw error;
|
|
460
|
-
}
|
|
461
|
-
return /* @__PURE__ */ jsxs3(Container2, { className: "divide-y p-0", children: [
|
|
462
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
463
|
-
/* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("orders.fulfillment.number", {
|
|
464
|
-
number: index + 1
|
|
465
|
-
}) }),
|
|
466
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-4", children: [
|
|
467
|
-
/* @__PURE__ */ jsx3(
|
|
468
|
-
Tooltip,
|
|
469
|
-
{
|
|
470
|
-
content: format(
|
|
471
|
-
new Date(statusTimestamp),
|
|
472
|
-
"dd MMM, yyyy, HH:mm:ss"
|
|
473
|
-
),
|
|
474
|
-
children: /* @__PURE__ */ jsx3(StatusBadge, { color: statusColor, className: "text-nowrap", children: statusText })
|
|
475
|
-
}
|
|
476
|
-
),
|
|
477
|
-
/* @__PURE__ */ jsx3(
|
|
478
|
-
ActionMenu,
|
|
479
|
-
{
|
|
480
|
-
groups: [
|
|
481
|
-
{
|
|
482
|
-
actions: [
|
|
483
|
-
{
|
|
484
|
-
label: t("actions.cancel"),
|
|
485
|
-
icon: /* @__PURE__ */ jsx3(XCircle, {}),
|
|
486
|
-
onClick: handleCancel,
|
|
487
|
-
disabled: !!fulfillment.canceled_at
|
|
488
|
-
}
|
|
489
|
-
]
|
|
490
|
-
}
|
|
491
|
-
]
|
|
492
|
-
}
|
|
493
|
-
)
|
|
494
|
-
] })
|
|
495
|
-
] }),
|
|
496
|
-
/* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
497
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.itemsLabel") }),
|
|
498
|
-
/* @__PURE__ */ jsx3("ul", { children: (fulfillment.items || []).map((f_item) => /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(Text2, { size: "small", leading: "compact", children: [
|
|
499
|
-
f_item.quantity,
|
|
500
|
-
"x ",
|
|
501
|
-
f_item.title
|
|
502
|
-
] }) }, f_item.line_item_id)) })
|
|
503
|
-
] }),
|
|
504
|
-
showLocation && /* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
505
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.shippingFromLabel") }),
|
|
506
|
-
stock_location ? /* @__PURE__ */ jsx3(
|
|
507
|
-
Link2,
|
|
508
|
-
{
|
|
509
|
-
to: `/settings/locations/${stock_location.id}`,
|
|
510
|
-
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
511
|
-
children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: stock_location.name })
|
|
512
|
-
}
|
|
513
|
-
) : /* @__PURE__ */ jsx3(Skeleton, { className: "w-16" })
|
|
514
|
-
] }),
|
|
515
|
-
/* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
516
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("fields.provider") }),
|
|
517
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: formatProvider(fulfillment.provider_id) })
|
|
518
|
-
] }),
|
|
519
|
-
/* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
520
|
-
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.trackingLabel") }),
|
|
521
|
-
/* @__PURE__ */ jsx3("div", { children: fulfillment.labels && fulfillment.labels.length > 0 ? /* @__PURE__ */ jsx3("ul", { children: fulfillment.labels.map((tlink) => {
|
|
522
|
-
const hasUrl = !!tlink.tracking_url?.length && tlink.tracking_url !== "#";
|
|
523
|
-
if (hasUrl) {
|
|
524
|
-
return /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3(
|
|
525
|
-
"a",
|
|
526
|
-
{
|
|
527
|
-
href: tlink.tracking_url || "",
|
|
528
|
-
target: "_blank",
|
|
529
|
-
rel: "noopener noreferrer",
|
|
530
|
-
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
531
|
-
children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: tlink.tracking_number })
|
|
532
|
-
}
|
|
533
|
-
) }, tlink.tracking_number);
|
|
534
|
-
}
|
|
535
|
-
return /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: tlink.tracking_number }) }, tlink.tracking_number);
|
|
536
|
-
}) }) : /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: "-" }) })
|
|
537
|
-
] }),
|
|
538
|
-
(showShippingButton || showDeliveryButton) && /* @__PURE__ */ jsxs3("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
539
|
-
showDeliveryButton && /* @__PURE__ */ jsx3(Button, { onClick: handleMarkAsDelivered, variant: "secondary", children: t(
|
|
540
|
-
isPickUpFulfillment ? "orders.fulfillment.markAsPickedUp" : "orders.fulfillment.markAsDelivered"
|
|
541
|
-
) }),
|
|
542
|
-
showShippingButton && /* @__PURE__ */ jsx3(
|
|
543
|
-
Button,
|
|
544
|
-
{
|
|
545
|
-
onClick: () => navigate(`./${fulfillment.id}/create-shipment`),
|
|
546
|
-
variant: "secondary",
|
|
547
|
-
children: t("orders.fulfillment.markAsShipped")
|
|
548
|
-
}
|
|
549
|
-
)
|
|
550
|
-
] })
|
|
551
|
-
] });
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
// src/pages/orders/[id]/_components/order-general-section/order-general-section.tsx
|
|
555
|
-
import { CheckCircle, XCircle as XCircle2 } from "@medusajs/icons";
|
|
556
|
-
import {
|
|
557
|
-
Container as Container3,
|
|
558
|
-
Copy as Copy3,
|
|
559
|
-
Heading as Heading3,
|
|
560
|
-
StatusBadge as StatusBadge2,
|
|
561
|
-
Text as Text3,
|
|
562
|
-
toast as toast2,
|
|
563
|
-
usePrompt as usePrompt2
|
|
564
|
-
} from "@medusajs/ui";
|
|
565
|
-
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
566
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
567
|
-
var OrderGeneralSection = ({ order }) => {
|
|
568
|
-
const { t } = useTranslation4();
|
|
569
|
-
const prompt = usePrompt2();
|
|
570
|
-
const { getFullDate } = useDate();
|
|
571
|
-
const { mutateAsync: cancelOrder } = useCancelOrder(order.id);
|
|
572
|
-
const { mutateAsync: completeOrder } = useCompleteOrder(order.id);
|
|
573
|
-
const handleComplete = async () => {
|
|
574
|
-
await completeOrder(void 0, {
|
|
575
|
-
onSuccess: () => {
|
|
576
|
-
toast2.success("Order completed");
|
|
577
|
-
},
|
|
578
|
-
onError: (e) => {
|
|
579
|
-
toast2.error(e.message);
|
|
580
|
-
}
|
|
581
|
-
});
|
|
582
|
-
};
|
|
583
|
-
const handleCancel = async () => {
|
|
584
|
-
const res = await prompt({
|
|
585
|
-
title: t("general.areYouSure"),
|
|
586
|
-
description: t("orders.cancelWarning", {
|
|
587
|
-
id: `#${order.display_id}`
|
|
588
|
-
}),
|
|
589
|
-
confirmText: t("actions.continue"),
|
|
590
|
-
cancelText: t("actions.cancel")
|
|
591
|
-
});
|
|
592
|
-
if (!res) {
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
await cancelOrder(void 0, {
|
|
596
|
-
onSuccess: () => {
|
|
597
|
-
toast2.success(t("orders.orderCanceled"));
|
|
598
|
-
},
|
|
599
|
-
onError: (e) => {
|
|
600
|
-
toast2.error(e.message);
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
};
|
|
604
|
-
return /* @__PURE__ */ jsxs4(Container3, { className: "flex items-center justify-between px-6 py-4", children: [
|
|
605
|
-
/* @__PURE__ */ jsxs4("div", { children: [
|
|
606
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-1", children: [
|
|
607
|
-
/* @__PURE__ */ jsxs4(Heading3, { children: [
|
|
608
|
-
"#",
|
|
609
|
-
order.display_id
|
|
610
|
-
] }),
|
|
611
|
-
/* @__PURE__ */ jsx4(Copy3, { content: `#${order.display_id}`, className: "text-ui-fg-muted" })
|
|
612
|
-
] }),
|
|
613
|
-
/* @__PURE__ */ jsx4(Text3, { size: "small", className: "text-ui-fg-subtle", children: t("orders.onDateFromSalesChannel", {
|
|
614
|
-
date: getFullDate({ date: order.created_at, includeTime: true }),
|
|
615
|
-
salesChannel: order.sales_channel?.name
|
|
616
|
-
}) })
|
|
617
|
-
] }),
|
|
618
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-4", children: [
|
|
619
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-x-1.5", children: [
|
|
620
|
-
/* @__PURE__ */ jsx4(OrderBadge, { order }),
|
|
621
|
-
/* @__PURE__ */ jsx4(PaymentBadge, { order }),
|
|
622
|
-
/* @__PURE__ */ jsx4(FulfillmentBadge, { order })
|
|
623
|
-
] }),
|
|
624
|
-
/* @__PURE__ */ jsx4(
|
|
625
|
-
ActionMenu,
|
|
626
|
-
{
|
|
627
|
-
groups: [
|
|
628
|
-
{
|
|
629
|
-
actions: [
|
|
630
|
-
{
|
|
631
|
-
label: t("actions.complete"),
|
|
632
|
-
onClick: handleComplete,
|
|
633
|
-
disabled: order.status !== "pending",
|
|
634
|
-
icon: /* @__PURE__ */ jsx4(CheckCircle, {})
|
|
635
|
-
},
|
|
636
|
-
{
|
|
637
|
-
label: t("actions.cancel"),
|
|
638
|
-
onClick: handleCancel,
|
|
639
|
-
//@ts-ignore
|
|
640
|
-
disabled: !!order.canceled_at,
|
|
641
|
-
icon: /* @__PURE__ */ jsx4(XCircle2, {})
|
|
642
|
-
}
|
|
643
|
-
]
|
|
644
|
-
}
|
|
645
|
-
]
|
|
646
|
-
}
|
|
647
|
-
)
|
|
648
|
-
] })
|
|
649
|
-
] });
|
|
650
|
-
};
|
|
651
|
-
var FulfillmentBadge = ({ order }) => {
|
|
652
|
-
const { t } = useTranslation4();
|
|
653
|
-
if (!order.fulfillment_status) {
|
|
654
|
-
return null;
|
|
655
|
-
}
|
|
656
|
-
const { label, color } = getOrderFulfillmentStatus(
|
|
657
|
-
t,
|
|
658
|
-
order.fulfillment_status
|
|
659
|
-
);
|
|
660
|
-
return /* @__PURE__ */ jsx4(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
661
|
-
};
|
|
662
|
-
var PaymentBadge = ({ order }) => {
|
|
663
|
-
const { t } = useTranslation4();
|
|
664
|
-
if (!order.payment_status) {
|
|
665
|
-
return null;
|
|
666
|
-
}
|
|
667
|
-
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
668
|
-
return /* @__PURE__ */ jsx4(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
669
|
-
};
|
|
670
|
-
var OrderBadge = ({ order }) => {
|
|
671
|
-
const { t } = useTranslation4();
|
|
672
|
-
const orderStatus = getCanceledOrderStatus(t, order.status);
|
|
673
|
-
if (!orderStatus) {
|
|
674
|
-
return null;
|
|
675
|
-
}
|
|
676
|
-
return /* @__PURE__ */ jsx4(StatusBadge2, { color: orderStatus.color, className: "text-nowrap", children: orderStatus.label });
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
// src/pages/orders/[id]/_components/order-payment-section/order-payment-section.tsx
|
|
680
|
-
import { Container as Container4, Heading as Heading4, StatusBadge as StatusBadge3, Text as Text4 } from "@medusajs/ui";
|
|
681
|
-
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
682
|
-
|
|
683
|
-
// src/lib/payment.ts
|
|
684
|
-
var getTotalCaptured = (paymentCollections) => paymentCollections.reduce((acc, paymentCollection) => {
|
|
685
|
-
acc = acc + (paymentCollection.captured_amount - paymentCollection.refunded_amount);
|
|
686
|
-
return acc;
|
|
687
|
-
}, 0);
|
|
688
|
-
var getTotalPending = (paymentCollections) => paymentCollections.filter((pc) => pc.status !== "canceled").reduce((acc, paymentCollection) => {
|
|
689
|
-
acc += paymentCollection.amount - paymentCollection.captured_amount;
|
|
690
|
-
return acc;
|
|
691
|
-
}, 0);
|
|
692
|
-
|
|
693
|
-
// src/pages/orders/[id]/_components/order-payment-section/order-payment-section.tsx
|
|
694
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
695
|
-
var OrderPaymentSection = ({ order }) => {
|
|
696
|
-
return /* @__PURE__ */ jsxs5(Container4, { className: "divide-y divide-dashed p-0", children: [
|
|
697
|
-
/* @__PURE__ */ jsx5(Header2, { order }),
|
|
698
|
-
/* @__PURE__ */ jsx5(Total, { order })
|
|
699
|
-
] });
|
|
700
|
-
};
|
|
701
|
-
var Header2 = ({ order }) => {
|
|
702
|
-
const { t } = useTranslation5();
|
|
703
|
-
return /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
704
|
-
/* @__PURE__ */ jsx5(Heading4, { level: "h2", children: t("orders.payment.title") }),
|
|
705
|
-
order.payment_status && /* @__PURE__ */ jsx5(
|
|
706
|
-
StatusBadge3,
|
|
707
|
-
{
|
|
708
|
-
color: getOrderPaymentStatus(t, order.payment_status).color,
|
|
709
|
-
className: "text-nowrap",
|
|
710
|
-
children: getOrderPaymentStatus(t, order.payment_status).label
|
|
711
|
-
}
|
|
712
|
-
)
|
|
713
|
-
] });
|
|
714
|
-
};
|
|
715
|
-
var Total = ({ order }) => {
|
|
716
|
-
const { t } = useTranslation5();
|
|
717
|
-
if (!order.payment_collections?.length) {
|
|
718
|
-
return null;
|
|
719
|
-
}
|
|
720
|
-
const paymentCollections = order.payment_collections;
|
|
721
|
-
const totalCaptured = getTotalCaptured(paymentCollections);
|
|
722
|
-
const totalPending = getTotalPending(paymentCollections);
|
|
723
|
-
const totalRefunded = paymentCollections.reduce(
|
|
724
|
-
(acc, pc) => acc + (pc.refunded_amount || 0),
|
|
725
|
-
0
|
|
726
|
-
);
|
|
727
|
-
return /* @__PURE__ */ jsxs5("div", { children: [
|
|
728
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
729
|
-
/* @__PURE__ */ jsx5(Text4, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPaidByCustomer") }),
|
|
730
|
-
/* @__PURE__ */ jsx5(Text4, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalCaptured, order.currency_code) })
|
|
731
|
-
] }),
|
|
732
|
-
totalRefunded > 0 && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
733
|
-
/* @__PURE__ */ jsx5(Text4, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalRefunded") }),
|
|
734
|
-
/* @__PURE__ */ jsx5(Text4, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalRefunded, order.currency_code) })
|
|
735
|
-
] }),
|
|
736
|
-
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
737
|
-
/* @__PURE__ */ jsx5(Text4, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPending") }),
|
|
738
|
-
/* @__PURE__ */ jsx5(Text4, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalPending, order.currency_code) })
|
|
739
|
-
] })
|
|
740
|
-
] });
|
|
741
|
-
};
|
|
742
|
-
|
|
743
|
-
// src/pages/orders/[id]/_components/order-summary-section/order-summary-section.tsx
|
|
744
|
-
import { useMemo, useState } from "react";
|
|
745
|
-
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
746
|
-
import { Link as Link3 } from "react-router-dom";
|
|
747
|
-
import {
|
|
748
|
-
ArrowLongRight,
|
|
749
|
-
TriangleDownMini
|
|
750
|
-
} from "@medusajs/icons";
|
|
751
|
-
import {
|
|
752
|
-
Button as Button2,
|
|
753
|
-
clx,
|
|
754
|
-
Container as Container5,
|
|
755
|
-
Copy as Copy4,
|
|
756
|
-
Heading as Heading5,
|
|
757
|
-
Text as Text5
|
|
758
|
-
} from "@medusajs/ui";
|
|
759
|
-
|
|
760
|
-
// src/pages/orders/[id]/_components/order-summary-section/shipping-info-popover.tsx
|
|
761
|
-
import { InformationCircleSolid } from "@medusajs/icons";
|
|
762
|
-
import { Badge, Tooltip as Tooltip2 } from "@medusajs/ui";
|
|
763
|
-
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
764
|
-
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
765
|
-
function ShippingInfoPopover({ shippingMethod }) {
|
|
766
|
-
const { t } = useTranslation6();
|
|
767
|
-
const shippingDetail = shippingMethod?.detail;
|
|
768
|
-
if (!shippingDetail) {
|
|
769
|
-
return;
|
|
770
|
-
}
|
|
771
|
-
let rmaType = t("orders.return");
|
|
772
|
-
let rmaId = shippingDetail.return_id;
|
|
773
|
-
if (shippingDetail.claim_id) {
|
|
774
|
-
rmaType = t("orders.claim");
|
|
775
|
-
rmaId = shippingDetail.claim_id;
|
|
776
|
-
}
|
|
777
|
-
if (shippingDetail.exchange_id) {
|
|
778
|
-
rmaType = t("orders.exchange");
|
|
779
|
-
rmaId = shippingDetail.exchange_id;
|
|
780
|
-
}
|
|
781
|
-
if (!rmaId) {
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
return /* @__PURE__ */ jsx6(
|
|
785
|
-
Tooltip2,
|
|
786
|
-
{
|
|
787
|
-
content: /* @__PURE__ */ jsxs6(Badge, { size: "2xsmall", rounded: "full", children: [
|
|
788
|
-
rmaType,
|
|
789
|
-
": #",
|
|
790
|
-
rmaId.slice(-7)
|
|
791
|
-
] }),
|
|
792
|
-
children: /* @__PURE__ */ jsx6(InformationCircleSolid, { className: "inline-block text-ui-fg-muted ml-1" })
|
|
793
|
-
}
|
|
794
|
-
);
|
|
795
|
-
}
|
|
796
|
-
var shipping_info_popover_default = ShippingInfoPopover;
|
|
797
|
-
|
|
798
|
-
// src/pages/orders/[id]/_components/order-summary-section/order-summary-section.tsx
|
|
799
|
-
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
800
|
-
var OrderSummarySection = ({
|
|
801
|
-
order
|
|
802
|
-
}) => {
|
|
803
|
-
const { t } = useTranslation7();
|
|
804
|
-
const receivableReturns = useMemo(
|
|
805
|
-
() => order.returns?.filter((r) => !r.canceled_at),
|
|
806
|
-
[order]
|
|
807
|
-
);
|
|
808
|
-
const showReturns = !!receivableReturns?.length;
|
|
809
|
-
const unpaidPaymentCollection = order.payment_collections?.find(
|
|
810
|
-
(pc) => pc.status !== "captured" && pc.status !== "canceled"
|
|
811
|
-
);
|
|
812
|
-
const pendingDifference = order.summary?.pending_difference || 0;
|
|
813
|
-
const isAmountSignificant = !isAmountLessThenRoundingError(
|
|
814
|
-
pendingDifference,
|
|
815
|
-
order.currency_code
|
|
816
|
-
);
|
|
817
|
-
const showRefund = unpaidPaymentCollection && pendingDifference < 0 && isAmountSignificant;
|
|
818
|
-
return /* @__PURE__ */ jsxs7(Container5, { className: "divide-y divide-dashed p-0", children: [
|
|
819
|
-
/* @__PURE__ */ jsx7(Header3, {}),
|
|
820
|
-
/* @__PURE__ */ jsx7(ItemBreakdown, { order }),
|
|
821
|
-
/* @__PURE__ */ jsx7(CostBreakdown, { order }),
|
|
822
|
-
/* @__PURE__ */ jsx7(Total2, { order }),
|
|
823
|
-
(showReturns || showRefund) && /* @__PURE__ */ jsxs7("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
824
|
-
showReturns && (receivableReturns?.length === 1 ? /* @__PURE__ */ jsx7(Button2, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ jsx7(
|
|
825
|
-
Link3,
|
|
826
|
-
{
|
|
827
|
-
to: `/orders/${order.id}/returns/${receivableReturns[0].id}/receive`,
|
|
828
|
-
children: t("orders.returns.receive.action")
|
|
829
|
-
}
|
|
830
|
-
) }) : /* @__PURE__ */ jsx7(
|
|
831
|
-
ActionMenu,
|
|
832
|
-
{
|
|
833
|
-
groups: [
|
|
834
|
-
{
|
|
835
|
-
actions: receivableReturns?.map((r) => {
|
|
836
|
-
let id = r.id;
|
|
837
|
-
let returnType = "Return";
|
|
838
|
-
if (r.exchange_id) {
|
|
839
|
-
id = r.exchange_id;
|
|
840
|
-
returnType = "Exchange";
|
|
841
|
-
}
|
|
842
|
-
if (r.claim_id) {
|
|
843
|
-
id = r.claim_id;
|
|
844
|
-
returnType = "Claim";
|
|
845
|
-
}
|
|
846
|
-
return {
|
|
847
|
-
label: t("orders.returns.receive.receiveItems", {
|
|
848
|
-
id: `#${id?.slice(-7)}`,
|
|
849
|
-
returnType
|
|
850
|
-
}),
|
|
851
|
-
icon: /* @__PURE__ */ jsx7(ArrowLongRight, {}),
|
|
852
|
-
to: `/orders/${order.id}/returns/${r.id}/receive`
|
|
853
|
-
};
|
|
854
|
-
})
|
|
855
|
-
}
|
|
856
|
-
],
|
|
857
|
-
children: /* @__PURE__ */ jsx7(Button2, { variant: "secondary", size: "small", children: t("orders.returns.receive.action") })
|
|
858
|
-
}
|
|
859
|
-
)),
|
|
860
|
-
showRefund && /* @__PURE__ */ jsx7(Button2, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx7(Link3, { to: `/orders/${order.id}/refund`, children: t("orders.payment.refundAmount", {
|
|
861
|
-
amount: getStylizedAmount(
|
|
862
|
-
pendingDifference * -1,
|
|
863
|
-
order?.currency_code
|
|
864
|
-
)
|
|
865
|
-
}) }) })
|
|
866
|
-
] })
|
|
867
|
-
] });
|
|
868
|
-
};
|
|
869
|
-
var Header3 = () => {
|
|
870
|
-
const { t } = useTranslation7();
|
|
871
|
-
return /* @__PURE__ */ jsx7("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx7(Heading5, { level: "h2", children: t("fields.summary") }) });
|
|
872
|
-
};
|
|
873
|
-
var Item = ({
|
|
874
|
-
item,
|
|
875
|
-
currencyCode
|
|
876
|
-
}) => {
|
|
877
|
-
const original_price = item.variant?.prices?.find((price2) => price2.currency_code === currencyCode)?.amount || 0;
|
|
878
|
-
const price = item.unit_price;
|
|
879
|
-
return /* @__PURE__ */ jsx7(Fragment2, { children: /* @__PURE__ */ jsxs7(
|
|
880
|
-
"div",
|
|
881
|
-
{
|
|
882
|
-
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-x-4 px-6 py-4",
|
|
883
|
-
children: [
|
|
884
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-x-4", children: [
|
|
885
|
-
/* @__PURE__ */ jsx7(Thumbnail, { src: item.thumbnail }),
|
|
886
|
-
/* @__PURE__ */ jsxs7("div", { children: [
|
|
887
|
-
/* @__PURE__ */ jsx7(
|
|
888
|
-
Text5,
|
|
889
|
-
{
|
|
890
|
-
size: "small",
|
|
891
|
-
leading: "compact",
|
|
892
|
-
weight: "plus",
|
|
893
|
-
className: "text-ui-fg-base",
|
|
894
|
-
children: item.title || item.product_title
|
|
895
|
-
}
|
|
896
|
-
),
|
|
897
|
-
item.variant_sku && /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-1", children: [
|
|
898
|
-
/* @__PURE__ */ jsx7(Text5, { size: "small", children: item.variant_sku }),
|
|
899
|
-
/* @__PURE__ */ jsx7(Copy4, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
900
|
-
] }),
|
|
901
|
-
/* @__PURE__ */ jsx7(Text5, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
902
|
-
] })
|
|
903
|
-
] }),
|
|
904
|
-
/* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
905
|
-
/* @__PURE__ */ jsx7("div", { className: "flex items-center justify-end gap-x-4", children: /* @__PURE__ */ jsxs7(Text5, { size: "small", children: [
|
|
906
|
-
original_price !== price && /* @__PURE__ */ jsx7("span", { className: "line-through text-ui-fg-muted text-xs mr-1", children: getLocaleAmount(original_price, currencyCode) }),
|
|
907
|
-
getLocaleAmount(price, currencyCode)
|
|
908
|
-
] }) }),
|
|
909
|
-
/* @__PURE__ */ jsx7("div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ jsx7("div", { className: "w-fit min-w-[27px]", children: /* @__PURE__ */ jsxs7(Text5, { size: "small", children: [
|
|
910
|
-
/* @__PURE__ */ jsx7("span", { className: "tabular-nums", children: item.quantity }),
|
|
911
|
-
"x"
|
|
912
|
-
] }) }) }),
|
|
913
|
-
/* @__PURE__ */ jsx7("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx7(Text5, { size: "small", className: "pt-[1px]", children: getLocaleAmount(item.original_total || 0, currencyCode) }) })
|
|
914
|
-
] })
|
|
915
|
-
]
|
|
916
|
-
},
|
|
917
|
-
item.id
|
|
918
|
-
) });
|
|
919
|
-
};
|
|
920
|
-
var ItemBreakdown = ({
|
|
921
|
-
order
|
|
922
|
-
}) => {
|
|
923
|
-
return /* @__PURE__ */ jsx7("div", { children: order.items?.map((item) => {
|
|
924
|
-
return /* @__PURE__ */ jsx7(
|
|
925
|
-
Item,
|
|
926
|
-
{
|
|
927
|
-
item,
|
|
928
|
-
currencyCode: order.currency_code
|
|
929
|
-
},
|
|
930
|
-
item.id
|
|
931
|
-
);
|
|
932
|
-
}) });
|
|
933
|
-
};
|
|
934
|
-
var Cost = ({
|
|
935
|
-
label,
|
|
936
|
-
value,
|
|
937
|
-
secondaryValue,
|
|
938
|
-
tooltip
|
|
939
|
-
}) => /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-3 items-center", children: [
|
|
940
|
-
/* @__PURE__ */ jsxs7(Text5, { size: "small", leading: "compact", children: [
|
|
941
|
-
label,
|
|
942
|
-
" ",
|
|
943
|
-
tooltip
|
|
944
|
-
] }),
|
|
945
|
-
/* @__PURE__ */ jsx7("div", { className: "text-right", children: /* @__PURE__ */ jsx7(Text5, { size: "small", leading: "compact", children: secondaryValue }) }),
|
|
946
|
-
/* @__PURE__ */ jsx7("div", { className: "text-right", children: /* @__PURE__ */ jsx7(Text5, { size: "small", leading: "compact", children: value }) })
|
|
947
|
-
] });
|
|
948
|
-
var CostBreakdown = ({
|
|
949
|
-
order
|
|
950
|
-
}) => {
|
|
951
|
-
const { t } = useTranslation7();
|
|
952
|
-
const [isTaxOpen, setIsTaxOpen] = useState(false);
|
|
953
|
-
const [isShippingOpen, setIsShippingOpen] = useState(false);
|
|
954
|
-
const commissionTotal = useMemo(() => {
|
|
955
|
-
return order.items.reduce((acc, item) => {
|
|
956
|
-
const lines = item.commission_lines;
|
|
957
|
-
if (!lines) return acc;
|
|
958
|
-
return acc + lines.reduce((sum, line) => sum + (line.amount ?? 0), 0);
|
|
959
|
-
}, 0);
|
|
960
|
-
}, [order.items]);
|
|
961
|
-
const discountCodes = useMemo(() => {
|
|
962
|
-
const codes = /* @__PURE__ */ new Set();
|
|
963
|
-
order.items.forEach(
|
|
964
|
-
(item) => item.adjustments?.forEach((adj) => {
|
|
965
|
-
codes.add(adj.code);
|
|
966
|
-
})
|
|
967
|
-
);
|
|
968
|
-
return Array.from(codes).sort();
|
|
969
|
-
}, [order]);
|
|
970
|
-
const taxCodes = useMemo(() => {
|
|
971
|
-
const taxCodeMap = {};
|
|
972
|
-
order.items.forEach((item) => {
|
|
973
|
-
item.tax_lines?.forEach((line) => {
|
|
974
|
-
taxCodeMap[line.code] = (taxCodeMap[line.code] || 0) + line.total;
|
|
975
|
-
});
|
|
976
|
-
});
|
|
977
|
-
order.shipping_methods.forEach((sm) => {
|
|
978
|
-
sm.tax_lines?.forEach((line) => {
|
|
979
|
-
taxCodeMap[line.code] = (taxCodeMap[line.code] || 0) + line.total;
|
|
980
|
-
});
|
|
981
|
-
});
|
|
982
|
-
return taxCodeMap;
|
|
983
|
-
}, [order]);
|
|
984
|
-
const automaticTaxesOn = !!order.region?.automatic_taxes;
|
|
985
|
-
const hasTaxLines = !!Object.keys(taxCodes).length;
|
|
986
|
-
const discountTotal = automaticTaxesOn ? order.discount_total : order.discount_subtotal;
|
|
987
|
-
return /* @__PURE__ */ jsxs7("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
|
|
988
|
-
/* @__PURE__ */ jsx7(
|
|
989
|
-
Cost,
|
|
990
|
-
{
|
|
991
|
-
label: t(
|
|
992
|
-
automaticTaxesOn ? "orders.summary.itemTotal" : "orders.summary.itemSubtotal"
|
|
993
|
-
),
|
|
994
|
-
value: getLocaleAmount(order.item_total, order.currency_code)
|
|
995
|
-
}
|
|
996
|
-
),
|
|
997
|
-
/* @__PURE__ */ jsx7(
|
|
998
|
-
Cost,
|
|
999
|
-
{
|
|
1000
|
-
label: (
|
|
1001
|
-
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
1002
|
-
/* @__PURE__ */ jsxs7(
|
|
1003
|
-
"span",
|
|
1004
|
-
{
|
|
1005
|
-
onClick: () => setIsShippingOpen((o) => !o),
|
|
1006
|
-
className: "flex cursor-pointer items-center gap-1",
|
|
1007
|
-
children: [
|
|
1008
|
-
/* @__PURE__ */ jsx7("span", { children: t(
|
|
1009
|
-
automaticTaxesOn ? "orders.summary.shippingTotal" : "orders.summary.shippingSubtotal"
|
|
1010
|
-
) }),
|
|
1011
|
-
/* @__PURE__ */ jsx7(
|
|
1012
|
-
TriangleDownMini,
|
|
1013
|
-
{
|
|
1014
|
-
style: {
|
|
1015
|
-
transform: `rotate(${isShippingOpen ? 0 : -90}deg)`
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
)
|
|
1019
|
-
]
|
|
1020
|
-
}
|
|
1021
|
-
)
|
|
1022
|
-
),
|
|
1023
|
-
value: getLocaleAmount(
|
|
1024
|
-
automaticTaxesOn ? order.shipping_total : order.shipping_subtotal,
|
|
1025
|
-
order.currency_code
|
|
1026
|
-
)
|
|
1027
|
-
}
|
|
1028
|
-
),
|
|
1029
|
-
isShippingOpen && /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-1 pl-5", children: (order.shipping_methods || []).sort(
|
|
1030
|
-
(m1, m2) => m1.created_at.localeCompare(m2.created_at)
|
|
1031
|
-
).map((sm, i) => {
|
|
1032
|
-
return /* @__PURE__ */ jsxs7(
|
|
1033
|
-
"div",
|
|
1034
|
-
{
|
|
1035
|
-
className: "flex items-center justify-between gap-x-2",
|
|
1036
|
-
children: [
|
|
1037
|
-
/* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsxs7("span", { className: "txt-small text-ui-fg-subtle font-medium", children: [
|
|
1038
|
-
sm.name,
|
|
1039
|
-
sm.detail?.return_id && ` (${t("fields.returnShipping")})`,
|
|
1040
|
-
" ",
|
|
1041
|
-
/* @__PURE__ */ jsx7(shipping_info_popover_default, { shippingMethod: sm }, i)
|
|
1042
|
-
] }) }),
|
|
1043
|
-
/* @__PURE__ */ jsx7("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx7("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
1044
|
-
/* @__PURE__ */ jsx7("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
|
|
1045
|
-
automaticTaxesOn ? sm.total : sm.subtotal,
|
|
1046
|
-
order.currency_code
|
|
1047
|
-
) })
|
|
1048
|
-
]
|
|
1049
|
-
},
|
|
1050
|
-
sm.id
|
|
1051
|
-
);
|
|
1052
|
-
}) }),
|
|
1053
|
-
/* @__PURE__ */ jsx7(
|
|
1054
|
-
Cost,
|
|
1055
|
-
{
|
|
1056
|
-
label: t(
|
|
1057
|
-
automaticTaxesOn ? "orders.summary.discountTotal" : "orders.summary.discountSubtotal"
|
|
1058
|
-
),
|
|
1059
|
-
secondaryValue: discountCodes.join(", "),
|
|
1060
|
-
value: discountTotal > 0 ? `- ${getLocaleAmount(discountTotal, order.currency_code)}` : "-"
|
|
1061
|
-
}
|
|
1062
|
-
),
|
|
1063
|
-
/* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1064
|
-
/* @__PURE__ */ jsxs7("div", { className: "flex justify-between", children: [
|
|
1065
|
-
/* @__PURE__ */ jsxs7(
|
|
1066
|
-
"div",
|
|
1067
|
-
{
|
|
1068
|
-
onClick: () => hasTaxLines && setIsTaxOpen((o) => !o),
|
|
1069
|
-
className: clx("flex items-center gap-1", {
|
|
1070
|
-
"cursor-pointer": hasTaxLines
|
|
1071
|
-
}),
|
|
1072
|
-
children: [
|
|
1073
|
-
/* @__PURE__ */ jsx7("span", { className: "txt-small select-none", children: t(
|
|
1074
|
-
automaticTaxesOn ? "orders.summary.taxTotalIncl" : "orders.summary.taxTotal"
|
|
1075
|
-
) }),
|
|
1076
|
-
hasTaxLines && /* @__PURE__ */ jsx7(
|
|
1077
|
-
TriangleDownMini,
|
|
1078
|
-
{
|
|
1079
|
-
style: {
|
|
1080
|
-
transform: `rotate(${isTaxOpen ? 0 : -90}deg)`
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
)
|
|
1084
|
-
]
|
|
1085
|
-
}
|
|
1086
|
-
),
|
|
1087
|
-
/* @__PURE__ */ jsx7("div", { className: "text-right", children: /* @__PURE__ */ jsx7(Text5, { size: "small", leading: "compact", children: getLocaleAmount(order.tax_total, order.currency_code) }) })
|
|
1088
|
-
] }),
|
|
1089
|
-
isTaxOpen && /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-1 pl-5", children: Object.entries(taxCodes).map(([code, total]) => {
|
|
1090
|
-
return /* @__PURE__ */ jsxs7(
|
|
1091
|
-
"div",
|
|
1092
|
-
{
|
|
1093
|
-
className: "flex items-center justify-between gap-x-2",
|
|
1094
|
-
children: [
|
|
1095
|
-
/* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7("span", { className: "txt-small text-ui-fg-subtle font-medium", children: code }) }),
|
|
1096
|
-
/* @__PURE__ */ jsx7("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx7("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
1097
|
-
/* @__PURE__ */ jsx7("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
1098
|
-
]
|
|
1099
|
-
},
|
|
1100
|
-
code
|
|
1101
|
-
);
|
|
1102
|
-
}) })
|
|
1103
|
-
] }),
|
|
1104
|
-
commissionTotal > 0 && /* @__PURE__ */ jsx7(
|
|
1105
|
-
Cost,
|
|
1106
|
-
{
|
|
1107
|
-
label: t("fields.commission"),
|
|
1108
|
-
value: getLocaleAmount(commissionTotal, order.currency_code)
|
|
1109
|
-
}
|
|
1110
|
-
)
|
|
1111
|
-
] });
|
|
1112
|
-
};
|
|
1113
|
-
var Total2 = ({ order }) => {
|
|
1114
|
-
const { t } = useTranslation7();
|
|
1115
|
-
return /* @__PURE__ */ jsxs7("div", { className: " flex flex-col gap-y-2 px-6 py-4", children: [
|
|
1116
|
-
/* @__PURE__ */ jsxs7("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
1117
|
-
/* @__PURE__ */ jsx7(
|
|
1118
|
-
Text5,
|
|
1119
|
-
{
|
|
1120
|
-
weight: "plus",
|
|
1121
|
-
className: "text-ui-fg-subtle",
|
|
1122
|
-
size: "small",
|
|
1123
|
-
leading: "compact",
|
|
1124
|
-
children: t("fields.total")
|
|
1125
|
-
}
|
|
1126
|
-
),
|
|
1127
|
-
/* @__PURE__ */ jsx7(
|
|
1128
|
-
Text5,
|
|
1129
|
-
{
|
|
1130
|
-
weight: "plus",
|
|
1131
|
-
className: "text-ui-fg-subtle",
|
|
1132
|
-
size: "small",
|
|
1133
|
-
leading: "compact",
|
|
1134
|
-
children: getStylizedAmount(order.total, order.currency_code)
|
|
1135
|
-
}
|
|
1136
|
-
)
|
|
1137
|
-
] }),
|
|
1138
|
-
/* @__PURE__ */ jsxs7("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
1139
|
-
/* @__PURE__ */ jsx7(
|
|
1140
|
-
Text5,
|
|
1141
|
-
{
|
|
1142
|
-
weight: "plus",
|
|
1143
|
-
className: "text-ui-fg-subtle",
|
|
1144
|
-
size: "small",
|
|
1145
|
-
leading: "compact",
|
|
1146
|
-
children: t("fields.paidTotal")
|
|
1147
|
-
}
|
|
1148
|
-
),
|
|
1149
|
-
/* @__PURE__ */ jsx7(
|
|
1150
|
-
Text5,
|
|
1151
|
-
{
|
|
1152
|
-
weight: "plus",
|
|
1153
|
-
className: "text-ui-fg-subtle",
|
|
1154
|
-
size: "small",
|
|
1155
|
-
leading: "compact",
|
|
1156
|
-
children: getStylizedAmount(
|
|
1157
|
-
getTotalCaptured(order.payment_collections || []),
|
|
1158
|
-
order.currency_code
|
|
1159
|
-
)
|
|
1160
|
-
}
|
|
1161
|
-
)
|
|
1162
|
-
] })
|
|
1163
|
-
] });
|
|
1164
|
-
};
|
|
1165
|
-
|
|
1166
|
-
// src/pages/orders/[id]/order-detail-page.tsx
|
|
1167
|
-
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1168
|
-
var Root = ({ children }) => {
|
|
1169
|
-
const initialData = useLoaderData();
|
|
1170
|
-
const { id } = useParams();
|
|
1171
|
-
const { order, isLoading, isError, error } = useOrder(
|
|
1172
|
-
id,
|
|
1173
|
-
{
|
|
1174
|
-
fields: DEFAULT_FIELDS
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
initialData
|
|
1178
|
-
}
|
|
1179
|
-
);
|
|
1180
|
-
if (order) {
|
|
1181
|
-
order.items = order.items.sort((itemA, itemB) => {
|
|
1182
|
-
if (itemA.created_at > itemB.created_at) {
|
|
1183
|
-
return 1;
|
|
1184
|
-
}
|
|
1185
|
-
if (itemA.created_at < itemB.created_at) {
|
|
1186
|
-
return -1;
|
|
1187
|
-
}
|
|
1188
|
-
return 0;
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1191
|
-
if (isLoading || !order) {
|
|
1192
|
-
return /* @__PURE__ */ jsx8(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 2, showJSON: true });
|
|
1193
|
-
}
|
|
1194
|
-
if (isError) {
|
|
1195
|
-
throw error;
|
|
1196
|
-
}
|
|
1197
|
-
return /* @__PURE__ */ jsx8(Fragment3, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs8(TwoColumnPage, { data: order, hasOutlet: true, children: [
|
|
1198
|
-
/* @__PURE__ */ jsxs8(TwoColumnPage.Main, { children: [
|
|
1199
|
-
/* @__PURE__ */ jsx8(OrderGeneralSection, { order }),
|
|
1200
|
-
/* @__PURE__ */ jsx8(OrderSummarySection, { order }),
|
|
1201
|
-
/* @__PURE__ */ jsx8(OrderPaymentSection, { order }),
|
|
1202
|
-
/* @__PURE__ */ jsx8(OrderFulfillmentSection, { order })
|
|
1203
|
-
] }),
|
|
1204
|
-
/* @__PURE__ */ jsx8(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx8(OrderCustomerSection, { order }) })
|
|
1205
|
-
] }) });
|
|
1206
|
-
};
|
|
1207
|
-
var OrderDetailPage = Object.assign(Root, {
|
|
1208
|
-
Main: TwoColumnPage.Main,
|
|
1209
|
-
Sidebar: TwoColumnPage.Sidebar,
|
|
1210
|
-
MainGeneralSection: OrderGeneralSection,
|
|
1211
|
-
MainSummarySection: OrderSummarySection,
|
|
1212
|
-
MainPaymentSection: OrderPaymentSection,
|
|
1213
|
-
MainFulfillmentSection: OrderFulfillmentSection,
|
|
1214
|
-
SidebarCustomerSection: OrderCustomerSection
|
|
1215
|
-
});
|
|
1216
|
-
export {
|
|
1217
|
-
OrderDetailPage,
|
|
1218
|
-
loader
|
|
1219
|
-
};
|