@mercurjs/vendor 2.1.6 → 2.2.0-canary.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/[id]-A55T2ORL.js +3066 -0
  2. package/dist/[id]-B4YZTANM.js +1571 -0
  3. package/dist/{[id]-UTKO3VG4.js → [id]-EKLRGVBA.js} +10 -10
  4. package/dist/{[id]-TO6KT3ZE.js → [id]-FE5GYYVZ.js} +28 -25
  5. package/dist/{[id]-4VCL3MMM.js → [id]-GBT6VB4S.js} +29 -23
  6. package/dist/{[id]-3G5G7ZFV.js → [id]-GC3ZYPK4.js} +25 -22
  7. package/dist/{[id]-6PXEWRG7.js → [id]-J6BZG5PU.js} +14 -14
  8. package/dist/{[id]-B3LHVQM5.js → [id]-QOEO3JOV.js} +29 -23
  9. package/dist/{[id]-H3C3ZSC6.js → [id]-QQU5HVFU.js} +29 -23
  10. package/dist/{[id]-PDGHF5J2.js → [id]-SHAJTJNZ.js} +43 -36
  11. package/dist/{[id]-X4DDKOMQ.js → [id]-T5ECVBPF.js} +30 -24
  12. package/dist/{[id]-T2ROPEGY.js → [id]-U5KZEQDR.js} +7 -7
  13. package/dist/{[id]-7RUAH3TI.js → [id]-YPCO3DJV.js} +5 -5
  14. package/dist/{[id]-Y7GAMNC5.js → [id]-ZCMSBEVM.js} +4 -4
  15. package/dist/{[location_id]-D55RQOXT.js → [location_id]-NUBXDDJC.js} +9 -9
  16. package/dist/{[province_id]-OFH2ZOFQ.js → [province_id]-6GUA4PV5.js} +23 -20
  17. package/dist/{add-C6OX5C54.js → add-NTRYWOJF.js} +42 -35
  18. package/dist/add-RU3WL4YB.js +428 -0
  19. package/dist/{add-customer-groups-PJRJUWS2.js → add-customer-groups-U5RZWW4B.js} +19 -16
  20. package/dist/{add-products-INOLNPO6.js → add-products-Q4MMDQKT.js} +26 -20
  21. package/dist/{add-promotions-AHDOP52Q.js → add-promotions-3AYXQXTP.js} +8 -8
  22. package/dist/{add-to-campaign-HL6NGRR4.js → add-to-campaign-QKYQCSR2.js} +4 -4
  23. package/dist/{address-KRENKSLP.js → address-77Y3AOQ3.js} +19 -16
  24. package/dist/{adjust-inventory-H4EUP7J3.js → adjust-inventory-AFJLWF5R.js} +2 -2
  25. package/dist/{allocate-items-SUCUZU4D.js → allocate-items-TCM5A55Y.js} +141 -126
  26. package/dist/{areas-UUMZDXLX.js → areas-XUC5V5UO.js} +8 -8
  27. package/dist/{attributes-CALEHJJG.js → attributes-SZP2MM5L.js} +3 -3
  28. package/dist/{breadcrumb-KQSFIXQ4.js → breadcrumb-2XA2WOK7.js} +1 -1
  29. package/dist/{breadcrumb-IG7VZGW2.js → breadcrumb-5NP23D6X.js} +15 -12
  30. package/dist/{breadcrumb-TW5JEOYS.js → breadcrumb-EVZIOB2G.js} +14 -11
  31. package/dist/{breadcrumb-OIGGCB3L.js → breadcrumb-FPWBT76A.js} +8 -2
  32. package/dist/{breadcrumb-BS7Y5OKF.js → breadcrumb-IK6XCQOQ.js} +2 -2
  33. package/dist/{breadcrumb-M5Z5WA6I.js → breadcrumb-KTARIL65.js} +2 -2
  34. package/dist/{breadcrumb-VNNZ3TTW.js → breadcrumb-PBR27GGX.js} +3 -3
  35. package/dist/breadcrumb-THJ2HPRB.js +26 -0
  36. package/dist/{breadcrumb-6W2VP3OZ.js → breadcrumb-TNJSGX4T.js} +15 -12
  37. package/dist/{campaigns-HS6MIO7X.js → campaigns-JAQTSA4Z.js} +6 -6
  38. package/dist/{categories-PKWR3FM3.js → categories-T4QJYX4R.js} +8 -8
  39. package/dist/{chunk-4URLUCTD.js → chunk-25E4KME5.js} +3 -3
  40. package/dist/chunk-27KRIXMQ.js +71 -0
  41. package/dist/{chunk-SFQKKIHA.js → chunk-27WLUOI2.js} +1 -1
  42. package/dist/{chunk-ZYOXKUKZ.js → chunk-2QTNCGKX.js} +1 -1
  43. package/dist/{chunk-5UD4P6YL.js → chunk-2USXZSTK.js} +4 -4
  44. package/dist/{chunk-PXYDR7WQ.js → chunk-3BXCPHN6.js} +3 -2
  45. package/dist/{chunk-VQ5EKDA3.js → chunk-3PMM6AMP.js} +3 -3
  46. package/dist/{chunk-J6BRLL3F.js → chunk-463CNCJC.js} +3 -3
  47. package/dist/{chunk-Y2QI7KWS.js → chunk-4LVP635F.js} +408 -664
  48. package/dist/{chunk-UL4O5M4S.js → chunk-4S6XGIC6.js} +1 -18
  49. package/dist/{chunk-RUE5BPC2.js → chunk-5QI3NDJG.js} +1 -1
  50. package/dist/{chunk-PPLC4IKI.js → chunk-5T6UWTRU.js} +10 -5
  51. package/dist/{chunk-WITQNQXN.js → chunk-6FUIK3PX.js} +4 -4
  52. package/dist/{chunk-HGQTL7NX.js → chunk-6K6EQOJF.js} +3 -3
  53. package/dist/{chunk-KAZ5BYTQ.js → chunk-6OUPJNYO.js} +5 -3
  54. package/dist/{chunk-PEKANQ3T.js → chunk-6UZERVBI.js} +2 -2
  55. package/dist/{chunk-RTAWYMQP.js → chunk-7CMRFP5Q.js} +2 -2
  56. package/dist/{chunk-I2IKYOZX.js → chunk-7IPCLQ5V.js} +19 -19
  57. package/dist/chunk-ADGVQVHP.js +101 -0
  58. package/dist/{chunk-IZ5RG5XI.js → chunk-AJLGY3LQ.js} +1 -21
  59. package/dist/chunk-BER45EYD.js +82 -0
  60. package/dist/{chunk-PCMNEUMV.js → chunk-BXRNZS5K.js} +1 -1
  61. package/dist/chunk-CFRWIQIZ.js +43 -0
  62. package/dist/{chunk-RL7SFZOF.js → chunk-DDJQRV6E.js} +1 -1
  63. package/dist/{chunk-D2MA5TAP.js → chunk-DO4F5FIO.js} +2 -2
  64. package/dist/{chunk-X4FLOQ45.js → chunk-DQKK43PR.js} +3 -3
  65. package/dist/{chunk-6WY5X4PE.js → chunk-E6W57UP3.js} +35 -125
  66. package/dist/chunk-FP6U6BPH.js +61 -0
  67. package/dist/chunk-FWPGOIFA.js +22 -0
  68. package/dist/{chunk-BLVJAKBA.js → chunk-FWS4YJ4B.js} +1 -1
  69. package/dist/chunk-GAE6TKOR.js +811 -0
  70. package/dist/{chunk-3CK6OINO.js → chunk-GDWBOQI5.js} +3 -5
  71. package/dist/{chunk-PDQSPKG5.js → chunk-GN6KB75Z.js} +1 -1
  72. package/dist/chunk-HDEOZN2Q.js +60 -0
  73. package/dist/chunk-IBEUR3J7.js +173 -0
  74. package/dist/chunk-J6XCRFBW.js +30 -0
  75. package/dist/{chunk-ZEVYT6IX.js → chunk-JAUZ73XE.js} +151 -266
  76. package/dist/{chunk-CNLP35S7.js → chunk-K6LOZ4S3.js} +54 -18
  77. package/dist/{chunk-JQP7MOFH.js → chunk-KIFSQOM2.js} +2 -2
  78. package/dist/{chunk-DARJTN4I.js → chunk-L4KBTV57.js} +9 -2
  79. package/dist/chunk-L57USMYC.js +39 -0
  80. package/dist/chunk-LARLBYU6.js +127 -0
  81. package/dist/chunk-LDZCCWJB.js +518 -0
  82. package/dist/chunk-LEWA4BPH.js +18 -0
  83. package/dist/chunk-LFX6WU4A.js +36 -0
  84. package/dist/{chunk-ITI54CII.js → chunk-LKUW5SV4.js} +6 -6
  85. package/dist/{chunk-LPOAVK6Y.js → chunk-LQD232FW.js} +47 -12
  86. package/dist/{chunk-4MFMCZEJ.js → chunk-MJCL3WID.js} +2 -2
  87. package/dist/{chunk-32RYSB2V.js → chunk-NBKWY6XN.js} +2 -2
  88. package/dist/{chunk-GYV6SKY7.js → chunk-O7VOGTLX.js} +4 -6
  89. package/dist/{chunk-KQGVSLUI.js → chunk-OYKUQXJX.js} +1926 -957
  90. package/dist/{chunk-CYTNBXWF.js → chunk-OZ44ATGE.js} +8 -8
  91. package/dist/{chunk-7Q5SDEK7.js → chunk-PAVZ6FPK.js} +7 -7
  92. package/dist/{chunk-2RHAI7WK.js → chunk-QLBIBLOY.js} +2 -2
  93. package/dist/chunk-RXV7INUV.js +426 -0
  94. package/dist/chunk-S23FD6FA.js +210 -0
  95. package/dist/{chunk-NYDJTWRL.js → chunk-SGR4DMCW.js} +4 -4
  96. package/dist/{chunk-OXXL4WQU.js → chunk-SPOHNK4X.js} +6 -6
  97. package/dist/{chunk-AIF2KTEE.js → chunk-SSUUT5LK.js} +12 -2
  98. package/dist/{chunk-QX45GVAL.js → chunk-SZBERGA4.js} +8 -8
  99. package/dist/{chunk-6SBMVLJ2.js → chunk-T5MJWWDX.js} +2 -2
  100. package/dist/chunk-T6LHVNWO.js +27 -0
  101. package/dist/chunk-TBYCZRZ7.js +248 -0
  102. package/dist/chunk-TF6V3TFG.js +438 -0
  103. package/dist/chunk-TW324MAT.js +185 -0
  104. package/dist/{chunk-4ZGFODSC.js → chunk-TYESCFYW.js} +1 -1
  105. package/dist/chunk-U5G3AVED.js +64 -0
  106. package/dist/chunk-U6PBLMXD.js +14 -0
  107. package/dist/{chunk-GZMXTNDN.js → chunk-UCYSCKZV.js} +1432 -1380
  108. package/dist/{chunk-P3ZTO6T2.js → chunk-UFFVRF4V.js} +2 -2
  109. package/dist/chunk-UM7ZR3VU.js +14 -0
  110. package/dist/chunk-UORPTGV2.js +114 -0
  111. package/dist/{chunk-5M3SL4UZ.js → chunk-VCOQ7WQ2.js} +30 -106
  112. package/dist/chunk-VCUUITW6.js +35 -0
  113. package/dist/{chunk-PTW7JNAP.js → chunk-VDHW6H5F.js} +5 -5
  114. package/dist/chunk-VZUA5SRD.js +62 -0
  115. package/dist/{chunk-DKQ4XMSN.js → chunk-X4GWB6AT.js} +6 -6
  116. package/dist/{chunk-6YA3C4NB.js → chunk-XCIMOIX6.js} +3 -12
  117. package/dist/chunk-XP23ZVQT.js +2183 -0
  118. package/dist/{chunk-WBI7FEGI.js → chunk-Y2MQ5EMD.js} +29 -24
  119. package/dist/chunk-YBF45CX5.js +23 -0
  120. package/dist/{chunk-N7OVXN72.js → chunk-YGJCJBPM.js} +1 -1
  121. package/dist/{chunk-WNVEMFIK.js → chunk-YHIJCI4U.js} +3 -3
  122. package/dist/{chunk-WFE6CT6M.js → chunk-YQZBAP3S.js} +22 -76
  123. package/dist/chunk-ZHFFTT3I.js +17 -0
  124. package/dist/{collections-DJZI2RM2.js → collections-URH2TCWJ.js} +28 -24
  125. package/dist/{configuration-GN3TO77H.js → configuration-7IYZ6GNP.js} +3 -3
  126. package/dist/{configuration-RHPIO2QT.js → configuration-C4IGBNXH.js} +1 -1
  127. package/dist/{create-7S7CZWEN.js → create-5PSOIHIT.js} +4 -4
  128. package/dist/create-7R6CZU53.js +215 -0
  129. package/dist/{create-3EK5CNNX.js → create-A7B3MLJX.js} +41 -34
  130. package/dist/create-F5R76QML.js +1178 -0
  131. package/dist/create-FKRYB7ZS.js +1784 -0
  132. package/dist/create-GGACODDN.js +1914 -0
  133. package/dist/{create-YO55Z3YD.js → create-HVZYJ3YC.js} +35 -38
  134. package/dist/{create-IDVCZHIX.js → create-JF2OUZQA.js} +16 -13
  135. package/dist/{create-3ZVXEPX5.js → create-JGYG5SBM.js} +29 -23
  136. package/dist/{create-G4T2PAJH.js → create-MS6KKFSV.js} +21 -18
  137. package/dist/{create-OCFPLNNY.js → create-MZYXMGKP.js} +6 -6
  138. package/dist/{create-HKJVSFB7.js → create-O35JRZEF.js} +25 -22
  139. package/dist/{create-OGLPDVOI.js → create-ODOFJF5N.js} +40 -37
  140. package/dist/{create-GHM7OTCR.js → create-R7K3ECN6.js} +1 -1
  141. package/dist/{create-D6EW3EWC.js → create-SFU3W3ZH.js} +1 -1
  142. package/dist/create-TKXH5KQY.js +239 -0
  143. package/dist/{create-33TRLASX.js → create-UPYB65PD.js} +1 -1
  144. package/dist/{create-KGYL7FBM.js → create-XVHOCZHJ.js} +1 -1
  145. package/dist/{create-4AE3VTWN.js → create-YBF4YGWG.js} +2 -2
  146. package/dist/{customers-6ZLE65UX.js → customers-SOLJ2KQQ.js} +5 -5
  147. package/dist/{edit-QBISX7D3.js → edit-2R5QCPTB.js} +16 -13
  148. package/dist/{edit-IR6V2IDN.js → edit-3E4ZO7HT.js} +21 -18
  149. package/dist/{edit-ZSOI56BQ.js → edit-4G5D7TES.js} +52 -40
  150. package/dist/{edit-B5B3XKDM.js → edit-522DG3BY.js} +1 -1
  151. package/dist/{edit-B75KK5ZX.js → edit-5CROKEJE.js} +41 -34
  152. package/dist/{edit-ATXE6CM5.js → edit-C4OCKQVU.js} +1 -1
  153. package/dist/{edit-7HTH2UJF.js → edit-FXNXTVIW.js} +3 -3
  154. package/dist/{edit-RNT555GP.js → edit-G2E5SNGU.js} +15 -12
  155. package/dist/{edit-4HZHLYI3.js → edit-GQNIINRR.js} +1 -1
  156. package/dist/{edit-2KRJIPRK.js → edit-HTLLYECP.js} +21 -18
  157. package/dist/{edit-LRRJTHV2.js → edit-KAKVPHZZ.js} +1 -1
  158. package/dist/{edit-GIJXLMC3.js → edit-O4JLGKQR.js} +2 -2
  159. package/dist/{edit-FNDDSSMT.js → edit-OKU6FMHJ.js} +60 -9
  160. package/dist/{edit-5CJZRHAA.js → edit-ORXS3A2Y.js} +1 -1
  161. package/dist/{edit-FC64DWB2.js → edit-Q3UQIOLS.js} +1 -1
  162. package/dist/edit-VVLITC2E.js +910 -0
  163. package/dist/edit-XSICGAVO.js +176 -0
  164. package/dist/{edit-7GVP6SRA.js → edit-ZAHCMF5U.js} +1 -1
  165. package/dist/{edit-MYSWY6W4.js → edit-ZMERG3L7.js} +1 -1
  166. package/dist/{edit-budget-J27CSEZH.js → edit-budget-L3CCEWNF.js} +1 -1
  167. package/dist/{edit-inventory-item-US77M2FF.js → edit-inventory-item-ZKXXL3QK.js} +2 -2
  168. package/dist/{edit-inventory-item-attributes-UGAE2NAZ.js → edit-inventory-item-attributes-GSKUMORD.js} +3 -3
  169. package/dist/{fulfillment-DCS67LTK.js → fulfillment-76IVZ266.js} +32 -22
  170. package/dist/{fulfillment-providers-GM5PO6N3.js → fulfillment-providers-G2L6LEVO.js} +24 -20
  171. package/dist/index.css +104 -65
  172. package/dist/index.d.ts +3 -10
  173. package/dist/index.js +549 -456
  174. package/dist/{inventory-OPZ2FSEE.js → inventory-WSFLTA6Z.js} +7 -7
  175. package/dist/{invite-KEJLNXEZ.js → invite-2673PU4I.js} +17 -13
  176. package/dist/{invite-CQCKEQW2.js → invite-HRXZ5YBP.js} +28 -24
  177. package/dist/loader-VDYPD3RI.js +31 -0
  178. package/dist/{locations-ZVPTQCQY.js → locations-INS6FTMJ.js} +4 -4
  179. package/dist/{login-OUHRNNXA.js → login-TWUBU6I6.js} +14 -11
  180. package/dist/{manage-locations-YUKEFCBJ.js → manage-locations-XHH5DVIR.js} +2 -2
  181. package/dist/{media-4KYFHB5V.js → media-Z4N5MKFG.js} +42 -9
  182. package/dist/{metadata-AWUKZ25V.js → metadata-5BPOBBU2.js} +3 -3
  183. package/dist/{metadata-OCE6A3JE.js → metadata-D6M66NQK.js} +17 -14
  184. package/dist/{metadata-PYY4IB7K.js → metadata-NIDIBXJT.js} +17 -14
  185. package/dist/{metadata-XP3ZYW2M.js → metadata-Q74OJWUD.js} +18 -15
  186. package/dist/{metadata-NYYL26MQ.js → metadata-REQIFWWH.js} +18 -15
  187. package/dist/{metadata-G7KZXVNE.js → metadata-YVHJPDLD.js} +17 -14
  188. package/dist/offer-create-page-E4FLSDJQ.js +743 -0
  189. package/dist/offer-detail-page-6SIBQTLP.js +492 -0
  190. package/dist/offer-edit-page-3MO566RP.js +151 -0
  191. package/dist/offer-inventory-batch-page-BD6PMDLW.js +290 -0
  192. package/dist/offer-pricing-edit-page-4TINK42V.js +199 -0
  193. package/dist/offers-GVN5LCK6.js +32 -0
  194. package/dist/{onboarding-WXZHW62K.js → onboarding-MK2RIFD4.js} +24 -21
  195. package/dist/{orders-LWJ472VM.js → orders-TVQDR4OJ.js} +30 -26
  196. package/dist/organization-XO3T2K2X.js +340 -0
  197. package/dist/{organize-RFOMQCBG.js → organize-5XRZWD5C.js} +4 -4
  198. package/dist/{organize-OVKJ3HZO.js → organize-Z7JTTDH4.js} +4 -4
  199. package/dist/pages/index.d.ts +439 -758
  200. package/dist/pages/index.js +85 -78
  201. package/dist/{payment-details-UVXYCTUK.js → payment-details-CFTX3QDL.js} +19 -16
  202. package/dist/{payouts-TR7K5I37.js → payouts-7Q7D4FET.js} +8 -8
  203. package/dist/{price-lists-S2WNELFZ.js → price-lists-6TFLA53G.js} +9 -9
  204. package/dist/{pricing-UF27DAXA.js → pricing-ECXV6K7G.js} +41 -37
  205. package/dist/{product-tags-2CKH2M6D.js → product-tags-5O7ZG6SA.js} +40 -33
  206. package/dist/{product-types-FX43JEO2.js → product-types-PKUEL7X5.js} +6 -6
  207. package/dist/product-variant-detail-PUWOMVHQ.js +210 -0
  208. package/dist/{product-variant-edit-P3DSIFE3.js → product-variant-edit-WZNO4CQX.js} +134 -66
  209. package/dist/{products-H5EMRJYS.js → products-BM3IIH5P.js} +27 -21
  210. package/dist/{products-2LHGS7X3.js → products-CPTRYL2Z.js} +44 -45
  211. package/dist/{professional-details-HYKTH44B.js → professional-details-ED4HNYXY.js} +18 -15
  212. package/dist/{profile-PB27WIRW.js → profile-6TGCNNUU.js} +21 -18
  213. package/dist/{promotions-5EYPGHJP.js → promotions-4336KI7E.js} +9 -9
  214. package/dist/receive-224KLULH.js +578 -0
  215. package/dist/refund-IGMSXQNX.js +268 -0
  216. package/dist/{register-X45K325N.js → register-OZ5CRANZ.js} +18 -15
  217. package/dist/{reset-password-GTWLBOFK.js → reset-password-5UHZU4D3.js} +1 -1
  218. package/dist/{return-reasons-LOKYRGMI.js → return-reasons-QJRA2ZX6.js} +21 -17
  219. package/dist/{sales-channels-Y4LRP7JC.js → sales-channels-CZDU7VTE.js} +7 -6
  220. package/dist/{sales-channels-7R2IY3KG.js → sales-channels-U55MUDQP.js} +7 -6
  221. package/dist/{settings-2XDLFYMS.js → settings-2GCQQTO6.js} +47 -40
  222. package/dist/shipment-HWQHMX2L.js +242 -0
  223. package/dist/{shipping-profile-R3NABPQF.js → shipping-profile-ZP7M6VSS.js} +2 -2
  224. package/dist/{shipping-profiles-QVKNFLCW.js → shipping-profiles-C5WBXWZ2.js} +21 -18
  225. package/dist/{stock-5RXNUPUT.js → stock-MQA7PRO6.js} +21 -18
  226. package/dist/{store-MPYOWMZT.js → store-5ZHZR4JI.js} +84 -149
  227. package/dist/{store-closure-DNMCHUXD.js → store-closure-H5WHV3LA.js} +24 -16
  228. package/dist/{store-select-UTPJ7DM7.js → store-select-PZS556FB.js} +19 -16
  229. package/dist/{tax-regions-UD6P5FVC.js → tax-regions-HDLBFZVG.js} +6 -6
  230. package/dist/{team-IMS66MVP.js → team-CLKJCZNH.js} +29 -26
  231. package/dist/types-CtCEtTE6.d.ts +16 -0
  232. package/package.json +5 -5
  233. package/dist/[id]-BYP37PU4.js +0 -1314
  234. package/dist/[id]-INOFZHL7.js +0 -1219
  235. package/dist/add-KRAGFFBJ.js +0 -158
  236. package/dist/bulk-edit-3SMBLIOA.js +0 -244
  237. package/dist/chunk-47SXTGLN.js +0 -397
  238. package/dist/chunk-4KX6CBJ4.js +0 -178
  239. package/dist/chunk-DLNNTQRY.js +0 -217
  240. package/dist/chunk-FX4V5JCF.js +0 -37
  241. package/dist/chunk-GC33DBKG.js +0 -143
  242. package/dist/chunk-LQYMBSRQ.js +0 -66
  243. package/dist/chunk-NK4NR6MN.js +0 -173
  244. package/dist/chunk-PFU6FSXY.js +0 -430
  245. package/dist/chunk-QJEOPT2P.js +0 -330
  246. package/dist/chunk-QSGR43JM.js +0 -30
  247. package/dist/chunk-STR3NGWE.js +0 -3736
  248. package/dist/create-3DOO3RNH.js +0 -716
  249. package/dist/create-I7HV3RM6.js +0 -150
  250. package/dist/edit-K2AD335I.js +0 -237
  251. package/dist/edit-VO5XLIEL.js +0 -362
  252. package/dist/edit-stocks-and-prices-MHHQFWFA.js +0 -408
  253. package/dist/organization-LPYQRTQC.js +0 -303
  254. package/dist/prices-3OXV5RGY.js +0 -270
  255. package/dist/product-variant-detail-WV4KXVXR.js +0 -590
  256. package/dist/shipment-4GW2JFWB.js +0 -174
  257. package/dist/stock-GPC3BCL6.js +0 -500
  258. package/dist/{chunk-SDSEW72R.js → chunk-E2HQPY32.js} +3 -3
  259. /package/dist/{chunk-CAS74NLJ.js → chunk-YV6MK4PZ.js} +0 -0
@@ -1,174 +0,0 @@
1
- import "./chunk-TKGWSUEI.js";
2
- import {
3
- KeyboundForm
4
- } from "./chunk-U2ZFCAPX.js";
5
- import {
6
- RouteFocusModal,
7
- useRouteModal
8
- } from "./chunk-3CK6OINO.js";
9
- import {
10
- Form
11
- } from "./chunk-3QSRE5LS.js";
12
- import "./chunk-47SXTGLN.js";
13
- import "./chunk-F4OJN2F2.js";
14
- import "./chunk-LRARA622.js";
15
- import "./chunk-M6N4ISXL.js";
16
- import "./chunk-S7EKBD2C.js";
17
- import "./chunk-VXMOPVRH.js";
18
- import "./chunk-IQWK723D.js";
19
- import "./chunk-VV6IKGCN.js";
20
- import "./chunk-PCMNEUMV.js";
21
- import "./chunk-BOZJOOGW.js";
22
- import "./chunk-RL7SFZOF.js";
23
- import "./chunk-LWJF63JW.js";
24
- import "./chunk-NBPMNUKZ.js";
25
- import {
26
- useCreateOrderShipment,
27
- useOrder
28
- } from "./chunk-WBI7FEGI.js";
29
- import "./chunk-VXWN37PT.js";
30
- import "./chunk-UL4O5M4S.js";
31
- import "./chunk-FX4V5JCF.js";
32
- import "./chunk-3B34B2M2.js";
33
- import "./chunk-RUE5BPC2.js";
34
- import "./chunk-ZEVYT6IX.js";
35
- import "./chunk-A5DJIOHN.js";
36
- import "./chunk-RHKRREUU.js";
37
- import "./chunk-ZA2KFUFR.js";
38
- import "./chunk-RIN4CBRB.js";
39
- import "./chunk-NBMM2TZK.js";
40
-
41
- // src/pages/orders/[id]/shipment/index.tsx
42
- import { useParams } from "react-router-dom";
43
-
44
- // src/pages/orders/[id]/shipment/order-create-shipment-form/order-create-shipment-form.tsx
45
- import { zodResolver } from "@hookform/resolvers/zod";
46
- import { useTranslation } from "react-i18next";
47
- import { Button, Heading, Input, toast } from "@medusajs/ui";
48
- import { useFieldArray, useForm } from "react-hook-form";
49
-
50
- // src/pages/orders/[id]/shipment/order-create-shipment-form/constants.ts
51
- import { z } from "zod";
52
- var CreateShipmentSchema = z.object({
53
- labels: z.array(
54
- z.object({
55
- tracking_number: z.string(),
56
- // TODO: this 2 are not optional in the API
57
- tracking_url: z.string().optional(),
58
- label_url: z.string().optional()
59
- })
60
- )
61
- });
62
-
63
- // src/pages/orders/[id]/shipment/order-create-shipment-form/order-create-shipment-form.tsx
64
- import { jsx, jsxs } from "react/jsx-runtime";
65
- function OrderCreateShipmentForm({
66
- order,
67
- fulfillment
68
- }) {
69
- const { t } = useTranslation();
70
- const { handleSuccess } = useRouteModal();
71
- const { mutateAsync: createShipment, isPending: isMutating } = useCreateOrderShipment(order.id, fulfillment?.id);
72
- const form = useForm({
73
- defaultValues: {},
74
- resolver: zodResolver(CreateShipmentSchema)
75
- });
76
- const { fields: labels, append } = useFieldArray({
77
- name: "labels",
78
- control: form.control
79
- });
80
- const handleSubmit = form.handleSubmit(async (data) => {
81
- await createShipment(
82
- {
83
- items: fulfillment?.items?.map((i) => ({ id: i?.line_item_id, quantity: i.quantity })).filter((item) => !!item.id) ?? [],
84
- labels: data.labels.filter((l) => !!l.tracking_number).map((l) => ({
85
- tracking_number: l.tracking_number,
86
- tracking_url: "#",
87
- label_url: "#"
88
- }))
89
- },
90
- {
91
- onSuccess: () => {
92
- toast.success(t("orders.shipment.toastCreated"));
93
- handleSuccess(`/orders/${order.id}`);
94
- },
95
- onError: (e) => {
96
- toast.error(e.message);
97
- }
98
- }
99
- );
100
- });
101
- return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs(
102
- KeyboundForm,
103
- {
104
- onSubmit: handleSubmit,
105
- className: "flex h-full flex-col overflow-hidden",
106
- children: [
107
- /* @__PURE__ */ jsx(RouteFocusModal.Header, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
108
- /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
109
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isMutating, children: t("actions.save") })
110
- ] }) }),
111
- /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex h-full w-full flex-col items-center divide-y overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "flex size-full flex-col items-center overflow-auto p-16", children: /* @__PURE__ */ jsx("div", { className: "flex w-full max-w-[736px] flex-col justify-center px-2 pb-2", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col divide-y", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col", children: [
112
- /* @__PURE__ */ jsx(Heading, { className: "mb-4", children: t("orders.shipment.title") }),
113
- labels.map((label, index) => /* @__PURE__ */ jsx(
114
- Form.Field,
115
- {
116
- control: form.control,
117
- name: `labels.${index}.tracking_number`,
118
- render: ({ field }) => {
119
- return /* @__PURE__ */ jsxs(Form.Item, { className: "mb-4", children: [
120
- index === 0 && /* @__PURE__ */ jsx(Form.Label, { children: t("orders.shipment.trackingUrl") }),
121
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
122
- Input,
123
- {
124
- ...field,
125
- placeholder: t(
126
- "orders.shipment.trackingUrlPlaceholder"
127
- )
128
- }
129
- ) }),
130
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
131
- ] });
132
- }
133
- },
134
- label.id
135
- )),
136
- /* @__PURE__ */ jsx(
137
- Button,
138
- {
139
- type: "button",
140
- onClick: () => append({ tracking_number: "" }),
141
- className: "self-end",
142
- variant: "secondary",
143
- children: t("orders.shipment.addTrackingUrl")
144
- }
145
- )
146
- ] }) }) }) }) })
147
- ]
148
- }
149
- ) });
150
- }
151
-
152
- // src/pages/orders/[id]/shipment/index.tsx
153
- import { jsx as jsx2 } from "react/jsx-runtime";
154
- var Component = () => {
155
- const { id, f_id } = useParams();
156
- const { order, isLoading, isError, error } = useOrder(id, {
157
- fields: "*fulfillments,*fulfillments.items,*fulfillments.labels"
158
- });
159
- if (isError) {
160
- throw error;
161
- }
162
- const ready = !isLoading && order;
163
- const fulfillment = order?.fulfillments?.find((f) => f.id === f_id);
164
- return /* @__PURE__ */ jsx2(RouteFocusModal, { children: ready && fulfillment && /* @__PURE__ */ jsx2(
165
- OrderCreateShipmentForm,
166
- {
167
- order,
168
- fulfillment
169
- }
170
- ) });
171
- };
172
- export {
173
- Component
174
- };
@@ -1,500 +0,0 @@
1
- import {
2
- ProgressBar
3
- } from "./chunk-QSGR43JM.js";
4
- import {
5
- castNumber
6
- } from "./chunk-SMQT3ZNO.js";
7
- import {
8
- DataGrid,
9
- DataGridReadonlyCell,
10
- DataGridSkeleton,
11
- DataGridTogglableNumberCell,
12
- createDataGridHelper,
13
- useDataGridDuplicateCell
14
- } from "./chunk-Y2QI7KWS.js";
15
- import "./chunk-IQPN4PZJ.js";
16
- import "./chunk-TKGWSUEI.js";
17
- import {
18
- KeyboundForm
19
- } from "./chunk-U2ZFCAPX.js";
20
- import {
21
- RouteFocusModal,
22
- useRouteModal
23
- } from "./chunk-3CK6OINO.js";
24
- import "./chunk-3QSRE5LS.js";
25
- import "./chunk-47SXTGLN.js";
26
- import "./chunk-F4OJN2F2.js";
27
- import "./chunk-LRARA622.js";
28
- import "./chunk-M6N4ISXL.js";
29
- import "./chunk-S7EKBD2C.js";
30
- import "./chunk-VXMOPVRH.js";
31
- import "./chunk-IQWK723D.js";
32
- import "./chunk-VV6IKGCN.js";
33
- import "./chunk-PCMNEUMV.js";
34
- import "./chunk-BOZJOOGW.js";
35
- import "./chunk-RL7SFZOF.js";
36
- import "./chunk-LWJF63JW.js";
37
- import {
38
- useStockLocations
39
- } from "./chunk-NBPMNUKZ.js";
40
- import "./chunk-WBI7FEGI.js";
41
- import "./chunk-VXWN37PT.js";
42
- import "./chunk-UL4O5M4S.js";
43
- import "./chunk-FX4V5JCF.js";
44
- import "./chunk-3B34B2M2.js";
45
- import "./chunk-RUE5BPC2.js";
46
- import {
47
- Thumbnail
48
- } from "./chunk-WIYFXWRI.js";
49
- import "./chunk-LAVHRER2.js";
50
- import "./chunk-Y7QKP6QU.js";
51
- import {
52
- Skeleton
53
- } from "./chunk-INNFZYX2.js";
54
- import {
55
- useBatchInventoryItemsLocationLevels,
56
- useProduct
57
- } from "./chunk-ZEVYT6IX.js";
58
- import "./chunk-A5DJIOHN.js";
59
- import "./chunk-RHKRREUU.js";
60
- import "./chunk-ZA2KFUFR.js";
61
- import "./chunk-RIN4CBRB.js";
62
- import "./chunk-NBMM2TZK.js";
63
-
64
- // src/pages/products/[id]/stock/index.tsx
65
- import { AnimatePresence } from "motion/react";
66
- import { Suspense, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
67
- import { useTranslation as useTranslation3 } from "react-i18next";
68
- import { Await, useParams } from "react-router-dom";
69
-
70
- // src/pages/products/[id]/stock/product-stock-form/product-stock-form.tsx
71
- import { zodResolver } from "@hookform/resolvers/zod";
72
- import { Button, toast, usePrompt } from "@medusajs/ui";
73
- import { useEffect, useMemo as useMemo2, useRef, useState } from "react";
74
- import { useForm } from "react-hook-form";
75
- import { useTranslation as useTranslation2 } from "react-i18next";
76
-
77
- // src/pages/products/[id]/stock/use-product-stock-columns.tsx
78
- import { InformationCircle } from "@medusajs/icons";
79
- import { Switch, Tooltip } from "@medusajs/ui";
80
- import { useCallback, useMemo } from "react";
81
- import { useTranslation } from "react-i18next";
82
-
83
- // src/components/data-grid/components/data-grid-duplicate-cell.tsx
84
- import { jsx } from "react/jsx-runtime";
85
- var DataGridDuplicateCell = ({
86
- duplicateOf,
87
- children
88
- }) => {
89
- const { watchedValue } = useDataGridDuplicateCell({ duplicateOf });
90
- return /* @__PURE__ */ jsx("div", { className: "bg-ui-bg-base txt-compact-small text-ui-fg-subtle flex size-full cursor-not-allowed items-center justify-between overflow-hidden px-4 py-2.5 outline-none", children: typeof children === "function" ? children({ value: watchedValue }) : children });
91
- };
92
-
93
- // src/pages/products/[id]/stock/utils.ts
94
- function isProductVariant(item) {
95
- return "product" in item || "product_id" in item;
96
- }
97
- function isProductVariantWithInventoryPivot(row) {
98
- return isProductVariant(row) && Array.isArray(row.inventory_items);
99
- }
100
- function getDisabledInventoryRows(variants) {
101
- const disabled = {};
102
- const inventoryItemToVariant = {};
103
- for (const variant of variants) {
104
- if (!variant.inventory_items) continue;
105
- for (const item of variant.inventory_items) {
106
- const existingMapping = inventoryItemToVariant[item.inventory_item_id];
107
- if (existingMapping && existingMapping.variantId !== variant.id) {
108
- disabled[item.inventory_item_id] = {
109
- id: existingMapping.variantId,
110
- title: existingMapping.title,
111
- sku: existingMapping.sku
112
- };
113
- } else if (!existingMapping) {
114
- inventoryItemToVariant[item.inventory_item_id] = {
115
- variantId: variant.id,
116
- title: variant.title || "",
117
- sku: variant.sku || ""
118
- };
119
- }
120
- }
121
- }
122
- return disabled;
123
- }
124
-
125
- // src/pages/products/[id]/stock/use-product-stock-columns.tsx
126
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
127
- var helper = createDataGridHelper();
128
- var useProductStockColumns = (locations = [], disabled = {}) => {
129
- const { t } = useTranslation();
130
- const getIsDisabled = useCallback(
131
- (item) => {
132
- const disabledItem = disabled[item.inventory_item_id];
133
- const isDisabled = !!disabledItem && disabledItem.id !== item.variant_id;
134
- if (!isDisabled) {
135
- return {
136
- isDisabled: false,
137
- item: void 0
138
- };
139
- }
140
- return {
141
- isDisabled,
142
- item: disabledItem
143
- };
144
- },
145
- [disabled]
146
- );
147
- return useMemo(
148
- () => [
149
- helper.column({
150
- id: "title",
151
- name: "Title",
152
- header: "Title",
153
- cell: (context) => {
154
- const item = context.row.original;
155
- if (isProductVariant(item)) {
156
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-2", children: [
157
- /* @__PURE__ */ jsx2(Thumbnail, { size: "small", src: item.product?.thumbnail }),
158
- /* @__PURE__ */ jsx2("span", { children: item.title || "-" })
159
- ] }) });
160
- }
161
- const { isDisabled, item: disabledItem } = getIsDisabled(item);
162
- if (isDisabled) {
163
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context, color: "normal", children: /* @__PURE__ */ jsxs("div", { className: "flex size-full items-center justify-between gap-x-2", children: [
164
- /* @__PURE__ */ jsx2(
165
- "span",
166
- {
167
- title: item.inventory?.title || void 0,
168
- className: "text-ui-fg-disabled",
169
- children: item.inventory?.title || "-"
170
- }
171
- ),
172
- /* @__PURE__ */ jsx2(
173
- Tooltip,
174
- {
175
- content: disabledItem.sku ? t("products.stock.tooltips.alreadyManagedWithSku", {
176
- title: disabledItem.title,
177
- sku: disabledItem.sku
178
- }) : t("products.stock.tooltips.alreadyManaged", {
179
- title: disabledItem.title
180
- }),
181
- children: /* @__PURE__ */ jsx2(InformationCircle, {})
182
- }
183
- )
184
- ] }) });
185
- }
186
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context, color: "normal", children: item.inventory?.title || "-" });
187
- },
188
- disableHiding: true
189
- }),
190
- helper.column({
191
- id: "sku",
192
- name: "SKU",
193
- header: "SKU",
194
- cell: (context) => {
195
- const item = context.row.original;
196
- if (isProductVariant(item)) {
197
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context, children: item.sku || "-" });
198
- }
199
- const { isDisabled } = getIsDisabled(item);
200
- if (isDisabled) {
201
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context, color: "normal", children: /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-disabled", children: item.inventory?.sku || "-" }) });
202
- }
203
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context, color: "normal", children: item.inventory?.sku || "-" });
204
- },
205
- disableHiding: true
206
- }),
207
- ...locations.map(
208
- (location) => helper.column({
209
- id: `location_${location.id}`,
210
- name: location.name,
211
- header: location.name,
212
- field: (context) => {
213
- const item = context.row.original;
214
- if (isProductVariant(item)) {
215
- return null;
216
- }
217
- const { isDisabled } = getIsDisabled(item);
218
- if (isDisabled) {
219
- return null;
220
- }
221
- return `variants.${item.variant_id}.inventory_items.${item.inventory_item_id}.locations.${location.id}`;
222
- },
223
- type: "togglable-number",
224
- cell: (context) => {
225
- const item = context.row.original;
226
- if (isProductVariant(item)) {
227
- return /* @__PURE__ */ jsx2(DataGridReadonlyCell, { context });
228
- }
229
- const { isDisabled, item: disabledItem } = getIsDisabled(item);
230
- if (isDisabled) {
231
- return /* @__PURE__ */ jsx2(
232
- DataGridDuplicateCell,
233
- {
234
- duplicateOf: `variants.${disabledItem.id}.inventory_items.${item.inventory_item_id}.locations.${location.id}`,
235
- children: ({ value }) => {
236
- const { checked, quantity } = value;
237
- return /* @__PURE__ */ jsxs("div", { className: "flex size-full items-center gap-x-2", children: [
238
- /* @__PURE__ */ jsx2(
239
- Switch,
240
- {
241
- dir: "ltr",
242
- className: "shrink-0 cursor-not-allowed rtl:rotate-180",
243
- tabIndex: -1,
244
- size: "small",
245
- checked,
246
- disabled: true
247
- }
248
- ),
249
- /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-disabled flex size-full items-center justify-end", children: quantity })
250
- ] });
251
- }
252
- }
253
- );
254
- }
255
- return /* @__PURE__ */ jsx2(
256
- DataGridTogglableNumberCell,
257
- {
258
- context,
259
- disabledToggleTooltip: t(
260
- "inventory.stock.disabledToggleTooltip"
261
- ),
262
- placeholder: t("inventory.stock.placeholder")
263
- }
264
- );
265
- }
266
- })
267
- )
268
- ],
269
- [locations, getIsDisabled, t]
270
- );
271
- };
272
-
273
- // src/pages/products/[id]/stock/schema.ts
274
- import { z } from "zod";
275
- var ProductStockLocationSchema = z.object({
276
- id: z.string().optional(),
277
- quantity: z.union([z.number(), z.string()]),
278
- checked: z.boolean(),
279
- disabledToggle: z.boolean().optional()
280
- });
281
- var ProductStockInventoryItemSchema = z.object({
282
- locations: z.record(ProductStockLocationSchema)
283
- });
284
- var ProductStockVariantSchema = z.object({
285
- inventory_items: z.record(ProductStockInventoryItemSchema)
286
- });
287
- var ProductStockSchema = z.object({
288
- variants: z.record(ProductStockVariantSchema)
289
- });
290
-
291
- // src/pages/products/[id]/stock/product-stock-form/product-stock-form.tsx
292
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
293
- var ProductStockForm = ({
294
- variants,
295
- locations,
296
- onLoaded
297
- }) => {
298
- const { t } = useTranslation2();
299
- const { handleSuccess, setCloseOnEscape } = useRouteModal();
300
- const prompt = usePrompt();
301
- useEffect(() => {
302
- onLoaded();
303
- }, [onLoaded]);
304
- const [isPromptOpen, setIsPromptOpen] = useState(false);
305
- const form = useForm({
306
- defaultValues: getDefaultValue(variants, locations),
307
- resolver: zodResolver(ProductStockSchema)
308
- });
309
- const initialValues = useRef(getDefaultValue(variants, locations));
310
- const disabled = useMemo2(() => getDisabledInventoryRows(variants), [variants]);
311
- const columns = useProductStockColumns(locations, disabled);
312
- const { mutateAsync, isPending } = useBatchInventoryItemsLocationLevels();
313
- const onSubmit = form.handleSubmit(async (data) => {
314
- const payload = {
315
- create: [],
316
- update: [],
317
- delete: [],
318
- force: true
319
- };
320
- for (const [variantId, variant] of Object.entries(data.variants)) {
321
- for (const [inventory_item_id, item] of Object.entries(
322
- variant.inventory_items
323
- )) {
324
- for (const [location_id, level] of Object.entries(item.locations)) {
325
- if (level.id) {
326
- const wasChecked = initialValues.current?.variants?.[variantId]?.inventory_items?.[inventory_item_id]?.locations?.[location_id]?.checked;
327
- if (wasChecked && !level.checked) {
328
- payload.delete.push(level.id);
329
- } else {
330
- const newQuantity = level.quantity !== "" ? castNumber(level.quantity) : 0;
331
- const originalQuantity = initialValues.current?.variants?.[variantId]?.inventory_items?.[inventory_item_id]?.locations?.[location_id]?.quantity;
332
- if (newQuantity !== originalQuantity) {
333
- payload.update.push({
334
- inventory_item_id,
335
- location_id,
336
- stocked_quantity: newQuantity
337
- });
338
- }
339
- }
340
- }
341
- if (!level.id && level.quantity !== "") {
342
- payload.create.push({
343
- inventory_item_id,
344
- location_id,
345
- stocked_quantity: castNumber(level.quantity)
346
- });
347
- }
348
- }
349
- }
350
- }
351
- if (payload.delete.length > 0) {
352
- setIsPromptOpen(true);
353
- const confirm = await prompt({
354
- title: t("general.areYouSure"),
355
- description: t("inventory.stock.disablePrompt", {
356
- count: payload.delete.length
357
- }),
358
- confirmText: t("actions.continue"),
359
- cancelText: t("actions.cancel"),
360
- variant: "confirmation"
361
- });
362
- setIsPromptOpen(false);
363
- if (!confirm) {
364
- return;
365
- }
366
- }
367
- await mutateAsync(payload, {
368
- onSuccess: () => {
369
- toast.success(t("inventory.stock.successToast"));
370
- handleSuccess();
371
- },
372
- onError: (error) => {
373
- toast.error(error.message);
374
- }
375
- });
376
- });
377
- return /* @__PURE__ */ jsx3(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs2(KeyboundForm, { onSubmit, className: "flex h-full flex-col", children: [
378
- /* @__PURE__ */ jsx3(RouteFocusModal.Header, {}),
379
- /* @__PURE__ */ jsx3(RouteFocusModal.Body, { className: "flex-1", children: /* @__PURE__ */ jsx3(
380
- DataGrid,
381
- {
382
- state: form,
383
- columns,
384
- data: variants,
385
- getSubRows,
386
- onEditingChange: (editing) => setCloseOnEscape(!editing),
387
- disableInteractions: isPending || isPromptOpen,
388
- multiColumnSelection: true
389
- }
390
- ) }),
391
- /* @__PURE__ */ jsx3(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-end gap-2", children: [
392
- /* @__PURE__ */ jsx3(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx3(Button, { variant: "secondary", size: "small", type: "button", children: t("actions.cancel") }) }),
393
- /* @__PURE__ */ jsx3(Button, { type: "submit", size: "small", isLoading: isPending, children: t("actions.save") })
394
- ] }) })
395
- ] }) });
396
- };
397
- function getSubRows(row) {
398
- if (isProductVariantWithInventoryPivot(row)) {
399
- return row.inventory_items;
400
- }
401
- }
402
- function getDefaultValue(variants, locations) {
403
- return {
404
- variants: variants?.reduce(
405
- (variantAcc, variant) => {
406
- const inventoryItems = variant.inventory_items?.reduce(
407
- (itemAcc, item) => {
408
- const locationsMap = locations.reduce((locationAcc, location) => {
409
- const level = item.inventory?.location_levels?.find(
410
- (level2) => level2.location_id === location.id
411
- );
412
- locationAcc[location.id] = {
413
- id: level?.id,
414
- quantity: level?.stocked_quantity !== void 0 ? level?.stocked_quantity : "",
415
- checked: !!level,
416
- disabledToggle: (level?.incoming_quantity || 0) > 0 || (level?.reserved_quantity || 0) > 0
417
- };
418
- return locationAcc;
419
- }, {});
420
- itemAcc[item.inventory_item_id] = { locations: locationsMap };
421
- return itemAcc;
422
- },
423
- {}
424
- );
425
- variantAcc[variant.id] = { inventory_items: inventoryItems || {} };
426
- return variantAcc;
427
- },
428
- {}
429
- )
430
- };
431
- }
432
-
433
- // src/pages/products/[id]/stock/index.tsx
434
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
435
- var Component = () => {
436
- const { t } = useTranslation3();
437
- const { id } = useParams();
438
- const { product, isLoading: isProductLoading } = useProduct(id);
439
- const { stock_locations, isLoading: isStockLoading } = useStockLocations();
440
- const allVariants = product?.variants?.map((variant) => ({
441
- ...variant,
442
- inventory_items: variant.inventory_items?.map((item) => ({
443
- ...item,
444
- inventory: item.inventory
445
- }))
446
- }));
447
- const [isLoading, setIsLoading] = useState2(false);
448
- const timeoutRef = useRef2();
449
- useEffect2(() => {
450
- timeoutRef.current = setTimeout(() => {
451
- setIsLoading(true);
452
- }, 200);
453
- return () => {
454
- if (timeoutRef.current) {
455
- clearTimeout(timeoutRef.current);
456
- }
457
- };
458
- }, []);
459
- const onLoaded = () => {
460
- if (timeoutRef.current) {
461
- clearTimeout(timeoutRef.current);
462
- }
463
- setIsLoading(false);
464
- };
465
- return /* @__PURE__ */ jsxs3("div", { children: [
466
- /* @__PURE__ */ jsx4("div", { className: "fixed inset-x-0 top-0 z-50 h-1", children: /* @__PURE__ */ jsx4(AnimatePresence, { children: isLoading || isProductLoading || isStockLoading ? /* @__PURE__ */ jsx4(ProgressBar, { duration: 5 }) : null }) }),
467
- /* @__PURE__ */ jsxs3(RouteFocusModal, { children: [
468
- /* @__PURE__ */ jsx4(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx4("span", { className: "sr-only", children: t("products.stock.heading") }) }),
469
- /* @__PURE__ */ jsx4(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx4("span", { className: "sr-only", children: t("products.stock.description") }) }),
470
- /* @__PURE__ */ jsx4(Suspense, { fallback: /* @__PURE__ */ jsx4(ProductStockFallback, {}), children: /* @__PURE__ */ jsx4(Await, { resolve: { allVariants, locations: stock_locations }, children: () => {
471
- return /* @__PURE__ */ jsx4(
472
- ProductStockForm,
473
- {
474
- variants: allVariants || [],
475
- locations: stock_locations || [],
476
- onLoaded
477
- }
478
- );
479
- } }) })
480
- ] })
481
- ] });
482
- };
483
- var ProductStockFallback = () => {
484
- return /* @__PURE__ */ jsx4("div", { className: "relative flex size-full flex-col items-center justify-center divide-y", children: /* @__PURE__ */ jsxs3("div", { className: "flex size-full flex-col divide-y", children: [
485
- /* @__PURE__ */ jsx4("div", { className: "px-4 py-2", children: /* @__PURE__ */ jsx4(Skeleton, { className: "h-7 w-7" }) }),
486
- /* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsx4(
487
- DataGridSkeleton,
488
- {
489
- columns: Array.from({ length: 10 })
490
- }
491
- ) }),
492
- /* @__PURE__ */ jsxs3("div", { className: "bg-ui-bg-base flex items-center justify-end gap-x-2 p-4", children: [
493
- /* @__PURE__ */ jsx4(Skeleton, { className: "h-7 w-[59px]" }),
494
- /* @__PURE__ */ jsx4(Skeleton, { className: "h-7 w-[46px]" })
495
- ] })
496
- ] }) });
497
- };
498
- export {
499
- Component
500
- };
@@ -2,12 +2,12 @@ import {
2
2
  getProvinceByIso2,
3
3
  isProvinceInCountry
4
4
  } from "./chunk-N2TQXB44.js";
5
- import {
6
- IconAvatar
7
- } from "./chunk-U2EI2ZLM.js";
8
5
  import {
9
6
  getCountryByIso2
10
7
  } from "./chunk-JRTZWK77.js";
8
+ import {
9
+ IconAvatar
10
+ } from "./chunk-U2EI2ZLM.js";
11
11
  import {
12
12
  useDeleteTaxRate
13
13
  } from "./chunk-LRARA622.js";
File without changes