@medusajs/dashboard 3.0.0-snapshot-20251114155958 → 3.0.0-snapshot-20251126221441

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 (253) hide show
  1. package/dist/{adjust-inventory-ZB3AVET7.mjs → adjust-inventory-WZOCLB5V.mjs} +1 -1
  2. package/dist/{api-key-management-create-U6VGZK7R.mjs → api-key-management-create-W7NL2IYN.mjs} +3 -3
  3. package/dist/{api-key-management-detail-B5XNEGKF.mjs → api-key-management-detail-3F77JKQT.mjs} +13 -13
  4. package/dist/{api-key-management-edit-TJM737A7.mjs → api-key-management-edit-TLVLXAVK.mjs} +3 -3
  5. package/dist/{api-key-management-list-ZRYMMTF5.mjs → api-key-management-list-FTLC3ELT.mjs} +3 -3
  6. package/dist/{api-key-management-sales-channels-D2RAHI7W.mjs → api-key-management-sales-channels-NYY3NZOE.mjs} +4 -4
  7. package/dist/app.css +3 -3
  8. package/dist/app.js +16021 -17376
  9. package/dist/app.mjs +11 -11
  10. package/dist/{campaign-create-IXOWJQ4L.mjs → campaign-create-LHL7FKQK.mjs} +3 -3
  11. package/dist/{campaign-detail-RCA3TBE4.mjs → campaign-detail-G2FIHVM2.mjs} +10 -10
  12. package/dist/{categories-metadata-5NBC7HX4.mjs → categories-metadata-YEF2WFML.mjs} +10 -10
  13. package/dist/{category-create-BTMZYQ5R.mjs → category-create-ELMCLH4J.mjs} +5 -5
  14. package/dist/{category-detail-RBUJVFPN.mjs → category-detail-ORXA4DBA.mjs} +14 -14
  15. package/dist/{category-edit-Q3KEELHO.mjs → category-edit-TYKLEYGE.mjs} +2 -2
  16. package/dist/{category-list-Z6HS6N75.mjs → category-list-IJ3DLPYQ.mjs} +5 -5
  17. package/dist/{category-organize-45NPSRNG.mjs → category-organize-PDLC54E2.mjs} +2 -2
  18. package/dist/{category-products-KREOO2KQ.mjs → category-products-GXTUJNT6.mjs} +13 -13
  19. package/dist/{chunk-SAZHCRHS.mjs → chunk-2PZVZSZW.mjs} +1 -1
  20. package/dist/{chunk-NFEW5CVI.mjs → chunk-3C6WQ7NH.mjs} +3 -37
  21. package/dist/{chunk-KF22R23X.mjs → chunk-3UOOSL7Y.mjs} +1 -1
  22. package/dist/{chunk-BYZSMXJ7.mjs → chunk-4DDI2KIE.mjs} +1 -1
  23. package/dist/{chunk-5N33TBBX.mjs → chunk-56TDUOXV.mjs} +1 -1
  24. package/dist/{chunk-67RC6SEX.mjs → chunk-5LGRZSEH.mjs} +1 -1
  25. package/dist/{chunk-W4TIFG3A.mjs → chunk-6KMZSZIA.mjs} +5 -5
  26. package/dist/{chunk-P23S5LDK.mjs → chunk-7V2JZU2B.mjs} +2 -2
  27. package/dist/{chunk-GHBURGZC.mjs → chunk-A6PWH2CK.mjs} +1 -1
  28. package/dist/{chunk-KJU3T6BK.mjs → chunk-AEMKNDRM.mjs} +2 -2
  29. package/dist/{chunk-QW4SQVMT.mjs → chunk-AENRV3N7.mjs} +50 -109
  30. package/dist/{chunk-O5DGX2NZ.mjs → chunk-AF7A24XI.mjs} +1 -1
  31. package/dist/{chunk-F7LJJHQT.mjs → chunk-C7F7MMXS.mjs} +1 -0
  32. package/dist/{chunk-CWIMWR6L.mjs → chunk-D6DIMX3W.mjs} +15 -15
  33. package/dist/{chunk-3RRA56WC.mjs → chunk-DODQ3KJT.mjs} +3 -8
  34. package/dist/{chunk-FJHAGJ5G.mjs → chunk-ETOJCN3Q.mjs} +1 -1
  35. package/dist/{chunk-YVQIO3JS.mjs → chunk-GYHQTVXN.mjs} +236 -318
  36. package/dist/{chunk-FNQ227BC.mjs → chunk-K5QWNI6V.mjs} +1 -1
  37. package/dist/{chunk-ZOJRDXH3.mjs → chunk-KC64IT2X.mjs} +1 -1
  38. package/dist/{chunk-K75OQ7QA.mjs → chunk-KHNOLBMA.mjs} +2 -2
  39. package/dist/{chunk-MOGV3UZD.mjs → chunk-KLNRCI3K.mjs} +1 -1
  40. package/dist/{chunk-YGEJFHC3.mjs → chunk-M3CKVBZC.mjs} +1 -1
  41. package/dist/{chunk-VW34SZWE.mjs → chunk-MDVO5GXZ.mjs} +2 -2
  42. package/dist/{chunk-7H6DB666.mjs → chunk-O4RZ3Y65.mjs} +1 -1
  43. package/dist/{chunk-5AM254NB.mjs → chunk-OFN7DIZA.mjs} +3 -83
  44. package/dist/{chunk-42TMWI76.mjs → chunk-OXPE5TAY.mjs} +1 -1
  45. package/dist/{chunk-NZNJSGGE.mjs → chunk-SIR4PJ4E.mjs} +3 -3
  46. package/dist/{chunk-QPJUVTKW.mjs → chunk-SWS2BE3M.mjs} +1 -1
  47. package/dist/{chunk-OMRGW7JS.mjs → chunk-T2ANPJ36.mjs} +3 -3
  48. package/dist/{chunk-ZE34KAKV.mjs → chunk-U63NCO35.mjs} +2 -2
  49. package/dist/{chunk-2WLOIS3L.mjs → chunk-WGRVE7KY.mjs} +21 -2
  50. package/dist/{chunk-BKJMQ6RP.mjs → chunk-WYITLR2E.mjs} +1 -1
  51. package/dist/{chunk-Y5TTJDGO.mjs → chunk-ZT7CR32D.mjs} +1 -1
  52. package/dist/{collection-add-products-KM4VO5G5.mjs → collection-add-products-D2KOVZPZ.mjs} +14 -14
  53. package/dist/{collection-create-RIGJHEX5.mjs → collection-create-I2A2X4VK.mjs} +2 -2
  54. package/dist/{collection-detail-MLVNULUS.mjs → collection-detail-ZT535E5T.mjs} +14 -14
  55. package/dist/{collection-edit-WX5G3FHR.mjs → collection-edit-RGH7NCUE.mjs} +2 -2
  56. package/dist/{collection-list-KWAHQGFE.mjs → collection-list-53JPFHPN.mjs} +23 -24
  57. package/dist/{collection-metadata-OMFOP3LA.mjs → collection-metadata-SQCA35II.mjs} +11 -11
  58. package/dist/{customer-detail-SVDGB2QD.mjs → customer-detail-W55EJ6LX.mjs} +14 -14
  59. package/dist/{customer-group-detail-OCQTI4GG.mjs → customer-group-detail-2WFTU5KU.mjs} +13 -13
  60. package/dist/{customer-group-list-K5MTMFLG.mjs → customer-group-list-GLF37WEN.mjs} +13 -13
  61. package/dist/{customers-add-customer-group-2LLBHTX3.mjs → customers-add-customer-group-KXT7RDV3.mjs} +13 -13
  62. package/dist/{edit-inventory-item-O6JLGZE4.mjs → edit-inventory-item-LMDNUI6M.mjs} +1 -1
  63. package/dist/{edit-inventory-item-attributes-AUVR3GYY.mjs → edit-inventory-item-attributes-DPJIHBP3.mjs} +1 -1
  64. package/dist/{edit-reservation-GQ6R6GVA.mjs → edit-reservation-IOOZBJ2T.mjs} +2 -2
  65. package/dist/{edit-rules-G7YMD5RC.mjs → edit-rules-7TG76PR3.mjs} +12 -12
  66. package/dist/en.json +3 -49
  67. package/dist/{inventory-create-GMFEGLE4.mjs → inventory-create-NQUETR3V.mjs} +10 -10
  68. package/dist/{inventory-detail-3BTAVXLJ.mjs → inventory-detail-ADLVUQJM.mjs} +10 -10
  69. package/dist/{inventory-list-ADJQDNX5.mjs → inventory-list-RQBI7UJX.mjs} +1 -1
  70. package/dist/{inventory-metadata-JJBXLQJG.mjs → inventory-metadata-45YATS7H.mjs} +10 -10
  71. package/dist/{inventory-stock-RHLN6ARK.mjs → inventory-stock-UG3CW3TM.mjs} +10 -10
  72. package/dist/{location-detail-F5QYFPUH.mjs → location-detail-BBPTVSP5.mjs} +15 -15
  73. package/dist/{location-fulfillment-providers-7JXNE6YT.mjs → location-fulfillment-providers-6AHWONY4.mjs} +14 -15
  74. package/dist/{location-sales-channels-JPH5BTUY.mjs → location-sales-channels-UVYT52SH.mjs} +3 -3
  75. package/dist/{location-service-zone-shipping-option-create-7VTPJAPA.mjs → location-service-zone-shipping-option-create-WEIDYZZT.mjs} +11 -11
  76. package/dist/{location-service-zone-shipping-option-edit-OYTEZGGC.mjs → location-service-zone-shipping-option-edit-TQNTCYII.mjs} +4 -4
  77. package/dist/{login-BGH5LSM4.mjs → login-VQ7YFW6V.mjs} +10 -10
  78. package/dist/{manage-locations-ATCDVTSR.mjs → manage-locations-2VDQ3ILT.mjs} +1 -1
  79. package/dist/{order-allocate-items-PHIW64XK.mjs → order-allocate-items-SSDLHV7A.mjs} +3 -3
  80. package/dist/{order-create-claim-NPQ6E5DR.mjs → order-create-claim-RAGNQ2RR.mjs} +18 -18
  81. package/dist/{order-create-edit-R4ZITC5I.mjs → order-create-edit-PRJWTWWE.mjs} +31 -16
  82. package/dist/{order-create-exchange-6XPYKVYN.mjs → order-create-exchange-DRSFEEL3.mjs} +60 -34
  83. package/dist/{order-create-fulfillment-7DVPBUES.mjs → order-create-fulfillment-URKHLFR7.mjs} +14 -14
  84. package/dist/{order-create-refund-7KEOYZTF.mjs → order-create-refund-VZG3UXLV.mjs} +15 -15
  85. package/dist/{order-create-return-J23AFCKP.mjs → order-create-return-P3OCXJSI.mjs} +6 -6
  86. package/dist/{order-create-shipment-KNXCANID.mjs → order-create-shipment-QZBUE342.mjs} +10 -10
  87. package/dist/{order-detail-7ATBL7GN.mjs → order-detail-32Y6JK42.mjs} +31 -31
  88. package/dist/{order-edit-billing-address-VS75YMUY.mjs → order-edit-billing-address-MUICLYNN.mjs} +11 -11
  89. package/dist/{order-edit-email-GEE7SF2E.mjs → order-edit-email-ADNCGCS3.mjs} +11 -11
  90. package/dist/{order-edit-shipping-address-HSRXSRLU.mjs → order-edit-shipping-address-NZF3KMVV.mjs} +11 -11
  91. package/dist/{order-list-GJTJHLZF.mjs → order-list-33SMDKZD.mjs} +5 -4
  92. package/dist/{order-metadata-LUBKP5Y4.mjs → order-metadata-UEKHMTAD.mjs} +10 -10
  93. package/dist/{order-receive-return-FLI44JN2.mjs → order-receive-return-5SB26KCQ.mjs} +11 -11
  94. package/dist/{order-request-transfer-NH2XCHMV.mjs → order-request-transfer-QS3LMEBW.mjs} +12 -12
  95. package/dist/{price-list-configuration-SS2VMD4N.mjs → price-list-configuration-CZPMKLNL.mjs} +4 -4
  96. package/dist/{price-list-create-DZR7JCDG.mjs → price-list-create-2YZRNBRI.mjs} +17 -17
  97. package/dist/{price-list-detail-4INABJQQ.mjs → price-list-detail-EGGLDH5B.mjs} +24 -20
  98. package/dist/{price-list-edit-VRI5T4W3.mjs → price-list-edit-3VNSZH4F.mjs} +2 -2
  99. package/dist/{price-list-list-S2HWTXKV.mjs → price-list-list-AU4IVCQN.mjs} +34 -18
  100. package/dist/{price-list-prices-add-DO43IEAD.mjs → price-list-prices-add-YRXYOXUG.mjs} +16 -14
  101. package/dist/{price-list-prices-edit-TRCLLGU4.mjs → price-list-prices-edit-UHOZKA75.mjs} +5 -3
  102. package/dist/{product-attributes-D6MNCAJB.mjs → product-attributes-W2PIZ6AU.mjs} +12 -12
  103. package/dist/{product-create-JQQTUEQL.mjs → product-create-UY3QXGNY.mjs} +554 -377
  104. package/dist/product-create-option-GAEPSU6J.mjs +145 -0
  105. package/dist/{product-create-variant-6UQRMACE.mjs → product-create-variant-RQEPRPG5.mjs} +11 -11
  106. package/dist/{product-detail-JMOULY3O.mjs → product-detail-FOLQUXCM.mjs} +54 -38
  107. package/dist/{product-edit-CC4OUBEC.mjs → product-edit-WRONAZ5F.mjs} +12 -12
  108. package/dist/product-edit-option-VIU3ZICO.mjs +150 -0
  109. package/dist/{product-export-BVREOXJT.mjs → product-export-ITQPBLG7.mjs} +22 -23
  110. package/dist/{product-image-variants-edit-7BBTFZO7.mjs → product-image-variants-edit-P2ZWO6DN.mjs} +10 -10
  111. package/dist/{product-import-UEXWOHOZ.mjs → product-import-WEHFNQXM.mjs} +10 -10
  112. package/dist/{product-list-RHHY3NAS.mjs → product-list-7QL2GZEA.mjs} +17 -17
  113. package/dist/{product-media-EKXMOSO4.mjs → product-media-WCLPCVR3.mjs} +2 -2
  114. package/dist/{product-metadata-DU2CNDKQ.mjs → product-metadata-LP3B3LXR.mjs} +10 -10
  115. package/dist/{product-organization-HU6YVPPV.mjs → product-organization-GKKUOJQV.mjs} +14 -14
  116. package/dist/{product-prices-UMEIS5AZ.mjs → product-prices-MKMKBH6P.mjs} +1 -1
  117. package/dist/{product-sales-channels-2SALTLTF.mjs → product-sales-channels-5YIO22UW.mjs} +3 -3
  118. package/dist/{product-shipping-profile-T4ZKHINJ.mjs → product-shipping-profile-GOESXQYV.mjs} +13 -13
  119. package/dist/{product-stock-CKBS4YDA.mjs → product-stock-KZ5NJINL.mjs} +10 -10
  120. package/dist/{product-tag-create-GFGPI7ML.mjs → product-tag-create-KOTNIDPO.mjs} +10 -10
  121. package/dist/{product-tag-detail-TTEWVF3I.mjs → product-tag-detail-4NEU4CQ4.mjs} +27 -28
  122. package/dist/{product-tag-edit-3XNTLATZ.mjs → product-tag-edit-UBVJB75M.mjs} +10 -10
  123. package/dist/{product-tag-list-24IJRVFR.mjs → product-tag-list-2JDK7DBC.mjs} +25 -26
  124. package/dist/{product-tag-metadata-JANWHZ3K.mjs → product-tag-metadata-H4QYJB5I.mjs} +10 -10
  125. package/dist/{product-type-detail-MAUHCM3C.mjs → product-type-detail-QSKBQZOO.mjs} +13 -13
  126. package/dist/{product-type-metadata-FAKUWQQF.mjs → product-type-metadata-OSGO33SD.mjs} +10 -10
  127. package/dist/{product-variant-detail-WHPECDUY.mjs → product-variant-detail-ATHRI3BX.mjs} +10 -10
  128. package/dist/{product-variant-edit-GR4RNE5G.mjs → product-variant-edit-457GNHH5.mjs} +11 -11
  129. package/dist/{product-variant-manage-inventory-items-IGDCLZQE.mjs → product-variant-manage-inventory-items-B7TUBSD5.mjs} +2 -2
  130. package/dist/{product-variant-media-EKI4BTEV.mjs → product-variant-media-6WWLRINP.mjs} +1 -1
  131. package/dist/{product-variant-metadata-DA2HKXXB.mjs → product-variant-metadata-GOUTYBDT.mjs} +10 -10
  132. package/dist/{promotion-add-campaign-DOALJUKJ.mjs → promotion-add-campaign-MKDYE7MW.mjs} +3 -3
  133. package/dist/{promotion-create-GGZULF2B.mjs → promotion-create-WCECPK2G.mjs} +18 -18
  134. package/dist/{promotion-detail-XK7U73XH.mjs → promotion-detail-JBM2LBZ4.mjs} +10 -10
  135. package/dist/{refund-reason-create-H7MHJ5C5.mjs → refund-reason-create-IAOKE37M.mjs} +10 -10
  136. package/dist/{refund-reason-edit-QY36CQVS.mjs → refund-reason-edit-D2VDINGV.mjs} +10 -10
  137. package/dist/{refund-reason-list-KSQW33QC.mjs → refund-reason-list-Q4TU7OVA.mjs} +13 -13
  138. package/dist/{region-create-UVJICJRX.mjs → region-create-QLPSK6TX.mjs} +1 -1
  139. package/dist/{region-edit-3NVXQECN.mjs → region-edit-JCJHA6TY.mjs} +1 -1
  140. package/dist/{region-metadata-4KQG6UL6.mjs → region-metadata-YLNPW7CL.mjs} +10 -10
  141. package/dist/{reservation-create-Z7TWUE2L.mjs → reservation-create-BW4CDTWR.mjs} +3 -3
  142. package/dist/{reservation-detail-W3FULMXT.mjs → reservation-detail-SMO3C2R5.mjs} +10 -10
  143. package/dist/{reservation-list-MN22JYAW.mjs → reservation-list-RGL67CIU.mjs} +2 -2
  144. package/dist/{reservation-metadata-AKAN5XNE.mjs → reservation-metadata-KU5AJF7S.mjs} +10 -10
  145. package/dist/{sales-channel-add-products-POHTQHMV.mjs → sales-channel-add-products-WGRIVVJA.mjs} +13 -13
  146. package/dist/{sales-channel-create-UFFXX5HK.mjs → sales-channel-create-TOBEDYFD.mjs} +2 -2
  147. package/dist/{sales-channel-detail-AACIFU2E.mjs → sales-channel-detail-VSTGXEZD.mjs} +13 -13
  148. package/dist/{sales-channel-edit-SP2HF4E3.mjs → sales-channel-edit-XUTE5GB5.mjs} +2 -2
  149. package/dist/{sales-channel-list-BY3KTVV6.mjs → sales-channel-list-2LXIRNZP.mjs} +11 -11
  150. package/dist/{sales-channel-metadata-KGOLI4BZ.mjs → sales-channel-metadata-RZMQYG4F.mjs} +10 -10
  151. package/dist/{shipping-option-type-create-PSQZW3RN.mjs → shipping-option-type-create-EQPBH6EA.mjs} +10 -10
  152. package/dist/{shipping-option-type-detail-WAW6TKJU.mjs → shipping-option-type-detail-BCCCVIIJ.mjs} +11 -11
  153. package/dist/{shipping-option-type-edit-2I44YHND.mjs → shipping-option-type-edit-CGTJ3HAR.mjs} +10 -10
  154. package/dist/{shipping-option-type-list-F4FRLW3P.mjs → shipping-option-type-list-3TLR4QZF.mjs} +11 -11
  155. package/dist/{shipping-profile-metadata-AZXPMPHG.mjs → shipping-profile-metadata-JSRQPOAD.mjs} +10 -10
  156. package/dist/{store-detail-AKRR64I6.mjs → store-detail-H53F5ESM.mjs} +10 -10
  157. package/dist/{store-edit-Q25HCMCQ.mjs → store-edit-3XS6IC2Z.mjs} +1 -1
  158. package/dist/{store-metadata-VLEDLAIJ.mjs → store-metadata-GHSJRHAV.mjs} +10 -10
  159. package/dist/{tax-region-create-JTM53LCS.mjs → tax-region-create-HYT3EOQO.mjs} +11 -11
  160. package/dist/{tax-region-detail-XBFYCVSH.mjs → tax-region-detail-TQS5425G.mjs} +28 -29
  161. package/dist/{tax-region-edit-2RRF7C7P.mjs → tax-region-edit-ZB36A456.mjs} +11 -11
  162. package/dist/{tax-region-province-detail-LGCYSFKE.mjs → tax-region-province-detail-CABVSQRU.mjs} +28 -29
  163. package/dist/{tax-region-tax-override-create-2W25EZNZ.mjs → tax-region-tax-override-create-ROK47GNE.mjs} +27 -28
  164. package/dist/{tax-region-tax-override-edit-ZSYNTYUG.mjs → tax-region-tax-override-edit-WRODO4LC.mjs} +26 -27
  165. package/dist/{user-detail-K5UMPO2L.mjs → user-detail-N6PT3KRP.mjs} +1 -1
  166. package/dist/{user-metadata-KOGHOQTW.mjs → user-metadata-DKZHLCPN.mjs} +10 -10
  167. package/dist/{workflow-execution-detail-4QAQ44YB.mjs → workflow-execution-detail-BQEMJSH6.mjs} +10 -10
  168. package/package.json +11 -11
  169. package/src/components/inputs/combobox/combobox.tsx +92 -173
  170. package/src/components/layout/main-layout/main-layout.tsx +4 -7
  171. package/src/dashboard-app/routes/get-route.map.tsx +12 -64
  172. package/src/hooks/api/index.ts +0 -1
  173. package/src/hooks/api/price-lists.tsx +32 -1
  174. package/src/hooks/api/products.tsx +66 -26
  175. package/src/hooks/table/filters/index.ts +0 -1
  176. package/src/i18n/translations/$schema.json +4 -172
  177. package/src/i18n/translations/en.json +3 -49
  178. package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +28 -3
  179. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-item.tsx +29 -4
  180. package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-item.tsx +23 -4
  181. package/src/routes/orders/order-detail/constants.ts +1 -0
  182. package/src/routes/orders/order-list/const.ts +1 -0
  183. package/src/routes/price-lists/price-list-detail/components/price-list-general-section/price-list-general-section.tsx +10 -4
  184. package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-count-cell.tsx +19 -0
  185. package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-columns.tsx +5 -6
  186. package/src/routes/price-lists/price-list-prices-add/price-list-prices-add.tsx +4 -1
  187. package/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +3 -1
  188. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +4 -16
  189. package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +198 -220
  190. package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +7 -4
  191. package/src/routes/products/product-create/constants.ts +0 -2
  192. package/src/routes/products/product-create/utils.ts +1 -6
  193. package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +122 -0
  194. package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +1 -0
  195. package/src/routes/products/product-create-option/index.ts +1 -0
  196. package/src/routes/products/product-create-option/product-create-option.tsx +26 -0
  197. package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +49 -31
  198. package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +123 -0
  199. package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +1 -0
  200. package/src/routes/products/product-edit-option/index.ts +1 -0
  201. package/src/routes/products/product-edit-option/product-edit-option.tsx +32 -0
  202. package/dist/chunk-ZHH3W7CN.mjs +0 -171
  203. package/dist/product-option-create-ML66ZKF3.mjs +0 -336
  204. package/dist/product-option-detail-DT7HJF5Q.mjs +0 -322
  205. package/dist/product-option-edit-GUKWRQQH.mjs +0 -324
  206. package/dist/product-option-list-KF3JSQ6Y.mjs +0 -262
  207. package/dist/product-option-metadata-BWWRRSAW.mjs +0 -71
  208. package/dist/product-options-manage-QYWBIHJA.mjs +0 -304
  209. package/src/hooks/api/product-options.tsx +0 -151
  210. package/src/hooks/table/columns/use-product-option-table-columns.tsx +0 -44
  211. package/src/hooks/table/filters/use-product-option-table-filters.tsx +0 -33
  212. package/src/hooks/table/query/use-product-option-table-query.tsx +0 -34
  213. package/src/routes/product-options/common/hooks/use-delete-product-option-action.tsx +0 -41
  214. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-details.tsx +0 -71
  215. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-form.tsx +0 -192
  216. package/src/routes/product-options/product-option-create/components/create-product-option-form/create-product-option-organize.tsx +0 -77
  217. package/src/routes/product-options/product-option-create/components/create-product-option-form/index.ts +0 -1
  218. package/src/routes/product-options/product-option-create/components/create-product-option-form/schema.ts +0 -15
  219. package/src/routes/product-options/product-option-create/index.ts +0 -1
  220. package/src/routes/product-options/product-option-create/product-option-create.tsx +0 -10
  221. package/src/routes/product-options/product-option-detail/breadcrumb.tsx +0 -14
  222. package/src/routes/product-options/product-option-detail/components/product-option-general-section/index.ts +0 -1
  223. package/src/routes/product-options/product-option-detail/components/product-option-general-section/product-option-general-section.tsx +0 -81
  224. package/src/routes/product-options/product-option-detail/components/product-option-product-section/index.ts +0 -1
  225. package/src/routes/product-options/product-option-detail/components/product-option-product-section/product-option-product-section.tsx +0 -74
  226. package/src/routes/product-options/product-option-detail/index.ts +0 -3
  227. package/src/routes/product-options/product-option-detail/loader.ts +0 -17
  228. package/src/routes/product-options/product-option-detail/product-option-detail.tsx +0 -50
  229. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-details.tsx +0 -94
  230. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-form.tsx +0 -116
  231. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/edit-product-option-organize.tsx +0 -77
  232. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/index.ts +0 -1
  233. package/src/routes/product-options/product-option-edit/components/edit-product-option-form/schema.ts +0 -13
  234. package/src/routes/product-options/product-option-edit/index.ts +0 -1
  235. package/src/routes/product-options/product-option-edit/product-option-edit.tsx +0 -34
  236. package/src/routes/product-options/product-option-list/components/product-option-list-table/index.ts +0 -1
  237. package/src/routes/product-options/product-option-list/components/product-option-list-table/product-option-list-table.tsx +0 -131
  238. package/src/routes/product-options/product-option-list/index.ts +0 -1
  239. package/src/routes/product-options/product-option-list/product-option-list.tsx +0 -19
  240. package/src/routes/product-options/product-option-metadata/index.ts +0 -1
  241. package/src/routes/product-options/product-option-metadata/product-option-metadata.tsx +0 -27
  242. package/src/routes/products/product-options-manage/components/product-options-manage-form/index.ts +0 -1
  243. package/src/routes/products/product-options-manage/components/product-options-manage-form/product-options-manage-form.tsx +0 -284
  244. package/src/routes/products/product-options-manage/index.ts +0 -1
  245. package/src/routes/products/product-options-manage/product-options-manage.tsx +0 -35
  246. package/dist/{chunk-2QH2TBJ2.mjs → chunk-ACJ3PPQJ.mjs} +3 -3
  247. package/dist/{customer-group-add-customers-2Y2GVCDV.mjs → customer-group-add-customers-QU4Q56SS.mjs} +3 -3
  248. package/dist/{customer-list-TG4D4QOT.mjs → customer-list-ZXCGIXJC.mjs} +3 -3
  249. package/dist/{location-list-ZJMZZ6T3.mjs → location-list-OYBI7EGV.mjs} +1 -1
  250. package/dist/{product-type-list-7WQ5D2KV.mjs → product-type-list-QX7QC6RI.mjs} +3 -3
  251. package/dist/{region-list-JAQXIBYD.mjs → region-list-XQRIBDMF.mjs} +3 -3
  252. package/dist/{return-reason-list-ATE2XU4H.mjs → return-reason-list-VYLLXDG4.mjs} +3 -3
  253. package/dist/{user-list-KPI3BTOA.mjs → user-list-6KATHOTJ.mjs} +3 -3
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ChipGroup
3
3
  } from "./chunk-X5VECN6S.mjs";
4
- import {
5
- SortableList
6
- } from "./chunk-ZHH3W7CN.mjs";
7
4
  import {
8
5
  HandleInput
9
6
  } from "./chunk-7OYLCEKK.mjs";
7
+ import {
8
+ ChipInput
9
+ } from "./chunk-XDJ7OMBR.mjs";
10
10
  import {
11
11
  useSalesChannelTableColumns,
12
12
  useSalesChannelTableEmptyState,
@@ -16,20 +16,20 @@ import {
16
16
  import "./chunk-2X25XWOW.mjs";
17
17
  import {
18
18
  CategoryCombobox
19
- } from "./chunk-GHBURGZC.mjs";
19
+ } from "./chunk-A6PWH2CK.mjs";
20
20
  import {
21
21
  useComboboxData
22
22
  } from "./chunk-3TZOFKX2.mjs";
23
23
  import {
24
24
  Combobox
25
- } from "./chunk-5AM254NB.mjs";
25
+ } from "./chunk-OFN7DIZA.mjs";
26
26
  import {
27
27
  PRODUCT_CREATE_FORM_DEFAULTS,
28
28
  ProductCreateSchema,
29
29
  UploadMediaFormItem,
30
30
  decorateVariantsWithDefaultValues,
31
31
  normalizeProductFormValues
32
- } from "./chunk-3RRA56WC.mjs";
32
+ } from "./chunk-DODQ3KJT.mjs";
33
33
  import "./chunk-ZQRKUG6J.mjs";
34
34
  import {
35
35
  DataGrid,
@@ -38,10 +38,10 @@ import {
38
38
  } from "./chunk-W7SLPIO2.mjs";
39
39
  import "./chunk-DK4WIVY6.mjs";
40
40
  import "./chunk-BYOPZAGX.mjs";
41
+ import "./chunk-2GWGNMAA.mjs";
41
42
  import {
42
43
  DataTable
43
44
  } from "./chunk-TBEGSDLQ.mjs";
44
- import "./chunk-2GWGNMAA.mjs";
45
45
  import "./chunk-C76H5USB.mjs";
46
46
  import "./chunk-DZWH2RV6.mjs";
47
47
  import {
@@ -61,7 +61,7 @@ import {
61
61
  import {
62
62
  FormExtensionZone,
63
63
  useExtendableForm
64
- } from "./chunk-YVQIO3JS.mjs";
64
+ } from "./chunk-GYHQTVXN.mjs";
65
65
  import "./chunk-2SSUH2HJ.mjs";
66
66
  import "./chunk-ONB3JEHR.mjs";
67
67
  import "./chunk-YCDDT44O.mjs";
@@ -88,31 +88,31 @@ import "./chunk-SUYYSKCB.mjs";
88
88
  import {
89
89
  Form
90
90
  } from "./chunk-OBQI23QM.mjs";
91
- import "./chunk-ZOJRDXH3.mjs";
91
+ import "./chunk-KC64IT2X.mjs";
92
92
  import "./chunk-I4OBEAOJ.mjs";
93
- import "./chunk-YGEJFHC3.mjs";
94
93
  import "./chunk-HI6URQ7H.mjs";
95
94
  import "./chunk-6CLQKVAU.mjs";
96
- import "./chunk-KI7TOXBR.mjs";
97
95
  import "./chunk-HKIF5HVL.mjs";
96
+ import "./chunk-M3CKVBZC.mjs";
97
+ import "./chunk-KI7TOXBR.mjs";
98
98
  import "./chunk-WAXMT4IY.mjs";
99
99
  import "./chunk-DYDGGABK.mjs";
100
100
  import "./chunk-LGNTHZ5Y.mjs";
101
101
  import "./chunk-CN7JXSGW.mjs";
102
102
  import "./chunk-5BQQRHQS.mjs";
103
- import "./chunk-7H6DB666.mjs";
104
- import "./chunk-2WLOIS3L.mjs";
103
+ import "./chunk-WGRVE7KY.mjs";
105
104
  import "./chunk-5AFMB7XQ.mjs";
105
+ import "./chunk-O4RZ3Y65.mjs";
106
106
  import "./chunk-A63RZVX6.mjs";
107
107
  import "./chunk-HBXV7ENS.mjs";
108
108
  import "./chunk-CDORR33H.mjs";
109
- import "./chunk-VW34SZWE.mjs";
110
- import "./chunk-MOGV3UZD.mjs";
111
- import "./chunk-5N33TBBX.mjs";
109
+ import "./chunk-MDVO5GXZ.mjs";
110
+ import "./chunk-KLNRCI3K.mjs";
111
+ import "./chunk-56TDUOXV.mjs";
112
112
  import {
113
113
  useSalesChannel,
114
114
  useSalesChannels
115
- } from "./chunk-FNQ227BC.mjs";
115
+ } from "./chunk-K5QWNI6V.mjs";
116
116
  import "./chunk-3BF5SC66.mjs";
117
117
  import {
118
118
  useStore
@@ -124,9 +124,8 @@ import {
124
124
  usePricePreferences
125
125
  } from "./chunk-SQDIZZDW.mjs";
126
126
  import {
127
- useCreateProduct,
128
- useProductOptions
129
- } from "./chunk-QW4SQVMT.mjs";
127
+ useCreateProduct
128
+ } from "./chunk-AENRV3N7.mjs";
130
129
  import "./chunk-FXYH54JP.mjs";
131
130
  import "./chunk-774WSTCC.mjs";
132
131
  import {
@@ -138,7 +137,7 @@ import "./chunk-QZ7TP4HQ.mjs";
138
137
  import { useTranslation as useTranslation10 } from "react-i18next";
139
138
 
140
139
  // src/routes/products/product-create/components/product-create-form/product-create-form.tsx
141
- import { Button as Button4, ProgressTabs, toast } from "@medusajs/ui";
140
+ import { Button as Button5, ProgressTabs, toast } from "@medusajs/ui";
142
141
  import { useEffect as useEffect2, useMemo as useMemo4, useState as useState4 } from "react";
143
142
  import { useWatch as useWatch4 } from "react-hook-form";
144
143
  import { useTranslation as useTranslation9 } from "react-i18next";
@@ -165,13 +164,7 @@ var ProductCreateGeneralSection = ({
165
164
  render: ({ field }) => {
166
165
  return /* @__PURE__ */ jsxs(Form.Item, { children: [
167
166
  /* @__PURE__ */ jsx(Form.Label, { children: t("products.fields.title.label") }),
168
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
169
- Input,
170
- {
171
- ...field,
172
- placeholder: t("products.fields.title.placeholder")
173
- }
174
- ) })
167
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field, placeholder: t("products.fields.title.placeholder") }) })
175
168
  ] });
176
169
  }
177
170
  }
@@ -184,13 +177,7 @@ var ProductCreateGeneralSection = ({
184
177
  render: ({ field }) => {
185
178
  return /* @__PURE__ */ jsxs(Form.Item, { children: [
186
179
  /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("products.fields.subtitle.label") }),
187
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
188
- Input,
189
- {
190
- ...field,
191
- placeholder: t("products.fields.subtitle.placeholder")
192
- }
193
- ) })
180
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field, placeholder: t("products.fields.subtitle.placeholder") }) })
194
181
  ] });
195
182
  }
196
183
  }
@@ -210,13 +197,7 @@ var ProductCreateGeneralSection = ({
210
197
  children: t("fields.handle")
211
198
  }
212
199
  ),
213
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
214
- HandleInput,
215
- {
216
- ...field,
217
- placeholder: t("products.fields.handle.placeholder")
218
- }
219
- ) })
200
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(HandleInput, { ...field, placeholder: t("products.fields.handle.placeholder") }) })
220
201
  ] });
221
202
  }
222
203
  }
@@ -230,13 +211,7 @@ var ProductCreateGeneralSection = ({
230
211
  render: ({ field }) => {
231
212
  return /* @__PURE__ */ jsxs(Form.Item, { children: [
232
213
  /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("products.fields.description.label") }),
233
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
234
- Textarea,
235
- {
236
- ...field,
237
- placeholder: t("products.fields.description.placeholder")
238
- }
239
- ) })
214
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field, placeholder: t("products.fields.description.placeholder") }) })
240
215
  ] });
241
216
  }
242
217
  }
@@ -537,23 +512,197 @@ function formatFileSize(bytes, decimalPlaces = 2) {
537
512
  }
538
513
 
539
514
  // src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx
515
+ import { XMarkMini } from "@medusajs/icons";
540
516
  import {
541
517
  Alert,
518
+ Button,
542
519
  Checkbox,
543
- clx,
520
+ clx as clx2,
544
521
  Heading,
545
522
  Hint,
523
+ IconButton as IconButton3,
546
524
  InlineTip,
525
+ Input as Input2,
547
526
  Label,
548
527
  Text as Text2
549
528
  } from "@medusajs/ui";
550
529
  import {
530
+ Controller,
551
531
  useFieldArray as useFieldArray2,
552
532
  useWatch
553
533
  } from "react-hook-form";
554
534
  import { useTranslation as useTranslation3 } from "react-i18next";
555
- import { useMemo, useState as useState2 } from "react";
556
- import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
535
+
536
+ // src/components/common/sortable-list/sortable-list.tsx
537
+ import {
538
+ DndContext as DndContext2,
539
+ DragOverlay as DragOverlay2,
540
+ KeyboardSensor as KeyboardSensor2,
541
+ PointerSensor as PointerSensor2,
542
+ defaultDropAnimationSideEffects as defaultDropAnimationSideEffects2,
543
+ useSensor as useSensor2,
544
+ useSensors as useSensors2
545
+ } from "@dnd-kit/core";
546
+ import {
547
+ SortableContext as SortableContext2,
548
+ arrayMove as arrayMove2,
549
+ sortableKeyboardCoordinates as sortableKeyboardCoordinates2,
550
+ useSortable as useSortable2
551
+ } from "@dnd-kit/sortable";
552
+ import { CSS as CSS2 } from "@dnd-kit/utilities";
553
+ import { DotsSix as DotsSix2 } from "@medusajs/icons";
554
+ import { IconButton as IconButton2, clx } from "@medusajs/ui";
555
+ import {
556
+ Fragment,
557
+ createContext,
558
+ useContext,
559
+ useMemo,
560
+ useState as useState2
561
+ } from "react";
562
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
563
+ var List = ({
564
+ items,
565
+ onChange,
566
+ renderItem
567
+ }) => {
568
+ const [active, setActive] = useState2(null);
569
+ const [activeItem, activeIndex] = useMemo(() => {
570
+ if (active === null) {
571
+ return [null, null];
572
+ }
573
+ const index = items.findIndex(({ id }) => id === active.id);
574
+ return [items[index], index];
575
+ }, [active, items]);
576
+ const sensors = useSensors2(
577
+ useSensor2(PointerSensor2),
578
+ useSensor2(KeyboardSensor2, {
579
+ coordinateGetter: sortableKeyboardCoordinates2
580
+ })
581
+ );
582
+ const handleDragStart = ({ active: active2 }) => {
583
+ setActive(active2);
584
+ };
585
+ const handleDragEnd = ({ active: active2, over }) => {
586
+ if (over && active2.id !== over.id) {
587
+ const activeIndex2 = items.findIndex(({ id }) => id === active2.id);
588
+ const overIndex = items.findIndex(({ id }) => id === over.id);
589
+ onChange(arrayMove2(items, activeIndex2, overIndex));
590
+ }
591
+ setActive(null);
592
+ };
593
+ const handleDragCancel = () => {
594
+ setActive(null);
595
+ };
596
+ return /* @__PURE__ */ jsxs3(
597
+ DndContext2,
598
+ {
599
+ sensors,
600
+ onDragStart: handleDragStart,
601
+ onDragEnd: handleDragEnd,
602
+ onDragCancel: handleDragCancel,
603
+ children: [
604
+ /* @__PURE__ */ jsx3(Overlay, { children: activeItem && activeIndex !== null ? renderItem(activeItem, activeIndex) : null }),
605
+ /* @__PURE__ */ jsx3(SortableContext2, { items, children: /* @__PURE__ */ jsx3(
606
+ "ul",
607
+ {
608
+ role: "application",
609
+ className: "flex list-inside list-none list-image-none flex-col p-0",
610
+ children: items.map((item, index) => /* @__PURE__ */ jsx3(Fragment, { children: renderItem(item, index) }, item.id))
611
+ }
612
+ ) })
613
+ ]
614
+ }
615
+ );
616
+ };
617
+ var dropAnimationConfig2 = {
618
+ sideEffects: defaultDropAnimationSideEffects2({
619
+ styles: {
620
+ active: {
621
+ opacity: "0.4"
622
+ }
623
+ }
624
+ })
625
+ };
626
+ var Overlay = ({ children }) => {
627
+ return /* @__PURE__ */ jsx3(
628
+ DragOverlay2,
629
+ {
630
+ className: "shadow-elevation-card-hover overflow-hidden rounded-md [&>li]:border-b-0",
631
+ dropAnimation: dropAnimationConfig2,
632
+ children
633
+ }
634
+ );
635
+ };
636
+ var SortableItemContext = createContext(null);
637
+ var useSortableItemContext = () => {
638
+ const context = useContext(SortableItemContext);
639
+ if (!context) {
640
+ throw new Error(
641
+ "useSortableItemContext must be used within a SortableItemContext"
642
+ );
643
+ }
644
+ return context;
645
+ };
646
+ var Item = ({
647
+ id,
648
+ className,
649
+ children
650
+ }) => {
651
+ const {
652
+ attributes,
653
+ isDragging,
654
+ listeners,
655
+ setNodeRef,
656
+ setActivatorNodeRef,
657
+ transform,
658
+ transition
659
+ } = useSortable2({ id });
660
+ const context = useMemo(
661
+ () => ({
662
+ attributes,
663
+ listeners,
664
+ ref: setActivatorNodeRef,
665
+ isDragging
666
+ }),
667
+ [attributes, listeners, setActivatorNodeRef, isDragging]
668
+ );
669
+ const style = {
670
+ opacity: isDragging ? 0.4 : void 0,
671
+ transform: CSS2.Translate.toString(transform),
672
+ transition
673
+ };
674
+ return /* @__PURE__ */ jsx3(SortableItemContext.Provider, { value: context, children: /* @__PURE__ */ jsx3(
675
+ "li",
676
+ {
677
+ className: clx("transition-fg flex flex-1 list-none", className),
678
+ ref: setNodeRef,
679
+ style,
680
+ children
681
+ }
682
+ ) });
683
+ };
684
+ var DragHandle = () => {
685
+ const { attributes, listeners, ref } = useSortableItemContext();
686
+ return /* @__PURE__ */ jsx3(
687
+ IconButton2,
688
+ {
689
+ variant: "transparent",
690
+ size: "small",
691
+ ...attributes,
692
+ ...listeners,
693
+ ref,
694
+ className: "cursor-grab touch-none active:cursor-grabbing",
695
+ children: /* @__PURE__ */ jsx3(DotsSix2, { className: "text-ui-fg-muted" })
696
+ }
697
+ );
698
+ };
699
+ var SortableList = Object.assign(List, {
700
+ Item,
701
+ DragHandle
702
+ });
703
+
704
+ // src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx
705
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
557
706
  var getPermutations = (data) => {
558
707
  if (data.length === 0) {
559
708
  return [];
@@ -579,6 +728,10 @@ var ProductCreateVariantsSection = ({
579
728
  form
580
729
  }) => {
581
730
  const { t } = useTranslation3();
731
+ const options = useFieldArray2({
732
+ control: form.control,
733
+ name: "options"
734
+ });
582
735
  const variants = useFieldArray2({
583
736
  control: form.control,
584
737
  name: "variants"
@@ -600,117 +753,71 @@ var ProductCreateVariantsSection = ({
600
753
  });
601
754
  const showInvalidOptionsMessage = !!form.formState.errors.options?.length;
602
755
  const showInvalidVariantsMessage = form.formState.errors.variants?.root?.message === "invalid_length";
603
- const { product_options = [], isLoading } = useProductOptions({
604
- is_exclusive: false
605
- });
606
- const productOptionChoices = useMemo(() => {
607
- return product_options.map((option) => ({
608
- value: option.id,
609
- label: option.title
610
- }));
611
- }, [product_options]);
612
- const [selectedOptionIds, setSelectedOptionIds] = useState2([]);
613
- const [selectedOptionValues, setSelectedOptionValues] = useState2({});
614
- const [customValues, setCustomValues] = useState2({});
615
- const handleProductOptionSelect = (optionIds) => {
616
- setSelectedOptionIds(optionIds);
617
- const newSelectedValues = {};
618
- const selectedProductOptions = product_options.filter(
619
- (option) => optionIds.includes(option.id)
756
+ const handleOptionValueUpdate = (index, value) => {
757
+ const { isTouched: hasUserSelectedVariants } = form.getFieldState("variants");
758
+ const newOptions = [...watchedOptions];
759
+ newOptions[index].values = value;
760
+ const permutations = getPermutations(
761
+ newOptions.filter(({ values }) => values.length)
620
762
  );
621
- selectedProductOptions.forEach((option) => {
622
- if (selectedOptionValues[option.id]) {
623
- newSelectedValues[option.id] = selectedOptionValues[option.id];
624
- } else {
625
- newSelectedValues[option.id] = option.values?.map((v) => v.id) || [];
763
+ const oldVariants = [...watchedVariants];
764
+ const findMatchingPermutation = (options2) => {
765
+ return permutations.find(
766
+ (permutation) => Object.keys(options2).every((key) => options2[key] === permutation[key])
767
+ );
768
+ };
769
+ const newVariants = oldVariants.reduce((variants2, variant) => {
770
+ const match = findMatchingPermutation(variant.options);
771
+ if (match) {
772
+ variants2.push({
773
+ ...variant,
774
+ title: getVariantName(match),
775
+ options: match
776
+ });
626
777
  }
778
+ return variants2;
779
+ }, []);
780
+ const usedPermutations = new Set(
781
+ newVariants.map((variant) => variant.options)
782
+ );
783
+ const unusedPermutations = permutations.filter(
784
+ (permutation) => !usedPermutations.has(permutation)
785
+ );
786
+ unusedPermutations.forEach((permutation) => {
787
+ newVariants.push({
788
+ title: getVariantName(permutation),
789
+ options: permutation,
790
+ should_create: hasUserSelectedVariants ? false : true,
791
+ variant_rank: newVariants.length,
792
+ // NOTE - prepare inventory array here for now so we prevent rendering issue if we append the items later
793
+ inventory: [{ inventory_item_id: "", required_quantity: "" }]
794
+ });
627
795
  });
628
- setSelectedOptionValues(newSelectedValues);
629
- updateFormWithSelectedValues(selectedProductOptions, newSelectedValues);
796
+ form.setValue("variants", newVariants);
630
797
  };
631
- const handleValueChange = (optionId, valueIds) => {
632
- if (valueIds.length === 0) {
798
+ const handleRemoveOption = (index) => {
799
+ if (index === 0) {
633
800
  return;
634
801
  }
635
- const allValues = getAllValuesForOption(optionId);
636
- const existingValueIds = new Set(allValues.map((v) => v.id));
637
- const validValueIds = [];
638
- const newCustomValues = [];
639
- valueIds.forEach((id) => {
640
- if (existingValueIds.has(id)) {
641
- validValueIds.push(id);
642
- } else {
643
- newCustomValues.push(id);
802
+ options.remove(index);
803
+ const newOptions = [...watchedOptions];
804
+ newOptions.splice(index, 1);
805
+ const validOptionTitles = new Set(newOptions.map((option) => option.title));
806
+ const permutations = getPermutations(newOptions);
807
+ const oldVariants = [...watchedVariants];
808
+ const newVariants = permutations.reduce((variants2, permutation) => {
809
+ const variant = oldVariants.find(
810
+ ({ options: options2 }) => Object.keys(options2).filter((option) => validOptionTitles.has(option)).every((key) => options2[key] === permutation[key])
811
+ );
812
+ if (variant) {
813
+ variants2.push({
814
+ ...variant,
815
+ title: variant.title,
816
+ options: permutation
817
+ });
644
818
  }
645
- });
646
- let updatedCustomValues = customValues;
647
- const updatedValidValueIds = [...validValueIds];
648
- newCustomValues.forEach((newValue) => {
649
- const tempId = `custom-${Date.now()}-${Math.random()}-${newValue}`;
650
- const existingCustom = updatedCustomValues[optionId] || [];
651
- const option = product_options.find((opt) => opt.id === optionId);
652
- const existingValuesCount = (option?.values?.length || 0) + existingCustom.length;
653
- const newCustomValue = {
654
- id: tempId,
655
- value: newValue,
656
- rank: existingValuesCount + newCustomValues.indexOf(newValue)
657
- };
658
- updatedCustomValues = {
659
- ...updatedCustomValues,
660
- [optionId]: [...updatedCustomValues[optionId] || [], newCustomValue]
661
- };
662
- updatedValidValueIds.push(tempId);
663
- });
664
- if (newCustomValues.length > 0) {
665
- setCustomValues(updatedCustomValues);
666
- }
667
- const updatedSelectedValues = {
668
- ...selectedOptionValues,
669
- [optionId]: updatedValidValueIds
670
- };
671
- setSelectedOptionValues(updatedSelectedValues);
672
- const selectedProductOptions = product_options.filter(
673
- (option) => selectedOptionIds.includes(option.id)
674
- );
675
- updateFormWithSelectedValues(
676
- selectedProductOptions,
677
- updatedSelectedValues,
678
- newCustomValues.length > 0 ? updatedCustomValues : void 0
679
- );
680
- };
681
- const getAllValuesForOption = (optionId, customVals) => {
682
- const option = product_options.find((opt) => opt.id === optionId);
683
- const existingValues = option?.values || [];
684
- const customForOption = (customVals || customValues)[optionId] || [];
685
- return [...existingValues, ...customForOption];
686
- };
687
- const updateFormWithSelectedValues = (selectedProductOptions, valueSelections, customVals) => {
688
- const newOptions = selectedProductOptions.map((option) => {
689
- const selectedValueIds = valueSelections[option.id] || [];
690
- const allValues = getAllValuesForOption(option.id, customVals);
691
- const selectedValues = allValues.filter((v) => selectedValueIds.includes(v.id)).sort((a, b) => {
692
- const rankA = a.rank ?? Number.MAX_VALUE;
693
- const rankB = b.rank ?? Number.MAX_VALUE;
694
- return rankA - rankB;
695
- }).map((v) => v.value);
696
- return {
697
- id: option.id,
698
- title: option.title,
699
- values: selectedValues,
700
- value_ids: selectedValueIds
701
- };
702
- });
703
- form.setValue("options", newOptions);
704
- const permutations = getPermutations(
705
- newOptions.filter(({ values }) => values.length)
706
- );
707
- const newVariants = permutations.map((permutation, index) => ({
708
- title: getVariantName(permutation),
709
- options: permutation,
710
- should_create: true,
711
- variant_rank: index,
712
- inventory: [{ inventory_item_id: "", required_quantity: "" }]
713
- }));
819
+ return variants2;
820
+ }, []);
714
821
  form.setValue("variants", newVariants);
715
822
  };
716
823
  const handleRankChange = (items) => {
@@ -782,10 +889,10 @@ var ProductCreateVariantsSection = ({
782
889
  ])
783
890
  );
784
891
  };
785
- return /* @__PURE__ */ jsxs3("div", { id: "variants", className: "flex flex-col gap-y-8", children: [
786
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
787
- /* @__PURE__ */ jsx3(Heading, { level: "h2", children: t("products.create.variants.header") }),
788
- /* @__PURE__ */ jsx3(
892
+ return /* @__PURE__ */ jsxs4("div", { id: "variants", className: "flex flex-col gap-y-8", children: [
893
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
894
+ /* @__PURE__ */ jsx4(Heading, { level: "h2", children: t("products.create.variants.header") }),
895
+ /* @__PURE__ */ jsx4(
789
896
  SwitchBox,
790
897
  {
791
898
  control: form.control,
@@ -804,74 +911,141 @@ var ProductCreateVariantsSection = ({
804
911
  } else {
805
912
  createDefaultOptionAndVariant();
806
913
  }
807
- setSelectedOptionIds([]);
808
- setSelectedOptionValues({});
809
- setCustomValues({});
810
914
  }
811
915
  }
812
916
  )
813
917
  ] }),
814
- watchedAreVariantsEnabled && /* @__PURE__ */ jsxs3(Fragment, { children: [
815
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
816
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
817
- /* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("products.create.variants.productOptions.label") }),
818
- /* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.productOptions.hint") })
819
- ] }),
820
- showInvalidOptionsMessage && /* @__PURE__ */ jsx3(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.options") }),
821
- /* @__PURE__ */ jsx3(
822
- Combobox,
823
- {
824
- value: selectedOptionIds,
825
- onChange: (value) => handleProductOptionSelect(value),
826
- options: productOptionChoices,
827
- placeholder: t("products.fields.options.optionTitlePlaceholder"),
828
- disabled: isLoading,
829
- displayMode: "chips"
918
+ watchedAreVariantsEnabled && /* @__PURE__ */ jsxs4(Fragment2, { children: [
919
+ /* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-y-6", children: /* @__PURE__ */ jsx4(
920
+ Form.Field,
921
+ {
922
+ control: form.control,
923
+ name: "options",
924
+ render: () => {
925
+ return /* @__PURE__ */ jsx4(Form.Item, { children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
926
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-start justify-between gap-x-4", children: [
927
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
928
+ /* @__PURE__ */ jsx4(Form.Label, { children: t("products.create.variants.productOptions.label") }),
929
+ /* @__PURE__ */ jsx4(Form.Hint, { children: t("products.create.variants.productOptions.hint") })
930
+ ] }),
931
+ /* @__PURE__ */ jsx4(
932
+ Button,
933
+ {
934
+ size: "small",
935
+ variant: "secondary",
936
+ type: "button",
937
+ onClick: () => {
938
+ options.append({
939
+ title: "",
940
+ values: []
941
+ });
942
+ },
943
+ children: t("actions.add")
944
+ }
945
+ )
946
+ ] }),
947
+ showInvalidOptionsMessage && /* @__PURE__ */ jsx4(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.options") }),
948
+ /* @__PURE__ */ jsx4("ul", { className: "flex flex-col gap-y-4", children: options.fields.map((option, index) => {
949
+ const hasError = !!form.formState.errors.options?.[index];
950
+ return /* @__PURE__ */ jsxs4(
951
+ "li",
952
+ {
953
+ className: clx2(
954
+ "bg-ui-bg-component shadow-elevation-card-rest grid grid-cols-[1fr_28px] items-center gap-1.5 rounded-xl p-1.5",
955
+ {
956
+ "border-ui-border-error shadow-borders-error": hasError
957
+ }
958
+ ),
959
+ children: [
960
+ /* @__PURE__ */ jsxs4("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
961
+ /* @__PURE__ */ jsx4("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx4(
962
+ Label,
963
+ {
964
+ size: "xsmall",
965
+ weight: "plus",
966
+ className: "text-ui-fg-subtle",
967
+ htmlFor: `options.${index}.title`,
968
+ children: t("fields.title")
969
+ }
970
+ ) }),
971
+ /* @__PURE__ */ jsx4(
972
+ Input2,
973
+ {
974
+ className: "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover",
975
+ ...form.register(
976
+ `options.${index}.title`
977
+ ),
978
+ placeholder: t(
979
+ "products.fields.options.optionTitlePlaceholder"
980
+ )
981
+ }
982
+ ),
983
+ /* @__PURE__ */ jsx4("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx4(
984
+ Label,
985
+ {
986
+ size: "xsmall",
987
+ weight: "plus",
988
+ className: "text-ui-fg-subtle",
989
+ htmlFor: `options.${index}.values`,
990
+ children: t("fields.values")
991
+ }
992
+ ) }),
993
+ /* @__PURE__ */ jsx4(
994
+ Controller,
995
+ {
996
+ control: form.control,
997
+ name: `options.${index}.values`,
998
+ render: ({
999
+ field: { onChange, ...field }
1000
+ }) => {
1001
+ const handleValueChange = (value) => {
1002
+ handleOptionValueUpdate(index, value);
1003
+ onChange(value);
1004
+ };
1005
+ return /* @__PURE__ */ jsx4(
1006
+ ChipInput,
1007
+ {
1008
+ ...field,
1009
+ variant: "contrast",
1010
+ onChange: handleValueChange,
1011
+ placeholder: t(
1012
+ "products.fields.options.variantionsPlaceholder"
1013
+ )
1014
+ }
1015
+ );
1016
+ }
1017
+ }
1018
+ )
1019
+ ] }),
1020
+ /* @__PURE__ */ jsx4(
1021
+ IconButton3,
1022
+ {
1023
+ type: "button",
1024
+ size: "small",
1025
+ variant: "transparent",
1026
+ className: "text-ui-fg-muted",
1027
+ disabled: index === 0,
1028
+ onClick: () => handleRemoveOption(index),
1029
+ children: /* @__PURE__ */ jsx4(XMarkMini, {})
1030
+ }
1031
+ )
1032
+ ]
1033
+ },
1034
+ option.id
1035
+ );
1036
+ }) })
1037
+ ] }) });
830
1038
  }
831
- )
832
- ] }),
833
- selectedOptionIds.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-4", children: [
834
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
835
- /* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("fields.values") }),
836
- /* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.selectValuesHint") })
837
- ] }),
838
- /* @__PURE__ */ jsx3("div", { className: "flex flex-col gap-y-3", children: product_options.filter((option) => selectedOptionIds.includes(option.id)).map((option) => {
839
- const allValues = getAllValuesForOption(option.id);
840
- const valueOptions = allValues.sort((a, b) => {
841
- const rankA = a.rank ?? Number.MAX_VALUE;
842
- const rankB = b.rank ?? Number.MAX_VALUE;
843
- return rankA - rankB;
844
- }).map((v) => ({
845
- value: v.id,
846
- label: v.value
847
- }));
848
- return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-2", children: [
849
- /* @__PURE__ */ jsx3(Label, { size: "small", weight: "plus", children: option.title }),
850
- /* @__PURE__ */ jsx3(
851
- Combobox,
852
- {
853
- value: selectedOptionValues[option.id] || [],
854
- onChange: (value) => handleValueChange(option.id, value),
855
- onCreateOption: (_) => {
856
- },
857
- options: valueOptions,
858
- placeholder: t(
859
- "products.fields.options.variantionsPlaceholder"
860
- ),
861
- displayMode: "chips"
862
- }
863
- )
864
- ] }, option.id);
865
- }) })
866
- ] }),
867
- /* @__PURE__ */ jsx3("div", { className: "grid grid-cols-1 gap-x-4 gap-y-8", children: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-y-6", children: [
868
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-col", children: [
869
- /* @__PURE__ */ jsx3(Label, { weight: "plus", children: t("products.create.variants.productVariants.label") }),
870
- /* @__PURE__ */ jsx3(Hint, { children: t("products.create.variants.productVariants.hint") })
1039
+ }
1040
+ ) }),
1041
+ /* @__PURE__ */ jsx4("div", { className: "grid grid-cols-1 gap-x-4 gap-y-8", children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
1042
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
1043
+ /* @__PURE__ */ jsx4(Label, { weight: "plus", children: t("products.create.variants.productVariants.label") }),
1044
+ /* @__PURE__ */ jsx4(Hint, { children: t("products.create.variants.productVariants.hint") })
871
1045
  ] }),
872
- !showInvalidOptionsMessage && showInvalidVariantsMessage && /* @__PURE__ */ jsx3(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.variants") }),
873
- variants.fields.length > 0 ? /* @__PURE__ */ jsxs3("div", { className: "overflow-hidden rounded-xl border", children: [
874
- /* @__PURE__ */ jsxs3(
1046
+ !showInvalidOptionsMessage && showInvalidVariantsMessage && /* @__PURE__ */ jsx4(Alert, { dismissible: true, variant: "error", children: t("products.create.errors.variants") }),
1047
+ variants.fields.length > 0 ? /* @__PURE__ */ jsxs4("div", { className: "overflow-hidden rounded-xl border", children: [
1048
+ /* @__PURE__ */ jsxs4(
875
1049
  "div",
876
1050
  {
877
1051
  className: "bg-ui-bg-component text-ui-fg-subtle grid items-center gap-3 border-b px-6 py-2.5",
@@ -879,7 +1053,7 @@ var ProductCreateVariantsSection = ({
879
1053
  gridTemplateColumns: `20px 28px repeat(${watchedOptions.length}, 1fr)`
880
1054
  },
881
1055
  children: [
882
- /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(
1056
+ /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
883
1057
  Checkbox,
884
1058
  {
885
1059
  className: "relative",
@@ -887,25 +1061,25 @@ var ProductCreateVariantsSection = ({
887
1061
  onCheckedChange: onCheckboxChange
888
1062
  }
889
1063
  ) }),
890
- /* @__PURE__ */ jsx3("div", {}),
891
- watchedOptions.map((option, index) => /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: option.title }) }, index))
1064
+ /* @__PURE__ */ jsx4("div", {}),
1065
+ watchedOptions.map((option, index) => /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", weight: "plus", children: option.title }) }, index))
892
1066
  ]
893
1067
  }
894
1068
  ),
895
- /* @__PURE__ */ jsx3(
1069
+ /* @__PURE__ */ jsx4(
896
1070
  SortableList,
897
1071
  {
898
1072
  items: variants.fields,
899
1073
  onChange: handleRankChange,
900
1074
  renderItem: (item, index) => {
901
- return /* @__PURE__ */ jsx3(
1075
+ return /* @__PURE__ */ jsx4(
902
1076
  SortableList.Item,
903
1077
  {
904
1078
  id: item.id,
905
- className: clx("bg-ui-bg-base border-b", {
1079
+ className: clx2("bg-ui-bg-base border-b", {
906
1080
  "border-b-0": index === variants.fields.length - 1
907
1081
  }),
908
- children: /* @__PURE__ */ jsxs3(
1082
+ children: /* @__PURE__ */ jsxs4(
909
1083
  "div",
910
1084
  {
911
1085
  className: "text-ui-fg-subtle grid w-full items-center gap-3 px-6 py-2.5",
@@ -913,7 +1087,7 @@ var ProductCreateVariantsSection = ({
913
1087
  gridTemplateColumns: `20px 28px repeat(${watchedOptions.length}, 1fr)`
914
1088
  },
915
1089
  children: [
916
- /* @__PURE__ */ jsx3(
1090
+ /* @__PURE__ */ jsx4(
917
1091
  Form.Field,
918
1092
  {
919
1093
  control: form.control,
@@ -921,7 +1095,7 @@ var ProductCreateVariantsSection = ({
921
1095
  render: ({
922
1096
  field: { value, onChange, ...field }
923
1097
  }) => {
924
- return /* @__PURE__ */ jsx3(Form.Item, { children: /* @__PURE__ */ jsx3(Form.Control, { children: /* @__PURE__ */ jsx3(
1098
+ return /* @__PURE__ */ jsx4(Form.Item, { children: /* @__PURE__ */ jsx4(Form.Control, { children: /* @__PURE__ */ jsx4(
925
1099
  Checkbox,
926
1100
  {
927
1101
  className: "relative",
@@ -933,8 +1107,8 @@ var ProductCreateVariantsSection = ({
933
1107
  }
934
1108
  }
935
1109
  ),
936
- /* @__PURE__ */ jsx3(SortableList.DragHandle, {}),
937
- Object.values(item.options).map((value, index2) => /* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: value }, index2))
1110
+ /* @__PURE__ */ jsx4(SortableList.DragHandle, {}),
1111
+ Object.values(item.options).map((value, index2) => /* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", children: value }, index2))
938
1112
  ]
939
1113
  }
940
1114
  )
@@ -943,40 +1117,40 @@ var ProductCreateVariantsSection = ({
943
1117
  }
944
1118
  }
945
1119
  )
946
- ] }) : /* @__PURE__ */ jsx3(Alert, { children: t("products.create.variants.productVariants.alert") }),
947
- variants.fields.length > 0 && /* @__PURE__ */ jsx3(InlineTip, { label: t("general.tip"), children: t("products.create.variants.productVariants.tip") })
1120
+ ] }) : /* @__PURE__ */ jsx4(Alert, { children: t("products.create.variants.productVariants.alert") }),
1121
+ variants.fields.length > 0 && /* @__PURE__ */ jsx4(InlineTip, { label: t("general.tip"), children: t("products.create.variants.productVariants.tip") })
948
1122
  ] }) })
949
1123
  ] })
950
1124
  ] });
951
1125
  };
952
1126
 
953
1127
  // src/routes/products/product-create/components/product-create-details-form/product-create-details-form.tsx
954
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1128
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
955
1129
  var ProductCreateDetailsForm = ({ form }) => {
956
1130
  const { getFormFields } = useExtension();
957
1131
  const fields = getFormFields("product", "create", "general");
958
- return /* @__PURE__ */ jsx4("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs4("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
959
- /* @__PURE__ */ jsx4(Header, {}),
960
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-y-6", children: [
961
- /* @__PURE__ */ jsx4(ProductCreateGeneralSection, { form }),
962
- /* @__PURE__ */ jsx4(FormExtensionZone, { fields, form }),
963
- /* @__PURE__ */ jsx4(ProductCreateMediaSection, { form })
1132
+ return /* @__PURE__ */ jsx5("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs5("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
1133
+ /* @__PURE__ */ jsx5(Header, {}),
1134
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-y-6", children: [
1135
+ /* @__PURE__ */ jsx5(ProductCreateGeneralSection, { form }),
1136
+ /* @__PURE__ */ jsx5(FormExtensionZone, { fields, form }),
1137
+ /* @__PURE__ */ jsx5(ProductCreateMediaSection, { form })
964
1138
  ] }),
965
- /* @__PURE__ */ jsx4(Divider, {}),
966
- /* @__PURE__ */ jsx4(ProductCreateVariantsSection, { form })
1139
+ /* @__PURE__ */ jsx5(Divider, {}),
1140
+ /* @__PURE__ */ jsx5(ProductCreateVariantsSection, { form })
967
1141
  ] }) });
968
1142
  };
969
1143
  var Header = () => {
970
1144
  const { t } = useTranslation4();
971
- return /* @__PURE__ */ jsx4("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx4(Heading2, { children: t("products.create.header") }) });
1145
+ return /* @__PURE__ */ jsx5("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx5(Heading2, { children: t("products.create.header") }) });
972
1146
  };
973
1147
 
974
1148
  // src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx
975
- import { Button, Heading as Heading3, IconButton as IconButton2, Input as Input2, Label as Label2 } from "@medusajs/ui";
1149
+ import { Button as Button2, Heading as Heading3, IconButton as IconButton4, Input as Input3, Label as Label2 } from "@medusajs/ui";
976
1150
  import { useFieldArray as useFieldArray3, useWatch as useWatch2 } from "react-hook-form";
977
- import { XMarkMini } from "@medusajs/icons";
1151
+ import { XMarkMini as XMarkMini2 } from "@medusajs/icons";
978
1152
  import { useTranslation as useTranslation5 } from "react-i18next";
979
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1153
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
980
1154
  function InventoryItemRow({
981
1155
  form,
982
1156
  variantIndex,
@@ -1000,13 +1174,13 @@ function InventoryItemRow({
1000
1174
  value: item.id
1001
1175
  }))
1002
1176
  });
1003
- return /* @__PURE__ */ jsxs5(
1177
+ return /* @__PURE__ */ jsxs6(
1004
1178
  "li",
1005
1179
  {
1006
1180
  className: "bg-ui-bg-component shadow-elevation-card-rest grid grid-cols-[1fr_28px] items-center gap-1.5 rounded-xl p-1.5",
1007
1181
  children: [
1008
- /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
1009
- /* @__PURE__ */ jsx5("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx5(
1182
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-[min-content,1fr] items-center gap-1.5", children: [
1183
+ /* @__PURE__ */ jsx6("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx6(
1010
1184
  Label2,
1011
1185
  {
1012
1186
  size: "xsmall",
@@ -1016,13 +1190,13 @@ function InventoryItemRow({
1016
1190
  children: t("fields.item")
1017
1191
  }
1018
1192
  ) }),
1019
- /* @__PURE__ */ jsx5(
1193
+ /* @__PURE__ */ jsx6(
1020
1194
  Form.Field,
1021
1195
  {
1022
1196
  control: form.control,
1023
1197
  name: `variants.${variantIndex}.inventory.${inventoryIndex}.inventory_item_id`,
1024
1198
  render: ({ field }) => {
1025
- return /* @__PURE__ */ jsx5(Form.Item, { children: /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(
1199
+ return /* @__PURE__ */ jsx6(Form.Item, { children: /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(
1026
1200
  Combobox,
1027
1201
  {
1028
1202
  ...field,
@@ -1041,7 +1215,7 @@ function InventoryItemRow({
1041
1215
  }
1042
1216
  }
1043
1217
  ),
1044
- /* @__PURE__ */ jsx5("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx5(
1218
+ /* @__PURE__ */ jsx6("div", { className: "flex items-center px-2 py-1.5", children: /* @__PURE__ */ jsx6(
1045
1219
  Label2,
1046
1220
  {
1047
1221
  size: "xsmall",
@@ -1051,15 +1225,15 @@ function InventoryItemRow({
1051
1225
  children: t("fields.quantity")
1052
1226
  }
1053
1227
  ) }),
1054
- /* @__PURE__ */ jsx5(
1228
+ /* @__PURE__ */ jsx6(
1055
1229
  Form.Field,
1056
1230
  {
1057
1231
  control: form.control,
1058
1232
  name: `variants.${variantIndex}.inventory.${inventoryIndex}.required_quantity`,
1059
1233
  render: ({ field: { onChange, value, ...field } }) => {
1060
- return /* @__PURE__ */ jsxs5(Form.Item, { children: [
1061
- /* @__PURE__ */ jsx5(Form.Control, { children: /* @__PURE__ */ jsx5(
1062
- Input2,
1234
+ return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1235
+ /* @__PURE__ */ jsx6(Form.Control, { children: /* @__PURE__ */ jsx6(
1236
+ Input3,
1063
1237
  {
1064
1238
  type: "number",
1065
1239
  className: "bg-ui-bg-field-component",
@@ -1079,21 +1253,21 @@ function InventoryItemRow({
1079
1253
  )
1080
1254
  }
1081
1255
  ) }),
1082
- /* @__PURE__ */ jsx5(Form.ErrorMessage, {})
1256
+ /* @__PURE__ */ jsx6(Form.ErrorMessage, {})
1083
1257
  ] });
1084
1258
  }
1085
1259
  }
1086
1260
  )
1087
1261
  ] }),
1088
- /* @__PURE__ */ jsx5(
1089
- IconButton2,
1262
+ /* @__PURE__ */ jsx6(
1263
+ IconButton4,
1090
1264
  {
1091
1265
  type: "button",
1092
1266
  size: "small",
1093
1267
  variant: "transparent",
1094
1268
  className: "text-ui-fg-muted",
1095
1269
  onClick: onRemove,
1096
- children: /* @__PURE__ */ jsx5(XMarkMini, {})
1270
+ children: /* @__PURE__ */ jsx6(XMarkMini2, {})
1097
1271
  }
1098
1272
  )
1099
1273
  ]
@@ -1116,14 +1290,14 @@ function VariantSection({ form, variant, index }) {
1116
1290
  (i, index2) => index2 != inventoryIndex && i.inventory_item_id === option.value
1117
1291
  );
1118
1292
  };
1119
- return /* @__PURE__ */ jsxs5("div", { className: "grid gap-y-4", children: [
1120
- /* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-x-4", children: [
1121
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-col", children: [
1122
- /* @__PURE__ */ jsx5(Form.Label, { children: variant.title }),
1123
- /* @__PURE__ */ jsx5(Form.Hint, { children: t("products.create.inventory.label") })
1293
+ return /* @__PURE__ */ jsxs6("div", { className: "grid gap-y-4", children: [
1294
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-start justify-between gap-x-4", children: [
1295
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
1296
+ /* @__PURE__ */ jsx6(Form.Label, { children: variant.title }),
1297
+ /* @__PURE__ */ jsx6(Form.Hint, { children: t("products.create.inventory.label") })
1124
1298
  ] }),
1125
- /* @__PURE__ */ jsx5(
1126
- Button,
1299
+ /* @__PURE__ */ jsx6(
1300
+ Button2,
1127
1301
  {
1128
1302
  size: "small",
1129
1303
  variant: "secondary",
@@ -1138,7 +1312,7 @@ function VariantSection({ form, variant, index }) {
1138
1312
  }
1139
1313
  )
1140
1314
  ] }),
1141
- inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */ jsx5(
1315
+ inventory.fields.map((inventoryItem, inventoryIndex) => /* @__PURE__ */ jsx6(
1142
1316
  InventoryItemRow,
1143
1317
  {
1144
1318
  form,
@@ -1160,9 +1334,9 @@ var ProductCreateInventoryKitSection = ({
1160
1334
  control: form.control,
1161
1335
  name: "variants"
1162
1336
  });
1163
- return /* @__PURE__ */ jsxs5("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1164
- /* @__PURE__ */ jsx5(Heading3, { children: t("products.create.inventory.heading") }),
1165
- variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */ jsx5(
1337
+ return /* @__PURE__ */ jsxs6("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1338
+ /* @__PURE__ */ jsx6(Heading3, { children: t("products.create.inventory.heading") }),
1339
+ variants.fields.filter((v) => v.inventory_kit).map((variant, variantIndex) => /* @__PURE__ */ jsx6(
1166
1340
  VariantSection,
1167
1341
  {
1168
1342
  form,
@@ -1175,18 +1349,18 @@ var ProductCreateInventoryKitSection = ({
1175
1349
  };
1176
1350
 
1177
1351
  // src/routes/products/product-create/components/product-create-inventory-kit-form/product-create-inventory-kit-form.tsx
1178
- import { jsx as jsx6 } from "react/jsx-runtime";
1352
+ import { jsx as jsx7 } from "react/jsx-runtime";
1179
1353
  var ProductCreateInventoryKitForm = ({
1180
1354
  form
1181
1355
  }) => {
1182
- return /* @__PURE__ */ jsx6("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx6("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx6(ProductCreateInventoryKitSection, { form }) }) });
1356
+ return /* @__PURE__ */ jsx7("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsx7("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: /* @__PURE__ */ jsx7(ProductCreateInventoryKitSection, { form }) }) });
1183
1357
  };
1184
1358
 
1185
1359
  // src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx
1186
- import { Button as Button2, Heading as Heading4 } from "@medusajs/ui";
1360
+ import { Button as Button3, Heading as Heading4 } from "@medusajs/ui";
1187
1361
  import { useFieldArray as useFieldArray4 } from "react-hook-form";
1188
1362
  import { Trans, useTranslation as useTranslation6 } from "react-i18next";
1189
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1363
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1190
1364
  var ProductCreateOrganizationSection = ({
1191
1365
  form
1192
1366
  }) => {
@@ -1231,9 +1405,9 @@ var ProductCreateOrganizationSection = ({
1231
1405
  const handleClearAllSalesChannels = () => {
1232
1406
  replace([]);
1233
1407
  };
1234
- return /* @__PURE__ */ jsxs6("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1235
- /* @__PURE__ */ jsx7(Heading4, { children: t("products.organization.header") }),
1236
- /* @__PURE__ */ jsx7(
1408
+ return /* @__PURE__ */ jsxs7("div", { id: "organize", className: "flex flex-col gap-y-8", children: [
1409
+ /* @__PURE__ */ jsx8(Heading4, { children: t("products.organization.header") }),
1410
+ /* @__PURE__ */ jsx8(
1237
1411
  SwitchBox,
1238
1412
  {
1239
1413
  control: form.control,
@@ -1243,16 +1417,16 @@ var ProductCreateOrganizationSection = ({
1243
1417
  optional: true
1244
1418
  }
1245
1419
  ),
1246
- /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1247
- /* @__PURE__ */ jsx7(
1420
+ /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1421
+ /* @__PURE__ */ jsx8(
1248
1422
  Form.Field,
1249
1423
  {
1250
1424
  control: form.control,
1251
1425
  name: "type_id",
1252
1426
  render: ({ field }) => {
1253
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1254
- /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.type.label") }),
1255
- /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1427
+ return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1428
+ /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.type.label") }),
1429
+ /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1256
1430
  Combobox,
1257
1431
  {
1258
1432
  ...field,
@@ -1262,20 +1436,20 @@ var ProductCreateOrganizationSection = ({
1262
1436
  fetchNextPage: types.fetchNextPage
1263
1437
  }
1264
1438
  ) }),
1265
- /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1439
+ /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1266
1440
  ] });
1267
1441
  }
1268
1442
  }
1269
1443
  ),
1270
- /* @__PURE__ */ jsx7(
1444
+ /* @__PURE__ */ jsx8(
1271
1445
  Form.Field,
1272
1446
  {
1273
1447
  control: form.control,
1274
1448
  name: "collection_id",
1275
1449
  render: ({ field }) => {
1276
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1277
- /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.collection.label") }),
1278
- /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1450
+ return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1451
+ /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.collection.label") }),
1452
+ /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1279
1453
  Combobox,
1280
1454
  {
1281
1455
  ...field,
@@ -1285,36 +1459,36 @@ var ProductCreateOrganizationSection = ({
1285
1459
  fetchNextPage: collections.fetchNextPage
1286
1460
  }
1287
1461
  ) }),
1288
- /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1462
+ /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1289
1463
  ] });
1290
1464
  }
1291
1465
  }
1292
1466
  )
1293
1467
  ] }),
1294
- /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1295
- /* @__PURE__ */ jsx7(
1468
+ /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1469
+ /* @__PURE__ */ jsx8(
1296
1470
  Form.Field,
1297
1471
  {
1298
1472
  control: form.control,
1299
1473
  name: "categories",
1300
1474
  render: ({ field }) => {
1301
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1302
- /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.categories.label") }),
1303
- /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(CategoryCombobox, { ...field }) }),
1304
- /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1475
+ return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1476
+ /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.categories.label") }),
1477
+ /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(CategoryCombobox, { ...field }) }),
1478
+ /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1305
1479
  ] });
1306
1480
  }
1307
1481
  }
1308
1482
  ),
1309
- /* @__PURE__ */ jsx7(
1483
+ /* @__PURE__ */ jsx8(
1310
1484
  Form.Field,
1311
1485
  {
1312
1486
  control: form.control,
1313
1487
  name: "tags",
1314
1488
  render: ({ field }) => {
1315
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1316
- /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.tags.label") }),
1317
- /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1489
+ return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1490
+ /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.tags.label") }),
1491
+ /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1318
1492
  Combobox,
1319
1493
  {
1320
1494
  ...field,
@@ -1324,25 +1498,25 @@ var ProductCreateOrganizationSection = ({
1324
1498
  fetchNextPage: tags.fetchNextPage
1325
1499
  }
1326
1500
  ) }),
1327
- /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1501
+ /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1328
1502
  ] });
1329
1503
  }
1330
1504
  }
1331
1505
  )
1332
1506
  ] }),
1333
- /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1334
- /* @__PURE__ */ jsxs6("div", { children: [
1335
- /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.shipping_profile.label") }),
1336
- /* @__PURE__ */ jsx7(Form.Hint, { children: /* @__PURE__ */ jsx7(Trans, { i18nKey: "products.fields.shipping_profile.hint" }) })
1507
+ /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
1508
+ /* @__PURE__ */ jsxs7("div", { children: [
1509
+ /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.shipping_profile.label") }),
1510
+ /* @__PURE__ */ jsx8(Form.Hint, { children: /* @__PURE__ */ jsx8(Trans, { i18nKey: "products.fields.shipping_profile.hint" }) })
1337
1511
  ] }),
1338
- /* @__PURE__ */ jsx7(
1512
+ /* @__PURE__ */ jsx8(
1339
1513
  Form.Field,
1340
1514
  {
1341
1515
  control: form.control,
1342
1516
  name: "shipping_profile_id",
1343
1517
  render: ({ field }) => {
1344
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1345
- /* @__PURE__ */ jsx7(Form.Control, { children: /* @__PURE__ */ jsx7(
1518
+ return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1519
+ /* @__PURE__ */ jsx8(Form.Control, { children: /* @__PURE__ */ jsx8(
1346
1520
  Combobox,
1347
1521
  {
1348
1522
  ...field,
@@ -1352,33 +1526,33 @@ var ProductCreateOrganizationSection = ({
1352
1526
  fetchNextPage: shippingProfiles.fetchNextPage
1353
1527
  }
1354
1528
  ) }),
1355
- /* @__PURE__ */ jsx7(Form.ErrorMessage, {})
1529
+ /* @__PURE__ */ jsx8(Form.ErrorMessage, {})
1356
1530
  ] });
1357
1531
  }
1358
1532
  }
1359
1533
  )
1360
1534
  ] }),
1361
- /* @__PURE__ */ jsx7("div", { className: "grid grid-cols-1 gap-y-4", children: /* @__PURE__ */ jsx7(
1535
+ /* @__PURE__ */ jsx8("div", { className: "grid grid-cols-1 gap-y-4", children: /* @__PURE__ */ jsx8(
1362
1536
  Form.Field,
1363
1537
  {
1364
1538
  control: form.control,
1365
1539
  name: "sales_channels",
1366
1540
  render: () => {
1367
- return /* @__PURE__ */ jsxs6(Form.Item, { children: [
1368
- /* @__PURE__ */ jsxs6("div", { className: "flex items-start justify-between gap-x-4", children: [
1369
- /* @__PURE__ */ jsxs6("div", { children: [
1370
- /* @__PURE__ */ jsx7(Form.Label, { optional: true, children: t("products.fields.sales_channels.label") }),
1371
- /* @__PURE__ */ jsx7(Form.Hint, { children: /* @__PURE__ */ jsx7(Trans, { i18nKey: "products.fields.sales_channels.hint" }) })
1541
+ return /* @__PURE__ */ jsxs7(Form.Item, { children: [
1542
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-start justify-between gap-x-4", children: [
1543
+ /* @__PURE__ */ jsxs7("div", { children: [
1544
+ /* @__PURE__ */ jsx8(Form.Label, { optional: true, children: t("products.fields.sales_channels.label") }),
1545
+ /* @__PURE__ */ jsx8(Form.Hint, { children: /* @__PURE__ */ jsx8(Trans, { i18nKey: "products.fields.sales_channels.hint" }) })
1372
1546
  ] }),
1373
- /* @__PURE__ */ jsx7(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx7(Button2, { size: "small", variant: "secondary", type: "button", children: t("actions.add") }) })
1547
+ /* @__PURE__ */ jsx8(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx8(Button3, { size: "small", variant: "secondary", type: "button", children: t("actions.add") }) })
1374
1548
  ] }),
1375
- /* @__PURE__ */ jsx7(Form.Control, { className: "mt-0", children: fields.length > 0 && /* @__PURE__ */ jsx7(
1549
+ /* @__PURE__ */ jsx8(Form.Control, { className: "mt-0", children: fields.length > 0 && /* @__PURE__ */ jsx8(
1376
1550
  ChipGroup,
1377
1551
  {
1378
1552
  onClearAll: handleClearAllSalesChannels,
1379
1553
  onRemove: remove,
1380
1554
  className: "py-4",
1381
- children: fields.map((field, index) => /* @__PURE__ */ jsx7(ChipGroup.Chip, { index, children: field.name }, field.key))
1555
+ children: fields.map((field, index) => /* @__PURE__ */ jsx8(ChipGroup.Chip, { index, children: field.name }, field.key))
1382
1556
  }
1383
1557
  ) })
1384
1558
  ] });
@@ -1390,7 +1564,7 @@ var ProductCreateOrganizationSection = ({
1390
1564
 
1391
1565
  // src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
1392
1566
  import {
1393
- Button as Button3,
1567
+ Button as Button4,
1394
1568
  createDataTableColumnHelper
1395
1569
  } from "@medusajs/ui";
1396
1570
  import { useEffect, useMemo as useMemo2, useState as useState3 } from "react";
@@ -1401,7 +1575,7 @@ import { keepPreviousData } from "@tanstack/react-query";
1401
1575
  var SC_STACKED_MODAL_ID = "sc";
1402
1576
 
1403
1577
  // src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx
1404
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1578
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1405
1579
  var PAGE_SIZE = 20;
1406
1580
  var ProductCreateSalesChannelStackedModal = ({
1407
1581
  form
@@ -1475,9 +1649,9 @@ var ProductCreateSalesChannelStackedModal = ({
1475
1649
  if (isError) {
1476
1650
  throw error;
1477
1651
  }
1478
- return /* @__PURE__ */ jsxs7(StackedFocusModal.Content, { className: "flex flex-col overflow-hidden", children: [
1479
- /* @__PURE__ */ jsx8(StackedFocusModal.Header, {}),
1480
- /* @__PURE__ */ jsx8(StackedFocusModal.Body, { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx8(
1652
+ return /* @__PURE__ */ jsxs8(StackedFocusModal.Content, { className: "flex flex-col overflow-hidden", children: [
1653
+ /* @__PURE__ */ jsx9(StackedFocusModal.Header, {}),
1654
+ /* @__PURE__ */ jsx9(StackedFocusModal.Body, { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx9(
1481
1655
  DataTable,
1482
1656
  {
1483
1657
  data: sales_channels,
@@ -1496,9 +1670,9 @@ var ProductCreateSalesChannelStackedModal = ({
1496
1670
  prefix: SC_STACKED_MODAL_ID
1497
1671
  }
1498
1672
  ) }),
1499
- /* @__PURE__ */ jsx8(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-end gap-x-2", children: [
1500
- /* @__PURE__ */ jsx8(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx8(Button3, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
1501
- /* @__PURE__ */ jsx8(Button3, { size: "small", onClick: handleAdd, type: "button", children: t("actions.save") })
1673
+ /* @__PURE__ */ jsx9(StackedFocusModal.Footer, { children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-end gap-x-2", children: [
1674
+ /* @__PURE__ */ jsx9(StackedFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx9(Button4, { size: "small", variant: "secondary", type: "button", children: t("actions.cancel") }) }),
1675
+ /* @__PURE__ */ jsx9(Button4, { size: "small", onClick: handleAdd, type: "button", children: t("actions.save") })
1502
1676
  ] }) })
1503
1677
  ] });
1504
1678
  };
@@ -1509,16 +1683,16 @@ var useColumns = () => {
1509
1683
  };
1510
1684
 
1511
1685
  // src/routes/products/product-create/components/product-create-organize-form/product-create-organize-form.tsx
1512
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1686
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1513
1687
  var ProductCreateOrganizeForm = ({ form }) => {
1514
1688
  const { getFormFields } = useExtension();
1515
1689
  const fields = getFormFields("product", "create", "organize");
1516
- return /* @__PURE__ */ jsxs8(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
1517
- /* @__PURE__ */ jsx9("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs8("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
1518
- /* @__PURE__ */ jsx9(ProductCreateOrganizationSection, { form }),
1519
- /* @__PURE__ */ jsx9(FormExtensionZone, { fields, form })
1690
+ return /* @__PURE__ */ jsxs9(StackedFocusModal, { id: SC_STACKED_MODAL_ID, children: [
1691
+ /* @__PURE__ */ jsx10("div", { className: "flex flex-col items-center p-16", children: /* @__PURE__ */ jsxs9("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
1692
+ /* @__PURE__ */ jsx10(ProductCreateOrganizationSection, { form }),
1693
+ /* @__PURE__ */ jsx10(FormExtensionZone, { fields, form })
1520
1694
  ] }) }),
1521
- /* @__PURE__ */ jsx9(ProductCreateSalesChannelStackedModal, { form })
1695
+ /* @__PURE__ */ jsx10(ProductCreateSalesChannelStackedModal, { form })
1522
1696
  ] });
1523
1697
  };
1524
1698
 
@@ -1526,7 +1700,7 @@ var ProductCreateOrganizeForm = ({ form }) => {
1526
1700
  import { useMemo as useMemo3 } from "react";
1527
1701
  import { useWatch as useWatch3 } from "react-hook-form";
1528
1702
  import { useTranslation as useTranslation8 } from "react-i18next";
1529
- import { jsx as jsx10 } from "react/jsx-runtime";
1703
+ import { jsx as jsx11 } from "react/jsx-runtime";
1530
1704
  var ProductCreateVariantsForm = ({
1531
1705
  form,
1532
1706
  regions,
@@ -1563,7 +1737,7 @@ var ProductCreateVariantsForm = ({
1563
1737
  });
1564
1738
  return ret;
1565
1739
  }, [variants]);
1566
- return /* @__PURE__ */ jsx10("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx10(
1740
+ return /* @__PURE__ */ jsx11("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx11(
1567
1741
  DataGrid,
1568
1742
  {
1569
1743
  columns,
@@ -1585,9 +1759,9 @@ var useColumns2 = ({
1585
1759
  () => [
1586
1760
  columnHelper2.column({
1587
1761
  id: "options",
1588
- header: () => /* @__PURE__ */ jsx10("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx10("span", { className: "truncate", children: options.map((o) => o.title).join(" / ") }) }),
1762
+ header: () => /* @__PURE__ */ jsx11("div", { className: "flex size-full items-center overflow-hidden", children: /* @__PURE__ */ jsx11("span", { className: "truncate", children: options.map((o) => o.title).join(" / ") }) }),
1589
1763
  cell: (context) => {
1590
- return /* @__PURE__ */ jsx10(DataGrid.ReadonlyCell, { context, children: options.map((o) => context.row.original.options[o.title]).join(" / ") });
1764
+ return /* @__PURE__ */ jsx11(DataGrid.ReadonlyCell, { context, children: options.map((o) => context.row.original.options[o.title]).join(" / ") });
1591
1765
  },
1592
1766
  disableHiding: true
1593
1767
  }),
@@ -1598,7 +1772,7 @@ var useColumns2 = ({
1598
1772
  field: (context) => `variants.${context.row.original.originalIndex}.title`,
1599
1773
  type: "text",
1600
1774
  cell: (context) => {
1601
- return /* @__PURE__ */ jsx10(DataGrid.TextCell, { context });
1775
+ return /* @__PURE__ */ jsx11(DataGrid.TextCell, { context });
1602
1776
  }
1603
1777
  }),
1604
1778
  columnHelper2.column({
@@ -1608,7 +1782,7 @@ var useColumns2 = ({
1608
1782
  field: (context) => `variants.${context.row.original.originalIndex}.sku`,
1609
1783
  type: "text",
1610
1784
  cell: (context) => {
1611
- return /* @__PURE__ */ jsx10(DataGrid.TextCell, { context });
1785
+ return /* @__PURE__ */ jsx11(DataGrid.TextCell, { context });
1612
1786
  }
1613
1787
  }),
1614
1788
  columnHelper2.column({
@@ -1618,7 +1792,7 @@ var useColumns2 = ({
1618
1792
  field: (context) => `variants.${context.row.original.originalIndex}.manage_inventory`,
1619
1793
  type: "boolean",
1620
1794
  cell: (context) => {
1621
- return /* @__PURE__ */ jsx10(DataGrid.BooleanCell, { context });
1795
+ return /* @__PURE__ */ jsx11(DataGrid.BooleanCell, { context });
1622
1796
  }
1623
1797
  }),
1624
1798
  columnHelper2.column({
@@ -1628,7 +1802,7 @@ var useColumns2 = ({
1628
1802
  field: (context) => `variants.${context.row.original.originalIndex}.allow_backorder`,
1629
1803
  type: "boolean",
1630
1804
  cell: (context) => {
1631
- return /* @__PURE__ */ jsx10(DataGrid.BooleanCell, { context });
1805
+ return /* @__PURE__ */ jsx11(DataGrid.BooleanCell, { context });
1632
1806
  }
1633
1807
  }),
1634
1808
  columnHelper2.column({
@@ -1638,7 +1812,7 @@ var useColumns2 = ({
1638
1812
  field: (context) => `variants.${context.row.original.originalIndex}.inventory_kit`,
1639
1813
  type: "boolean",
1640
1814
  cell: (context) => {
1641
- return /* @__PURE__ */ jsx10(
1815
+ return /* @__PURE__ */ jsx11(
1642
1816
  DataGrid.BooleanCell,
1643
1817
  {
1644
1818
  context,
@@ -1665,7 +1839,7 @@ var useColumns2 = ({
1665
1839
  };
1666
1840
 
1667
1841
  // src/routes/products/product-create/components/product-create-form/product-create-form.tsx
1668
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1842
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1669
1843
  var SAVE_DRAFT_BUTTON = "save-draft-button";
1670
1844
  var ProductCreateForm = ({
1671
1845
  defaultChannel,
@@ -1698,10 +1872,13 @@ var ProductCreateForm = ({
1698
1872
  if (!regions?.length) {
1699
1873
  return {};
1700
1874
  }
1701
- return regions.reduce((acc, reg) => {
1702
- acc[reg.id] = reg.currency_code;
1703
- return acc;
1704
- }, {});
1875
+ return regions.reduce(
1876
+ (acc, reg) => {
1877
+ acc[reg.id] = reg.currency_code;
1878
+ return acc;
1879
+ },
1880
+ {}
1881
+ );
1705
1882
  }, [regions]);
1706
1883
  const watchedVariants = useWatch4({
1707
1884
  control: form.control,
@@ -1803,7 +1980,7 @@ var ProductCreateForm = ({
1803
1980
  }
1804
1981
  setTabState({ ...currentState });
1805
1982
  }, [tab]);
1806
- return /* @__PURE__ */ jsx11(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs9(
1983
+ return /* @__PURE__ */ jsx12(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs10(
1807
1984
  KeyboundForm,
1808
1985
  {
1809
1986
  onKeyDown: (e) => {
@@ -1826,7 +2003,7 @@ var ProductCreateForm = ({
1826
2003
  onSubmit: handleSubmit,
1827
2004
  className: "flex h-full flex-col",
1828
2005
  children: [
1829
- /* @__PURE__ */ jsxs9(
2006
+ /* @__PURE__ */ jsxs10(
1830
2007
  ProgressTabs,
1831
2008
  {
1832
2009
  dir: direction,
@@ -1840,8 +2017,8 @@ var ProductCreateForm = ({
1840
2017
  },
1841
2018
  className: "flex h-full flex-col overflow-hidden",
1842
2019
  children: [
1843
- /* @__PURE__ */ jsx11(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx11("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsxs9(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: [
1844
- /* @__PURE__ */ jsx11(
2020
+ /* @__PURE__ */ jsx12(RouteFocusModal.Header, { children: /* @__PURE__ */ jsx12("div", { className: "-my-2 w-full border-l", children: /* @__PURE__ */ jsxs10(ProgressTabs.List, { className: "justify-start-start flex w-full items-center", children: [
2021
+ /* @__PURE__ */ jsx12(
1845
2022
  ProgressTabs.Trigger,
1846
2023
  {
1847
2024
  status: tabState["details" /* DETAILS */],
@@ -1850,7 +2027,7 @@ var ProductCreateForm = ({
1850
2027
  children: t("products.create.tabs.details")
1851
2028
  }
1852
2029
  ),
1853
- /* @__PURE__ */ jsx11(
2030
+ /* @__PURE__ */ jsx12(
1854
2031
  ProgressTabs.Trigger,
1855
2032
  {
1856
2033
  status: tabState["organize" /* ORGANIZE */],
@@ -1859,7 +2036,7 @@ var ProductCreateForm = ({
1859
2036
  children: t("products.create.tabs.organize")
1860
2037
  }
1861
2038
  ),
1862
- /* @__PURE__ */ jsx11(
2039
+ /* @__PURE__ */ jsx12(
1863
2040
  ProgressTabs.Trigger,
1864
2041
  {
1865
2042
  status: tabState["variants" /* VARIANTS */],
@@ -1868,7 +2045,7 @@ var ProductCreateForm = ({
1868
2045
  children: t("products.create.tabs.variants")
1869
2046
  }
1870
2047
  ),
1871
- showInventoryTab && /* @__PURE__ */ jsx11(
2048
+ showInventoryTab && /* @__PURE__ */ jsx12(
1872
2049
  ProgressTabs.Trigger,
1873
2050
  {
1874
2051
  status: tabState["inventory" /* INVENTORY */],
@@ -1878,29 +2055,29 @@ var ProductCreateForm = ({
1878
2055
  }
1879
2056
  )
1880
2057
  ] }) }) }),
1881
- /* @__PURE__ */ jsxs9(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: [
1882
- /* @__PURE__ */ jsx11(
2058
+ /* @__PURE__ */ jsxs10(RouteFocusModal.Body, { className: "size-full overflow-hidden", children: [
2059
+ /* @__PURE__ */ jsx12(
1883
2060
  ProgressTabs.Content,
1884
2061
  {
1885
2062
  className: "size-full overflow-y-auto",
1886
2063
  value: "details" /* DETAILS */,
1887
- children: /* @__PURE__ */ jsx11(ProductCreateDetailsForm, { form })
2064
+ children: /* @__PURE__ */ jsx12(ProductCreateDetailsForm, { form })
1888
2065
  }
1889
2066
  ),
1890
- /* @__PURE__ */ jsx11(
2067
+ /* @__PURE__ */ jsx12(
1891
2068
  ProgressTabs.Content,
1892
2069
  {
1893
2070
  className: "size-full overflow-y-auto",
1894
2071
  value: "organize" /* ORGANIZE */,
1895
- children: /* @__PURE__ */ jsx11(ProductCreateOrganizeForm, { form })
2072
+ children: /* @__PURE__ */ jsx12(ProductCreateOrganizeForm, { form })
1896
2073
  }
1897
2074
  ),
1898
- /* @__PURE__ */ jsx11(
2075
+ /* @__PURE__ */ jsx12(
1899
2076
  ProgressTabs.Content,
1900
2077
  {
1901
2078
  className: "size-full overflow-y-auto",
1902
2079
  value: "variants" /* VARIANTS */,
1903
- children: /* @__PURE__ */ jsx11(
2080
+ children: /* @__PURE__ */ jsx12(
1904
2081
  ProductCreateVariantsForm,
1905
2082
  {
1906
2083
  form,
@@ -1911,22 +2088,22 @@ var ProductCreateForm = ({
1911
2088
  )
1912
2089
  }
1913
2090
  ),
1914
- showInventoryTab && /* @__PURE__ */ jsx11(
2091
+ showInventoryTab && /* @__PURE__ */ jsx12(
1915
2092
  ProgressTabs.Content,
1916
2093
  {
1917
2094
  className: "size-full overflow-y-auto",
1918
2095
  value: "inventory" /* INVENTORY */,
1919
- children: /* @__PURE__ */ jsx11(ProductCreateInventoryKitForm, { form })
2096
+ children: /* @__PURE__ */ jsx12(ProductCreateInventoryKitForm, { form })
1920
2097
  }
1921
2098
  )
1922
2099
  ] })
1923
2100
  ]
1924
2101
  }
1925
2102
  ),
1926
- /* @__PURE__ */ jsx11(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-end gap-x-2", children: [
1927
- /* @__PURE__ */ jsx11(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx11(Button4, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
1928
- /* @__PURE__ */ jsx11(
1929
- Button4,
2103
+ /* @__PURE__ */ jsx12(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-end gap-x-2", children: [
2104
+ /* @__PURE__ */ jsx12(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx12(Button5, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
2105
+ /* @__PURE__ */ jsx12(
2106
+ Button5,
1930
2107
  {
1931
2108
  "data-name": SAVE_DRAFT_BUTTON,
1932
2109
  size: "small",
@@ -1936,7 +2113,7 @@ var ProductCreateForm = ({
1936
2113
  children: t("actions.saveAsDraft")
1937
2114
  }
1938
2115
  ),
1939
- /* @__PURE__ */ jsx11(
2116
+ /* @__PURE__ */ jsx12(
1940
2117
  PrimaryButton,
1941
2118
  {
1942
2119
  tab,
@@ -1958,8 +2135,8 @@ var PrimaryButton = ({
1958
2135
  }) => {
1959
2136
  const { t } = useTranslation9();
1960
2137
  if (tab === "variants" /* VARIANTS */ && !showInventoryTab || tab === "inventory" /* INVENTORY */ && showInventoryTab) {
1961
- return /* @__PURE__ */ jsx11(
1962
- Button4,
2138
+ return /* @__PURE__ */ jsx12(
2139
+ Button5,
1963
2140
  {
1964
2141
  "data-name": "publish-button",
1965
2142
  type: "submit",
@@ -1971,8 +2148,8 @@ var PrimaryButton = ({
1971
2148
  "submit-button"
1972
2149
  );
1973
2150
  }
1974
- return /* @__PURE__ */ jsx11(
1975
- Button4,
2151
+ return /* @__PURE__ */ jsx12(
2152
+ Button5,
1976
2153
  {
1977
2154
  type: "button",
1978
2155
  variant: "primary",
@@ -1985,7 +2162,7 @@ var PrimaryButton = ({
1985
2162
  };
1986
2163
 
1987
2164
  // src/routes/products/product-create/product-create.tsx
1988
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2165
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
1989
2166
  var ProductCreate = () => {
1990
2167
  const { t } = useTranslation10();
1991
2168
  const {
@@ -2031,10 +2208,10 @@ var ProductCreate = () => {
2031
2208
  if (isPricePreferencesError) {
2032
2209
  throw pricePreferencesError;
2033
2210
  }
2034
- return /* @__PURE__ */ jsxs10(RouteFocusModal, { children: [
2035
- /* @__PURE__ */ jsx12(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: t("products.create.title") }) }),
2036
- /* @__PURE__ */ jsx12(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: t("products.create.description") }) }),
2037
- ready && /* @__PURE__ */ jsx12(
2211
+ return /* @__PURE__ */ jsxs11(RouteFocusModal, { children: [
2212
+ /* @__PURE__ */ jsx13(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx13("span", { className: "sr-only", children: t("products.create.title") }) }),
2213
+ /* @__PURE__ */ jsx13(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx13("span", { className: "sr-only", children: t("products.create.description") }) }),
2214
+ ready && /* @__PURE__ */ jsx13(
2038
2215
  ProductCreateForm,
2039
2216
  {
2040
2217
  defaultChannel: sales_channel,