@feedmepos/mf-inventory-portal 1.9.0-dev.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/{App-0333Hh25.js → App-CjEtCJ3u.js} +10 -10
  2. package/dist/{ApprovalView-CZLYqnnT.js → ApprovalView-CWeB-z4R.js} +9 -9
  3. package/dist/{BindingsDialog-CA02lqel.js → BindingsDialog-B2WXjWQ0.js} +2 -2
  4. package/dist/{BindingsPicker-CwDLZ-ki.js → BindingsPicker-DTc0Q5Em.js} +2 -2
  5. package/dist/{BindingsTable-BX87v_kq.js → BindingsTable-x1FRAcgJ.js} +4 -4
  6. package/dist/{BulkReceiveRequestPage-Vh0Rfa8e.js → BulkReceiveRequestPage-Dk4K_vUX.js} +1022 -1047
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-0fI4-Pao.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CPGujVFu.js} +1 -1
  8. package/dist/{ClosingDraftView-CxNgkVY_.js → ClosingDraftView-BqpTn8dY.js} +19 -19
  9. package/dist/{ClosingHistoryView-CUCepuA7.js → ClosingHistoryView-BJQWFz5X.js} +7 -7
  10. package/dist/ClosingTemplateView-Pj1Kj49d.js +2392 -0
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-B6Ge_6VY.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Dxt4x9Ia.js} +1 -1
  12. package/dist/{DefaultView-V-9a_YfK.js → DefaultView-BIyIubVt.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BiwT9953.js → DeliveryOrderPrintPreview-2nIVkxIe.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-I_6Wu-P-.js → EmailDialog.vue_vue_type_script_setup_true_lang-BnJdt92Q.js} +9769 -9731
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BV5mX5w5.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-FraKTknm.js} +1 -1
  16. package/dist/{FeatureCapabilityGate-B4VGdv_F.js → FeatureCapabilityGate-6_6psomb.js} +2 -2
  17. package/dist/{FeaturePageGate.vue_vue_type_script_setup_true_lang-CvFbN-7h.js → FeaturePageGate.vue_vue_type_script_setup_true_lang-CbrcFNoj.js} +1 -1
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Qd3R-TWu.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C8QTtw9i.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CxOLg-J3.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Cz5saN2u.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BeIfx9jE.js} +2 -2
  21. package/dist/{FmMultiselectDialog-BK0r-tyZ.js → FmMultiselectDialog-CcH__ggk.js} +2 -2
  22. package/dist/{FmMultiselectDialog-CFx8Qcyc.js → FmMultiselectDialog-snxpWhRm.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Cuyu_K9x.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DHlqvBTh.js} +5 -5
  24. package/dist/{ImportView-Ci9vufCx.js → ImportView-C7KyQ6wA.js} +7 -7
  25. package/dist/{IngredientsView-4s7vcW9U.js → IngredientsView-z4pObocZ.js} +15 -15
  26. package/dist/{IntegrationExplorerView-CtGuW0uI.js → IntegrationExplorerView-thWjNTPa.js} +6 -6
  27. package/dist/{IntegrationPlatformView-SpCAu3Fu.js → IntegrationPlatformView-BDe83nB1.js} +4472 -4425
  28. package/dist/{IntegrationView-DjQ4wbXh.js → IntegrationView-CyR9BK3D.js} +15 -15
  29. package/dist/{InventoryBindingForm-Bb5k9tav.js → InventoryBindingForm-CjTZYqzB.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CISHYfRi.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DzXGyj0H.js} +4 -4
  31. package/dist/{InventoryBindingSummary-CkN9QdNL.js → InventoryBindingSummary-CnLEvpRL.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C9hasqsO.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DpysXAz4.js} +2 -2
  33. package/dist/{ProductionRunDetailPage-BTNY3v9C.js → ProductionRunDetailPage-DqlFNDov.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CTOibYjJ.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-D-GoCIbB.js} +8 -8
  35. package/dist/{ProductionRunPage-GrWt4iw2.js → ProductionRunPage-xr34sye0.js} +4 -4
  36. package/dist/{PublishView-1sBMVk4p.js → PublishView-CfuP-tjm.js} +15 -15
  37. package/dist/{PurchaseOrderPrintPreview-DYwbSUVy.js → PurchaseOrderPrintPreview-DjAxJ2cK.js} +2 -2
  38. package/dist/ReceiveRequestView-CVw76dPw.js +692 -0
  39. package/dist/{RecipeView-CGkE2cX2.js → RecipeView-UlHc-Voo.js} +16 -16
  40. package/dist/{SettingsView-j5UKU2Z5.js → SettingsView-C1OGXlIE.js} +7 -7
  41. package/dist/{StockView-CMYUShkK.js → StockView-CrKLqz-6.js} +543 -543
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CcomAJoj.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cm5vtlP6.js} +1 -1
  43. package/dist/{SupplierView-whYEtaTf.js → SupplierView-DhH5eT5y.js} +13 -13
  44. package/dist/{SurchargeView-BqT_PfTk.js → SurchargeView-ByKH6JnI.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpiuOVuT.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-ZSuKa-oz.js} +2 -2
  46. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C5GOz40T.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CHvqcU44.js} +1 -1
  47. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CHyAdS3A.js +5002 -0
  48. package/dist/{TransferTemplateView-ZJYWzTCZ.js → TransferTemplateView-DJ1XO2Vg.js} +19 -19
  49. package/dist/{UnitCostHistoryView-DWcB9nbL.js → UnitCostHistoryView-CrBs_s0L.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-60B3tkI-.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js} +4 -4
  51. package/dist/{UnitView-BWX8BecE.js → UnitView--PWg-4ON.js} +7 -7
  52. package/dist/{WarehouseView-CfWLJlP2.js → WarehouseView-DoOwa0Zq.js} +8 -8
  53. package/dist/{WastageTemplateView-Gb64MBgD.js → WastageTemplateView-CiLs8nAz.js} +15 -15
  54. package/dist/api/purchase-order-template.d.ts +1 -1
  55. package/dist/{app-Coquqqkh.js → app-CFO3QhF-.js} +7558 -6916
  56. package/dist/app.d.ts +8 -0
  57. package/dist/app.js +1 -1
  58. package/dist/{bulk-edit-simulation.helper-DUAiYzrr.js → bulk-edit-simulation.helper-BjYd_yK4.js} +2 -2
  59. package/dist/{closing-template-BK-yS2H4.js → closing-template-DXfmztnK.js} +1 -1
  60. package/dist/{date2-79rkBzVf.js → date2-BMfqPhRQ.js} +1 -1
  61. package/dist/{dayjs.min-CciBGvaL.js → dayjs.min-BVjxIhrP.js} +1 -1
  62. package/dist/{decimal--BREmfoS.js → decimal-Drh1-c85.js} +2 -2
  63. package/dist/{defineDeepModel-BRSFHwsW.js → defineDeepModel-BuNVB2KT.js} +1 -1
  64. package/dist/{duplicate-template-CcEqsP8Q.js → duplicate-template-Dua82hTr.js} +1 -1
  65. package/dist/{feature-DdZZAV6X.js → feature-C1JuDWvs.js} +3 -3
  66. package/dist/feature-flags/plan-tier.d.ts +0 -2
  67. package/dist/{format-time-from-id-C7YvcXDM.js → format-time-from-id-Cq6U2Bxo.js} +1 -1
  68. package/dist/{format-unit-display-Dfiq_rw7.js → format-unit-display-DQLT3yWg.js} +99 -101
  69. package/dist/{id-to-date-6hzUYycs.js → id-to-date-F63bzmo9.js} +1 -1
  70. package/dist/{import-export.helper-D5QuDEDV.js → import-export.helper-C-wM1uvH.js} +5 -5
  71. package/dist/{index-CD9IHjp3.js → index-BI_mOT-T.js} +1 -1
  72. package/dist/{index-CPFsBIFO.js → index-CUK2ixs-.js} +3 -3
  73. package/dist/{index-Crdk73ES.js → index-CvbK4SMT.js} +1 -1
  74. package/dist/{lz-string-CCRQaGZF.js → lz-string-DaX9t6Vd.js} +1 -1
  75. package/dist/{netsuite-C_VLrQoH.js → netsuite-Zrpzr6d8.js} +2522 -2505
  76. package/dist/{netsuite-explorer-BCuM8JZ1.js → netsuite-explorer-C3fHF-PT.js} +1 -1
  77. package/dist/{predefined-templates-BV4NkB9O.js → predefined-templates-DG6CeFks.js} +1 -1
  78. package/dist/{publish-versions-BinCKAtn.js → publish-versions-Cr7-V-Br.js} +1 -1
  79. package/dist/purchase-order-template-wj3XUGRR.js +41 -0
  80. package/dist/{recalculationUtils-ISOYv_rW.js → recalculationUtils-B2fP6IRt.js} +1 -1
  81. package/dist/{row-action.enum-BQCb8S3i.js → row-action.enum-fy5kNv1e.js} +1 -1
  82. package/dist/{rules-CW08Pe1t.js → rules-BbnkP4bE.js} +3 -3
  83. package/dist/{stock-Bh5IJNfM.js → stock-2HrEwnse.js} +1 -1
  84. package/dist/{stock-Cv_zWpOe.js → stock-qgCoZCip.js} +2 -2
  85. package/dist/stores/inventory.in-flight.spec.d.ts +1 -0
  86. package/dist/{supplier-D3h2DfJz.js → supplier-jSpdakxP.js} +2 -2
  87. package/dist/{surcharge-9e8wa-vK.js → surcharge-BUcmyVUD.js} +1 -1
  88. package/dist/tsconfig.app.tsbuildinfo +1 -1
  89. package/dist/{uom-rules-BRmDOW0t.js → uom-rules-CRVV9zbT.js} +1 -1
  90. package/dist/{use-ingredient-select-dialog-D8ibotty.js → use-ingredient-select-dialog-BEpP8U3E.js} +2 -2
  91. package/dist/{use-inventory-binding-dialog-D2xL-vbo.js → use-inventory-binding-dialog-C71O7N8L.js} +2 -2
  92. package/dist/{use-template-enabled-locations-Bb7vUiAf.js → use-template-enabled-locations-DIN3OgYg.js} +2 -2
  93. package/dist/{use-transfer-locations-B2yday-I.js → use-transfer-locations-Bp60KXqJ.js} +2 -2
  94. package/dist/{useHrmPermission-CPEJKpoy.js → useHrmPermission-isSBKi_1.js} +1 -1
  95. package/dist/{useNavigationMenu-SHKOcKP-.js → useNavigationMenu-B7i0bnUj.js} +5 -5
  96. package/dist/{useSseClient-ED9mFSXt.js → useSseClient-DOVhr07c.js} +1 -1
  97. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +5 -0
  98. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.spec.d.ts +1 -0
  99. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-total-cost.d.ts +24 -0
  100. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-total-cost.spec.d.ts +1 -0
  101. package/dist/views/receive-request/helper/purchase-export.d.ts +26 -0
  102. package/dist/views/receive-request/helper/purchase-export.spec.d.ts +1 -0
  103. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +3 -3
  104. package/dist/{vue-Tmyz7_6a.js → vue-XyWi0ihT.js} +37 -30
  105. package/dist/{vue-i18n-BY0GeUdz.js → vue-i18n-B1LiOy9S.js} +479 -479
  106. package/dist/{xlsx.util-DQnB9ape.js → xlsx.util-CLxGkNhJ.js} +2 -2
  107. package/package.json +5 -7
  108. package/dist/ClosingTemplateView-BHe5gCFH.js +0 -2358
  109. package/dist/ReceiveRequestView-DuU5hqQU.js +0 -729
  110. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-ajtRmauo.js +0 -4961
  111. package/dist/purchase-order-template-BZUOWGmV.js +0 -41
@@ -1,107 +1,105 @@
1
- import { defineComponent as at, ref as P, onBeforeUnmount as Qt, computed as B, watch as Ke, createElementBlock as y, openBlock as i, Fragment as Re, createBlock as ve, createVNode as E, Teleport as dt, Transition as Ht, withCtx as Ie, createCommentVNode as q, createElementVNode as e, toDisplayString as p, unref as n, normalizeClass as H, createTextVNode as rt, renderList as tt, withModifiers as Kt, mergeModels as Gt, useModel as Xt, resolveComponent as Te, getCurrentScope as Zt, onScopeDispose as en, h as Ee, onMounted as tn, onUnmounted as nn, normalizeStyle as gt, watchEffect as an, isRef as Rt, normalizeProps as Pt, mergeProps as yt, guardReactiveProps as sn } from "vue";
2
- import { a as rn } from "./FeaturePageGate.vue_vue_type_script_setup_true_lang-CvFbN-7h.js";
3
- import { u as on, l as ln } from "./netsuite-C_VLrQoH.js";
4
- import { u as mt, a as un, G as cn, a1 as Dt, t as dn, a2 as Ge, q as mn, c as fn, D as ut, x as pn } from "./app-Coquqqkh.js";
5
- import { i as _t, _ as vn } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Qd3R-TWu.js";
6
- import { a as qt, d as yn } from "./rules-CW08Pe1t.js";
7
- import { b as bn, d as hn, c as gn, e as _n, f as xn, P as Bt, h as wn, a as kn, _ as Cn, g as Fn } from "./TransferDetails.vue_vue_type_script_setup_true_lang-ajtRmauo.js";
8
- import { i as Sn } from "./id-to-date-6hzUYycs.js";
9
- import { d as Xe } from "./dayjs.min-CciBGvaL.js";
10
- import { e as Rn } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-60B3tkI-.js";
11
- import { u as Pn } from "./useTabStorage-BkIVScW_.js";
12
- import { u as Et, _ as Dn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
13
- import { components as qn, useSnackbar as ft, useDialog as En, useBreakpoints as Nn } from "@feedmepos/ui-library";
14
- import { d as On, u as $n, _ as An, a as Bn, c as Tn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-I_6Wu-P-.js";
15
- import { useI18n as it, useCoreStore as Tt } from "@feedmepos/mf-common";
16
- import { u as It, a as In } from "./supplier-D3h2DfJz.js";
17
- import { u as xt, P as Ln } from "./feature-DdZZAV6X.js";
18
- import { b as zn } from "./vue-Tmyz7_6a.js";
19
- import { u as Mn } from "./stock-Bh5IJNfM.js";
20
- import { u as nt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpiuOVuT.js";
21
- import { b as Lt, a as Un } from "./format-unit-display-Dfiq_rw7.js";
22
- import { _ as Vn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
1
+ import { defineComponent as at, ref as P, onBeforeUnmount as Yt, computed as A, watch as Qe, createElementBlock as y, openBlock as i, Fragment as Se, createBlock as pe, createVNode as E, Teleport as dt, Transition as Ht, withCtx as Ae, createCommentVNode as q, createElementVNode as e, toDisplayString as p, unref as n, normalizeClass as Q, createTextVNode as rt, renderList as tt, withModifiers as Qt, mergeModels as Gt, useModel as Kt, resolveComponent as Oe, getCurrentScope as Xt, onScopeDispose as Zt, h as qe, onMounted as en, onUnmounted as tn, normalizeStyle as gt, watchEffect as nn, isRef as Rt, normalizeProps as Pt, mergeProps as yt, guardReactiveProps as an } from "vue";
2
+ import { a as sn } from "./FeaturePageGate.vue_vue_type_script_setup_true_lang-CbrcFNoj.js";
3
+ import { u as rn, l as on } from "./netsuite-Zrpzr6d8.js";
4
+ import { u as mt, a as ln, G as un, a1 as Dt, t as cn, a2 as Ke, q as dn, c as mn, D as ut, x as fn } from "./app-CFO3QhF-.js";
5
+ import { i as _t, _ as pn } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B-wMlDXd.js";
6
+ import { d as vn, u as yn, _ as bn, a as hn, c as gn, p as _n } from "./EmailDialog.vue_vue_type_script_setup_true_lang-BnJdt92Q.js";
7
+ import { d as Xe } from "./dayjs.min-BVjxIhrP.js";
8
+ import { e as xn } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DRJptXCQ.js";
9
+ import { u as wn } from "./useTabStorage-BkIVScW_.js";
10
+ import { u as qt, _ as kn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
11
+ import { components as Cn, useSnackbar as ft, useDialog as Fn, useBreakpoints as Sn } from "@feedmepos/ui-library";
12
+ import { useI18n as it, useCoreStore as Ot } from "@feedmepos/mf-common";
13
+ import { u as At, a as Rn } from "./supplier-jSpdakxP.js";
14
+ import { u as xt, P as Pn } from "./feature-C1JuDWvs.js";
15
+ import { b as Dn } from "./vue-XyWi0ihT.js";
16
+ import { u as qn } from "./stock-2HrEwnse.js";
17
+ import { u as nt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-ZSuKa-oz.js";
18
+ import { b as Tt, a as En } from "./format-unit-display-DQLT3yWg.js";
19
+ import { b as Nn, d as $n, c as Bn, e as On, g as An, P as It, f as Tn, a as In, _ as Ln } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CHyAdS3A.js";
20
+ import { _ as zn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
23
21
  import { F as ot } from "./index-eGvSlWMU.js";
24
- import { P as Jn, J as jn, D as Wn } from "./app-C39bYJmq.js";
25
- import { a as Yn, t as Qn } from "./date2-79rkBzVf.js";
26
- import { F as Nt } from "./form-mode.enum-BKiNVH6A.js";
27
- import { p as Hn } from "./format-time-from-id-C7YvcXDM.js";
28
- import { defineStore as Kn } from "pinia";
29
- import { u as Gn } from "./useSseClient-ED9mFSXt.js";
30
- import { u as Xn } from "./use-row-action-Cvq6VO38.js";
31
- import { R as ct, D as Zn } from "./row-action.enum-BQCb8S3i.js";
32
- import { u as ea } from "./vue-i18n-BY0GeUdz.js";
33
- const ta = {
22
+ import { P as Mn, J as Un, D as Vn } from "./app-C39bYJmq.js";
23
+ import { a as Jn, t as jn } from "./date2-BMfqPhRQ.js";
24
+ import { F as Et } from "./form-mode.enum-BKiNVH6A.js";
25
+ import { p as Wn } from "./format-time-from-id-Cq6U2Bxo.js";
26
+ import { defineStore as Yn } from "pinia";
27
+ import { u as Hn } from "./useSseClient-DOVhr07c.js";
28
+ import { u as Qn } from "./use-row-action-Cvq6VO38.js";
29
+ import { R as ct, D as Gn } from "./row-action.enum-fy5kNv1e.js";
30
+ import { u as Kn } from "./vue-i18n-B1LiOy9S.js";
31
+ const Xn = {
34
32
  key: 0,
35
33
  class: "fixed inset-0 z-[200] bg-white flex flex-col overflow-hidden",
36
34
  style: { "font-family": "Inter, sans-serif" }
37
- }, na = {
35
+ }, Zn = {
38
36
  key: 0,
39
37
  class: "flex items-center justify-between px-24 h-[64px] border-b border-[#F0F0F0] shrink-0 bg-white"
40
- }, aa = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, sa = { class: "flex items-center gap-8" }, ra = {
38
+ }, ea = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, ta = { class: "flex items-center gap-8" }, na = {
41
39
  key: 1,
42
40
  class: "flex items-center justify-center px-32 py-16 border-b border-[#F0F0F0] shrink-0 bg-white"
43
- }, oa = { class: "flex items-center max-w-[600px] w-full" }, la = ["disabled"], ia = { key: 1 }, ua = ["disabled"], ca = { key: 1 }, da = {
41
+ }, aa = { class: "flex items-center max-w-[600px] w-full" }, sa = ["disabled"], ra = { key: 1 }, oa = ["disabled"], la = { key: 1 }, ia = {
44
42
  class: "flex flex-col items-center gap-4 min-w-0",
45
43
  disabled: !0
46
- }, ma = { class: "flex flex-1 overflow-hidden" }, fa = { class: "flex-1 min-w-0 overflow-y-auto" }, pa = {
44
+ }, ua = { class: "flex flex-1 overflow-hidden" }, ca = { class: "flex-1 min-w-0 overflow-y-auto" }, da = {
47
45
  key: 0,
48
46
  class: "px-32 py-24"
49
- }, va = { class: "flex flex-col gap-4 mb-10" }, ya = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, ba = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, ha = {
47
+ }, ma = { class: "flex flex-col gap-4 mb-10" }, fa = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, pa = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, va = {
50
48
  key: 0,
51
49
  "data-testid": "wizard-destination-checking",
52
50
  role: "status",
53
51
  class: "flex items-center gap-8 mb-12 fm-typo-en-body-md-400 text-[#6B6C70]"
54
- }, ga = {
52
+ }, ya = {
55
53
  key: 1,
56
54
  "data-testid": "wizard-destination-error",
57
55
  role: "alert",
58
56
  class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-12"
59
- }, _a = { class: "fm-typo-en-body-md-400 text-red-800" }, xa = {
57
+ }, ba = { class: "fm-typo-en-body-md-400 text-red-800" }, ha = {
60
58
  key: 2,
61
59
  "data-testid": "wizard-destination-unavailable",
62
60
  role: "alert",
63
61
  class: "rounded-md border border-[#E0E0E0] bg-[#FAFAFA] px-16 py-8 mb-12 fm-typo-en-body-md-400 text-[#4B4B4B]"
64
- }, wa = { class: "mb-12" }, ka = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, Ca = ["onClick"], Fa = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Sa = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, Ra = { class: "flex-1 min-w-0" }, Pa = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Da = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, qa = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Ea = {
62
+ }, ga = { class: "mb-12" }, _a = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, xa = ["onClick"], wa = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, ka = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, Ca = { class: "flex-1 min-w-0" }, Fa = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Sa = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, Ra = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Pa = {
65
63
  key: 0,
66
64
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
67
- }, Na = {
65
+ }, Da = {
68
66
  key: 0,
69
67
  class: "py-40 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
70
- }, Oa = {
68
+ }, qa = {
71
69
  key: 1,
72
70
  class: "px-32 py-24"
73
- }, $a = { class: "flex flex-col gap-4 mb-12" }, Aa = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Ba = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Ta = { class: "grid grid-cols-2 gap-12 mb-12" }, Ia = { class: "flex items-start justify-between mb-12" }, La = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, za = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Ma = { class: "flex items-start justify-between mb-12" }, Ua = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, Va = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Ja = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ja = {
71
+ }, Ea = { class: "flex flex-col gap-4 mb-12" }, Na = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, $a = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Ba = { class: "grid grid-cols-2 gap-12 mb-12" }, Oa = { class: "flex items-start justify-between mb-12" }, Aa = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, Ta = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Ia = { class: "flex items-start justify-between mb-12" }, La = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, za = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Ma = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, Ua = {
74
72
  key: 0,
75
73
  "data-testid": "wizard-template-required",
76
74
  class: "fm-typo-en-body-sm-400 text-[#6B6C70] mb-12"
77
- }, Wa = { class: "mb-12" }, Ya = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, Qa = ["onClick"], Ha = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Ka = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, Ga = { class: "flex-1 min-w-0" }, Xa = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Za = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, es = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, ts = {
75
+ }, Va = { class: "mb-12" }, Ja = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, ja = ["onClick"], Wa = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Ya = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, Ha = { class: "flex-1 min-w-0" }, Qa = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Ga = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, Ka = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Xa = {
78
76
  key: 0,
79
77
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
80
- }, ns = {
78
+ }, Za = {
81
79
  key: 0,
82
80
  class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
83
- }, as = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ss = { class: "mb-12" }, rs = {
81
+ }, es = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ts = { class: "mb-12" }, ns = {
84
82
  key: 0,
85
83
  class: "py-32 flex justify-center"
86
- }, os = {
84
+ }, as = {
87
85
  key: 1,
88
86
  class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
89
- }, ls = {
87
+ }, ss = {
90
88
  key: 2,
91
89
  class: "flex flex-col gap-8"
92
- }, is = ["onClick"], us = { class: "flex-1 min-w-0" }, cs = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, ds = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, ms = {
90
+ }, rs = ["onClick"], os = { class: "flex-1 min-w-0" }, ls = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, is = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, us = {
93
91
  key: 0,
94
92
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
95
- }, fs = {
93
+ }, cs = {
96
94
  key: 2,
97
95
  class: "px-32 py-24"
98
- }, ps = { class: "flex flex-col gap-4 mb-12" }, vs = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, ys = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, bs = { class: "p-4" }, hs = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, gs = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, _s = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, xs = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, ws = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, ks = {
96
+ }, ds = { class: "flex flex-col gap-4 mb-12" }, ms = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, fs = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, ps = { class: "p-4" }, vs = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, ys = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, bs = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, hs = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, gs = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, _s = {
99
97
  key: 0,
100
98
  class: "text-[11px] leading-[14px] text-[#6B6C70]"
101
- }, Cs = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Fs = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Ss = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Rs = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Ps = {
99
+ }, xs = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, ws = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, ks = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Cs = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Fs = {
102
100
  key: 0,
103
101
  class: "text-[11px] leading-[14px] text-[#6B6C70]"
104
- }, Ds = { class: "flex items-center justify-between gap-8 px-10 py-4" }, qs = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, Es = { class: "fm-typo-en-title-md-600" }, Ns = { class: "flex flex-col gap-16" }, Os = { class: "fm-typo-en-body-md-400" }, $s = { class: "max-h-[300px] overflow-y-auto" }, As = { class: "list-disc pl-16" }, Bs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ts = { class: "flex w-full gap-8 justify-end" }, Is = /* @__PURE__ */ at({
102
+ }, Ss = { class: "flex items-center justify-between gap-8 px-10 py-4" }, Rs = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, Ps = { class: "fm-typo-en-title-md-600" }, Ds = { class: "flex flex-col gap-16" }, qs = { class: "fm-typo-en-body-md-400" }, Es = { class: "max-h-[300px] overflow-y-auto" }, Ns = { class: "list-disc pl-16" }, $s = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Bs = { class: "flex w-full gap-8 justify-end" }, Os = /* @__PURE__ */ at({
105
103
  __name: "CreateTransferWizard",
106
104
  props: {
107
105
  show: { type: Boolean },
@@ -110,91 +108,91 @@ const ta = {
110
108
  },
111
109
  emits: ["update:show", "submitted"],
112
110
  setup(C, { emit: _ }) {
113
- const { FmButton: x, FmDialog: $, FmIcon: O, FmTextField: L } = qn, K = C, V = _, { t: o } = it(), s = ft(), g = mt(), J = It(), Fe = un(), m = Mn(), d = nt(), h = Lt(), c = xt(), w = zn("bulk-receive-transfer"), l = P(0), f = P(!1), T = P(null), W = P(""), R = P(null), j = P(null), I = P(null), se = P(""), ce = P(""), de = P(!1), me = P(!1), Je = P(!1), Se = P(!1), je = P(!1), We = P(/* @__PURE__ */ new Map()), Me = P(), le = P([]), re = P("idle");
114
- let Ce = null, we = null;
115
- function Ne() {
116
- we == null || we.abort(), we = null;
117
- }
118
- Qt(Ne);
119
- const Ze = B(
120
- () => re.value === "ready" && c.warehouseRequestRequiresTemplate
111
+ const { FmButton: x, FmDialog: B, FmIcon: $, FmTextField: L } = Cn, G = C, U = _, { t: o } = it(), s = ft(), h = mt(), V = At(), Ce = ln(), m = qn(), d = nt(), b = Tt(), c = xt(), w = Dn("bulk-receive-transfer"), l = P(0), f = P(!1), T = P(null), W = P(""), R = P(null), J = P(null), I = P(null), ae = P(""), ue = P(""), ce = P(!1), de = P(!1), Ue = P(!1), Fe = P(!1), Ve = P(!1), Je = P(/* @__PURE__ */ new Map()), Le = P(), oe = P([]), se = P("idle");
112
+ let ke = null, _e = null;
113
+ function Ee() {
114
+ _e == null || _e.abort(), _e = null;
115
+ }
116
+ Yt(Ee);
117
+ const Ze = A(
118
+ () => se.value === "ready" && c.warehouseRequestRequiresTemplate
121
119
  );
122
- function Oe(t) {
120
+ function Ne(t) {
123
121
  return !c.warehouseRequestRequiresTemplate || !!t.template || t.supplier.internal === "restaurant";
124
122
  }
125
- function Ye() {
123
+ function je() {
126
124
  var a;
127
125
  const t = T.value;
128
- return !!t && re.value === "ready" && Ce === t.dbName && ((a = g._currentLocation) == null ? void 0 : a.dbName) === t.dbName && w.state.value === "enabled";
126
+ return !!t && se.value === "ready" && ke === t.dbName && ((a = h._currentLocation) == null ? void 0 : a.dbName) === t.dbName && w.state.value === "enabled";
129
127
  }
130
- const N = B(
131
- () => !!T.value && re.value !== "checking"
132
- ), k = B(() => R.value === "transfer" ? !!j.value : R.value === "template" ? !!I.value : !1), z = B(() => (le.value.length ? le.value : Y.value.items ?? []).some((a) => a.quantity.amount > 0)), ne = B(() => de.value), ae = B(
133
- () => z.value && me.value && Je.value && !de.value
134
- ), fe = B(() => l.value === 0 ? N.value : l.value === 1 ? k.value : l.value === 2 ? ae.value : !1), Le = B(
128
+ const N = A(
129
+ () => !!T.value && se.value !== "checking"
130
+ ), k = A(() => R.value === "transfer" ? !!J.value : R.value === "template" ? !!I.value : !1), z = A(() => (oe.value.length ? oe.value : Y.value.items ?? []).some((a) => a.quantity.amount > 0)), ne = A(() => ce.value), me = A(
131
+ () => z.value && de.value && Ue.value && !ce.value
132
+ ), Te = A(() => l.value === 0 ? N.value : l.value === 1 ? k.value : l.value === 2 ? me.value : !1), We = A(
135
133
  () => l.value === 2 ? o("inventory.transfer.receiveRequest.bulk.wizard.createTransferBtn") : o("inventory.transfer.receiveRequest.bulk.wizard.continueBtn")
136
- ), $e = B(
134
+ ), ze = A(
137
135
  () => u.value === "Purchase" ? "Purchase method" : "Transfer method"
138
- ), U = B(
136
+ ), j = A(
139
137
  () => u.value === "Purchase" ? "Purchase details" : "Transfer details"
140
- ), ye = B(() => {
138
+ ), xe = A(() => {
141
139
  const t = W.value.trim().toLowerCase();
142
- let a = g.locations;
143
- return K.selectedOutletIds && K.selectedOutletIds.length > 0 && (a = a.filter((S) => K.selectedOutletIds.includes(S.doc._id))), t ? a.filter(
140
+ let a = h.locations;
141
+ return G.selectedOutletIds && G.selectedOutletIds.length > 0 && (a = a.filter((S) => G.selectedOutletIds.includes(S.doc._id))), t ? a.filter(
144
142
  (S) => S.name.toLowerCase().includes(t) || (S.doc.profile.code ?? "").toLowerCase().includes(t)
145
143
  ) : a;
146
- }), Ue = B(() => {
147
- var xe;
148
- const t = (xe = T.value) == null ? void 0 : xe.doc._id, a = J.suppliers.map((ue) => ({
149
- doc: ue,
150
- name: ue.name,
144
+ }), Ge = A(() => {
145
+ var ge;
146
+ const t = (ge = T.value) == null ? void 0 : ge.doc._id, a = V.suppliers.map((ie) => ({
147
+ doc: ie,
148
+ name: ie.name,
151
149
  dbName: "",
152
150
  type: "supplier",
153
151
  acceptRequest: !0
154
152
  })), X = [
155
- ...g.allLocations ?? g.locations,
153
+ ...h.allLocations ?? h.locations,
156
154
  ...a
157
155
  ].filter(
158
- (ue) => ue.doc._id !== t && (!Ze.value || ue.type === "restaurant")
159
- ), v = se.value.trim().toLowerCase();
160
- return v ? X.filter((ue) => {
156
+ (ie) => ie.doc._id !== t && (!Ze.value || ie.type === "restaurant")
157
+ ), v = ae.value.trim().toLowerCase();
158
+ return v ? X.filter((ie) => {
161
159
  var He;
162
- const ze = ue.type === "supplier" ? "" : ((He = ue.doc.profile) == null ? void 0 : He.code) ?? "";
163
- return ue.name.toLowerCase().includes(v) || ze.toLowerCase().includes(v);
160
+ const Ie = ie.type === "supplier" ? "" : ((He = ie.doc.profile) == null ? void 0 : He.code) ?? "";
161
+ return ie.name.toLowerCase().includes(v) || Ie.toLowerCase().includes(v);
164
162
  }) : X;
165
- }), r = B(() => {
166
- const t = ce.value.trim().toLowerCase(), a = h.templates;
163
+ }), r = A(() => {
164
+ const t = ue.value.trim().toLowerCase(), a = b.templates;
167
165
  return t ? a.filter((S) => S.name.toLowerCase().includes(t)) : a;
168
- }), u = B(() => {
166
+ }), u = A(() => {
169
167
  var t;
170
168
  if (Y.value.supplier)
171
169
  return typeof Y.value.supplier.internal == "string" ? "Transfer" : "Purchase";
172
- if (R.value === "transfer" && j.value)
173
- return j.value.type === "supplier" ? "Purchase" : "Transfer";
170
+ if (R.value === "transfer" && J.value)
171
+ return J.value.type === "supplier" ? "Purchase" : "Transfer";
174
172
  if (R.value === "template" && I.value) {
175
- const a = h.templates.find(
173
+ const a = b.templates.find(
176
174
  (S) => S._id === I.value
177
175
  );
178
176
  if ((t = a == null ? void 0 : a.purchaseOrder) != null && t.supplier)
179
177
  return typeof a.purchaseOrder.supplier.internal == "string" ? "Transfer" : "Purchase";
180
178
  }
181
179
  return "Transfer";
182
- }), b = B(() => T.value ? T.value.name : o("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), A = B(() => R.value === "transfer" ? u.value === "Purchase" ? "Purchase from Supplier" : o("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? o("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : o("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), M = B(() => {
180
+ }), g = A(() => T.value ? T.value.name : o("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), O = A(() => R.value === "transfer" ? u.value === "Purchase" ? "Purchase from Supplier" : o("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? o("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : o("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), M = A(() => {
183
181
  var t;
184
- if (R.value === "transfer" && j.value)
185
- return j.value.name;
182
+ if (R.value === "transfer" && J.value)
183
+ return J.value.name;
186
184
  if (R.value === "template" && I.value) {
187
- const a = h.templates.find((S) => S._id === I.value);
185
+ const a = b.templates.find((S) => S._id === I.value);
188
186
  return (t = a == null ? void 0 : a.purchaseOrder) != null && t.supplier ? a.purchaseOrder.supplier.name || I.value : (a == null ? void 0 : a.name) ?? I.value;
189
187
  }
190
188
  return o("inventory.transfer.receiveRequest.bulk.wizard.noneYet");
191
189
  });
192
190
  function F(t) {
193
- var X, v, xe, ue, ze;
194
- const a = (X = t.doc.profile) != null && X.code ? `#${t.doc.profile.code}` : "", S = [(xe = (v = t.doc.profile) == null ? void 0 : v.address) == null ? void 0 : xe.line1, (ze = (ue = t.doc.profile) == null ? void 0 : ue.address) == null ? void 0 : ze.city].filter(Boolean).join(" · ");
191
+ var X, v, ge, ie, Ie;
192
+ const a = (X = t.doc.profile) != null && X.code ? `#${t.doc.profile.code}` : "", S = [(ge = (v = t.doc.profile) == null ? void 0 : v.address) == null ? void 0 : ge.line1, (Ie = (ie = t.doc.profile) == null ? void 0 : ie.address) == null ? void 0 : Ie.city].filter(Boolean).join(" · ");
195
193
  return [a, S].filter(Boolean).join(" · ");
196
194
  }
197
- function Q(t) {
195
+ function H(t) {
198
196
  var S, X;
199
197
  return [(S = t.doc.address) == null ? void 0 : S.line1, (X = t.doc.address) == null ? void 0 : X.city].filter(Boolean).join(" · ");
200
198
  }
@@ -203,23 +201,23 @@ const ta = {
203
201
  return t.type === "supplier" ? "" : ((a = t.doc.profile) == null ? void 0 : a.code) ?? "";
204
202
  }
205
203
  function ee(t) {
206
- var a, S, X, v, xe, ue;
207
- return t.type === "supplier" ? [(a = t.doc.address) == null ? void 0 : a.line1, (S = t.doc.address) == null ? void 0 : S.city].filter(Boolean).join(" · ") : [(v = (X = t.doc.profile) == null ? void 0 : X.address) == null ? void 0 : v.line1, (ue = (xe = t.doc.profile) == null ? void 0 : xe.address) == null ? void 0 : ue.city].filter(Boolean).join(" · ");
204
+ var a, S, X, v, ge, ie;
205
+ return t.type === "supplier" ? [(a = t.doc.address) == null ? void 0 : a.line1, (S = t.doc.address) == null ? void 0 : S.city].filter(Boolean).join(" · ") : [(v = (X = t.doc.profile) == null ? void 0 : X.address) == null ? void 0 : v.line1, (ie = (ge = t.doc.profile) == null ? void 0 : ge.address) == null ? void 0 : ie.city].filter(Boolean).join(" · ");
208
206
  }
209
- const oe = B(
207
+ const re = A(
210
208
  () => T.value ? F(T.value) : ""
211
- ), te = B(
212
- () => R.value === "transfer" && j.value ? j.value.type === "supplier" ? Q(j.value) : F(j.value) : ""
213
- ), pe = B(() => {
214
- const a = (le.value.length ? le.value : Y.value.items ?? []).filter((S) => S.quantity.amount > 0).length;
209
+ ), te = A(
210
+ () => R.value === "transfer" && J.value ? J.value.type === "supplier" ? H(J.value) : F(J.value) : ""
211
+ ), fe = A(() => {
212
+ const a = (oe.value.length ? oe.value : Y.value.items ?? []).filter((S) => S.quantity.amount > 0).length;
215
213
  return a === 0 ? o("inventory.transfer.receiveRequest.bulk.wizard.noneYet") : `${a} ${a === 1 ? "item" : "items"}`;
216
214
  });
217
- function be(t) {
215
+ function ve(t) {
218
216
  var S;
219
217
  const a = (S = t.purchaseOrder) == null ? void 0 : S.supplier;
220
218
  return a ? a.internal === "warehouse" ? `Transfer from ${a.name}` : a.internal === "restaurant" ? `Transfer from ${a.name}` : `Purchase from ${a.name}` : "";
221
219
  }
222
- function Pe(t) {
220
+ function Re(t) {
223
221
  return {
224
222
  _id: t.doc._id,
225
223
  internal: t.type,
@@ -237,7 +235,7 @@ const ta = {
237
235
  }
238
236
  };
239
237
  }
240
- function Ae(t) {
238
+ function $e(t) {
241
239
  return {
242
240
  _id: t._id,
243
241
  internal: void 0,
@@ -258,9 +256,9 @@ const ta = {
258
256
  }
259
257
  };
260
258
  }
261
- function ge() {
259
+ function be() {
262
260
  var X;
263
- const t = I.value ? h.templates.find((v) => v._id === I.value) : void 0, a = {
261
+ const t = I.value ? b.templates.find((v) => v._id === I.value) : void 0, a = {
264
262
  _rev: void 0,
265
263
  email: void 0,
266
264
  internal: void 0,
@@ -271,7 +269,7 @@ const ta = {
271
269
  _id: "",
272
270
  name: "",
273
271
  address: { line2: void 0, line1: "", state: "", city: "", postcode: "", country: "" }
274
- }, S = R.value === "transfer" && j.value ? j.value.type === "supplier" ? Ae(j.value.doc) : Pe(j.value) : R.value === "template" && (t != null && t.purchaseOrder.supplier) ? t.purchaseOrder.supplier : a;
272
+ }, S = R.value === "transfer" && J.value ? J.value.type === "supplier" ? $e(J.value.doc) : Re(J.value) : R.value === "template" && (t != null && t.purchaseOrder.supplier) ? t.purchaseOrder.supplier : a;
275
273
  return {
276
274
  remark: void 0,
277
275
  ref: void 0,
@@ -287,62 +285,62 @@ const ta = {
287
285
  templateDoc: t
288
286
  };
289
287
  }
290
- const Y = P(ge()), G = P(`${Math.random()}`), ke = B(
288
+ const Y = P(be()), K = P(`${Math.random()}`), we = A(
291
289
  () => {
292
290
  var t;
293
291
  return ((t = Y.value.items) == null ? void 0 : t.filter((a) => a.quantity.amount === 0)) ?? [];
294
292
  }
295
293
  );
296
- Ke(
297
- () => K.show,
294
+ Qe(
295
+ () => G.show,
298
296
  (t) => {
299
- if (Ne(), t && (l.value = 0, f.value = !1, T.value = null, re.value = "idle", Ce = null, R.value = null, j.value = null, I.value = null, W.value = "", se.value = "", ce.value = "", me.value = !1, Je.value = !1, le.value = [], Y.value = ge(), G.value = `${Math.random()}`, K.selectedOutletIds && K.selectedOutletIds.length === 1)) {
300
- const a = g.locations.find(
301
- (S) => S.doc._id === K.selectedOutletIds[0]
297
+ if (Ee(), t && (l.value = 0, f.value = !1, T.value = null, se.value = "idle", ke = null, R.value = null, J.value = null, I.value = null, W.value = "", ae.value = "", ue.value = "", de.value = !1, Ue.value = !1, oe.value = [], Y.value = be(), K.value = `${Math.random()}`, G.selectedOutletIds && G.selectedOutletIds.length === 1)) {
298
+ const a = h.locations.find(
299
+ (S) => S.doc._id === G.selectedOutletIds[0]
302
300
  );
303
- a && (T.value = a, De(a));
301
+ a && (T.value = a, Pe(a));
304
302
  }
305
303
  }
306
304
  );
307
- async function De(t) {
305
+ async function Pe(t) {
308
306
  var X;
309
- Ne();
307
+ Ee();
310
308
  const a = new AbortController();
311
- we = a, Ce !== t.dbName && (Ce = null, R.value = null, j.value = null, I.value = null, le.value = []), me.value = !1, re.value = "checking", g._currentLocation = t;
309
+ _e = a, ke !== t.dbName && (ke = null, R.value = null, J.value = null, I.value = null, oe.value = []), de.value = !1, se.value = "checking", h._currentLocation = t;
312
310
  const S = await c.awaitLocationFeatures(t.dbName, {
313
311
  signal: a.signal,
314
312
  retryOnError: !0
315
313
  });
316
- if (we === a) {
314
+ if (_e === a) {
317
315
  if (((X = T.value) == null ? void 0 : X.dbName) !== t.dbName) {
318
- re.value = "idle";
316
+ se.value = "idle";
319
317
  return;
320
318
  }
321
319
  if (S !== "ready") {
322
- re.value = "error";
320
+ se.value = "error";
323
321
  return;
324
322
  }
325
323
  if (w.state.value !== "enabled") {
326
- re.value = "unavailable";
324
+ se.value = "unavailable";
327
325
  return;
328
326
  }
329
- re.value = "ready", Ce = t.dbName, pt(a.signal), Mt(a.signal), h.fetchTemplates(), l.value = 1;
327
+ se.value = "ready", ke = t.dbName, pt(a.signal), zt(a.signal), b.fetchTemplates(), l.value = 1;
330
328
  }
331
329
  }
332
- function qe(t) {
333
- T.value = t, re.value !== "checking" && (re.value = "idle");
330
+ function De(t) {
331
+ T.value = t, se.value !== "checking" && (se.value = "idle");
334
332
  }
335
333
  function D() {
336
- T.value && De(T.value);
334
+ T.value && Pe(T.value);
337
335
  }
338
- function ie() {
336
+ function le() {
339
337
  if (l.value === 0) {
340
338
  const t = T.value;
341
- if (!t || re.value === "checking") return;
342
- De(t);
339
+ if (!t || se.value === "checking") return;
340
+ Pe(t);
343
341
  } else if (l.value === 1) {
344
- if (!k.value || !Ye()) return;
345
- if (!Oe(ge())) {
342
+ if (!k.value || !je()) return;
343
+ if (!Ne(be())) {
346
344
  s.open({
347
345
  title: "Template required",
348
346
  message: "This outlet requires a template unless transferring from another outlet.",
@@ -350,20 +348,20 @@ const ta = {
350
348
  });
351
349
  return;
352
350
  }
353
- Y.value = ge(), G.value = `${Math.random()}`, le.value = [], l.value = 2;
354
- } else l.value === 2 && Vt();
351
+ Y.value = be(), K.value = `${Math.random()}`, oe.value = [], l.value = 2;
352
+ } else l.value === 2 && Ut();
355
353
  }
356
- function he() {
354
+ function ye() {
357
355
  l.value > 0 && l.value--;
358
356
  }
359
- function _e(t) {
357
+ function he(t) {
360
358
  t < l.value && (l.value = t);
361
359
  }
362
- function Ve() {
363
- V("update:show", !1);
360
+ function Me() {
361
+ U("update:show", !1);
364
362
  }
365
- function Qe(t) {
366
- R.value !== t && (R.value = t, j.value = null, I.value = null, le.value = [], Y.value = {
363
+ function Ye(t) {
364
+ R.value !== t && (R.value = t, J.value = null, I.value = null, oe.value = [], Y.value = {
367
365
  ...Y.value,
368
366
  items: [],
369
367
  template: void 0,
@@ -371,16 +369,16 @@ const ta = {
371
369
  });
372
370
  }
373
371
  function st(t) {
374
- le.value = t ?? [];
372
+ oe.value = t ?? [];
375
373
  }
376
- Ke(I, (t) => {
377
- R.value === "template" && t && (Y.value = ge(), G.value = `${Math.random()}`);
374
+ Qe(I, (t) => {
375
+ R.value === "template" && t && (Y.value = be(), K.value = `${Math.random()}`);
378
376
  });
379
377
  async function pt(t) {
380
- me.value = !1;
378
+ de.value = !1;
381
379
  try {
382
- if (await J.readSuppliers(), t.aborted) return;
383
- me.value = !0;
380
+ if (await V.readSuppliers(), t.aborted) return;
381
+ de.value = !0;
384
382
  } catch {
385
383
  if (t.aborted) return;
386
384
  s.open({
@@ -390,39 +388,39 @@ const ta = {
390
388
  });
391
389
  }
392
390
  }
393
- async function Mt(t) {
394
- je.value = !0, We.value = /* @__PURE__ */ new Map();
391
+ async function zt(t) {
392
+ Ve.value = !0, Je.value = /* @__PURE__ */ new Map();
395
393
  try {
396
394
  const a = await m.readStockBalance();
397
395
  if (t.aborted) return;
398
396
  const S = /* @__PURE__ */ new Map();
399
397
  for (const X of a.skus ?? [])
400
398
  S.set(X.id, X);
401
- We.value = S;
399
+ Je.value = S;
402
400
  } catch {
403
401
  } finally {
404
- t.aborted || (je.value = !1);
402
+ t.aborted || (Ve.value = !1);
405
403
  }
406
404
  }
407
- function Ut() {
405
+ function Mt() {
408
406
  var t;
409
- (t = Me.value) != null && t.getFormData && (Y.value = { ...Y.value, ...Me.value.getFormData() });
407
+ (t = Le.value) != null && t.getFormData && (Y.value = { ...Y.value, ...Le.value.getFormData() });
410
408
  }
411
- function Vt() {
412
- if (Ut(), ke.value.length > 0) {
413
- Se.value = !0;
409
+ function Ut() {
410
+ if (Mt(), we.value.length > 0) {
411
+ Fe.value = !0;
414
412
  return;
415
413
  }
416
414
  kt();
417
415
  }
418
- function Jt() {
416
+ function Vt() {
419
417
  var t;
420
- Y.value.items = ((t = Y.value.items) == null ? void 0 : t.filter((a) => a.quantity.amount > 0)) ?? [], Se.value = !1, kt();
418
+ Y.value.items = ((t = Y.value.items) == null ? void 0 : t.filter((a) => a.quantity.amount > 0)) ?? [], Fe.value = !1, kt();
421
419
  }
422
420
  function kt() {
423
421
  var S, X;
424
- const t = Ln.validatePurchaseOrderItems({
425
- skusById: Fe.skuById ?? {},
422
+ const t = Pn.validatePurchaseOrderItems({
423
+ skusById: Ce.skuById ?? {},
426
424
  items: Y.value.items ?? []
427
425
  }), a = Object.values(t).flat();
428
426
  if (a.length > 0) {
@@ -434,17 +432,17 @@ const ta = {
434
432
  });
435
433
  return;
436
434
  }
437
- (X = (S = Me.value) == null ? void 0 : S.validateInputs) == null || X.call(S);
435
+ (X = (S = Le.value) == null ? void 0 : S.validateInputs) == null || X.call(S);
438
436
  }
439
- async function jt(t) {
440
- var v, xe;
441
- const a = T.value, S = we;
442
- if (!a || !S || Ce !== a.dbName) return !1;
437
+ async function Jt(t) {
438
+ var v, ge;
439
+ const a = T.value, S = _e;
440
+ if (!a || !S || ke !== a.dbName) return !1;
443
441
  const X = await c.awaitLocationFeatures(a.dbName, {
444
442
  signal: S.signal,
445
443
  retryOnError: !0
446
444
  });
447
- return S.signal.aborted || we !== S || ((v = T.value) == null ? void 0 : v.dbName) !== a.dbName || ((xe = g._currentLocation) == null ? void 0 : xe.dbName) !== a.dbName ? !1 : X !== "ready" ? (s.open({
445
+ return S.signal.aborted || _e !== S || ((v = T.value) == null ? void 0 : v.dbName) !== a.dbName || ((ge = h._currentLocation) == null ? void 0 : ge.dbName) !== a.dbName ? !1 : X !== "ready" ? (s.open({
448
446
  title: "Outlet settings couldn’t load",
449
447
  message: `Transfer requirements for ${a.name} are unconfirmed. Your details are kept — please try again.`,
450
448
  type: "warning"
@@ -452,17 +450,17 @@ const ta = {
452
450
  title: "Bulk Receive / Transfer is unavailable",
453
451
  message: `Transfers can’t be created for ${a.name}.`,
454
452
  type: "error"
455
- }), !1) : Oe(t) ? !0 : (s.open({
453
+ }), !1) : Ne(t) ? !0 : (s.open({
456
454
  title: "Template required",
457
455
  message: "This outlet requires a template unless transferring from another outlet.",
458
456
  type: "warning"
459
457
  }), !1);
460
458
  }
461
- async function Wt() {
462
- if (de.value) return;
459
+ async function jt() {
460
+ if (ce.value) return;
463
461
  const t = Y.value;
464
- if (de.value = !0, !await jt(t)) {
465
- de.value = !1;
462
+ if (ce.value = !0, !await Jt(t)) {
463
+ ce.value = !1;
466
464
  return;
467
465
  }
468
466
  if (t.items = t.items.filter((a) => a.quantity.amount > 0), !t.items.length) {
@@ -470,7 +468,7 @@ const ta = {
470
468
  title: "Cannot create order",
471
469
  message: "There are no items with non-zero amount in your request.",
472
470
  type: "error"
473
- }), de.value = !1;
471
+ }), ce.value = !1;
474
472
  return;
475
473
  }
476
474
  (t.supplier.internal === "warehouse" || t.supplier.internal === "restaurant") && (t.items = t.items.map(({ totalCost: a, ...S }) => S));
@@ -479,7 +477,7 @@ const ta = {
479
477
  title: o("inventory.transfer.receiveRequest.create.success"),
480
478
  message: o("inventory.transfer.receiveRequest.create.successMessage"),
481
479
  type: "success"
482
- }), V("submitted"), V("update:show", !1), Yt();
480
+ }), U("submitted"), U("update:show", !1), Wt();
483
481
  } catch (a) {
484
482
  s.open({
485
483
  title: o("inventory.transfer.receiveRequest.create.error.title"),
@@ -487,14 +485,14 @@ const ta = {
487
485
  type: "error"
488
486
  }), console.error("Error creating purchase order", a);
489
487
  } finally {
490
- de.value = !1;
488
+ ce.value = !1;
491
489
  }
492
490
  }
493
- function Yt() {
494
- l.value = 0, f.value = !1, T.value = null, R.value = null, j.value = null, I.value = null, W.value = "", se.value = "", ce.value = "", me.value = !1, Je.value = !1, le.value = [], Y.value = ge(), G.value = `${Math.random()}`;
491
+ function Wt() {
492
+ l.value = 0, f.value = !1, T.value = null, R.value = null, J.value = null, I.value = null, W.value = "", ae.value = "", ue.value = "", de.value = !1, Ue.value = !1, oe.value = [], Y.value = be(), K.value = `${Math.random()}`;
495
493
  }
496
- return (t, a) => (i(), y(Re, null, [
497
- (i(), ve(dt, { to: "body" }, [
494
+ return (t, a) => (i(), y(Se, null, [
495
+ (i(), pe(dt, { to: "body" }, [
498
496
  E(Ht, {
499
497
  "enter-active-class": "transition-opacity duration-150 ease-out",
500
498
  "enter-from-class": "opacity-0",
@@ -503,89 +501,89 @@ const ta = {
503
501
  "leave-from-class": "opacity-100",
504
502
  "leave-to-class": "opacity-0"
505
503
  }, {
506
- default: Ie(() => {
504
+ default: Ae(() => {
507
505
  var S, X;
508
506
  return [
509
- t.show ? (i(), y("div", ta, [
510
- f.value ? q("", !0) : (i(), y("div", na, [
511
- e("span", aa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
512
- e("div", sa, [
507
+ t.show ? (i(), y("div", Xn, [
508
+ f.value ? q("", !0) : (i(), y("div", Zn, [
509
+ e("span", ea, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
510
+ e("div", ta, [
513
511
  E(n(x), {
514
512
  variant: "tertiary",
515
513
  size: "md",
516
514
  label: n(o)("inventory.transfer.receiveRequest.bulk.wizard.cancelBtn"),
517
- onClick: Ve
515
+ onClick: Me
518
516
  }, null, 8, ["label"]),
519
- l.value > 0 ? (i(), ve(n(x), {
517
+ l.value > 0 ? (i(), pe(n(x), {
520
518
  key: 0,
521
519
  variant: "secondary",
522
520
  size: "md",
523
521
  "prepend-icon": "arrow_back",
524
522
  label: n(o)("inventory.transfer.receiveRequest.bulk.wizard.backBtn"),
525
- onClick: he
523
+ onClick: ye
526
524
  }, null, 8, ["label"])) : q("", !0),
527
525
  E(n(x), {
528
526
  size: "md",
529
- disabled: !fe.value,
530
- loading: de.value || re.value === "checking",
531
- label: Le.value,
532
- onClick: ie
527
+ disabled: !Te.value,
528
+ loading: ce.value || se.value === "checking",
529
+ label: We.value,
530
+ onClick: le
533
531
  }, null, 8, ["disabled", "loading", "label"])
534
532
  ])
535
533
  ])),
536
- f.value ? q("", !0) : (i(), y("div", ra, [
537
- e("div", oa, [
534
+ f.value ? q("", !0) : (i(), y("div", na, [
535
+ e("div", aa, [
538
536
  e("button", {
539
537
  class: "flex flex-col items-center gap-4 min-w-0 group",
540
538
  disabled: l.value <= 0,
541
- onClick: a[0] || (a[0] = (v) => _e(0))
539
+ onClick: a[0] || (a[0] = (v) => he(0))
542
540
  }, [
543
541
  e("div", {
544
- class: H([
542
+ class: Q([
545
543
  "w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
546
544
  l.value > 0 || l.value === 0 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
547
545
  ])
548
546
  }, [
549
- l.value > 0 ? (i(), ve(n(O), {
547
+ l.value > 0 ? (i(), pe(n($), {
550
548
  key: 0,
551
549
  name: "check",
552
550
  size: "sm"
553
- })) : (i(), y("span", ia, "1"))
551
+ })) : (i(), y("span", ra, "1"))
554
552
  ], 2),
555
553
  e("span", {
556
- class: H(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
554
+ class: Q(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
557
555
  }, " Select destination ", 2)
558
- ], 8, la),
556
+ ], 8, sa),
559
557
  e("div", {
560
- class: H(["flex-1 h-1 mx-8 transition-colors duration-200", l.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
558
+ class: Q(["flex-1 h-1 mx-8 transition-colors duration-200", l.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
561
559
  }, null, 2),
562
560
  e("button", {
563
561
  class: "flex flex-col items-center gap-4 min-w-0 group",
564
562
  disabled: l.value <= 1,
565
- onClick: a[1] || (a[1] = (v) => _e(1))
563
+ onClick: a[1] || (a[1] = (v) => he(1))
566
564
  }, [
567
565
  e("div", {
568
- class: H([
566
+ class: Q([
569
567
  "w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
570
568
  l.value > 1 || l.value === 1 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
571
569
  ])
572
570
  }, [
573
- l.value > 1 ? (i(), ve(n(O), {
571
+ l.value > 1 ? (i(), pe(n($), {
574
572
  key: 0,
575
573
  name: "check",
576
574
  size: "sm"
577
- })) : (i(), y("span", ca, "2"))
575
+ })) : (i(), y("span", la, "2"))
578
576
  ], 2),
579
577
  e("span", {
580
- class: H(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
581
- }, p($e.value), 3)
582
- ], 8, ua),
578
+ class: Q(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
579
+ }, p(ze.value), 3)
580
+ ], 8, oa),
583
581
  e("div", {
584
- class: H(["flex-1 h-1 mx-8 transition-colors duration-200", l.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
582
+ class: Q(["flex-1 h-1 mx-8 transition-colors duration-200", l.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
585
583
  }, null, 2),
586
- e("button", da, [
584
+ e("button", ia, [
587
585
  e("div", {
588
- class: H([
586
+ class: Q([
589
587
  "w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
590
588
  l.value === 2 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
591
589
  ])
@@ -593,33 +591,33 @@ const ta = {
593
591
  e("span", null, "3", -1)
594
592
  ]), 2),
595
593
  e("span", {
596
- class: H(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
597
- }, p(U.value), 3)
594
+ class: Q(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", l.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
595
+ }, p(j.value), 3)
598
596
  ])
599
597
  ])
600
598
  ])),
601
- e("div", ma, [
602
- e("div", fa, [
603
- l.value === 0 ? (i(), y("div", pa, [
604
- e("div", va, [
605
- e("h3", ya, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
606
- e("p", ba, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
599
+ e("div", ua, [
600
+ e("div", ca, [
601
+ l.value === 0 ? (i(), y("div", da, [
602
+ e("div", ma, [
603
+ e("h3", fa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
604
+ e("p", pa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
607
605
  ]),
608
- re.value === "checking" ? (i(), y("div", ha, [
609
- E(n(O), {
606
+ se.value === "checking" ? (i(), y("div", va, [
607
+ E(n($), {
610
608
  name: "progress_activity",
611
609
  class: "text-[#FF7823] animate-spin"
612
610
  }),
613
611
  a[12] || (a[12] = rt(" Checking outlet settings… "))
614
- ])) : re.value === "error" ? (i(), y("div", ga, [
615
- e("span", _a, " Settings for " + p((S = T.value) == null ? void 0 : S.name) + " couldn’t load, so its transfer requirements are unconfirmed. ", 1),
612
+ ])) : se.value === "error" ? (i(), y("div", ya, [
613
+ e("span", ba, " Settings for " + p((S = T.value) == null ? void 0 : S.name) + " couldn’t load, so its transfer requirements are unconfirmed. ", 1),
616
614
  E(n(x), {
617
615
  variant: "secondary",
618
616
  label: "Retry",
619
617
  onClick: D
620
618
  })
621
- ])) : re.value === "unavailable" ? (i(), y("div", xa, " Bulk Receive / Transfer isn’t available for " + p((X = T.value) == null ? void 0 : X.name) + ". Choose another outlet. ", 1)) : q("", !0),
622
- e("div", wa, [
619
+ ])) : se.value === "unavailable" ? (i(), y("div", ha, " Bulk Receive / Transfer isn’t available for " + p((X = T.value) == null ? void 0 : X.name) + ". Choose another outlet. ", 1)) : q("", !0),
620
+ e("div", ga, [
623
621
  E(n(L), {
624
622
  "model-value": W.value,
625
623
  "onUpdate:modelValue": a[2] || (a[2] = (v) => W.value = v),
@@ -627,70 +625,70 @@ const ta = {
627
625
  placeholder: n(o)("inventory.transfer.receiveRequest.bulk.wizard.step1SearchPlaceholder")
628
626
  }, null, 8, ["model-value", "placeholder"])
629
627
  ]),
630
- e("div", ka, [
631
- (i(!0), y(Re, null, tt(ye.value, (v, xe) => {
632
- var ue, ze, He, vt, Ct, Ft, St;
628
+ e("div", _a, [
629
+ (i(!0), y(Se, null, tt(xe.value, (v, ge) => {
630
+ var ie, Ie, He, vt, Ct, Ft, St;
633
631
  return i(), y("div", {
634
632
  key: v.dbName,
635
- class: H(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
636
- ((ue = T.value) == null ? void 0 : ue.dbName) === v.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
637
- xe > 0 ? "border-t border-[#F0F0F0]" : ""
633
+ class: Q(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
634
+ ((ie = T.value) == null ? void 0 : ie.dbName) === v.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
635
+ ge > 0 ? "border-t border-[#F0F0F0]" : ""
638
636
  ]]),
639
- onClick: (Xr) => qe(v)
637
+ onClick: (Qr) => De(v)
640
638
  }, [
641
- e("div", Fa, [
642
- e("span", Sa, p(v.name.slice(0, 2).toUpperCase()), 1)
639
+ e("div", wa, [
640
+ e("span", ka, p(v.name.slice(0, 2).toUpperCase()), 1)
643
641
  ]),
644
- e("div", Ra, [
645
- e("div", Pa, p(v.name), 1),
646
- e("div", Da, [
642
+ e("div", Ca, [
643
+ e("div", Fa, p(v.name), 1),
644
+ e("div", Sa, [
647
645
  rt(p(v.doc.profile.code ? `#${v.doc.profile.code}` : n(o)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
648
- (ze = v.doc.profile.address) != null && ze.line1 || (He = v.doc.profile.address) != null && He.city ? (i(), y(Re, { key: 0 }, [
646
+ (Ie = v.doc.profile.address) != null && Ie.line1 || (He = v.doc.profile.address) != null && He.city ? (i(), y(Se, { key: 0 }, [
649
647
  rt(" · " + p([(vt = v.doc.profile.address) == null ? void 0 : vt.line1, (Ct = v.doc.profile.address) == null ? void 0 : Ct.city].filter(Boolean).join(" · ")), 1)
650
648
  ], 64)) : q("", !0)
651
649
  ])
652
650
  ]),
653
- e("span", qa, p(v.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
651
+ e("span", Ra, p(v.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
654
652
  e("div", {
655
- class: H([
653
+ class: Q([
656
654
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
657
655
  ((Ft = T.value) == null ? void 0 : Ft.dbName) === v.dbName ? "border-[#FF7823]" : "border-[#CCCCCC]"
658
656
  ])
659
657
  }, [
660
- ((St = T.value) == null ? void 0 : St.dbName) === v.dbName ? (i(), y("div", Ea)) : q("", !0)
658
+ ((St = T.value) == null ? void 0 : St.dbName) === v.dbName ? (i(), y("div", Pa)) : q("", !0)
661
659
  ], 2)
662
- ], 10, Ca);
660
+ ], 10, xa);
663
661
  }), 128)),
664
- ye.value.length === 0 ? (i(), y("div", Na, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : q("", !0)
662
+ xe.value.length === 0 ? (i(), y("div", Da, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : q("", !0)
665
663
  ])
666
664
  ])) : q("", !0),
667
- l.value === 1 ? (i(), y("div", Oa, [
668
- e("div", $a, [
669
- e("h3", Aa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
670
- e("p", Ba, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
665
+ l.value === 1 ? (i(), y("div", qa, [
666
+ e("div", Ea, [
667
+ e("h3", Na, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
668
+ e("p", $a, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
671
669
  ]),
672
- e("div", Ta, [
670
+ e("div", Ba, [
673
671
  e("div", {
674
- class: H([
672
+ class: Q([
675
673
  "border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
676
674
  R.value === "transfer" ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
677
675
  ]),
678
- onClick: a[3] || (a[3] = (v) => Qe("transfer"))
676
+ onClick: a[3] || (a[3] = (v) => Ye("transfer"))
679
677
  }, [
680
- e("div", Ia, [
678
+ e("div", Oa, [
681
679
  e("div", {
682
- class: H(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
680
+ class: Q(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
683
681
  }, [
684
- E(n(O), {
682
+ E(n($), {
685
683
  name: "swap_horiz",
686
684
  size: "md",
687
- class: H(R.value === "transfer" ? "text-white" : "text-[#6B6C70]")
685
+ class: Q(R.value === "transfer" ? "text-white" : "text-[#6B6C70]")
688
686
  }, null, 8, ["class"])
689
687
  ], 2),
690
688
  e("div", {
691
- class: H(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
689
+ class: Q(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
692
690
  }, [
693
- R.value === "transfer" ? (i(), ve(n(O), {
691
+ R.value === "transfer" ? (i(), pe(n($), {
694
692
  key: 0,
695
693
  name: "check",
696
694
  size: "sm",
@@ -698,30 +696,30 @@ const ta = {
698
696
  })) : q("", !0)
699
697
  ], 2)
700
698
  ]),
701
- e("div", La, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
702
- e("div", za, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
699
+ e("div", Aa, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
700
+ e("div", Ta, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
703
701
  ], 2),
704
702
  e("div", {
705
- class: H([
703
+ class: Q([
706
704
  "border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
707
705
  R.value === "template" ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
708
706
  ]),
709
- onClick: a[4] || (a[4] = (v) => Qe("template"))
707
+ onClick: a[4] || (a[4] = (v) => Ye("template"))
710
708
  }, [
711
- e("div", Ma, [
709
+ e("div", Ia, [
712
710
  e("div", {
713
- class: H(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
711
+ class: Q(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
714
712
  }, [
715
- E(n(O), {
713
+ E(n($), {
716
714
  name: "description",
717
715
  size: "md",
718
- class: H(R.value === "template" ? "text-white" : "text-[#6B6C70]")
716
+ class: Q(R.value === "template" ? "text-white" : "text-[#6B6C70]")
719
717
  }, null, 8, ["class"])
720
718
  ], 2),
721
719
  e("div", {
722
- class: H(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
720
+ class: Q(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
723
721
  }, [
724
- R.value === "template" ? (i(), ve(n(O), {
722
+ R.value === "template" ? (i(), pe(n($), {
725
723
  key: 0,
726
724
  name: "check",
727
725
  size: "sm",
@@ -729,160 +727,160 @@ const ta = {
729
727
  })) : q("", !0)
730
728
  ], 2)
731
729
  ]),
732
- e("div", Ua, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
733
- e("div", Va, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
730
+ e("div", La, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
731
+ e("div", za, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
734
732
  ], 2)
735
733
  ]),
736
- R.value === "transfer" ? (i(), y(Re, { key: 0 }, [
737
- e("div", Ja, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
738
- Ze.value ? (i(), y("p", ja, " This outlet requires a template for purchases and warehouse transfers. Transfers from another outlet are still available. ")) : q("", !0),
739
- e("div", Wa, [
734
+ R.value === "transfer" ? (i(), y(Se, { key: 0 }, [
735
+ e("div", Ma, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
736
+ Ze.value ? (i(), y("p", Ua, " This outlet requires a template for purchases and warehouse transfers. Transfers from another outlet are still available. ")) : q("", !0),
737
+ e("div", Va, [
740
738
  E(n(L), {
741
- "model-value": se.value,
742
- "onUpdate:modelValue": a[5] || (a[5] = (v) => se.value = v),
739
+ "model-value": ae.value,
740
+ "onUpdate:modelValue": a[5] || (a[5] = (v) => ae.value = v),
743
741
  "prepend-icon": "search",
744
742
  placeholder: n(o)(
745
743
  "inventory.transfer.receiveRequest.bulk.wizard.step2SearchSourcePlaceholder"
746
744
  )
747
745
  }, null, 8, ["model-value", "placeholder"])
748
746
  ]),
749
- e("div", Ya, [
750
- (i(!0), y(Re, null, tt(Ue.value, (v, xe) => {
751
- var ue, ze, He;
747
+ e("div", Ja, [
748
+ (i(!0), y(Se, null, tt(Ge.value, (v, ge) => {
749
+ var ie, Ie, He;
752
750
  return i(), y("div", {
753
751
  key: v.dbName,
754
- class: H(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
755
- ((ue = j.value) == null ? void 0 : ue.doc._id) === v.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
756
- xe > 0 ? "border-t border-[#F0F0F0]" : ""
752
+ class: Q(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
753
+ ((ie = J.value) == null ? void 0 : ie.doc._id) === v.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
754
+ ge > 0 ? "border-t border-[#F0F0F0]" : ""
757
755
  ]]),
758
- onClick: (vt) => j.value = v
756
+ onClick: (vt) => J.value = v
759
757
  }, [
760
- e("div", Ha, [
761
- e("span", Ka, p(v.name.slice(0, 2).toUpperCase()), 1)
758
+ e("div", Wa, [
759
+ e("span", Ya, p(v.name.slice(0, 2).toUpperCase()), 1)
762
760
  ]),
763
- e("div", Ga, [
764
- e("div", Xa, p(v.name), 1),
765
- e("div", Za, [
761
+ e("div", Ha, [
762
+ e("div", Qa, p(v.name), 1),
763
+ e("div", Ga, [
766
764
  rt(p(Z(v) ? `#${Z(v)}` : n(o)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
767
- ee(v) ? (i(), y(Re, { key: 0 }, [
765
+ ee(v) ? (i(), y(Se, { key: 0 }, [
768
766
  rt(" · " + p(ee(v)), 1)
769
767
  ], 64)) : q("", !0)
770
768
  ])
771
769
  ]),
772
- e("span", es, p(v.type === "warehouse" ? "Warehouse" : v.type === "supplier" ? "Supplier" : "Restaurant"), 1),
770
+ e("span", Ka, p(v.type === "warehouse" ? "Warehouse" : v.type === "supplier" ? "Supplier" : "Restaurant"), 1),
773
771
  e("div", {
774
- class: H([
772
+ class: Q([
775
773
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
776
- ((ze = j.value) == null ? void 0 : ze.doc._id) === v.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
774
+ ((Ie = J.value) == null ? void 0 : Ie.doc._id) === v.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
777
775
  ])
778
776
  }, [
779
- ((He = j.value) == null ? void 0 : He.doc._id) === v.doc._id ? (i(), y("div", ts)) : q("", !0)
777
+ ((He = J.value) == null ? void 0 : He.doc._id) === v.doc._id ? (i(), y("div", Xa)) : q("", !0)
780
778
  ], 2)
781
- ], 10, Qa);
779
+ ], 10, ja);
782
780
  }), 128)),
783
- Ue.value.length === 0 ? (i(), y("div", ns, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : q("", !0)
781
+ Ge.value.length === 0 ? (i(), y("div", Za, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : q("", !0)
784
782
  ])
785
783
  ], 64)) : q("", !0),
786
- R.value === "template" ? (i(), y(Re, { key: 1 }, [
787
- e("div", as, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
788
- e("div", ss, [
784
+ R.value === "template" ? (i(), y(Se, { key: 1 }, [
785
+ e("div", es, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
786
+ e("div", ts, [
789
787
  E(n(L), {
790
- "model-value": ce.value,
791
- "onUpdate:modelValue": a[6] || (a[6] = (v) => ce.value = v),
788
+ "model-value": ue.value,
789
+ "onUpdate:modelValue": a[6] || (a[6] = (v) => ue.value = v),
792
790
  "prepend-icon": "search",
793
791
  placeholder: n(o)(
794
792
  "inventory.transfer.receiveRequest.bulk.wizard.step2SearchTemplatePlaceholder"
795
793
  )
796
794
  }, null, 8, ["model-value", "placeholder"])
797
795
  ]),
798
- n(h).loading ? (i(), y("div", rs, [
799
- E(n(O), {
796
+ n(b).loading ? (i(), y("div", ns, [
797
+ E(n($), {
800
798
  name: "progress_activity",
801
799
  class: "text-[#FF7823] animate-spin"
802
800
  })
803
- ])) : r.value.length === 0 ? (i(), y("div", os, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (i(), y("div", ls, [
804
- (i(!0), y(Re, null, tt(r.value, (v) => (i(), y("div", {
801
+ ])) : r.value.length === 0 ? (i(), y("div", as, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (i(), y("div", ss, [
802
+ (i(!0), y(Se, null, tt(r.value, (v) => (i(), y("div", {
805
803
  key: v._id,
806
- class: H([
804
+ class: Q([
807
805
  "border rounded-lg px-16 py-12 cursor-pointer transition-all duration-150 flex items-center gap-12",
808
806
  I.value === v._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
809
807
  ]),
810
- onClick: (xe) => I.value = v._id
808
+ onClick: (ge) => I.value = v._id
811
809
  }, [
812
- e("div", us, [
813
- e("div", cs, p(v.name), 1),
814
- e("div", ds, p(be(v)) + " · " + p(v.purchaseOrder.items.length) + " items ", 1)
810
+ e("div", os, [
811
+ e("div", ls, p(v.name), 1),
812
+ e("div", is, p(ve(v)) + " · " + p(v.purchaseOrder.items.length) + " items ", 1)
815
813
  ]),
816
814
  e("div", {
817
- class: H([
815
+ class: Q([
818
816
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
819
817
  I.value === v._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
820
818
  ])
821
819
  }, [
822
- I.value === v._id ? (i(), y("div", ms)) : q("", !0)
820
+ I.value === v._id ? (i(), y("div", us)) : q("", !0)
823
821
  ], 2)
824
- ], 10, is))), 128))
822
+ ], 10, rs))), 128))
825
823
  ]))
826
824
  ], 64)) : q("", !0)
827
825
  ])) : q("", !0),
828
- l.value === 2 ? (i(), y("div", fs, [
829
- e("div", ps, [
830
- e("h3", vs, p(U.value), 1)
826
+ l.value === 2 ? (i(), y("div", cs, [
827
+ e("div", ds, [
828
+ e("h3", ms, p(j.value), 1)
831
829
  ]),
832
- (i(), ve(On, {
830
+ (i(), pe(vn, {
833
831
  ref_key: "formRef",
834
- ref: Me,
832
+ ref: Le,
835
833
  class: "w-full",
836
- "onForm:ready": a[7] || (a[7] = () => Je.value = !0),
834
+ "onForm:ready": a[7] || (a[7] = () => Ue.value = !0),
837
835
  "onForm:dataChange": st,
838
- onValidationSuccess: Wt,
836
+ onValidationSuccess: jt,
839
837
  modelValue: Y.value,
840
838
  "onUpdate:modelValue": a[8] || (a[8] = (v) => Y.value = v),
841
839
  disabled: ne.value,
842
840
  "locked-supplier": Y.value.supplier,
843
- suppliers: n(J).suppliers,
844
- skus: n(Fe).skus,
845
- key: G.value,
841
+ suppliers: n(V).suppliers,
842
+ skus: n(Ce).skus,
843
+ key: K.value,
846
844
  "last-closing-date": t.lastClosingDate,
847
- "sku-balance-map": We.value,
848
- "is-balance-loading": je.value
845
+ "sku-balance-map": Je.value,
846
+ "is-balance-loading": Ve.value
849
847
  }, null, 8, ["modelValue", "disabled", "locked-supplier", "suppliers", "skus", "last-closing-date", "sku-balance-map", "is-balance-loading"]))
850
848
  ])) : q("", !0)
851
849
  ]),
852
- e("div", ys, [
853
- e("div", bs, [
854
- e("div", hs, [
855
- e("div", gs, [
856
- e("div", _s, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
850
+ e("div", fs, [
851
+ e("div", ps, [
852
+ e("div", vs, [
853
+ e("div", ys, [
854
+ e("div", bs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
857
855
  ]),
858
- e("div", xs, [
859
- e("span", ws, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
856
+ e("div", hs, [
857
+ e("span", gs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
860
858
  e("span", {
861
- class: H(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", T.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
862
- }, p(b.value), 3),
863
- oe.value ? (i(), y("span", ks, p(oe.value), 1)) : q("", !0)
859
+ class: Q(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", T.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
860
+ }, p(g.value), 3),
861
+ re.value ? (i(), y("span", _s, p(re.value), 1)) : q("", !0)
864
862
  ]),
865
- e("div", Cs, [
866
- e("span", Fs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
863
+ e("div", xs, [
864
+ e("span", ws, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
867
865
  e("span", {
868
- class: H(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", R.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
869
- }, p(A.value), 3)
866
+ class: Q(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", R.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
867
+ }, p(O.value), 3)
870
868
  ]),
871
- e("div", Ss, [
872
- e("span", Rs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
869
+ e("div", ks, [
870
+ e("span", Cs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
873
871
  e("span", {
874
- class: H([
872
+ class: Q([
875
873
  "text-[15px] leading-[20px] font-semibold transition-colors duration-200",
876
- j.value || I.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
874
+ J.value || I.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
877
875
  ])
878
876
  }, p(M.value), 3),
879
- te.value ? (i(), y("span", Ps, p(te.value), 1)) : q("", !0)
877
+ te.value ? (i(), y("span", Fs, p(te.value), 1)) : q("", !0)
880
878
  ]),
881
- e("div", Ds, [
882
- e("span", qs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
879
+ e("div", Ss, [
880
+ e("span", Rs, p(n(o)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
883
881
  e("span", {
884
- class: H(["text-[15px] leading-[20px] font-medium transition-colors duration-200", z.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
885
- }, p(pe.value), 3)
882
+ class: Q(["text-[15px] leading-[20px] font-medium transition-colors duration-200", z.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
883
+ }, p(fe.value), 3)
886
884
  ])
887
885
  ])
888
886
  ])
@@ -894,55 +892,55 @@ const ta = {
894
892
  _: 1
895
893
  })
896
894
  ])),
897
- E(n($), {
898
- modelValue: Se.value,
899
- "onUpdate:modelValue": a[10] || (a[10] = (S) => Se.value = S),
895
+ E(n(B), {
896
+ modelValue: Fe.value,
897
+ "onUpdate:modelValue": a[10] || (a[10] = (S) => Fe.value = S),
900
898
  overlay: !0
901
899
  }, {
902
- "dialog-header": Ie(() => [
903
- e("div", Es, p(n(o)("inventory.transfer.template.zeroQuantity.title")), 1)
900
+ "dialog-header": Ae(() => [
901
+ e("div", Ps, p(n(o)("inventory.transfer.template.zeroQuantity.title")), 1)
904
902
  ]),
905
- "dialog-footer": Ie(() => [
906
- e("div", Ts, [
903
+ "dialog-footer": Ae(() => [
904
+ e("div", Bs, [
907
905
  E(n(x), {
908
906
  label: n(o)("common.cancel"),
909
907
  variant: "tertiary",
910
908
  size: "md",
911
- onClick: a[9] || (a[9] = (S) => Se.value = !1)
909
+ onClick: a[9] || (a[9] = (S) => Fe.value = !1)
912
910
  }, null, 8, ["label"]),
913
911
  E(n(x), {
914
912
  label: n(o)("inventory.transfer.template.zeroQuantity.removeAll"),
915
913
  variant: "primary",
916
914
  size: "md",
917
915
  "prepend-icon": "delete",
918
- onClick: Jt
916
+ onClick: Vt
919
917
  }, null, 8, ["label"])
920
918
  ])
921
919
  ]),
922
- default: Ie(() => [
923
- e("div", Ns, [
924
- e("div", Os, p(n(o)("inventory.transfer.template.zeroQuantity.message", {
925
- count: ke.value.length
920
+ default: Ae(() => [
921
+ e("div", Ds, [
922
+ e("div", qs, p(n(o)("inventory.transfer.template.zeroQuantity.message", {
923
+ count: we.value.length
926
924
  })), 1),
927
- e("div", $s, [
928
- e("ul", As, [
929
- (i(!0), y(Re, null, tt(ke.value, (S) => (i(), y("li", {
925
+ e("div", Es, [
926
+ e("ul", Ns, [
927
+ (i(!0), y(Se, null, tt(we.value, (S) => (i(), y("li", {
930
928
  key: S.sku._id,
931
929
  class: "fm-typo-en-body-md-400"
932
930
  }, p(S.sku.name) + " (" + p(S.sku.code) + ") ", 1))), 128))
933
931
  ])
934
932
  ]),
935
- e("div", Bs, p(n(o)("inventory.transfer.template.zeroQuantity.prompt")), 1)
933
+ e("div", $s, p(n(o)("inventory.transfer.template.zeroQuantity.prompt")), 1)
936
934
  ])
937
935
  ]),
938
936
  _: 1
939
937
  }, 8, ["modelValue"])
940
938
  ], 64));
941
939
  }
942
- }), Ls = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, zs = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, Ms = { class: "flex gap-2 items-center" }, Us = ["disabled"], Vs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, Js = {
940
+ }), As = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, Ts = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, Is = { class: "flex gap-2 items-center" }, Ls = ["disabled"], zs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, Ms = {
943
941
  key: 0,
944
942
  class: "flex flex-col items-center gap-3 text-gray-500"
945
- }, js = ["src"], Ws = /* @__PURE__ */ at({
943
+ }, Us = ["src"], Vs = /* @__PURE__ */ at({
946
944
  __name: "PdfPreviewDialog",
947
945
  props: {
948
946
  modelValue: { type: Boolean },
@@ -951,43 +949,43 @@ const ta = {
951
949
  },
952
950
  emits: ["update:modelValue"],
953
951
  setup(C, { emit: _ }) {
954
- const x = C, $ = _, O = P(null);
952
+ const x = C, B = _, $ = P(null);
955
953
  function L() {
956
- $("update:modelValue", !1);
954
+ B("update:modelValue", !1);
957
955
  }
958
- function K() {
959
- var V, o;
956
+ function G() {
957
+ var U, o;
960
958
  if (x.blobUrl)
961
959
  try {
962
- (o = (V = O.value) == null ? void 0 : V.contentWindow) == null || o.print();
960
+ (o = (U = $.value) == null ? void 0 : U.contentWindow) == null || o.print();
963
961
  } catch {
964
962
  const s = document.createElement("a");
965
963
  s.href = x.blobUrl, s.download = "purchase-order.pdf", document.body.appendChild(s), s.click(), document.body.removeChild(s);
966
964
  }
967
965
  }
968
- return (V, o) => (i(), ve(dt, { to: "body" }, [
969
- V.modelValue ? (i(), y("div", {
966
+ return (U, o) => (i(), pe(dt, { to: "body" }, [
967
+ U.modelValue ? (i(), y("div", {
970
968
  key: 0,
971
969
  class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
972
- onClick: Kt(L, ["self"])
970
+ onClick: Qt(L, ["self"])
973
971
  }, [
974
- e("div", Ls, [
975
- e("div", zs, [
972
+ e("div", As, [
973
+ e("div", Ts, [
976
974
  o[0] || (o[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
977
- e("div", Ms, [
975
+ e("div", Is, [
978
976
  e("button", {
979
- disabled: V.loading || !V.blobUrl,
977
+ disabled: U.loading || !U.blobUrl,
980
978
  class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
981
- onClick: K
982
- }, " Print ", 8, Us),
979
+ onClick: G
980
+ }, " Print ", 8, Ls),
983
981
  e("button", {
984
982
  class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
985
983
  onClick: L
986
984
  }, " × ")
987
985
  ])
988
986
  ]),
989
- e("div", Vs, [
990
- V.loading ? (i(), y("div", Js, o[1] || (o[1] = [
987
+ e("div", zs, [
988
+ U.loading ? (i(), y("div", Ms, o[1] || (o[1] = [
991
989
  e("svg", {
992
990
  class: "animate-spin h-10 w-10 text-blue-500",
993
991
  xmlns: "http://www.w3.org/2000/svg",
@@ -1009,19 +1007,19 @@ const ta = {
1009
1007
  })
1010
1008
  ], -1),
1011
1009
  e("span", { class: "text-sm" }, "Generating PDF…", -1)
1012
- ]))) : V.blobUrl ? (i(), y("iframe", {
1010
+ ]))) : U.blobUrl ? (i(), y("iframe", {
1013
1011
  key: 1,
1014
1012
  ref_key: "iframeRef",
1015
- ref: O,
1016
- src: V.blobUrl,
1013
+ ref: $,
1014
+ src: U.blobUrl,
1017
1015
  class: "w-full h-full border-none"
1018
- }, null, 8, js)) : q("", !0)
1016
+ }, null, 8, Us)) : q("", !0)
1019
1017
  ])
1020
1018
  ])
1021
1019
  ])) : q("", !0)
1022
1020
  ]));
1023
1021
  }
1024
- }), Ys = /* @__PURE__ */ at({
1022
+ }), Js = /* @__PURE__ */ at({
1025
1023
  __name: "MultiLocationSelector",
1026
1024
  props: /* @__PURE__ */ Gt({
1027
1025
  locations: {}
@@ -1031,59 +1029,59 @@ const ta = {
1031
1029
  }),
1032
1030
  emits: ["update:modelValue"],
1033
1031
  setup(C) {
1034
- const { t: _ } = it(), x = C, $ = Xt(C, "modelValue"), O = P(!1), L = P(""), K = B(() => {
1032
+ const { t: _ } = it(), x = C, B = Kt(C, "modelValue"), $ = P(!1), L = P(""), G = A(() => {
1035
1033
  const d = L.value.trim().toLowerCase();
1036
1034
  return d ? x.locations.filter(
1037
- (h) => h.name.toLowerCase().includes(d) || (h.doc.profile.code ?? "").toLowerCase().includes(d)
1035
+ (b) => b.name.toLowerCase().includes(d) || (b.doc.profile.code ?? "").toLowerCase().includes(d)
1038
1036
  ) : x.locations;
1039
- }), V = B(() => $.value.length), o = B(
1040
- () => K.value.length > 0 && K.value.every((d) => $.value.includes(d.dbName))
1041
- ), s = B(
1042
- () => K.value.some((d) => $.value.includes(d.dbName)) && !o.value
1043
- ), g = B(() => {
1044
- if (V.value === 0) return _("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
1045
- if (V.value === 1) {
1046
- const d = x.locations.find((h) => h.dbName === $.value[0]);
1047
- return d ? `${d.name} (${d.doc.profile.code ?? "--"})` : $.value[0];
1037
+ }), U = A(() => B.value.length), o = A(
1038
+ () => G.value.length > 0 && G.value.every((d) => B.value.includes(d.dbName))
1039
+ ), s = A(
1040
+ () => G.value.some((d) => B.value.includes(d.dbName)) && !o.value
1041
+ ), h = A(() => {
1042
+ if (U.value === 0) return _("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
1043
+ if (U.value === 1) {
1044
+ const d = x.locations.find((b) => b.dbName === B.value[0]);
1045
+ return d ? `${d.name} (${d.doc.profile.code ?? "--"})` : B.value[0];
1048
1046
  }
1049
- return _("inventory.transfer.receiveRequest.bulk.locationsSelected", [V.value]);
1047
+ return _("inventory.transfer.receiveRequest.bulk.locationsSelected", [U.value]);
1050
1048
  });
1051
- function J() {
1052
- const d = K.value.map((h) => h.dbName);
1053
- o.value ? $.value = $.value.filter((h) => !d.includes(h)) : $.value = [.../* @__PURE__ */ new Set([...$.value, ...d])];
1049
+ function V() {
1050
+ const d = G.value.map((b) => b.dbName);
1051
+ o.value ? B.value = B.value.filter((b) => !d.includes(b)) : B.value = [.../* @__PURE__ */ new Set([...B.value, ...d])];
1054
1052
  }
1055
- function Fe(d) {
1056
- $.value.includes(d) ? $.value = $.value.filter((h) => h !== d) : $.value = [...$.value, d];
1053
+ function Ce(d) {
1054
+ B.value.includes(d) ? B.value = B.value.filter((b) => b !== d) : B.value = [...B.value, d];
1057
1055
  }
1058
1056
  function m(d) {
1059
- return $.value.includes(d);
1057
+ return B.value.includes(d);
1060
1058
  }
1061
- return (d, h) => {
1062
- const c = Te("FmIcon"), w = Te("FmChip"), l = Te("FmTextField"), f = Te("FmMenuItem"), T = Te("FmMenu");
1063
- return i(), ve(T, {
1064
- "model-value": O.value,
1059
+ return (d, b) => {
1060
+ const c = Oe("FmIcon"), w = Oe("FmChip"), l = Oe("FmTextField"), f = Oe("FmMenuItem"), T = Oe("FmMenu");
1061
+ return i(), pe(T, {
1062
+ "model-value": $.value,
1065
1063
  placement: "bottom-end",
1066
1064
  "close-on-click": !1,
1067
- onMenuChanged: h[1] || (h[1] = (W) => {
1068
- O.value = W, W || (L.value = "");
1065
+ onMenuChanged: b[1] || (b[1] = (W) => {
1066
+ $.value = W, W || (L.value = "");
1069
1067
  })
1070
1068
  }, {
1071
- "menu-button": Ie(() => [
1069
+ "menu-button": Ae(() => [
1072
1070
  E(w, {
1073
- label: g.value,
1071
+ label: h.value,
1074
1072
  class: "text-fm-color-neutral-gray-400 cursor-pointer"
1075
1073
  }, {
1076
- default: Ie(() => [
1074
+ default: Ae(() => [
1077
1075
  E(c, {
1078
1076
  name: "storefront",
1079
1077
  outline: "",
1080
1078
  size: "sm"
1081
1079
  }),
1082
1080
  e("div", {
1083
- class: H(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": V.value > 0 }])
1084
- }, p(g.value), 3),
1081
+ class: Q(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": U.value > 0 }])
1082
+ }, p(h.value), 3),
1085
1083
  E(c, {
1086
- name: O.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
1084
+ name: $.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
1087
1085
  outline: "",
1088
1086
  size: "sm"
1089
1087
  }, null, 8, ["name"])
@@ -1091,10 +1089,10 @@ const ta = {
1091
1089
  _: 1
1092
1090
  }, 8, ["label"])
1093
1091
  ]),
1094
- default: Ie(() => [
1092
+ default: Ae(() => [
1095
1093
  E(l, {
1096
1094
  "model-value": L.value,
1097
- "onUpdate:modelValue": h[0] || (h[0] = (W) => L.value = W),
1095
+ "onUpdate:modelValue": b[0] || (b[0] = (W) => L.value = W),
1098
1096
  placeholder: n(_)("inventory.common.table.toolbar.filterItems"),
1099
1097
  class: "my-8"
1100
1098
  }, null, 8, ["model-value", "placeholder"]),
@@ -1103,17 +1101,17 @@ const ta = {
1103
1101
  label: n(_)("inventory.common.selectAll"),
1104
1102
  "has-checkbox": !0,
1105
1103
  indeterminate: s.value,
1106
- onClick: J
1104
+ onClick: V
1107
1105
  }, null, 8, ["model-value", "label", "indeterminate"]),
1108
- (i(!0), y(Re, null, tt(K.value, (W) => (i(), ve(f, {
1106
+ (i(!0), y(Se, null, tt(G.value, (W) => (i(), pe(f, {
1109
1107
  key: W.dbName,
1110
1108
  "model-value": m(W.dbName),
1111
1109
  label: `${W.name} (${W.doc.profile.code ?? "--"})`,
1112
1110
  sublabel: W.type === "restaurant" ? n(_)("inventory.common.restaurant") : n(_)("inventory.common.warehouse"),
1113
1111
  "has-checkbox": !0,
1114
- onClick: (R) => Fe(W.dbName)
1112
+ onClick: (R) => Ce(W.dbName)
1115
1113
  }, null, 8, ["model-value", "label", "sublabel", "onClick"]))), 128)),
1116
- K.value.length === 0 ? (i(), ve(f, {
1114
+ G.value.length === 0 ? (i(), pe(f, {
1117
1115
  key: 0,
1118
1116
  disabled: "",
1119
1117
  label: n(_)("inventory.common.noResultFound")
@@ -1123,40 +1121,40 @@ const ta = {
1123
1121
  }, 8, ["model-value"]);
1124
1122
  };
1125
1123
  }
1126
- }), zt = "bulk-jobs-v1";
1127
- function Qs() {
1124
+ }), Lt = "bulk-jobs-v1";
1125
+ function js() {
1128
1126
  try {
1129
- const C = localStorage.getItem(zt);
1127
+ const C = localStorage.getItem(Lt);
1130
1128
  return C ? JSON.parse(C) : [];
1131
1129
  } catch {
1132
1130
  return [];
1133
1131
  }
1134
1132
  }
1135
- function Hs(C) {
1133
+ function Ws(C) {
1136
1134
  try {
1137
- localStorage.setItem(zt, JSON.stringify(C));
1135
+ localStorage.setItem(Lt, JSON.stringify(C));
1138
1136
  } catch {
1139
1137
  }
1140
1138
  }
1141
- const Ot = 5e3, $t = 3e3, Ks = 300, et = ["completed", "failed", "cancelled"];
1142
- function Gs(C, _) {
1139
+ const Nt = 5e3, $t = 3e3, Ys = 300, et = ["completed", "failed", "cancelled"];
1140
+ function Hs(C, _) {
1143
1141
  var x;
1144
1142
  return C.cancelled ? "cancelled" : C.message === "completed" ? "completed" : C.message === "error" || (x = C.message) != null && x.startsWith("error:") ? "failed" : C.message === "processing" ? "active" : "waiting";
1145
1143
  }
1146
- const wt = Kn("bulkJob", () => {
1147
- const C = P(Qs()), _ = /* @__PURE__ */ new Map();
1144
+ const wt = Yn("bulkJob", () => {
1145
+ const C = P(js()), _ = /* @__PURE__ */ new Map();
1148
1146
  let x = null;
1149
- Ke(C, (m) => {
1150
- x && clearTimeout(x), x = setTimeout(() => Hs(m), Ks);
1147
+ Qe(C, (m) => {
1148
+ x && clearTimeout(x), x = setTimeout(() => Ws(m), Ys);
1151
1149
  }, { deep: !0 });
1152
- function $(m, d) {
1150
+ function B(m, d) {
1153
1151
  var R;
1154
- const h = C.value.find((j) => j.jobId === m);
1155
- let c = Gs(d, h == null ? void 0 : h.type);
1152
+ const b = C.value.find((J) => J.jobId === m);
1153
+ let c = Hs(d, b == null ? void 0 : b.type);
1156
1154
  const w = d.errorCount ?? 0;
1157
- c === "completed" && w > 0 && (h == null ? void 0 : h.type) === "download" && (c = "failed");
1158
- const l = d.total ?? 0, f = d.current ?? 0, T = c === "failed" || c === "completed" && w > 0, W = (h == null ? void 0 : h.hidden) && T;
1159
- V(m, {
1155
+ c === "completed" && w > 0 && (b == null ? void 0 : b.type) === "download" && (c = "failed");
1156
+ const l = d.total ?? 0, f = d.current ?? 0, T = c === "failed" || c === "completed" && w > 0, W = (b == null ? void 0 : b.hidden) && T;
1157
+ U(m, {
1160
1158
  status: c,
1161
1159
  progress: l > 0 ? Math.round(f / l * 100) : 0,
1162
1160
  current: f,
@@ -1168,57 +1166,57 @@ const wt = Kn("bulkJob", () => {
1168
1166
  zipSizeBytes: d.zipSizeBytes ?? void 0,
1169
1167
  stalePoIds: (R = d.stalePoIds) != null && R.length ? d.stalePoIds : void 0,
1170
1168
  ...W ? { hidden: !1 } : {}
1171
- }), et.includes(c) && (L(m), h != null && h.hidden && !W && o(m));
1169
+ }), et.includes(c) && (L(m), b != null && b.hidden && !W && o(m));
1172
1170
  }
1173
- function O(m) {
1171
+ function $(m) {
1174
1172
  if (_.has(m) || !C.value.find((I) => I.jobId === m)) return;
1175
- const h = nt();
1173
+ const b = nt();
1176
1174
  let c = !1, w = null, l = !1;
1177
1175
  async function f() {
1178
1176
  if (l || c) return;
1179
- const I = C.value.find((se) => se.jobId === m);
1177
+ const I = C.value.find((ae) => ae.jobId === m);
1180
1178
  if (!(!I || et.includes(I.status)))
1181
1179
  try {
1182
- const se = await h.getBulkJobStatus(I.dbName, m);
1183
- if (se && !l && !c) {
1184
- $(m, se);
1185
- const ce = C.value.find((de) => de.jobId === m);
1186
- ce && !et.includes(ce.status) && (w = setTimeout(f, $t));
1180
+ const ae = await b.getBulkJobStatus(I.dbName, m);
1181
+ if (ae && !l && !c) {
1182
+ B(m, ae);
1183
+ const ue = C.value.find((ce) => ce.jobId === m);
1184
+ ue && !et.includes(ue.status) && (w = setTimeout(f, $t));
1187
1185
  }
1188
1186
  } catch {
1189
1187
  !l && !c && (w = setTimeout(f, $t));
1190
1188
  }
1191
1189
  }
1192
- const T = Gn(), { unsubscribe: W, initialState: R } = T.subscribe(
1190
+ const T = Hn(), { unsubscribe: W, initialState: R } = T.subscribe(
1193
1191
  { type: "bulkPo", params: { jobId: m } },
1194
1192
  (I) => {
1195
- c = !0, w && (clearTimeout(w), w = null), $(m, I);
1193
+ c = !0, w && (clearTimeout(w), w = null), B(m, I);
1196
1194
  }
1197
- ), j = () => {
1195
+ ), J = () => {
1198
1196
  l = !0, W(), w && (clearTimeout(w), w = null);
1199
1197
  };
1200
- _.set(m, j), R.then((I) => {
1201
- const se = I == null ? void 0 : I.initialState;
1202
- se && $(m, se);
1198
+ _.set(m, J), R.then((I) => {
1199
+ const ae = I == null ? void 0 : I.initialState;
1200
+ ae && B(m, ae);
1203
1201
  }).catch(() => {
1204
1202
  }), setTimeout(() => {
1205
- !c && !l && (console.warn(`[bulkJob] SSE silent for job ${m} after ${Ot}ms — starting polling fallback`), f());
1206
- }, Ot);
1203
+ !c && !l && (console.warn(`[bulkJob] SSE silent for job ${m} after ${Nt}ms — starting polling fallback`), f());
1204
+ }, Nt);
1207
1205
  }
1208
1206
  function L(m) {
1209
1207
  const d = _.get(m);
1210
1208
  d !== void 0 && (d(), _.delete(m));
1211
1209
  }
1212
- function K(m) {
1213
- C.value = [m, ...C.value], O(m.jobId);
1210
+ function G(m) {
1211
+ C.value = [m, ...C.value], $(m.jobId);
1214
1212
  }
1215
1213
  for (const m of C.value)
1216
- et.includes(m.status) || O(m.jobId);
1217
- function V(m, d) {
1218
- const h = C.value.findIndex((c) => c.jobId === m);
1219
- if (h !== -1) {
1220
- const c = C.value[h], w = d.status ?? c.status, l = et.includes(w) && !et.includes(c.status) && !c.completedAt;
1221
- C.value[h] = {
1214
+ et.includes(m.status) || $(m.jobId);
1215
+ function U(m, d) {
1216
+ const b = C.value.findIndex((c) => c.jobId === m);
1217
+ if (b !== -1) {
1218
+ const c = C.value[b], w = d.status ?? c.status, l = et.includes(w) && !et.includes(c.status) && !c.completedAt;
1219
+ C.value[b] = {
1222
1220
  ...c,
1223
1221
  ...d,
1224
1222
  ...l ? { completedAt: Date.now() } : {}
@@ -1229,16 +1227,16 @@ const wt = Kn("bulkJob", () => {
1229
1227
  L(m), C.value = C.value.filter((d) => d.jobId !== m);
1230
1228
  }
1231
1229
  async function s(m) {
1232
- const d = C.value.find((h) => h.jobId === m);
1230
+ const d = C.value.find((b) => b.jobId === m);
1233
1231
  if (d)
1234
1232
  try {
1235
1233
  await nt().cancelBulkJob(d.dbName, m);
1236
- } catch (h) {
1237
- console.warn("[cancelJob] cancel API call failed for job", m, h);
1234
+ } catch (b) {
1235
+ console.warn("[cancelJob] cancel API call failed for job", m, b);
1238
1236
  }
1239
1237
  }
1240
- function g(m, d) {
1241
- return C.value.find((h) => h.jobId === m) || K({
1238
+ function h(m, d) {
1239
+ return C.value.find((b) => b.jobId === m) || G({
1242
1240
  jobId: m,
1243
1241
  type: "download",
1244
1242
  dbName: d,
@@ -1250,8 +1248,8 @@ const wt = Kn("bulkJob", () => {
1250
1248
  errorCount: 0,
1251
1249
  startedAt: Date.now(),
1252
1250
  hidden: !0
1253
- }), new Promise((h, c) => {
1254
- const w = Ke(
1251
+ }), new Promise((b, c) => {
1252
+ const w = Qe(
1255
1253
  () => C.value.find((l) => l.jobId === m),
1256
1254
  (l) => {
1257
1255
  if (!l) {
@@ -1267,7 +1265,7 @@ const wt = Kn("bulkJob", () => {
1267
1265
  return;
1268
1266
  }
1269
1267
  if (l.downloadReady) {
1270
- w(), h();
1268
+ w(), b();
1271
1269
  return;
1272
1270
  }
1273
1271
  },
@@ -1275,109 +1273,109 @@ const wt = Kn("bulkJob", () => {
1275
1273
  );
1276
1274
  });
1277
1275
  }
1278
- const J = B(
1276
+ const V = A(
1279
1277
  () => C.value.filter((m) => !m.hidden && (m.status === "waiting" || m.status === "active"))
1280
- ), Fe = B(() => J.value.length > 0);
1281
- return { jobs: C, addJob: K, updateJob: V, removeJob: o, cancelJob: s, waitForPdfJob: g, activeJobs: J, hasActiveJobs: Fe };
1278
+ ), Ce = A(() => V.value.length > 0);
1279
+ return { jobs: C, addJob: G, updateJob: U, removeJob: o, cancelJob: s, waitForPdfJob: h, activeJobs: V, hasActiveJobs: Ce };
1282
1280
  }), lt = P(), Be = P();
1283
1281
  let bt = 0;
1284
1282
  const ht = P();
1285
- function Xs(C) {
1286
- const _ = En(), x = mt(), $ = xt(), O = It(), L = Tt(), K = Un(), V = Lt(), o = P(!1), s = ft(), { t: g } = it(), J = nt(), Fe = bn(), m = wt(), d = P([]), h = P([]), c = P(new Array()), w = P(
1283
+ function Qs(C) {
1284
+ const _ = Fn(), x = mt(), B = xt(), $ = At(), L = Ot(), G = En(), U = Tt(), o = P(!1), s = ft(), { t: h } = it(), V = nt(), Ce = Nn(), m = wt(), d = P([]), b = P([]), c = P(new Array()), w = P(
1287
1285
  new Array()
1288
1286
  ), l = P(
1289
1287
  C != null && C.startDate && (C != null && C.endDate) ? C : _t()
1290
- ), f = B(() => {
1288
+ ), f = A(() => {
1291
1289
  const r = new Date(l.value.startDate), u = new Date(l.value.endDate);
1292
1290
  return {
1293
- start: Qn(r).toISOString(),
1294
- end: Yn(u).toISOString()
1291
+ start: jn(r).toISOString(),
1292
+ end: Jn(u).toISOString()
1295
1293
  };
1296
- }), T = cn(), W = P(null), R = P([]), j = P(), I = P(!1), se = P(null);
1297
- let ce = null;
1298
- function de() {
1299
- ce && (ce.abort(), ce = null, o.value = !1, I.value = !1, se.value = null);
1294
+ }), T = un(), W = P(null), R = P([]), J = P(), I = P(!1), ae = P(null);
1295
+ let ue = null;
1296
+ function ce() {
1297
+ ue && (ue.abort(), ue = null, o.value = !1, I.value = !1, ae.value = null);
1300
1298
  }
1301
- let me = null;
1302
- Zt() && en(() => {
1303
- de(), me == null || me.abort();
1299
+ let de = null;
1300
+ Xt() && Zt(() => {
1301
+ ce(), de == null || de.abort();
1304
1302
  });
1305
- function Je(r) {
1306
- const u = x.locations.find((b) => b.dbName === r._locationDbName);
1303
+ function Ue(r) {
1304
+ const u = x.locations.find((g) => g.dbName === r._locationDbName);
1307
1305
  if (!u) return null;
1308
1306
  if (u.type === "restaurant") {
1309
- const b = x.locationRestaurantFromCore(u.doc._id);
1310
- if (b !== null)
1311
- return { ...u, doc: b };
1307
+ const g = x.locationRestaurantFromCore(u.doc._id);
1308
+ if (g !== null)
1309
+ return { ...u, doc: g };
1312
1310
  }
1313
1311
  return u;
1314
1312
  }
1315
- function Se(r) {
1316
- const u = x.locations.find((b) => b.dbName === r._locationDbName);
1313
+ function Fe(r) {
1314
+ const u = x.locations.find((g) => g.dbName === r._locationDbName);
1317
1315
  u && (x._currentLocation = u);
1318
1316
  }
1319
- async function je(r, u, b) {
1320
- const A = d.value.map((ee) => ({ dbName: ee })), M = A.length;
1321
- se.value = { done: 0, total: M };
1322
- let F = u.cursor, Q = u.retryFailed, Z = !0;
1323
- for (; Z && !b.aborted; ) {
1324
- const ee = await J.getBulkPaginatedPurchaseOrders(
1317
+ async function Ve(r, u, g) {
1318
+ const O = d.value.map((ee) => ({ dbName: ee })), M = O.length;
1319
+ ae.value = { done: 0, total: M };
1320
+ let F = u.cursor, H = u.retryFailed, Z = !0;
1321
+ for (; Z && !g.aborted; ) {
1322
+ const ee = await V.getBulkPaginatedPurchaseOrders(
1325
1323
  {
1326
- locations: A,
1324
+ locations: O,
1327
1325
  ...f.value,
1328
1326
  pageSize: 100,
1329
1327
  cursor: F,
1330
- retryFailed: Q
1328
+ retryFailed: H
1331
1329
  },
1332
- b
1330
+ g
1333
1331
  );
1334
- if (b.aborted) return;
1335
- Q = void 0, se.value = {
1332
+ if (g.aborted) return;
1333
+ H = void 0, ae.value = {
1336
1334
  done: Math.max(0, M - ee.pendingLocations),
1337
1335
  total: M
1338
1336
  }, r.push(
1339
1337
  ...ee.data.map(
1340
- ({ locationDbName: oe, ...te }) => ({ ...te, _locationDbName: oe })
1338
+ ({ locationDbName: re, ...te }) => ({ ...te, _locationDbName: re })
1341
1339
  )
1342
- ), h.value = [...r].sort((oe, te) => te._id.localeCompare(oe._id)), R.value = ee.failed, j.value = ee.cursor, Z = ee.hasNext, F = ee.cursor;
1340
+ ), b.value = [...r].sort((re, te) => te._id.localeCompare(re._id)), R.value = ee.failed, J.value = ee.cursor, Z = ee.hasNext, F = ee.cursor;
1343
1341
  }
1344
1342
  }
1345
- async function We() {
1346
- const r = h.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
1347
- c.value = r.length > 0 ? await Fe.getShipmentsByIds(r) : [];
1343
+ async function Je() {
1344
+ const r = b.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
1345
+ c.value = r.length > 0 ? await Ce.getShipmentsByIds(r) : [];
1348
1346
  }
1349
- async function Me(r) {
1350
- const u = r.map((b) => {
1351
- var A;
1352
- return ((A = b.request) == null ? void 0 : A.id) ?? "";
1353
- }).filter((b) => b);
1354
- w.value = u.length > 0 ? await J.readRequestByIds(u) : [];
1347
+ async function Le(r) {
1348
+ const u = r.map((g) => {
1349
+ var O;
1350
+ return ((O = g.request) == null ? void 0 : O.id) ?? "";
1351
+ }).filter((g) => g);
1352
+ w.value = u.length > 0 ? await V.readRequestByIds(u) : [];
1355
1353
  }
1356
- const le = 25;
1357
- async function re() {
1354
+ const oe = 25;
1355
+ async function se() {
1358
1356
  var u;
1359
- if (h.value = [], c.value = [], R.value = [], j.value = void 0, d.value.length === 0)
1357
+ if (b.value = [], c.value = [], R.value = [], J.value = void 0, d.value.length === 0)
1360
1358
  return;
1361
- if (d.value.length > le) {
1359
+ if (d.value.length > oe) {
1362
1360
  s.open({
1363
1361
  title: "Too many locations selected",
1364
- message: `Select at most ${le} locations`,
1362
+ message: `Select at most ${oe} locations`,
1365
1363
  type: "warning"
1366
1364
  });
1367
1365
  return;
1368
1366
  }
1369
- de();
1367
+ ce();
1370
1368
  const r = new AbortController();
1371
- ce = r, o.value = !0;
1369
+ ue = r, o.value = !0;
1372
1370
  try {
1373
- await je([], {}, r.signal), R.value.length > 0 && s.open({
1371
+ await Ve([], {}, r.signal), R.value.length > 0 && s.open({
1374
1372
  title: "Some locations failed to load",
1375
1373
  message: `Purchase orders could not be loaded for ${R.value.length} location(s)`,
1376
1374
  type: "error"
1377
- }), await We();
1378
- const A = await T.readCurrentLocationLastClosing(!0), M = A == null ? void 0 : A._id;
1379
- M && (W.value = Hn(M));
1380
- const F = await $.awaitLocationFeatures(
1375
+ }), await Je();
1376
+ const O = await T.readCurrentLocationLastClosing(!0), M = O == null ? void 0 : O._id;
1377
+ M && (W.value = Wn(M));
1378
+ const F = await B.awaitLocationFeatures(
1381
1379
  (u = x._currentLocation) == null ? void 0 : u.dbName,
1382
1380
  { signal: r.signal, retryOnError: !0 }
1383
1381
  );
@@ -1386,28 +1384,28 @@ function Xs(C) {
1386
1384
  title: "Outlet settings couldn’t load",
1387
1385
  message: "Transfer template requirements are unconfirmed. Refresh to try again.",
1388
1386
  type: "warning"
1389
- }), F === "ready" && $.warehouseRequestRequiresTemplate && await V.fetchTemplates();
1390
- } catch (b) {
1387
+ }), F === "ready" && B.warehouseRequestRequiresTemplate && await U.fetchTemplates();
1388
+ } catch (g) {
1391
1389
  if (r.signal.aborted) return;
1392
1390
  s.open({
1393
1391
  title: "Something went wrong",
1394
1392
  // the API client surfaces the server's message (e.g. the location cap)
1395
- message: (b == null ? void 0 : b.message) || "Error at fetching purchase orders",
1393
+ message: (g == null ? void 0 : g.message) || "Error at fetching purchase orders",
1396
1394
  type: "error"
1397
1395
  });
1398
1396
  } finally {
1399
- ce === r && (ce = null, o.value = !1, se.value = null);
1397
+ ue === r && (ue = null, o.value = !1, ae.value = null);
1400
1398
  }
1401
1399
  }
1402
- async function Ce() {
1403
- if (!j.value || !R.value.some((u) => u.retryable)) return;
1404
- de();
1400
+ async function ke() {
1401
+ if (!J.value || !R.value.some((u) => u.retryable)) return;
1402
+ ce();
1405
1403
  const r = new AbortController();
1406
- ce = r, I.value = !0;
1404
+ ue = r, I.value = !0;
1407
1405
  try {
1408
- const u = [...h.value];
1409
- if (await je(u, { cursor: j.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
1410
- await We();
1406
+ const u = [...b.value];
1407
+ if (await Ve(u, { cursor: J.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
1408
+ await Je();
1411
1409
  } catch (u) {
1412
1410
  if (r.signal.aborted) return;
1413
1411
  s.open({
@@ -1416,28 +1414,28 @@ function Xs(C) {
1416
1414
  type: "error"
1417
1415
  });
1418
1416
  } finally {
1419
- ce === r && (ce = null, I.value = !1, se.value = null);
1417
+ ue === r && (ue = null, I.value = !1, ae.value = null);
1420
1418
  }
1421
1419
  }
1422
- function we(r, u) {
1423
- l.value = { startDate: r, endDate: u }, re();
1420
+ function _e(r, u) {
1421
+ l.value = { startDate: r, endDate: u }, se();
1424
1422
  }
1425
- const Ne = P();
1423
+ const Ee = P();
1426
1424
  async function Ze(r) {
1427
- var Z, ee, oe;
1425
+ var Z, ee, re;
1428
1426
  const u = d.value[0];
1429
1427
  if (u) {
1430
- const te = x.locations.find((pe) => pe.dbName === u);
1428
+ const te = x.locations.find((fe) => fe.dbName === u);
1431
1429
  te && (x._currentLocation = te);
1432
1430
  }
1433
- me == null || me.abort();
1434
- const b = new AbortController();
1435
- me = b;
1436
- const A = (Z = x._currentLocation) == null ? void 0 : Z.dbName, M = await $.awaitLocationFeatures(A, {
1437
- signal: b.signal,
1431
+ de == null || de.abort();
1432
+ const g = new AbortController();
1433
+ de = g;
1434
+ const O = (Z = x._currentLocation) == null ? void 0 : Z.dbName, M = await B.awaitLocationFeatures(O, {
1435
+ signal: g.signal,
1438
1436
  retryOnError: !0
1439
1437
  });
1440
- if (b.signal.aborted || ((ee = x._currentLocation) == null ? void 0 : ee.dbName) !== A) return;
1438
+ if (g.signal.aborted || ((ee = x._currentLocation) == null ? void 0 : ee.dbName) !== O) return;
1441
1439
  if (M !== "ready") {
1442
1440
  M === "error" && s.open({
1443
1441
  title: "Outlet settings couldn’t load",
@@ -1447,96 +1445,96 @@ function Xs(C) {
1447
1445
  return;
1448
1446
  }
1449
1447
  function F(te) {
1450
- var be;
1451
- if (b.signal.aborted || ((be = x._currentLocation) == null ? void 0 : be.dbName) !== A) return;
1452
- const pe = {
1453
- mode: Nt.CREATE,
1448
+ var ve;
1449
+ if (g.signal.aborted || ((ve = x._currentLocation) == null ? void 0 : ve.dbName) !== O) return;
1450
+ const fe = {
1451
+ mode: Et.CREATE,
1454
1452
  modelValue: r || void 0,
1455
1453
  show: !0,
1456
- "onUpdate:show"(Pe) {
1457
- lt.value.show = Pe;
1454
+ "onUpdate:show"(Re) {
1455
+ lt.value.show = Re;
1458
1456
  },
1459
1457
  templateId: te,
1460
1458
  lastClosingDate: W.value
1461
1459
  };
1462
- lt.value = pe;
1460
+ lt.value = fe;
1463
1461
  }
1464
- let Q;
1465
- if ($.warehouseRequestRequiresTemplate && !(r != null && r.template)) {
1466
- if (await V.fetchTemplates(), b.signal.aborted || ((oe = x._currentLocation) == null ? void 0 : oe.dbName) !== A) return;
1462
+ let H;
1463
+ if (B.warehouseRequestRequiresTemplate && !(r != null && r.template)) {
1464
+ if (await U.fetchTemplates(), g.signal.aborted || ((re = x._currentLocation) == null ? void 0 : re.dbName) !== O) return;
1467
1465
  _.open({
1468
1466
  title: "Create transfer",
1469
1467
  message: "",
1470
1468
  primaryActions: { text: "Select a template", close: !0 },
1471
1469
  secondaryActions: { text: "Outlet to Outlet", variant: "secondary", close: !0 }
1472
1470
  }).onPrimary(async () => {
1473
- Q = await K.getTemplateId(), Q && F(Q);
1471
+ H = await G.getTemplateId(), H && F(H);
1474
1472
  }).onSecondary(() => {
1475
1473
  F(void 0);
1476
1474
  });
1477
1475
  } else
1478
- F(Q);
1476
+ F(H);
1479
1477
  }
1480
- const Oe = Xn();
1481
- async function Ye(r, u) {
1482
- return r.items != null ? r : await J.getPurchaseOrderById(r._id, void 0, u);
1478
+ const Ne = Qn();
1479
+ async function je(r, u) {
1480
+ return r.items != null ? r : await V.getPurchaseOrderById(r._id, void 0, u);
1483
1481
  }
1484
1482
  async function N(r) {
1485
- await Oe.run(async (u) => {
1486
- Se(r);
1487
- const b = await Ye(r, u), A = {
1488
- mode: Nt.UPDATE,
1489
- modelValue: fn(b),
1483
+ await Ne.run(async (u) => {
1484
+ Fe(r);
1485
+ const g = await je(r, u), O = {
1486
+ mode: Et.UPDATE,
1487
+ modelValue: mn(g),
1490
1488
  show: !0,
1491
1489
  "onUpdate:show"(M) {
1492
1490
  lt.value.show = M;
1493
1491
  },
1494
1492
  lastClosingDate: W.value
1495
1493
  };
1496
- lt.value = A;
1494
+ lt.value = O;
1497
1495
  });
1498
1496
  }
1499
1497
  async function k(r) {
1500
- var Pe, Ae, ge, Y;
1501
- if (Se(r), !L.currentBusiness.value) return;
1502
- const u = r, b = O.supplierById[r.supplier._id], A = (b == null ? void 0 : b.name) ?? r.supplier.name, M = (b == null ? void 0 : b.email) ?? ((Pe = r.supplier) == null ? void 0 : Pe.email) ?? "";
1498
+ var Re, $e, be, Y;
1499
+ if (Fe(r), !L.currentBusiness.value) return;
1500
+ const u = r, g = $.supplierById[r.supplier._id], O = (g == null ? void 0 : g.name) ?? r.supplier.name, M = (g == null ? void 0 : g.email) ?? ((Re = r.supplier) == null ? void 0 : Re.email) ?? "";
1503
1501
  if (!M) {
1504
1502
  s.open({
1505
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1506
- message: g("inventory.transfer.receiveRequest.bulk.singleEmailNoSupplierEmail"),
1503
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1504
+ message: h("inventory.transfer.receiveRequest.bulk.singleEmailNoSupplierEmail"),
1507
1505
  type: "warning"
1508
1506
  });
1509
1507
  return;
1510
1508
  }
1511
- const F = u._locationDbName, Q = r._rev, ee = (((Ae = x.locations.find((G) => G.dbName === F)) == null ? void 0 : Ae.name) || F).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), oe = `PO_${r.seqNumber ?? r._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), te = `${ee}/${oe}`, pe = ++bt;
1512
- let be = null;
1509
+ const F = u._locationDbName, H = r._rev, ee = ((($e = x.locations.find((K) => K.dbName === F)) == null ? void 0 : $e.name) || F).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), re = `PO_${r.seqNumber ?? r._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), te = `${ee}/${re}`, fe = ++bt;
1510
+ let ve = null;
1513
1511
  Be.value = {
1514
- recipientName: A,
1512
+ recipientName: O,
1515
1513
  email: M,
1516
1514
  business: L.currentBusiness.value,
1517
1515
  pdfLoading: !0,
1518
1516
  show: !0,
1519
- "onUpdate:show"(G) {
1520
- !G && be && (URL.revokeObjectURL(be), be = null), Be.value && (Be.value = { ...Be.value, show: G });
1517
+ "onUpdate:show"(K) {
1518
+ !K && ve && (URL.revokeObjectURL(ve), ve = null), Be.value && (Be.value = { ...Be.value, show: K });
1521
1519
  },
1522
- async onDispatch({ sender: G, message: ke }) {
1523
- var De;
1520
+ async onDispatch({ sender: K, message: we }) {
1521
+ var Pe;
1524
1522
  try {
1525
- const { jobId: qe } = await J.enqueueBulkEmail(F, {
1526
- senderEmail: G.emailAddress,
1527
- senderName: G.name || ((De = L.currentBusiness.value) == null ? void 0 : De.name) || "FeedMe Inventory",
1523
+ const { jobId: De } = await V.enqueueBulkEmail(F, {
1524
+ senderEmail: K.emailAddress,
1525
+ senderName: K.name || ((Pe = L.currentBusiness.value) == null ? void 0 : Pe.name) || "FeedMe Inventory",
1528
1526
  items: [
1529
1527
  {
1530
1528
  subject: `Purchase Order #${r.seqNumber ?? r._id}`,
1531
- recipientName: A,
1529
+ recipientName: O,
1532
1530
  recipientEmail: M,
1533
- message: ke.trim() || void 0,
1531
+ message: we.trim() || void 0,
1534
1532
  pos: [{ poId: r._id, dbName: F, filename: te }]
1535
1533
  }
1536
1534
  ]
1537
1535
  });
1538
1536
  m.addJob({
1539
- jobId: qe,
1537
+ jobId: De,
1540
1538
  type: "email",
1541
1539
  dbName: F,
1542
1540
  title: `Email PO #${r.seqNumber ?? r._id}`,
@@ -1548,146 +1546,146 @@ function Xs(C) {
1548
1546
  startedAt: Date.now(),
1549
1547
  hidden: !0
1550
1548
  }), s.open({
1551
- title: g("inventory.transfer.receiveRequest.bulk.emailSuccess"),
1552
- message: g("inventory.transfer.receiveRequest.bulk.emailQueued"),
1549
+ title: h("inventory.transfer.receiveRequest.bulk.emailSuccess"),
1550
+ message: h("inventory.transfer.receiveRequest.bulk.emailQueued"),
1553
1551
  type: "success"
1554
1552
  });
1555
- } catch (qe) {
1556
- throw console.error("Single email enqueue failed", qe), s.open({
1557
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1558
- message: g("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
1553
+ } catch (De) {
1554
+ throw console.error("Single email enqueue failed", De), s.open({
1555
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1556
+ message: h("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
1559
1557
  type: "error"
1560
- }), qe;
1558
+ }), De;
1561
1559
  }
1562
1560
  }
1563
1561
  };
1564
1562
  try {
1565
- let G = await J.getPurchaseOrderPdf(r._id, F, Q);
1566
- "pending" in G && (await m.waitForPdfJob(G.jobId, F), G = await J.getPurchaseOrderPdf(r._id, F, Q));
1567
- const ke = URL.createObjectURL(G);
1568
- pe === bt && ((ge = Be.value) != null && ge.show) ? (be = ke, Be.value = {
1563
+ let K = await V.getPurchaseOrderPdf(r._id, F, H);
1564
+ "pending" in K && (await m.waitForPdfJob(K.jobId, F), K = await V.getPurchaseOrderPdf(r._id, F, H));
1565
+ const we = URL.createObjectURL(K);
1566
+ fe === bt && ((be = Be.value) != null && be.show) ? (ve = we, Be.value = {
1569
1567
  ...Be.value,
1570
- pdfBlobUrl: ke,
1568
+ pdfBlobUrl: we,
1571
1569
  pdfLoading: !1
1572
- }) : URL.revokeObjectURL(ke);
1573
- } catch (G) {
1574
- console.error("[promptEmailDialog] PDF preview fetch failed:", G), pe === bt && ((Y = Be.value) != null && Y.show) && (Be.value = { ...Be.value, pdfLoading: !1 });
1570
+ }) : URL.revokeObjectURL(we);
1571
+ } catch (K) {
1572
+ console.error("[promptEmailDialog] PDF preview fetch failed:", K), fe === bt && ((Y = Be.value) != null && Y.show) && (Be.value = { ...Be.value, pdfLoading: !1 });
1575
1573
  }
1576
1574
  }
1577
1575
  async function z(r) {
1578
- if (Se(r), r.items != null)
1576
+ if (Fe(r), r.items != null)
1579
1577
  return r;
1580
1578
  try {
1581
- return { ...await J.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
1579
+ return { ...await V.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
1582
1580
  } catch (u) {
1583
1581
  throw console.error(`Failed to hydrate PO ${r._id} for action`, u), u;
1584
1582
  }
1585
1583
  }
1586
1584
  async function ne(r, u) {
1587
- var Q;
1588
- Se(r);
1589
- const b = await Oe.run((Z) => Ye(r, Z));
1590
- if (!b) return;
1591
- if (u === void 0 && ((Q = r.request) != null && Q.id))
1585
+ var H;
1586
+ Fe(r);
1587
+ const g = await Ne.run((Z) => je(r, Z));
1588
+ if (!g) return;
1589
+ if (u === void 0 && ((H = r.request) != null && H.id))
1592
1590
  try {
1593
- u = await J.getLatestPurchaseOrderRequest(r._id);
1591
+ u = await V.getLatestPurchaseOrderRequest(r._id);
1594
1592
  } catch (Z) {
1595
1593
  console.warn("[transfer-details] POR fetch failed for", r._id, Z);
1596
1594
  }
1597
- const M = Je(r), F = {
1595
+ const M = Ue(r), F = {
1598
1596
  poRequest: u,
1599
- purchaseOrder: b,
1597
+ purchaseOrder: g,
1600
1598
  transferTo: M == null ? void 0 : M.name,
1601
1599
  transferToDbName: M == null ? void 0 : M.dbName,
1602
1600
  show: !0,
1603
1601
  canResubmit: !1,
1604
1602
  canApprove: !1,
1605
1603
  "onUpdate:show"(Z) {
1606
- Ne.value && (Ne.value = { ...Ne.value, show: Z });
1604
+ Ee.value && (Ee.value = { ...Ee.value, show: Z });
1607
1605
  },
1608
- scope: Bt.RECEIVE_REQUEST,
1609
- receivedMap: xn(b) ?? {},
1606
+ scope: It.RECEIVE_REQUEST,
1607
+ receivedMap: An(g) ?? {},
1610
1608
  shipments: c.value
1611
1609
  };
1612
- Ne.value = F;
1610
+ Ee.value = F;
1613
1611
  }
1614
- async function ae(r, u, b, A, M) {
1615
- const F = wn();
1612
+ async function me(r, u, g, O, M) {
1613
+ const F = Tn();
1616
1614
  o.value = !0;
1617
1615
  try {
1618
1616
  await F({
1619
1617
  operate: {
1620
1618
  operation: u,
1621
1619
  doc: r,
1622
- options: (u === Ge.enum.confirmDraft || u === Ge.enum.completeReceive) && $.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
1620
+ options: (u === Ke.enum.confirmDraft || u === Ke.enum.completeReceive) && B.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
1623
1621
  },
1624
1622
  operateV2: {
1625
1623
  _id: r._id,
1626
1624
  _rev: r._rev ?? "",
1627
- action: u === Ge.enum.submitRequest ? Ge.enum.confirmDraft : u,
1625
+ action: u === Ke.enum.submitRequest ? Ke.enum.confirmDraft : u,
1628
1626
  payloads: M ?? []
1629
1627
  },
1630
- transferTo: A
1631
- }), await new Promise((Q) => setTimeout(Q, 1e3)), s.open({ title: "Success", message: b, type: "success" });
1632
- } catch (Q) {
1628
+ transferTo: O
1629
+ }), await new Promise((H) => setTimeout(H, 1e3)), s.open({ title: "Success", message: g, type: "success" });
1630
+ } catch (H) {
1633
1631
  s.open({
1634
1632
  title: "Something went wrong",
1635
1633
  message: "Please try again.",
1636
1634
  type: "error"
1637
- }), console.error("Error when submitting PO operation", u, r, Q);
1635
+ }), console.error("Error when submitting PO operation", u, r, H);
1638
1636
  } finally {
1639
- o.value = !1, re();
1637
+ o.value = !1, se();
1640
1638
  }
1641
1639
  }
1642
- async function fe(r, u, b) {
1643
- Se(r);
1644
- const A = hn[u];
1645
- if (!A) {
1640
+ async function Te(r, u, g) {
1641
+ Fe(r);
1642
+ const O = $n[u];
1643
+ if (!O) {
1646
1644
  s.open({
1647
1645
  title: "Something went wrong",
1648
- message: `Cannot process order: ${dn(u)}`,
1646
+ message: `Cannot process order: ${cn(u)}`,
1649
1647
  type: "error"
1650
1648
  });
1651
1649
  return;
1652
1650
  }
1653
- const { successMessage: M, ...F } = A;
1654
- if (u === Ge.enum.rejectDraft) {
1651
+ const { successMessage: M, ...F } = O;
1652
+ if (u === Ke.enum.rejectDraft) {
1655
1653
  let ee = "";
1656
1654
  _.open({
1657
1655
  title: F.title,
1658
1656
  message: F.message,
1659
1657
  primaryActions: F.primaryActions,
1660
- contentComponent: gn,
1658
+ contentComponent: Bn,
1661
1659
  contentComponentProps: {
1662
1660
  message: F.message,
1663
- onChange: (oe) => ee = oe
1661
+ onChange: (re) => ee = re
1664
1662
  }
1665
1663
  }).onPrimary(() => {
1666
- ae(r, u, M, b, [
1664
+ me(r, u, M, g, [
1667
1665
  { action: "rejectDraft", payload: { rejectReason: ee } }
1668
1666
  ]);
1669
1667
  });
1670
1668
  return;
1671
1669
  }
1672
- const Q = [], Z = _n();
1673
- Z.init(r), (u === Ge.enum.confirmDraft || u === Ge.enum.submitRequest) && Q.push({
1670
+ const H = [], Z = On();
1671
+ Z.init(r), (u === Ke.enum.confirmDraft || u === Ke.enum.submitRequest) && H.push({
1674
1672
  action: "confirmDraft",
1675
- payload: Z.controller.value.toConfirmDraftData(mn())
1673
+ payload: Z.controller.value.toConfirmDraftData(dn())
1676
1674
  }), _.open({
1677
1675
  title: F.title,
1678
1676
  message: F.message,
1679
1677
  primaryActions: F.primaryActions
1680
1678
  }).onPrimary(() => {
1681
- ae(
1679
+ me(
1682
1680
  r,
1683
1681
  u,
1684
1682
  M,
1685
- b,
1686
- Q
1683
+ g,
1684
+ H
1687
1685
  );
1688
1686
  });
1689
1687
  }
1690
- async function Le() {
1688
+ async function We() {
1691
1689
  _.open({
1692
1690
  title: "Upload Transfer",
1693
1691
  primaryActions: { text: "Xilnex transfer note", close: !0 },
@@ -1702,48 +1700,48 @@ function Xs(C) {
1702
1700
  ht.value = r;
1703
1701
  });
1704
1702
  }
1705
- async function $e() {
1703
+ async function ze() {
1706
1704
  const { start: r, end: u } = f.value;
1707
1705
  return (await Promise.allSettled(
1708
- d.value.map(async (A) => (await J.getPurchaseOrders({ start: r, end: u, dbName: A })).map((F) => ({ ...F, _locationDbName: A })))
1709
- )).flatMap((A) => A.status === "fulfilled" ? A.value : []);
1706
+ d.value.map(async (O) => (await V.getPurchaseOrders({ start: r, end: u, dbName: O })).map((F) => ({ ...F, _locationDbName: O })))
1707
+ )).flatMap((O) => O.status === "fulfilled" ? O.value : []);
1710
1708
  }
1711
- async function U(r) {
1712
- return m.activeJobs.find((b) => b.type === r) ? new Promise((b) => {
1709
+ async function j(r) {
1710
+ return m.activeJobs.find((g) => g.type === r) ? new Promise((g) => {
1713
1711
  _.open({
1714
- title: g("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
1715
- message: g("inventory.transfer.receiveRequest.bulk.activeJobWarningMsg", [r]),
1716
- primaryActions: { text: g("inventory.transfer.receiveRequest.bulk.activeJobWarningConfirm"), close: !0 },
1717
- secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1718
- }).onPrimary(() => b(!0)).onSecondary(() => b(!1));
1712
+ title: h("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
1713
+ message: h("inventory.transfer.receiveRequest.bulk.activeJobWarningMsg", [r]),
1714
+ primaryActions: { text: h("inventory.transfer.receiveRequest.bulk.activeJobWarningConfirm"), close: !0 },
1715
+ secondaryActions: { text: h("inventory.common.cancel"), close: !0 }
1716
+ }).onPrimary(() => g(!0)).onSecondary(() => g(!1));
1719
1717
  }) : !0;
1720
1718
  }
1721
- async function ye(r) {
1722
- if (!await U("download")) return;
1723
- const { startDate: u, endDate: b } = l.value;
1724
- if (Xe(b).diff(Xe(u), "month", !0) > 2) {
1719
+ async function xe(r) {
1720
+ if (!await j("download")) return;
1721
+ const { startDate: u, endDate: g } = l.value;
1722
+ if (Xe(g).diff(Xe(u), "month", !0) > 2) {
1725
1723
  s.open({
1726
- title: g("inventory.transfer.receiveRequest.bulk.downloadError"),
1727
- message: g("inventory.transfer.receiveRequest.bulk.downloadLimitExceeded"),
1724
+ title: h("inventory.transfer.receiveRequest.bulk.downloadError"),
1725
+ message: h("inventory.transfer.receiveRequest.bulk.downloadLimitExceeded"),
1728
1726
  type: "error"
1729
1727
  });
1730
1728
  return;
1731
1729
  }
1732
1730
  if (r.length === 0) {
1733
1731
  s.open({
1734
- title: g("inventory.transfer.receiveRequest.bulk.downloadError"),
1735
- message: g("inventory.transfer.receiveRequest.bulk.noOrdersToDownload"),
1732
+ title: h("inventory.transfer.receiveRequest.bulk.downloadError"),
1733
+ message: h("inventory.transfer.receiveRequest.bulk.noOrdersToDownload"),
1736
1734
  type: "warning"
1737
1735
  });
1738
1736
  return;
1739
1737
  }
1740
- const A = r.map((F) => {
1738
+ const O = r.map((F) => {
1741
1739
  var te;
1742
- const Z = (((te = x.locations.find((pe) => pe.dbName === F._locationDbName)) == null ? void 0 : te.name) || F._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), ee = `PO_${F.seqNumber || F._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), oe = `${Z}/${ee}`;
1743
- return { poId: F._id, dbName: F._locationDbName, filename: oe, rev: F._rev };
1740
+ const Z = (((te = x.locations.find((fe) => fe.dbName === F._locationDbName)) == null ? void 0 : te.name) || F._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), ee = `PO_${F.seqNumber || F._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), re = `${Z}/${ee}`;
1741
+ return { poId: F._id, dbName: F._locationDbName, filename: re, rev: F._rev };
1744
1742
  }), M = d.value[0];
1745
1743
  try {
1746
- const { jobId: F, fromCache: Q } = await J.enqueueBulkDownload(M, { items: A });
1744
+ const { jobId: F, fromCache: H } = await V.enqueueBulkDownload(M, { items: O });
1747
1745
  m.addJob({
1748
1746
  jobId: F,
1749
1747
  type: "download",
@@ -1755,199 +1753,199 @@ function Xs(C) {
1755
1753
  total: r.length,
1756
1754
  errorCount: 0,
1757
1755
  startedAt: Date.now()
1758
- }), Q ? s.open({
1759
- title: g("inventory.transfer.receiveRequest.bulk.downloadCachedTitle"),
1760
- message: g("inventory.transfer.receiveRequest.bulk.downloadCachedMsg"),
1756
+ }), H ? s.open({
1757
+ title: h("inventory.transfer.receiveRequest.bulk.downloadCachedTitle"),
1758
+ message: h("inventory.transfer.receiveRequest.bulk.downloadCachedMsg"),
1761
1759
  type: "info"
1762
1760
  }) : s.open({
1763
- title: g("inventory.transfer.receiveRequest.bulk.downloadSuccess"),
1764
- message: g("inventory.transfer.receiveRequest.bulk.downloadQueued"),
1761
+ title: h("inventory.transfer.receiveRequest.bulk.downloadSuccess"),
1762
+ message: h("inventory.transfer.receiveRequest.bulk.downloadQueued"),
1765
1763
  type: "success"
1766
1764
  });
1767
1765
  } catch (F) {
1768
1766
  console.error("Bulk download enqueue failed", F), s.open({
1769
- title: g("inventory.transfer.receiveRequest.bulk.downloadError"),
1770
- message: g("inventory.transfer.receiveRequest.bulk.downloadErrorMsg"),
1767
+ title: h("inventory.transfer.receiveRequest.bulk.downloadError"),
1768
+ message: h("inventory.transfer.receiveRequest.bulk.downloadErrorMsg"),
1771
1769
  type: "error"
1772
1770
  });
1773
1771
  }
1774
1772
  }
1775
- async function Ue(r) {
1776
- var ke, De, qe;
1777
- if (!await U("email")) return;
1773
+ async function Ge(r) {
1774
+ var we, Pe, De;
1775
+ if (!await j("email")) return;
1778
1776
  const u = [
1779
1777
  Dt.enum.RECEIVING,
1780
1778
  Dt.enum.PROCESSING
1781
1779
  // PARTIAL_RECEIVED display status maps from PROCESSING
1782
- ], b = r.filter((D) => u.includes(D.status));
1783
- if (b.length === 0) {
1780
+ ], g = r.filter((D) => u.includes(D.status));
1781
+ if (g.length === 0) {
1784
1782
  s.open({
1785
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1786
- message: g("inventory.transfer.receiveRequest.bulk.noOrdersToEmail"),
1783
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1784
+ message: h("inventory.transfer.receiveRequest.bulk.noOrdersToEmail"),
1787
1785
  type: "warning"
1788
1786
  });
1789
1787
  return;
1790
1788
  }
1791
- if (!((ke = L.currentBusiness.value) != null && ke._id)) return;
1792
- await Me(b);
1793
- const A = $n(), M = In(), F = /* @__PURE__ */ new Map(), Q = x.locations.map((D) => D.dbName), Z = `business_${L.currentBusiness.value._id}`, ee = [.../* @__PURE__ */ new Set([...Q, Z])];
1789
+ if (!((we = L.currentBusiness.value) != null && we._id)) return;
1790
+ await Le(g);
1791
+ const O = yn(), M = Rn(), F = /* @__PURE__ */ new Map(), H = x.locations.map((D) => D.dbName), Z = `business_${L.currentBusiness.value._id}`, ee = [.../* @__PURE__ */ new Set([...H, Z])];
1794
1792
  await Promise.allSettled(
1795
1793
  ee.map(async (D) => {
1796
1794
  try {
1797
- (await M.readSuppliersByDbName(D)).forEach((he) => {
1798
- const _e = F.get(he._id);
1799
- (!_e || !_e.email && he.email) && F.set(he._id, he);
1795
+ (await M.readSuppliersByDbName(D)).forEach((ye) => {
1796
+ const he = F.get(ye._id);
1797
+ (!he || !he.email && ye.email) && F.set(ye._id, ye);
1800
1798
  });
1801
- } catch (ie) {
1802
- console.warn("[emailAll] fetch failed for", D, ie);
1799
+ } catch (le) {
1800
+ console.warn("[emailAll] fetch failed for", D, le);
1803
1801
  }
1804
1802
  })
1805
1803
  );
1806
- function oe(D) {
1807
- var he;
1808
- const ie = F.get(D.supplier._id);
1809
- return (ie == null ? void 0 : ie.email) || ((he = D.supplier) == null ? void 0 : he.email);
1810
- }
1811
- const te = [], pe = [];
1812
- for (const D of b)
1813
- oe(D) ? te.push(D) : pe.push(D);
1814
- const be = Ee(
1804
+ function re(D) {
1805
+ var ye;
1806
+ const le = F.get(D.supplier._id);
1807
+ return (le == null ? void 0 : le.email) || ((ye = D.supplier) == null ? void 0 : ye.email);
1808
+ }
1809
+ const te = [], fe = [];
1810
+ for (const D of g)
1811
+ re(D) ? te.push(D) : fe.push(D);
1812
+ const ve = qe(
1815
1813
  "p",
1816
1814
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1817
- g("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
1815
+ h("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
1818
1816
  );
1819
- if (pe.length > 0) {
1817
+ if (fe.length > 0) {
1820
1818
  const D = /* @__PURE__ */ new Map();
1821
- for (const _e of pe) {
1822
- const Ve = _e.supplier._id;
1823
- D.has(Ve) || D.set(Ve, { supplierName: _e.supplier.name, pos: [] }), D.get(Ve).pos.push(_e);
1819
+ for (const he of fe) {
1820
+ const Me = he.supplier._id;
1821
+ D.has(Me) || D.set(Me, { supplierName: he.supplier.name, pos: [] }), D.get(Me).pos.push(he);
1824
1822
  }
1825
- const ie = Ee("div", { class: "flex flex-col gap-12" }, [
1826
- be,
1827
- Ee(
1823
+ const le = qe("div", { class: "flex flex-col gap-12" }, [
1824
+ ve,
1825
+ qe(
1828
1826
  "p",
1829
1827
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1830
- g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [pe.length])
1828
+ h("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [fe.length])
1831
1829
  ),
1832
- Ee(
1830
+ qe(
1833
1831
  "div",
1834
1832
  { class: "flex flex-col gap-4 max-h-[320px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100 p-8" },
1835
1833
  [...D.values()].map(
1836
- ({ supplierName: _e, pos: Ve }) => Ee("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
1837
- Ee("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, _e),
1838
- Ee(
1834
+ ({ supplierName: he, pos: Me }) => qe("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
1835
+ qe("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, he),
1836
+ qe(
1839
1837
  "div",
1840
1838
  { class: "flex flex-wrap gap-4" },
1841
- Ve.map(
1842
- (Qe) => Ee("span", {
1839
+ Me.map(
1840
+ (Ye) => qe("span", {
1843
1841
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded px-6 py-2"
1844
- }, `PO #${Qe.seqNumber ?? Qe._id}`)
1842
+ }, `PO #${Ye.seqNumber ?? Ye._id}`)
1845
1843
  )
1846
1844
  )
1847
1845
  ])
1848
1846
  )
1849
1847
  ),
1850
- Ee(
1848
+ qe(
1851
1849
  "p",
1852
1850
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1853
- g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [te.length, b.length])
1851
+ h("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [te.length, g.length])
1854
1852
  ),
1855
- Ee(
1853
+ qe(
1856
1854
  "p",
1857
1855
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1858
- g("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
1856
+ h("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
1859
1857
  )
1860
1858
  ]);
1861
- if (!await new Promise((_e) => {
1859
+ if (!await new Promise((he) => {
1862
1860
  _.open({
1863
- title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1864
- contentComponent: ie,
1861
+ title: h("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1862
+ contentComponent: le,
1865
1863
  contentComponentProps: {},
1866
1864
  primaryActions: {
1867
- text: g("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
1865
+ text: h("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
1868
1866
  close: !0
1869
1867
  },
1870
- secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1871
- }).onPrimary(() => _e(!0)).onSecondary(() => _e(!1));
1868
+ secondaryActions: { text: h("inventory.common.cancel"), close: !0 }
1869
+ }).onPrimary(() => he(!0)).onSecondary(() => he(!1));
1872
1870
  })) return;
1873
1871
  } else {
1874
- const D = Ee("div", { class: "flex flex-col gap-12" }, [
1875
- be,
1876
- Ee(
1872
+ const D = qe("div", { class: "flex flex-col gap-12" }, [
1873
+ ve,
1874
+ qe(
1877
1875
  "p",
1878
1876
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1879
- g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [te.length])
1877
+ h("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [te.length])
1880
1878
  )
1881
1879
  ]);
1882
- if (!await new Promise((he) => {
1880
+ if (!await new Promise((ye) => {
1883
1881
  _.open({
1884
- title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1882
+ title: h("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1885
1883
  contentComponent: D,
1886
1884
  contentComponentProps: {},
1887
1885
  primaryActions: {
1888
- text: g("inventory.transfer.receiveRequest.bulk.emailConfirm"),
1886
+ text: h("inventory.transfer.receiveRequest.bulk.emailConfirm"),
1889
1887
  close: !0
1890
1888
  },
1891
- secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1892
- }).onPrimary(() => he(!0)).onSecondary(() => he(!1));
1889
+ secondaryActions: { text: h("inventory.common.cancel"), close: !0 }
1890
+ }).onPrimary(() => ye(!0)).onSecondary(() => ye(!1));
1893
1891
  })) return;
1894
1892
  }
1895
1893
  if (te.length === 0) {
1896
1894
  s.open({
1897
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1898
- message: g("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
1895
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1896
+ message: h("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
1899
1897
  type: "warning"
1900
1898
  });
1901
1899
  return;
1902
1900
  }
1903
- let Pe = [];
1901
+ let Re = [];
1904
1902
  try {
1905
- Pe = await A.getEmailList(L.currentBusiness.value._id);
1903
+ Re = await O.getEmailList(L.currentBusiness.value._id);
1906
1904
  } catch {
1907
1905
  s.open({
1908
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1909
- message: g("inventory.transfer.receiveRequest.bulk.noEmailSender"),
1906
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1907
+ message: h("inventory.transfer.receiveRequest.bulk.noEmailSender"),
1910
1908
  type: "error"
1911
1909
  });
1912
1910
  return;
1913
1911
  }
1914
- const Ae = Pe.find((D) => D.verified);
1915
- if (!Ae) {
1912
+ const $e = Re.find((D) => D.verified);
1913
+ if (!$e) {
1916
1914
  s.open({
1917
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1918
- message: g("inventory.transfer.receiveRequest.bulk.noEmailSender"),
1915
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1916
+ message: h("inventory.transfer.receiveRequest.bulk.noEmailSender"),
1919
1917
  type: "error"
1920
1918
  });
1921
1919
  return;
1922
1920
  }
1923
- const ge = /* @__PURE__ */ new Map();
1921
+ const be = /* @__PURE__ */ new Map();
1924
1922
  for (const D of te) {
1925
- const ie = oe(D);
1926
- if (!ie) continue;
1927
- const _e = (((De = x.locations.find((pt) => pt.dbName === D._locationDbName)) == null ? void 0 : De.name) || D._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), Ve = `PO_${D.seqNumber || D._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), Qe = { poId: D._id, dbName: D._locationDbName, filename: `${_e}/${Ve}` }, st = ge.get(ie);
1928
- st ? (st.pos.push(Qe), st.seqNumbers.push(D.seqNumber ?? D._id)) : ge.set(ie, {
1923
+ const le = re(D);
1924
+ if (!le) continue;
1925
+ const he = (((Pe = x.locations.find((pt) => pt.dbName === D._locationDbName)) == null ? void 0 : Pe.name) || D._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), Me = `PO_${D.seqNumber || D._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), Ye = { poId: D._id, dbName: D._locationDbName, filename: `${he}/${Me}` }, st = be.get(le);
1926
+ st ? (st.pos.push(Ye), st.seqNumbers.push(D.seqNumber ?? D._id)) : be.set(le, {
1929
1927
  recipientName: D.supplier.name,
1930
- recipientEmail: ie,
1931
- pos: [Qe],
1928
+ recipientEmail: le,
1929
+ pos: [Ye],
1932
1930
  seqNumbers: [D.seqNumber ?? D._id]
1933
1931
  });
1934
1932
  }
1935
- const Y = [...ge.values()].map((D) => ({
1933
+ const Y = [...be.values()].map((D) => ({
1936
1934
  subject: D.pos.length > 1 ? `Purchase Orders (${D.pos.length})` : `Purchase Order #${D.seqNumbers[0]}`,
1937
1935
  recipientName: D.recipientName,
1938
1936
  recipientEmail: D.recipientEmail,
1939
1937
  pos: D.pos
1940
- })), G = d.value[0];
1938
+ })), K = d.value[0];
1941
1939
  try {
1942
- const { jobId: D } = await J.enqueueBulkEmail(G, {
1943
- senderEmail: Ae.emailAddress,
1944
- senderName: Ae.name || ((qe = L.currentBusiness.value) == null ? void 0 : qe.name) || "FeedMe Inventory",
1940
+ const { jobId: D } = await V.enqueueBulkEmail(K, {
1941
+ senderEmail: $e.emailAddress,
1942
+ senderName: $e.name || ((De = L.currentBusiness.value) == null ? void 0 : De.name) || "FeedMe Inventory",
1945
1943
  items: Y
1946
1944
  });
1947
1945
  m.addJob({
1948
1946
  jobId: D,
1949
1947
  type: "email",
1950
- dbName: G,
1948
+ dbName: K,
1951
1949
  title: `Email All (${Y.length} supplier${Y.length === 1 ? "" : "s"}, ${te.length} POs)`,
1952
1950
  status: "waiting",
1953
1951
  progress: 0,
@@ -1956,76 +1954,76 @@ function Xs(C) {
1956
1954
  errorCount: 0,
1957
1955
  startedAt: Date.now()
1958
1956
  }), s.open({
1959
- title: g("inventory.transfer.receiveRequest.bulk.emailSuccess"),
1960
- message: g("inventory.transfer.receiveRequest.bulk.emailQueued"),
1957
+ title: h("inventory.transfer.receiveRequest.bulk.emailSuccess"),
1958
+ message: h("inventory.transfer.receiveRequest.bulk.emailQueued"),
1961
1959
  type: "success"
1962
1960
  });
1963
1961
  } catch (D) {
1964
1962
  console.error("Bulk email enqueue failed", D), s.open({
1965
- title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1966
- message: g("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
1963
+ title: h("inventory.transfer.receiveRequest.bulk.emailSendError"),
1964
+ message: h("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
1967
1965
  type: "error"
1968
1966
  });
1969
1967
  }
1970
1968
  }
1971
1969
  return {
1972
1970
  selectedLocationDbNames: d,
1973
- purchaseOrders: h,
1971
+ purchaseOrders: b,
1974
1972
  shipments: c,
1975
1973
  purchaseRequests: w,
1976
- rowAction: Oe,
1977
- updateDateRange: we,
1978
- fetchData: re,
1974
+ rowAction: Ne,
1975
+ updateDateRange: _e,
1976
+ fetchData: se,
1979
1977
  failedLocations: R,
1980
- retryFailedLocations: Ce,
1978
+ retryFailedLocations: ke,
1981
1979
  retryingFailed: I,
1982
- fetchProgress: se,
1983
- abortOngoingBrowse: de,
1984
- fetchFullPurchaseOrders: $e,
1980
+ fetchProgress: ae,
1981
+ abortOngoingBrowse: ce,
1982
+ fetchFullPurchaseOrders: ze,
1985
1983
  loading: o,
1986
1984
  transferDialogProps: lt,
1987
1985
  promptCreateTransferDialog: Ze,
1988
1986
  promptUpdateTransferDialog: N,
1989
- transferDetailsProps: Ne,
1987
+ transferDetailsProps: Ee,
1990
1988
  promptShowTransferDetails: ne,
1991
1989
  resolvePO: z,
1992
- submitAction: fe,
1990
+ submitAction: Te,
1993
1991
  xilnexImportDialogProps: ht,
1994
- promptUploadTransferDialog: Le,
1992
+ promptUploadTransferDialog: We,
1995
1993
  emailDialogProps: Be,
1996
1994
  promptEmailDialog: k,
1997
- downloadAll: ye,
1998
- emailAll: Ue,
1995
+ downloadAll: xe,
1996
+ emailAll: Ge,
1999
1997
  lastClosingDate: W
2000
1998
  };
2001
1999
  }
2002
- function Zs(C, _, x) {
2003
- const $ = C._locationDbName;
2000
+ function Gs(C, _, x) {
2001
+ const B = C._locationDbName;
2002
+ if (!B) return null;
2003
+ const $ = _.find((L) => L.dbName === B);
2004
2004
  if (!$) return null;
2005
- const O = _.find((L) => L.dbName === $);
2006
- if (!O) return null;
2007
- if (O.type === "restaurant") {
2008
- const L = x(O.doc._id);
2009
- if (L !== null) return { ...O, doc: L };
2005
+ if ($.type === "restaurant") {
2006
+ const L = x($.doc._id);
2007
+ if (L !== null) return { ...$, doc: L };
2010
2008
  }
2011
- return O;
2009
+ return $;
2012
2010
  }
2013
- function er(C, _) {
2011
+ function Ks(C, _) {
2014
2012
  return _.find((x) => x.purchaseOrderId === C._id);
2015
2013
  }
2016
- function tr(C, _) {
2017
- const x = mt(), { t: $ } = it(), O = nt(), L = ft(), K = wt(), V = P(!1), o = P(!1), s = P(null);
2018
- async function g(m, d) {
2014
+ function Xs(C, _) {
2015
+ const x = mt(), { t: B } = it(), $ = nt(), L = ft(), G = wt(), U = P(!1), o = P(!1), s = P(null);
2016
+ async function h(m, d) {
2019
2017
  if (m !== ct.PrintPdf) return !1;
2020
2018
  const c = d._locationDbName, w = d._rev;
2021
- s.value && (URL.revokeObjectURL(s.value), s.value = null), o.value = !0, V.value = !0;
2019
+ s.value && (URL.revokeObjectURL(s.value), s.value = null), o.value = !0, U.value = !0;
2022
2020
  try {
2023
- let l = await O.getPurchaseOrderPdf(d._id, c, w);
2024
- "pending" in l && (await K.waitForPdfJob(l.jobId, c), l = await O.getPurchaseOrderPdf(d._id, c, w)), s.value = URL.createObjectURL(l);
2021
+ let l = await $.getPurchaseOrderPdf(d._id, c, w);
2022
+ "pending" in l && (await G.waitForPdfJob(l.jobId, c), l = await $.getPurchaseOrderPdf(d._id, c, w)), s.value = URL.createObjectURL(l);
2025
2023
  } catch {
2026
- V.value = !1, L.open({
2027
- title: $("inventory.common.somethingWentWrong"),
2028
- message: $("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
2024
+ U.value = !1, L.open({
2025
+ title: B("inventory.common.somethingWentWrong"),
2026
+ message: B("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
2029
2027
  type: "error"
2030
2028
  });
2031
2029
  } finally {
@@ -2033,8 +2031,8 @@ function tr(C, _) {
2033
2031
  }
2034
2032
  return !0;
2035
2033
  }
2036
- const J = kn(
2037
- Bt.RECEIVE_REQUEST,
2034
+ const V = In(
2035
+ It.RECEIVE_REQUEST,
2038
2036
  C,
2039
2037
  _,
2040
2038
  {
@@ -2045,88 +2043,88 @@ function tr(C, _) {
2045
2043
  fetchFullPo: async (m) => {
2046
2044
  const d = m._locationDbName;
2047
2045
  return await C.rowAction.run(
2048
- (c) => O.getPurchaseOrderById(m._id, d, c)
2046
+ (c) => $.getPurchaseOrderById(m._id, d, c)
2049
2047
  ) ?? null;
2050
2048
  },
2051
- resolveLocation: (m) => Zs(
2049
+ resolveLocation: (m) => Gs(
2052
2050
  m,
2053
2051
  x.locations,
2054
2052
  x.locationRestaurantFromCore
2055
2053
  ),
2056
- resolvePurchaseRequest: (m) => er(m, C.purchaseRequests.value),
2054
+ resolvePurchaseRequest: (m) => Ks(m, C.purchaseRequests.value),
2057
2055
  // Exclude both legacy Print and Print (Beta) — the bulk listing uses
2058
2056
  // Lambda-generated PDF via PrintPdf instead.
2059
2057
  excludeRowActions: [ct.Print, ct.PrintCustom],
2060
2058
  // Inject the Lambda PDF print action into every row's context menu.
2061
- appendRowActions: () => [Zn[ct.PrintPdf]],
2059
+ appendRowActions: () => [Gn[ct.PrintPdf]],
2062
2060
  // Handle the PrintPdf action before the default handler runs.
2063
- onCustomAction: (m, d) => g(m, d)
2061
+ onCustomAction: (m, d) => h(m, d)
2064
2062
  }
2065
2063
  );
2066
2064
  return {
2067
- columnDefs: B(() => {
2068
- const m = J.columnDefs.value, d = {
2065
+ columnDefs: A(() => {
2066
+ const m = V.columnDefs.value, d = {
2069
2067
  id: "location",
2070
- header: () => $("inventory.transfer.receiveRequest.bulk.locationColumn"),
2068
+ header: () => B("inventory.transfer.receiveRequest.bulk.locationColumn"),
2071
2069
  cell(c) {
2072
2070
  const w = c.row.original._locationDbName, l = x.locations.find((f) => f.dbName === w);
2073
2071
  return l ? `${l.name} (${l.doc.profile.code ?? "--"})` : w;
2074
2072
  },
2075
2073
  enableSorting: !1,
2076
2074
  size: 160
2077
- }, h = [...m];
2078
- return h.splice(1, 0, d), h;
2075
+ }, b = [...m];
2076
+ return b.splice(1, 0, d), b;
2079
2077
  }),
2080
- showPdfDialog: V,
2078
+ showPdfDialog: U,
2081
2079
  pdfPreviewLoading: o,
2082
2080
  pdfPreviewBlobUrl: s
2083
2081
  };
2084
2082
  }
2085
- const nr = {
2083
+ const Zs = {
2086
2084
  key: 0,
2087
2085
  class: "inline-flex items-center justify-center bg-white/25 text-white rounded-full min-w-[18px] h-[18px] px-[4px] text-[10px] font-semibold leading-none"
2088
- }, ar = {
2086
+ }, er = {
2089
2087
  key: 1,
2090
2088
  class: "bg-white rounded-lg shadow-xl border border-fm-color-neutral-gray-100 w-[360px] max-h-[480px] flex flex-col overflow-hidden"
2091
- }, sr = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, rr = { class: "fm-typo-en-title-sm-600" }, or = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, lr = { class: "flex items-start justify-between gap-8" }, ir = { class: "flex flex-col gap-2" }, ur = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, cr = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, dr = { class: "flex items-center gap-4" }, mr = ["disabled", "onClick"], fr = ["disabled", "onClick"], pr = ["onClick"], vr = {
2089
+ }, tr = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, nr = { class: "fm-typo-en-title-sm-600" }, ar = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, sr = { class: "flex items-start justify-between gap-8" }, rr = { class: "flex flex-col gap-2" }, or = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, lr = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, ir = { class: "flex items-center gap-4" }, ur = ["disabled", "onClick"], cr = ["disabled", "onClick"], dr = ["onClick"], mr = {
2092
2090
  key: 0,
2093
2091
  class: "flex flex-col gap-4"
2094
- }, yr = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, br = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, hr = {
2092
+ }, fr = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, pr = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, vr = {
2095
2093
  key: 0,
2096
2094
  class: "truncate max-w-[200px]"
2097
- }, gr = { class: "ml-auto" }, _r = {
2095
+ }, yr = { class: "ml-auto" }, br = {
2098
2096
  key: 1,
2099
2097
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-success"
2100
- }, xr = {
2098
+ }, hr = {
2101
2099
  key: 2,
2102
2100
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-warning"
2103
- }, wr = {
2101
+ }, gr = {
2104
2102
  key: 3,
2105
2103
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-secondary"
2106
- }, kr = {
2104
+ }, _r = {
2107
2105
  key: 4,
2108
2106
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-error"
2109
- }, Cr = { key: 0 }, Fr = { key: 1 }, Sr = {
2107
+ }, xr = { key: 0 }, wr = { key: 1 }, kr = {
2110
2108
  key: 5,
2111
2109
  class: "flex items-center gap-[5px] text-[11px] leading-none text-fm-color-typo-secondary"
2112
- }, Rr = /* @__PURE__ */ at({
2110
+ }, Cr = /* @__PURE__ */ at({
2113
2111
  __name: "BulkJobProgressPanel",
2114
2112
  setup(C) {
2115
- const { t: _ } = ea(), x = wt(), $ = B(() => x.jobs.filter((c) => !c.hidden)), O = nt(), L = P(!1), K = P(null);
2116
- function V(c) {
2117
- L.value && K.value && !K.value.contains(c.target) && (L.value = !1);
2118
- }
2119
- tn(() => {
2120
- document.addEventListener("click", V, !0);
2121
- }), nn(() => {
2122
- document.removeEventListener("click", V, !0);
2113
+ const { t: _ } = Kn(), x = wt(), B = A(() => x.jobs.filter((c) => !c.hidden)), $ = nt(), L = P(!1), G = P(null);
2114
+ function U(c) {
2115
+ L.value && G.value && !G.value.contains(c.target) && (L.value = !1);
2116
+ }
2117
+ en(() => {
2118
+ document.addEventListener("click", U, !0);
2119
+ }), tn(() => {
2120
+ document.removeEventListener("click", U, !0);
2123
2121
  });
2124
2122
  const o = P(/* @__PURE__ */ new Set()), s = P(/* @__PURE__ */ new Set());
2125
- async function g(c) {
2123
+ async function h(c) {
2126
2124
  if (!o.value.has(c.jobId)) {
2127
2125
  o.value = /* @__PURE__ */ new Set([...o.value, c.jobId]);
2128
2126
  try {
2129
- const w = await O.downloadBulkJob(c.dbName, c.jobId), l = URL.createObjectURL(w), f = document.createElement("a");
2127
+ const w = await $.downloadBulkJob(c.dbName, c.jobId), l = URL.createObjectURL(w), f = document.createElement("a");
2130
2128
  f.href = l, f.download = "purchase-orders.zip", document.body.appendChild(f), f.click(), document.body.removeChild(f), setTimeout(() => URL.revokeObjectURL(l), 1e3);
2131
2129
  } finally {
2132
2130
  const w = new Set(o.value);
@@ -2134,7 +2132,7 @@ const nr = {
2134
2132
  }
2135
2133
  }
2136
2134
  }
2137
- async function J(c) {
2135
+ async function V(c) {
2138
2136
  if (!s.value.has(c.jobId)) {
2139
2137
  s.value = /* @__PURE__ */ new Set([...s.value, c.jobId]);
2140
2138
  try {
@@ -2145,7 +2143,7 @@ const nr = {
2145
2143
  }
2146
2144
  }
2147
2145
  }
2148
- function Fe(c) {
2146
+ function Ce(c) {
2149
2147
  x.removeJob(c);
2150
2148
  }
2151
2149
  function m(c) {
@@ -2155,16 +2153,16 @@ const nr = {
2155
2153
  const w = Math.round(c / 1e3), l = Math.floor(w / 60), f = w % 60;
2156
2154
  return l > 0 ? `${l}m ${f}s` : `${f}s`;
2157
2155
  }
2158
- function h(c) {
2156
+ function b(c) {
2159
2157
  return c < 1024 ? `${c} B` : c < 1024 * 1024 ? `${(c / 1024).toFixed(1)} KB` : `${(c / (1024 * 1024)).toFixed(1)} MB`;
2160
2158
  }
2161
2159
  return (c, w) => {
2162
- const l = Te("FmIcon");
2163
- return i(), ve(dt, { to: "body" }, [
2164
- $.value.length > 0 ? (i(), y("div", {
2160
+ const l = Oe("FmIcon");
2161
+ return i(), pe(dt, { to: "body" }, [
2162
+ B.value.length > 0 ? (i(), y("div", {
2165
2163
  key: 0,
2166
2164
  ref_key: "panelRef",
2167
- ref: K,
2165
+ ref: G,
2168
2166
  class: "fixed bottom-24 right-24 z-[9998] flex flex-col items-end gap-8"
2169
2167
  }, [
2170
2168
  L.value ? q("", !0) : (i(), y("button", {
@@ -2177,11 +2175,11 @@ const nr = {
2177
2175
  size: "sm"
2178
2176
  }),
2179
2177
  e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
2180
- n(x).activeJobs.length > 0 ? (i(), y("span", nr, p(n(x).activeJobs.length), 1)) : q("", !0)
2178
+ n(x).activeJobs.length > 0 ? (i(), y("span", Zs, p(n(x).activeJobs.length), 1)) : q("", !0)
2181
2179
  ])),
2182
- L.value ? (i(), y("div", ar, [
2183
- e("div", sr, [
2184
- e("span", rr, p(n(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
2180
+ L.value ? (i(), y("div", er, [
2181
+ e("div", tr, [
2182
+ e("span", nr, p(n(_)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
2185
2183
  e("button", {
2186
2184
  "aria-label": "Collapse",
2187
2185
  onClick: w[1] || (w[1] = (f) => L.value = !1),
@@ -2193,104 +2191,104 @@ const nr = {
2193
2191
  })
2194
2192
  ])
2195
2193
  ]),
2196
- e("div", or, [
2197
- (i(!0), y(Re, null, tt($.value, (f) => {
2194
+ e("div", ar, [
2195
+ (i(!0), y(Se, null, tt(B.value, (f) => {
2198
2196
  var T;
2199
2197
  return i(), y("div", {
2200
2198
  key: f.jobId,
2201
2199
  class: "px-16 py-12 flex flex-col gap-8"
2202
2200
  }, [
2203
- e("div", lr, [
2204
- e("div", ir, [
2205
- e("span", ur, p(f.title), 1),
2206
- e("span", cr, p(f.status), 1)
2201
+ e("div", sr, [
2202
+ e("div", rr, [
2203
+ e("span", or, p(f.title), 1),
2204
+ e("span", lr, p(f.status), 1)
2207
2205
  ]),
2208
- e("div", dr, [
2206
+ e("div", ir, [
2209
2207
  f.downloadReady ? (i(), y("button", {
2210
2208
  key: 0,
2211
2209
  class: "text-fm-color-primary hover:opacity-80 disabled:opacity-40",
2212
2210
  disabled: o.value.has(f.jobId),
2213
2211
  title: "Download",
2214
2212
  "aria-label": "Download",
2215
- onClick: (W) => g(f)
2213
+ onClick: (W) => h(f)
2216
2214
  }, [
2217
2215
  E(l, {
2218
2216
  name: o.value.has(f.jobId) ? "progress_activity" : "download",
2219
2217
  size: "sm"
2220
2218
  }, null, 8, ["name"])
2221
- ], 8, mr)) : q("", !0),
2219
+ ], 8, ur)) : q("", !0),
2222
2220
  f.status === "waiting" || f.status === "active" ? (i(), y("button", {
2223
2221
  key: 1,
2224
2222
  class: "text-fm-color-semantic-error-500 hover:opacity-80 disabled:opacity-40",
2225
2223
  disabled: s.value.has(f.jobId),
2226
2224
  title: "Cancel",
2227
2225
  "aria-label": "Cancel",
2228
- onClick: (W) => J(f)
2226
+ onClick: (W) => V(f)
2229
2227
  }, [
2230
2228
  E(l, {
2231
2229
  name: s.value.has(f.jobId) ? "progress_activity" : "cancel",
2232
2230
  size: "sm"
2233
2231
  }, null, 8, ["name"])
2234
- ], 8, fr)) : q("", !0),
2232
+ ], 8, cr)) : q("", !0),
2235
2233
  m(f.status) ? (i(), y("button", {
2236
2234
  key: 2,
2237
2235
  class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
2238
2236
  title: "Dismiss",
2239
2237
  "aria-label": "Dismiss",
2240
- onClick: (W) => Fe(f.jobId)
2238
+ onClick: (W) => Ce(f.jobId)
2241
2239
  }, [
2242
2240
  E(l, {
2243
2241
  name: "close",
2244
2242
  size: "sm"
2245
2243
  })
2246
- ], 8, pr)) : q("", !0)
2244
+ ], 8, dr)) : q("", !0)
2247
2245
  ])
2248
2246
  ]),
2249
- f.status === "active" || f.status === "waiting" ? (i(), y("div", vr, [
2250
- e("div", yr, [
2247
+ f.status === "active" || f.status === "waiting" ? (i(), y("div", mr, [
2248
+ e("div", fr, [
2251
2249
  e("div", {
2252
2250
  class: "bg-fm-color-primary h-[3px] rounded-full transition-all duration-300",
2253
2251
  style: gt({ width: `${f.progress}%` })
2254
2252
  }, null, 4)
2255
2253
  ]),
2256
- e("div", br, [
2257
- f.currentItem ? (i(), y("span", hr, p(f.currentItem), 1)) : q("", !0),
2258
- e("span", gr, p(f.current) + " / " + p(f.total), 1)
2254
+ e("div", pr, [
2255
+ f.currentItem ? (i(), y("span", vr, p(f.currentItem), 1)) : q("", !0),
2256
+ e("span", yr, p(f.current) + " / " + p(f.total), 1)
2259
2257
  ])
2260
2258
  ])) : q("", !0),
2261
- f.status === "completed" && f.errorCount === 0 ? (i(), y("div", _r, [
2259
+ f.status === "completed" && f.errorCount === 0 ? (i(), y("div", br, [
2262
2260
  E(l, {
2263
2261
  name: "check_circle",
2264
2262
  size: "sm"
2265
2263
  }),
2266
2264
  e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
2267
2265
  ])) : q("", !0),
2268
- f.status === "completed" && (((T = f.stalePoIds) == null ? void 0 : T.length) ?? 0) > 0 ? (i(), y("div", xr, [
2266
+ f.status === "completed" && (((T = f.stalePoIds) == null ? void 0 : T.length) ?? 0) > 0 ? (i(), y("div", hr, [
2269
2267
  E(l, {
2270
2268
  name: "warning",
2271
2269
  size: "sm"
2272
2270
  }),
2273
2271
  e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobStalePos", [f.stalePoIds.length])), 1)
2274
2272
  ])) : q("", !0),
2275
- f.status === "cancelled" ? (i(), y("div", wr, [
2273
+ f.status === "cancelled" ? (i(), y("div", gr, [
2276
2274
  E(l, {
2277
2275
  name: "do_not_disturb_on",
2278
2276
  size: "sm"
2279
2277
  }),
2280
2278
  e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
2281
2279
  ])) : q("", !0),
2282
- f.status === "failed" ? (i(), y("div", kr, [
2280
+ f.status === "failed" ? (i(), y("div", _r, [
2283
2281
  E(l, {
2284
2282
  name: "cancel",
2285
2283
  size: "sm"
2286
2284
  }),
2287
- f.errorCount > 0 ? (i(), y("span", Cr, p(n(_)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [f.errorCount])), 1)) : (i(), y("span", Fr, p(n(_)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
2285
+ f.errorCount > 0 ? (i(), y("span", xr, p(n(_)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [f.errorCount])), 1)) : (i(), y("span", wr, p(n(_)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
2288
2286
  ])) : q("", !0),
2289
- m(f.status) && f.completedAt ? (i(), y("div", Sr, [
2287
+ m(f.status) && f.completedAt ? (i(), y("div", kr, [
2290
2288
  e("span", null, p(n(_)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [d(f.completedAt - f.startedAt)])), 1),
2291
- f.zipSizeBytes ? (i(), y(Re, { key: 0 }, [
2289
+ f.zipSizeBytes ? (i(), y(Se, { key: 0 }, [
2292
2290
  w[2] || (w[2] = e("span", null, "·", -1)),
2293
- e("span", null, p(h(f.zipSizeBytes)), 1)
2291
+ e("span", null, p(b(f.zipSizeBytes)), 1)
2294
2292
  ], 64)) : q("", !0)
2295
2293
  ])) : q("", !0)
2296
2294
  ]);
@@ -2301,31 +2299,31 @@ const nr = {
2301
2299
  ]);
2302
2300
  };
2303
2301
  }
2304
- }), Pr = {
2302
+ }), Fr = {
2305
2303
  key: 0,
2306
2304
  class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
2307
- }, Dr = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, qr = { class: "flex-1 xs:w-full sm:w-full" }, Er = {
2305
+ }, Sr = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, Rr = { class: "flex-1 xs:w-full sm:w-full" }, Pr = {
2308
2306
  key: 0,
2309
2307
  class: "flex-1"
2310
- }, Nr = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, Or = {
2308
+ }, Dr = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, qr = {
2311
2309
  key: 0,
2312
2310
  class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
2313
- }, $r = { class: "fm-typo-en-body-md-400" }, Ar = {
2311
+ }, Er = { class: "fm-typo-en-body-md-400" }, Nr = {
2314
2312
  key: 1,
2315
2313
  class: "relative"
2316
- }, Br = {
2314
+ }, $r = {
2317
2315
  key: 0,
2318
2316
  class: "flex items-center gap-12 mb-8"
2319
- }, Tr = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, Ir = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, Lr = {
2317
+ }, Br = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, Or = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, Ar = {
2320
2318
  key: 1,
2321
2319
  class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-8"
2322
- }, zr = { class: "fm-typo-en-body-md-400 text-red-800" }, Mr = { class: "flex flex-col py-8" }, Ur = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vr = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Jr = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, jr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Wr = {
2320
+ }, Tr = { class: "fm-typo-en-body-md-400 text-red-800" }, Ir = { class: "flex flex-col py-8" }, Lr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zr = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Mr = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Ur = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Vr = {
2323
2321
  key: 0,
2324
2322
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
2325
- }, Yr = { class: "pt-8" }, Qr = {
2323
+ }, Jr = { class: "pt-8" }, jr = {
2326
2324
  key: 0,
2327
2325
  class: "absolute inset-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm"
2328
- }, Hr = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Kr = { class: "fm-typo-en-body-md-400" }, At = "BulkReceiveRequestViewSearchCriteria", Gr = /* @__PURE__ */ at({
2326
+ }, Wr = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Yr = { class: "fm-typo-en-body-md-400" }, Bt = "BulkReceiveRequestViewSearchCriteria", Hr = /* @__PURE__ */ at({
2329
2327
  __name: "BulkReceiveRequestView",
2330
2328
  setup(C) {
2331
2329
  const { t: _ } = it(), x = ft();
@@ -2334,12 +2332,12 @@ const nr = {
2334
2332
  startDate: ut.string().optional().nullable(),
2335
2333
  endDate: ut.string().optional().nullable()
2336
2334
  });
2337
- const $ = Pn(), O = xt(), L = on();
2338
- function K() {
2335
+ const B = wn(), $ = xt(), L = rn();
2336
+ function G() {
2339
2337
  const N = {
2340
2338
  name: "",
2341
2339
  ..._t()
2342
- }, k = $.getItem(At);
2340
+ }, k = B.getItem(Bt);
2343
2341
  if (!k) return N;
2344
2342
  try {
2345
2343
  return JSON.parse(k);
@@ -2347,16 +2345,16 @@ const nr = {
2347
2345
  return N;
2348
2346
  }
2349
2347
  }
2350
- function V() {
2351
- $.setItem(At, JSON.stringify(o.value));
2348
+ function U() {
2349
+ B.setItem(Bt, JSON.stringify(o.value));
2352
2350
  }
2353
- const o = P(K()), s = Xs(o.value), g = P(!1), { selectedLocationDbNames: J } = s, Fe = B(() => T.value.filter((N) => J.value.includes(N.dbName)).map((N) => N.doc._id)), {
2351
+ const o = P(G()), s = Qs(o.value), h = P(!1), { selectedLocationDbNames: V } = s, Ce = A(() => T.value.filter((N) => V.value.includes(N.dbName)).map((N) => N.doc._id)), {
2354
2352
  columnDefs: m,
2355
2353
  showPdfDialog: d,
2356
- pdfPreviewLoading: h,
2354
+ pdfPreviewLoading: b,
2357
2355
  pdfPreviewBlobUrl: c
2358
- } = tr(s, s.shipments), w = mt(), l = pn(), f = Tt(), T = P([]);
2359
- an(() => {
2356
+ } = Xs(s, s.shipments), w = mt(), l = fn(), f = Ot(), T = P([]);
2357
+ nn(() => {
2360
2358
  const N = w.locations;
2361
2359
  N.length > 0 && (T.value = N);
2362
2360
  });
@@ -2369,26 +2367,26 @@ const nr = {
2369
2367
  } catch {
2370
2368
  }
2371
2369
  }
2372
- Ke(
2370
+ Qe(
2373
2371
  [() => f.sessionUser.value, () => f.currentBusiness.value],
2374
2372
  ([N, k]) => {
2375
2373
  N && k && W();
2376
2374
  },
2377
2375
  { immediate: !0 }
2378
2376
  );
2379
- const R = B(() => s.loading.value), j = B(
2377
+ const R = A(() => s.loading.value), J = A(
2380
2378
  () => s.failedLocations.value.map((N) => {
2381
2379
  var k;
2382
2380
  return ((k = w.locations.find((z) => z.dbName === N.dbName)) == null ? void 0 : k.name) ?? N.dbName;
2383
2381
  }).join(", ")
2384
- ), I = B(
2382
+ ), I = A(
2385
2383
  () => s.failedLocations.value.some((N) => N.retryable)
2386
2384
  );
2387
- function se(N) {
2385
+ function ae(N) {
2388
2386
  var k;
2389
2387
  return N.itemCount ?? ((k = N.items) == null ? void 0 : k.length) ?? 0;
2390
2388
  }
2391
- async function ce() {
2389
+ async function ue() {
2392
2390
  const N = `inventory-record_${Xe(o.value.startDate).format("DD-MM-YYYY_HH-mm")}-${Xe(o.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`;
2393
2391
  let k = [];
2394
2392
  try {
@@ -2401,77 +2399,54 @@ const nr = {
2401
2399
  });
2402
2400
  return;
2403
2401
  }
2404
- const z = k.flatMap(
2405
- (ae) => ae.items.map((fe) => {
2406
- var u, b;
2407
- const Le = new Date(Sn(ae._id) ?? ""), $e = ae.effectiveAt ? new Date(ae.effectiveAt) : void 0, U = qt(
2408
- Fn(fe.sku, ae.deliveryOrder || [])
2409
- ), ye = qt(fe.quantity), Ue = ((u = fe == null ? void 0 : fe.measurement) == null ? void 0 : u.abbrev) || fe.sku.unit.abbrev;
2402
+ const z = _n(
2403
+ k.map((ne) => {
2404
+ var me;
2410
2405
  return {
2411
- Location: ((b = w.locations.find((A) => A.dbName === ae._locationDbName)) == null ? void 0 : b.name) ?? "",
2412
- "SKU code": fe.code,
2413
- "SKU name": fe.name,
2414
- "PO #": ae.seqNumber,
2415
- "Effective at": $e,
2416
- Date: Le,
2417
- Status: ae.status,
2418
- Reference: ae.ref ?? "",
2419
- "Received quantity": U,
2420
- "Ordered quantity": ye,
2421
- Unit: Ue,
2422
- "Total cost": fe.totalCost ? yn(fe.totalCost) : null
2406
+ po: ne,
2407
+ destination: ((me = w.locations.find((Te) => Te.dbName === ne._locationDbName)) == null ? void 0 : me.name) ?? ""
2423
2408
  };
2424
- })
2425
- ), ne = [
2426
- "Location",
2427
- "SKU code",
2428
- "SKU name",
2429
- "PO #",
2430
- "Date",
2431
- "Status",
2432
- "Reference",
2433
- "Received quantity",
2434
- "Ordered quantity",
2435
- "Unit"
2436
- ];
2437
- O.enableBackdatePo && ne.insert("Effective at", 5), O.enableTotalCost && ne.push("Total cost"), await Rn([{ name: "purchases", data: z, columns: ne }], N), x.open({
2409
+ }),
2410
+ { backdate: $.enableBackdatePo, totalCost: $.enableTotalCost }
2411
+ );
2412
+ await xn([z], N), x.open({
2438
2413
  title: _("inventory.transfer.receiveRequest.export.success"),
2439
2414
  message: _("inventory.transfer.receiveRequest.export.message", [N]),
2440
2415
  type: "success"
2441
2416
  });
2442
2417
  }
2443
- const de = P(_t()), me = P("");
2444
- Ke([() => de.value], ([N]) => {
2418
+ const ce = P(_t()), de = P("");
2419
+ Qe([() => ce.value], ([N]) => {
2445
2420
  if (!N.startDate || !N.endDate) return;
2446
2421
  if (Xe(N.endDate).diff(Xe(N.startDate), "day") > 60) {
2447
2422
  x.open({
2448
2423
  title: _("inventory.transfer.receiveRequest.bulk.dateRangeLimitTitle"),
2449
2424
  message: _("inventory.transfer.receiveRequest.bulk.dateRangeLimitMsg"),
2450
2425
  type: "warning"
2451
- }), de.value = {
2426
+ }), ce.value = {
2452
2427
  startDate: N.startDate,
2453
2428
  endDate: Xe(N.startDate).add(60, "day").format("YYYY-MM-DD")
2454
2429
  };
2455
2430
  return;
2456
2431
  }
2457
- o.value.startDate = N.startDate, o.value.endDate = N.endDate, s.updateDateRange(o.value.startDate, o.value.endDate), V();
2458
- }), Ke([() => me.value], () => {
2459
- V();
2432
+ o.value.startDate = N.startDate, o.value.endDate = N.endDate, s.updateDateRange(o.value.startDate, o.value.endDate), U();
2433
+ }), Qe([() => de.value], () => {
2434
+ U();
2460
2435
  });
2461
- const Je = ln.debounce(() => s.fetchData(), 1500);
2462
- Ke(
2463
- () => J.value,
2436
+ const Ue = on.debounce(() => s.fetchData(), 1500);
2437
+ Qe(
2438
+ () => V.value,
2464
2439
  () => {
2465
- s.abortOngoingBrowse(), Je();
2440
+ s.abortOngoingBrowse(), Ue();
2466
2441
  }
2467
2442
  );
2468
- function Se(N) {
2443
+ function Fe(N) {
2469
2444
  if (N === "create") {
2470
2445
  if (R.value) {
2471
2446
  x.open({ title: "Loading data...", message: "Please wait.", type: "info" });
2472
2447
  return;
2473
2448
  }
2474
- if (J.value.length === 0) {
2449
+ if (V.value.length === 0) {
2475
2450
  x.open({
2476
2451
  title: "No outlets selected",
2477
2452
  message: "Please select at least one outlet to create a transfer.",
@@ -2479,18 +2454,18 @@ const nr = {
2479
2454
  });
2480
2455
  return;
2481
2456
  }
2482
- g.value = !0;
2457
+ h.value = !0;
2483
2458
  return;
2484
2459
  }
2485
- if (N === "upload" && O.enableXilnexTransferNote)
2460
+ if (N === "upload" && $.enableXilnexTransferNote)
2486
2461
  return s.promptUploadTransferDialog();
2487
2462
  if (N === "refresh") return s.fetchData();
2488
- if (N === "export") return ce();
2489
- if (N === "downloadAll") return je();
2490
- if (N === "emailAll") return We();
2463
+ if (N === "export") return ue();
2464
+ if (N === "downloadAll") return Ve();
2465
+ if (N === "emailAll") return Je();
2491
2466
  }
2492
- async function je() {
2493
- if (J.value.length === 0) {
2467
+ async function Ve() {
2468
+ if (V.value.length === 0) {
2494
2469
  x.open({
2495
2470
  title: _("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
2496
2471
  message: "",
@@ -2498,11 +2473,11 @@ const nr = {
2498
2473
  });
2499
2474
  return;
2500
2475
  }
2501
- await s.downloadAll(Ye.value);
2476
+ await s.downloadAll(je.value);
2502
2477
  }
2503
- async function We() {
2504
- if (O.enablePurchaseOrderEmail) {
2505
- if (J.value.length === 0) {
2478
+ async function Je() {
2479
+ if ($.enablePurchaseOrderEmail) {
2480
+ if (V.value.length === 0) {
2506
2481
  x.open({
2507
2482
  title: _("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
2508
2483
  message: "",
@@ -2510,34 +2485,34 @@ const nr = {
2510
2485
  });
2511
2486
  return;
2512
2487
  }
2513
- await s.emailAll(Ye.value);
2488
+ await s.emailAll(je.value);
2514
2489
  }
2515
2490
  }
2516
- const { breakpoints: Me } = Nn(), le = B(() => Me.value.xs || Me.value.sm), re = B(() => le.value ? 10 : 20), Ce = Et(), we = Et(), Ne = B(() => O.enableReceiveRequestBeta ? [
2491
+ const { breakpoints: Le } = Sn(), oe = A(() => Le.value.xs || Le.value.sm), se = A(() => oe.value ? 10 : 20), ke = qt(), _e = qt(), Ee = A(() => $.enableReceiveRequestBeta ? [
2517
2492
  {
2518
2493
  label: _("inventory.transfer.receiveRequest.actions.create"),
2519
2494
  value: "create",
2520
2495
  isPrimary: !0,
2521
2496
  prependIcon: "add"
2522
2497
  },
2523
- ...O.enableXilnexTransferNote ? [{ label: _("inventory.common.upload"), value: "upload" }] : [],
2498
+ ...$.enableXilnexTransferNote ? [{ label: _("inventory.common.upload"), value: "upload" }] : [],
2524
2499
  { label: _("inventory.common.refresh"), value: "refresh" },
2525
2500
  { label: _("inventory.common.export"), value: "export" },
2526
- ...O.enablePrintTemplate && !R.value ? [
2501
+ ...$.enablePrintTemplate && !R.value ? [
2527
2502
  {
2528
2503
  label: _("inventory.transfer.receiveRequest.bulk.downloadAll"),
2529
2504
  value: "downloadAll",
2530
2505
  prependIcon: "download"
2531
2506
  }
2532
2507
  ] : [],
2533
- ...O.enablePurchaseOrderEmail && !R.value ? [
2508
+ ...$.enablePurchaseOrderEmail && !R.value ? [
2534
2509
  {
2535
2510
  label: _("inventory.transfer.receiveRequest.bulk.emailAll"),
2536
2511
  value: "emailAll",
2537
2512
  prependIcon: "email"
2538
2513
  }
2539
2514
  ] : []
2540
- ] : []), Ze = B(() => {
2515
+ ] : []), Ze = A(() => {
2541
2516
  const N = [
2542
2517
  {
2543
2518
  type: "string",
@@ -2558,7 +2533,7 @@ const nr = {
2558
2533
  values: Array.from(
2559
2534
  new Set(
2560
2535
  s.purchaseOrders.value.map((z) => {
2561
- const ne = w.locations.find((ae) => ae.dbName === z._locationDbName);
2536
+ const ne = w.locations.find((me) => me.dbName === z._locationDbName);
2562
2537
  return (ne == null ? void 0 : ne.name) ?? z._locationDbName;
2563
2538
  })
2564
2539
  )
@@ -2570,8 +2545,8 @@ const nr = {
2570
2545
  key: "netsuiteTransactionNumber",
2571
2546
  entity: "purchaseOrder",
2572
2547
  values: s.purchaseOrders.value.map((z) => {
2573
- var ne, ae;
2574
- return (ae = (ne = z.netSuite) == null ? void 0 : ne.additionalInfo) == null ? void 0 : ae.transactionnumber;
2548
+ var ne, me;
2549
+ return (me = (ne = z.netSuite) == null ? void 0 : ne.additionalInfo) == null ? void 0 : me.transactionnumber;
2575
2550
  }).filter((z) => z != null)
2576
2551
  },
2577
2552
  {
@@ -2594,17 +2569,17 @@ const nr = {
2594
2569
  }
2595
2570
  ];
2596
2571
  return [...N, ...L.isEnabled ? k : []];
2597
- }), Oe = P(null), Ye = B(() => {
2598
- if (!Oe.value) return s.purchaseOrders.value;
2599
- const N = Jn.build(Oe.value);
2572
+ }), Ne = P(null), je = A(() => {
2573
+ if (!Ne.value) return s.purchaseOrders.value;
2574
+ const N = Mn.build(Ne.value);
2600
2575
  return s.purchaseOrders.value.filter((k) => {
2601
- var ne, ae, fe, Le, $e;
2602
- const z = ((ne = w.locations.find((U) => U.dbName === k._locationDbName)) == null ? void 0 : ne.name) ?? k._locationDbName;
2603
- return jn(
2576
+ var ne, me, Te, We, ze;
2577
+ const z = ((ne = w.locations.find((j) => j.dbName === k._locationDbName)) == null ? void 0 : ne.name) ?? k._locationDbName;
2578
+ return Un(
2604
2579
  {
2605
- netsuiteTransactionNumber: (fe = (ae = k.netSuite) == null ? void 0 : ae.additionalInfo) == null ? void 0 : fe.transactionnumber,
2606
- netsuiteOrderNo: (Le = k.netSuite) == null ? void 0 : Le.refNo,
2607
- netsuiteOrderId: ($e = k.netSuite) == null ? void 0 : $e.id,
2580
+ netsuiteTransactionNumber: (Te = (me = k.netSuite) == null ? void 0 : me.additionalInfo) == null ? void 0 : Te.transactionnumber,
2581
+ netsuiteOrderNo: (We = k.netSuite) == null ? void 0 : We.refNo,
2582
+ netsuiteOrderId: (ze = k.netSuite) == null ? void 0 : ze.id,
2608
2583
  status: k.status,
2609
2584
  transferFrom: k.supplier.name,
2610
2585
  location: z
@@ -2614,64 +2589,64 @@ const nr = {
2614
2589
  });
2615
2590
  });
2616
2591
  return (N, k) => {
2617
- const z = Te("FmIcon"), ne = Te("FmTextField"), ae = Te("FmButton"), fe = Te("FmTable"), Le = Te("FmCircularProgress");
2618
- return i(), ve(Dn, {
2592
+ const z = Oe("FmIcon"), ne = Oe("FmTextField"), me = Oe("FmButton"), Te = Oe("FmTable"), We = Oe("FmCircularProgress");
2593
+ return i(), pe(kn, {
2619
2594
  title: n(_)("inventory.transfer.receiveRequest.bulk.title"),
2620
- actions: Ne.value,
2621
- "onClick:action": Se
2595
+ actions: Ee.value,
2596
+ "onClick:action": Fe
2622
2597
  }, {
2623
- default: Ie(() => {
2624
- var $e;
2598
+ default: Ae(() => {
2599
+ var ze;
2625
2600
  return [
2626
- n(O).isLoaded && !n(O).enableReceiveRequestBeta ? (i(), y("div", Pr, [
2601
+ n($).isLoaded && !n($).enableReceiveRequestBeta ? (i(), y("div", Fr, [
2627
2602
  E(z, {
2628
2603
  name: "block",
2629
2604
  size: "xl"
2630
2605
  }),
2631
2606
  k[11] || (k[11] = e("p", { class: "fm-typo-en-body-md-400" }, "Not available", -1))
2632
- ])) : n(O).enableReceiveRequestBeta ? (i(), y(Re, { key: 1 }, [
2607
+ ])) : n($).enableReceiveRequestBeta ? (i(), y(Se, { key: 1 }, [
2633
2608
  e("div", {
2634
- class: H(["flex flex-col gap-8 max-h-full", { "p-0": le.value, "px-24": !le.value }])
2609
+ class: Q(["flex flex-col gap-8 max-h-full", { "p-0": oe.value, "px-24": !oe.value }])
2635
2610
  }, [
2636
2611
  e("div", {
2637
2612
  class: "flex flex-col gap-8",
2638
2613
  onVnodeMounted: k[4] || (k[4] = //@ts-ignore
2639
- (...U) => n(Ce).onMounted && n(Ce).onMounted(...U)),
2614
+ (...j) => n(ke).onMounted && n(ke).onMounted(...j)),
2640
2615
  onVnodeUnmounted: k[5] || (k[5] = //@ts-ignore
2641
- (...U) => n(Ce).onUnmounted && n(Ce).onUnmounted(...U))
2616
+ (...j) => n(ke).onUnmounted && n(ke).onUnmounted(...j))
2642
2617
  }, [
2643
2618
  e("div", {
2644
- class: H([
2619
+ class: Q([
2645
2620
  "flex gap-8 items-center",
2646
- { "px-8 flex-col-reverse h-[unset]": le.value, "h-48": !le.value }
2621
+ { "px-8 flex-col-reverse h-[unset]": oe.value, "h-48": !oe.value }
2647
2622
  ])
2648
2623
  }, [
2649
2624
  e("div", {
2650
- class: H(["flex gap-8 items-center", { "w-full overflow-x-auto": le.value }])
2625
+ class: Q(["flex gap-8 items-center", { "w-full overflow-x-auto": oe.value }])
2651
2626
  }, [
2652
- E(Ys, {
2653
- modelValue: n(J),
2654
- "onUpdate:modelValue": k[0] || (k[0] = (U) => Rt(J) ? J.value = U : null),
2627
+ E(Js, {
2628
+ modelValue: n(V),
2629
+ "onUpdate:modelValue": k[0] || (k[0] = (j) => Rt(V) ? V.value = j : null),
2655
2630
  locations: T.value
2656
2631
  }, null, 8, ["modelValue", "locations"]),
2657
- E(vn, {
2658
- "model-value": de.value,
2659
- "onUpdate:modelValue": k[1] || (k[1] = (U) => de.value = U)
2632
+ E(pn, {
2633
+ "model-value": ce.value,
2634
+ "onUpdate:modelValue": k[1] || (k[1] = (j) => ce.value = j)
2660
2635
  }, null, 8, ["model-value"])
2661
2636
  ], 2),
2662
- e("div", Dr, [
2663
- e("div", qr, [
2664
- E(n(Wn), {
2665
- modelValue: Oe.value,
2666
- "onUpdate:modelValue": k[2] || (k[2] = (U) => Oe.value = U),
2637
+ e("div", Sr, [
2638
+ e("div", Rr, [
2639
+ E(n(Vn), {
2640
+ modelValue: Ne.value,
2641
+ "onUpdate:modelValue": k[2] || (k[2] = (j) => Ne.value = j),
2667
2642
  attributes: Ze.value
2668
2643
  }, null, 8, ["modelValue", "attributes"])
2669
2644
  ]),
2670
- le.value ? q("", !0) : (i(), y("div", Er)),
2671
- e("div", Nr, [
2645
+ oe.value ? q("", !0) : (i(), y("div", Pr)),
2646
+ e("div", Dr, [
2672
2647
  E(ne, {
2673
- "model-value": me.value,
2674
- "onUpdate:modelValue": k[3] || (k[3] = (U) => me.value = U),
2648
+ "model-value": de.value,
2649
+ "onUpdate:modelValue": k[3] || (k[3] = (j) => de.value = j),
2675
2650
  "prepend-icon": "search",
2676
2651
  placeholder: n(_)("inventory.common.table.toolbar.filterItems"),
2677
2652
  class: "w-full"
@@ -2680,21 +2655,21 @@ const nr = {
2680
2655
  ])
2681
2656
  ], 2)
2682
2657
  ], 512),
2683
- n(J).length === 0 && !R.value ? (i(), y("div", Or, [
2658
+ n(V).length === 0 && !R.value ? (i(), y("div", qr, [
2684
2659
  E(z, {
2685
2660
  name: "storefront",
2686
2661
  size: "xl"
2687
2662
  }),
2688
- e("p", $r, p(n(_)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
2689
- ])) : (i(), y("div", Ar, [
2663
+ e("p", Er, p(n(_)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
2664
+ ])) : (i(), y("div", Nr, [
2690
2665
  e("div", {
2691
2666
  onVnodeMounted: k[6] || (k[6] = //@ts-ignore
2692
- (...U) => n(we).onMounted && n(we).onMounted(...U)),
2667
+ (...j) => n(_e).onMounted && n(_e).onMounted(...j)),
2693
2668
  onVnodeUnmounted: k[7] || (k[7] = //@ts-ignore
2694
- (...U) => n(we).onUnmounted && n(we).onUnmounted(...U))
2669
+ (...j) => n(_e).onUnmounted && n(_e).onUnmounted(...j))
2695
2670
  }, [
2696
- (R.value || n(s).retryingFailed.value) && n(s).fetchProgress.value ? (i(), y("div", Br, [
2697
- e("div", Tr, [
2671
+ (R.value || n(s).retryingFailed.value) && n(s).fetchProgress.value ? (i(), y("div", $r, [
2672
+ e("div", Br, [
2698
2673
  e("div", {
2699
2674
  class: "h-full rounded-full bg-fm-color-primary transition-all duration-300",
2700
2675
  style: gt({
@@ -2702,11 +2677,11 @@ const nr = {
2702
2677
  })
2703
2678
  }, null, 4)
2704
2679
  ]),
2705
- e("span", Ir, p(n(s).fetchProgress.value.done) + "/" + p(n(s).fetchProgress.value.total) + " locations ", 1)
2680
+ e("span", Or, p(n(s).fetchProgress.value.done) + "/" + p(n(s).fetchProgress.value.total) + " locations ", 1)
2706
2681
  ])) : q("", !0),
2707
- n(s).failedLocations.value.length > 0 ? (i(), y("div", Lr, [
2708
- e("span", zr, " Failed to load: " + p(j.value), 1),
2709
- I.value ? (i(), ve(ae, {
2682
+ n(s).failedLocations.value.length > 0 ? (i(), y("div", Ar, [
2683
+ e("span", Tr, " Failed to load: " + p(J.value), 1),
2684
+ I.value ? (i(), pe(me, {
2710
2685
  key: 0,
2711
2686
  variant: "secondary",
2712
2687
  disabled: n(s).retryingFailed.value || R.value,
@@ -2715,53 +2690,53 @@ const nr = {
2715
2690
  }, null, 8, ["disabled", "label", "onClick"])) : q("", !0)
2716
2691
  ])) : q("", !0)
2717
2692
  ], 512),
2718
- E(fe, {
2719
- style: gt(n(Ce).tableHeight),
2693
+ E(Te, {
2694
+ style: gt(n(ke).tableHeight),
2720
2695
  "column-defs": n(m),
2721
- "row-data": Ye.value,
2722
- "search-value": me.value,
2696
+ "row-data": je.value,
2697
+ "search-value": de.value,
2723
2698
  loading: R.value,
2724
- onRowClick: k[8] || (k[8] = (U) => n(s).promptShowTransferDetails(U.original)),
2725
- "page-size": re.value
2699
+ onRowClick: k[8] || (k[8] = (j) => n(s).promptShowTransferDetails(j.original)),
2700
+ "page-size": se.value
2726
2701
  }, {
2727
- "list-row": Ie((U) => [
2728
- E(Vn, {
2729
- row: U,
2702
+ "list-row": Ae((j) => [
2703
+ E(zn, {
2704
+ row: j,
2730
2705
  onRowClick: n(s).promptShowTransferDetails
2731
2706
  }, {
2732
- default: Ie((ye) => {
2733
- var Ue, r, u, b, A, M, F, Q, Z, ee, oe, te, pe, be, Pe, Ae, ge, Y, G, ke, De, qe, D, ie, he;
2707
+ default: Ae((xe) => {
2708
+ var Ge, r, u, g, O, M, F, H, Z, ee, re, te, fe, ve, Re, $e, be, Y, K, we, Pe, De, D, le, ye;
2734
2709
  return [
2735
- e("div", Mr, [
2736
- e("div", Ur, [
2710
+ e("div", Ir, [
2711
+ e("div", Lr, [
2737
2712
  E(n(ot), {
2738
- render: (u = (r = (Ue = ye._id) == null ? void 0 : Ue.column) == null ? void 0 : r.columnDef) == null ? void 0 : u.cell,
2739
- props: (A = (b = ye._id) == null ? void 0 : b.getContext) == null ? void 0 : A.call(b)
2713
+ render: (u = (r = (Ge = xe._id) == null ? void 0 : Ge.column) == null ? void 0 : r.columnDef) == null ? void 0 : u.cell,
2714
+ props: (O = (g = xe._id) == null ? void 0 : g.getContext) == null ? void 0 : O.call(g)
2740
2715
  }, null, 8, ["render", "props"])
2741
2716
  ]),
2742
- e("div", Vr, [
2717
+ e("div", zr, [
2743
2718
  E(n(ot), {
2744
- render: (Q = (F = (M = ye.location) == null ? void 0 : M.column) == null ? void 0 : F.columnDef) == null ? void 0 : Q.cell,
2745
- props: (ee = (Z = ye.location) == null ? void 0 : Z.getContext) == null ? void 0 : ee.call(Z)
2719
+ render: (H = (F = (M = xe.location) == null ? void 0 : M.column) == null ? void 0 : F.columnDef) == null ? void 0 : H.cell,
2720
+ props: (ee = (Z = xe.location) == null ? void 0 : Z.getContext) == null ? void 0 : ee.call(Z)
2746
2721
  }, null, 8, ["render", "props"])
2747
2722
  ]),
2748
- e("div", Jr, [
2723
+ e("div", Mr, [
2749
2724
  E(n(ot), {
2750
- render: (pe = (te = (oe = ye.supplier_name) == null ? void 0 : oe.column) == null ? void 0 : te.columnDef) == null ? void 0 : pe.cell,
2751
- props: (Pe = (be = ye.supplier_name) == null ? void 0 : be.getContext) == null ? void 0 : Pe.call(be)
2725
+ render: (fe = (te = (re = xe.supplier_name) == null ? void 0 : re.column) == null ? void 0 : te.columnDef) == null ? void 0 : fe.cell,
2726
+ props: (Re = (ve = xe.supplier_name) == null ? void 0 : ve.getContext) == null ? void 0 : Re.call(ve)
2752
2727
  }, null, 8, ["render", "props"])
2753
2728
  ]),
2754
- e("div", jr, p(n(_)("inventory.transfer.table.noOfItems")) + ": " + p(se(U.original)), 1),
2755
- U.original.ref ? (i(), y("div", Wr, [
2729
+ e("div", Ur, p(n(_)("inventory.transfer.table.noOfItems")) + ": " + p(ae(j.original)), 1),
2730
+ j.original.ref ? (i(), y("div", Vr, [
2756
2731
  E(n(ot), {
2757
- render: (Y = (ge = (Ae = ye.ref) == null ? void 0 : Ae.column) == null ? void 0 : ge.columnDef) == null ? void 0 : Y.cell,
2758
- props: (ke = (G = ye.ref) == null ? void 0 : G.getContext) == null ? void 0 : ke.call(G)
2732
+ render: (Y = (be = ($e = xe.ref) == null ? void 0 : $e.column) == null ? void 0 : be.columnDef) == null ? void 0 : Y.cell,
2733
+ props: (we = (K = xe.ref) == null ? void 0 : K.getContext) == null ? void 0 : we.call(K)
2759
2734
  }, null, 8, ["render", "props"])
2760
2735
  ])) : q("", !0),
2761
- e("div", Yr, [
2736
+ e("div", Jr, [
2762
2737
  E(n(ot), {
2763
- render: (D = (qe = (De = ye.status) == null ? void 0 : De.column) == null ? void 0 : qe.columnDef) == null ? void 0 : D.cell,
2764
- props: (he = (ie = ye.status) == null ? void 0 : ie.getContext) == null ? void 0 : he.call(ie)
2738
+ render: (D = (De = (Pe = xe.status) == null ? void 0 : Pe.column) == null ? void 0 : De.columnDef) == null ? void 0 : D.cell,
2739
+ props: (ye = (le = xe.status) == null ? void 0 : le.getContext) == null ? void 0 : ye.call(le)
2765
2740
  }, null, 8, ["render", "props"])
2766
2741
  ])
2767
2742
  ])
@@ -2772,11 +2747,11 @@ const nr = {
2772
2747
  ]),
2773
2748
  _: 1
2774
2749
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]),
2775
- n(s).rowAction.pending.value ? (i(), y("div", Qr, [
2776
- e("div", Hr, [
2777
- E(Le, { size: "md" }),
2778
- e("span", Kr, p(n(_)("inventory.common.loading")), 1),
2779
- E(ae, {
2750
+ n(s).rowAction.pending.value ? (i(), y("div", jr, [
2751
+ e("div", Wr, [
2752
+ E(We, { size: "md" }),
2753
+ e("span", Yr, p(n(_)("inventory.common.loading")), 1),
2754
+ E(me, {
2780
2755
  variant: "secondary",
2781
2756
  label: n(_)("inventory.common.cancel"),
2782
2757
  onClick: n(s).rowAction.cancel
@@ -2785,31 +2760,31 @@ const nr = {
2785
2760
  ])) : q("", !0)
2786
2761
  ]))
2787
2762
  ], 2),
2788
- (i(), ve(dt, { to: "body" }, [
2789
- E(Rr),
2790
- n(O).enablePurchaseOrderEmail ? (i(), ve(An, Pt(yt({ key: 0 }, n(s).emailDialogProps.value)), null, 16)) : q("", !0),
2791
- E(Is, {
2792
- show: g.value,
2793
- "onUpdate:show": k[9] || (k[9] = (U) => g.value = U),
2763
+ (i(), pe(dt, { to: "body" }, [
2764
+ E(Cr),
2765
+ n($).enablePurchaseOrderEmail ? (i(), pe(bn, Pt(yt({ key: 0 }, n(s).emailDialogProps.value)), null, 16)) : q("", !0),
2766
+ E(Os, {
2767
+ show: h.value,
2768
+ "onUpdate:show": k[9] || (k[9] = (j) => h.value = j),
2794
2769
  "last-closing-date": n(s).lastClosingDate.value,
2795
- "selected-outlet-ids": Fe.value,
2770
+ "selected-outlet-ids": Ce.value,
2796
2771
  onSubmitted: n(s).fetchData
2797
2772
  }, null, 8, ["show", "last-closing-date", "selected-outlet-ids", "onSubmitted"]),
2798
- E(Bn, yt(n(s).transferDialogProps.value, {
2773
+ E(hn, yt(n(s).transferDialogProps.value, {
2799
2774
  onSubmitted: n(s).fetchData
2800
2775
  }), null, 16, ["onSubmitted"]),
2801
- n(s).transferDetailsProps.value != null ? (i(), ve(Cn, yt({ key: 1 }, {
2776
+ n(s).transferDetailsProps.value != null ? (i(), pe(Ln, yt({ key: 1 }, {
2802
2777
  ...n(s).transferDetailsProps.value,
2803
- receivedMap: (($e = n(s).transferDetailsProps.value) == null ? void 0 : $e.receivedMap) ?? {},
2778
+ receivedMap: ((ze = n(s).transferDetailsProps.value) == null ? void 0 : ze.receivedMap) ?? {},
2804
2779
  shipments: n(s).shipments.value ?? []
2805
2780
  }, {
2806
2781
  onSubmitted: n(s).fetchData
2807
2782
  }), null, 16, ["onSubmitted"])) : q("", !0),
2808
- E(Tn, Pt(sn(n(s).xilnexImportDialogProps.value)), null, 16),
2809
- E(Ws, {
2783
+ E(gn, Pt(an(n(s).xilnexImportDialogProps.value)), null, 16),
2784
+ E(Vs, {
2810
2785
  modelValue: n(d),
2811
- "onUpdate:modelValue": k[10] || (k[10] = (U) => Rt(d) ? d.value = U : null),
2812
- loading: n(h),
2786
+ "onUpdate:modelValue": k[10] || (k[10] = (j) => Rt(d) ? d.value = j : null),
2787
+ loading: n(b),
2813
2788
  "blob-url": n(c)
2814
2789
  }, null, 8, ["modelValue", "loading", "blob-url"])
2815
2790
  ]))
@@ -2820,20 +2795,20 @@ const nr = {
2820
2795
  }, 8, ["title", "actions"]);
2821
2796
  };
2822
2797
  }
2823
- }), No = /* @__PURE__ */ at({
2798
+ }), Ro = /* @__PURE__ */ at({
2824
2799
  __name: "BulkReceiveRequestPage",
2825
2800
  setup(C) {
2826
- return (_, x) => (i(), ve(rn, {
2801
+ return (_, x) => (i(), pe(sn, {
2827
2802
  "feature-key": "bulk-receive-transfer",
2828
2803
  "keep-across-locations": ""
2829
2804
  }, {
2830
- default: Ie(() => [
2831
- E(Gr)
2805
+ default: Ae(() => [
2806
+ E(Hr)
2832
2807
  ]),
2833
2808
  _: 1
2834
2809
  }));
2835
2810
  }
2836
2811
  });
2837
2812
  export {
2838
- No as default
2813
+ Ro as default
2839
2814
  };