@feedmepos/mf-inventory-portal 1.8.0-dev.16 → 1.8.0-dev.17

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 (133) hide show
  1. package/dist/{App-xSsyvQV_.js → App-CRmKXhRV.js} +9 -9
  2. package/dist/{ApprovalView-DfJ0FAiD.js → ApprovalView-tDkNN-Cd.js} +9 -9
  3. package/dist/{BindingsDialog-oAZyjgrN.js → BindingsDialog-DrB0U9F6.js} +2 -2
  4. package/dist/{BindingsPicker-CEIo7myR.js → BindingsPicker-tjjgijNe.js} +2 -2
  5. package/dist/{BindingsTable-BKa-JYRR.js → BindingsTable-D7EGgWxE.js} +4 -4
  6. package/dist/{BulkReceiveRequestPage-C6Oyg5-E.js → BulkReceiveRequestPage-B7GEE9qI.js} +21 -21
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BvleQo5y.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-B4j6Acmo.js} +1 -1
  8. package/dist/{ClosingDraftView-tJrjqyAC.js → ClosingDraftView-DH0eBMZ8.js} +19 -19
  9. package/dist/{ClosingHistoryView-CJQlK4Xc.js → ClosingHistoryView-FmdYCiLI.js} +7 -7
  10. package/dist/{ClosingTemplateView-DYRtdK5h.js → ClosingTemplateView-BGmFG2-y.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DEwi7wFf.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DHboInU_.js} +1 -1
  12. package/dist/{DefaultView-CxTBlkln.js → DefaultView-CsNlHUlf.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-Bywdjc2U.js → DeliveryOrderPrintPreview-CMe2DpP1.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DcFAUTdO.js → EmailDialog.vue_vue_type_script_setup_true_lang-Yen9u78U.js} +7759 -7654
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C8c6rmJv.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BJy8_H2s.js} +1 -1
  16. package/dist/{FeatureCapabilityGate-B41dULfm.js → FeatureCapabilityGate-DN8b1697.js} +2 -2
  17. package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-D4G6i1D6.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-DmNFZYam.js} +1 -1
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CnqH115V.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-2zOATqzb.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QBviJzAO.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CVBUkN02.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BuE-1qd6.js} +2 -2
  21. package/dist/{FmMultiselectDialog-M6CvNFW1.js → FmMultiselectDialog-C3B8pd2Z.js} +2 -2
  22. package/dist/{FmMultiselectDialog-CFNZMzlC.js → FmMultiselectDialog-LI5ekHzQ.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BGco50Ma.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DQZ7aJGJ.js} +113 -106
  24. package/dist/{ImportView-C2GOmpuK.js → ImportView-DYoeJLdr.js} +6 -6
  25. package/dist/{IngredientsView-wB9kGiOK.js → IngredientsView-u3KHfALO.js} +15 -15
  26. package/dist/{IntegrationExplorerView-BujwGE4q.js → IntegrationExplorerView-Bl0Z8sxM.js} +6 -6
  27. package/dist/{IntegrationPlatformView-Wnvj6-BG.js → IntegrationPlatformView-CybBB3RA.js} +2 -2
  28. package/dist/{IntegrationView-C77rSbpn.js → IntegrationView-Dxy7QhCp.js} +14 -14
  29. package/dist/{InventoryBindingForm-Bs7Duwfj.js → InventoryBindingForm-DyUvyOsa.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DawAEeuP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dmch1sfA.js} +4 -4
  31. package/dist/{InventoryBindingSummary-BefkYWIr.js → InventoryBindingSummary-DwY3vUf_.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BpUMK6fj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2UtnJtf.js} +2 -2
  33. package/dist/{ProductionRunDetailPage-CVx9LS-P.js → ProductionRunDetailPage-Cdi4hv3E.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-4aYz5NwS.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D5jlF5x4.js} +988 -954
  35. package/dist/{ProductionRunPage-CuXzmWMc.js → ProductionRunPage-RcbHy0Mj.js} +4 -4
  36. package/dist/{PublishView-Bu8J6ndy.js → PublishView-CyJ_rE-5.js} +3 -3
  37. package/dist/{PurchaseOrderPrintPreview-DaslFe8u.js → PurchaseOrderPrintPreview-ZlbV3YfE.js} +2 -2
  38. package/dist/{ReceiveRequestView-CKPBpN4x.js → ReceiveRequestView-BKz8N6yK.js} +13 -13
  39. package/dist/{RecipeView-BeZ9ljtA.js → RecipeView-D3IEyQoK.js} +15 -15
  40. package/dist/{SettingsView-CWhMdNfn.js → SettingsView-A0eozTq3.js} +7 -7
  41. package/dist/{StockView-C5IhPGxi.js → StockView-DrxkHTH4.js} +25 -25
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B9Rx_9b7.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CD11VzXa.js} +1 -1
  43. package/dist/{SupplierView-BSGajl9V.js → SupplierView-Cg60vwsj.js} +15 -14
  44. package/dist/{SurchargeView-DtAszxTN.js → SurchargeView-Dxvg-RnC.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CfxroS8u.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DDLGEaa2.js} +2 -2
  46. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DfYoaT5a.js +332 -0
  47. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B_9i5LzY.js → TransferDetails.vue_vue_type_script_setup_true_lang-D3wClK8t.js} +1264 -1232
  48. package/dist/{TransferTemplateView-D6_AfMja.js → TransferTemplateView-DfCJzLHt.js} +945 -941
  49. package/dist/{UnitCostHistoryView-kisQehVE.js → UnitCostHistoryView-BkNnwNUc.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DKoPNZoW.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Clufqvr_.js} +4 -4
  51. package/dist/{UnitView-jSLennZW.js → UnitView-D_agG3Kd.js} +7 -7
  52. package/dist/{WarehouseView-CUdWJCMq.js → WarehouseView-DE_CaJCb.js} +8 -8
  53. package/dist/{WastageTemplateView--B0LSwHa.js → WastageTemplateView-r3b6angy.js} +15 -15
  54. package/dist/api/inventory.d.ts +9 -9
  55. package/dist/{app-Bb5HLWTu.js → app-CLTXsVH_.js} +26976 -25707
  56. package/dist/app.d.ts +48 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{closing-template-CgDMayoo.js → closing-template-yP6QT_6M.js} +4 -4
  59. package/dist/components/FmUnitInputProps.d.ts +1 -0
  60. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  61. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  62. package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
  63. package/dist/composable/defineApi.d.ts +1 -1
  64. package/dist/{date2-D9gB9BE-.js → date2-9jq_OKuv.js} +1 -1
  65. package/dist/{dayjs.min-CumM_kH7.js → dayjs.min-CAxu5-hQ.js} +1 -1
  66. package/dist/{decimal-CVF1rRoj.js → decimal-BhGvDuWQ.js} +2 -2
  67. package/dist/{defineDeepModel-DE-DsQjm.js → defineDeepModel-Czbczabc.js} +1 -1
  68. package/dist/{duplicate-template-CFYtQfQn.js → duplicate-template-X72Zob-u.js} +1 -1
  69. package/dist/{feature-kti8bU8q.js → feature-CC2pF6VK.js} +2 -2
  70. package/dist/{format-time-from-id-CWZ5VGvM.js → format-time-from-id-DhZOfLN4.js} +1 -1
  71. package/dist/{format-unit-display-BlxdvskN.js → format-unit-display-BalKqHYj.js} +115 -113
  72. package/dist/{id-to-date-BaH_1Kui.js → id-to-date-Cb9v4BtX.js} +1 -1
  73. package/dist/{import-export.helper-8rKrOB0E.js → import-export.helper-9D5DLoaq.js} +5 -5
  74. package/dist/{index-B9p_OEdk.js → index-B0T8iGU6.js} +1 -1
  75. package/dist/{index-BHc3cNyz.js → index-CnjRz458.js} +3 -3
  76. package/dist/{index-MEUJonBr.js → index-DqV626Os.js} +1768 -1741
  77. package/dist/{lz-string-IiazGN0W.js → lz-string-CK_kK0b8.js} +1 -1
  78. package/dist/{netsuite-BeDxaeKM.js → netsuite-Czq6x14E.js} +2 -2
  79. package/dist/{netsuite-explorer-4IluitzS.js → netsuite-explorer-BugWV6N7.js} +1 -1
  80. package/dist/{predefined-templates-D4qVID1q.js → predefined-templates-D5qjNE4o.js} +1 -1
  81. package/dist/{purchase-order-template-GTOntq3C.js → purchase-order-template-Bc0QP-bq.js} +1 -1
  82. package/dist/{recalculationUtils-Dye8x2TO.js → recalculationUtils-CJknKvb-.js} +1 -1
  83. package/dist/{row-action.enum-CVJbq_-y.js → row-action.enum-Cz1k6Kht.js} +1 -1
  84. package/dist/{rules-Y3zXVj3i.js → rules-BQscySfb.js} +45 -40
  85. package/dist/{stock-BR8x3nlx.js → stock--68mu-M1.js} +1 -1
  86. package/dist/{stock-BIjTQFsR.js → stock-DCz3ZTmd.js} +2 -2
  87. package/dist/stores/integration/netsuite.d.ts +2 -2
  88. package/dist/stores/location.d.ts +42 -42
  89. package/dist/stores/supplier.d.ts +48 -48
  90. package/dist/stores/warehouse.d.ts +1 -1
  91. package/dist/{supplier-CbdCjiIB.js → supplier-U06ZrnoC.js} +2 -2
  92. package/dist/{surcharge-BoXLK6o0.js → surcharge-B5DGPlf5.js} +1 -1
  93. package/dist/tsconfig.app.tsbuildinfo +1 -1
  94. package/dist/{uom-rules-C5h1AoPJ.js → uom-rules-DfBYytl6.js} +1 -1
  95. package/dist/{use-ingredient-select-dialog-D196q_qk.js → use-ingredient-select-dialog-BRTxaEaQ.js} +2 -2
  96. package/dist/{use-inventory-binding-dialog-B4IhhCjM.js → use-inventory-binding-dialog-DQDv8yOS.js} +2 -2
  97. package/dist/{use-template-enabled-locations-CDKP3kTS.js → use-template-enabled-locations-DzQVNhev.js} +2 -2
  98. package/dist/{use-transfer-locations-DE4vxSDp.js → use-transfer-locations-CGvKssyQ.js} +2 -2
  99. package/dist/{useHrmPermission-D1dkveCP.js → useHrmPermission-BkOtYcLu.js} +1 -1
  100. package/dist/{useNavigationMenu-N5_7da8m.js → useNavigationMenu-korDNdFf.js} +4 -4
  101. package/dist/{useSseClient-CKpNaz5g.js → useSseClient-BjoRcYKu.js} +1 -1
  102. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  103. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  104. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  105. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  106. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  107. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  108. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
  109. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  110. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  111. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  112. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  113. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  114. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  115. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
  116. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
  117. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
  118. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
  119. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
  120. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  121. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  122. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  123. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  124. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  125. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  126. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  127. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  128. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  129. package/dist/{vue-CxSKQOrZ.js → vue-hPU91AHR.js} +2 -2
  130. package/dist/{vue-i18n-CTR_IUvd.js → vue-i18n-VFYpKHHB.js} +158 -158
  131. package/dist/{xlsx.util-J9pxGRQD.js → xlsx.util-VlHt05TU.js} +2 -2
  132. package/package.json +5 -5
  133. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CTj_jYK1.js +0 -299
@@ -1,32 +1,32 @@
1
- import { defineComponent as re, onMounted as Ve, computed as V, ref as H, watch as Fe, inject as _t, resolveComponent as E, createElementBlock as O, openBlock as w, createElementVNode as t, createVNode as u, withCtx as P, renderSlot as je, withDirectives as He, normalizeClass as oe, vModelText as We, reactive as Ye, h as G, createCommentVNode as j, toDisplayString as S, unref as e, Fragment as ae, normalizeStyle as Oe, renderList as ye, createBlock as se, mergeProps as Me, createTextVNode as ie, mergeModels as Ge, useModel as gt, isRef as tt, withModifiers as xt, Teleport as kt, normalizeProps as $t, guardReactiveProps as Ft } from "vue";
1
+ import { defineComponent as ae, onMounted as Ve, computed as M, ref as H, watch as Fe, inject as _t, resolveComponent as E, createElementBlock as C, openBlock as S, createElementVNode as t, createVNode as u, withCtx as P, renderSlot as He, withDirectives as We, normalizeClass as oe, vModelText as Ye, reactive as Te, h as K, createCommentVNode as j, toDisplayString as F, unref as e, Fragment as re, normalizeStyle as Me, renderList as ye, createBlock as se, mergeProps as Ee, createTextVNode as ie, mergeModels as Ke, useModel as gt, isRef as tt, withModifiers as xt, Teleport as kt, normalizeProps as $t, guardReactiveProps as Ft } from "vue";
2
2
  import { u as St, _ as wt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
3
  import { useI18n as pe, useCoreStore as It } from "@feedmepos/mf-common";
4
- import { f as Tt, t as Ct, u as Se, g as Ot, a as Ke, b as Vt } from "./format-unit-display-BlxdvskN.js";
5
- import { R as Ze } from "./row-action.enum-CVJbq_-y.js";
6
- import { a as we, q as Mt, r as X, s as fe, u as ot, t as Et, k as xe } from "./app-Bb5HLWTu.js";
7
- import { _ as Dt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqHtzo20.js";
8
- import { components as ue, useSnackbar as At, useProxiedModel as st, useDialog as qt, useBreakpoints as Rt } from "@feedmepos/ui-library";
9
- import { defineStore as Bt, storeToRefs as Je } from "pinia";
4
+ import { f as Tt, t as Ct, u as Se, g as Ot, a as Ge, b as Mt } from "./format-unit-display-BalKqHYj.js";
5
+ import { R as Ze } from "./row-action.enum-Cz1k6Kht.js";
6
+ import { a as we, q as Vt, r as X, s as fe, u as ot, t as Et, k as xe } from "./app-CLTXsVH_.js";
7
+ import { _ as Dt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BuE-1qd6.js";
8
+ import { components as ue, useSnackbar as At, useProxiedModel as st, useDialog as qt, useBreakpoints as Ut } from "@feedmepos/ui-library";
9
+ import { defineStore as Rt, storeToRefs as Je } from "pinia";
10
10
  import { F as me } from "./form-mode.enum-BKiNVH6A.js";
11
- import { u as Te, I as ve, t as Xe, b as Ut, n as Pt, a as Q, c as Nt, R as ce, g as de, A as ke, M as lt, d as Lt } from "./rules-Y3zXVj3i.js";
12
- import { d as nt } from "./defineDeepModel-DE-DsQjm.js";
13
- import { _ as at, F as rt, a as it, b as dt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BGco50Ma.js";
14
- import { F as Ce, u as $e } from "./feature-kti8bU8q.js";
15
- import { u as Ee, _ as Qt } from "./netsuite-BeDxaeKM.js";
16
- import { u as zt } from "./supplier-CbdCjiIB.js";
17
- import { u as jt } from "./use-ingredient-select-dialog-D196q_qk.js";
11
+ import { u as Ce, I as ve, t as Xe, b as Bt, n as Pt, a as Q, c as Nt, R as ce, g as de, A as ke, M as nt, d as Lt } from "./rules-BQscySfb.js";
12
+ import { d as lt } from "./defineDeepModel-Czbczabc.js";
13
+ import { _ as rt, F as at, a as it, b as dt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-DQZ7aJGJ.js";
14
+ import { F as Oe, u as $e } from "./feature-CC2pF6VK.js";
15
+ import { u as De, _ as Qt } from "./netsuite-Czq6x14E.js";
16
+ import { u as zt } from "./supplier-U06ZrnoC.js";
17
+ import { u as jt } from "./use-ingredient-select-dialog-BRTxaEaQ.js";
18
18
  import { _ as ut } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
19
- import { F as ne } from "./index-eGvSlWMU.js";
20
- import { u as Ht } from "./use-template-enabled-locations-CDKP3kTS.js";
21
- import { u as Wt } from "./use-transfer-locations-DE4vxSDp.js";
22
- import { _ as mt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-QBviJzAO.js";
23
- import { u as Yt } from "./purchase-order-template-GTOntq3C.js";
24
- import { _ as Gt } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js";
25
- import { f as Kt } from "./format-time-from-id-CWZ5VGvM.js";
26
- import { f as ct } from "./date2-D9gB9BE-.js";
27
- import { u as Ie } from "./vue-i18n-CTR_IUvd.js";
28
- import { t as Zt, a as Jt, d as Xt } from "./xlsx.util-J9pxGRQD.js";
29
- const eo = { class: "flex flex-col" }, to = { class: "flex flex-col" }, oo = { class: "flex-1" }, so = { class: "flex items-center" }, lo = { class: "flex-1" }, no = { class: "flex-1" }, pt = /* @__PURE__ */ re({
19
+ import { F as le } from "./index-eGvSlWMU.js";
20
+ import { u as Ht } from "./use-template-enabled-locations-DzQVNhev.js";
21
+ import { u as Wt } from "./use-transfer-locations-CGvKssyQ.js";
22
+ import { _ as mt } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CVBUkN02.js";
23
+ import { u as Yt } from "./purchase-order-template-Bc0QP-bq.js";
24
+ import { _ as Kt } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js";
25
+ import { f as Gt } from "./format-time-from-id-DhZOfLN4.js";
26
+ import { f as ct } from "./date2-9jq_OKuv.js";
27
+ import { u as Ie } from "./vue-i18n-VFYpKHHB.js";
28
+ import { t as Zt, a as Jt, d as Xt } from "./xlsx.util-VlHt05TU.js";
29
+ const eo = { class: "flex flex-col" }, to = { class: "flex flex-col" }, oo = { class: "flex-1" }, so = { class: "flex items-center" }, no = { class: "flex-1" }, lo = { class: "flex-1" }, pt = /* @__PURE__ */ ae({
30
30
  __name: "FmMinMaxInput",
31
31
  props: {
32
32
  rules: {},
@@ -63,185 +63,185 @@ const eo = { class: "flex flex-col" }, to = { class: "flex flex-col" }, oo = { c
63
63
  helperText: {},
64
64
  helperState: {}
65
65
  },
66
- setup(F) {
67
- const d = F, l = nt("modelValue"), a = ve();
66
+ setup($) {
67
+ const d = $, n = lt("modelValue"), r = ve();
68
68
  Ve(() => {
69
- const { min: g, max: m } = l ?? {};
70
- if (!(!g || !m) && g.precision !== m.precision) {
71
- const y = Math.max(g.precision, m.precision), b = Te(g, y), n = Te(m, y);
72
- l.min = b, l.max = n;
69
+ const { min: _, max: c } = n ?? {};
70
+ if (!(!_ || !c) && _.precision !== c.precision) {
71
+ const g = Math.max(_.precision, c.precision), v = Ce(_, g), l = Ce(c, g);
72
+ n.min = v, n.max = l;
73
73
  }
74
74
  });
75
- const o = V(() => {
76
- const { min: g, max: m } = l ?? {};
77
- return Math.max((g == null ? void 0 : g.precision) ?? 0, (m == null ? void 0 : m.precision) ?? 0, d.precision ?? 0);
78
- }), r = (g) => {
79
- if (!g) return "";
80
- const m = Ut(g), y = o.value, b = Te(m, y);
75
+ const o = M(() => {
76
+ const { min: _, max: c } = n ?? {};
77
+ return Math.max((_ == null ? void 0 : _.precision) ?? 0, (c == null ? void 0 : c.precision) ?? 0, d.precision ?? 0);
78
+ }), a = (_) => {
79
+ if (!_) return "";
80
+ const c = Bt(_), g = o.value, v = Ce(c, g);
81
81
  return Pt(
82
- +Q(b),
83
- b.precision
82
+ +Q(v),
83
+ v.precision
84
84
  );
85
- }, h = H(r(l.min)), v = H(r(l.max));
86
- Fe([h, v], ([g, m]) => {
87
- const y = l ?? {}, b = a(g), n = a(m), p = o.value;
88
- if (g !== "" && b === !0) {
89
- const C = Xe(+g, p);
90
- y.min = C;
85
+ }, h = H(a(n.min)), b = H(a(n.max));
86
+ Fe([h, b], ([_, c]) => {
87
+ const g = n ?? {}, v = r(_), l = r(c), f = o.value;
88
+ if (_ !== "" && v === !0) {
89
+ const w = Xe(+_, f);
90
+ g.min = w;
91
91
  } else
92
- y.min = null;
93
- if (m !== "" && n === !0) {
94
- const C = Xe(+m, p);
95
- y.max = C;
92
+ g.min = null;
93
+ if (c !== "" && l === !0) {
94
+ const w = Xe(+c, f);
95
+ g.max = w;
96
96
  } else
97
- y.max = null;
98
- l.min = y.min, l.max = y.max;
97
+ g.max = null;
98
+ n.min = g.min, n.max = g.max;
99
99
  });
100
- const T = Symbol.for("fm:form-state"), k = _t(T, null), M = V(() => d.disabled ?? (k == null ? void 0 : k.getDisabled()) ?? !1), $ = H(), s = H(), i = H(!1), f = H(!1), _ = V(() => i.value || f.value), D = V(() => [...[
100
+ const T = Symbol.for("fm:form-state"), k = _t(T, null), O = M(() => d.disabled ?? (k == null ? void 0 : k.getDisabled()) ?? !1), V = H(), m = H(), s = H(!1), i = H(!1), p = M(() => s.value || i.value), D = M(() => [...[
101
101
  function() {
102
- return typeof a(h.value) == "string" || typeof a(v.value) == "string" ? "Must be a number" : !0;
102
+ return typeof r(h.value) == "string" || typeof r(b.value) == "string" ? "Must be a number" : !0;
103
103
  },
104
- function(y) {
105
- return !y || !y.min || !y.max ? !0 : +Q(y.min) > +Q(y.max) ? "Min must be less than or equal to max" : !0;
104
+ function(g) {
105
+ return !g || !g.min || !g.max ? !0 : +Q(g.min) > +Q(g.max) ? "Min must be less than or equal to max" : !0;
106
106
  }
107
107
  ], ...d.rules ?? []]);
108
- return (g, m) => {
109
- const y = E("FmLabel"), b = E("FmField"), n = E("FmFormGroup");
110
- return w(), O("div", eo, [
108
+ return (_, c) => {
109
+ const g = E("FmLabel"), v = E("FmField"), l = E("FmFormGroup");
110
+ return S(), C("div", eo, [
111
111
  t("div", to, [
112
112
  t("div", oo, [
113
- u(y, {
114
- label: g.label,
115
- disabled: g.disabled,
116
- required: g.labelMark === "required",
117
- optional: g.labelMark === "optional"
113
+ u(g, {
114
+ label: _.label,
115
+ disabled: _.disabled,
116
+ required: _.labelMark === "required",
117
+ optional: _.labelMark === "optional"
118
118
  }, null, 8, ["label", "disabled", "required", "optional"])
119
119
  ]),
120
- u(b, { focused: _.value }, {
120
+ u(v, { focused: p.value }, {
121
121
  default: P(() => [
122
122
  t("div", so, [
123
- je(g.$slots, "prepend"),
124
- m[6] || (m[6] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
125
- t("div", lo, [
126
- He(t("input", {
123
+ He(_.$slots, "prepend"),
124
+ c[6] || (c[6] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
125
+ t("div", no, [
126
+ We(t("input", {
127
127
  type: "text",
128
128
  ref_key: "minInputRef",
129
- ref: $,
130
- onFocus: m[0] || (m[0] = () => i.value = !0),
131
- onBlur: m[1] || (m[1] = () => i.value = !1),
132
- "onUpdate:modelValue": m[2] || (m[2] = (p) => h.value = p),
129
+ ref: V,
130
+ onFocus: c[0] || (c[0] = () => s.value = !0),
131
+ onBlur: c[1] || (c[1] = () => s.value = !1),
132
+ "onUpdate:modelValue": c[2] || (c[2] = (f) => h.value = f),
133
133
  class: oe({
134
134
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
135
- "text-fm-color-typo-primary": !M.value,
136
- "text-fm-color-typo-disabled": M.value
135
+ "text-fm-color-typo-primary": !O.value,
136
+ "text-fm-color-typo-disabled": O.value
137
137
  })
138
138
  }, null, 34), [
139
- [We, h.value]
139
+ [Ye, h.value]
140
140
  ])
141
141
  ]),
142
- m[7] || (m[7] = t("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
143
- m[8] || (m[8] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
144
- t("div", no, [
145
- He(t("input", {
142
+ c[7] || (c[7] = t("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
143
+ c[8] || (c[8] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
144
+ t("div", lo, [
145
+ We(t("input", {
146
146
  type: "text",
147
147
  ref_key: "maxInputRef",
148
- ref: s,
149
- onFocus: m[3] || (m[3] = () => f.value = !0),
150
- onBlur: m[4] || (m[4] = () => f.value = !1),
151
- "onUpdate:modelValue": m[5] || (m[5] = (p) => v.value = p),
148
+ ref: m,
149
+ onFocus: c[3] || (c[3] = () => i.value = !0),
150
+ onBlur: c[4] || (c[4] = () => i.value = !1),
151
+ "onUpdate:modelValue": c[5] || (c[5] = (f) => b.value = f),
152
152
  class: oe({
153
153
  "fm-text-field--input fm-typo-en-body-lg-400": !0,
154
- "text-fm-color-typo-primary": !M.value,
155
- "text-fm-color-typo-disabled": M.value
154
+ "text-fm-color-typo-primary": !O.value,
155
+ "text-fm-color-typo-disabled": O.value
156
156
  })
157
157
  }, null, 34), [
158
- [We, v.value]
158
+ [Ye, b.value]
159
159
  ])
160
160
  ]),
161
- je(g.$slots, "append")
161
+ He(_.$slots, "append")
162
162
  ])
163
163
  ]),
164
164
  _: 3
165
165
  }, 8, ["focused"])
166
166
  ]),
167
- u(n, {
167
+ u(l, {
168
168
  class: "flex-1",
169
- "model-value": g.modelValue,
170
- info: g.labelInfo,
169
+ "model-value": _.modelValue,
170
+ info: _.labelInfo,
171
171
  rules: D.value,
172
- "helper-text": g.helperText,
173
- "helper-state": g.helperState
172
+ "helper-text": _.helperText,
173
+ "helper-state": _.helperState
174
174
  }, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
175
175
  ]);
176
176
  };
177
177
  }
178
178
  });
179
- function ft({ min: F, max: d } = { min: !0, max: !0 }) {
180
- return function(a) {
181
- return !a || !a.min && F != !1 || !a.max && d != !1 ? "Required" : !0;
179
+ function ft({ min: $, max: d } = { min: !0, max: !0 }) {
180
+ return function(r) {
181
+ return !r || !r.min && $ != !1 || !r.max && d != !1 ? "Required" : !0;
182
182
  };
183
183
  }
184
- function yt(F, d) {
185
- return function(a) {
186
- return !a || !a.min || !a.max ? !0 : +Q(a.min) < F ? `Must be between ${F} and ${d}` : +Q(a.max) > d ? `Must be between ${F} and ${d}` : !0;
184
+ function yt($, d) {
185
+ return function(r) {
186
+ return !r || !r.min || !r.max ? !0 : +Q(r.min) < $ ? `Must be between ${$} and ${d}` : +Q(r.max) > d ? `Must be between ${$} and ${d}` : !0;
187
187
  };
188
188
  }
189
- function vt(F) {
190
- const d = Nt(F), l = Q(F);
189
+ function vt($) {
190
+ const d = Nt($), n = Q($);
191
191
  return function(o) {
192
- const r = !(o != null && o.min) || d(o.min) === !0, h = !(o != null && o.max) || d(o.max) === !0;
193
- return !r && !h ? `Min & max must be a multiple of ${l}` : r ? h ? !0 : `Max must be a multiple of ${l}` : `Min must be a multiple of ${l}`;
192
+ const a = !(o != null && o.min) || d(o.min) === !0, h = !(o != null && o.max) || d(o.max) === !0;
193
+ return !a && !h ? `Min & max must be a multiple of ${n}` : a ? h ? !0 : `Max must be a multiple of ${n}` : `Min must be a multiple of ${n}`;
194
194
  };
195
195
  }
196
- const bt = Bt("netsuite-custom-field-helper", () => {
197
- const F = Ee();
198
- function d(l, a, o, r, h) {
199
- var k, M, $;
196
+ const bt = Rt("netsuite-custom-field-helper", () => {
197
+ const $ = De();
198
+ function d(n, r, o, a, h) {
199
+ var k, O, V;
200
200
  if (!o) {
201
201
  h == null || h("Unit is not valid");
202
202
  return;
203
203
  }
204
- let v = l.code;
205
- if (((k = l.measurement) == null ? void 0 : k.id) !== ((M = o.measurement) == null ? void 0 : M.id) && F.isEnabled) {
206
- const s = F.getItemCustomCode(a, ($ = o.measurement) == null ? void 0 : $.id);
207
- s && (v = s);
204
+ let b = n.code;
205
+ if (((k = n.measurement) == null ? void 0 : k.id) !== ((O = o.measurement) == null ? void 0 : O.id) && $.isEnabled) {
206
+ const m = $.getItemCustomCode(r, (V = o.measurement) == null ? void 0 : V.id);
207
+ m && (b = m);
208
208
  }
209
- r({
210
- ...l,
209
+ a({
210
+ ...n,
211
211
  quantity: o.amount,
212
212
  measurement: o.measurement ?? null,
213
- code: v
213
+ code: b
214
214
  });
215
215
  }
216
216
  return {
217
217
  validateUnitInput: d
218
218
  };
219
219
  });
220
- var Z = /* @__PURE__ */ ((F) => (F.Code = "Code", F.Name = "Name", F.DefaultAmount = "DefaultAmount", F.Limit = "Limit", F.Step = "Step", F.Cost = "Cost", F.Delete = "Delete", F))(Z || {});
221
- function ao(F, d = {}) {
222
- const { t: l } = pe(), a = we(), o = $e(), r = Ye({}), h = Ye({}), v = ($) => $.id ?? $.sku._id, T = bt();
220
+ var Z = /* @__PURE__ */ (($) => ($.Code = "Code", $.Name = "Name", $.DefaultAmount = "DefaultAmount", $.Limit = "Limit", $.Step = "Step", $.Cost = "Cost", $.Delete = "Delete", $))(Z || {});
221
+ function ro($, d = {}) {
222
+ const { t: n } = pe(), r = we(), o = $e(), a = Te({}), h = Te({}), b = (m) => m.id ?? m.sku._id, T = Te(/* @__PURE__ */ new Set()), k = bt();
223
223
  Ve(() => {
224
- for (const $ of F.items) {
225
- if (!$.totalCost)
224
+ for (const m of $.items) {
225
+ if (!m.totalCost)
226
226
  continue;
227
- const { cost: s } = Ce.calculateDefaultCost({
228
- item: $.sku,
229
- amount: $.quantity,
230
- measurement: $.measurement,
227
+ const { cost: s } = Oe.calculateDefaultCost({
228
+ item: m.sku,
229
+ amount: m.quantity,
230
+ measurement: m.measurement,
231
231
  overrides: {
232
- supplier: F.supplier
232
+ supplier: $.supplier
233
233
  },
234
- defaultCurrency: Mt()
235
- }), i = $.totalCost ?? Ce.reset();
236
- s ? r[$.sku._id] = s.amount !== i.amount || s.precision !== i.precision : r[$.sku._id] = !0;
234
+ defaultCurrency: Vt()
235
+ }), i = m.totalCost ?? Oe.reset();
236
+ s ? a[m.sku._id] = s.amount !== i.amount || s.precision !== i.precision : a[m.sku._id] = !0;
237
237
  }
238
238
  });
239
- const k = [
239
+ const O = [
240
240
  {
241
241
  id: "Code",
242
- header: () => G("div", { class: "flex-col" }, [
243
- G("div", l("inventory.transfer.form.items.table.Code")),
244
- G(
242
+ header: () => K("div", { class: "flex-col" }, [
243
+ K("div", n("inventory.transfer.form.items.table.Code")),
244
+ K(
245
245
  "div",
246
246
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
247
247
  "(original code)"
@@ -249,13 +249,13 @@ function ao(F, d = {}) {
249
249
  ]),
250
250
  accessorKey: "code",
251
251
  size: 180,
252
- cell($) {
253
- const s = $.row.original;
254
- return G("div", [
255
- G(ue.FmTextField, {
252
+ cell(m) {
253
+ const s = m.row.original;
254
+ return K("div", [
255
+ K(ue.FmTextField, {
256
256
  modelValue: s.code,
257
257
  "onUpdate:modelValue": (i) => {
258
- F.updateItem({
258
+ $.updateItem({
259
259
  ...s,
260
260
  code: i
261
261
  });
@@ -271,22 +271,22 @@ function ao(F, d = {}) {
271
271
  },
272
272
  {
273
273
  id: "Name",
274
- header: () => G("div", { class: "flex-col" }, [
275
- G("div", l("inventory.transfer.form.items.table.Name")),
276
- G(
274
+ header: () => K("div", { class: "flex-col" }, [
275
+ K("div", n("inventory.transfer.form.items.table.Name")),
276
+ K(
277
277
  "div",
278
278
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
279
279
  "(original name)"
280
280
  )
281
281
  ]),
282
282
  minSize: 300,
283
- cell($) {
284
- const s = $.row.original;
285
- return G("div", [
286
- G(ue.FmTextField, {
283
+ cell(m) {
284
+ const s = m.row.original;
285
+ return K("div", [
286
+ K(ue.FmTextField, {
287
287
  modelValue: s.name,
288
288
  "onUpdate:modelValue": (i) => {
289
- F.updateItem({
289
+ $.updateItem({
290
290
  ...s,
291
291
  name: i
292
292
  });
@@ -302,43 +302,47 @@ function ao(F, d = {}) {
302
302
  },
303
303
  {
304
304
  id: "DefaultAmount",
305
- header: () => l("inventory.transfer.form.items.table.DefaultAmount"),
305
+ header: () => n("inventory.transfer.form.items.table.DefaultAmount"),
306
306
  minSize: 200,
307
- cell($) {
308
- var g;
309
- const s = $.row.original, i = a.skuById[s.sku._id], f = a.unitById[(g = i.unit) == null ? void 0 : g._id], _ = f.measurements.find((m) => {
310
- var y;
311
- return ((y = s.measurement) == null ? void 0 : y.id) === m.id;
312
- }), D = s.sku.unit._id !== i.unit._id || !f || s.measurement && !_;
313
- return G(at, {
307
+ cell(m) {
308
+ const s = m.row.original, i = r.skuById[s.sku._id], p = s.id ?? s.sku._id, D = r.unitById[i.unit._id], _ = D ?? i.unit, c = !D && !T.has(p), g = `Unit "${i.unit.name}" (${i.unit.abbrev}) no longer exists in inventory units. Please reselect unit.`, v = _.measurements.find((f) => {
309
+ var w;
310
+ return ((w = s.measurement) == null ? void 0 : w.id) === f.id;
311
+ }), l = s.sku.unit._id !== i.unit._id || c || s.measurement && !v;
312
+ return K(rt, {
314
313
  style: {
315
314
  flex: "1 1 0%"
316
315
  },
317
316
  modelValue: {
318
317
  amount: s.quantity ?? { amount: 1, precision: 0 },
319
318
  // NOTE: leave this reading from row.sku.unit and row.measurement instead,
320
- measurement: s.measurement ?? (s.sku.unit._id !== i.unit._id ? { ...s.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
319
+ measurement: c ? { ...i.unit, id: "", abbrev: "", conversion: { amount: 1, precision: 0 } } : s.measurement ?? (s.sku.unit._id !== i.unit._id ? { ...s.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
321
320
  },
322
- disabled: F.disabled,
321
+ disabled: $.disabled,
323
322
  key: s.sku._id,
324
- unit: f,
325
- "onUpdate:modelValue": (m) => {
326
- T.validateUnitInput(
323
+ unit: _,
324
+ helperText: c ? g : "",
325
+ helperState: c ? "error" : "none",
326
+ "onUpdate:measurement": () => {
327
+ T.add(p);
328
+ },
329
+ "onUpdate:modelValue": (f) => {
330
+ k.validateUnitInput(
327
331
  s,
328
332
  i,
329
- m,
330
- (y) => {
331
- F.updateItem({
333
+ f,
334
+ (w) => {
335
+ $.updateItem({
332
336
  ...s,
333
- code: y.code,
334
- quantity: y.quantity,
335
- measurement: y.measurement
337
+ code: w.code,
338
+ quantity: w.quantity,
339
+ measurement: w.measurement
336
340
  });
337
341
  }
338
342
  );
339
343
  },
340
344
  rules: [
341
- rt(s.quantityStep),
345
+ at(s.quantityStep),
342
346
  ...+Q(s.quantity) ? [
343
347
  it(
344
348
  +Q(
@@ -353,8 +357,8 @@ function ao(F, d = {}) {
353
357
  dt(
354
358
  s.maximumQuantity ? +Q(s.maximumQuantity) : 1 / 0
355
359
  ),
356
- function(y) {
357
- return D ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
360
+ function(w) {
361
+ return c ? g : l ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
358
362
  }
359
363
  ],
360
364
  applyDefaultRules: !0
@@ -367,9 +371,9 @@ function ao(F, d = {}) {
367
371
  header: () => "Limit",
368
372
  // TODO: i18n,
369
373
  minSize: 280,
370
- cell($) {
371
- const s = $.row.original;
372
- return G(pt, {
374
+ cell(m) {
375
+ const s = m.row.original;
376
+ return K(pt, {
373
377
  style: {
374
378
  flex: "1 1 0%"
375
379
  },
@@ -377,12 +381,12 @@ function ao(F, d = {}) {
377
381
  min: s.minimumQuantity,
378
382
  max: s.maximumQuantity
379
383
  },
380
- disabled: F.disabled,
384
+ disabled: $.disabled,
381
385
  key: s.sku._id,
382
386
  unit: s.sku.unit,
383
387
  "onUpdate:modelValue": (i) => {
384
- const f = { ...s };
385
- i != null && i.min ? f.minimumQuantity = i.min : f.minimumQuantity = null, i != null && i.max ? f.maximumQuantity = i.max : f.maximumQuantity = null, F.updateItem(f);
388
+ const p = { ...s };
389
+ i != null && i.min ? p.minimumQuantity = i.min : p.minimumQuantity = null, i != null && i.max ? p.maximumQuantity = i.max : p.maximumQuantity = null, $.updateItem(p);
386
390
  },
387
391
  rules: [
388
392
  ft({ max: !1 }),
@@ -402,19 +406,19 @@ function ao(F, d = {}) {
402
406
  },
403
407
  {
404
408
  id: "Step",
405
- header: () => l("inventory.transfer.form.items.table.Step"),
409
+ header: () => n("inventory.transfer.form.items.table.Step"),
406
410
  minSize: 100,
407
- cell($) {
408
- const s = $.row.original;
409
- return G(ue.FmTextField, {
410
- modelValue: h[v(s)] ?? Q(s.quantityStep ?? Ce.reset(), !1),
411
+ cell(m) {
412
+ const s = m.row.original;
413
+ return K(ue.FmTextField, {
414
+ modelValue: h[b(s)] ?? Q(s.quantityStep ?? Oe.reset(), !1),
411
415
  key: s.sku._id,
412
416
  "onUpdate:modelValue": (i) => {
413
417
  if (ve()(i) !== !0) {
414
- h[v(s)] = i;
418
+ h[b(s)] = i;
415
419
  return;
416
420
  }
417
- delete h[v(s)], F.updateItem({
421
+ delete h[b(s)], $.updateItem({
418
422
  ...s,
419
423
  quantityStep: fe.fromNumber(+i)
420
424
  });
@@ -425,7 +429,7 @@ function ao(F, d = {}) {
425
429
  amount: 1,
426
430
  precision: de(s.sku.unit, s.measurement)
427
431
  }),
428
- lt(s.sku.unit, s.measurement)
432
+ nt(s.sku.unit, s.measurement)
429
433
  ]
430
434
  });
431
435
  },
@@ -434,10 +438,10 @@ function ao(F, d = {}) {
434
438
  {
435
439
  id: "Delete",
436
440
  header: "",
437
- cell($) {
438
- const s = $.row.original;
439
- return G("div", { class: "flex items-center" }, [
440
- o.usePurchaseOrderV2 ? G(
441
+ cell(m) {
442
+ const s = m.row.original;
443
+ return K("div", { class: "flex items-center" }, [
444
+ o.usePurchaseOrderV2 ? K(
441
445
  ue.FmTooltip,
442
446
  {
443
447
  zIndex: 50,
@@ -445,13 +449,13 @@ function ao(F, d = {}) {
445
449
  },
446
450
  {
447
451
  default() {
448
- return G(ue.FmButton, {
452
+ return K(ue.FmButton, {
449
453
  key: s.sku._id,
450
454
  type: "button",
451
455
  icon: "add_circle",
452
456
  variant: "tertiary",
453
457
  size: "md",
454
- disabled: F.disabled,
458
+ disabled: $.disabled,
455
459
  onClick: async () => {
456
460
  const i = {
457
461
  id: crypto.randomUUID(),
@@ -462,17 +466,17 @@ function ao(F, d = {}) {
462
466
  quantityStep: fe.fromNumber(1),
463
467
  minimumQuantity: fe.fromNumber(1)
464
468
  };
465
- T.validateUnitInput(
469
+ k.validateUnitInput(
466
470
  i,
467
471
  s.sku,
468
472
  {
469
473
  amount: i.quantity,
470
474
  measurement: null
471
475
  },
472
- (f) => {
473
- i.code = f.code;
476
+ (p) => {
477
+ i.code = p.code;
474
478
  }
475
- ), F.duplicateItem(i);
479
+ ), $.duplicateItem(i);
476
480
  }
477
481
  });
478
482
  },
@@ -481,16 +485,16 @@ function ao(F, d = {}) {
481
485
  }
482
486
  }
483
487
  ) : null,
484
- G(ue.FmButton, {
488
+ K(ue.FmButton, {
485
489
  class: "delete-button",
486
490
  key: s.sku._id,
487
491
  type: "button",
488
492
  icon: "delete",
489
493
  variant: "tertiary",
490
494
  size: "md",
491
- disabled: F.disabled,
495
+ disabled: $.disabled,
492
496
  onClick: () => {
493
- delete h[v(s)], F.deleteItem(s);
497
+ delete h[b(s)], $.deleteItem(s);
494
498
  }
495
499
  })
496
500
  ]);
@@ -504,100 +508,100 @@ function ao(F, d = {}) {
504
508
  }
505
509
  ];
506
510
  return {
507
- columnDefs: V(() => {
508
- const $ = $e(), s = [...k];
511
+ columnDefs: M(() => {
512
+ const m = $e(), s = [...O];
509
513
  if (Object.keys(d).length > 0)
510
- for (const [i, f] of Object.entries(d))
514
+ for (const [i, p] of Object.entries(d))
511
515
  s.splice(Number(i), 0, {
512
- ...f,
516
+ ...p,
513
517
  id: i
514
518
  });
515
- return $.enableTotalCost && F.transferType === X.enum.purchase ? s : s.filter((i) => i.id !== "Cost");
519
+ return m.enableTotalCost && $.transferType === X.enum.purchase ? s : s.filter((i) => i.id !== "Cost");
516
520
  })
517
521
  };
518
522
  }
519
- const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-center" }, uo = { class: "flex-1 flex gap-1 items-center" }, mo = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, co = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, po = { class: "flex gap-8 w-full" }, fo = { class: "flex-1 flex flex-col gap-4" }, yo = { class: "flex-1 flex flex-col gap-4" }, vo = {
523
+ const ao = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-center" }, uo = { class: "flex-1 flex gap-1 items-center" }, mo = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, co = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, po = { class: "flex gap-8 w-full" }, fo = { class: "flex-1 flex flex-col gap-4" }, yo = { class: "flex-1 flex flex-col gap-4" }, vo = {
520
524
  key: 0,
521
525
  class: "flex gap-8 w-full"
522
- }, bo = { class: "flex-1 flex flex-col gap-4" }, ho = { class: "flex-1 flex flex-col gap-4" }, _o = { class: "flex gap-8 w-full" }, go = { class: "flex-1 flex flex-col gap-4" }, xo = /* @__PURE__ */ re({
526
+ }, bo = { class: "flex-1 flex flex-col gap-4" }, ho = { class: "flex-1 flex flex-col gap-4" }, _o = { class: "flex gap-8 w-full" }, go = { class: "flex-1 flex flex-col gap-4" }, xo = /* @__PURE__ */ ae({
523
527
  __name: "TransferTemplateItem",
524
528
  props: {
525
529
  cellByColId: {},
526
530
  row: {}
527
531
  },
528
- setup(F) {
532
+ setup($) {
529
533
  const { t: d } = pe();
530
- function l(a) {
531
- return a;
534
+ function n(r) {
535
+ return r;
532
536
  }
533
- return (a, o) => {
534
- var h, v, T, k, M, $, s, i, f, _, D, g, m, y, b, n, p, C, I, B, ee, te, A, N, c, x, q, L, W, J;
535
- const r = E("FmLabel");
536
- return w(), O("div", ro, [
537
+ return (r, o) => {
538
+ var h, b, T, k, O, V, m, s, i, p, D, _, c, g, v, l, f, w, I, R, ee, te, A, N, y, x, q, L, W, J;
539
+ const a = E("FmLabel");
540
+ return S(), C("div", ao, [
537
541
  t("div", io, [
538
542
  t("div", uo, [
539
- t("span", mo, " (" + S(a.row.original.sku.code) + ") ", 1),
540
- t("span", co, S(a.row.original.sku.name), 1)
543
+ t("span", mo, " (" + F(r.row.original.sku.code) + ") ", 1),
544
+ t("span", co, F(r.row.original.sku.name), 1)
541
545
  ]),
542
546
  t("div", null, [
543
- u(e(ne), {
544
- render: (T = (v = (h = a.cellByColId.Delete) == null ? void 0 : h.column) == null ? void 0 : v.columnDef) == null ? void 0 : T.cell,
545
- props: (M = (k = a.cellByColId.Delete) == null ? void 0 : k.getContext) == null ? void 0 : M.call(k)
547
+ u(e(le), {
548
+ render: (T = (b = (h = r.cellByColId.Delete) == null ? void 0 : h.column) == null ? void 0 : b.columnDef) == null ? void 0 : T.cell,
549
+ props: (O = (k = r.cellByColId.Delete) == null ? void 0 : k.getContext) == null ? void 0 : O.call(k)
546
550
  }, null, 8, ["render", "props"])
547
551
  ])
548
552
  ]),
549
553
  t("div", po, [
550
554
  t("div", fo, [
551
- u(r, {
555
+ u(a, {
552
556
  label: e(d)(`inventory.transfer.form.items.table.${e(Z).Code}`)
553
557
  }, null, 8, ["label"]),
554
- u(e(ne), {
555
- render: (i = (s = ($ = a.cellByColId[e(Z).Code]) == null ? void 0 : $.column) == null ? void 0 : s.columnDef) == null ? void 0 : i.cell,
556
- props: (_ = (f = a.cellByColId[e(Z).Code]) == null ? void 0 : f.getContext) == null ? void 0 : _.call(f)
558
+ u(e(le), {
559
+ render: (s = (m = (V = r.cellByColId[e(Z).Code]) == null ? void 0 : V.column) == null ? void 0 : m.columnDef) == null ? void 0 : s.cell,
560
+ props: (p = (i = r.cellByColId[e(Z).Code]) == null ? void 0 : i.getContext) == null ? void 0 : p.call(i)
557
561
  }, null, 8, ["render", "props"]),
558
562
  o[0] || (o[0] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
559
563
  ]),
560
564
  t("div", yo, [
561
- u(r, {
565
+ u(a, {
562
566
  label: e(d)(`inventory.transfer.form.items.table.${e(Z).Name}`)
563
567
  }, null, 8, ["label"]),
564
- u(e(ne), {
565
- render: (m = (g = (D = a.cellByColId[e(Z).Name]) == null ? void 0 : D.column) == null ? void 0 : g.columnDef) == null ? void 0 : m.cell,
566
- props: (b = (y = a.cellByColId[e(Z).Name]) == null ? void 0 : y.getContext) == null ? void 0 : b.call(y)
568
+ u(e(le), {
569
+ render: (c = (_ = (D = r.cellByColId[e(Z).Name]) == null ? void 0 : D.column) == null ? void 0 : _.columnDef) == null ? void 0 : c.cell,
570
+ props: (v = (g = r.cellByColId[e(Z).Name]) == null ? void 0 : g.getContext) == null ? void 0 : v.call(g)
567
571
  }, null, 8, ["render", "props"]),
568
572
  o[1] || (o[1] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
569
573
  ])
570
574
  ]),
571
- a.row.original ? (w(), O("div", vo, [
575
+ r.row.original ? (S(), C("div", vo, [
572
576
  t("div", bo, [
573
- u(r, {
577
+ u(a, {
574
578
  label: e(d)(`inventory.transfer.form.items.table.${e(Z).DefaultAmount}`)
575
579
  }, null, 8, ["label"]),
576
- u(e(ne), {
577
- render: (C = (p = (n = a.cellByColId[e(Z).DefaultAmount]) == null ? void 0 : n.column) == null ? void 0 : p.columnDef) == null ? void 0 : C.cell,
578
- props: (B = (I = a.cellByColId[e(Z).DefaultAmount]) == null ? void 0 : I.getContext) == null ? void 0 : B.call(I)
580
+ u(e(le), {
581
+ render: (w = (f = (l = r.cellByColId[e(Z).DefaultAmount]) == null ? void 0 : l.column) == null ? void 0 : f.columnDef) == null ? void 0 : w.cell,
582
+ props: (R = (I = r.cellByColId[e(Z).DefaultAmount]) == null ? void 0 : I.getContext) == null ? void 0 : R.call(I)
579
583
  }, null, 8, ["render", "props"]),
580
584
  o[2] || (o[2] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
581
585
  ]),
582
586
  t("div", ho, [
583
- u(r, {
587
+ u(a, {
584
588
  label: e(d)(`inventory.transfer.form.items.table.${e(Z).Step}`)
585
589
  }, null, 8, ["label"]),
586
- u(e(ne), {
587
- render: (A = (te = (ee = a.cellByColId[e(Z).Step]) == null ? void 0 : ee.column) == null ? void 0 : te.columnDef) == null ? void 0 : A.cell,
588
- props: (c = (N = a.cellByColId[e(Z).Step]) == null ? void 0 : N.getContext) == null ? void 0 : c.call(N)
590
+ u(e(le), {
591
+ render: (A = (te = (ee = r.cellByColId[e(Z).Step]) == null ? void 0 : ee.column) == null ? void 0 : te.columnDef) == null ? void 0 : A.cell,
592
+ props: (y = (N = r.cellByColId[e(Z).Step]) == null ? void 0 : N.getContext) == null ? void 0 : y.call(N)
589
593
  }, null, 8, ["render", "props"]),
590
594
  o[3] || (o[3] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
591
595
  ])
592
596
  ])) : j("", !0),
593
597
  t("div", _o, [
594
598
  t("div", go, [
595
- u(r, {
599
+ u(a, {
596
600
  label: e(d)(`inventory.transfer.form.items.table.${e(Z).Limit}`)
597
601
  }, null, 8, ["label"]),
598
- u(e(ne), {
599
- render: (L = (q = (x = a.cellByColId[e(Z).Limit]) == null ? void 0 : x.column) == null ? void 0 : q.columnDef) == null ? void 0 : L.cell,
600
- props: (J = (W = a.cellByColId[e(Z).Limit]) == null ? void 0 : W.getContext) == null ? void 0 : J.call(W)
602
+ u(e(le), {
603
+ render: (L = (q = (x = r.cellByColId[e(Z).Limit]) == null ? void 0 : x.column) == null ? void 0 : q.columnDef) == null ? void 0 : L.cell,
604
+ props: (J = (W = r.cellByColId[e(Z).Limit]) == null ? void 0 : W.getContext) == null ? void 0 : J.call(W)
601
605
  }, null, 8, ["render", "props"]),
602
606
  o[4] || (o[4] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
603
607
  ])
@@ -605,7 +609,7 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
605
609
  ]);
606
610
  };
607
611
  }
608
- }), ko = { class: "fm-typo-en-body-md-400 line-clamp-2 w-full" }, $o = { key: 0 }, Fo = ["colspan"], So = /* @__PURE__ */ re({
612
+ }), ko = { class: "fm-typo-en-body-md-400 line-clamp-2 w-full" }, $o = { key: 0 }, Fo = ["colspan"], So = /* @__PURE__ */ ae({
609
613
  __name: "TransferTemplateItemTable",
610
614
  props: {
611
615
  row: {},
@@ -613,28 +617,28 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
613
617
  errorMessage: {}
614
618
  },
615
619
  emits: ["update:item"],
616
- setup(F) {
617
- function d(l) {
618
- return l.column.columnDef.meta;
620
+ setup($) {
621
+ function d(n) {
622
+ return n.column.columnDef.meta;
619
623
  }
620
- return (l, a) => (w(), O(ae, null, [
624
+ return (n, r) => (S(), C(re, null, [
621
625
  t("tr", {
622
626
  class: "hover:bg-fm-color-opacity-sm border-b border-fm-color-neutral-gray-100",
623
- style: Oe({ backgroundColor: l.errorMessage ? "#ffd6d6" : void 0 })
627
+ style: Me({ backgroundColor: n.errorMessage ? "#ffd6d6" : void 0 })
624
628
  }, [
625
- (w(!0), O(ae, null, ye(l.row.getVisibleCells(), (o) => {
626
- var r, h, v, T, k;
627
- return w(), O("td", {
629
+ (S(!0), C(re, null, ye(n.row.getVisibleCells(), (o) => {
630
+ var a, h, b, T, k;
631
+ return S(), C("td", {
628
632
  key: o.id,
629
- class: oe(["text-fm-color-typo-primary", ((r = d(o)) == null ? void 0 : r.cellClass) ?? "px-16", "py-2"]),
630
- style: Oe({
631
- width: (h = d(o)) != null && h.width ? (v = d(o)) == null ? void 0 : v.width : o.column.getSize() !== 0 ? `${o.column.getSize()}px` : void 0,
633
+ class: oe(["text-fm-color-typo-primary", ((a = d(o)) == null ? void 0 : a.cellClass) ?? "px-16", "py-2"]),
634
+ style: Me({
635
+ width: (h = d(o)) != null && h.width ? (b = d(o)) == null ? void 0 : b.width : o.column.getSize() !== 0 ? `${o.column.getSize()}px` : void 0,
632
636
  maxWidth: (T = d(o)) == null ? void 0 : T.maxWidth,
633
637
  textAlign: ((k = d(o)) == null ? void 0 : k.textAlign) ?? "left"
634
638
  })
635
639
  }, [
636
640
  t("span", ko, [
637
- u(e(ne), {
641
+ u(e(le), {
638
642
  props: o.getContext(),
639
643
  render: o.column.columnDef.cell
640
644
  }, null, 8, ["props", "render"])
@@ -642,152 +646,152 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
642
646
  ], 6);
643
647
  }), 128))
644
648
  ], 4),
645
- l.errorMessage ? (w(), O("tr", $o, [
649
+ n.errorMessage ? (S(), C("tr", $o, [
646
650
  t("td", {
647
- colspan: l.row.getVisibleCells().length,
651
+ colspan: n.row.getVisibleCells().length,
648
652
  class: "text-red-600 px-16 py-2"
649
- }, S(l.errorMessage), 9, Fo)
653
+ }, F(n.errorMessage), 9, Fo)
650
654
  ])) : j("", !0)
651
655
  ], 64));
652
656
  }
653
- }), wo = { class: "flex flex-col gap-16" }, Io = { class: "flex flex-col gap-24" }, To = { class: "flex flex-col gap-16" }, Co = { class: "flex items-center" }, Oo = { class: "flex flex-col" }, Vo = { class: "flex flex-col gap-16" }, Mo = { class: "flex gap-3" }, Eo = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Do = {
657
+ }), wo = { class: "flex flex-col gap-16" }, Io = { class: "flex flex-col gap-24" }, To = { class: "flex flex-col gap-16" }, Co = { class: "flex items-center" }, Oo = { class: "flex flex-col" }, Mo = { class: "flex flex-col gap-16" }, Vo = { class: "flex gap-3" }, Eo = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Do = {
654
658
  key: 0,
655
659
  class: "border rounded-sm px-8 py-2 bg-fm-color-system-warning-100 fm-typo-en-body-lg-400"
656
- }, Ao = { class: "border rounded-sm px-8 py-2 bg-fm-color-system-info-100 fm-typo-en-body-lg-400" }, qo = { class: "mb-2" }, Ro = /* @__PURE__ */ re({
660
+ }, Ao = { class: "border rounded-sm px-8 py-2 bg-fm-color-system-info-100 fm-typo-en-body-lg-400" }, qo = { class: "mb-2" }, Uo = /* @__PURE__ */ ae({
657
661
  __name: "TransferTemplateForm",
658
662
  props: {
659
663
  modelValue: {},
660
664
  disabled: { type: Boolean }
661
665
  },
662
666
  emits: ["update:disabled"],
663
- setup(F, { expose: d, emit: l }) {
664
- const a = F, o = l, r = nt(), { t: h } = pe(), v = H({}), T = ot(), k = we(), M = zt(), $ = $e(), s = Ee(), i = bt();
667
+ setup($, { expose: d, emit: n }) {
668
+ const r = $, o = n, a = lt(), { t: h } = pe(), b = H({}), T = ot(), k = we(), O = zt(), V = $e(), m = De(), s = bt();
665
669
  Fe(
666
- () => r.purchaseOrder.items.length,
670
+ () => a.purchaseOrder.items.length,
667
671
  () => {
668
- v.value = {};
672
+ b.value = {};
669
673
  }
670
674
  ), T.watchLocation(async () => {
671
- location && (r.purchaseOrder.supplier || (r.purchaseOrder.supplier = M.suppliers.find((c) => c) ?? r.purchaseOrder.supplier));
675
+ location && (a.purchaseOrder.supplier || (a.purchaseOrder.supplier = O.suppliers.find((y) => y) ?? a.purchaseOrder.supplier));
672
676
  });
673
- const f = Wt(
674
- () => r.purchaseOrder,
675
- (c) => {
676
- r.purchaseOrder = {
677
- ...r.purchaseOrder,
678
- supplier: c.supplier ?? (r == null ? void 0 : r.purchaseOrder.supplier)
677
+ const i = Wt(
678
+ () => a.purchaseOrder,
679
+ (y) => {
680
+ a.purchaseOrder = {
681
+ ...a.purchaseOrder,
682
+ supplier: y.supplier ?? (a == null ? void 0 : a.purchaseOrder.supplier)
679
683
  };
680
684
  }
681
- ), _ = V({
685
+ ), p = M({
682
686
  get() {
683
- var c, x;
684
- return typeof ((x = (c = r.purchaseOrder) == null ? void 0 : c.supplier) == null ? void 0 : x.internal) == "string" ? X.enum.transfer : X.enum.purchase;
687
+ var y, x;
688
+ return typeof ((x = (y = a.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : x.internal) == "string" ? X.enum.transfer : X.enum.purchase;
685
689
  },
686
- set(c) {
690
+ set(y) {
687
691
  var q, L;
688
- const x = typeof ((L = (q = r.purchaseOrder) == null ? void 0 : q.supplier) == null ? void 0 : L.internal) == "string" ? X.enum.transfer : X.enum.purchase;
689
- c !== x && (r.purchaseOrder.supplier = c === X.enum.purchase ? f.locationOptionsTypePurchase.value[0] : f.locationOptionsTypeTransfer.value[0]);
692
+ const x = typeof ((L = (q = a.purchaseOrder) == null ? void 0 : q.supplier) == null ? void 0 : L.internal) == "string" ? X.enum.transfer : X.enum.purchase;
693
+ y !== x && (a.purchaseOrder.supplier = y === X.enum.purchase ? i.locationOptionsTypePurchase.value[0] : i.locationOptionsTypeTransfer.value[0]);
690
694
  }
691
- }), D = V(() => f.transferLocationOptions.value), g = V({
695
+ }), D = M(() => i.transferLocationOptions.value), _ = M({
692
696
  get() {
693
- var c;
694
- return (c = r.purchaseOrder.supplier) == null ? void 0 : c._id;
697
+ var y;
698
+ return (y = a.purchaseOrder.supplier) == null ? void 0 : y._id;
695
699
  },
696
- set(c) {
697
- f.transferLocationModel.value = c;
700
+ set(y) {
701
+ i.transferLocationModel.value = y;
698
702
  }
699
703
  });
700
- async function m() {
701
- const c = await s.checkCustomFieldCodes({
704
+ async function c() {
705
+ const y = await m.checkCustomFieldCodes({
702
706
  beforeStart: async () => {
703
707
  o("update:disabled", !0);
704
708
  },
705
- templateItems: r.purchaseOrder.items
709
+ templateItems: a.purchaseOrder.items
706
710
  });
707
- v.value = c, o("update:disabled", !1);
711
+ b.value = y, o("update:disabled", !1);
708
712
  }
709
713
  const {
710
- promptSelectLocations: y,
711
- columnDefs: b,
712
- rowData: n
714
+ promptSelectLocations: g,
715
+ columnDefs: v,
716
+ rowData: l
713
717
  } = Ht({
714
718
  getLocations() {
715
- return r.locations;
719
+ return a.locations;
716
720
  },
717
- setLocations(c) {
718
- r.locations = c;
721
+ setLocations(y) {
722
+ a.locations = y;
719
723
  }
720
724
  });
721
- function p() {
722
- var c, x;
723
- return (c = r.locations) != null && c.find((q) => {
725
+ function f() {
726
+ var y, x;
727
+ return (y = a.locations) != null && y.find((q) => {
724
728
  var L, W;
725
- return ((L = q.doc) == null ? void 0 : L._id) === ((W = r.purchaseOrder.supplier) == null ? void 0 : W._id);
726
- }) ? `Location ${(x = r.purchaseOrder.supplier) == null ? void 0 : x.name} must be removed because template cannot be used to transfer to itself.` : !0;
729
+ return ((L = q.doc) == null ? void 0 : L._id) === ((W = a.purchaseOrder.supplier) == null ? void 0 : W._id);
730
+ }) ? `Location ${(x = a.purchaseOrder.supplier) == null ? void 0 : x.name} must be removed because template cannot be used to transfer to itself.` : !0;
727
731
  }
728
- const C = V({
732
+ const w = M({
729
733
  get() {
730
- return r.purchaseOrder.remark ?? void 0;
734
+ return a.purchaseOrder.remark ?? void 0;
731
735
  },
732
- set(c) {
733
- r.purchaseOrder.remark = c;
736
+ set(y) {
737
+ a.purchaseOrder.remark = y;
734
738
  }
735
739
  }), I = H();
736
740
  d({
737
741
  validateInputs: () => {
738
- var c, x;
739
- (x = (c = I.value) == null ? void 0 : c.validateInputs) == null || x.call(c);
742
+ var y, x;
743
+ (x = (y = I.value) == null ? void 0 : y.validateInputs) == null || x.call(y);
740
744
  },
741
745
  resetInputsValidation: () => {
742
- var c, x;
743
- (x = (c = I.value) == null ? void 0 : c.resetInputsValidation) == null || x.call(c);
746
+ var y, x;
747
+ (x = (y = I.value) == null ? void 0 : y.resetInputsValidation) == null || x.call(y);
744
748
  },
745
749
  resetInputs: () => {
746
- var c, x;
747
- (x = (c = I.value) == null ? void 0 : c.resetInputs) == null || x.call(c);
750
+ var y, x;
751
+ (x = (y = I.value) == null ? void 0 : y.resetInputs) == null || x.call(y);
748
752
  }
749
753
  });
750
- const B = V(() => ({
751
- duplicateItem: (c) => {
752
- r.purchaseOrder.items = [
753
- ...r.purchaseOrder.items,
754
+ const R = M(() => ({
755
+ duplicateItem: (y) => {
756
+ a.purchaseOrder.items = [
757
+ ...a.purchaseOrder.items,
754
758
  {
755
- ...c
759
+ ...y
756
760
  }
757
761
  ];
758
762
  },
759
- updateItem: (c) => {
763
+ updateItem: (y) => {
760
764
  let x = [];
761
- c.id ? x = r.purchaseOrder.items.map((q) => q.id !== c.id ? q : c) : x = r.purchaseOrder.items.map((q) => q.sku._id !== c.sku._id ? q : c), r.purchaseOrder.items = x;
765
+ y.id ? x = a.purchaseOrder.items.map((q) => q.id !== y.id ? q : y) : x = a.purchaseOrder.items.map((q) => q.sku._id !== y.sku._id ? q : y), a.purchaseOrder.items = x;
762
766
  },
763
- deleteItem: (c) => {
764
- console.log(c.id);
767
+ deleteItem: (y) => {
768
+ console.log(y.id);
765
769
  let x = [];
766
- c.id ? x = r.purchaseOrder.items.filter((q) => q.id !== c.id) : x = r.purchaseOrder.items.filter((q) => q.sku._id !== c.sku._id), r.purchaseOrder.items = x;
770
+ y.id ? x = a.purchaseOrder.items.filter((q) => q.id !== y.id) : x = a.purchaseOrder.items.filter((q) => q.sku._id !== y.sku._id), a.purchaseOrder.items = x;
767
771
  }
768
- })), ee = ao(
772
+ })), ee = ro(
769
773
  {
770
- duplicateItem: B.value.duplicateItem,
771
- updateItem: B.value.updateItem,
772
- deleteItem: B.value.deleteItem,
774
+ duplicateItem: R.value.duplicateItem,
775
+ updateItem: R.value.updateItem,
776
+ deleteItem: R.value.deleteItem,
773
777
  get supplier() {
774
- return r.purchaseOrder.supplier;
778
+ return a.purchaseOrder.supplier;
775
779
  },
776
780
  get items() {
777
- return r.purchaseOrder.items;
781
+ return a.purchaseOrder.items;
778
782
  },
779
783
  get transferType() {
780
784
  return X.enum.purchase;
781
785
  },
782
786
  get disabled() {
783
- return a.disabled;
787
+ return r.disabled;
784
788
  }
785
789
  },
786
- s.transferTemplateColumnDefs({
787
- onUpdate: (c, x, q, L) => {
788
- if (c < 0 || c >= r.purchaseOrder.items.length) return;
789
- const W = r.purchaseOrder.items[c];
790
- W && B.value.updateItem({
790
+ m.transferTemplateColumnDefs({
791
+ onUpdate: (y, x, q, L) => {
792
+ if (y < 0 || y >= a.purchaseOrder.items.length) return;
793
+ const W = a.purchaseOrder.items[y];
794
+ W && R.value.updateItem({
791
795
  ...W,
792
796
  sku: x,
793
797
  // Sku might be outdated, so we need to update it
@@ -796,97 +800,97 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
796
800
  });
797
801
  }
798
802
  })
799
- ), te = V(() => ee.columnDefs.value), { promptSelectIngredients: A } = jt();
803
+ ), te = M(() => ee.columnDefs.value), { promptSelectIngredients: A } = jt();
800
804
  async function N() {
801
- const x = k.skus.map((U) => ({
802
- label: U.name,
803
- sublabel: U.code,
804
- value: U
805
- })).filter((U) => {
805
+ const x = k.skus.map((B) => ({
806
+ label: B.name,
807
+ sublabel: B.code,
808
+ value: B
809
+ })).filter((B) => {
806
810
  var z;
807
- return (z = r.purchaseOrder.items) == null ? void 0 : z.find((K) => K.sku._id === U.value._id);
808
- }).map((U) => U.value), q = r.purchaseOrder.items ?? [], L = await A(
809
- x.map((U) => U._id),
810
- (U) => {
811
- const z = k.skuById[U], K = q.find((Y) => Y.sku._id === z._id);
812
- if (K)
813
- return K;
814
- const le = { amount: 1, precision: de(z.unit) };
815
- let R = {
816
- id: $.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
811
+ return (z = a.purchaseOrder.items) == null ? void 0 : z.find((G) => G.sku._id === B.value._id);
812
+ }).map((B) => B.value), q = a.purchaseOrder.items ?? [], L = await A(
813
+ x.map((B) => B._id),
814
+ (B) => {
815
+ const z = k.skuById[B], G = q.find((Y) => Y.sku._id === z._id);
816
+ if (G)
817
+ return G;
818
+ const ne = { amount: 1, precision: de(z.unit) };
819
+ let U = {
820
+ id: V.usePurchaseOrderV2 ? crypto.randomUUID() : void 0,
817
821
  sku: z,
818
822
  code: z.code,
819
823
  name: z.name,
820
- quantity: le,
821
- minimumQuantity: le,
824
+ quantity: ne,
825
+ minimumQuantity: ne,
822
826
  // maximumQuantity: adjustmentAmountMultiplyDecimal(minimumQuantity, {
823
827
  // amount: 100,
824
828
  // precision: 0
825
829
  // }),
826
- quantityStep: le
830
+ quantityStep: ne
827
831
  };
828
- return i.validateUnitInput(
829
- R,
832
+ return s.validateUnitInput(
833
+ U,
830
834
  z,
831
835
  {
832
- amount: le,
836
+ amount: ne,
833
837
  measurement: null
834
838
  },
835
839
  (Y) => {
836
- R.code = Y.code;
840
+ U.code = Y.code;
837
841
  }
838
- ), R;
842
+ ), U;
839
843
  }
840
844
  );
841
845
  if (!L) return;
842
- const W = L.map((U) => U.sku._id), J = [];
843
- for (const U of W) {
844
- const z = q.filter((K) => K.sku._id === U);
846
+ const W = L.map((B) => B.sku._id), J = [];
847
+ for (const B of W) {
848
+ const z = q.filter((G) => G.sku._id === B);
845
849
  if (z.length > 0)
846
850
  J.push(...z);
847
851
  else {
848
- const K = L.find((le) => le.sku._id === U);
849
- K && J.push(K);
852
+ const G = L.find((ne) => ne.sku._id === B);
853
+ G && J.push(G);
850
854
  }
851
855
  }
852
- J.sort((U, z) => U.sku.code.localeCompare(z.sku.code)), r.purchaseOrder.items = J;
856
+ J.sort((B, z) => B.sku.code.localeCompare(z.sku.code)), a.purchaseOrder.items = J;
853
857
  }
854
- return (c, x) => {
855
- const q = E("FmTextField"), L = E("FmSelect"), W = E("FmTextarea"), J = E("FmButton"), U = E("FmTable"), z = E("FmFormGroup"), K = E("FmForm");
856
- return w(), se(K, {
858
+ return (y, x) => {
859
+ const q = E("FmTextField"), L = E("FmSelect"), W = E("FmTextarea"), J = E("FmButton"), B = E("FmTable"), z = E("FmFormGroup"), G = E("FmForm");
860
+ return S(), se(G, {
857
861
  ref_key: "formRef",
858
862
  ref: I,
859
863
  class: "flex flex-col gap-32",
860
- disabled: c.disabled
864
+ disabled: y.disabled
861
865
  }, {
862
866
  default: P(() => {
863
- var le;
867
+ var ne;
864
868
  return [
865
869
  t("div", wo, [
866
870
  t("div", Io, [
867
871
  u(q, {
868
872
  label: e(h)("inventory.transfer.form.name"),
869
873
  "label-mark": "required",
870
- modelValue: e(r).name,
871
- "onUpdate:modelValue": x[0] || (x[0] = (R) => e(r).name = R),
874
+ modelValue: e(a).name,
875
+ "onUpdate:modelValue": x[0] || (x[0] = (U) => e(a).name = U),
872
876
  rules: [e(ce)()]
873
877
  }, null, 8, ["label", "modelValue", "rules"]),
874
878
  u(L, {
875
879
  label: e(h)("inventory.transfer.form.type.title"),
876
- "model-value": _.value,
877
- "onUpdate:modelValue": x[1] || (x[1] = (R) => _.value = R),
880
+ "model-value": p.value,
881
+ "onUpdate:modelValue": x[1] || (x[1] = (U) => p.value = U),
878
882
  items: [
879
883
  {
880
884
  label: e(h)("inventory.transfer.form.type.purchase"),
881
885
  value: e(X).enum.purchase,
882
- disabled: !e(f).locationOptionsTypePurchase.value.length,
883
- sublabel: e(f).locationOptionsTypePurchase.value.length ? void 0 : e(h)("inventory.transfer.form.noSupplierAvailable")
886
+ disabled: !e(i).locationOptionsTypePurchase.value.length,
887
+ sublabel: e(i).locationOptionsTypePurchase.value.length ? void 0 : e(h)("inventory.transfer.form.noSupplierAvailable")
884
888
  },
885
889
  {
886
890
  label: e(h)("inventory.transfer.form.type.transfer"),
887
891
  value: e(X).enum.transfer,
888
- disabled: !e(f).locationOptionsTypeTransfer.value.length,
889
- sublabel: e(f).locationOptionsTypeTransfer.value.length ? void 0 : e(h)("inventory.transfer.form.noLocationAvailable")
892
+ disabled: !e(i).locationOptionsTypeTransfer.value.length,
893
+ sublabel: e(i).locationOptionsTypeTransfer.value.length ? void 0 : e(h)("inventory.transfer.form.noLocationAvailable")
890
894
  }
891
895
  ],
892
896
  rules: [e(ke)(1)(D.value)]
@@ -895,36 +899,36 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
895
899
  t("span", {
896
900
  class: oe([
897
901
  "line-clamp-1 fm-typo-en-body-lg-400",
898
- c.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
902
+ y.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
899
903
  ])
900
- }, S(e(Et)(_.value)), 3)
904
+ }, F(e(Et)(p.value)), 3)
901
905
  ]),
902
906
  _: 1
903
907
  }, 8, ["label", "model-value", "items", "rules"]),
904
908
  u(L, {
905
- label: _.value === e(X).enum.purchase ? e(h)("inventory.transfer.form.purchaseFrom") : e(h)("inventory.transfer.form.transferFrom"),
906
- modelValue: g.value,
907
- "onUpdate:modelValue": x[2] || (x[2] = (R) => g.value = R),
909
+ label: p.value === e(X).enum.purchase ? e(h)("inventory.transfer.form.purchaseFrom") : e(h)("inventory.transfer.form.transferFrom"),
910
+ modelValue: _.value,
911
+ "onUpdate:modelValue": x[2] || (x[2] = (U) => _.value = U),
908
912
  items: D.value
909
913
  }, {
910
- "menu-wrapper": P((R) => {
914
+ "menu-wrapper": P((U) => {
911
915
  var Y;
912
916
  return [
913
- u(mt, Me(R, {
917
+ u(mt, Ee(U, {
914
918
  items: D.value,
915
- "model-value": (Y = c.modelValue.purchaseOrder.supplier) == null ? void 0 : Y._id
919
+ "model-value": (Y = y.modelValue.purchaseOrder.supplier) == null ? void 0 : Y._id
916
920
  }), null, 16, ["items", "model-value"])
917
921
  ];
918
922
  }),
919
923
  default: P(() => {
920
- var R;
924
+ var U;
921
925
  return [
922
926
  t("span", {
923
927
  class: oe([
924
928
  "line-clamp-1 fm-typo-en-body-lg-400",
925
- c.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
929
+ y.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
926
930
  ])
927
- }, S((R = D.value.find((Y) => Y.value === g.value)) == null ? void 0 : R.label), 3)
931
+ }, F((U = D.value.find((Y) => Y.value === _.value)) == null ? void 0 : U.label), 3)
928
932
  ];
929
933
  }),
930
934
  _: 1
@@ -932,16 +936,16 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
932
936
  u(q, {
933
937
  label: e(h)("inventory.transfer.form.reference"),
934
938
  "label-mark": "optional",
935
- modelValue: e(r).purchaseOrder.ref,
936
- "onUpdate:modelValue": x[3] || (x[3] = (R) => e(r).purchaseOrder.ref = R)
939
+ modelValue: e(a).purchaseOrder.ref,
940
+ "onUpdate:modelValue": x[3] || (x[3] = (U) => e(a).purchaseOrder.ref = U)
937
941
  }, null, 8, ["label", "modelValue"]),
938
942
  u(W, {
939
943
  label: e(h)("inventory.transfer.form.remark"),
940
944
  "label-mark": "optional",
941
945
  "max-length": 240,
942
- modelValue: C.value,
943
- "onUpdate:modelValue": x[4] || (x[4] = (R) => C.value = R),
944
- class: oe({ "text-fm-color-typo-disabled": c.disabled })
946
+ modelValue: w.value,
947
+ "onUpdate:modelValue": x[4] || (x[4] = (U) => w.value = U),
948
+ class: oe({ "text-fm-color-typo-disabled": y.disabled })
945
949
  }, null, 8, ["label", "modelValue", "class"])
946
950
  ])
947
951
  ]),
@@ -949,53 +953,53 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
949
953
  t("div", Co, [
950
954
  x[8] || (x[8] = t("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
951
955
  u(J, {
952
- disabled: c.disabled,
956
+ disabled: y.disabled,
953
957
  label: "Select location",
954
958
  "prepend-icon": "add",
955
959
  variant: "plain",
956
960
  class: "border-2 rounded-lg border-fm-color-primary",
957
- onClick: e(y)
961
+ onClick: e(g)
958
962
  }, null, 8, ["disabled", "onClick"])
959
963
  ]),
960
- u(U, {
961
- "column-defs": e(b),
962
- "row-data": e(n),
964
+ u(B, {
965
+ "column-defs": e(v),
966
+ "row-data": e(l),
963
967
  "shrink-at": 9999,
964
- onRowClick: e(y),
968
+ onRowClick: e(g),
965
969
  "hide-footer": ""
966
970
  }, null, 8, ["column-defs", "row-data", "onRowClick"]),
967
971
  t("div", Oo, [
968
972
  u(z, {
969
973
  "model-value": [
970
- (le = a.modelValue.purchaseOrder.supplier) == null ? void 0 : le._id,
971
- ...a.modelValue.locations ?? []
974
+ (ne = r.modelValue.purchaseOrder.supplier) == null ? void 0 : ne._id,
975
+ ...r.modelValue.locations ?? []
972
976
  ].join(","),
973
- rules: [p]
977
+ rules: [f]
974
978
  }, null, 8, ["model-value", "rules"])
975
979
  ])
976
980
  ]),
977
- t("div", Vo, [
978
- t("div", Mo, [
979
- t("div", Eo, S(e(h)("inventory.transfer.form.items.title")), 1),
980
- e(s).isEnabled ? (w(), se(J, {
981
+ t("div", Mo, [
982
+ t("div", Vo, [
983
+ t("div", Eo, F(e(h)("inventory.transfer.form.items.title")), 1),
984
+ e(m).isEnabled ? (S(), se(J, {
981
985
  key: 0,
982
986
  label: "Check NetSuite",
983
987
  "prepend-icon": "troubleshoot",
984
988
  variant: "secondary",
985
- onClick: m,
989
+ onClick: c,
986
990
  size: "md"
987
991
  })) : j("", !0),
988
992
  u(J, {
989
- disabled: c.disabled,
993
+ disabled: y.disabled,
990
994
  label: e(h)("inventory.transfer.form.items.addItem"),
991
995
  "prepend-icon": "add",
992
996
  variant: "plain",
993
997
  class: "border-2 rounded-lg border-fm-color-primary",
994
- onClick: x[5] || (x[5] = (R) => N()),
998
+ onClick: x[5] || (x[5] = (U) => N()),
995
999
  size: "md"
996
1000
  }, null, 8, ["disabled", "label"])
997
1001
  ]),
998
- e(s).isEnabled ? (w(), O("div", Do, x[9] || (x[9] = [
1002
+ e(m).isEnabled ? (S(), C("div", Do, x[9] || (x[9] = [
999
1003
  ie(" NetSuite is enabled. "),
1000
1004
  t("ul", { style: { "list-style": "initial", "margin-left": "20px" } }, [
1001
1005
  t("li", null, ' When adding new item or changing UOM, the first match available custom code (if any) will be applied to "Code" for each item by default. '),
@@ -1005,38 +1009,38 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1005
1009
  ]))) : j("", !0),
1006
1010
  t("div", Ao, [
1007
1011
  t("p", qo, [
1008
- ie(' Set "' + S(e(h)("inventory.transfer.form.items.table.DefaultAmount")) + '" to "0" to mark the item as ', 1),
1012
+ ie(' Set "' + F(e(h)("inventory.transfer.form.items.table.DefaultAmount")) + '" to "0" to mark the item as ', 1),
1009
1013
  x[10] || (x[10] = t("b", null, "optional", -1)),
1010
1014
  x[11] || (x[11] = ie(" when creating an order request. "))
1011
1015
  ]),
1012
1016
  x[12] || (x[12] = t("p", null, ' You can leave "Max" empty to remove the limit on the maximum quantity of the item when creating an order request. ', -1))
1013
1017
  ]),
1014
- (w(), se(U, {
1018
+ (S(), se(B, {
1015
1019
  "column-defs": te.value,
1016
- "row-data": e(r).purchaseOrder.items,
1017
- key: e(r).purchaseOrder.items.map((R) => R.sku._id).join("."),
1020
+ "row-data": e(a).purchaseOrder.items,
1021
+ key: e(a).purchaseOrder.items.map((U) => U.sku._id).join("."),
1018
1022
  "hide-footer": "",
1019
- "page-size": e(r).purchaseOrder.items.length
1023
+ "page-size": e(a).purchaseOrder.items.length
1020
1024
  }, {
1021
- "table-row": P((R) => [
1025
+ "table-row": P((U) => [
1022
1026
  u(So, {
1023
- row: R,
1024
- errorMessage: v.value[R.index],
1025
- "onUpdate:item": x[6] || (x[6] = (Y) => B.value.updateItem(Y)),
1026
- disabled: c.disabled
1027
+ row: U,
1028
+ errorMessage: b.value[U.index],
1029
+ "onUpdate:item": x[6] || (x[6] = (Y) => R.value.updateItem(Y)),
1030
+ disabled: y.disabled
1027
1031
  }, null, 8, ["row", "errorMessage", "disabled"])
1028
1032
  ]),
1029
- "list-row": P((R) => [
1030
- (w(), se(ut, {
1031
- row: R,
1032
- key: e(r).purchaseOrder.items.map((Y) => Y.sku._id).join(".")
1033
+ "list-row": P((U) => [
1034
+ (S(), se(ut, {
1035
+ row: U,
1036
+ key: e(a).purchaseOrder.items.map((Y) => Y.sku._id).join(".")
1033
1037
  }, {
1034
1038
  default: P((Y) => [
1035
1039
  u(xo, {
1036
- row: R,
1040
+ row: U,
1037
1041
  "cell-by-col-id": Y,
1038
- "onUpdate:item": x[7] || (x[7] = (be) => B.value.updateItem(be)),
1039
- disabled: c.disabled
1042
+ "onUpdate:item": x[7] || (x[7] = (be) => R.value.updateItem(be)),
1043
+ disabled: y.disabled
1040
1044
  }, null, 8, ["row", "cell-by-col-id", "disabled"])
1041
1045
  ]),
1042
1046
  _: 2
@@ -1045,7 +1049,7 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1045
1049
  _: 1
1046
1050
  }, 8, ["column-defs", "row-data", "page-size"])),
1047
1051
  u(z, {
1048
- "model-value": e(r).purchaseOrder.items.length,
1052
+ "model-value": e(a).purchaseOrder.items.length,
1049
1053
  rules: [e(ke)(1)]
1050
1054
  }, null, 8, ["model-value", "rules"])
1051
1055
  ])
@@ -1055,9 +1059,9 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1055
1059
  }, 8, ["disabled"]);
1056
1060
  };
1057
1061
  }
1058
- }), Bo = { class: "flex items-center" }, Uo = { class: "fm-typo-en-title-md-800" }, Po = { class: "flex gap-4" }, No = /* @__PURE__ */ re({
1062
+ }), Ro = { class: "flex items-center" }, Bo = { class: "fm-typo-en-title-md-800" }, Po = { class: "flex gap-4" }, No = /* @__PURE__ */ ae({
1059
1063
  __name: "TransferTemplateDialog",
1060
- props: /* @__PURE__ */ Ge({
1064
+ props: /* @__PURE__ */ Ke({
1061
1065
  mode: {},
1062
1066
  modelValue: {},
1063
1067
  show: { type: Boolean }
@@ -1065,10 +1069,10 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1065
1069
  disabled: { type: Boolean },
1066
1070
  disabledModifiers: {}
1067
1071
  }),
1068
- emits: /* @__PURE__ */ Ge(["update:show", "submitted"], ["update:disabled"]),
1069
- setup(F, { expose: d, emit: l }) {
1070
- var y;
1071
- const a = F, o = l, r = Yt(), h = At(), { t: v } = pe(), T = st(a, "show");
1072
+ emits: /* @__PURE__ */ Ke(["update:show", "submitted"], ["update:disabled"]),
1073
+ setup($, { expose: d, emit: n }) {
1074
+ var g;
1075
+ const r = $, o = n, a = Yt(), h = At(), { t: b } = pe(), T = st(r, "show");
1072
1076
  function k() {
1073
1077
  return {
1074
1078
  _id: "",
@@ -1099,135 +1103,135 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1099
1103
  }
1100
1104
  };
1101
1105
  }
1102
- const M = H(a.modelValue ?? k()), $ = H(((y = a.modelValue) == null ? void 0 : y._id) ?? `${Math.random()}`);
1106
+ const O = H(r.modelValue ?? k()), V = H(((g = r.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1103
1107
  Fe(
1104
- () => a.show,
1105
- (b) => {
1106
- var n;
1107
- b && (M.value = a.modelValue ?? k(), $.value = ((n = a.modelValue) == null ? void 0 : n._id) ?? `${Math.random()}`);
1108
+ () => r.show,
1109
+ (v) => {
1110
+ var l;
1111
+ v && (O.value = r.modelValue ?? k(), V.value = `${((l = r.modelValue) == null ? void 0 : l._id) ?? ""}-${Math.random()}`);
1108
1112
  }
1109
1113
  );
1110
- const s = gt(F, "disabled"), i = V(() => {
1111
- switch (a.mode) {
1114
+ const m = gt($, "disabled"), s = M(() => {
1115
+ switch (r.mode) {
1112
1116
  case me.READ:
1113
1117
  return "";
1114
1118
  case me.CREATE:
1115
- return v("inventory.transfer.template.create.title");
1119
+ return b("inventory.transfer.template.create.title");
1116
1120
  case me.UPDATE:
1117
- return v("inventory.transfer.template.update.title");
1121
+ return b("inventory.transfer.template.update.title");
1118
1122
  }
1119
1123
  return "";
1120
- }), f = H();
1124
+ }), i = H();
1121
1125
  d({
1122
1126
  validateInputs: () => {
1123
- var b, n;
1124
- (n = (b = f.value) == null ? void 0 : b.validateInputs) == null || n.call(b);
1127
+ var v, l;
1128
+ (l = (v = i.value) == null ? void 0 : v.validateInputs) == null || l.call(v);
1125
1129
  },
1126
1130
  resetInputsValidation: () => {
1127
- var b, n;
1128
- (n = (b = f.value) == null ? void 0 : b.resetInputsValidation) == null || n.call(b);
1131
+ var v, l;
1132
+ (l = (v = i.value) == null ? void 0 : v.resetInputsValidation) == null || l.call(v);
1129
1133
  },
1130
1134
  resetInputs: () => {
1131
- var b, n;
1132
- (n = (b = f.value) == null ? void 0 : b.resetInputs) == null || n.call(b);
1135
+ var v, l;
1136
+ (l = (v = i.value) == null ? void 0 : v.resetInputs) == null || l.call(v);
1133
1137
  }
1134
1138
  });
1135
- async function _() {
1136
- var n, p;
1137
- const b = M.value;
1138
- if (b) {
1139
- s.value = !0, (((n = b.purchaseOrder.supplier) == null ? void 0 : n.internal) === xe.enum.warehouse || ((p = b.purchaseOrder.supplier) == null ? void 0 : p.internal) === xe.enum.restaurant) && (b.purchaseOrder.items = b.purchaseOrder.items.map(
1140
- ({ totalCost: C, ...I }) => I
1139
+ async function p() {
1140
+ var l, f;
1141
+ const v = O.value;
1142
+ if (v) {
1143
+ m.value = !0, (((l = v.purchaseOrder.supplier) == null ? void 0 : l.internal) === xe.enum.warehouse || ((f = v.purchaseOrder.supplier) == null ? void 0 : f.internal) === xe.enum.restaurant) && (v.purchaseOrder.items = v.purchaseOrder.items.map(
1144
+ ({ totalCost: w, ...I }) => I
1141
1145
  ));
1142
1146
  try {
1143
- await r.createTemplate(b), await new Promise((C) => setTimeout(C, 1e3)), h.open({
1144
- title: v("inventory.transfer.template.create.success"),
1145
- message: v("inventory.transfer.template.create.successMessage"),
1147
+ await a.createTemplate(v), await new Promise((w) => setTimeout(w, 1e3)), h.open({
1148
+ title: b("inventory.transfer.template.create.success"),
1149
+ message: b("inventory.transfer.template.create.successMessage"),
1146
1150
  type: "success"
1147
1151
  }), o("update:show", !1), o("submitted");
1148
- } catch (C) {
1152
+ } catch (w) {
1149
1153
  h.open({
1150
- title: v("inventory.transfer.template.create.error"),
1151
- message: v("inventory.transfer.template.create.errorMessage"),
1154
+ title: b("inventory.transfer.template.create.error"),
1155
+ message: b("inventory.transfer.template.create.errorMessage"),
1152
1156
  type: "error"
1153
- }), console.error("Error in creating transfer template", C);
1157
+ }), console.error("Error in creating transfer template", w);
1154
1158
  } finally {
1155
- s.value = !1;
1159
+ m.value = !1;
1156
1160
  }
1157
1161
  }
1158
1162
  }
1159
1163
  async function D() {
1160
- var n, p;
1161
- const b = M.value;
1162
- if (b) {
1163
- s.value = !0, (((n = b.purchaseOrder.supplier) == null ? void 0 : n.internal) === xe.enum.warehouse || ((p = b.purchaseOrder.supplier) == null ? void 0 : p.internal) === xe.enum.restaurant) && (b.purchaseOrder.items = b.purchaseOrder.items.map(
1164
- ({ totalCost: C, ...I }) => I
1164
+ var l, f;
1165
+ const v = O.value;
1166
+ if (v) {
1167
+ m.value = !0, (((l = v.purchaseOrder.supplier) == null ? void 0 : l.internal) === xe.enum.warehouse || ((f = v.purchaseOrder.supplier) == null ? void 0 : f.internal) === xe.enum.restaurant) && (v.purchaseOrder.items = v.purchaseOrder.items.map(
1168
+ ({ totalCost: w, ...I }) => I
1165
1169
  ));
1166
1170
  try {
1167
- await r.updateTemplate(b), await new Promise((C) => setTimeout(C, 1e3)), h.open({
1168
- title: v("inventory.transfer.template.update.success"),
1169
- message: v("inventory.transfer.template.update.successMessage"),
1171
+ await a.updateTemplate(v), await new Promise((w) => setTimeout(w, 1e3)), h.open({
1172
+ title: b("inventory.transfer.template.update.success"),
1173
+ message: b("inventory.transfer.template.update.successMessage"),
1170
1174
  type: "success"
1171
1175
  }), o("update:show", !1), o("submitted");
1172
- } catch (C) {
1176
+ } catch (w) {
1173
1177
  h.open({
1174
- title: v("inventory.transfer.template.update.error"),
1175
- message: v("inventory.transfer.template.update.errorMessage"),
1178
+ title: b("inventory.transfer.template.update.error"),
1179
+ message: b("inventory.transfer.template.update.errorMessage"),
1176
1180
  type: "error"
1177
- }), console.error("Error in updating transfer template", C);
1181
+ }), console.error("Error in updating transfer template", w);
1178
1182
  } finally {
1179
- s.value = !1;
1183
+ m.value = !1;
1180
1184
  }
1181
1185
  }
1182
1186
  }
1183
- function g() {
1184
- switch (a.mode) {
1187
+ function _() {
1188
+ switch (r.mode) {
1185
1189
  case me.CREATE:
1186
- return _();
1190
+ return p();
1187
1191
  case me.UPDATE:
1188
1192
  return D();
1189
1193
  }
1190
1194
  }
1191
- function m() {
1192
- var b, n;
1193
- (n = (b = f.value) == null ? void 0 : b.validateInputs) == null || n.call(b);
1195
+ function c() {
1196
+ var v, l;
1197
+ (l = (v = i.value) == null ? void 0 : v.validateInputs) == null || l.call(v);
1194
1198
  }
1195
- return (b, n) => {
1196
- const p = E("FmButton"), C = E("FmSideSheet");
1197
- return w(), se(C, {
1199
+ return (v, l) => {
1200
+ const f = E("FmButton"), w = E("FmSideSheet");
1201
+ return S(), se(w, {
1198
1202
  modelValue: e(T),
1199
- "onUpdate:modelValue": n[3] || (n[3] = (I) => tt(T) ? T.value = I : null),
1203
+ "onUpdate:modelValue": l[3] || (l[3] = (I) => tt(T) ? T.value = I : null),
1200
1204
  "dismiss-away": "",
1201
1205
  "close-button": "",
1202
1206
  "max-width": 1600
1203
1207
  }, {
1204
1208
  "side-sheet-header": P(() => [
1205
- t("div", Bo, [
1206
- t("div", Uo, S(i.value), 1)
1209
+ t("div", Ro, [
1210
+ t("div", Bo, F(s.value), 1)
1207
1211
  ])
1208
1212
  ]),
1209
1213
  default: P(() => [
1210
- (w(), se(Ro, {
1214
+ (S(), se(Uo, {
1211
1215
  class: "w-full",
1212
1216
  ref_key: "formRef",
1213
- ref: f,
1214
- onValidationSuccess: g,
1215
- "model-value": M.value,
1216
- "onUpdate:modelValue": n[0] || (n[0] = (I) => M.value = I),
1217
- disabled: s.value,
1218
- "onUpdate:disabled": n[1] || (n[1] = (I) => s.value = I),
1219
- key: $.value
1217
+ ref: i,
1218
+ onValidationSuccess: _,
1219
+ "model-value": O.value,
1220
+ "onUpdate:modelValue": l[0] || (l[0] = (I) => O.value = I),
1221
+ disabled: m.value,
1222
+ "onUpdate:disabled": l[1] || (l[1] = (I) => m.value = I),
1223
+ key: V.value
1220
1224
  }, null, 8, ["model-value", "disabled"]))
1221
1225
  ]),
1222
1226
  "side-sheet-footer": P(() => [
1223
1227
  t("div", Po, [
1224
- u(Gt, {
1225
- loading: s.value,
1226
- label: e(v)("common.save"),
1227
- "confirm-title": `Save ${a.mode === e(me).CREATE ? "Template" : "Changes"}`,
1228
- onConfirm: m
1228
+ u(Kt, {
1229
+ loading: m.value,
1230
+ label: e(b)("common.save"),
1231
+ "confirm-title": `Save ${r.mode === e(me).CREATE ? "Template" : "Changes"}`,
1232
+ onConfirm: c
1229
1233
  }, {
1230
- "dialog-content": P(() => n[4] || (n[4] = [
1234
+ "dialog-content": P(() => l[4] || (l[4] = [
1231
1235
  t("div", { class: "fm-typo-en-body-md-400 bg-fm-color-primary-oats p-8 rounded" }, [
1232
1236
  ie(" Warning: This action "),
1233
1237
  t("span", { class: "text-fm-color-system-error-300" }, "will not"),
@@ -1236,11 +1240,11 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1236
1240
  ])),
1237
1241
  _: 1
1238
1242
  }, 8, ["loading", "label", "confirm-title"]),
1239
- u(p, {
1240
- disabled: s.value,
1243
+ u(f, {
1244
+ disabled: m.value,
1241
1245
  variant: "tertiary",
1242
- label: e(v)("common.close"),
1243
- onClick: n[2] || (n[2] = (I) => o("update:show", !1))
1246
+ label: e(b)("common.close"),
1247
+ onClick: l[2] || (l[2] = (I) => o("update:show", !1))
1244
1248
  }, null, 8, ["disabled", "label"])
1245
1249
  ])
1246
1250
  ]),
@@ -1248,16 +1252,16 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1248
1252
  }, 8, ["modelValue"]);
1249
1253
  };
1250
1254
  }
1251
- }), Lo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, Qo = { class: "flex justify-between" }, zo = { class: "fm-typo-en-body-lg-600" }, jo = { class: "fm-status-badge fm-status-badge-info-secondary" }, Ho = { class: "flex flex-col gap-8" }, Wo = { class: "flex flex-col gap-4" }, Yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Go = { class: "flex gap-1" }, Ko = { class: "fm-typo-en-body-lg-600" }, Zo = {
1255
+ }), Lo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, Qo = { class: "flex justify-between" }, zo = { class: "fm-typo-en-body-lg-600" }, jo = { class: "fm-status-badge fm-status-badge-info-secondary" }, Ho = { class: "flex flex-col gap-8" }, Wo = { class: "flex flex-col gap-4" }, Yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ko = { class: "flex gap-1" }, Go = { class: "fm-typo-en-body-lg-600" }, Zo = {
1252
1256
  key: 0,
1253
1257
  class: "flex flex-col gap-4"
1254
1258
  }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xo = { class: "flex gap-1" }, es = { class: "fm-typo-en-body-lg-600" }, ts = {
1255
1259
  key: 1,
1256
1260
  class: "flex flex-col gap-4"
1257
- }, os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ss = { class: "fm-typo-en-body-lg-600" }, ls = {
1261
+ }, os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ss = { class: "fm-typo-en-body-lg-600" }, ns = {
1258
1262
  key: 2,
1259
1263
  class: "flex flex-col gap-4"
1260
- }, ns = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, as = { class: "fm-typo-en-body-lg-600" }, rs = {
1264
+ }, ls = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rs = { class: "fm-typo-en-body-lg-600" }, as = {
1261
1265
  key: 3,
1262
1266
  class: "flex flex-col gap-4"
1263
1267
  }, is = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ds = { class: "fm-typo-en-body-lg-600" }, us = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, ms = { class: "flex flex-col gap-8" }, cs = { class: "fm-typo-en-body-lg-600" }, ps = { class: "flex w-full gap-4" }, fs = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, ys = { class: "fm-typo-en-body-lg-600 shrink-0" }, vs = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, bs = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, hs = {
@@ -1266,85 +1270,85 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1266
1270
  }, _s = {
1267
1271
  key: 0,
1268
1272
  class: "flex gap-4 items-center"
1269
- }, gs = { class: "flex flex-col gap-12" }, xs = { class: "flex flex-col gap-8" }, ks = { class: "flex gap-8 xs:flex-col" }, $s = /* @__PURE__ */ re({
1273
+ }, gs = { class: "flex flex-col gap-12" }, xs = { class: "flex flex-col gap-8" }, ks = { class: "flex gap-8 xs:flex-col" }, $s = /* @__PURE__ */ ae({
1270
1274
  __name: "TransferTemplateDetails",
1271
1275
  props: {
1272
1276
  template: {},
1273
1277
  show: { type: Boolean }
1274
1278
  },
1275
1279
  emits: ["update:show", "action:edit"],
1276
- setup(F, { emit: d }) {
1277
- const l = F, a = d, o = $e(), { t: r } = pe(), h = V(() => {
1278
- var s;
1279
- return (s = l.template) == null ? void 0 : s.purchaseOrder;
1280
- }), v = [
1280
+ setup($, { emit: d }) {
1281
+ const n = $, r = d, o = $e(), { t: a } = pe(), h = M(() => {
1282
+ var m;
1283
+ return (m = n.template) == null ? void 0 : m.purchaseOrder;
1284
+ }), b = [
1281
1285
  { accessorKey: "name", header: () => "Name" },
1282
1286
  { accessorKey: "type", header: () => "Type" }
1283
- ], T = H(""), k = V(
1287
+ ], T = H(""), k = M(
1284
1288
  () => {
1285
- var s, i, f, _;
1286
- return ((i = (s = h.value) == null ? void 0 : s.supplier) == null ? void 0 : i.internal) === "restaurant" || ((_ = (f = h.value) == null ? void 0 : f.supplier) == null ? void 0 : _.internal) === "warehouse" ? X.enum.transfer : X.enum.purchase;
1289
+ var m, s, i, p;
1290
+ return ((s = (m = h.value) == null ? void 0 : m.supplier) == null ? void 0 : s.internal) === "restaurant" || ((p = (i = h.value) == null ? void 0 : i.supplier) == null ? void 0 : p.internal) === "warehouse" ? X.enum.transfer : X.enum.purchase;
1287
1291
  }
1288
- ), M = H(!0), $ = st(l, "show");
1289
- return (s, i) => {
1290
- var n;
1291
- const f = E("FmMenuDivider"), _ = E("FmCard"), D = E("FmIcon"), g = E("FmTextField"), m = E("FmTable"), y = E("FmButton"), b = E("FmSideSheet");
1292
- return w(), se(b, {
1293
- header: e(r)("inventory.transfer.template.details.view", { template: (n = s.template) == null ? void 0 : n.name }),
1294
- modelValue: e($),
1295
- "onUpdate:modelValue": i[2] || (i[2] = (p) => tt($) ? $.value = p : null),
1296
- "dismiss-away": M.value,
1292
+ ), O = H(!0), V = st(n, "show");
1293
+ return (m, s) => {
1294
+ var l;
1295
+ const i = E("FmMenuDivider"), p = E("FmCard"), D = E("FmIcon"), _ = E("FmTextField"), c = E("FmTable"), g = E("FmButton"), v = E("FmSideSheet");
1296
+ return S(), se(v, {
1297
+ header: e(a)("inventory.transfer.template.details.view", { template: (l = m.template) == null ? void 0 : l.name }),
1298
+ modelValue: e(V),
1299
+ "onUpdate:modelValue": s[2] || (s[2] = (f) => tt(V) ? V.value = f : null),
1300
+ "dismiss-away": O.value,
1297
1301
  "close-button": "",
1298
1302
  "max-width": 1200
1299
1303
  }, {
1300
1304
  default: P(() => {
1301
- var p, C;
1305
+ var f, w;
1302
1306
  return [
1303
1307
  t("div", Lo, [
1304
1308
  t("div", null, [
1305
- u(_, {
1309
+ u(p, {
1306
1310
  variant: "outlined",
1307
1311
  class: "flex flex-col gap-8 px-12 py-16"
1308
1312
  }, {
1309
1313
  default: P(() => {
1310
- var I, B, ee, te, A, N, c, x, q;
1314
+ var I, R, ee, te, A, N, y, x, q;
1311
1315
  return [
1312
1316
  t("div", Qo, [
1313
- t("div", zo, S(e(r)("inventory.transfer.template.details.templateSummary")), 1),
1314
- t("div", jo, S(e(r)(
1317
+ t("div", zo, F(e(a)("inventory.transfer.template.details.templateSummary")), 1),
1318
+ t("div", jo, F(e(a)(
1315
1319
  `inventory.transfer.receiveRequest.details.type.${k.value.toLocaleLowerCase("en-US")}`
1316
1320
  )), 1)
1317
1321
  ]),
1318
- u(f),
1322
+ u(i),
1319
1323
  t("div", Ho, [
1320
1324
  t("div", Wo, [
1321
1325
  t("div", Yo, [
1322
- t("div", Go, S(e(r)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1326
+ t("div", Ko, F(e(a)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1323
1327
  ]),
1324
- t("div", Ko, S(e(Kt)(((I = s.template) == null ? void 0 : I._id) ?? "")), 1)
1328
+ t("div", Go, F(e(Gt)(((I = m.template) == null ? void 0 : I._id) ?? "")), 1)
1325
1329
  ]),
1326
- (B = s.template) != null && B.updatedAt ? (w(), O("div", Zo, [
1330
+ (R = m.template) != null && R.updatedAt ? (S(), C("div", Zo, [
1327
1331
  t("div", Jo, [
1328
- t("div", Xo, S(e(r)("inventory.transfer.receiveRequest.details.updatedAt")), 1)
1332
+ t("div", Xo, F(e(a)("inventory.transfer.receiveRequest.details.updatedAt")), 1)
1329
1333
  ]),
1330
1334
  t("div", es, [
1331
- ie(S(e(ct)(new Date(s.template.updatedAt))) + " ", 1),
1332
- (ee = s.template.updatedBy) != null && ee.name ? (w(), O(ae, { key: 0 }, [
1333
- ie(" (" + S(s.template.updatedBy.name) + ") ", 1)
1335
+ ie(F(e(ct)(new Date(m.template.updatedAt))) + " ", 1),
1336
+ (ee = m.template.updatedBy) != null && ee.name ? (S(), C(re, { key: 0 }, [
1337
+ ie(" (" + F(m.template.updatedBy.name) + ") ", 1)
1334
1338
  ], 64)) : j("", !0)
1335
1339
  ])
1336
1340
  ])) : j("", !0),
1337
- (A = (te = h.value) == null ? void 0 : te.supplier) != null && A.name ? (w(), O("div", ts, [
1338
- t("div", os, S(e(r)("inventory.transfer.receiveRequest.details.from")), 1),
1339
- t("div", ss, S((c = (N = h.value) == null ? void 0 : N.supplier) == null ? void 0 : c.name), 1)
1341
+ (A = (te = h.value) == null ? void 0 : te.supplier) != null && A.name ? (S(), C("div", ts, [
1342
+ t("div", os, F(e(a)("inventory.transfer.receiveRequest.details.from")), 1),
1343
+ t("div", ss, F((y = (N = h.value) == null ? void 0 : N.supplier) == null ? void 0 : y.name), 1)
1340
1344
  ])) : j("", !0),
1341
- (x = h.value) != null && x.ref ? (w(), O("div", ls, [
1342
- t("div", ns, S(e(r)("inventory.transfer.receiveRequest.details.reference")), 1),
1343
- t("div", as, S(h.value.ref), 1)
1345
+ (x = h.value) != null && x.ref ? (S(), C("div", ns, [
1346
+ t("div", ls, F(e(a)("inventory.transfer.receiveRequest.details.reference")), 1),
1347
+ t("div", rs, F(h.value.ref), 1)
1344
1348
  ])) : j("", !0),
1345
- (q = h.value) != null && q.remark ? (w(), O("div", rs, [
1346
- t("div", is, S(e(r)("inventory.transfer.receiveRequest.details.remark")), 1),
1347
- t("div", ds, S(h.value.remark), 1)
1349
+ (q = h.value) != null && q.remark ? (S(), C("div", as, [
1350
+ t("div", is, F(e(a)("inventory.transfer.receiveRequest.details.remark")), 1),
1351
+ t("div", ds, F(h.value.remark), 1)
1348
1352
  ])) : j("", !0)
1349
1353
  ])
1350
1354
  ];
@@ -1354,51 +1358,51 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1354
1358
  ]),
1355
1359
  t("div", us, [
1356
1360
  t("div", ms, [
1357
- t("div", cs, S(e(r)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1358
- (w(!0), O(ae, null, ye(((p = h.value) == null ? void 0 : p.items) ?? [], (I) => (w(), O("div", {
1361
+ t("div", cs, F(e(a)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
1362
+ (S(!0), C(re, null, ye(((f = h.value) == null ? void 0 : f.items) ?? [], (I) => (S(), C("div", {
1359
1363
  key: I.code,
1360
1364
  class: "flex flex-col"
1361
1365
  }, [
1362
1366
  t("div", ps, [
1363
- t("div", fs, S(I.name), 1),
1364
- i[3] || (i[3] = t("div", { class: "flex-1 min-w-32" }, null, -1)),
1365
- t("div", ys, S(e(Tt)(I.quantity, I.sku.unit, I.measurement)), 1)
1367
+ t("div", fs, F(I.name), 1),
1368
+ s[3] || (s[3] = t("div", { class: "flex-1 min-w-32" }, null, -1)),
1369
+ t("div", ys, F(e(Tt)(I.quantity, I.sku.unit, I.measurement)), 1)
1366
1370
  ]),
1367
1371
  t("div", vs, [
1368
- t("div", bs, S(I.code), 1),
1369
- I.totalCost && e(o).enableTotalCost ? (w(), O("div", hs, " (" + S(e(Lt)(I.totalCost)) + ") ", 1)) : j("", !0)
1372
+ t("div", bs, F(I.code), 1),
1373
+ I.totalCost && e(o).enableTotalCost ? (S(), C("div", hs, " (" + F(e(Lt)(I.totalCost)) + ") ", 1)) : j("", !0)
1370
1374
  ]),
1371
- e(Ct)(I) ? (w(), O("div", _s, [
1375
+ e(Ct)(I) ? (S(), C("div", _s, [
1372
1376
  u(D, {
1373
1377
  name: "error",
1374
1378
  color: "system-error-300",
1375
1379
  size: "sm"
1376
1380
  }),
1377
- i[4] || (i[4] = t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400" }, " This item has invalid unit configuration. Apply update on this item. ", -1))
1381
+ s[4] || (s[4] = t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400" }, " This item has invalid unit configuration. Apply update on this item. ", -1))
1378
1382
  ])) : j("", !0)
1379
1383
  ]))), 128))
1380
1384
  ])
1381
1385
  ]),
1382
- i[6] || (i[6] = t("div", null, null, -1)),
1383
- i[7] || (i[7] = t("div", null, null, -1)),
1386
+ s[6] || (s[6] = t("div", null, null, -1)),
1387
+ s[7] || (s[7] = t("div", null, null, -1)),
1384
1388
  t("div", gs, [
1385
- i[5] || (i[5] = t("div", { class: "flex flex-col" }, [
1389
+ s[5] || (s[5] = t("div", { class: "flex flex-col" }, [
1386
1390
  t("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
1387
1391
  t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
1388
1392
  ], -1)),
1389
1393
  t("div", xs, [
1390
- u(g, {
1394
+ u(_, {
1391
1395
  modelValue: T.value,
1392
- "onUpdate:modelValue": i[0] || (i[0] = (I) => T.value = I),
1396
+ "onUpdate:modelValue": s[0] || (s[0] = (I) => T.value = I),
1393
1397
  placeholder: "Filter locations",
1394
1398
  "prepend-icon": "search"
1395
1399
  }, null, 8, ["modelValue"]),
1396
- u(m, {
1400
+ u(c, {
1397
1401
  "hide-footer": "",
1398
1402
  style: { height: "500px" },
1399
- "column-defs": v,
1403
+ "column-defs": b,
1400
1404
  "search-value": T.value,
1401
- "row-data": ((C = l.template) == null ? void 0 : C.locations) ?? [{ name: "All locations" }]
1405
+ "row-data": ((w = n.template) == null ? void 0 : w.locations) ?? [{ name: "All locations" }]
1402
1406
  }, null, 8, ["search-value", "row-data"])
1403
1407
  ])
1404
1408
  ])
@@ -1407,9 +1411,9 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1407
1411
  }),
1408
1412
  "side-sheet-footer": P(() => [
1409
1413
  t("div", ks, [
1410
- u(y, {
1411
- label: e(r)("common.edit"),
1412
- onClick: i[1] || (i[1] = (p) => a("action:edit")),
1414
+ u(g, {
1415
+ label: e(a)("common.edit"),
1416
+ onClick: s[1] || (s[1] = (f) => r("action:edit")),
1413
1417
  variant: "tertiary"
1414
1418
  }, null, 8, ["label"])
1415
1419
  ])
@@ -1424,104 +1428,104 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1424
1428
  }, ws = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, Is = { class: "flex-1 flex flex-col overflow-hidden" }, Ts = {
1425
1429
  key: 0,
1426
1430
  class: "flex-1 flex items-center justify-center"
1427
- }, Cs = { class: "text-center px-32" }, Os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-placeholder" }, Vs = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-border-default shrink-0" }, Ms = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Es = { class: "flex-1 overflow-y-auto divide-y divide-fm-color-border-default" }, Ds = ["onClick"], As = { class: "flex-1 min-w-0" }, qs = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, Rs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-2" }, Bs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary shrink-0" }, Us = { class: "px-16 py-10 border-t border-fm-color-border-default bg-fm-color-surface-secondary shrink-0" }, Ps = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ns = /* @__PURE__ */ re({
1431
+ }, Cs = { class: "text-center px-32" }, Os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-placeholder" }, Ms = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-border-default shrink-0" }, Vs = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Es = { class: "flex-1 overflow-y-auto divide-y divide-fm-color-border-default" }, Ds = ["onClick"], As = { class: "flex-1 min-w-0" }, qs = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary truncate" }, Us = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-2" }, Rs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary shrink-0" }, Bs = { class: "px-16 py-10 border-t border-fm-color-border-default bg-fm-color-surface-secondary shrink-0" }, Ps = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ns = /* @__PURE__ */ ae({
1428
1432
  __name: "TemplateItemBulkEditorStep1",
1429
- setup(F) {
1430
- const { t: d } = Ie(), l = we(), a = Se(), o = V(
1431
- () => l.skus.map((T) => ({
1433
+ setup($) {
1434
+ const { t: d } = Ie(), n = we(), r = Se(), o = M(
1435
+ () => n.skus.map((T) => ({
1432
1436
  label: T.name,
1433
1437
  sublabel: T.code,
1434
1438
  value: T._id
1435
1439
  }))
1436
- ), r = V({
1440
+ ), a = M({
1437
1441
  get: () => {
1438
1442
  var T;
1439
- return ((T = a.selectedSku) == null ? void 0 : T._id) ?? null;
1443
+ return ((T = r.selectedSku) == null ? void 0 : T._id) ?? null;
1440
1444
  },
1441
1445
  set: (T) => {
1442
1446
  if (!T) {
1443
- a.selectedSku = null, a.deselectAllTemplates();
1447
+ r.selectedSku = null, r.deselectAllTemplates();
1444
1448
  return;
1445
1449
  }
1446
- a.selectedSku = l.skuById[T] ?? null, a.selectAllTemplates();
1450
+ r.selectedSku = n.skuById[T] ?? null, r.selectAllTemplates();
1447
1451
  }
1448
- }), h = V(
1449
- () => a.candidateTemplates.length > 0 && a.candidateTemplates.every((T) => a.selectedTemplateIds.includes(T._id))
1452
+ }), h = M(
1453
+ () => r.candidateTemplates.length > 0 && r.candidateTemplates.every((T) => r.selectedTemplateIds.includes(T._id))
1450
1454
  );
1451
- function v() {
1452
- h.value ? a.deselectAllTemplates() : a.selectAllTemplates();
1455
+ function b() {
1456
+ h.value ? r.deselectAllTemplates() : r.selectAllTemplates();
1453
1457
  }
1454
1458
  return (T, k) => {
1455
- var f;
1456
- const M = E("FmSelect"), $ = E("FmIcon"), s = E("FmButton"), i = E("FmCheckbox");
1457
- return w(), O("div", Fs, [
1459
+ var i;
1460
+ const O = E("FmSelect"), V = E("FmIcon"), m = E("FmButton"), s = E("FmCheckbox");
1461
+ return S(), C("div", Fs, [
1458
1462
  t("div", Ss, [
1459
1463
  t("div", null, [
1460
- t("p", ws, S(e(d)("inventory.transfer.template.bulkEditor.step1.title")), 1)
1464
+ t("p", ws, F(e(d)("inventory.transfer.template.bulkEditor.step1.title")), 1)
1461
1465
  ]),
1462
- u(M, {
1463
- modelValue: r.value,
1464
- "onUpdate:modelValue": k[0] || (k[0] = (_) => r.value = _),
1466
+ u(O, {
1467
+ modelValue: a.value,
1468
+ "onUpdate:modelValue": k[0] || (k[0] = (p) => a.value = p),
1465
1469
  items: o.value,
1466
1470
  placeholder: e(d)("inventory.transfer.template.bulkEditor.step1.skuPlaceholder"),
1467
1471
  clearable: ""
1468
1472
  }, {
1469
- "menu-wrapper": P((_) => [
1470
- u(mt, Me(_, {
1473
+ "menu-wrapper": P((p) => [
1474
+ u(mt, Ee(p, {
1471
1475
  items: o.value,
1472
- "model-value": r.value
1476
+ "model-value": a.value
1473
1477
  }), null, 16, ["items", "model-value"])
1474
1478
  ]),
1475
1479
  _: 1
1476
1480
  }, 8, ["modelValue", "items", "placeholder"])
1477
1481
  ]),
1478
1482
  t("div", Is, [
1479
- !e(a).selectedSku || e(a).candidateTemplates.length === 0 ? (w(), O("div", Ts, [
1483
+ !e(r).selectedSku || e(r).candidateTemplates.length === 0 ? (S(), C("div", Ts, [
1480
1484
  t("div", Cs, [
1481
- u($, {
1485
+ u(V, {
1482
1486
  name: "list_alt",
1483
1487
  size: "lg",
1484
1488
  class: "text-fm-color-typo-placeholder mb-12"
1485
1489
  }),
1486
- t("p", Os, S(e(a).selectedSku ? e(d)("inventory.transfer.template.bulkEditor.step1.emptyNoMatch") : e(d)("inventory.transfer.template.bulkEditor.step1.emptyNoSku")), 1)
1490
+ t("p", Os, F(e(r).selectedSku ? e(d)("inventory.transfer.template.bulkEditor.step1.emptyNoMatch") : e(d)("inventory.transfer.template.bulkEditor.step1.emptyNoSku")), 1)
1487
1491
  ])
1488
- ])) : (w(), O(ae, { key: 1 }, [
1489
- t("div", Vs, [
1490
- t("span", Ms, S(e(d)("inventory.transfer.template.bulkEditor.step1.templatesContain", { count: e(a).candidateTemplates.length, sku: (f = e(a).selectedSku) == null ? void 0 : f.name }, e(a).candidateTemplates.length)), 1),
1491
- u(s, {
1492
+ ])) : (S(), C(re, { key: 1 }, [
1493
+ t("div", Ms, [
1494
+ t("span", Vs, F(e(d)("inventory.transfer.template.bulkEditor.step1.templatesContain", { count: e(r).candidateTemplates.length, sku: (i = e(r).selectedSku) == null ? void 0 : i.name }, e(r).candidateTemplates.length)), 1),
1495
+ u(m, {
1492
1496
  label: h.value ? e(d)("inventory.transfer.template.bulkEditor.step1.deselectAll") : e(d)("inventory.transfer.template.bulkEditor.step1.selectAll"),
1493
1497
  variant: "tertiary",
1494
1498
  size: "md",
1495
- onClick: v
1499
+ onClick: b
1496
1500
  }, null, 8, ["label"])
1497
1501
  ]),
1498
1502
  t("div", Es, [
1499
- (w(!0), O(ae, null, ye(e(a).candidateTemplates, (_) => (w(), O("div", {
1500
- key: _._id,
1503
+ (S(!0), C(re, null, ye(e(r).candidateTemplates, (p) => (S(), C("div", {
1504
+ key: p._id,
1501
1505
  class: "flex items-center gap-12 px-16 py-12 hover:bg-fm-color-surface-hover transition-colors cursor-pointer",
1502
- onClick: (D) => e(a).toggleTemplate(_._id)
1506
+ onClick: (D) => e(r).toggleTemplate(p._id)
1503
1507
  }, [
1504
- u(i, {
1508
+ u(s, {
1505
1509
  value: !0,
1506
- "model-value": e(a).selectedTemplateIds.includes(_._id),
1507
- "onUpdate:modelValue": (D) => e(a).toggleTemplate(_._id),
1510
+ "model-value": e(r).selectedTemplateIds.includes(p._id),
1511
+ "onUpdate:modelValue": (D) => e(r).toggleTemplate(p._id),
1508
1512
  onClick: k[1] || (k[1] = xt(() => {
1509
1513
  }, ["stop"]))
1510
1514
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1511
1515
  t("div", As, [
1512
- t("div", qs, S(_.name), 1),
1513
- t("div", Rs, [
1514
- ie(S(e(d)("inventory.transfer.template.bulkEditor.step1.from")) + " " + S(_.purchaseOrder.supplier.name) + " ", 1),
1515
- _.purchaseOrder.ref ? (w(), O(ae, { key: 0 }, [
1516
- ie(" · " + S(e(d)("inventory.transfer.template.bulkEditor.step1.ref")) + " " + S(_.purchaseOrder.ref), 1)
1516
+ t("div", qs, F(p.name), 1),
1517
+ t("div", Us, [
1518
+ ie(F(e(d)("inventory.transfer.template.bulkEditor.step1.from")) + " " + F(p.purchaseOrder.supplier.name) + " ", 1),
1519
+ p.purchaseOrder.ref ? (S(), C(re, { key: 0 }, [
1520
+ ie(" · " + F(e(d)("inventory.transfer.template.bulkEditor.step1.ref")) + " " + F(p.purchaseOrder.ref), 1)
1517
1521
  ], 64)) : j("", !0)
1518
1522
  ])
1519
1523
  ]),
1520
- t("span", Bs, S(e(d)("inventory.transfer.template.bulkEditor.step1.items", { count: _.purchaseOrder.items.length }, _.purchaseOrder.items.length)), 1)
1524
+ t("span", Rs, F(e(d)("inventory.transfer.template.bulkEditor.step1.items", { count: p.purchaseOrder.items.length }, p.purchaseOrder.items.length)), 1)
1521
1525
  ], 8, Ds))), 128))
1522
1526
  ]),
1523
- t("div", Us, [
1524
- t("span", Ps, S(e(d)("inventory.transfer.template.bulkEditor.step1.selectedCount", { selected: e(a).selectedTemplateIds.length, total: e(a).candidateTemplates.length })), 1)
1527
+ t("div", Bs, [
1528
+ t("span", Ps, F(e(d)("inventory.transfer.template.bulkEditor.step1.selectedCount", { selected: e(r).selectedTemplateIds.length, total: e(r).candidateTemplates.length })), 1)
1525
1529
  ])
1526
1530
  ], 64))
1527
1531
  ])
@@ -1531,164 +1535,164 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1531
1535
  }), Ls = { class: "flex flex-col gap-20 p-24 h-full overflow-y-auto" }, Qs = { class: "fm-typo-en-heading-sm-700 text-fm-color-typo-primary" }, zs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mt-4" }, js = {
1532
1536
  key: 0,
1533
1537
  class: "flex flex-col gap-16"
1534
- }, Hs = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary px-16 py-10 flex items-center gap-12" }, Ws = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Ys = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary ml-8" }, Gs = {
1538
+ }, Hs = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary px-16 py-10 flex items-center gap-12" }, Ws = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Ys = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary ml-8" }, Ks = {
1535
1539
  key: 0,
1536
1540
  class: "ml-auto"
1537
- }, Ks = { class: "grid grid-cols-2 gap-12" }, Zs = { class: "flex flex-col gap-4" }, Js = { class: "flex items-center gap-8" }, Xs = { class: "flex flex-col gap-4" }, el = { class: "flex items-center gap-8" }, tl = { class: "grid grid-cols-2 gap-12" }, ol = { class: "flex flex-col gap-4" }, sl = { class: "flex items-center gap-8" }, ll = { class: "flex flex-col gap-4" }, nl = { class: "flex items-center gap-8" }, al = { class: "flex flex-col gap-4" }, rl = { class: "flex items-center gap-8" }, il = /* @__PURE__ */ re({
1541
+ }, Gs = { class: "grid grid-cols-2 gap-12" }, Zs = { class: "flex flex-col gap-4" }, Js = { class: "flex items-center gap-8" }, Xs = { class: "flex flex-col gap-4" }, en = { class: "flex items-center gap-8" }, tn = { class: "grid grid-cols-2 gap-12" }, on = { class: "flex flex-col gap-4" }, sn = { class: "flex items-center gap-8" }, nn = { class: "flex flex-col gap-4" }, ln = { class: "flex items-center gap-8" }, rn = { class: "flex flex-col gap-4" }, an = { class: "flex items-center gap-8" }, dn = /* @__PURE__ */ ae({
1538
1542
  __name: "TemplateItemBulkEditorStep2",
1539
1543
  emits: ["validation-success"],
1540
- setup(F, { expose: d, emit: l }) {
1541
- const { t: a } = Ie(), o = Se(), r = Ee(), h = we(), v = V(
1544
+ setup($, { expose: d, emit: n }) {
1545
+ const { t: r } = Ie(), o = Se(), a = De(), h = we(), b = M(
1542
1546
  () => o.selectedSku ? h.skuById[o.selectedSku._id] ?? o.selectedSku : null
1543
- ), T = V(() => {
1544
- var n, p;
1545
- return (p = (n = v.value) == null ? void 0 : n.unit) != null && p._id ? h.unitById[v.value.unit._id] ?? null : null;
1546
- }), k = V({
1547
+ ), T = M(() => {
1548
+ var l, f;
1549
+ return (f = (l = b.value) == null ? void 0 : l.unit) != null && f._id ? h.unitById[b.value.unit._id] ?? null : null;
1550
+ }), k = M({
1547
1551
  get: () => o.editedItem.code ?? "",
1548
- set: (n) => {
1549
- o.editedItem = { ...o.editedItem, code: n };
1552
+ set: (l) => {
1553
+ o.editedItem = { ...o.editedItem, code: l };
1550
1554
  }
1551
- }), M = V({
1555
+ }), O = M({
1552
1556
  get: () => o.editedItem.name ?? "",
1553
- set: (n) => {
1554
- o.editedItem = { ...o.editedItem, name: n };
1557
+ set: (l) => {
1558
+ o.editedItem = { ...o.editedItem, name: l };
1555
1559
  }
1556
- }), $ = V({
1560
+ }), V = M({
1557
1561
  get: () => ({
1558
1562
  amount: o.editedItem.quantity ?? { amount: 1, precision: 0 },
1559
1563
  measurement: o.editedItem.measurement ?? null
1560
1564
  }),
1561
- set: (n) => {
1562
- n && (o.editedItem = {
1565
+ set: (l) => {
1566
+ l && (o.editedItem = {
1563
1567
  ...o.editedItem,
1564
- quantity: n.amount,
1565
- measurement: n.measurement ?? void 0
1568
+ quantity: l.amount,
1569
+ measurement: l.measurement ?? void 0
1566
1570
  });
1567
1571
  }
1568
- }), s = H(null);
1572
+ }), m = H(null);
1569
1573
  Fe(() => {
1570
- var n;
1571
- return (n = v.value) == null ? void 0 : n._id;
1574
+ var l;
1575
+ return (l = b.value) == null ? void 0 : l._id;
1572
1576
  }, () => {
1573
- s.value = null;
1577
+ m.value = null;
1574
1578
  });
1575
- const i = V({
1576
- get: () => s.value ?? Q(o.editedItem.quantityStep ?? { amount: 1, precision: 0 }, !1),
1577
- set: (n) => {
1578
- if (n.trim() === "" || ve()(n) !== !0) {
1579
- s.value = n;
1579
+ const s = M({
1580
+ get: () => m.value ?? Q(o.editedItem.quantityStep ?? { amount: 1, precision: 0 }, !1),
1581
+ set: (l) => {
1582
+ if (l.trim() === "" || ve()(l) !== !0) {
1583
+ m.value = l;
1580
1584
  return;
1581
1585
  }
1582
- s.value = null, o.editedItem = { ...o.editedItem, quantityStep: fe.fromNumber(+n) };
1586
+ m.value = null, o.editedItem = { ...o.editedItem, quantityStep: fe.fromNumber(+l) };
1583
1587
  }
1584
- }), f = V({
1588
+ }), i = M({
1585
1589
  get: () => ({
1586
1590
  min: o.editedItem.minimumQuantity ?? void 0,
1587
1591
  max: o.editedItem.maximumQuantity ?? void 0
1588
1592
  }),
1589
- set: (n) => {
1593
+ set: (l) => {
1590
1594
  o.editedItem = {
1591
1595
  ...o.editedItem,
1592
- minimumQuantity: (n == null ? void 0 : n.min) ?? null,
1593
- maximumQuantity: (n == null ? void 0 : n.max) ?? null
1596
+ minimumQuantity: (l == null ? void 0 : l.min) ?? null,
1597
+ maximumQuantity: (l == null ? void 0 : l.max) ?? null
1594
1598
  };
1595
1599
  }
1596
- }), _ = V(() => {
1600
+ }), p = M(() => {
1597
1601
  var I;
1598
- const n = o.editedItem, p = n.quantityStep ?? { amount: 1, precision: 0 }, C = (I = v.value) == null ? void 0 : I.unit;
1599
- return C ? [
1600
- rt(p),
1601
- ...+(Q(n.quantity ?? { amount: 0, precision: 0 }) ?? 0) > 0 ? [
1602
+ const l = o.editedItem, f = l.quantityStep ?? { amount: 1, precision: 0 }, w = (I = b.value) == null ? void 0 : I.unit;
1603
+ return w ? [
1604
+ at(f),
1605
+ ...+(Q(l.quantity ?? { amount: 0, precision: 0 }) ?? 0) > 0 ? [
1602
1606
  it(
1603
1607
  +(Q(
1604
- n.minimumQuantity ?? {
1608
+ l.minimumQuantity ?? {
1605
1609
  amount: 1,
1606
- precision: de(C, n.measurement)
1610
+ precision: de(w, l.measurement)
1607
1611
  }
1608
1612
  ) ?? 0)
1609
1613
  )
1610
1614
  ] : [],
1611
1615
  dt(
1612
- n.maximumQuantity ? +(Q(n.maximumQuantity) ?? 1 / 0) : 1 / 0
1616
+ l.maximumQuantity ? +(Q(l.maximumQuantity) ?? 1 / 0) : 1 / 0
1613
1617
  )
1614
1618
  ] : [];
1615
- }), D = V(() => v.value ? [
1619
+ }), D = M(() => b.value ? [
1616
1620
  ce(),
1617
1621
  ve(),
1618
1622
  ke({
1619
1623
  amount: 1,
1620
- precision: de(v.value.unit, o.editedItem.measurement)
1624
+ precision: de(b.value.unit, o.editedItem.measurement)
1621
1625
  }),
1622
- lt(v.value.unit, o.editedItem.measurement)
1623
- ] : []), g = V(() => v.value ? [
1626
+ nt(b.value.unit, o.editedItem.measurement)
1627
+ ] : []), _ = M(() => b.value ? [
1624
1628
  ft({ max: !1 }),
1625
1629
  vt(o.editedItem.quantityStep ?? { amount: 1, precision: 0 }),
1626
1630
  yt(
1627
1631
  +(Q({
1628
1632
  amount: 0,
1629
- precision: de(v.value.unit, o.editedItem.measurement)
1633
+ precision: de(b.value.unit, o.editedItem.measurement)
1630
1634
  }) ?? 0),
1631
1635
  1 / 0
1632
1636
  )
1633
- ] : []), m = l, y = H();
1637
+ ] : []), c = n, g = H();
1634
1638
  d({
1635
1639
  validateInputs: () => {
1636
- var n, p;
1637
- return (p = (n = y.value) == null ? void 0 : n.validateInputs) == null ? void 0 : p.call(n);
1640
+ var l, f;
1641
+ return (f = (l = g.value) == null ? void 0 : l.validateInputs) == null ? void 0 : f.call(l);
1638
1642
  }
1639
1643
  });
1640
- function b(n, p, C) {
1644
+ function v(l, f, w) {
1641
1645
  o.editedItem = {
1642
1646
  ...o.editedItem,
1643
- sku: n,
1644
- code: p,
1645
- measurement: C ?? o.editedItem.measurement
1647
+ sku: l,
1648
+ code: f,
1649
+ measurement: w ?? o.editedItem.measurement
1646
1650
  };
1647
1651
  const I = ["code"];
1648
- C !== void 0 && I.push("defaultAmount"), o.autoSelectFields(I);
1652
+ w !== void 0 && I.push("defaultAmount"), o.autoSelectFields(I);
1649
1653
  }
1650
- return (n, p) => {
1651
- const C = E("FmIcon"), I = E("FmCheckbox"), B = E("FmLabel"), ee = E("FmTextField"), te = E("FmForm");
1652
- return w(), O("div", Ls, [
1654
+ return (l, f) => {
1655
+ const w = E("FmIcon"), I = E("FmCheckbox"), R = E("FmLabel"), ee = E("FmTextField"), te = E("FmForm");
1656
+ return S(), C("div", Ls, [
1653
1657
  t("div", null, [
1654
- t("p", Qs, S(e(a)("inventory.transfer.template.bulkEditor.step2.title")), 1),
1655
- t("p", zs, S(e(a)("inventory.transfer.template.bulkEditor.step2.subtitle", { count: e(o).selectedTemplateIds.length }, e(o).selectedTemplateIds.length)), 1)
1658
+ t("p", Qs, F(e(r)("inventory.transfer.template.bulkEditor.step2.title")), 1),
1659
+ t("p", zs, F(e(r)("inventory.transfer.template.bulkEditor.step2.subtitle", { count: e(o).selectedTemplateIds.length }, e(o).selectedTemplateIds.length)), 1)
1656
1660
  ]),
1657
1661
  u(te, {
1658
1662
  ref_key: "formRef",
1659
- ref: y,
1660
- onValidationSuccess: p[10] || (p[10] = (A) => m("validation-success"))
1663
+ ref: g,
1664
+ onValidationSuccess: f[10] || (f[10] = (A) => c("validation-success"))
1661
1665
  }, {
1662
1666
  default: P(() => [
1663
- v.value ? (w(), O("div", js, [
1667
+ b.value ? (S(), C("div", js, [
1664
1668
  t("div", Hs, [
1665
- u(C, {
1669
+ u(w, {
1666
1670
  name: "inventory_2",
1667
1671
  size: "sm",
1668
1672
  class: "text-fm-color-typo-secondary"
1669
1673
  }),
1670
1674
  t("div", null, [
1671
- t("span", Ws, S(v.value.name), 1),
1672
- t("span", Ys, "(" + S(v.value.code) + ")", 1)
1675
+ t("span", Ws, F(b.value.name), 1),
1676
+ t("span", Ys, "(" + F(b.value.code) + ")", 1)
1673
1677
  ]),
1674
- e(r).isEnabled ? (w(), O("div", Gs, [
1678
+ e(a).isEnabled ? (S(), C("div", Ks, [
1675
1679
  u(Qt, {
1676
- sku: v.value,
1677
- "setting-options": e(r).skuSettingOptions,
1678
- "onUpdate:modelValue": b
1680
+ sku: b.value,
1681
+ "setting-options": e(a).skuSettingOptions,
1682
+ "onUpdate:modelValue": v
1679
1683
  }, null, 8, ["sku", "setting-options"])
1680
1684
  ])) : j("", !0)
1681
1685
  ]),
1682
- t("div", Ks, [
1686
+ t("div", Gs, [
1683
1687
  t("div", Zs, [
1684
1688
  t("div", Js, [
1685
1689
  u(I, {
1686
1690
  value: !0,
1687
1691
  "model-value": e(o).selectedFields.has("code"),
1688
- "onUpdate:modelValue": p[0] || (p[0] = (A) => e(o).toggleField("code"))
1692
+ "onUpdate:modelValue": f[0] || (f[0] = (A) => e(o).toggleField("code"))
1689
1693
  }, null, 8, ["model-value"]),
1690
- u(B, {
1691
- label: e(a)("inventory.transfer.template.bulkEditor.step2.fieldCode"),
1694
+ u(R, {
1695
+ label: e(r)("inventory.transfer.template.bulkEditor.step2.fieldCode"),
1692
1696
  mark: e(o).selectedFields.has("code") ? "required" : void 0
1693
1697
  }, null, 8, ["label", "mark"])
1694
1698
  ]),
@@ -1697,22 +1701,22 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1697
1701
  }, [
1698
1702
  u(ee, {
1699
1703
  modelValue: k.value,
1700
- "onUpdate:modelValue": p[1] || (p[1] = (A) => k.value = A),
1701
- "helper-text": v.value.code,
1704
+ "onUpdate:modelValue": f[1] || (f[1] = (A) => k.value = A),
1705
+ "helper-text": b.value.code,
1702
1706
  rules: e(o).selectedFields.has("code") ? [e(ce)()] : [],
1703
1707
  disabled: !e(o).selectedFields.has("code")
1704
1708
  }, null, 8, ["modelValue", "helper-text", "rules", "disabled"])
1705
1709
  ], 2)
1706
1710
  ]),
1707
1711
  t("div", Xs, [
1708
- t("div", el, [
1712
+ t("div", en, [
1709
1713
  u(I, {
1710
1714
  value: !0,
1711
1715
  "model-value": e(o).selectedFields.has("name"),
1712
- "onUpdate:modelValue": p[2] || (p[2] = (A) => e(o).toggleField("name"))
1716
+ "onUpdate:modelValue": f[2] || (f[2] = (A) => e(o).toggleField("name"))
1713
1717
  }, null, 8, ["model-value"]),
1714
- u(B, {
1715
- label: e(a)("inventory.transfer.template.bulkEditor.step2.fieldName"),
1718
+ u(R, {
1719
+ label: e(r)("inventory.transfer.template.bulkEditor.step2.fieldName"),
1716
1720
  mark: e(o).selectedFields.has("name") ? "required" : void 0
1717
1721
  }, null, 8, ["label", "mark"])
1718
1722
  ]),
@@ -1720,85 +1724,85 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1720
1724
  class: oe(e(o).selectedFields.has("name") ? "" : "pointer-events-none select-none opacity-40")
1721
1725
  }, [
1722
1726
  u(ee, {
1723
- modelValue: M.value,
1724
- "onUpdate:modelValue": p[3] || (p[3] = (A) => M.value = A),
1725
- "helper-text": v.value.name,
1727
+ modelValue: O.value,
1728
+ "onUpdate:modelValue": f[3] || (f[3] = (A) => O.value = A),
1729
+ "helper-text": b.value.name,
1726
1730
  rules: e(o).selectedFields.has("name") ? [e(ce)()] : [],
1727
1731
  disabled: !e(o).selectedFields.has("name")
1728
1732
  }, null, 8, ["modelValue", "helper-text", "rules", "disabled"])
1729
1733
  ], 2)
1730
1734
  ])
1731
1735
  ]),
1732
- t("div", tl, [
1733
- t("div", ol, [
1734
- t("div", sl, [
1736
+ t("div", tn, [
1737
+ t("div", on, [
1738
+ t("div", sn, [
1735
1739
  u(I, {
1736
1740
  value: !0,
1737
1741
  "model-value": e(o).selectedFields.has("defaultAmount"),
1738
- "onUpdate:modelValue": p[4] || (p[4] = (A) => e(o).toggleField("defaultAmount"))
1742
+ "onUpdate:modelValue": f[4] || (f[4] = (A) => e(o).toggleField("defaultAmount"))
1739
1743
  }, null, 8, ["model-value"]),
1740
- u(B, {
1741
- label: e(a)("inventory.transfer.template.bulkEditor.step2.fieldDefaultAmount"),
1744
+ u(R, {
1745
+ label: e(r)("inventory.transfer.template.bulkEditor.step2.fieldDefaultAmount"),
1742
1746
  mark: e(o).selectedFields.has("defaultAmount") ? "required" : void 0
1743
1747
  }, null, 8, ["label", "mark"])
1744
1748
  ]),
1745
1749
  t("div", {
1746
1750
  class: oe(e(o).selectedFields.has("defaultAmount") ? "" : "pointer-events-none select-none opacity-40")
1747
1751
  }, [
1748
- T.value ? (w(), se(at, {
1752
+ T.value ? (S(), se(rt, {
1749
1753
  key: 0,
1750
- modelValue: $.value,
1751
- "onUpdate:modelValue": p[5] || (p[5] = (A) => $.value = A),
1754
+ modelValue: V.value,
1755
+ "onUpdate:modelValue": f[5] || (f[5] = (A) => V.value = A),
1752
1756
  unit: T.value,
1753
- rules: e(o).selectedFields.has("defaultAmount") ? _.value : [],
1757
+ rules: e(o).selectedFields.has("defaultAmount") ? p.value : [],
1754
1758
  disabled: !e(o).selectedFields.has("defaultAmount"),
1755
1759
  "apply-default-rules": ""
1756
1760
  }, null, 8, ["modelValue", "unit", "rules", "disabled"])) : j("", !0)
1757
1761
  ], 2)
1758
1762
  ]),
1759
- t("div", ll, [
1760
- t("div", nl, [
1763
+ t("div", nn, [
1764
+ t("div", ln, [
1761
1765
  u(I, {
1762
1766
  value: !0,
1763
1767
  "model-value": e(o).selectedFields.has("step"),
1764
- "onUpdate:modelValue": p[6] || (p[6] = (A) => e(o).toggleField("step"))
1768
+ "onUpdate:modelValue": f[6] || (f[6] = (A) => e(o).toggleField("step"))
1765
1769
  }, null, 8, ["model-value"]),
1766
- u(B, {
1767
- label: e(a)("inventory.transfer.template.bulkEditor.step2.fieldStep")
1770
+ u(R, {
1771
+ label: e(r)("inventory.transfer.template.bulkEditor.step2.fieldStep")
1768
1772
  }, null, 8, ["label"])
1769
1773
  ]),
1770
1774
  t("div", {
1771
1775
  class: oe(e(o).selectedFields.has("step") ? "" : "pointer-events-none select-none opacity-40")
1772
1776
  }, [
1773
1777
  u(ee, {
1774
- modelValue: i.value,
1775
- "onUpdate:modelValue": p[7] || (p[7] = (A) => i.value = A),
1778
+ modelValue: s.value,
1779
+ "onUpdate:modelValue": f[7] || (f[7] = (A) => s.value = A),
1776
1780
  rules: e(o).selectedFields.has("step") ? D.value : [],
1777
1781
  disabled: !e(o).selectedFields.has("step")
1778
1782
  }, null, 8, ["modelValue", "rules", "disabled"])
1779
1783
  ], 2)
1780
1784
  ])
1781
1785
  ]),
1782
- t("div", al, [
1783
- t("div", rl, [
1786
+ t("div", rn, [
1787
+ t("div", an, [
1784
1788
  u(I, {
1785
1789
  value: !0,
1786
1790
  "model-value": e(o).selectedFields.has("limit"),
1787
- "onUpdate:modelValue": p[8] || (p[8] = (A) => e(o).toggleField("limit"))
1791
+ "onUpdate:modelValue": f[8] || (f[8] = (A) => e(o).toggleField("limit"))
1788
1792
  }, null, 8, ["model-value"]),
1789
- u(B, {
1790
- label: e(a)("inventory.transfer.template.bulkEditor.step2.fieldLimit")
1793
+ u(R, {
1794
+ label: e(r)("inventory.transfer.template.bulkEditor.step2.fieldLimit")
1791
1795
  }, null, 8, ["label"])
1792
1796
  ]),
1793
1797
  t("div", {
1794
1798
  class: oe(e(o).selectedFields.has("limit") ? "" : "pointer-events-none select-none opacity-40")
1795
1799
  }, [
1796
- v.value.unit ? (w(), se(pt, {
1800
+ b.value.unit ? (S(), se(pt, {
1797
1801
  key: 0,
1798
- modelValue: f.value,
1799
- "onUpdate:modelValue": p[9] || (p[9] = (A) => f.value = A),
1800
- unit: v.value.unit,
1801
- rules: e(o).selectedFields.has("limit") ? g.value : [],
1802
+ modelValue: i.value,
1803
+ "onUpdate:modelValue": f[9] || (f[9] = (A) => i.value = A),
1804
+ unit: b.value.unit,
1805
+ rules: e(o).selectedFields.has("limit") ? _.value : [],
1802
1806
  disabled: !e(o).selectedFields.has("limit"),
1803
1807
  "disable-unit": "",
1804
1808
  "apply-default-rules": ""
@@ -1813,30 +1817,30 @@ const ro = { class: "flex flex-col gap-8 py-16" }, io = { class: "flex items-cen
1813
1817
  };
1814
1818
  }
1815
1819
  }), et = { amount: 0, precision: 0 };
1816
- function dl(F) {
1817
- var l;
1818
- const d = F.sku;
1820
+ function un($) {
1821
+ var n;
1822
+ const d = $.sku;
1819
1823
  return {
1820
1824
  code: d.code,
1821
- overrideCode: F.code,
1822
- name: F.name ?? d.name,
1823
- unit: ((l = d.unit.measurements.find((a) => a.id === d.trackingMeasurement)) == null ? void 0 : l.abbrev) ?? d.unit.abbrev,
1824
- defaultQuantity: +Q(F.quantity),
1825
- minimumQuantity: +Q(F.minimumQuantity ?? et),
1826
- maximumQuantity: +Q(F.maximumQuantity ?? et),
1827
- quantityStep: +Q(F.quantityStep)
1825
+ overrideCode: $.code,
1826
+ name: $.name ?? d.name,
1827
+ unit: ((n = d.unit.measurements.find((r) => r.id === d.trackingMeasurement)) == null ? void 0 : n.abbrev) ?? d.unit.abbrev,
1828
+ defaultQuantity: +Q($.quantity),
1829
+ minimumQuantity: +Q($.minimumQuantity ?? et),
1830
+ maximumQuantity: +Q($.maximumQuantity ?? et),
1831
+ quantityStep: +Q($.quantityStep)
1828
1832
  };
1829
1833
  }
1830
- function ul(F) {
1834
+ function mn($) {
1831
1835
  var T;
1832
- const l = It().currentBusiness.value, a = Ot(), r = (T = F.map((k) => {
1833
- var f;
1834
- const M = k.purchaseOrder.items.map((_) => dl(_)), $ = [
1836
+ const n = It().currentBusiness.value, r = Ot(), a = (T = $.map((k) => {
1837
+ var i;
1838
+ const O = k.purchaseOrder.items.map((p) => un(p)), V = [
1835
1839
  ["Template ID", k._id],
1836
1840
  ["Template name", k.name],
1837
- ["Business name", l == null ? void 0 : l.name],
1838
- ["Business ID", l == null ? void 0 : l._id],
1839
- ["Menu version", l == null ? void 0 : l.menuVersion],
1841
+ ["Business name", n == null ? void 0 : n.name],
1842
+ ["Business ID", n == null ? void 0 : n._id],
1843
+ ["Menu version", n == null ? void 0 : n.menuVersion],
1840
1844
  [
1841
1845
  "Purchase/Transfer",
1842
1846
  typeof k.purchaseOrder.supplier.internal == "string" ? X.enum.transfer : X.enum.purchase
@@ -1846,148 +1850,148 @@ function ul(F) {
1846
1850
  `${k.purchaseOrder.supplier.name} (${[
1847
1851
  k.purchaseOrder.supplier.internal,
1848
1852
  k.purchaseOrder.supplier._id
1849
- ].filter((_) => _).join("_")})`
1853
+ ].filter((p) => p).join("_")})`
1850
1854
  ],
1851
1855
  [
1852
1856
  "Locations",
1853
- ...(f = k.locations) != null && f.length ? k.locations.map((_) => `${_.name} (${_.dbName})`) : ["All"]
1857
+ ...(i = k.locations) != null && i.length ? k.locations.map((p) => `${p.name} (${p.dbName})`) : ["All"]
1854
1858
  ],
1855
1859
  ["Reference", k.purchaseOrder.ref ?? ""],
1856
1860
  ["Remark", k.purchaseOrder.remark ?? ""],
1857
1861
  [],
1858
- a.map((_) => _.name),
1859
- ...M.map((_) => a.map((D) => _[D.id]))
1860
- ], s = a.map((_) => `system:${_.id}`), i = Zt($, s);
1861
- return { name: k.name, sheet: i };
1862
+ r.map((p) => p.name),
1863
+ ...O.map((p) => r.map((D) => p[D.id]))
1864
+ ], m = r.map((p) => `system:${p.id}`), s = Zt(V, m);
1865
+ return { name: k.name, sheet: s };
1862
1866
  }).reduce(
1863
- (k, M) => {
1864
- var s;
1865
- const $ = M.name.slice(0, 28);
1866
- return (s = k.sheetOccurence)[$] ?? (s[$] = 0), k.sheetOccurence[$] += 1, k.sheets[`${$} (${k.sheetOccurence[$]})`] = M.sheet, k;
1867
+ (k, O) => {
1868
+ var m;
1869
+ const V = O.name.slice(0, 28);
1870
+ return (m = k.sheetOccurence)[V] ?? (m[V] = 0), k.sheetOccurence[V] += 1, k.sheets[`${V} (${k.sheetOccurence[V]})`] = O.sheet, k;
1867
1871
  },
1868
1872
  {
1869
1873
  sheets: {},
1870
1874
  sheetOccurence: {}
1871
1875
  }
1872
- )) == null ? void 0 : T.sheets, h = `${l == null ? void 0 : l.name} transfer templates bulk edit (${ct(/* @__PURE__ */ new Date())}).xlsx`, v = Jt(r);
1873
- Xt(v, h);
1876
+ )) == null ? void 0 : T.sheets, h = `${n == null ? void 0 : n.name} transfer templates bulk edit (${ct(/* @__PURE__ */ new Date())}).xlsx`, b = Jt(a);
1877
+ Xt(b, h);
1874
1878
  }
1875
- const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, pl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, fl = { class: "flex flex-wrap gap-12 items-center" }, yl = { class: "flex items-center gap-6" }, vl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, bl = { class: "flex items-center gap-6" }, hl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _l = { class: "text-fm-color-typo-primary" }, gl = { class: "text-fm-color-typo-placeholder ml-4" }, xl = { class: "mt-12" }, kl = ["onClick"], $l = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, Fl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Sl = {
1879
+ const cn = { class: "flex flex-col gap-16" }, pn = { class: "rounded-lg border border-fm-color-border-default bg-fm-color-surface-secondary p-16" }, fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary mb-8" }, yn = { class: "flex flex-wrap gap-12 items-center" }, vn = { class: "flex items-center gap-6" }, bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, hn = { class: "flex items-center gap-6" }, _n = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, gn = { class: "text-fm-color-typo-primary" }, xn = { class: "text-fm-color-typo-placeholder ml-4" }, kn = { class: "mt-12" }, $n = ["onClick"], Fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary flex-1 truncate" }, Sn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, wn = {
1876
1880
  key: 0,
1877
1881
  class: "px-12 py-8 border-b border-fm-color-border-default"
1878
- }, wl = {
1882
+ }, In = {
1879
1883
  key: 1,
1880
1884
  class: "divide-y divide-fm-color-border-default"
1881
- }, Il = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary w-28 shrink-0" }, Tl = { class: "fm-typo-en-body-sm-400 line-through text-fm-color-error" }, Cl = { class: "fm-typo-en-body-sm-400 text-fm-color-success font-medium" }, Ol = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Vl = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-placeholder ml-4 italic" }, Ml = /* @__PURE__ */ re({
1885
+ }, Tn = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary w-28 shrink-0" }, Cn = { class: "fm-typo-en-body-sm-400 line-through text-fm-color-error" }, On = { class: "fm-typo-en-body-sm-400 text-fm-color-success font-medium" }, Mn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Vn = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-placeholder ml-4 italic" }, En = /* @__PURE__ */ ae({
1882
1886
  __name: "TemplateItemBulkEditorStep3",
1883
- setup(F) {
1884
- const { t: d } = Ie(), l = Se(), a = H(/* @__PURE__ */ new Set());
1885
- function o(i) {
1886
- return a.value.has(i);
1887
+ setup($) {
1888
+ const { t: d } = Ie(), n = Se(), r = H(/* @__PURE__ */ new Set());
1889
+ function o(s) {
1890
+ return r.value.has(s);
1887
1891
  }
1888
- function r(i) {
1889
- const f = new Set(a.value);
1890
- f.has(i) ? f.delete(i) : f.add(i), a.value = f;
1892
+ function a(s) {
1893
+ const i = new Set(r.value);
1894
+ i.has(s) ? i.delete(s) : i.add(s), r.value = i;
1891
1895
  }
1892
- const h = V(() => {
1893
- const i = /* @__PURE__ */ new Map();
1894
- for (const f of l.selectedTemplates)
1895
- i.set(f._id, f);
1896
- return i;
1896
+ const h = M(() => {
1897
+ const s = /* @__PURE__ */ new Map();
1898
+ for (const i of n.selectedTemplates)
1899
+ s.set(i._id, i);
1900
+ return s;
1897
1901
  });
1898
- function v(i) {
1899
- var p;
1900
- const f = (p = l.selectedSku) == null ? void 0 : p._id;
1901
- if (!f) return [];
1902
- const _ = h.value.get(i), D = l.reviewPayloads.find((C) => C._id === i);
1903
- if (!_ || !D) return [];
1904
- const g = _.purchaseOrder.items.find((C) => C.sku._id === f), m = D.purchaseOrder.items.find((C) => C.sku._id === f);
1905
- if (!g || !m) return [];
1906
- const y = (C) => C != null ? Q(C) : "—", b = l.selectedFields;
1902
+ function b(s) {
1903
+ var f;
1904
+ const i = (f = n.selectedSku) == null ? void 0 : f._id;
1905
+ if (!i) return [];
1906
+ const p = h.value.get(s), D = n.reviewPayloads.find((w) => w._id === s);
1907
+ if (!p || !D) return [];
1908
+ const _ = p.purchaseOrder.items.find((w) => w.sku._id === i), c = D.purchaseOrder.items.find((w) => w.sku._id === i);
1909
+ if (!_ || !c) return [];
1910
+ const g = (w) => w != null ? Q(w) : "—", v = n.selectedFields;
1907
1911
  return [
1908
1912
  {
1909
1913
  group: "code",
1910
1914
  label: d("inventory.transfer.template.bulkEditor.step3.fieldCode"),
1911
- before: g.code ?? "—",
1912
- after: m.code ?? "—",
1913
- changed: g.code !== m.code
1915
+ before: _.code ?? "—",
1916
+ after: c.code ?? "—",
1917
+ changed: _.code !== c.code
1914
1918
  },
1915
1919
  {
1916
1920
  group: "name",
1917
1921
  label: d("inventory.transfer.template.bulkEditor.step3.fieldName"),
1918
- before: g.name ?? "—",
1919
- after: m.name ?? "—",
1920
- changed: g.name !== m.name
1922
+ before: _.name ?? "—",
1923
+ after: c.name ?? "—",
1924
+ changed: _.name !== c.name
1921
1925
  },
1922
1926
  {
1923
1927
  group: "defaultAmount",
1924
1928
  label: d("inventory.transfer.template.bulkEditor.step3.fieldDefaultAmount"),
1925
- before: y(g.quantity),
1926
- after: y(m.quantity),
1927
- changed: y(g.quantity) !== y(m.quantity)
1929
+ before: g(_.quantity),
1930
+ after: g(c.quantity),
1931
+ changed: g(_.quantity) !== g(c.quantity)
1928
1932
  },
1929
1933
  {
1930
1934
  group: "step",
1931
1935
  label: d("inventory.transfer.template.bulkEditor.step3.fieldStep"),
1932
- before: y(g.quantityStep),
1933
- after: y(m.quantityStep),
1934
- changed: y(g.quantityStep) !== y(m.quantityStep)
1936
+ before: g(_.quantityStep),
1937
+ after: g(c.quantityStep),
1938
+ changed: g(_.quantityStep) !== g(c.quantityStep)
1935
1939
  },
1936
1940
  {
1937
1941
  group: "limit",
1938
1942
  label: d("inventory.transfer.template.bulkEditor.step3.fieldMin"),
1939
- before: y(g.minimumQuantity),
1940
- after: y(m.minimumQuantity),
1941
- changed: y(g.minimumQuantity) !== y(m.minimumQuantity)
1943
+ before: g(_.minimumQuantity),
1944
+ after: g(c.minimumQuantity),
1945
+ changed: g(_.minimumQuantity) !== g(c.minimumQuantity)
1942
1946
  },
1943
1947
  {
1944
1948
  group: "limit",
1945
1949
  label: d("inventory.transfer.template.bulkEditor.step3.fieldMax"),
1946
- before: y(g.maximumQuantity),
1947
- after: y(m.maximumQuantity),
1948
- changed: y(g.maximumQuantity) !== y(m.maximumQuantity)
1950
+ before: g(_.maximumQuantity),
1951
+ after: g(c.maximumQuantity),
1952
+ changed: g(_.maximumQuantity) !== g(c.maximumQuantity)
1949
1953
  }
1950
- ].filter((C) => b.has(C.group));
1954
+ ].filter((w) => v.has(w.group));
1951
1955
  }
1952
1956
  function T() {
1953
- ul(l.reviewPayloads);
1957
+ mn(n.reviewPayloads);
1954
1958
  }
1955
- function k(i) {
1956
- return l.succeededIds.has(i) ? "updated" : l.applyErrors.has(i) ? "failed" : "pending";
1959
+ function k(s) {
1960
+ return n.succeededIds.has(s) ? "updated" : n.applyErrors.has(s) ? "failed" : "pending";
1957
1961
  }
1958
- const M = {
1962
+ const O = {
1959
1963
  updated: "success",
1960
1964
  failed: "critical",
1961
1965
  pending: "success"
1962
- }, $ = {
1966
+ }, V = {
1963
1967
  updated: "inventory.transfer.template.bulkEditor.step3.updatedChip",
1964
1968
  failed: "inventory.transfer.template.bulkEditor.step3.failedChip",
1965
1969
  pending: "inventory.transfer.template.bulkEditor.step3.willUpdateChip"
1966
- }, s = V(() => l.reviewPayloads.length);
1967
- return (i, f) => {
1968
- var y, b;
1969
- const _ = E("FmChip"), D = E("FmButton"), g = E("FmIcon"), m = E("FmBanner");
1970
- return w(), O("div", ml, [
1971
- t("div", cl, [
1972
- t("p", pl, S(e(d)("inventory.transfer.template.bulkEditor.step3.title")), 1),
1973
- t("div", fl, [
1974
- t("div", yl, [
1975
- u(_, {
1970
+ }, m = M(() => n.reviewPayloads.length);
1971
+ return (s, i) => {
1972
+ var g, v;
1973
+ const p = E("FmChip"), D = E("FmButton"), _ = E("FmIcon"), c = E("FmBanner");
1974
+ return S(), C("div", cn, [
1975
+ t("div", pn, [
1976
+ t("p", fn, F(e(d)("inventory.transfer.template.bulkEditor.step3.title")), 1),
1977
+ t("div", yn, [
1978
+ t("div", vn, [
1979
+ u(p, {
1976
1980
  size: "sm",
1977
- label: String(s.value),
1981
+ label: String(m.value),
1978
1982
  variant: "success"
1979
1983
  }, null, 8, ["label"]),
1980
- t("span", vl, S(e(d)("inventory.transfer.template.bulkEditor.step3.willUpdate", { count: s.value }, s.value)), 1)
1984
+ t("span", bn, F(e(d)("inventory.transfer.template.bulkEditor.step3.willUpdate", { count: m.value }, m.value)), 1)
1981
1985
  ]),
1982
- t("div", bl, [
1983
- t("span", hl, [
1984
- ie(S(e(d)("inventory.transfer.template.bulkEditor.step3.item")) + " ", 1),
1985
- t("strong", _l, S((y = e(l).selectedSku) == null ? void 0 : y.name), 1),
1986
- t("span", gl, "(" + S((b = e(l).selectedSku) == null ? void 0 : b.code) + ")", 1)
1986
+ t("div", hn, [
1987
+ t("span", _n, [
1988
+ ie(F(e(d)("inventory.transfer.template.bulkEditor.step3.item")) + " ", 1),
1989
+ t("strong", gn, F((g = e(n).selectedSku) == null ? void 0 : g.name), 1),
1990
+ t("span", xn, "(" + F((v = e(n).selectedSku) == null ? void 0 : v.code) + ")", 1)
1987
1991
  ])
1988
1992
  ])
1989
1993
  ]),
1990
- t("div", xl, [
1994
+ t("div", kn, [
1991
1995
  u(D, {
1992
1996
  label: e(d)("inventory.transfer.template.bulkEditor.step3.export"),
1993
1997
  variant: "secondary",
@@ -1996,51 +2000,51 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
1996
2000
  }, null, 8, ["label"])
1997
2001
  ])
1998
2002
  ]),
1999
- (w(!0), O(ae, null, ye(e(l).reviewPayloads, (n) => (w(), O("div", {
2000
- key: n._id,
2003
+ (S(!0), C(re, null, ye(e(n).reviewPayloads, (l) => (S(), C("div", {
2004
+ key: l._id,
2001
2005
  class: "rounded-lg border border-fm-color-border-default overflow-hidden"
2002
2006
  }, [
2003
2007
  t("button", {
2004
2008
  type: "button",
2005
- class: oe(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary text-left cursor-pointer", { "border-b border-fm-color-border-default": o(n._id) }]),
2006
- onClick: (p) => r(n._id)
2009
+ class: oe(["w-full flex items-center gap-8 px-12 py-10 bg-fm-color-surface-secondary text-left cursor-pointer", { "border-b border-fm-color-border-default": o(l._id) }]),
2010
+ onClick: (f) => a(l._id)
2007
2011
  }, [
2008
- u(g, {
2009
- name: o(n._id) ? "expand_less" : "expand_more",
2012
+ u(_, {
2013
+ name: o(l._id) ? "expand_less" : "expand_more",
2010
2014
  size: "sm",
2011
2015
  class: "text-fm-color-typo-secondary flex-shrink-0"
2012
2016
  }, null, 8, ["name"]),
2013
- t("span", $l, S(n.name), 1),
2014
- t("span", Fl, S(e(d)("inventory.transfer.template.bulkEditor.step1.from")) + " " + S(n.purchaseOrder.supplier.name), 1),
2015
- u(_, {
2017
+ t("span", Fn, F(l.name), 1),
2018
+ t("span", Sn, F(e(d)("inventory.transfer.template.bulkEditor.step1.from")) + " " + F(l.purchaseOrder.supplier.name), 1),
2019
+ u(p, {
2016
2020
  size: "sm",
2017
- label: e(d)($[k(n._id)]),
2018
- variant: M[k(n._id)]
2021
+ label: e(d)(V[k(l._id)]),
2022
+ variant: O[k(l._id)]
2019
2023
  }, null, 8, ["label", "variant"])
2020
- ], 10, kl),
2021
- e(l).applyErrors.has(n._id) ? (w(), O("div", Sl, [
2022
- u(m, {
2024
+ ], 10, $n),
2025
+ e(n).applyErrors.has(l._id) ? (S(), C("div", wn, [
2026
+ u(c, {
2023
2027
  type: "error",
2024
- message: e(l).applyErrors.get(n._id)
2028
+ message: e(n).applyErrors.get(l._id)
2025
2029
  }, null, 8, ["message"])
2026
2030
  ])) : j("", !0),
2027
- o(n._id) ? (w(), O("div", wl, [
2028
- (w(!0), O(ae, null, ye(v(n._id), (p) => (w(), O("div", {
2029
- key: p.label,
2031
+ o(l._id) ? (S(), C("div", In, [
2032
+ (S(!0), C(re, null, ye(b(l._id), (f) => (S(), C("div", {
2033
+ key: f.label,
2030
2034
  class: "flex items-center gap-8 px-12 py-8"
2031
2035
  }, [
2032
- t("span", Il, S(p.label), 1),
2033
- p.changed ? (w(), O(ae, { key: 0 }, [
2034
- t("span", Tl, S(p.before), 1),
2035
- u(g, {
2036
+ t("span", Tn, F(f.label), 1),
2037
+ f.changed ? (S(), C(re, { key: 0 }, [
2038
+ t("span", Cn, F(f.before), 1),
2039
+ u(_, {
2036
2040
  name: "arrow_forward",
2037
2041
  size: "sm",
2038
2042
  class: "text-fm-color-typo-placeholder shrink-0"
2039
2043
  }),
2040
- t("span", Cl, S(p.after), 1)
2041
- ], 64)) : (w(), O(ae, { key: 1 }, [
2042
- t("span", Ol, S(p.before), 1),
2043
- t("span", Vl, S(e(d)("inventory.transfer.template.bulkEditor.step3.unchanged")), 1)
2044
+ t("span", On, F(f.after), 1)
2045
+ ], 64)) : (S(), C(re, { key: 1 }, [
2046
+ t("span", Mn, F(f.before), 1),
2047
+ t("span", Vn, F(e(d)("inventory.transfer.template.bulkEditor.step3.unchanged")), 1)
2044
2048
  ], 64))
2045
2049
  ]))), 128))
2046
2050
  ])) : j("", !0)
@@ -2048,46 +2052,46 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
2048
2052
  ]);
2049
2053
  };
2050
2054
  }
2051
- }), El = { class: "flex items-center gap-12" }, Dl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Al = {
2055
+ }), Dn = { class: "flex items-center gap-12" }, An = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, qn = {
2052
2056
  key: 0,
2053
2057
  class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
2054
- }, ql = {
2058
+ }, Un = {
2055
2059
  key: 1,
2056
2060
  class: "h-[calc(98vh-120px)] overflow-hidden flex flex-col"
2057
- }, Rl = {
2061
+ }, Rn = {
2058
2062
  key: 2,
2059
2063
  class: "h-[calc(98vh-120px)] overflow-y-auto px-24 py-20"
2060
- }, Bl = {
2064
+ }, Bn = {
2061
2065
  key: 0,
2062
2066
  class: "flex items-center gap-8 px-4"
2063
- }, Ul = {
2067
+ }, Pn = {
2064
2068
  key: 1,
2065
2069
  class: "flex items-center gap-8 px-4"
2066
- }, Pl = /* @__PURE__ */ re({
2070
+ }, Nn = /* @__PURE__ */ ae({
2067
2071
  __name: "TemplateItemBulkEditorDialog",
2068
- setup(F) {
2069
- const { t: d } = Ie(), l = Se(), a = qt(), o = H(), r = V(() => l.currentStep === 1), h = V(() => l.currentStep === 2), v = V(() => l.currentStep === 3);
2072
+ setup($) {
2073
+ const { t: d } = Ie(), n = Se(), r = qt(), o = H(), a = M(() => n.currentStep === 1), h = M(() => n.currentStep === 2), b = M(() => n.currentStep === 3);
2070
2074
  function T() {
2071
- var _;
2072
- l.currentStep === 1 ? l.goToStep2() : l.currentStep === 2 && ((_ = o.value) == null || _.validateInputs());
2075
+ var p;
2076
+ n.currentStep === 1 ? n.goToStep2() : n.currentStep === 2 && ((p = o.value) == null || p.validateInputs());
2073
2077
  }
2074
2078
  function k() {
2075
- l.goToStep3();
2079
+ n.goToStep3();
2076
2080
  }
2077
- function M() {
2078
- l.back();
2081
+ function O() {
2082
+ n.back();
2079
2083
  }
2080
- function $() {
2081
- l.show = !1, l.reset();
2084
+ function V() {
2085
+ n.show = !1, n.reset();
2082
2086
  }
2083
- function s() {
2084
- var _;
2085
- a.open({
2087
+ function m() {
2088
+ var p;
2089
+ r.open({
2086
2090
  title: d("inventory.transfer.template.bulkEditor.confirm.title"),
2087
2091
  message: d("inventory.transfer.template.bulkEditor.confirm.message", {
2088
- sku: (_ = l.selectedSku) == null ? void 0 : _.name,
2089
- count: l.reviewPayloads.length
2090
- }, l.reviewPayloads.length),
2092
+ sku: (p = n.selectedSku) == null ? void 0 : p.name,
2093
+ count: n.reviewPayloads.length
2094
+ }, n.reviewPayloads.length),
2091
2095
  primaryActions: {
2092
2096
  text: d("inventory.transfer.template.bulkEditor.confirm.confirm"),
2093
2097
  variant: "primary",
@@ -2098,18 +2102,18 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
2098
2102
  close: !0
2099
2103
  }
2100
2104
  }).onPrimary(async () => {
2101
- await l.confirmAndApply();
2105
+ await n.confirmAndApply();
2102
2106
  });
2103
2107
  }
2104
- const i = V(() => l.currentStep === 2 ? d("inventory.transfer.template.bulkEditor.review") : d("inventory.transfer.template.bulkEditor.next")), f = V(() => l.currentStep === 1 ? !l.canGoToStep2 : l.currentStep === 2 ? !l.canGoToStep3 : !1);
2105
- return (_, D) => {
2106
- const g = E("FmChip"), m = E("FmButton"), y = E("FmDialog");
2107
- return w(), se(y, {
2108
- modelValue: e(l).show,
2108
+ const s = M(() => n.currentStep === 2 ? d("inventory.transfer.template.bulkEditor.review") : d("inventory.transfer.template.bulkEditor.next")), i = M(() => n.currentStep === 1 ? !n.canGoToStep2 : n.currentStep === 2 ? !n.canGoToStep3 : !1);
2109
+ return (p, D) => {
2110
+ const _ = E("FmChip"), c = E("FmButton"), g = E("FmDialog");
2111
+ return S(), se(g, {
2112
+ modelValue: e(n).show,
2109
2113
  "onUpdate:modelValue": [
2110
- D[0] || (D[0] = (b) => e(l).show = b),
2111
- D[1] || (D[1] = (b) => {
2112
- b || e(l).reset();
2114
+ D[0] || (D[0] = (v) => e(n).show = v),
2115
+ D[1] || (D[1] = (v) => {
2116
+ v || e(n).reset();
2113
2117
  })
2114
2118
  ],
2115
2119
  overlay: !0,
@@ -2118,97 +2122,97 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
2118
2122
  "max-height": "98vh"
2119
2123
  }, {
2120
2124
  "dialog-header": P(() => [
2121
- t("div", El, [
2122
- t("span", Dl, S(e(d)("inventory.transfer.template.bulkEditor.dialogTitle")), 1),
2123
- u(g, {
2125
+ t("div", Dn, [
2126
+ t("span", An, F(e(d)("inventory.transfer.template.bulkEditor.dialogTitle")), 1),
2127
+ u(_, {
2124
2128
  size: "sm",
2125
- label: e(d)("inventory.transfer.template.bulkEditor.stepChip", { step: e(l).currentStep }),
2129
+ label: e(d)("inventory.transfer.template.bulkEditor.stepChip", { step: e(n).currentStep }),
2126
2130
  variant: "neutral"
2127
2131
  }, null, 8, ["label"])
2128
2132
  ])
2129
2133
  ]),
2130
2134
  "dialog-footer": P(() => [
2131
- v.value ? (w(), O("div", Ul, [
2132
- u(m, {
2135
+ b.value ? (S(), C("div", Pn, [
2136
+ u(c, {
2133
2137
  label: e(d)("inventory.transfer.template.bulkEditor.confirmAndUpdate"),
2134
- disabled: e(l).isSaving,
2135
- loading: e(l).isSaving,
2136
- onClick: s
2138
+ disabled: e(n).isSaving,
2139
+ loading: e(n).isSaving,
2140
+ onClick: m
2137
2141
  }, null, 8, ["label", "disabled", "loading"]),
2138
- u(m, {
2142
+ u(c, {
2139
2143
  label: e(d)("inventory.transfer.template.bulkEditor.back"),
2140
2144
  variant: "secondary",
2141
- disabled: e(l).isSaving,
2142
- onClick: M
2145
+ disabled: e(n).isSaving,
2146
+ onClick: O
2143
2147
  }, null, 8, ["label", "disabled"]),
2144
- u(m, {
2148
+ u(c, {
2145
2149
  label: e(d)("inventory.transfer.template.bulkEditor.close"),
2146
2150
  variant: "tertiary",
2147
- disabled: e(l).isSaving,
2148
- onClick: $
2151
+ disabled: e(n).isSaving,
2152
+ onClick: V
2149
2153
  }, null, 8, ["label", "disabled"])
2150
- ])) : (w(), O("div", Bl, [
2151
- u(m, {
2152
- label: i.value,
2153
- disabled: f.value,
2154
+ ])) : (S(), C("div", Bn, [
2155
+ u(c, {
2156
+ label: s.value,
2157
+ disabled: i.value,
2154
2158
  onClick: T
2155
2159
  }, null, 8, ["label", "disabled"]),
2156
- e(l).currentStep > 1 ? (w(), se(m, {
2160
+ e(n).currentStep > 1 ? (S(), se(c, {
2157
2161
  key: 0,
2158
2162
  label: e(d)("inventory.transfer.template.bulkEditor.back"),
2159
2163
  variant: "secondary",
2160
- onClick: M
2164
+ onClick: O
2161
2165
  }, null, 8, ["label"])) : j("", !0),
2162
- u(m, {
2166
+ u(c, {
2163
2167
  label: e(d)("inventory.transfer.template.bulkEditor.close"),
2164
2168
  variant: "tertiary",
2165
- onClick: $
2169
+ onClick: V
2166
2170
  }, null, 8, ["label"])
2167
2171
  ]))
2168
2172
  ]),
2169
2173
  default: P(() => [
2170
- r.value ? (w(), O("div", Al, [
2174
+ a.value ? (S(), C("div", qn, [
2171
2175
  u(Ns)
2172
- ])) : h.value ? (w(), O("div", ql, [
2173
- u(il, {
2176
+ ])) : h.value ? (S(), C("div", Un, [
2177
+ u(dn, {
2174
2178
  ref_key: "step2Ref",
2175
2179
  ref: o,
2176
2180
  onValidationSuccess: k
2177
2181
  }, null, 512)
2178
- ])) : v.value ? (w(), O("div", Rl, [
2179
- u(Ml)
2182
+ ])) : b.value ? (S(), C("div", Rn, [
2183
+ u(En)
2180
2184
  ])) : j("", !0)
2181
2185
  ]),
2182
2186
  _: 1
2183
2187
  }, 8, ["modelValue"]);
2184
2188
  };
2185
2189
  }
2186
- }), Nl = { class: "flex-1 flex flex-col gap-8" }, Ll = { class: "flex flex-col" }, Ql = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, jl = { class: "fm-typo-en-body-lg-400" }, Hl = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, Wl = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, $n = /* @__PURE__ */ re({
2190
+ }), Ln = { class: "flex-1 flex flex-col gap-8" }, Qn = { class: "flex flex-col" }, zn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Hn = { class: "fm-typo-en-body-lg-400" }, Wn = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, Yn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, $l = /* @__PURE__ */ ae({
2187
2191
  __name: "TransferTemplateView",
2188
- setup(F) {
2189
- const { t: d } = pe(), { createTemplate: l, viewTemplate: a, importTemplates: o, exportTemplates: r, openBulkItemEditor: h } = Ke(), { templateDialogProps: v, templateDetailsProps: T } = Je(Ke()), k = Vt(), { loading: M, templates: $ } = Je(k), s = H(!1), i = St(), f = ot(), { breakpoints: _ } = Rt();
2192
+ setup($) {
2193
+ const { t: d } = pe(), { createTemplate: n, viewTemplate: r, importTemplates: o, exportTemplates: a, openBulkItemEditor: h } = Ge(), { templateDialogProps: b, templateDetailsProps: T } = Je(Ge()), k = Mt(), { loading: O, templates: V } = Je(k), m = H(!1), s = St(), i = ot(), { breakpoints: p } = Ut();
2190
2194
  Ve(k.fetchTemplates);
2191
- const D = V(
2192
- () => s.value || M.value || !f._currentLocation
2193
- ), g = V(() => $.value), m = H(""), y = V(() => _.value.xs || _.value.sm), b = V(() => y.value ? 10 : 20);
2194
- function n(I) {
2195
+ const D = M(
2196
+ () => m.value || O.value || !i._currentLocation
2197
+ ), _ = M(() => V.value), c = H(""), g = M(() => p.value.xs || p.value.sm), v = M(() => g.value ? 10 : 20);
2198
+ function l(I) {
2195
2199
  switch (I) {
2196
2200
  case Ze.Add:
2197
- return l();
2201
+ return n();
2198
2202
  case "refresh":
2199
2203
  return k.fetchTemplates();
2200
2204
  case "import":
2201
2205
  return o();
2202
2206
  case "export":
2203
- return r();
2207
+ return a();
2204
2208
  case "bulk-edit-items":
2205
2209
  return h();
2206
2210
  }
2207
2211
  }
2208
- function p(I) {
2212
+ function f(I) {
2209
2213
  return I;
2210
2214
  }
2211
- const C = V(() => [
2215
+ const w = M(() => [
2212
2216
  {
2213
2217
  label: d("inventory.closing.template.create.title"),
2214
2218
  value: Ze.Add,
@@ -2236,13 +2240,13 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
2236
2240
  isPrimary: !1
2237
2241
  }
2238
2242
  ]);
2239
- return (I, B) => {
2243
+ return (I, R) => {
2240
2244
  const ee = E("FmTable");
2241
- return w(), O(ae, null, [
2245
+ return S(), C(re, null, [
2242
2246
  u(wt, {
2243
2247
  title: e(d)("inventory.transfer.template.title2"),
2244
- actions: C.value,
2245
- "onClick:action": n
2248
+ actions: w.value,
2249
+ "onClick:action": l
2246
2250
  }, {
2247
2251
  default: P(() => {
2248
2252
  var te;
@@ -2251,67 +2255,67 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
2251
2255
  class: oe([
2252
2256
  "flex flex-col gap-8 max-h-full",
2253
2257
  {
2254
- "p-0": y.value,
2255
- "px-24 ": !y.value
2258
+ "p-0": g.value,
2259
+ "px-24 ": !g.value
2256
2260
  }
2257
2261
  ])
2258
2262
  }, [
2259
2263
  u(Dt, {
2260
2264
  searchable: "",
2261
- search: m.value,
2262
- "onUpdate:search": B[0] || (B[0] = (A) => m.value = A)
2265
+ search: c.value,
2266
+ "onUpdate:search": R[0] || (R[0] = (A) => c.value = A)
2263
2267
  }, null, 8, ["search"]),
2264
- (w(), se(ee, {
2265
- style: Oe(e(i).tableHeight),
2268
+ (S(), se(ee, {
2269
+ style: Me(e(s).tableHeight),
2266
2270
  "column-defs": e(k).columnDefs,
2267
- "row-data": g.value,
2268
- "search-value": m.value,
2271
+ "row-data": _.value,
2272
+ "search-value": c.value,
2269
2273
  loading: D.value,
2270
- key: (te = e(f)._currentLocation) == null ? void 0 : te.dbName,
2271
- onRowClick: B[1] || (B[1] = (A) => e(a)(A.original)),
2272
- "page-size": b.value
2274
+ key: (te = e(i)._currentLocation) == null ? void 0 : te.dbName,
2275
+ onRowClick: R[1] || (R[1] = (A) => e(r)(A.original)),
2276
+ "page-size": v.value
2273
2277
  }, {
2274
2278
  "list-row": P((A) => [
2275
2279
  u(ut, {
2276
2280
  row: A,
2277
- onRowClick: (N) => e(a)(N)
2281
+ onRowClick: (N) => e(r)(N)
2278
2282
  }, {
2279
2283
  default: P((N) => {
2280
- var c, x, q, L, W, J, U, z, K, le, R, Y, be, he, De, Ae, qe, Re, Be, Ue, _e, Pe, Ne, Le, Qe, ge, ze;
2284
+ var y, x, q, L, W, J, B, z, G, ne, U, Y, be, he, Ae, qe, Ue, Re, Be, Pe, _e, Ne, Le, Qe, ze, ge, je;
2281
2285
  return [
2282
- t("div", Nl, [
2283
- t("div", Ll, [
2284
- t("div", Ql, [
2285
- u(e(ne), {
2286
- render: (q = (x = (c = N._id) == null ? void 0 : c.column) == null ? void 0 : x.columnDef) == null ? void 0 : q.cell,
2286
+ t("div", Ln, [
2287
+ t("div", Qn, [
2288
+ t("div", zn, [
2289
+ u(e(le), {
2290
+ render: (q = (x = (y = N._id) == null ? void 0 : y.column) == null ? void 0 : x.columnDef) == null ? void 0 : q.cell,
2287
2291
  props: (W = (L = N._id) == null ? void 0 : L.getContext) == null ? void 0 : W.call(L)
2288
2292
  }, null, 8, ["render", "props"])
2289
2293
  ]),
2290
- t("div", zl, [
2291
- u(e(ne), {
2292
- render: (z = (U = (J = N.name) == null ? void 0 : J.column) == null ? void 0 : U.columnDef) == null ? void 0 : z.cell,
2293
- props: (le = (K = N.name) == null ? void 0 : K.getContext) == null ? void 0 : le.call(K)
2294
+ t("div", jn, [
2295
+ u(e(le), {
2296
+ render: (z = (B = (J = N.name) == null ? void 0 : J.column) == null ? void 0 : B.columnDef) == null ? void 0 : z.cell,
2297
+ props: (ne = (G = N.name) == null ? void 0 : G.getContext) == null ? void 0 : ne.call(G)
2294
2298
  }, null, 8, ["render", "props"])
2295
2299
  ]),
2296
- t("div", jl, [
2297
- u(e(ne), {
2298
- render: (be = (Y = (R = N.supplier) == null ? void 0 : R.column) == null ? void 0 : Y.columnDef) == null ? void 0 : be.cell,
2299
- props: (De = (he = N.supplier) == null ? void 0 : he.getContext) == null ? void 0 : De.call(he)
2300
+ t("div", Hn, [
2301
+ u(e(le), {
2302
+ render: (be = (Y = (U = N.supplier) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : be.cell,
2303
+ props: (Ae = (he = N.supplier) == null ? void 0 : he.getContext) == null ? void 0 : Ae.call(he)
2300
2304
  }, null, 8, ["render", "props"])
2301
2305
  ]),
2302
- t("div", null, S((Ae = A.original.locations) != null && Ae.length ? `Enabled for ${(qe = A.original.locations) == null ? void 0 : qe.length} outlets` : "Enabled for all outlets"), 1),
2303
- t("div", Hl, S(A.original.purchaseOrder.items.length ? A.original.purchaseOrder.items.map((ht) => ht.name).join(", ") : "No items"), 1),
2304
- t("div", Wl, [
2305
- u(e(ne), {
2306
- render: (Ue = (Be = (Re = N.ref) == null ? void 0 : Re.column) == null ? void 0 : Be.columnDef) == null ? void 0 : Ue.cell,
2307
- props: (Pe = (_e = N.ref) == null ? void 0 : _e.getContext) == null ? void 0 : Pe.call(_e)
2306
+ t("div", null, F((qe = A.original.locations) != null && qe.length ? `Enabled for ${(Ue = A.original.locations) == null ? void 0 : Ue.length} outlets` : "Enabled for all outlets"), 1),
2307
+ t("div", Wn, F(A.original.purchaseOrder.items.length ? A.original.purchaseOrder.items.map((ht) => ht.name).join(", ") : "No items"), 1),
2308
+ t("div", Yn, [
2309
+ u(e(le), {
2310
+ render: (Pe = (Be = (Re = N.ref) == null ? void 0 : Re.column) == null ? void 0 : Be.columnDef) == null ? void 0 : Pe.cell,
2311
+ props: (Ne = (_e = N.ref) == null ? void 0 : _e.getContext) == null ? void 0 : Ne.call(_e)
2308
2312
  }, null, 8, ["render", "props"])
2309
2313
  ])
2310
2314
  ]),
2311
2315
  t("div", null, [
2312
- u(e(ne), {
2313
- render: (Qe = (Le = (Ne = N.type) == null ? void 0 : Ne.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Qe.cell,
2314
- props: (ze = (ge = N.type) == null ? void 0 : ge.getContext) == null ? void 0 : ze.call(ge)
2316
+ u(e(le), {
2317
+ render: (ze = (Qe = (Le = N.type) == null ? void 0 : Le.column) == null ? void 0 : Qe.columnDef) == null ? void 0 : ze.cell,
2318
+ props: (je = (ge = N.type) == null ? void 0 : ge.getContext) == null ? void 0 : je.call(ge)
2315
2319
  }, null, 8, ["render", "props"])
2316
2320
  ])
2317
2321
  ])
@@ -2327,17 +2331,17 @@ const ml = { class: "flex flex-col gap-16" }, cl = { class: "rounded-lg border b
2327
2331
  }),
2328
2332
  _: 1
2329
2333
  }, 8, ["title", "actions"]),
2330
- (w(), se(kt, { to: "body" }, [
2334
+ (S(), se(kt, { to: "body" }, [
2331
2335
  u($s, $t(Ft(e(T))), null, 16),
2332
- u(No, Me(e(v), {
2333
- onSubmitted: B[2] || (B[2] = (te) => e(k).fetchTemplates())
2336
+ u(No, Ee(e(b), {
2337
+ onSubmitted: R[2] || (R[2] = (te) => e(k).fetchTemplates())
2334
2338
  }), null, 16),
2335
- u(Pl)
2339
+ u(Nn)
2336
2340
  ]))
2337
2341
  ], 64);
2338
2342
  };
2339
2343
  }
2340
2344
  });
2341
2345
  export {
2342
- $n as default
2346
+ $l as default
2343
2347
  };