@mercurjs/vendor 2.2.1 → 2.3.0-canary.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.
Files changed (204) hide show
  1. package/dist/{[id]-47SUX5X3.js → [id]-3IFUEMOA.js} +12 -9
  2. package/dist/{[id]-PIB2DEVI.js → [id]-3NM7G2QP.js} +11 -8
  3. package/dist/[id]-3TCOLUQH.js +197 -0
  4. package/dist/{[id]-SKU5SFBG.js → [id]-4IWSF6TW.js} +137 -204
  5. package/dist/{[id]-BPQNQFVE.js → [id]-AMZFAAJ3.js} +75 -124
  6. package/dist/[id]-C3TB6V2O.js +286 -0
  7. package/dist/{[id]-NGRV5I2A.js → [id]-HEDNHQ5Z.js} +8 -6
  8. package/dist/[id]-KFACDZAI.js +949 -0
  9. package/dist/{[id]-BHU5BSQT.js → [id]-KFRGBNLH.js} +19 -16
  10. package/dist/{[id]-OE5TUWNF.js → [id]-OVWD6DNG.js} +8 -6
  11. package/dist/{[id]-RJRAZN3T.js → [id]-PJ2K4O3C.js} +7 -5
  12. package/dist/{[id]-ZD5HBP2R.js → [id]-ROMWNPJA.js} +13 -10
  13. package/dist/[id]-UPNI3OCU.js +697 -0
  14. package/dist/{[id]-YB3DBBXT.js → [id]-YFLQXZGC.js} +12 -9
  15. package/dist/{[province_id]-CUWKNPBW.js → [province_id]-IM22PLJP.js} +8 -6
  16. package/dist/{add-YEUSE5QA.js → add-AUSWWCA3.js} +9 -7
  17. package/dist/{add-MYV5IOGP.js → add-MBCWT6XT.js} +157 -227
  18. package/dist/{add-customer-groups-Q3F357F2.js → add-customer-groups-3FD754Z2.js} +7 -5
  19. package/dist/{add-products-WVNYODC6.js → add-products-IS22SHHN.js} +12 -9
  20. package/dist/{add-promotions-F62YE3BE.js → add-promotions-VDD5PKMN.js} +27 -9
  21. package/dist/{add-to-campaign-WBSCTSKW.js → add-to-campaign-B3PGGNFA.js} +3 -2
  22. package/dist/{address-ZMZ4ST5T.js → address-7HSQSXUS.js} +6 -4
  23. package/dist/{adjust-inventory-QUGKDXOC.js → adjust-inventory-2OKDFVLK.js} +2 -3
  24. package/dist/{allocate-items-7NSBGXSF.js → allocate-items-QAYROQMK.js} +4 -2
  25. package/dist/{areas-EJCZBY2E.js → areas-WQ44GWQO.js} +2 -2
  26. package/dist/{breadcrumb-M657ZCG6.js → breadcrumb-4I7MU2QY.js} +1 -1
  27. package/dist/{breadcrumb-KNBZ3JNR.js → breadcrumb-7ZFC43R4.js} +1 -1
  28. package/dist/{breadcrumb-C7M5PG2Q.js → breadcrumb-IDLCUHX3.js} +6 -4
  29. package/dist/{breadcrumb-MXYWEBK6.js → breadcrumb-OXRGEOVL.js} +6 -4
  30. package/dist/{breadcrumb-JWFTKHLE.js → breadcrumb-RQ52GELM.js} +2 -1
  31. package/dist/{breadcrumb-QPV566YX.js → breadcrumb-UDSK4EUS.js} +7 -5
  32. package/dist/breadcrumb-XCPUUZUO.js +26 -0
  33. package/dist/{campaigns-BPLAE6QQ.js → campaigns-LIPKZKI7.js} +5 -4
  34. package/dist/{categories-H2XAJCGC.js → categories-D2U6VLH5.js} +2 -2
  35. package/dist/{chunk-4RVWITM2.js → chunk-3JWHERV7.js} +76 -23
  36. package/dist/{chunk-BCXREBMV.js → chunk-4ATO577Q.js} +1 -1
  37. package/dist/{chunk-VHFKJLDH.js → chunk-4JVORTN4.js} +1 -1
  38. package/dist/{chunk-HHD2VUED.js → chunk-4UKAKFKL.js} +1 -1
  39. package/dist/{chunk-3L7WHWKB.js → chunk-5DRYAIOY.js} +3 -3
  40. package/dist/{chunk-7TIZP4YG.js → chunk-5RWK4U4V.js} +26 -0
  41. package/dist/{chunk-UEKRQS5Q.js → chunk-6ECHPZS3.js} +2 -2
  42. package/dist/{chunk-IWAL74YU.js → chunk-6GQLSWOO.js} +1 -1
  43. package/dist/{chunk-HCUIYIIY.js → chunk-6OZQTHCR.js} +1 -1
  44. package/dist/chunk-6XMUN2BZ.js +0 -0
  45. package/dist/{chunk-RLRWDHME.js → chunk-6YQR2AWM.js} +3 -20
  46. package/dist/{chunk-26OOAKQ6.js → chunk-7H6NMQ6U.js} +8 -1
  47. package/dist/{chunk-SVYBMLVN.js → chunk-7J2QRH4V.js} +1 -1
  48. package/dist/chunk-7LIENHWP.js +26 -0
  49. package/dist/{chunk-EPSRO7C5.js → chunk-7LIT4GXO.js} +2 -2
  50. package/dist/chunk-7POOMBIN.js +108 -0
  51. package/dist/{chunk-SDFZUBS3.js → chunk-CDZALZ5E.js} +1 -1
  52. package/dist/{chunk-72HQFLZI.js → chunk-CSEB2RNO.js} +1 -1
  53. package/dist/{chunk-X6ZQMFCT.js → chunk-DAOSTHVB.js} +44 -25
  54. package/dist/chunk-FKKI62AC.js +282 -0
  55. package/dist/{chunk-VBKW4GWP.js → chunk-FPBXQIFJ.js} +1 -1
  56. package/dist/{chunk-SI55QRZ4.js → chunk-G5NNOOHR.js} +59 -6
  57. package/dist/chunk-G6J5ZKM3.js +31 -0
  58. package/dist/{chunk-U5V6HNVW.js → chunk-GL3XVUAY.js} +1 -1
  59. package/dist/{chunk-RJE4MAYB.js → chunk-GYLRZXWS.js} +1 -1
  60. package/dist/{chunk-3XW55FZY.js → chunk-IYQHEISY.js} +6 -6
  61. package/dist/chunk-IZI2PKL7.js +27 -0
  62. package/dist/chunk-JN6MHI6V.js +334 -0
  63. package/dist/{chunk-YUQA6TUA.js → chunk-JOCO7JOB.js} +3 -3
  64. package/dist/{chunk-OGUTFP6B.js → chunk-JYUHDM23.js} +13 -51
  65. package/dist/{chunk-QB7BI4B7.js → chunk-K2DXXPNA.js} +153 -86
  66. package/dist/{chunk-XG76XXM2.js → chunk-KKMA6VPG.js} +1 -1
  67. package/dist/chunk-KVAD5JGS.js +11 -0
  68. package/dist/{chunk-YRZ53SAN.js → chunk-L26J5MO2.js} +2 -2
  69. package/dist/{chunk-FEVCBT24.js → chunk-LOSVZJXS.js} +2 -2
  70. package/dist/{chunk-63XYNXUL.js → chunk-LYP7XK5O.js} +1 -1
  71. package/dist/chunk-MVVFD2JT.js +51 -0
  72. package/dist/{chunk-RVFPWOR2.js → chunk-MY5H7C3A.js} +2 -2
  73. package/dist/{chunk-GTNCNKTC.js → chunk-NP5TISFX.js} +1 -1
  74. package/dist/{chunk-3GSR455R.js → chunk-NQMHP2LC.js} +1 -1
  75. package/dist/{chunk-2S2WK2OG.js → chunk-NV2RZAHW.js} +1 -10
  76. package/dist/{chunk-4IIATKG7.js → chunk-O7OWHKWA.js} +6 -6
  77. package/dist/{chunk-GIKVFOQL.js → chunk-OJCMHDZI.js} +2 -2
  78. package/dist/chunk-QLOJNFUE.js +53 -0
  79. package/dist/{chunk-OKJHUQBY.js → chunk-QSS7ATY3.js} +15 -27
  80. package/dist/{chunk-XVBONKRV.js → chunk-RCMKDW6O.js} +1 -1
  81. package/dist/{chunk-WJF24CGA.js → chunk-RDLVH6CM.js} +33 -5
  82. package/dist/chunk-SF5N2HX4.js +268 -0
  83. package/dist/{chunk-MQR26KYT.js → chunk-SYHA2RVL.js} +1 -1
  84. package/dist/{chunk-ZXDMPIXN.js → chunk-U3OEGBHH.js} +2 -2
  85. package/dist/{chunk-EJBOBB4B.js → chunk-V3N2Y4OL.js} +46 -46
  86. package/dist/{chunk-UUBGLS7U.js → chunk-V43BEBDT.js} +187 -35
  87. package/dist/{chunk-VBRTC2VU.js → chunk-VAFGNDAP.js} +4 -3
  88. package/dist/{chunk-4UQMRTSC.js → chunk-VH3TGSWE.js} +46 -2
  89. package/dist/{chunk-ZEKV7LGF.js → chunk-VV2K3EBF.js} +1 -1
  90. package/dist/{chunk-S2VYK3YC.js → chunk-WI2ZAFZF.js} +1 -1
  91. package/dist/chunk-WP3B4NEU.js +32 -0
  92. package/dist/{chunk-DY3XQPHC.js → chunk-WW2XYOHJ.js} +5 -3
  93. package/dist/{chunk-IVYIMGQC.js → chunk-X44P463Q.js} +45 -10
  94. package/dist/{chunk-R5KN6IFB.js → chunk-XHWBTV72.js} +2 -2
  95. package/dist/{chunk-OVHIUZ3K.js → chunk-XQ47NZJC.js} +1 -1
  96. package/dist/{chunk-LN7XHEPJ.js → chunk-YT4RAUWM.js} +2 -2
  97. package/dist/{chunk-6VKJM537.js → chunk-ZK4DIDXG.js} +1 -1
  98. package/dist/{collections-52DJLHWW.js → collections-3MEKABDT.js} +13 -12
  99. package/dist/{configuration-UMRBE5RQ.js → configuration-QK2FW2CV.js} +2 -2
  100. package/dist/{configuration-QEDVL2WF.js → configuration-RYH3VUBV.js} +15 -48
  101. package/dist/{create-ALUKAFJS.js → create-5M66YUYY.js} +2 -2
  102. package/dist/{create-ABRPUMHQ.js → create-75C65ZIS.js} +6 -5
  103. package/dist/{create-6IRD2CVC.js → create-A3CQXIRQ.js} +11 -9
  104. package/dist/{create-LYNWCP2N.js → create-GYNDVCY2.js} +5 -4
  105. package/dist/create-ICCAEOSA.js +343 -0
  106. package/dist/{create-5RQ32XPT.js → create-KBDT33O2.js} +287 -287
  107. package/dist/{create-GEYXN6SW.js → create-L5HMOVY5.js} +6 -4
  108. package/dist/{create-MFGMTZ5A.js → create-M2W5N6QV.js} +7 -5
  109. package/dist/{create-NTZH45DW.js → create-NSJGRO4L.js} +13 -11
  110. package/dist/{create-H77ZUZG5.js → create-O4K6TO4G.js} +9 -7
  111. package/dist/{create-S7VYYTUD.js → create-PW5L3MJI.js} +9 -7
  112. package/dist/{create-7SJ5DSQK.js → create-UQ26QTPQ.js} +19 -16
  113. package/dist/{create-2I3GAX4C.js → create-WIGBFSRH.js} +15 -6
  114. package/dist/{create-7FT7N2NH.js → create-WPN3OUJU.js} +3 -2
  115. package/dist/{create-G76MVCJU.js → create-ZVGYET6W.js} +5 -4
  116. package/dist/customer-availability-VAOKKCTK.js +164 -0
  117. package/dist/{customer-group-add-customers-T7OYWJCB.js → customer-group-add-customers-BSMUKWVO.js} +1 -1
  118. package/dist/{customer-group-detail-E7HRZ3LE.js → customer-group-detail-QCPC2YWK.js} +2 -2
  119. package/dist/{customer-groups-26HJ55MF.js → customer-groups-6WGUNFHG.js} +2 -2
  120. package/dist/{customers-EXFRZX5F.js → customers-7OGYQSGA.js} +2 -2
  121. package/dist/edit-2BKYNGYL.js +262 -0
  122. package/dist/{edit-M4AP65HO.js → edit-32ZGQUWZ.js} +7 -5
  123. package/dist/{edit-MPOTIGUY.js → edit-3OXHBHY4.js} +22 -38
  124. package/dist/{edit-2RN3OT27.js → edit-7T2JMZG3.js} +7 -56
  125. package/dist/{edit-6VJWRZHQ.js → edit-AFWQY3BZ.js} +6 -4
  126. package/dist/{edit-NB5VN2E4.js → edit-EDXF3T7F.js} +4 -3
  127. package/dist/edit-GJCXPD5A.js +81 -0
  128. package/dist/{edit-WHGYNDEB.js → edit-KOLDPZ4H.js} +19 -16
  129. package/dist/{edit-TIBQEQVV.js → edit-LZFD3RSY.js} +9 -7
  130. package/dist/{edit-QBUYHSE7.js → edit-QVK3BEPA.js} +7 -5
  131. package/dist/{edit-EGBVEWXS.js → edit-ZLZR7F33.js} +8 -6
  132. package/dist/{edit-H5FJ45ZT.js → edit-ZM7NJVRE.js} +1 -1
  133. package/dist/{edit-budget-PYPHUJPW.js → edit-budget-MOZETGZV.js} +1 -1
  134. package/dist/{edit-inventory-item-BCVECCLT.js → edit-inventory-item-HFGHS732.js} +17 -14
  135. package/dist/{edit-inventory-item-attributes-GWEMP67O.js → edit-inventory-item-attributes-5ORZJF4I.js} +18 -1
  136. package/dist/edit-reservation-LSYQUDYQ.js +294 -0
  137. package/dist/extension-targets.d.ts +6 -3
  138. package/dist/{fulfillment-HDU7GATG.js → fulfillment-TVRF5TID.js} +6 -4
  139. package/dist/{fulfillment-providers-6RZNNT7U.js → fulfillment-providers-TEV23LGB.js} +11 -10
  140. package/dist/index.css +14 -14
  141. package/dist/index.js +252 -146
  142. package/dist/{inventory-XJ2E6DPC.js → inventory-CMIRAJJY.js} +2 -2
  143. package/dist/{invite-755AJC3M.js → invite-K3R2GRYF.js} +6 -4
  144. package/dist/{invite-FD2TXZTW.js → invite-ZMIYLOWJ.js} +9 -7
  145. package/dist/{login-UGKYRKMD.js → login-LG3XH6B2.js} +8 -6
  146. package/dist/{manage-locations-PRQI5TI4.js → manage-locations-5B4HP6NQ.js} +24 -5
  147. package/dist/{media-TGFAHFBV.js → media-DY2XDZYT.js} +7 -5
  148. package/dist/{media-2KEHXPRU.js → media-OGO6M3CP.js} +10 -8
  149. package/dist/{metadata-BQQFHVKF.js → metadata-AW5Y72BI.js} +6 -4
  150. package/dist/metadata-HS6CLO4Z.js +69 -0
  151. package/dist/{metadata-5TVRCKWX.js → metadata-HXXVD3VP.js} +6 -4
  152. package/dist/{metadata-7JWZ4VFM.js → metadata-TXNUZBPX.js} +6 -4
  153. package/dist/{metadata-G73TILNE.js → metadata-UVOHT2VF.js} +6 -4
  154. package/dist/{metadata-4ZZ4ZIWJ.js → metadata-ZBSZL74N.js} +6 -4
  155. package/dist/{offer-create-page-PPXRYET4.js → offer-create-page-53P65U2V.js} +11 -8
  156. package/dist/{offer-detail-page-BFGKAS4L.js → offer-detail-page-BGFLDXO7.js} +1 -1
  157. package/dist/{offer-variant-detail-page-BLHRF4MK.js → offer-variant-detail-page-DCTRZUTM.js} +1 -1
  158. package/dist/{offers-7I67VSHI.js → offers-5776XUH5.js} +13 -9
  159. package/dist/{onboarding-7MURQYXX.js → onboarding-ROLIHG3L.js} +6 -4
  160. package/dist/{orders-D7NZNDUS.js → orders-VA3HNJAY.js} +12 -11
  161. package/dist/{organization-T6ZTYMMW.js → organization-UH4IUA62.js} +8 -6
  162. package/dist/pages/index.d.ts +9 -1
  163. package/dist/pages/index.js +53 -44
  164. package/dist/{payment-details-UQ65D5AY.js → payment-details-CD4GZEUL.js} +6 -4
  165. package/dist/{payouts-A336D2HG.js → payouts-26ZOYDRP.js} +2 -2
  166. package/dist/{price-lists-3WRT4TR2.js → price-lists-U5ASDHMI.js} +5 -8
  167. package/dist/{pricing-CPPIL627.js → pricing-SWUZSQL3.js} +8 -6
  168. package/dist/{product-tags-7DTA73YT.js → product-tags-4V65LOJJ.js} +19 -16
  169. package/dist/{product-types-OB26NF2D.js → product-types-CMI33S32.js} +3 -4
  170. package/dist/{product-variant-detail-4DDE6RJ5.js → product-variant-detail-NW3LQZE7.js} +6 -4
  171. package/dist/{product-variant-edit-SAZUI4E3.js → product-variant-edit-MNYFEZND.js} +9 -7
  172. package/dist/{products-RYXTZFGT.js → products-L2H6HOL2.js} +18 -15
  173. package/dist/{products-GJ2KTGBZ.js → products-YIF6FPBO.js} +12 -9
  174. package/dist/{professional-details-UN5B4YDJ.js → professional-details-QO5BWMRD.js} +6 -4
  175. package/dist/{profile-6MIDTK52.js → profile-2KKBVKAL.js} +6 -4
  176. package/dist/{promotions-SQ47TCZL.js → promotions-C5YWXVP5.js} +5 -5
  177. package/dist/{receive-ZG6FFN7H.js → receive-RRZK3FP2.js} +4 -3
  178. package/dist/{refund-KJX74N6T.js → refund-FLCZAMPR.js} +3 -2
  179. package/dist/{register-RDSK4E4D.js → register-SZ2T6QQA.js} +8 -6
  180. package/dist/reservations-C326XEVA.js +350 -0
  181. package/dist/{reset-password-C462PDN2.js → reset-password-H66R27K4.js} +1 -1
  182. package/dist/respond-IPRDCH57.js +132 -0
  183. package/dist/{return-reasons-MY63HNF6.js → return-reasons-2BUKIQBO.js} +9 -7
  184. package/dist/reviews-LBLCFBRQ.js +14 -0
  185. package/dist/{settings-TJ6HPHMK.js → settings-THSRJ5WS.js} +26 -23
  186. package/dist/{shipment-6CTA2GHU.js → shipment-X2WWJ3AE.js} +6 -4
  187. package/dist/{shipping-profile-CFISOMTE.js → shipping-profile-7P3RPEIJ.js} +1 -1
  188. package/dist/{shipping-profiles-5UAZNYKJ.js → shipping-profiles-JPBRRMPD.js} +8 -6
  189. package/dist/{stock-465GEUY3.js → stock-UMESDWV5.js} +21 -7
  190. package/dist/{store-2PQB2XWE.js → store-5YMOSKVT.js} +7 -5
  191. package/dist/{store-closure-DYW54VHB.js → store-closure-EPGDOV7U.js} +6 -4
  192. package/dist/{store-select-6A5YR7WH.js → store-select-JEEV4V57.js} +7 -5
  193. package/dist/{team-GXEBC57M.js → team-R6ARMF73.js} +9 -7
  194. package/package.json +12 -9
  195. package/dist/[id]-HEVGSOAV.js +0 -598
  196. package/dist/[id]-MU7A6SZO.js +0 -526
  197. package/dist/chunk-2ZFELO2L.js +0 -13
  198. package/dist/chunk-6IJMSVC6.js +0 -16
  199. package/dist/chunk-BNOKKKUU.js +0 -88
  200. package/dist/chunk-BX3JE7IE.js +0 -247
  201. package/dist/edit-4B364HGZ.js +0 -222
  202. package/dist/edit-SQU5UOGE.js +0 -105
  203. package/dist/{[location_id]-OXNC5E4F.js → [location_id]-IGPM7LDR.js} +1 -1
  204. package/dist/{chunk-CYE7HVAV.js → chunk-SCJBJQCL.js} +3 -3
@@ -0,0 +1,949 @@
1
+ import {
2
+ INVENTORY_DETAIL_FIELDS
3
+ } from "./chunk-VV2K3EBF.js";
4
+ import {
5
+ TextCell,
6
+ TextHeader
7
+ } from "./chunk-JHIMVLB2.js";
8
+ import {
9
+ getFormattedCountry
10
+ } from "./chunk-W6Y3PPU5.js";
11
+ import "./chunk-JRTZWK77.js";
12
+ import {
13
+ PlaceholderCell
14
+ } from "./chunk-PHOCVOZ5.js";
15
+ import {
16
+ SectionRow
17
+ } from "./chunk-4TLP3TAA.js";
18
+ import {
19
+ SidebarLink
20
+ } from "./chunk-UST2RGWB.js";
21
+ import "./chunk-U2EI2ZLM.js";
22
+ import {
23
+ TwoColumnPage
24
+ } from "./chunk-YV6MK4PZ.js";
25
+ import "./chunk-FQERBIVS.js";
26
+ import {
27
+ _DataTable,
28
+ useDataTable
29
+ } from "./chunk-6GQLSWOO.js";
30
+ import "./chunk-YN3FGNJM.js";
31
+ import "./chunk-KCHYLLVG.js";
32
+ import "./chunk-3EF54XFY.js";
33
+ import {
34
+ useQueryParams
35
+ } from "./chunk-THHRRYRS.js";
36
+ import {
37
+ useDate
38
+ } from "./chunk-LRD242C7.js";
39
+ import {
40
+ Thumbnail
41
+ } from "./chunk-WIYFXWRI.js";
42
+ import {
43
+ TwoColumnPageSkeleton
44
+ } from "./chunk-INNFZYX2.js";
45
+ import {
46
+ ActionMenu
47
+ } from "./chunk-BDGZ4EQO.js";
48
+ import "./chunk-LAVHRER2.js";
49
+ import "./chunk-QHQWEERJ.js";
50
+ import "./chunk-Y7QKP6QU.js";
51
+ import "./chunk-6YQR2AWM.js";
52
+ import "./chunk-K5324KIX.js";
53
+ import "./chunk-FV76G2D7.js";
54
+ import "./chunk-GHDLST2P.js";
55
+ import "./chunk-YVYYOBAE.js";
56
+ import "./chunk-L2NJPDUD.js";
57
+ import "./chunk-7LIENHWP.js";
58
+ import "./chunk-NV2RZAHW.js";
59
+ import "./chunk-MR6REQKT.js";
60
+ import "./chunk-EPSDO2MJ.js";
61
+ import "./chunk-BHEU34FL.js";
62
+ import "./chunk-W34KDYZA.js";
63
+ import "./chunk-II3CLUXA.js";
64
+ import "./chunk-OCYVN77Z.js";
65
+ import "./chunk-J2XUEO2E.js";
66
+ import "./chunk-DETQ6IBQ.js";
67
+ import "./chunk-VWPNMEOE.js";
68
+ import {
69
+ useStockLocations
70
+ } from "./chunk-O72AIZUN.js";
71
+ import "./chunk-GL3XVUAY.js";
72
+ import "./chunk-PF7R7LMW.js";
73
+ import "./chunk-JYUHDM23.js";
74
+ import {
75
+ useDeleteReservationItem,
76
+ useReservationItems
77
+ } from "./chunk-7POOMBIN.js";
78
+ import "./chunk-4U2BLH45.js";
79
+ import {
80
+ inventoryItemsQueryKeys,
81
+ useDeleteInventoryItemLevel,
82
+ useInventoryItem,
83
+ useInventoryItemLevels
84
+ } from "./chunk-EMUCGKHP.js";
85
+ import "./chunk-A5DJIOHN.js";
86
+ import {
87
+ queryClient
88
+ } from "./chunk-RHKRREUU.js";
89
+ import "./chunk-ZA2KFUFR.js";
90
+ import {
91
+ fetchQuery
92
+ } from "./chunk-DTGEFKK4.js";
93
+ import "./chunk-NBMM2TZK.js";
94
+
95
+ // src/pages/inventory/[id]/loader.tsx
96
+ import { getLinkQuery } from "@mercurjs/dashboard-shared";
97
+ var inventoryDetailQuery = (id) => {
98
+ const query = getLinkQuery("inventory_item", INVENTORY_DETAIL_FIELDS);
99
+ return {
100
+ queryKey: inventoryItemsQueryKeys.detail(id, query),
101
+ queryFn: async () => fetchQuery(
102
+ `/vendor/inventory-items/${id}?fields=${query.fields}`,
103
+ { method: "GET" }
104
+ )
105
+ };
106
+ };
107
+ var loader = async ({ params }) => {
108
+ const id = params.id;
109
+ const query = inventoryDetailQuery(id);
110
+ return queryClient.ensureQueryData(query);
111
+ };
112
+
113
+ // src/pages/inventory/[id]/inventory-detail-page.tsx
114
+ import { Children } from "react";
115
+ import { useLoaderData, useParams } from "react-router-dom";
116
+ import { useLinkQuery, WidgetZone } from "@mercurjs/dashboard-shared";
117
+
118
+ // src/pages/inventory/[id]/_components/inventory-item-attributes/attributes-section.tsx
119
+ import { Container, Heading } from "@medusajs/ui";
120
+ import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
121
+ import { PencilSquare } from "@medusajs/icons";
122
+ import { useTranslation } from "react-i18next";
123
+ import { jsx, jsxs } from "react/jsx-runtime";
124
+ var InventoryItemAttributeSection = ({
125
+ inventoryItem
126
+ }) => {
127
+ const { t } = useTranslation();
128
+ return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
129
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
130
+ /* @__PURE__ */ jsx(Heading, { level: "h2", children: t("products.attributes") }),
131
+ /* @__PURE__ */ jsx(
132
+ ActionMenu,
133
+ {
134
+ groups: [
135
+ {
136
+ actions: [
137
+ {
138
+ label: t("actions.edit"),
139
+ to: "attributes",
140
+ icon: /* @__PURE__ */ jsx(PencilSquare, {})
141
+ }
142
+ ]
143
+ }
144
+ ]
145
+ }
146
+ )
147
+ ] }),
148
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.height"), value: inventoryItem.height }),
149
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.width"), value: inventoryItem.width }),
150
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.length"), value: inventoryItem.length }),
151
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.weight"), value: inventoryItem.weight }),
152
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.midCode"), value: inventoryItem.mid_code }),
153
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.hsCode"), value: inventoryItem.hs_code }),
154
+ /* @__PURE__ */ jsx(SectionRow, { title: t("fields.material"), value: inventoryItem.material }),
155
+ /* @__PURE__ */ jsx(
156
+ SectionRow,
157
+ {
158
+ title: t("fields.countryOfOrigin"),
159
+ value: getFormattedCountry(inventoryItem.origin_country)
160
+ }
161
+ ),
162
+ /* @__PURE__ */ jsx(
163
+ DisplayExtensionZone,
164
+ {
165
+ model: "inventory_item",
166
+ zone: "attributes",
167
+ data: inventoryItem
168
+ }
169
+ )
170
+ ] });
171
+ };
172
+
173
+ // src/pages/inventory/[id]/_components/inventory-item-general-section.tsx
174
+ import { Container as Container2, Heading as Heading2 } from "@medusajs/ui";
175
+ import { PencilSquare as PencilSquare2 } from "@medusajs/icons";
176
+ import { useTranslation as useTranslation2 } from "react-i18next";
177
+ import { DisplayExtensionZone as DisplayExtensionZone2, DisplayField } from "@mercurjs/dashboard-shared";
178
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
179
+ var GENERAL_FIELD_IDS = ["title", "sku", "in_stock", "reserved", "available"];
180
+ var InventoryItemGeneralSection = ({
181
+ inventoryItem
182
+ }) => {
183
+ const { t } = useTranslation2();
184
+ const stockedQuantity = inventoryItem.location_levels?.reduce(
185
+ (acc, level) => acc + level.stocked_quantity,
186
+ 0
187
+ ) || 0;
188
+ const reservedQuantity = inventoryItem.location_levels?.reduce(
189
+ (acc, level) => acc + level.reserved_quantity,
190
+ 0
191
+ ) || 0;
192
+ const availableQuantity = stockedQuantity - reservedQuantity;
193
+ const getQuantityFormat = (quantity) => {
194
+ if (quantity !== void 0 && !isNaN(quantity)) {
195
+ return t("inventory.quantityAcrossLocations", {
196
+ quantity,
197
+ locations: inventoryItem.location_levels?.length ?? "-"
198
+ });
199
+ }
200
+ return "-";
201
+ };
202
+ return /* @__PURE__ */ jsxs2(
203
+ Container2,
204
+ {
205
+ className: "divide-y p-0",
206
+ "data-testid": "inventory-item-general-section",
207
+ children: [
208
+ /* @__PURE__ */ jsxs2(
209
+ "div",
210
+ {
211
+ className: "flex items-center justify-between px-6 py-4",
212
+ "data-testid": "inventory-item-general-header",
213
+ children: [
214
+ /* @__PURE__ */ jsx2(
215
+ DisplayField,
216
+ {
217
+ model: "inventory_item",
218
+ zone: "general",
219
+ id: "title",
220
+ data: inventoryItem,
221
+ children: /* @__PURE__ */ jsx2(Heading2, { "data-testid": "inventory-item-general-title", children: inventoryItem.title ?? inventoryItem.sku })
222
+ }
223
+ ),
224
+ /* @__PURE__ */ jsx2(
225
+ ActionMenu,
226
+ {
227
+ groups: [
228
+ {
229
+ actions: [
230
+ {
231
+ icon: /* @__PURE__ */ jsx2(PencilSquare2, {}),
232
+ label: t("actions.edit"),
233
+ to: "edit"
234
+ }
235
+ ]
236
+ }
237
+ ],
238
+ "data-testid": "inventory-item-general-action-menu"
239
+ }
240
+ )
241
+ ]
242
+ }
243
+ ),
244
+ /* @__PURE__ */ jsx2(
245
+ DisplayField,
246
+ {
247
+ model: "inventory_item",
248
+ zone: "general",
249
+ id: "sku",
250
+ data: inventoryItem,
251
+ children: /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.sku"), value: inventoryItem.sku ?? "-" })
252
+ }
253
+ ),
254
+ /* @__PURE__ */ jsx2(
255
+ DisplayField,
256
+ {
257
+ model: "inventory_item",
258
+ zone: "general",
259
+ id: "in_stock",
260
+ data: inventoryItem,
261
+ children: /* @__PURE__ */ jsx2(
262
+ SectionRow,
263
+ {
264
+ title: t("fields.inStock"),
265
+ value: getQuantityFormat(stockedQuantity)
266
+ }
267
+ )
268
+ }
269
+ ),
270
+ /* @__PURE__ */ jsx2(
271
+ DisplayField,
272
+ {
273
+ model: "inventory_item",
274
+ zone: "general",
275
+ id: "reserved",
276
+ data: inventoryItem,
277
+ children: /* @__PURE__ */ jsx2(
278
+ SectionRow,
279
+ {
280
+ title: t("inventory.reserved"),
281
+ value: getQuantityFormat(reservedQuantity)
282
+ }
283
+ )
284
+ }
285
+ ),
286
+ /* @__PURE__ */ jsx2(
287
+ DisplayField,
288
+ {
289
+ model: "inventory_item",
290
+ zone: "general",
291
+ id: "available",
292
+ data: inventoryItem,
293
+ children: /* @__PURE__ */ jsx2(
294
+ SectionRow,
295
+ {
296
+ title: t("inventory.available"),
297
+ value: getQuantityFormat(availableQuantity)
298
+ }
299
+ )
300
+ }
301
+ ),
302
+ /* @__PURE__ */ jsx2(
303
+ DisplayExtensionZone2,
304
+ {
305
+ model: "inventory_item",
306
+ zone: "general",
307
+ data: inventoryItem,
308
+ builtInFieldIds: GENERAL_FIELD_IDS
309
+ }
310
+ )
311
+ ]
312
+ }
313
+ );
314
+ };
315
+
316
+ // src/pages/inventory/[id]/_components/inventory-item-location-levels.tsx
317
+ import { Button, Container as Container3, Heading as Heading3 } from "@medusajs/ui";
318
+ import { useTranslation as useTranslation6 } from "react-i18next";
319
+ import { Link } from "react-router-dom";
320
+ import { DisplayExtensionZone as DisplayExtensionZone3 } from "@mercurjs/dashboard-shared";
321
+
322
+ // src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-columns.tsx
323
+ import { createColumnHelper } from "@tanstack/react-table";
324
+ import { useMemo } from "react";
325
+ import { useTranslation as useTranslation4 } from "react-i18next";
326
+
327
+ // src/pages/inventory/[id]/_components/location-levels-table/location-actions.tsx
328
+ import { PencilSquare as PencilSquare3, Trash } from "@medusajs/icons";
329
+ import { toast, usePrompt } from "@medusajs/ui";
330
+ import { useTranslation as useTranslation3 } from "react-i18next";
331
+ import { jsx as jsx3 } from "react/jsx-runtime";
332
+ var LocationActions = ({ level }) => {
333
+ const { t } = useTranslation3();
334
+ const prompt = usePrompt();
335
+ const { mutateAsync } = useDeleteInventoryItemLevel(
336
+ level.inventory_item_id,
337
+ level.location_id
338
+ );
339
+ const locationName = level.stock_locations?.map((location) => location.name).join(", ") ?? "";
340
+ const handleDelete = async () => {
341
+ const res = await prompt({
342
+ title: t("inventory.level.deleteTitle"),
343
+ description: t("inventory.level.deleteDescription", {
344
+ location: locationName
345
+ }),
346
+ confirmText: t("actions.delete"),
347
+ cancelText: t("actions.cancel")
348
+ });
349
+ if (!res) {
350
+ return;
351
+ }
352
+ await mutateAsync(void 0, {
353
+ onSuccess: () => toast.success(t("inventory.levelDeleted")),
354
+ onError: (e) => toast.error(e.message)
355
+ });
356
+ };
357
+ return /* @__PURE__ */ jsx3(
358
+ ActionMenu,
359
+ {
360
+ groups: [
361
+ {
362
+ actions: [
363
+ {
364
+ icon: /* @__PURE__ */ jsx3(PencilSquare3, {}),
365
+ label: t("actions.edit"),
366
+ to: `locations/${level.location_id}`
367
+ }
368
+ ]
369
+ },
370
+ {
371
+ actions: [
372
+ {
373
+ icon: /* @__PURE__ */ jsx3(Trash, {}),
374
+ label: t("actions.delete"),
375
+ onClick: handleDelete,
376
+ disabled: level.reserved_quantity > 0 || level.stocked_quantity > 0
377
+ }
378
+ ]
379
+ }
380
+ ]
381
+ }
382
+ );
383
+ };
384
+
385
+ // src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-columns.tsx
386
+ import { jsx as jsx4 } from "react/jsx-runtime";
387
+ var columnHelper = createColumnHelper();
388
+ var useLocationListTableColumns = () => {
389
+ const { t } = useTranslation4();
390
+ return useMemo(
391
+ () => [
392
+ columnHelper.display({
393
+ id: "location",
394
+ header: t("fields.location"),
395
+ cell: ({ row }) => {
396
+ const locationName = row.original.stock_locations?.map((location) => location.name).join(", ");
397
+ if (!locationName) {
398
+ return /* @__PURE__ */ jsx4(PlaceholderCell, {});
399
+ }
400
+ return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: locationName.toString() }) });
401
+ }
402
+ }),
403
+ columnHelper.accessor("reserved_quantity", {
404
+ header: t("inventory.reserved"),
405
+ cell: ({ getValue }) => {
406
+ const quantity = getValue();
407
+ if (Number.isNaN(quantity)) {
408
+ return /* @__PURE__ */ jsx4(PlaceholderCell, {});
409
+ }
410
+ return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: quantity }) });
411
+ }
412
+ }),
413
+ columnHelper.accessor("stocked_quantity", {
414
+ header: t("fields.inStock"),
415
+ cell: ({ getValue }) => {
416
+ const stockedQuantity = getValue();
417
+ if (Number.isNaN(stockedQuantity)) {
418
+ return /* @__PURE__ */ jsx4(PlaceholderCell, {});
419
+ }
420
+ return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: stockedQuantity }) });
421
+ }
422
+ }),
423
+ columnHelper.accessor("available_quantity", {
424
+ header: t("inventory.available"),
425
+ cell: ({ getValue }) => {
426
+ const availableQuantity = getValue();
427
+ if (Number.isNaN(availableQuantity)) {
428
+ return /* @__PURE__ */ jsx4(PlaceholderCell, {});
429
+ }
430
+ return /* @__PURE__ */ jsx4("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx4("span", { className: "truncate", children: availableQuantity }) });
431
+ }
432
+ }),
433
+ columnHelper.display({
434
+ id: "actions",
435
+ cell: ({ row }) => /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-end", children: /* @__PURE__ */ jsx4(LocationActions, { level: row.original }) })
436
+ })
437
+ ],
438
+ [t]
439
+ );
440
+ };
441
+
442
+ // src/pages/inventory/[id]/_components/location-levels-table/use-location-list-table-query.tsx
443
+ var useLocationLevelTableQuery = ({
444
+ pageSize = 20,
445
+ prefix
446
+ }) => {
447
+ const raw = useQueryParams(
448
+ [
449
+ "id",
450
+ "location_id",
451
+ "stocked_quantity",
452
+ "reserved_quantity",
453
+ "incoming_quantity",
454
+ "available_quantity",
455
+ "*stock_locations"
456
+ ],
457
+ prefix
458
+ );
459
+ const { reserved_quantity, stocked_quantity, available_quantity, ...params } = raw;
460
+ const searchParams = {
461
+ limit: pageSize,
462
+ reserved_quantity: reserved_quantity ? JSON.parse(reserved_quantity) : void 0,
463
+ stocked_quantity: stocked_quantity ? JSON.parse(stocked_quantity) : void 0,
464
+ available_quantity: available_quantity ? JSON.parse(available_quantity) : void 0,
465
+ ...params
466
+ };
467
+ return {
468
+ searchParams,
469
+ raw
470
+ };
471
+ };
472
+
473
+ // src/pages/inventory/[id]/_components/location-levels-table/location-list-table.tsx
474
+ import { useTranslation as useTranslation5 } from "react-i18next";
475
+ import { jsx as jsx5 } from "react/jsx-runtime";
476
+ var PAGE_SIZE = 20;
477
+ var ItemLocationListTable = ({
478
+ inventory_item_id
479
+ }) => {
480
+ const { t } = useTranslation5();
481
+ const { searchParams, raw } = useLocationLevelTableQuery({
482
+ pageSize: PAGE_SIZE
483
+ });
484
+ const { inventory_levels, count, isLoading } = useInventoryItemLevels(
485
+ inventory_item_id,
486
+ {
487
+ ...searchParams,
488
+ fields: "*stock_locations"
489
+ }
490
+ );
491
+ const columns = useLocationListTableColumns();
492
+ const filteredLocationLevels = inventory_levels?.filter(
493
+ (level) => level.stock_locations.length > 0
494
+ );
495
+ const { table } = useDataTable({
496
+ data: filteredLocationLevels ?? [],
497
+ columns,
498
+ count,
499
+ enablePagination: true,
500
+ getRowId: (row) => row.id,
501
+ pageSize: PAGE_SIZE
502
+ });
503
+ return /* @__PURE__ */ jsx5(
504
+ _DataTable,
505
+ {
506
+ table,
507
+ columns,
508
+ pageSize: PAGE_SIZE,
509
+ count: filteredLocationLevels?.length,
510
+ isLoading,
511
+ pagination: true,
512
+ queryObject: raw,
513
+ noRecords: {
514
+ title: t("inventory.locations.noRecordsTitle"),
515
+ message: t("inventory.locations.noRecordsMessage")
516
+ }
517
+ }
518
+ );
519
+ };
520
+
521
+ // src/pages/inventory/[id]/_components/inventory-item-location-levels.tsx
522
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
523
+ var InventoryItemLocationLevelsSection = ({
524
+ inventoryItem
525
+ }) => {
526
+ const { t } = useTranslation6();
527
+ return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
528
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
529
+ /* @__PURE__ */ jsx6(Heading3, { children: t("inventory.locationLevels") }),
530
+ /* @__PURE__ */ jsx6(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx6(Link, { to: "locations", children: t("inventory.manageLocations") }) })
531
+ ] }),
532
+ /* @__PURE__ */ jsx6(ItemLocationListTable, { inventory_item_id: inventoryItem.id }),
533
+ /* @__PURE__ */ jsx6(
534
+ DisplayExtensionZone3,
535
+ {
536
+ model: "inventory_item",
537
+ zone: "locations",
538
+ data: inventoryItem
539
+ }
540
+ )
541
+ ] });
542
+ };
543
+
544
+ // src/pages/inventory/[id]/_components/inventory-item-reservations.tsx
545
+ import { Button as Button2, Container as Container4, Heading as Heading4 } from "@medusajs/ui";
546
+ import { DisplayExtensionZone as DisplayExtensionZone4 } from "@mercurjs/dashboard-shared";
547
+ import { useTranslation as useTranslation11 } from "react-i18next";
548
+ import { Link as Link2 } from "react-router-dom";
549
+
550
+ // src/pages/inventory/[id]/_components/reservations-table/reservation-list-table.tsx
551
+ import { useMemo as useMemo3 } from "react";
552
+ import { useTranslation as useTranslation10 } from "react-i18next";
553
+
554
+ // src/pages/inventory/[id]/_components/reservations-table/use-reservation-list-table-columns.tsx
555
+ import { createColumnHelper as createColumnHelper2 } from "@tanstack/react-table";
556
+ import { useMemo as useMemo2 } from "react";
557
+ import { useTranslation as useTranslation9 } from "react-i18next";
558
+
559
+ // src/components/table/table-cells/common/created-at-cell/created-at-cell.tsx
560
+ import { Tooltip } from "@medusajs/ui";
561
+ import { useTranslation as useTranslation7 } from "react-i18next";
562
+ import { jsx as jsx7 } from "react/jsx-runtime";
563
+ var CreatedAtCell = ({ date }) => {
564
+ const { getFullDate } = useDate();
565
+ if (!date) {
566
+ return /* @__PURE__ */ jsx7(PlaceholderCell, {});
567
+ }
568
+ return /* @__PURE__ */ jsx7("div", { className: "flex h-full w-full items-center overflow-hidden", children: /* @__PURE__ */ jsx7(
569
+ Tooltip,
570
+ {
571
+ className: "z-10",
572
+ content: /* @__PURE__ */ jsx7("span", { className: "text-pretty", children: `${getFullDate({
573
+ date,
574
+ includeTime: true
575
+ })}` }),
576
+ children: /* @__PURE__ */ jsx7("span", { className: "truncate", children: getFullDate({ date, includeTime: true }) })
577
+ }
578
+ ) });
579
+ };
580
+
581
+ // src/pages/inventory/[id]/_components/reservations-table/reservation-actions.tsx
582
+ import { PencilSquare as PencilSquare4, Trash as Trash2 } from "@medusajs/icons";
583
+ import { toast as toast2, usePrompt as usePrompt2 } from "@medusajs/ui";
584
+ import { useTranslation as useTranslation8 } from "react-i18next";
585
+ import { jsx as jsx8 } from "react/jsx-runtime";
586
+ var ReservationActions = ({
587
+ reservation
588
+ }) => {
589
+ const { t } = useTranslation8();
590
+ const prompt = usePrompt2();
591
+ const { mutateAsync } = useDeleteReservationItem(reservation.id);
592
+ const handleDelete = async () => {
593
+ if (reservation.line_item_id) {
594
+ await prompt({
595
+ title: t("inventory.reservation.deleteTitle"),
596
+ description: t("inventory.reservation.deleteBlockedDescription"),
597
+ confirmText: t("inventory.reservation.gotIt"),
598
+ cancelText: t("actions.cancel")
599
+ });
600
+ return;
601
+ }
602
+ const res = await prompt({
603
+ title: t("inventory.reservation.deleteTitle"),
604
+ description: t("inventory.reservation.deleteDescription"),
605
+ confirmText: t("actions.delete"),
606
+ cancelText: t("actions.cancel")
607
+ });
608
+ if (!res) {
609
+ return;
610
+ }
611
+ await mutateAsync(void 0, {
612
+ onSuccess: () => {
613
+ toast2.success(t("inventory.reservation.deleteSuccessToast"));
614
+ },
615
+ onError: (e) => {
616
+ toast2.error(e.message);
617
+ }
618
+ });
619
+ };
620
+ return /* @__PURE__ */ jsx8(
621
+ ActionMenu,
622
+ {
623
+ groups: [
624
+ {
625
+ actions: [
626
+ {
627
+ icon: /* @__PURE__ */ jsx8(PencilSquare4, {}),
628
+ label: t("actions.edit"),
629
+ to: `/reservations/${reservation.id}/edit`
630
+ }
631
+ ]
632
+ },
633
+ {
634
+ actions: [
635
+ {
636
+ icon: /* @__PURE__ */ jsx8(Trash2, {}),
637
+ label: t("actions.delete"),
638
+ onClick: handleDelete
639
+ }
640
+ ]
641
+ }
642
+ ],
643
+ "data-testid": `reservation-actions-${reservation.id}`
644
+ }
645
+ );
646
+ };
647
+
648
+ // src/pages/inventory/[id]/_components/reservations-table/use-reservation-list-table-columns.tsx
649
+ import { jsx as jsx9 } from "react/jsx-runtime";
650
+ var columnHelper2 = createColumnHelper2();
651
+ var useReservationTableColumn = ({ sku }) => {
652
+ const { t } = useTranslation9();
653
+ return useMemo2(
654
+ () => [
655
+ columnHelper2.display({
656
+ id: "sku",
657
+ header: () => /* @__PURE__ */ jsx9(TextHeader, { text: t("fields.sku") }),
658
+ cell: () => {
659
+ return /* @__PURE__ */ jsx9(TextCell, { text: sku });
660
+ }
661
+ }),
662
+ columnHelper2.accessor("line_item.order_id", {
663
+ header: () => /* @__PURE__ */ jsx9(TextHeader, { text: t("inventory.reservation.orderID") }),
664
+ cell: ({ getValue }) => {
665
+ const orderId = getValue();
666
+ if (!orderId) {
667
+ return /* @__PURE__ */ jsx9(PlaceholderCell, {});
668
+ }
669
+ return /* @__PURE__ */ jsx9(TextCell, { text: orderId });
670
+ }
671
+ }),
672
+ columnHelper2.accessor("description", {
673
+ header: () => /* @__PURE__ */ jsx9(TextHeader, { text: t("fields.description") }),
674
+ cell: ({ getValue }) => {
675
+ const description = getValue();
676
+ if (!description) {
677
+ return /* @__PURE__ */ jsx9(PlaceholderCell, {});
678
+ }
679
+ return /* @__PURE__ */ jsx9(TextCell, { text: description });
680
+ }
681
+ }),
682
+ columnHelper2.accessor("location.name", {
683
+ header: () => /* @__PURE__ */ jsx9(TextHeader, { text: t("inventory.reservation.location") }),
684
+ cell: ({ getValue }) => {
685
+ const location = getValue();
686
+ if (!location) {
687
+ return /* @__PURE__ */ jsx9(PlaceholderCell, {});
688
+ }
689
+ return /* @__PURE__ */ jsx9(TextCell, { text: location });
690
+ }
691
+ }),
692
+ columnHelper2.accessor("created_at", {
693
+ header: () => /* @__PURE__ */ jsx9(TextHeader, { text: t("fields.createdAt") }),
694
+ cell: ({ getValue }) => /* @__PURE__ */ jsx9(CreatedAtCell, { date: getValue() })
695
+ }),
696
+ columnHelper2.accessor("quantity", {
697
+ header: () => /* @__PURE__ */ jsx9(TextHeader, { text: t("fields.quantity"), align: "right" }),
698
+ cell: ({ getValue }) => {
699
+ return /* @__PURE__ */ jsx9(TextCell, { text: getValue(), align: "right" });
700
+ }
701
+ }),
702
+ columnHelper2.display({
703
+ id: "actions",
704
+ cell: ({ row }) => /* @__PURE__ */ jsx9("div", { className: "flex w-full items-center justify-end", children: /* @__PURE__ */ jsx9(ReservationActions, { reservation: row.original }) })
705
+ })
706
+ ],
707
+ [t, sku]
708
+ );
709
+ };
710
+
711
+ // src/pages/inventory/[id]/_components/reservations-table/use-reservation-list-table-query.tsx
712
+ var useReservationsTableQuery = ({
713
+ pageSize = 20,
714
+ prefix
715
+ }) => {
716
+ const raw = useQueryParams(
717
+ [
718
+ "id",
719
+ "location_id",
720
+ "inventory_item_id",
721
+ "quantity",
722
+ "line_item_id",
723
+ "description",
724
+ "created_by"
725
+ ],
726
+ prefix
727
+ );
728
+ const { quantity, ...params } = raw;
729
+ const searchParams = {
730
+ limit: pageSize,
731
+ quantity: quantity ? JSON.parse(quantity) : void 0,
732
+ ...params
733
+ };
734
+ return {
735
+ searchParams,
736
+ raw
737
+ };
738
+ };
739
+
740
+ // src/pages/inventory/[id]/_components/reservations-table/reservation-list-table.tsx
741
+ import { jsx as jsx10 } from "react/jsx-runtime";
742
+ var PAGE_SIZE2 = 20;
743
+ var ReservationItemTable = ({
744
+ inventoryItem
745
+ }) => {
746
+ const { t } = useTranslation10();
747
+ const { searchParams, raw } = useReservationsTableQuery({
748
+ pageSize: PAGE_SIZE2
749
+ });
750
+ const { reservations, count, isPending } = useReservationItems({
751
+ ...searchParams,
752
+ fields: "+line_item.order_id",
753
+ inventory_item_id: [inventoryItem.id]
754
+ });
755
+ const { stock_locations } = useStockLocations({
756
+ id: (reservations || []).map((r) => r.location_id)
757
+ });
758
+ const data = useMemo3(() => {
759
+ const locationMap = new Map((stock_locations || []).map((l) => [l.id, l]));
760
+ return (reservations || []).map((r) => ({
761
+ ...r,
762
+ location: locationMap.get(r.location_id)
763
+ }));
764
+ }, [reservations, stock_locations]);
765
+ const columns = useReservationTableColumn({ sku: inventoryItem.sku });
766
+ const { table } = useDataTable({
767
+ data: data ?? [],
768
+ columns,
769
+ count,
770
+ enablePagination: true,
771
+ getRowId: (row) => row.id,
772
+ pageSize: PAGE_SIZE2
773
+ });
774
+ return /* @__PURE__ */ jsx10(
775
+ _DataTable,
776
+ {
777
+ table,
778
+ columns,
779
+ pageSize: PAGE_SIZE2,
780
+ count,
781
+ isLoading: isPending,
782
+ pagination: true,
783
+ queryObject: raw,
784
+ noRecords: {
785
+ title: t("inventory.reservations.noRecordsTitle"),
786
+ message: t("inventory.reservations.noRecordsMessage")
787
+ }
788
+ }
789
+ );
790
+ };
791
+
792
+ // src/pages/inventory/[id]/_components/inventory-item-reservations.tsx
793
+ import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
794
+ var InventoryItemReservationsSection = ({
795
+ inventoryItem
796
+ }) => {
797
+ const { t } = useTranslation11();
798
+ return /* @__PURE__ */ jsxs4(
799
+ Container4,
800
+ {
801
+ className: "divide-y p-0",
802
+ "data-testid": "inventory-item-reservations-section",
803
+ children: [
804
+ /* @__PURE__ */ jsxs4(
805
+ "div",
806
+ {
807
+ className: "flex items-center justify-between px-6 py-4",
808
+ "data-testid": "inventory-item-reservations-header",
809
+ children: [
810
+ /* @__PURE__ */ jsx11(Heading4, { "data-testid": "inventory-item-reservations-title", children: t("reservations.domain") }),
811
+ /* @__PURE__ */ jsx11(
812
+ Button2,
813
+ {
814
+ size: "small",
815
+ variant: "secondary",
816
+ asChild: true,
817
+ "data-testid": "inventory-create-reservation-button",
818
+ children: /* @__PURE__ */ jsx11(Link2, { to: `/reservations/create?item_id=${inventoryItem.id}`, children: t("actions.create") })
819
+ }
820
+ )
821
+ ]
822
+ }
823
+ ),
824
+ /* @__PURE__ */ jsx11(ReservationItemTable, { inventoryItem }),
825
+ /* @__PURE__ */ jsx11(
826
+ DisplayExtensionZone4,
827
+ {
828
+ model: "inventory_item",
829
+ zone: "reservations",
830
+ data: inventoryItem
831
+ }
832
+ )
833
+ ]
834
+ }
835
+ );
836
+ };
837
+
838
+ // src/pages/inventory/[id]/_components/inventory-item-offers/associated-offers-section.tsx
839
+ import { Container as Container5, Heading as Heading5 } from "@medusajs/ui";
840
+ import { useTranslation as useTranslation12 } from "react-i18next";
841
+ import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
842
+ var AssociatedOffersSection = ({
843
+ offers
844
+ }) => {
845
+ const { t } = useTranslation12();
846
+ if (!offers?.length) {
847
+ return null;
848
+ }
849
+ return /* @__PURE__ */ jsxs5(Container5, { className: "p-0", "data-testid": "inventory-item-offers-section", children: [
850
+ /* @__PURE__ */ jsx12("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx12(Heading5, { level: "h2", "data-testid": "inventory-item-offers-title", children: t("inventory.associatedOffers") }) }),
851
+ offers.map((offer) => {
852
+ const variantTitle = offer.product_variant?.title;
853
+ const productTitle = offer.product_variant?.product?.title;
854
+ const label = variantTitle || offer.sku;
855
+ const description = [variantTitle, productTitle].filter(Boolean).join(" \xB7 ");
856
+ return /* @__PURE__ */ jsx12(
857
+ SidebarLink,
858
+ {
859
+ to: `/offers/${offer.product_id}/variants/${offer.id}`,
860
+ labelKey: label,
861
+ descriptionKey: description,
862
+ icon: /* @__PURE__ */ jsx12(
863
+ Thumbnail,
864
+ {
865
+ src: offer.product_variant?.product?.thumbnail ?? null
866
+ }
867
+ ),
868
+ dataTestid: `inventory-associated-offer-${offer.id}`
869
+ },
870
+ offer.id
871
+ );
872
+ })
873
+ ] });
874
+ };
875
+
876
+ // src/pages/inventory/[id]/inventory-detail-page.tsx
877
+ import { Fragment, jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
878
+ var Root = ({ children }) => {
879
+ const { id } = useParams();
880
+ const initialData = useLoaderData();
881
+ const {
882
+ inventory_item,
883
+ isPending: isLoading,
884
+ isError,
885
+ error
886
+ } = useInventoryItem(
887
+ id,
888
+ useLinkQuery("inventory_item", INVENTORY_DETAIL_FIELDS),
889
+ { initialData }
890
+ );
891
+ if (isLoading || !inventory_item) {
892
+ return /* @__PURE__ */ jsx13(
893
+ TwoColumnPageSkeleton,
894
+ {
895
+ showJSON: true,
896
+ mainSections: 3,
897
+ sidebarSections: 2,
898
+ showMetadata: true
899
+ }
900
+ );
901
+ }
902
+ if (isError) {
903
+ throw error;
904
+ }
905
+ return /* @__PURE__ */ jsx13(Fragment, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs6(TwoColumnPage, { data: inventory_item, showJSON: true, showMetadata: true, children: [
906
+ /* @__PURE__ */ jsx13(TwoColumnPage.Main, { children: /* @__PURE__ */ jsxs6(WidgetZone, { id: "inventory.detail.main", data: inventory_item, children: [
907
+ /* @__PURE__ */ jsx13(InventoryItemGeneralSection, { inventoryItem: inventory_item }),
908
+ /* @__PURE__ */ jsx13(
909
+ InventoryItemLocationLevelsSection,
910
+ {
911
+ inventoryItem: inventory_item
912
+ }
913
+ ),
914
+ /* @__PURE__ */ jsx13(
915
+ InventoryItemReservationsSection,
916
+ {
917
+ inventoryItem: inventory_item
918
+ }
919
+ )
920
+ ] }) }),
921
+ /* @__PURE__ */ jsx13(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsxs6(WidgetZone, { id: "inventory.detail.side", data: inventory_item, children: [
922
+ /* @__PURE__ */ jsx13(
923
+ AssociatedOffersSection,
924
+ {
925
+ offers: inventory_item.offers
926
+ }
927
+ ),
928
+ /* @__PURE__ */ jsx13(
929
+ InventoryItemAttributeSection,
930
+ {
931
+ inventoryItem: inventory_item
932
+ }
933
+ )
934
+ ] }) })
935
+ ] }) });
936
+ };
937
+ var InventoryDetailPage = Object.assign(Root, {
938
+ Main: TwoColumnPage.Main,
939
+ Sidebar: TwoColumnPage.Sidebar,
940
+ MainGeneralSection: InventoryItemGeneralSection,
941
+ MainLocationLevelsSection: InventoryItemLocationLevelsSection,
942
+ MainReservationsSection: InventoryItemReservationsSection,
943
+ SidebarOffersSection: AssociatedOffersSection,
944
+ SidebarAttributeSection: InventoryItemAttributeSection
945
+ });
946
+ export {
947
+ InventoryDetailPage,
948
+ loader
949
+ };