@mercurjs/admin 2.2.0-canary.18 → 2.2.0-canary.19

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 (173) hide show
  1. package/dist/{add-campaign-promotions-4QP4LF7G.js → add-campaign-promotions-KK4JMLSK.js} +3 -3
  2. package/dist/{adjust-inventory-AHIKDW7M.js → adjust-inventory-F3OTF6O6.js} +5 -5
  3. package/dist/{api-key-management-detail-ZRLG6YRB.js → api-key-management-detail-JMWPGN6M.js} +6 -6
  4. package/dist/{attribute-create-NIYUQEHQ.js → attribute-create-TJRNP5SK.js} +7 -7
  5. package/dist/{attribute-detail-GA4FDSAG.js → attribute-detail-7I2SQCDK.js} +6 -6
  6. package/dist/{attribute-edit-KJL36HQ4.js → attribute-edit-UBG6SMUF.js} +2 -2
  7. package/dist/{attribute-edit-possible-value-LGOD3ZKQ.js → attribute-edit-possible-value-3BYEPC4X.js} +2 -2
  8. package/dist/{attribute-list-A3RFO32Z.js → attribute-list-EFU4DPB5.js} +5 -5
  9. package/dist/{campaign-detail-A7ZM4Q7M.js → campaign-detail-H32E6EDD.js} +9 -9
  10. package/dist/{categories-metadata-FCV4YK74.js → categories-metadata-V37DXTVZ.js} +5 -5
  11. package/dist/{category-detail-CIEHVR4M.js → category-detail-5MRHPG6T.js} +10 -10
  12. package/dist/{category-products-AB3YAGSW.js → category-products-3KYY662O.js} +9 -9
  13. package/dist/{chunk-WUGV75DM.js → chunk-3F6U44M6.js} +1 -1
  14. package/dist/{chunk-IBX52HBP.js → chunk-3N7QXAMO.js} +1 -1
  15. package/dist/{chunk-K2C42QAV.js → chunk-4DYSSDAA.js} +4 -4
  16. package/dist/{chunk-2PUBUYFG.js → chunk-5GXPXVVD.js} +2 -2
  17. package/dist/{chunk-CIKXWLWE.js → chunk-6AYGDFNE.js} +2 -2
  18. package/dist/{chunk-G5DQCCPL.js → chunk-6LG3VL3Q.js} +2 -2
  19. package/dist/{chunk-A2GVK4VZ.js → chunk-AXVZ56UD.js} +2 -2
  20. package/dist/{chunk-2LKMOTLX.js → chunk-B7HIZN4V.js} +2 -2
  21. package/dist/{chunk-EOLSQKPV.js → chunk-BJQ4UBK7.js} +529 -480
  22. package/dist/{chunk-OMBP3YSV.js → chunk-CFBEBAQS.js} +1 -1
  23. package/dist/{chunk-FJRNNDZS.js → chunk-EASE3NLF.js} +1 -1
  24. package/dist/chunk-EG45GIE3.js +368 -0
  25. package/dist/{chunk-TWCYZF6X.js → chunk-EM5TF7YZ.js} +1 -1
  26. package/dist/{chunk-MEXH366L.js → chunk-FCLS6CKW.js} +2 -2
  27. package/dist/{chunk-ENFXIYIH.js → chunk-FYKG35MR.js} +1 -1
  28. package/dist/{chunk-VZ7GNMGX.js → chunk-GA4ZFAOV.js} +1 -1
  29. package/dist/{chunk-RZ5SFALB.js → chunk-GFUCELIZ.js} +2 -2
  30. package/dist/{chunk-OFOKVLV3.js → chunk-GHGOOZEL.js} +2 -2
  31. package/dist/{chunk-CVZA23ES.js → chunk-GNWWL47L.js} +3 -3
  32. package/dist/{chunk-MR3MLNWV.js → chunk-HYQPZADS.js} +1 -1
  33. package/dist/{chunk-DELK6EWH.js → chunk-IHTQOPB6.js} +1 -1
  34. package/dist/chunk-JEJQKTZO.js +191 -0
  35. package/dist/{chunk-5BF5JDWT.js → chunk-JWE2IW4R.js} +5 -5
  36. package/dist/chunk-KZB7LCF2.js +82 -0
  37. package/dist/{chunk-N6YOACEW.js → chunk-L5Z4JGRD.js} +1 -1
  38. package/dist/{chunk-3VDLE5GA.js → chunk-LVCIAKJI.js} +1 -1
  39. package/dist/{chunk-PE6JFXWU.js → chunk-MFIT2RX5.js} +1 -1
  40. package/dist/{chunk-ZB4TESPP.js → chunk-O62SUNK2.js} +16 -7
  41. package/dist/{chunk-Q5WTOVZZ.js → chunk-O63MLTQV.js} +71 -0
  42. package/dist/{chunk-WPVDACTL.js → chunk-OA24YN34.js} +1 -1
  43. package/dist/{chunk-3DMUKRIX.js → chunk-OXONMLRP.js} +2 -2
  44. package/dist/{chunk-LJDGVBOQ.js → chunk-PJR6W35H.js} +1 -1
  45. package/dist/chunk-PN5C4AND.js +115 -0
  46. package/dist/chunk-QR3GYYX6.js +0 -0
  47. package/dist/{chunk-VT6QIVZW.js → chunk-RMAQKNBA.js} +10 -1
  48. package/dist/{chunk-IEPH6A2W.js → chunk-RV7DWZZB.js} +2 -2
  49. package/dist/chunk-RXRDZ47F.js +103 -0
  50. package/dist/{chunk-623TMW36.js → chunk-T53YX34K.js} +1 -1
  51. package/dist/{chunk-EYFWEKFJ.js → chunk-TLOJG7LK.js} +2 -2
  52. package/dist/{chunk-7Y6A7XK6.js → chunk-UCHVBAUB.js} +2 -2
  53. package/dist/{chunk-47W2JHOE.js → chunk-UT2O7IS7.js} +2 -2
  54. package/dist/{chunk-B4K7H6DH.js → chunk-UUTACMA5.js} +1 -1
  55. package/dist/{chunk-JSMUFZZN.js → chunk-WHIYSLYW.js} +1 -1
  56. package/dist/{chunk-SEQJOCTT.js → chunk-X4N7EMFO.js} +2 -2
  57. package/dist/{chunk-RUSMGNQ6.js → chunk-X7E65HM2.js} +1 -1
  58. package/dist/{chunk-RWRL4AXD.js → chunk-XKD67CD4.js} +2 -2
  59. package/dist/{chunk-UCYSCKZV.js → chunk-Y7FNFQCU.js} +1 -6
  60. package/dist/{chunk-HEGPAGJT.js → chunk-YI7I7JFX.js} +2 -2
  61. package/dist/{chunk-EB6ZFOTO.js → chunk-YLK2WZU3.js} +2 -2
  62. package/dist/{chunk-OCRKS4Z7.js → chunk-ZDJWTF64.js} +2 -2
  63. package/dist/{chunk-T4GL73RP.js → chunk-ZG6DNI7O.js} +1 -1
  64. package/dist/{chunk-OHOWEMHO.js → chunk-ZIFHQXP3.js} +31 -25
  65. package/dist/{collection-add-products-KTUW23TD.js → collection-add-products-4EZ6W4N6.js} +9 -9
  66. package/dist/{collection-detail-TR7TDQZG.js → collection-detail-X22ZIM5S.js} +10 -10
  67. package/dist/{collection-list-FOWSOTS7.js → collection-list-6CUEOLUU.js} +9 -9
  68. package/dist/{collection-metadata-DS32TGOK.js → collection-metadata-AWJYPZKR.js} +5 -5
  69. package/dist/commission-rule-commission-edit-TA3H3EEN.js +196 -0
  70. package/dist/commission-rule-create-O7Z25SC7.js +412 -0
  71. package/dist/commission-rule-detail-I7LVSNAM.js +45 -0
  72. package/dist/commission-rule-edit-YSHDTYZY.js +342 -0
  73. package/dist/{commission-rate-list-Y5XLEO67.js → commissions-list-OUGVPED6.js} +13 -4
  74. package/dist/{customer-detail-5XGZ2K3H.js → customer-detail-6MBW3FHO.js} +6 -6
  75. package/dist/{customer-group-detail-JX3BEYFG.js → customer-group-detail-G53RB6EA.js} +5 -5
  76. package/dist/{customer-group-list-F5TFLDVH.js → customer-group-list-XDNCZ4K6.js} +5 -5
  77. package/dist/{customer-group-metadata-CHOTUAS2.js → customer-group-metadata-FWLKUHIZ.js} +5 -5
  78. package/dist/{customer-metadata-LG6HA56I.js → customer-metadata-KU4YWD3R.js} +5 -5
  79. package/dist/{customers-add-customer-group-3YKZEZKJ.js → customers-add-customer-group-5Y5XPN7C.js} +5 -5
  80. package/dist/{edit-inventory-item-5EYVQ6CM.js → edit-inventory-item-MBLHBGBH.js} +5 -5
  81. package/dist/{edit-inventory-item-attributes-7QM4YHAQ.js → edit-inventory-item-attributes-GTTGNBO4.js} +5 -5
  82. package/dist/{edit-rules-2S5H7MC2.js → edit-rules-UFGKSAJV.js} +5 -5
  83. package/dist/global-commission-edit-LCD6JJUX.js +194 -0
  84. package/dist/index.js +158 -150
  85. package/dist/{inventory-create-RBMMOSC3.js → inventory-create-4O4L6NXK.js} +5 -5
  86. package/dist/{inventory-detail-LSAJ3ZB5.js → inventory-detail-ZWHSLLLI.js} +5 -5
  87. package/dist/{inventory-metadata-OZAKLWNY.js → inventory-metadata-GZYYWU3S.js} +5 -5
  88. package/dist/{inventory-stock-WUAIUFQS.js → inventory-stock-S5B6ZZQW.js} +5 -5
  89. package/dist/{location-detail-PBCP7BBV.js → location-detail-QS7HM2KG.js} +5 -5
  90. package/dist/{location-fulfillment-providers-D4EFIF3Z.js → location-fulfillment-providers-6RUGYQ3W.js} +7 -7
  91. package/dist/{location-list-DM4WU57J.js → location-list-7RTDLHGR.js} +5 -5
  92. package/dist/{location-service-zone-shipping-option-create-T4LT4E6M.js → location-service-zone-shipping-option-create-UKULBDGM.js} +5 -5
  93. package/dist/{login-LTASZXSR.js → login-SFGV4QGP.js} +5 -5
  94. package/dist/{marketplace-detail-GSPPUVR7.js → marketplace-detail-7VPTFUPB.js} +5 -5
  95. package/dist/{marketplace-metadata-PB7JEK2K.js → marketplace-metadata-E25VT5TH.js} +5 -5
  96. package/dist/{offers-D2QQQD2F.js → offers-WYAJB75N.js} +9 -9
  97. package/dist/{order-create-claim-HND7RODU.js → order-create-claim-3AQK3FH2.js} +3 -3
  98. package/dist/{order-create-edit-LIQGALQ2.js → order-create-edit-UFD26FE2.js} +2 -2
  99. package/dist/{order-create-exchange-QE2TJ36U.js → order-create-exchange-QCYD3DC4.js} +7 -7
  100. package/dist/{order-create-refund-37JJA6MM.js → order-create-refund-TR4XMHRY.js} +5 -5
  101. package/dist/{order-create-return-AVVT3OUO.js → order-create-return-Y7QS52UL.js} +2 -2
  102. package/dist/{order-detail-A2WC2OZU.js → order-detail-FZT74HMD.js} +10 -10
  103. package/dist/{order-edit-billing-address-IPWVSYR2.js → order-edit-billing-address-OJZICMBN.js} +6 -6
  104. package/dist/{order-edit-email-ZQZNTV4P.js → order-edit-email-TH26N5HK.js} +5 -5
  105. package/dist/{order-edit-shipping-address-YPYWT3YN.js → order-edit-shipping-address-GBOUGZPD.js} +5 -5
  106. package/dist/{order-list-QR3ZVI4U.js → order-list-C5YOR6B5.js} +2 -2
  107. package/dist/{order-metadata-E25YHGCC.js → order-metadata-RT3BVTYZ.js} +5 -5
  108. package/dist/{order-request-transfer-XDNXRB66.js → order-request-transfer-3HTFPYFD.js} +5 -5
  109. package/dist/pages/index.d.ts +5 -23
  110. package/dist/pages/index.js +79 -77
  111. package/dist/{price-list-create-GBUUE3NP.js → price-list-create-XQWV352E.js} +10 -10
  112. package/dist/{price-list-detail-77FAEXXO.js → price-list-detail-347UU3LU.js} +10 -10
  113. package/dist/{price-list-prices-add-2XS5TX5X.js → price-list-prices-add-R656I6QF.js} +10 -10
  114. package/dist/{price-list-prices-edit-C2C3I64A.js → price-list-prices-edit-BOKBTLEI.js} +5 -5
  115. package/dist/{product-add-existing-attributes-NFXKW6SW.js → product-add-existing-attributes-MNGWZFGD.js} +7 -7
  116. package/dist/{product-create-AG4AYDM3.js → product-create-LMYR36NA.js} +9 -9
  117. package/dist/{product-create-variant-7DVYYUDX.js → product-create-variant-XETT2WJC.js} +3 -3
  118. package/dist/{product-detail-CNVETME5.js → product-detail-WSL4PXKK.js} +7 -7
  119. package/dist/{product-edit-attribute-GXFMVPCQ.js → product-edit-attribute-XEYHQJ6D.js} +2 -2
  120. package/dist/{product-list-KM37QJ6F.js → product-list-7YPGRGHX.js} +10 -10
  121. package/dist/{product-media-H5DAWUYR.js → product-media-H6SYBNLI.js} +2 -2
  122. package/dist/{product-metadata-4ZLL42UF.js → product-metadata-MGLJJ7QG.js} +5 -5
  123. package/dist/{product-tag-create-KKRQQT3A.js → product-tag-create-JCYAG42N.js} +5 -5
  124. package/dist/{product-tag-detail-R6UFJDCW.js → product-tag-detail-AUNKJJLP.js} +12 -12
  125. package/dist/{product-tag-edit-TISDF4FQ.js → product-tag-edit-2FREKKVN.js} +5 -5
  126. package/dist/{product-tag-list-NFPQVVMO.js → product-tag-list-IKL46JZT.js} +12 -12
  127. package/dist/{product-tag-metadata-GJFYX5HU.js → product-tag-metadata-UV3TBPXS.js} +5 -5
  128. package/dist/{product-type-detail-XJPSQDL2.js → product-type-detail-DKHKFADI.js} +13 -13
  129. package/dist/{product-type-metadata-GKVLFBF6.js → product-type-metadata-22OACFMD.js} +8 -8
  130. package/dist/{product-variant-detail-VCMC4BZP.js → product-variant-detail-MNMJBYIP.js} +5 -5
  131. package/dist/{product-variant-edit-QLDFN6LI.js → product-variant-edit-THZLEOGL.js} +7 -7
  132. package/dist/{product-variant-metadata-VZZMPRRG.js → product-variant-metadata-7N7PL7WY.js} +5 -5
  133. package/dist/{promotion-create-POBB7B23.js → promotion-create-RB3AA5GE.js} +5 -5
  134. package/dist/{promotion-detail-NSOGXQAY.js → promotion-detail-PEDTLXZ4.js} +8 -8
  135. package/dist/{promotion-list-7C3SQCSO.js → promotion-list-MCYWN5TF.js} +4 -4
  136. package/dist/{refund-reason-create-HPLJOL6S.js → refund-reason-create-YWA5XP4J.js} +5 -5
  137. package/dist/{refund-reason-edit-JI4U4RWO.js → refund-reason-edit-MBG5WL43.js} +5 -5
  138. package/dist/{refund-reason-list-SWU4B2ED.js → refund-reason-list-GPDRI2QM.js} +10 -10
  139. package/dist/{region-metadata-LDWMTB7G.js → region-metadata-WDZ7DRGU.js} +5 -5
  140. package/dist/{reservation-detail-BLPISKPA.js → reservation-detail-WTYOR6IB.js} +5 -5
  141. package/dist/{reservation-metadata-AZ265HZI.js → reservation-metadata-PJVHEJRU.js} +5 -5
  142. package/dist/{reset-password-6CAYNSJ6.js → reset-password-2NVKH6QA.js} +1 -1
  143. package/dist/{return-reason-list-7HTIV7NK.js → return-reason-list-E6L7VJY7.js} +5 -5
  144. package/dist/{sales-channel-add-products-S47CQCJF.js → sales-channel-add-products-BKT3CFLY.js} +9 -9
  145. package/dist/{sales-channel-detail-6JPHP4FZ.js → sales-channel-detail-MUBMJGQV.js} +10 -10
  146. package/dist/{sales-channel-list-D673ONK2.js → sales-channel-list-O5SFOGMA.js} +5 -5
  147. package/dist/{sales-channel-metadata-OY47MCFI.js → sales-channel-metadata-67RGBA7X.js} +5 -5
  148. package/dist/{shipping-option-type-create-H2YRDETZ.js → shipping-option-type-create-OBF6GG5W.js} +5 -5
  149. package/dist/{shipping-option-type-detail-NVSXILP4.js → shipping-option-type-detail-TJC2GBUA.js} +7 -7
  150. package/dist/{shipping-option-type-edit-KBPDYAUJ.js → shipping-option-type-edit-INKLJRSH.js} +5 -5
  151. package/dist/{shipping-option-type-list-OUKJZJ6R.js → shipping-option-type-list-WKA64NYE.js} +7 -7
  152. package/dist/{shipping-profile-metadata-CQCDC45M.js → shipping-profile-metadata-RI6Y2N6V.js} +5 -5
  153. package/dist/{store-bulk-edit-DXWHZMGL.js → store-bulk-edit-WML2DUA4.js} +1 -1
  154. package/dist/{store-create-MVHUY3I3.js → store-create-AGF2LZWR.js} +5 -5
  155. package/dist/{store-details-V3NMV665.js → store-details-3HWOCRYI.js} +11 -11
  156. package/dist/{store-edit-6CC2GBFY.js → store-edit-5WWOOSHT.js} +3 -3
  157. package/dist/{store-list-WV6XHGLU.js → store-list-YEEKX2AV.js} +9 -9
  158. package/dist/{store-member-invite-7YIXFC56.js → store-member-invite-TULPI3N5.js} +1 -1
  159. package/dist/{tax-region-create-RGE5ZIBR.js → tax-region-create-X2LAHX27.js} +6 -6
  160. package/dist/{tax-region-detail-OKEK6WNJ.js → tax-region-detail-3X3TNFJA.js} +5 -5
  161. package/dist/{tax-region-edit-QQ3LB74P.js → tax-region-edit-7ECYGXEA.js} +5 -5
  162. package/dist/{tax-region-metadata-GPTD6KZB.js → tax-region-metadata-FQLEYY2R.js} +5 -5
  163. package/dist/{tax-region-province-detail-WHO3RLUX.js → tax-region-province-detail-DIV5AAFQ.js} +5 -5
  164. package/dist/{tax-region-tax-override-create-223MPYUG.js → tax-region-tax-override-create-BV4O3QCU.js} +14 -16
  165. package/dist/{tax-region-tax-override-edit-WFOXP6A7.js → tax-region-tax-override-edit-QUA77YTI.js} +16 -18
  166. package/dist/{user-metadata-A3JS6O4K.js → user-metadata-64LX64QI.js} +5 -5
  167. package/package.json +1 -1
  168. package/dist/chunk-AKTAFKIU.js +0 -228
  169. package/dist/chunk-HLJ24XVH.js +0 -390
  170. package/dist/chunk-SWL7ZCP3.js +0 -11
  171. package/dist/commission-rate-create-G42ZUJPH.js +0 -782
  172. package/dist/commission-rate-detail-VGYTGWLH.js +0 -85
  173. package/dist/commission-rate-edit-3CYWYOMS.js +0 -767
@@ -1,782 +0,0 @@
1
- import {
2
- TargetForm,
3
- TargetItem,
4
- TaxRateRuleReferenceSchema
5
- } from "./chunk-ZB4TESPP.js";
6
- import "./chunk-5A4JNOK3.js";
7
- import "./chunk-O5VKW5FL.js";
8
- import "./chunk-LTBX54CI.js";
9
- import "./chunk-LQAAVRET.js";
10
- import "./chunk-AFQS6E4N.js";
11
- import "./chunk-QG6PLWNH.js";
12
- import "./chunk-DBYUB2YI.js";
13
- import "./chunk-54EPH67T.js";
14
- import "./chunk-4F5GP7J7.js";
15
- import "./chunk-JQV7CXEC.js";
16
- import "./chunk-KOURHC2N.js";
17
- import "./chunk-2ZFELO2L.js";
18
- import "./chunk-26OOAKQ6.js";
19
- import "./chunk-ZQZHFMD7.js";
20
- import "./chunk-I5THQVYP.js";
21
- import "./chunk-J3AMUGGZ.js";
22
- import "./chunk-CMHI2RPL.js";
23
- import "./chunk-S2WEYEQR.js";
24
- import {
25
- PercentageInput
26
- } from "./chunk-MAEP2UCK.js";
27
- import "./chunk-HINXQTCW.js";
28
- import "./chunk-HC25LNX7.js";
29
- import "./chunk-MR3MLNWV.js";
30
- import "./chunk-MG4GKUJW.js";
31
- import "./chunk-AYVH6Q5O.js";
32
- import "./chunk-VOHEQ7B5.js";
33
- import "./chunk-N5IUYCUZ.js";
34
- import "./chunk-7SVLKK6Q.js";
35
- import "./chunk-GR6JUIRU.js";
36
- import "./chunk-PVZBDWLK.js";
37
- import "./chunk-QUHSHIAC.js";
38
- import "./chunk-VKOE5J66.js";
39
- import "./chunk-DY3XQPHC.js";
40
- import "./chunk-NOWUEJ74.js";
41
- import "./chunk-VW56KWO2.js";
42
- import "./chunk-TZSOL34K.js";
43
- import "./chunk-25LYVP3C.js";
44
- import "./chunk-2Y3WMGN6.js";
45
- import "./chunk-PXYDR7WQ.js";
46
- import "./chunk-JHIMVLB2.js";
47
- import "./chunk-JRTZWK77.js";
48
- import "./chunk-OMBP3YSV.js";
49
- import "./chunk-WPVDACTL.js";
50
- import "./chunk-RZ5SFALB.js";
51
- import "./chunk-LYZDVZWA.js";
52
- import "./chunk-FWPGOIFA.js";
53
- import "./chunk-DB6ANJBO.js";
54
- import "./chunk-PHOCVOZ5.js";
55
- import "./chunk-FQERBIVS.js";
56
- import "./chunk-NQEXDLYH.js";
57
- import "./chunk-YN3FGNJM.js";
58
- import "./chunk-KAZ5BYTQ.js";
59
- import "./chunk-634XVU3D.js";
60
- import "./chunk-RT6L7JXU.js";
61
- import "./chunk-4YWKKCTT.js";
62
- import {
63
- currencies,
64
- getCurrencySymbol
65
- } from "./chunk-IQPN4PZJ.js";
66
- import "./chunk-TKGWSUEI.js";
67
- import {
68
- KeyboundForm
69
- } from "./chunk-SITRHMZZ.js";
70
- import {
71
- RouteFocusModal,
72
- StackedFocusModal,
73
- useRouteModal,
74
- useStackedModal
75
- } from "./chunk-FWJLS7XD.js";
76
- import {
77
- Form
78
- } from "./chunk-3QSRE5LS.js";
79
- import "./chunk-WIYFXWRI.js";
80
- import "./chunk-UZWFZMOX.js";
81
- import "./chunk-XQNVC4Q7.js";
82
- import "./chunk-THHRRYRS.js";
83
- import "./chunk-UCYSCKZV.js";
84
- import "./chunk-LJDGVBOQ.js";
85
- import "./chunk-OH4AABUT.js";
86
- import "./chunk-FJHAAROU.js";
87
- import "./chunk-AEMDNTW5.js";
88
- import "./chunk-LYD3C73Z.js";
89
- import "./chunk-533GMKEG.js";
90
- import "./chunk-46M463BR.js";
91
- import "./chunk-YFRC6GEN.js";
92
- import "./chunk-N6SI4IIT.js";
93
- import "./chunk-JPNPTILP.js";
94
- import "./chunk-DAXXLQKB.js";
95
- import {
96
- useCreateCommissionRate
97
- } from "./chunk-OHOWEMHO.js";
98
- import "./chunk-GKGLVDDV.js";
99
- import "./chunk-ESPLVOFC.js";
100
- import "./chunk-WJJXUXSO.js";
101
- import "./chunk-LAPEZATU.js";
102
- import "./chunk-Z2UBJXTU.js";
103
- import "./chunk-QKJGSZI2.js";
104
- import {
105
- useStore
106
- } from "./chunk-FXWKGNRV.js";
107
- import "./chunk-VDKOJ5WD.js";
108
- import "./chunk-ZN7LWXVC.js";
109
- import "./chunk-XGUUM3S6.js";
110
- import "./chunk-VYMODH6P.js";
111
- import "./chunk-LEG67A2R.js";
112
- import "./chunk-PRBE5CM3.js";
113
- import "./chunk-5TRY5IMZ.js";
114
- import "./chunk-EPHVGD5Z.js";
115
- import "./chunk-VT6QIVZW.js";
116
- import "./chunk-OKWGPKVK.js";
117
- import "./chunk-KYFWVLWO.js";
118
- import "./chunk-LAVHRER2.js";
119
- import {
120
- useDocumentDirection
121
- } from "./chunk-Y7QKP6QU.js";
122
- import "./chunk-INNFZYX2.js";
123
- import "./chunk-M2E3PKA4.js";
124
- import "./chunk-RHKRREUU.js";
125
- import "./chunk-ZA2KFUFR.js";
126
- import "./chunk-ZBWL72TB.js";
127
- import "./chunk-NBMM2TZK.js";
128
-
129
- // src/pages/commission-rates/commission-rate-create/components/create-commission-rate-form/create-commission-rate-form.tsx
130
- import { zodResolver } from "@hookform/resolvers/zod";
131
- import {
132
- Button,
133
- CurrencyInput,
134
- Divider,
135
- Heading,
136
- Hint,
137
- Input,
138
- Label,
139
- Select,
140
- Text,
141
- clx,
142
- toast,
143
- Switch
144
- } from "@medusajs/ui";
145
- import { MagnifyingGlass } from "@medusajs/icons";
146
- import { useEffect } from "react";
147
- import { useFieldArray, useForm, useWatch } from "react-hook-form";
148
- import { useTranslation } from "react-i18next";
149
- import * as zod from "zod";
150
- import { jsx, jsxs } from "react/jsx-runtime";
151
- var STACKED_MODAL_ID = "cr";
152
- var getStackedModalId = (type) => `${STACKED_MODAL_ID}-${type}`;
153
- var CreateCommissionRateSchema = zod.object({
154
- name: zod.string().min(1),
155
- code: zod.string().min(1),
156
- type: zod.enum(["fixed", "percentage"]),
157
- target: zod.enum(["item", "shipping"]),
158
- value: zod.coerce.number().min(0),
159
- currency_code: zod.string().optional(),
160
- min_amount: zod.coerce.number().optional(),
161
- include_tax: zod.boolean(),
162
- is_enabled: zod.boolean(),
163
- priority: zod.coerce.number().int().min(0),
164
- enabled_rules: zod.object({
165
- product: zod.boolean(),
166
- product_type: zod.boolean(),
167
- shipping_option: zod.boolean()
168
- }),
169
- product: zod.array(TaxRateRuleReferenceSchema).optional(),
170
- product_type: zod.array(TaxRateRuleReferenceSchema).optional(),
171
- shipping_option: zod.array(TaxRateRuleReferenceSchema).optional()
172
- });
173
- var CreateCommissionRateForm = ({
174
- store
175
- }) => {
176
- const { t } = useTranslation();
177
- const { handleSuccess } = useRouteModal();
178
- const { setIsOpen } = useStackedModal();
179
- const direction = useDocumentDirection();
180
- const form = useForm({
181
- defaultValues: {
182
- name: "",
183
- code: "",
184
- type: "percentage",
185
- target: "item",
186
- value: 0,
187
- currency_code: "",
188
- min_amount: void 0,
189
- include_tax: false,
190
- is_enabled: true,
191
- priority: 0,
192
- enabled_rules: {
193
- product: false,
194
- product_type: false,
195
- shipping_option: false
196
- },
197
- product: [],
198
- product_type: [],
199
- shipping_option: []
200
- },
201
- resolver: zodResolver(CreateCommissionRateSchema)
202
- });
203
- const storeCurrencies = (store?.supported_currencies ?? []).map(
204
- (c) => currencies[c.currency_code.toUpperCase()]
205
- );
206
- const defaultCurrencyCode = store?.supported_currencies?.[0]?.currency_code ?? "";
207
- useEffect(() => {
208
- if (defaultCurrencyCode && !form.getValues("currency_code")) {
209
- form.setValue("currency_code", defaultCurrencyCode);
210
- }
211
- }, [defaultCurrencyCode, form]);
212
- const { mutateAsync: createCommissionRate, isPending } = useCreateCommissionRate();
213
- const handleSubmit = form.handleSubmit(async (values) => {
214
- const rules = [
215
- ...(values.product || []).map((ref) => ({
216
- reference: "product" /* PRODUCT */,
217
- reference_id: ref.value
218
- })),
219
- ...(values.product_type || []).map((ref) => ({
220
- reference: "product_type" /* PRODUCT_TYPE */,
221
- reference_id: ref.value
222
- })),
223
- ...(values.shipping_option || []).map((ref) => ({
224
- reference: "shipping_option" /* SHIPPING_OPTION */,
225
- reference_id: ref.value
226
- }))
227
- ];
228
- await createCommissionRate(
229
- {
230
- name: values.name,
231
- code: values.code,
232
- type: values.type,
233
- target: values.target,
234
- value: values.value,
235
- currency_code: values.currency_code || null,
236
- min_amount: values.min_amount ?? null,
237
- include_tax: values.include_tax,
238
- is_enabled: values.is_enabled,
239
- priority: values.priority,
240
- ...rules.length > 0 ? { rules } : {}
241
- },
242
- {
243
- onSuccess: ({ commission_rate }) => {
244
- toast.success(t("commissionRates.create.successToast"));
245
- handleSuccess(`../${commission_rate.id}`);
246
- },
247
- onError: (e) => {
248
- toast.error(e.message);
249
- }
250
- }
251
- );
252
- });
253
- const watchType = form.watch("type");
254
- const watchCurrency = form.watch("currency_code");
255
- const products = useFieldArray({
256
- control: form.control,
257
- name: "product" /* PRODUCT */
258
- });
259
- const productTypes = useFieldArray({
260
- control: form.control,
261
- name: "product_type" /* PRODUCT_TYPE */
262
- });
263
- const shippingOptions = useFieldArray({
264
- control: form.control,
265
- name: "shipping_option" /* SHIPPING_OPTION */
266
- });
267
- const getControls = (type) => {
268
- switch (type) {
269
- case "product" /* PRODUCT */:
270
- return products;
271
- case "product_type" /* PRODUCT_TYPE */:
272
- return productTypes;
273
- case "shipping_option" /* SHIPPING_OPTION */:
274
- return shippingOptions;
275
- }
276
- };
277
- const referenceTypeOptions = [
278
- {
279
- value: "product" /* PRODUCT */,
280
- label: t("taxRegions.fields.targets.options.product")
281
- },
282
- {
283
- value: "product_type" /* PRODUCT_TYPE */,
284
- label: t("taxRegions.fields.targets.options.productType")
285
- },
286
- {
287
- value: "shipping_option" /* SHIPPING_OPTION */,
288
- label: t("taxRegions.fields.targets.options.shippingOption")
289
- }
290
- ];
291
- const searchPlaceholders = {
292
- ["product" /* PRODUCT */]: t(
293
- "taxRegions.fields.targets.placeholders.product"
294
- ),
295
- ["product_type" /* PRODUCT_TYPE */]: t(
296
- "taxRegions.fields.targets.placeholders.productType"
297
- ),
298
- ["shipping_option" /* SHIPPING_OPTION */]: t(
299
- "taxRegions.fields.targets.placeholders.shippingOption"
300
- )
301
- };
302
- const getFieldHandler = (type) => {
303
- const { fields, remove, append } = getControls(type);
304
- const modalId = getStackedModalId(type);
305
- return (references) => {
306
- if (!references.length) {
307
- form.setValue(type, [], { shouldDirty: true });
308
- setIsOpen(modalId, false);
309
- return;
310
- }
311
- const newIds = references.map((reference) => reference.value);
312
- const fieldsToAdd = references.filter(
313
- (reference) => !fields.some((field) => field.value === reference.value)
314
- );
315
- for (const field of fields) {
316
- if (!newIds.includes(field.value)) {
317
- remove(fields.indexOf(field));
318
- }
319
- }
320
- append(fieldsToAdd);
321
- setIsOpen(modalId, false);
322
- };
323
- };
324
- const displayOrder = /* @__PURE__ */ new Set();
325
- const disableRule = (type) => {
326
- form.setValue(type, [], { shouldDirty: true });
327
- form.setValue(`enabled_rules.${type}`, false, { shouldDirty: true });
328
- displayOrder.delete(type);
329
- };
330
- const enableRule = (type) => {
331
- form.setValue(`enabled_rules.${type}`, true, { shouldDirty: true });
332
- form.setValue(type, [], { shouldDirty: true });
333
- displayOrder.add(type);
334
- };
335
- const watchedEnabledRules = useWatch({
336
- control: form.control,
337
- name: "enabled_rules"
338
- });
339
- const addRule = () => {
340
- const firstDisabledRule = Object.keys(watchedEnabledRules).find(
341
- (key) => !watchedEnabledRules[key]
342
- );
343
- if (firstDisabledRule) {
344
- enableRule(firstDisabledRule);
345
- }
346
- };
347
- const visibleRuleTypes = referenceTypeOptions.filter((option) => watchedEnabledRules[option.value]).sort((a, b) => {
348
- const orderArray = Array.from(displayOrder);
349
- return orderArray.indexOf(b.value) - orderArray.indexOf(a.value);
350
- });
351
- const getAvailableRuleTypes = (type) => {
352
- return referenceTypeOptions.filter((option) => {
353
- return !visibleRuleTypes.some(
354
- (visibleOption) => visibleOption.value === option.value
355
- ) || option.value === type;
356
- });
357
- };
358
- const showAddButton = Object.values(watchedEnabledRules).some(
359
- (value) => !value
360
- );
361
- return /* @__PURE__ */ jsx(RouteFocusModal.Form, { form, children: /* @__PURE__ */ jsxs(
362
- KeyboundForm,
363
- {
364
- className: "flex h-full flex-col overflow-hidden",
365
- onSubmit: handleSubmit,
366
- children: [
367
- /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
368
- /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex overflow-hidden", children: /* @__PURE__ */ jsx(
369
- "div",
370
- {
371
- className: clx(
372
- "flex h-full w-full flex-col items-center overflow-y-auto p-16"
373
- ),
374
- children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8", children: [
375
- /* @__PURE__ */ jsxs("div", { children: [
376
- /* @__PURE__ */ jsx(Heading, { children: t("commissionRates.create.header") }),
377
- /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("commissionRates.create.description") })
378
- ] }),
379
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
380
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
381
- /* @__PURE__ */ jsx(
382
- Form.Field,
383
- {
384
- control: form.control,
385
- name: "name",
386
- render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
387
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.name") }),
388
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
389
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
390
- ] })
391
- }
392
- ),
393
- /* @__PURE__ */ jsx(
394
- Form.Field,
395
- {
396
- control: form.control,
397
- name: "code",
398
- render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
399
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.code") }),
400
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
401
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
402
- ] })
403
- }
404
- )
405
- ] }),
406
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
407
- /* @__PURE__ */ jsx(
408
- Form.Field,
409
- {
410
- control: form.control,
411
- name: "type",
412
- render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
413
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.type.label") }),
414
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
415
- /* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
416
- /* @__PURE__ */ jsxs(Select.Content, { children: [
417
- /* @__PURE__ */ jsx(Select.Item, { value: "percentage", children: t("commissionRates.fields.type.percentage") }),
418
- /* @__PURE__ */ jsx(Select.Item, { value: "fixed", children: t("commissionRates.fields.type.fixed") })
419
- ] })
420
- ] }) }),
421
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
422
- ] })
423
- }
424
- ),
425
- /* @__PURE__ */ jsx(
426
- Form.Field,
427
- {
428
- control: form.control,
429
- name: "target",
430
- render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
431
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.target.label") }),
432
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
433
- /* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
434
- /* @__PURE__ */ jsxs(Select.Content, { children: [
435
- /* @__PURE__ */ jsx(Select.Item, { value: "item", children: t("commissionRates.fields.target.item") }),
436
- /* @__PURE__ */ jsx(Select.Item, { value: "shipping", children: t("commissionRates.fields.target.shipping") })
437
- ] })
438
- ] }) }),
439
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
440
- ] })
441
- }
442
- )
443
- ] }),
444
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
445
- /* @__PURE__ */ jsx(
446
- Form.Field,
447
- {
448
- control: form.control,
449
- name: "currency_code",
450
- render: ({ field: { onChange, ref, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
451
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.currencyCode") }),
452
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
453
- /* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: t("commissionRates.fields.currencyPlaceholder") }) }),
454
- /* @__PURE__ */ jsx(Select.Content, { children: storeCurrencies.map((currency) => /* @__PURE__ */ jsx(
455
- Select.Item,
456
- {
457
- value: currency.code.toLowerCase(),
458
- children: currency.name
459
- },
460
- currency.code
461
- )) })
462
- ] }) }),
463
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
464
- ] })
465
- }
466
- ),
467
- /* @__PURE__ */ jsx(
468
- Form.Field,
469
- {
470
- control: form.control,
471
- name: "value",
472
- render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
473
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.rate") }),
474
- /* @__PURE__ */ jsx(Form.Control, { children: watchType === "percentage" ? /* @__PURE__ */ jsx(
475
- PercentageInput,
476
- {
477
- ...field,
478
- value,
479
- decimalsLimit: 4,
480
- onValueChange: (_value, _name, values) => onChange(values?.float ?? 0)
481
- }
482
- ) : /* @__PURE__ */ jsx(
483
- CurrencyInput,
484
- {
485
- min: 0,
486
- onValueChange: (value2) => onChange(value2 ? parseInt(value2) : ""),
487
- code: watchCurrency,
488
- symbol: watchCurrency ? getCurrencySymbol(watchCurrency) : "",
489
- ...field,
490
- value
491
- }
492
- ) }),
493
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
494
- ] })
495
- }
496
- )
497
- ] }),
498
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
499
- /* @__PURE__ */ jsx(
500
- Form.Field,
501
- {
502
- control: form.control,
503
- name: "min_amount",
504
- render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
505
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.minAmount") }),
506
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
507
- CurrencyInput,
508
- {
509
- min: 0,
510
- onValueChange: (value2) => onChange(value2 ? parseInt(value2) : ""),
511
- code: watchCurrency,
512
- symbol: watchCurrency ? getCurrencySymbol(watchCurrency) : "",
513
- ...field,
514
- value
515
- }
516
- ) }),
517
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
518
- ] })
519
- }
520
- ),
521
- /* @__PURE__ */ jsx(
522
- Form.Field,
523
- {
524
- control: form.control,
525
- name: "priority",
526
- render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
527
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.priority") }),
528
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { type: "number", ...field }) }),
529
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
530
- ] })
531
- }
532
- )
533
- ] })
534
- ] }),
535
- /* @__PURE__ */ jsx(
536
- Form.Field,
537
- {
538
- control: form.control,
539
- name: "is_enabled",
540
- render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
541
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
542
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.enabled") }),
543
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
544
- Switch,
545
- {
546
- ...field,
547
- checked: value,
548
- onCheckedChange: onChange
549
- }
550
- ) })
551
- ] }),
552
- /* @__PURE__ */ jsx(Form.Hint, { children: t("commissionRates.fields.enabledHint") }),
553
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
554
- ] })
555
- }
556
- ),
557
- /* @__PURE__ */ jsx(
558
- Form.Field,
559
- {
560
- control: form.control,
561
- name: "include_tax",
562
- render: ({ field: { value, onChange, ...field } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
563
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
564
- /* @__PURE__ */ jsx(Form.Label, { children: t("commissionRates.fields.includeTax") }),
565
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
566
- Switch,
567
- {
568
- ...field,
569
- checked: value,
570
- onCheckedChange: onChange
571
- }
572
- ) })
573
- ] }),
574
- /* @__PURE__ */ jsx(Form.Hint, { children: t("commissionRates.fields.includeTaxHint") }),
575
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
576
- ] })
577
- }
578
- ),
579
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-3", children: [
580
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-x-4", children: [
581
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
582
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-1", children: [
583
- /* @__PURE__ */ jsx(
584
- Label,
585
- {
586
- id: "commission_rules_label",
587
- htmlFor: "commission_rules",
588
- children: t("taxRegions.fields.targets.label")
589
- }
590
- ),
591
- /* @__PURE__ */ jsxs(
592
- Text,
593
- {
594
- size: "small",
595
- leading: "compact",
596
- className: "text-ui-fg-muted",
597
- children: [
598
- "(",
599
- t("fields.optional"),
600
- ")"
601
- ]
602
- }
603
- )
604
- ] }),
605
- /* @__PURE__ */ jsx(
606
- Hint,
607
- {
608
- id: "commission_rules_description",
609
- className: "text-pretty",
610
- children: t("taxRegions.fields.targets.hint")
611
- }
612
- )
613
- ] }),
614
- showAddButton && /* @__PURE__ */ jsx(
615
- Button,
616
- {
617
- onClick: addRule,
618
- type: "button",
619
- size: "small",
620
- variant: "transparent",
621
- className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover flex-shrink-0",
622
- children: t("taxRegions.fields.targets.action")
623
- }
624
- )
625
- ] }),
626
- /* @__PURE__ */ jsx(
627
- "div",
628
- {
629
- id: "commission_rules",
630
- "aria-labelledby": "commission_rules_label",
631
- "aria-describedby": "commission_rules_description",
632
- role: "application",
633
- className: "flex flex-col gap-y-3",
634
- children: visibleRuleTypes.map((ruleType, index) => {
635
- const type = ruleType.value;
636
- const label = ruleType.label;
637
- const isLast = index === visibleRuleTypes.length - 1;
638
- const searchPlaceholder = searchPlaceholders[type];
639
- const options = getAvailableRuleTypes(type);
640
- const { fields, remove } = getControls(type);
641
- const handler = getFieldHandler(type);
642
- const modalId = getStackedModalId(type);
643
- const handleChangeType = (value) => {
644
- disableRule(type);
645
- enableRule(value);
646
- };
647
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
648
- Form.Field,
649
- {
650
- control: form.control,
651
- name: ruleType.value,
652
- render: ({ field }) => {
653
- return /* @__PURE__ */ jsxs(Form.Item, { className: "space-y-0", children: [
654
- /* @__PURE__ */ jsx(Form.Label, { className: "sr-only", children: label }),
655
- /* @__PURE__ */ jsxs(
656
- "div",
657
- {
658
- className: clx(
659
- "bg-ui-bg-component shadow-elevation-card-rest transition-fg grid gap-1.5 rounded-xl py-1.5",
660
- "aria-[invalid='true']:shadow-borders-error"
661
- ),
662
- role: "application",
663
- ...field,
664
- children: [
665
- /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid gap-1.5 px-1.5 md:grid-cols-2", children: [
666
- isLast ? /* @__PURE__ */ jsxs(
667
- Select,
668
- {
669
- dir: direction,
670
- value: type,
671
- onValueChange: handleChangeType,
672
- children: [
673
- /* @__PURE__ */ jsx(Select.Trigger, { className: "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover", children: /* @__PURE__ */ jsx(Select.Value, {}) }),
674
- /* @__PURE__ */ jsx(Select.Content, { children: options.map((option) => {
675
- return /* @__PURE__ */ jsx(
676
- Select.Item,
677
- {
678
- value: option.value,
679
- children: option.label
680
- },
681
- option.value
682
- );
683
- }) })
684
- ]
685
- }
686
- ) : /* @__PURE__ */ jsx("div", { className: "bg-ui-bg-field shadow-borders-base txt-compact-small rounded-md px-2 py-1.5", children: label }),
687
- /* @__PURE__ */ jsx("div", { className: "bg-ui-bg-field shadow-borders-base txt-compact-small rounded-md px-2 py-1.5", children: t(
688
- "taxRegions.fields.targets.operators.in"
689
- ) })
690
- ] }),
691
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 px-1.5", children: [
692
- /* @__PURE__ */ jsxs(StackedFocusModal, { id: modalId, children: [
693
- /* @__PURE__ */ jsx(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
694
- "button",
695
- {
696
- type: "button",
697
- className: "bg-ui-bg-field-component hover:bg-ui-bg-field-component-hover shadow-borders-base txt-compact-small text-ui-fg-muted transition-fg focus-visible:shadow-borders-interactive-with-active flex flex-1 items-center gap-x-2 rounded-md px-2 py-1.5 outline-none",
698
- children: [
699
- /* @__PURE__ */ jsx(MagnifyingGlass, {}),
700
- searchPlaceholder
701
- ]
702
- }
703
- ) }),
704
- /* @__PURE__ */ jsx(StackedFocusModal.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", children: t("actions.browse") }) }),
705
- /* @__PURE__ */ jsxs(StackedFocusModal.Content, { children: [
706
- /* @__PURE__ */ jsxs(StackedFocusModal.Header, { children: [
707
- /* @__PURE__ */ jsx(StackedFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { className: "sr-only", children: t(
708
- "taxRegions.fields.targets.modal.header"
709
- ) }) }),
710
- /* @__PURE__ */ jsx(StackedFocusModal.Description, { className: "sr-only", children: t(
711
- "taxRegions.fields.targets.hint"
712
- ) })
713
- ] }),
714
- /* @__PURE__ */ jsx(
715
- TargetForm,
716
- {
717
- type: "focus",
718
- referenceType: type,
719
- state: fields,
720
- setState: handler
721
- }
722
- )
723
- ] })
724
- ] }),
725
- /* @__PURE__ */ jsx(
726
- Button,
727
- {
728
- variant: "secondary",
729
- onClick: () => disableRule(type),
730
- type: "button",
731
- children: t("actions.delete")
732
- }
733
- )
734
- ] }),
735
- fields.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-1.5", children: [
736
- /* @__PURE__ */ jsx(Divider, { variant: "dashed" }),
737
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-y-1.5 px-1.5", children: fields.map((field2, index2) => {
738
- return /* @__PURE__ */ jsx(
739
- TargetItem,
740
- {
741
- index: index2,
742
- label: field2.label,
743
- onRemove: remove,
744
- value: field2.value
745
- },
746
- field2.id
747
- );
748
- }) })
749
- ] }) : null
750
- ]
751
- }
752
- ),
753
- /* @__PURE__ */ jsx(Form.ErrorMessage, { className: "mt-2" })
754
- ] });
755
- }
756
- }
757
- ) }, type);
758
- })
759
- }
760
- )
761
- ] })
762
- ] })
763
- }
764
- ) }),
765
- /* @__PURE__ */ jsxs(RouteFocusModal.Footer, { children: [
766
- /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
767
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
768
- ] })
769
- ]
770
- }
771
- ) });
772
- };
773
-
774
- // src/pages/commission-rates/commission-rate-create/commission-rate-create.tsx
775
- import { jsx as jsx2 } from "react/jsx-runtime";
776
- var CommissionRateCreate = () => {
777
- const { isLoading, store } = useStore();
778
- return /* @__PURE__ */ jsx2(RouteFocusModal, { children: !isLoading && store && /* @__PURE__ */ jsx2(CreateCommissionRateForm, { store }) });
779
- };
780
- export {
781
- CommissionRateCreate as Component
782
- };