@feedmepos/mf-inventory-portal 1.7.7-dev.2 → 1.7.7-dev.4

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 (91) hide show
  1. package/dist/{App-DQB7ZGVn.js → App-e4ZmCNvN.js} +6 -6
  2. package/dist/{ApprovalView-Bq4wMFYQ.js → ApprovalView-C3wOLlHv.js} +9 -9
  3. package/dist/{BindingsDialog-m_HOQFVp.js → BindingsDialog-JlcH1aTw.js} +2 -2
  4. package/dist/{BindingsPicker-DzAb-9I4.js → BindingsPicker-DkrqlfPN.js} +2 -2
  5. package/dist/{BindingsTable-CwNAyCpw.js → BindingsTable-jpp6SPws.js} +3 -3
  6. package/dist/{BulkReceiveRequestView-B9ZM5v0_.js → BulkReceiveRequestView-BirdnUIo.js} +913 -896
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Dkw2R5DA.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DNR7YGEF.js} +1 -1
  8. package/dist/{ClosingDraftView-BqdMzG2j.js → ClosingDraftView-DIQch6xD.js} +19 -19
  9. package/dist/{ClosingHistoryView-CXLz3826.js → ClosingHistoryView-CZJoa31l.js} +5 -5
  10. package/dist/{ClosingTemplateView-CHSpzYWc.js → ClosingTemplateView-ZkzqXyT8.js} +16 -16
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BFSc8bVy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CxtMXhQB.js} +1 -1
  12. package/dist/{DefaultView-BDthfFGe.js → DefaultView-DWTZ6C3R.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-CXCGIl2y.js → DeliveryOrderPrintPreview-DzaNa2kK.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BQG6sXH7.js → EmailDialog.vue_vue_type_script_setup_true_lang-DUTCUt3m.js} +4268 -4261
  15. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BR9QB9bS.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Ct1GCzAa.js} +1 -1
  16. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-w4qpQDKg.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Lh-Vr5z8.js} +2 -2
  17. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BPYdl0vd.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CtQGcvea.js} +2 -2
  18. package/dist/{FmMultiselectDialog-RH-hMXCs.js → FmMultiselectDialog-DbnFLr4o.js} +1 -1
  19. package/dist/{FmMultiselectDialog-ObtKhnp9.js → FmMultiselectDialog-DcoxFEB2.js} +2 -2
  20. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang--SE8T91u.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DKcmu7bM.js} +5 -5
  21. package/dist/{ImportView-ZBOv0qQg.js → ImportView-DMPur1x5.js} +6 -6
  22. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BXP3U6x9.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-Iq3mSUfb.js} +1 -1
  23. package/dist/{IngredientGroupView-BlN0aXs9.js → IngredientGroupView-BvVTo1Ke.js} +5 -5
  24. package/dist/{IngredientsView-1ETawPz9.js → IngredientsView-CU69Hilq.js} +15 -15
  25. package/dist/{IntegrationExplorerView-WQTSX5Kb.js → IntegrationExplorerView-DB9Jbj1t.js} +4 -4
  26. package/dist/{IntegrationView-DGBju-oe.js → IntegrationView-B_qDF6wh.js} +2529 -2443
  27. package/dist/{InventoryBindingForm-BC3c0b1Z.js → InventoryBindingForm-BKVf7QV7.js} +1 -1
  28. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D88qKjuw.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DUjlsaXv.js} +5 -5
  29. package/dist/{InventoryBindingSummary-ocaiQ262.js → InventoryBindingSummary-DMdzvxMo.js} +1 -1
  30. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DeAWVtO3.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DUiwhqTz.js} +1 -1
  31. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DXr4mR0h.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DC1TZ8zc.js} +1 -1
  32. package/dist/{ProductionView-qeQpJ6iH.js → ProductionView-AUaZW4HQ.js} +7 -7
  33. package/dist/{PublishView-DlzjETLe.js → PublishView-vslQlSGy.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-CZDQBnTE.js → PurchaseOrderPrintPreview-BxzRJu3z.js} +2 -2
  35. package/dist/{ReceiveRequestView-CPsvV8pK.js → ReceiveRequestView-B9vQ0two.js} +14 -14
  36. package/dist/{RecipeView-CRWDP2Fx.js → RecipeView-0DnB9vpf.js} +17 -17
  37. package/dist/{SettingsView-BVt07uZX.js → SettingsView-BZ2li6OG.js} +4 -4
  38. package/dist/{StockView-XHNINaPR.js → StockView-0PLcziHH.js} +21 -21
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-RlnZsDo4.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-xR_iYH46.js} +1 -1
  40. package/dist/{SupplierView-DS49kqWA.js → SupplierView-MQpBEso3.js} +12 -12
  41. package/dist/{SurchargeView-TztJVCYu.js → SurchargeView-CRmL4yf7.js} +6 -6
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D82qO_HK.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-OAfKYJHc.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DVTn8bO7.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DLmu0Z09.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CiPPb_C_.js → TransferDetails.vue_vue_type_script_setup_true_lang-DI7ugC2e.js} +20 -20
  45. package/dist/{TransferTemplateView-B76xhBA_.js → TransferTemplateView-CUIMBNiD.js} +20 -20
  46. package/dist/{UnitCostHistoryView-fW3-K8GS.js → UnitCostHistoryView-Dzmio_VF.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZill-Ny.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-rxm53Kpe.js} +4 -4
  48. package/dist/{UnitView-BSg_HOvl.js → UnitView-BF8oW55F.js} +7 -7
  49. package/dist/{WarehouseView-B7NZMg6b.js → WarehouseView-DMa16xHP.js} +5 -5
  50. package/dist/{WastageTemplateView-C4MjJb7v.js → WastageTemplateView-Bf7cHP8P.js} +14 -14
  51. package/dist/api/codemax.d.ts +3 -1
  52. package/dist/{app-DZE5rfQr.js → app-6IztYHx0.js} +27 -23
  53. package/dist/app.d.ts +4 -0
  54. package/dist/app.js +1 -1
  55. package/dist/{closing-template-Bs04O3VA.js → closing-template-MIqLe_gz.js} +1 -1
  56. package/dist/{date2-Ckv7-dVt.js → date2-DbL4HabJ.js} +1 -1
  57. package/dist/{dayjs.min-DK1guu5b.js → dayjs.min-ePcZnrnS.js} +1 -1
  58. package/dist/{decimal-CnRXaJqd.js → decimal-D-LnqjKq.js} +2 -2
  59. package/dist/{defineDeepModel-D31zGgon.js → defineDeepModel-Bty3whQM.js} +1 -1
  60. package/dist/{duplicate-template-7r0h9vPk.js → duplicate-template-H_NPyDBN.js} +1 -1
  61. package/dist/{feature-KvOvcAlX.js → feature-CPc36p5Q.js} +2 -2
  62. package/dist/{format-time-from-id-6I4tO6By.js → format-time-from-id-BkSJPBPj.js} +1 -1
  63. package/dist/{format-unit-display-w09ubJOp.js → format-unit-display-BOclhjP_.js} +12 -12
  64. package/dist/{import-export.helper-DpWiemZl.js → import-export.helper-DamKVb5B.js} +6 -6
  65. package/dist/{index-CAwhCSKd.js → index-BJdt1ytp.js} +1 -1
  66. package/dist/{index-DmHzp_7o.js → index-DYv_DAVd.js} +16 -12
  67. package/dist/{index-O9WySMBY.js → index-Ya7If-Ie.js} +1 -1
  68. package/dist/{inventory-core-dart.default-DRMELJ4n.js → inventory-core-dart.default-iDYPRIr1.js} +1 -1
  69. package/dist/{lz-string-BoWvdPjB.js → lz-string--yaiymH2.js} +1 -1
  70. package/dist/{netsuite-zVNnRPSi.js → netsuite-DMU7KBLH.js} +2 -2
  71. package/dist/{number-BcZGsTAF.js → number-CnoNE3dq.js} +3 -3
  72. package/dist/{predefined-templates-nqNAb-ht.js → predefined-templates-j-OmxHRV.js} +1 -1
  73. package/dist/{purchase-order-template-B8eq6SZf.js → purchase-order-template-qrm11ZSb.js} +1 -1
  74. package/dist/{recalculationUtils-C5QEOt51.js → recalculationUtils-DdROokZS.js} +1 -1
  75. package/dist/{rules-BcL0Z-KC.js → rules-C9KpfT_c.js} +2 -2
  76. package/dist/{stock-Br1XXnri.js → stock-DFl6hM8p.js} +1 -1
  77. package/dist/{stock-Dfq40TuU.js → stock-k1HJnDb5.js} +3 -3
  78. package/dist/{supplier-BKDh4Ye6.js → supplier-1RVDAJgt.js} +2 -2
  79. package/dist/{surcharge-Dl8UH4t8.js → surcharge-BGpOQVQk.js} +1 -1
  80. package/dist/tsconfig.app.tsbuildinfo +1 -1
  81. package/dist/{uom-rules-D9pUHL6C.js → uom-rules-u_8oQL8X.js} +1 -1
  82. package/dist/{use-ingredient-select-dialog-DN4UYDhQ.js → use-ingredient-select-dialog-CWD-rBKb.js} +2 -2
  83. package/dist/{use-inventory-binding-dialog-D5XJfpZr.js → use-inventory-binding-dialog-MAXDJLSD.js} +2 -2
  84. package/dist/{use-template-enabled-locations-B3uFMvkF.js → use-template-enabled-locations-BKKnG3h9.js} +2 -2
  85. package/dist/{use-transfer-locations-CP_DDQ-q.js → use-transfer-locations-Do66oqYE.js} +2 -2
  86. package/dist/{useHrmPermission-Dy5_1mLL.js → useHrmPermission-Kwlb-xbn.js} +1 -1
  87. package/dist/{useNavigationMenu-DviXtVHv.js → useNavigationMenu-Or_fkxv1.js} +2 -2
  88. package/dist/{useSseClient-Dy6N-CSS.js → useSseClient-ClQjN-eX.js} +1 -1
  89. package/dist/{vue-i18n-CrhEyADO.js → vue-i18n-B8mT1TfS.js} +510 -510
  90. package/dist/{xlsx.util-DfP6GI9J.js → xlsx.util-D6RuisON.js} +2 -2
  91. package/package.json +2 -2
@@ -1,85 +1,86 @@
1
- import { defineComponent as tt, ref as k, computed as L, watch as Ve, createElementBlock as y, openBlock as m, Fragment as ye, createBlock as le, createVNode as E, Teleport as lt, Transition as Dt, withCtx as Pe, createCommentVNode as D, createElementVNode as e, toDisplayString as p, unref as t, normalizeClass as J, renderList as Qe, createTextVNode as ot, withModifiers as Et, mergeModels as qt, useModel as Nt, resolveComponent as Ce, h as xe, onMounted as At, onUnmounted as $t, normalizeStyle as mt, watchEffect as Ot, isRef as bt, normalizeProps as ht, mergeProps as ct, guardReactiveProps as Bt } from "vue";
2
- import { u as Tt, l as It } from "./netsuite-zVNnRPSi.js";
3
- import { u as it, a as Lt, G as zt, T as gt, s as Mt, U as Ye, q as Ut, c as Vt, D as st, x as Jt } from "./app-DZE5rfQr.js";
4
- import { i as ft, _ as jt } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BR9QB9bS.js";
5
- import { a as xt, d as Wt } from "./number-BcZGsTAF.js";
6
- import { b as Yt, d as Ht, c as Qt, e as Kt, f as Gt, P as kt, h as Xt, a as Zt, _ as en, g as tn } from "./TransferDetails.vue_vue_type_script_setup_true_lang-CiPPb_C_.js";
7
- import { i as nn } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DXr4mR0h.js";
8
- import { d as He } from "./dayjs.min-DK1guu5b.js";
9
- import { e as on } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZill-Ny.js";
10
- import { u as sn } from "./useTabStorage-BkIVScW_.js";
11
- import { u as an, _ as rn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
12
- import { components as ln, useSnackbar as ut, useDialog as un, useBreakpoints as cn } from "@feedmepos/ui-library";
13
- import { c as dn, u as mn, _ as fn, a as pn, b as vn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-BQG6sXH7.js";
14
- import { useI18n as nt, useCoreStore as Ct } from "@feedmepos/mf-common";
15
- import { u as Ft, a as yn } from "./supplier-BKDh4Ye6.js";
16
- import { u as bn } from "./stock-Br1XXnri.js";
17
- import { u as Ke } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-D82qO_HK.js";
18
- import { b as St, a as hn } from "./format-unit-display-w09ubJOp.js";
19
- import { P as gn } from "./inventory-core-dart.default-DRMELJ4n.js";
20
- import { _ as xn, F as Ze } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
21
- import { u as Rt } from "./feature-KvOvcAlX.js";
22
- import { P as _n, J as wn, D as kn } from "./app-C39bYJmq.js";
23
- import { a as Cn, t as Fn } from "./date2-Ckv7-dVt.js";
24
- import { F as _t } from "./form-mode.enum-BKiNVH6A.js";
25
- import { p as Sn } from "./format-time-from-id-6I4tO6By.js";
26
- import { defineStore as Rn } from "pinia";
27
- import { u as Pn } from "./use-row-action-Cvq6VO38.js";
28
- import { R as at, D as Dn } from "./row-action.enum-ncgDYAjP.js";
29
- import { u as En } from "./vue-i18n-CrhEyADO.js";
30
- const qn = {
1
+ import { defineComponent as nt, ref as C, computed as L, watch as Ve, createElementBlock as y, openBlock as m, Fragment as he, createBlock as ue, createVNode as E, Teleport as lt, Transition as qt, withCtx as Pe, createCommentVNode as D, createElementVNode as e, toDisplayString as v, unref as t, normalizeClass as J, renderList as Ke, createTextVNode as st, withModifiers as Nt, mergeModels as $t, useModel as At, resolveComponent as Ce, h as _e, onMounted as Ot, onUnmounted as Bt, normalizeStyle as mt, watchEffect as Tt, isRef as bt, normalizeProps as ht, mergeProps as ct, guardReactiveProps as It } from "vue";
2
+ import { u as Lt, l as zt } from "./netsuite-DMU7KBLH.js";
3
+ import { u as it, a as Mt, G as Ut, T as gt, s as Vt, U as Ye, q as Jt, c as jt, D as at, x as Wt } from "./app-6IztYHx0.js";
4
+ import { i as ft, _ as Yt } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Ct1GCzAa.js";
5
+ import { a as _t, d as Ht } from "./number-CnoNE3dq.js";
6
+ import { b as Qt, d as Kt, c as Gt, e as Xt, f as Zt, P as Ft, h as en, a as tn, _ as nn, g as on } from "./TransferDetails.vue_vue_type_script_setup_true_lang-DI7ugC2e.js";
7
+ import { i as sn } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DC1TZ8zc.js";
8
+ import { d as He } from "./dayjs.min-ePcZnrnS.js";
9
+ import { e as an } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-rxm53Kpe.js";
10
+ import { u as rn } from "./useTabStorage-BkIVScW_.js";
11
+ import { u as ln, _ as un } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
12
+ import { components as cn, useSnackbar as ut, useDialog as dn, useBreakpoints as mn } from "@feedmepos/ui-library";
13
+ import { c as fn, u as pn, _ as vn, a as yn, b as bn } from "./EmailDialog.vue_vue_type_script_setup_true_lang-DUTCUt3m.js";
14
+ import { useI18n as ot, useCoreStore as St } from "@feedmepos/mf-common";
15
+ import { u as Rt, a as hn } from "./supplier-1RVDAJgt.js";
16
+ import { u as gn } from "./stock-DFl6hM8p.js";
17
+ import { u as Ge } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-OAfKYJHc.js";
18
+ import { b as Pt, a as _n } from "./format-unit-display-BOclhjP_.js";
19
+ import { P as xn } from "./inventory-core-dart.default-iDYPRIr1.js";
20
+ import { _ as wn, F as et } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
21
+ import { u as Dt } from "./feature-CPc36p5Q.js";
22
+ import { P as kn, J as Cn, D as Fn } from "./app-C39bYJmq.js";
23
+ import { a as Sn, t as Rn } from "./date2-DbL4HabJ.js";
24
+ import { F as xt } from "./form-mode.enum-BKiNVH6A.js";
25
+ import { p as Pn } from "./format-time-from-id-BkSJPBPj.js";
26
+ import { defineStore as Dn } from "pinia";
27
+ import { u as En } from "./useSseClient-ClQjN-eX.js";
28
+ import { u as qn } from "./use-row-action-Cvq6VO38.js";
29
+ import { R as rt, D as Nn } from "./row-action.enum-ncgDYAjP.js";
30
+ import { u as $n } from "./vue-i18n-B8mT1TfS.js";
31
+ const An = {
31
32
  key: 0,
32
33
  class: "fixed inset-0 z-[200] bg-white flex flex-col overflow-hidden",
33
34
  style: { "font-family": "Inter, sans-serif" }
34
- }, Nn = {
35
+ }, On = {
35
36
  key: 0,
36
37
  class: "flex items-center justify-between px-24 h-[64px] border-b border-[#F0F0F0] shrink-0 bg-white"
37
- }, An = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, $n = { class: "flex items-center gap-8" }, On = {
38
+ }, Bn = { class: "fm-typo-en-title-md-800 text-[#1C1C1E]" }, Tn = { class: "flex items-center gap-8" }, In = {
38
39
  key: 1,
39
40
  class: "flex items-center justify-center px-32 py-16 border-b border-[#F0F0F0] shrink-0 bg-white"
40
- }, Bn = { class: "flex items-center max-w-[600px] w-full" }, Tn = ["disabled"], In = { key: 1 }, Ln = ["disabled"], zn = { key: 1 }, Mn = {
41
+ }, Ln = { class: "flex items-center max-w-[600px] w-full" }, zn = ["disabled"], Mn = { key: 1 }, Un = ["disabled"], Vn = { key: 1 }, Jn = {
41
42
  class: "flex flex-col items-center gap-4 min-w-0",
42
43
  disabled: !0
43
- }, Un = { class: "flex flex-1 overflow-hidden" }, Vn = { class: "flex-1 min-w-0 overflow-y-auto" }, Jn = {
44
+ }, jn = { class: "flex flex-1 overflow-hidden" }, Wn = { class: "flex-1 min-w-0 overflow-y-auto" }, Yn = {
44
45
  key: 0,
45
46
  class: "px-32 py-24"
46
- }, jn = { class: "flex flex-col gap-4 mb-10" }, Wn = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Yn = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Hn = { class: "mb-12" }, Qn = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, Kn = ["onClick"], Gn = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Xn = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, Zn = { class: "flex-1 min-w-0" }, eo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, to = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, no = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, oo = {
47
+ }, Hn = { class: "flex flex-col gap-4 mb-10" }, Qn = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Kn = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, Gn = { class: "mb-12" }, Xn = { class: "border border-[#E0E0E0] rounded-sm overflow-hidden bg-white" }, Zn = ["onClick"], eo = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, to = { class: "fm-typo-en-body-xs text-[#6B6C70]" }, no = { class: "flex-1 min-w-0" }, oo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, so = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, ao = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, ro = {
47
48
  key: 0,
48
49
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
49
- }, so = {
50
+ }, lo = {
50
51
  key: 0,
51
52
  class: "py-40 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
52
- }, ao = {
53
+ }, io = {
53
54
  key: 1,
54
55
  class: "px-32 py-24"
55
- }, ro = { class: "flex flex-col gap-4 mb-12" }, lo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, io = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, uo = { class: "grid grid-cols-2 gap-12 mb-12" }, co = { class: "flex items-start justify-between mb-12" }, mo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, fo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, po = { class: "flex items-start justify-between mb-12" }, vo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, yo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, bo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, ho = { class: "mb-12" }, go = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, xo = ["onClick"], _o = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, wo = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, ko = { class: "flex-1 min-w-0" }, Co = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Fo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, So = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Ro = {
56
+ }, uo = { class: "flex flex-col gap-4 mb-12" }, co = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, mo = { class: "fm-typo-en-body-md-400 text-[#4B4B4B]" }, fo = { class: "grid grid-cols-2 gap-12 mb-12" }, po = { class: "flex items-start justify-between mb-12" }, vo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, yo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, bo = { class: "flex items-start justify-between mb-12" }, ho = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-4" }, go = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, _o = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, xo = { class: "mb-12" }, wo = { class: "border border-[#E0E0E0] rounded-xl overflow-hidden bg-white" }, ko = ["onClick"], Co = { class: "w-32 h-32 rounded-full bg-[#F0F0F0] flex items-center justify-center shrink-0" }, Fo = { class: "fm-typo-en-body-xs-600 text-[#6B6C70]" }, So = { class: "flex-1 min-w-0" }, Ro = { class: "fm-typo-en-body-md-600 text-[#1C1C1E]" }, Po = { class: "fm-typo-en-body-sm-400 text-[#6B6C70] truncate" }, Do = { class: "text-[10px] leading-[12px] font-semibold text-[#6B6C70] bg-[#F6F7F8] px-4 py-1 rounded-[4px] uppercase tracking-[0.08em] shrink-0" }, Eo = {
56
57
  key: 0,
57
58
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
58
- }, Po = {
59
+ }, qo = {
59
60
  key: 0,
60
61
  class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
61
- }, Do = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, Eo = { class: "mb-12" }, qo = {
62
+ }, No = { class: "fm-typo-en-body-md-700 text-[#1C1C1E] mb-12" }, $o = { class: "mb-12" }, Ao = {
62
63
  key: 0,
63
64
  class: "py-32 flex justify-center"
64
- }, No = {
65
+ }, Oo = {
65
66
  key: 1,
66
67
  class: "py-32 text-center text-[#B2B3B6] fm-typo-en-body-md-400"
67
- }, Ao = {
68
+ }, Bo = {
68
69
  key: 2,
69
70
  class: "flex flex-col gap-8"
70
- }, $o = ["onClick"], Oo = { class: "flex-1 min-w-0" }, Bo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, To = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Io = {
71
+ }, To = ["onClick"], Io = { class: "flex-1 min-w-0" }, Lo = { class: "fm-typo-en-body-md-600 text-[#1C1C1E] mb-2" }, zo = { class: "fm-typo-en-body-sm-400 text-[#6B6C70]" }, Mo = {
71
72
  key: 0,
72
73
  class: "w-[8px] h-[8px] rounded-full bg-[#FF7823]"
73
- }, Lo = {
74
+ }, Uo = {
74
75
  key: 2,
75
76
  class: "px-32 py-24"
76
- }, zo = { class: "flex flex-col gap-4 mb-12" }, Mo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, Uo = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, Vo = { class: "p-4" }, Jo = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, jo = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, Wo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, Yo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Ho = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Qo = {
77
+ }, Vo = { class: "flex flex-col gap-4 mb-12" }, Jo = { class: "fm-typo-en-title-sm-700 text-[#1C1C1E]" }, jo = { class: "w-[332px] shrink-0 border-l border-[#F0F0F0] overflow-y-auto bg-white" }, Wo = { class: "p-4" }, Yo = { class: "flex flex-col gap-0 border border-[#E9EAEC] rounded-2xl bg-white overflow-hidden" }, Ho = { class: "px-10 py-5 border-b border-[#F0F0F0]" }, Qo = { class: "fm-typo-en-body-md-700 text-[#1C1C1E]" }, Ko = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Go = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Xo = {
77
78
  key: 0,
78
79
  class: "text-[11px] leading-[14px] text-[#6B6C70]"
79
- }, Ko = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Go = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, Xo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, Zo = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, es = {
80
+ }, Zo = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, es = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, ts = { class: "flex flex-col gap-0.5 px-10 py-4 border-b border-[#F0F0F0]" }, ns = { class: "text-[11px] leading-[14px] font-medium text-[#6B6C70]" }, os = {
80
81
  key: 0,
81
82
  class: "text-[11px] leading-[14px] text-[#6B6C70]"
82
- }, ts = { class: "flex items-center justify-between gap-8 px-10 py-4" }, ns = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, os = { class: "fm-typo-en-title-md-600" }, ss = { class: "flex flex-col gap-16" }, as = { class: "fm-typo-en-body-md-400" }, rs = { class: "max-h-[300px] overflow-y-auto" }, ls = { class: "list-disc pl-16" }, is = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, us = { class: "flex w-full gap-8 justify-end" }, cs = /* @__PURE__ */ tt({
83
+ }, ss = { class: "flex items-center justify-between gap-8 px-10 py-4" }, as = { class: "text-[15px] leading-[20px] font-semibold text-[#1C1C1E]" }, rs = { class: "fm-typo-en-title-md-600" }, ls = { class: "flex flex-col gap-16" }, is = { class: "fm-typo-en-body-md-400" }, us = { class: "max-h-[300px] overflow-y-auto" }, cs = { class: "list-disc pl-16" }, ds = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ms = { class: "flex w-full gap-8 justify-end" }, fs = /* @__PURE__ */ nt({
83
84
  __name: "CreateTransferWizard",
84
85
  props: {
85
86
  show: { type: Boolean },
@@ -87,15 +88,15 @@ const qn = {
87
88
  selectedOutletIds: {}
88
89
  },
89
90
  emits: ["update:show", "submitted"],
90
- setup(_, { emit: h }) {
91
- const { FmButton: w, FmDialog: O, FmIcon: S, FmTextField: z } = ln, Y = _, $ = h, { t: c } = nt(), l = ut(), g = it(), V = Ft(), de = Lt(), v = bn(), f = Ke(), d = St(), i = k(0), C = k(!1), o = k(null), H = k(""), R = k(null), N = k(null), M = k(null), be = k(""), he = k(""), ue = k(!1), ne = k(!1), ve = k(!1), De = k(!1), _e = k(!1), Ae = k(/* @__PURE__ */ new Map()), Ee = k(), me = k([]), ge = L(() => !!o.value), $e = L(() => R.value === "transfer" ? !!N.value : R.value === "template" ? !!M.value : !1), Fe = L(() => (me.value.length ? me.value : A.value.items ?? []).some((a) => a.quantity.amount > 0)), Ge = L(() => ue.value), qe = L(
92
- () => Fe.value && ne.value && ve.value && !ue.value
93
- ), Oe = L(() => i.value === 0 ? ge.value : i.value === 1 ? $e.value : i.value === 2 ? qe.value : !1), Se = L(
91
+ setup(x, { emit: h }) {
92
+ const { FmButton: k, FmDialog: A, FmIcon: S, FmTextField: M } = cn, Y = x, O = h, { t: c } = ot(), l = ut(), g = it(), U = Rt(), fe = Mt(), p = gn(), f = Ge(), d = Pt(), i = C(0), _ = C(!1), o = C(null), H = C(""), R = C(null), q = C(null), z = C(null), pe = C(""), G = C(""), se = C(!1), ee = C(!1), de = C(!1), De = C(!1), xe = C(!1), $e = C(/* @__PURE__ */ new Map()), Ee = C(), ve = C([]), ge = L(() => !!o.value), Ae = L(() => R.value === "transfer" ? !!q.value : R.value === "template" ? !!z.value : !1), Fe = L(() => (ve.value.length ? ve.value : $.value.items ?? []).some((a) => a.quantity.amount > 0)), Xe = L(() => se.value), qe = L(
93
+ () => Fe.value && ee.value && de.value && !se.value
94
+ ), Oe = L(() => i.value === 0 ? ge.value : i.value === 1 ? Ae.value : i.value === 2 ? qe.value : !1), Se = L(
94
95
  () => i.value === 2 ? c("inventory.transfer.receiveRequest.bulk.wizard.createTransferBtn") : c("inventory.transfer.receiveRequest.bulk.wizard.continueBtn")
95
96
  ), P = L(
96
- () => ee.value === "Purchase" ? "Purchase method" : "Transfer method"
97
+ () => ne.value === "Purchase" ? "Purchase method" : "Transfer method"
97
98
  ), F = L(
98
- () => ee.value === "Purchase" ? "Purchase details" : "Transfer details"
99
+ () => ne.value === "Purchase" ? "Purchase details" : "Transfer details"
99
100
  ), B = L(() => {
100
101
  const n = H.value.trim().toLowerCase();
101
102
  let a = g.locations;
@@ -103,72 +104,72 @@ const qn = {
103
104
  (s) => s.name.toLowerCase().includes(n) || (s.doc.profile.code ?? "").toLowerCase().includes(n)
104
105
  ) : a;
105
106
  }), K = L(() => {
106
- var fe;
107
- const n = (fe = o.value) == null ? void 0 : fe.doc._id, a = V.suppliers.map((se) => ({
108
- doc: se,
109
- name: se.name,
107
+ var ye;
108
+ const n = (ye = o.value) == null ? void 0 : ye.doc._id, a = U.suppliers.map((re) => ({
109
+ doc: re,
110
+ name: re.name,
110
111
  dbName: "",
111
112
  type: "supplier",
112
113
  acceptRequest: !0
113
- })), X = [
114
+ })), Z = [
114
115
  ...g.allLocations ?? g.locations,
115
116
  ...a
116
- ].filter((se) => se.doc._id !== n), te = be.value.trim().toLowerCase();
117
- return te ? X.filter((se) => {
118
- var Xe;
119
- const Ue = se.type === "supplier" ? "" : ((Xe = se.doc.profile) == null ? void 0 : Xe.code) ?? "";
120
- return se.name.toLowerCase().includes(te) || Ue.toLowerCase().includes(te);
121
- }) : X;
122
- }), G = L(() => {
123
- const n = he.value.trim().toLowerCase(), a = d.templates;
117
+ ].filter((re) => re.doc._id !== n), oe = pe.value.trim().toLowerCase();
118
+ return oe ? Z.filter((re) => {
119
+ var Ze;
120
+ const Ue = re.type === "supplier" ? "" : ((Ze = re.doc.profile) == null ? void 0 : Ze.code) ?? "";
121
+ return re.name.toLowerCase().includes(oe) || Ue.toLowerCase().includes(oe);
122
+ }) : Z;
123
+ }), X = L(() => {
124
+ const n = G.value.trim().toLowerCase(), a = d.templates;
124
125
  return n ? a.filter((s) => s.name.toLowerCase().includes(n)) : a;
125
- }), ee = L(() => {
126
+ }), ne = L(() => {
126
127
  var n;
127
- if (A.value.supplier)
128
- return typeof A.value.supplier.internal == "string" ? "Transfer" : "Purchase";
129
- if (R.value === "transfer" && N.value)
130
- return N.value.type === "supplier" ? "Purchase" : "Transfer";
131
- if (R.value === "template" && M.value) {
128
+ if ($.value.supplier)
129
+ return typeof $.value.supplier.internal == "string" ? "Transfer" : "Purchase";
130
+ if (R.value === "transfer" && q.value)
131
+ return q.value.type === "supplier" ? "Purchase" : "Transfer";
132
+ if (R.value === "template" && z.value) {
132
133
  const a = d.templates.find(
133
- (s) => s._id === M.value
134
+ (s) => s._id === z.value
134
135
  );
135
136
  if ((n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier)
136
137
  return typeof a.purchaseOrder.supplier.internal == "string" ? "Transfer" : "Purchase";
137
138
  }
138
139
  return "Transfer";
139
- }), Re = L(() => o.value ? o.value.name : c("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), we = L(() => R.value === "transfer" ? ee.value === "Purchase" ? "Purchase from Supplier" : c("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? c("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : c("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), j = L(() => {
140
+ }), Re = L(() => o.value ? o.value.name : c("inventory.transfer.receiveRequest.bulk.wizard.notSelected")), we = L(() => R.value === "transfer" ? ne.value === "Purchase" ? "Purchase from Supplier" : c("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletMethod") : R.value === "template" ? c("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateMethod") : c("inventory.transfer.receiveRequest.bulk.wizard.notChosen")), j = L(() => {
140
141
  var n;
141
- if (R.value === "transfer" && N.value)
142
- return N.value.name;
143
- if (R.value === "template" && M.value) {
144
- const a = d.templates.find((s) => s._id === M.value);
145
- return (n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier ? a.purchaseOrder.supplier.name || M.value : (a == null ? void 0 : a.name) ?? M.value;
142
+ if (R.value === "transfer" && q.value)
143
+ return q.value.name;
144
+ if (R.value === "template" && z.value) {
145
+ const a = d.templates.find((s) => s._id === z.value);
146
+ return (n = a == null ? void 0 : a.purchaseOrder) != null && n.supplier ? a.purchaseOrder.supplier.name || z.value : (a == null ? void 0 : a.name) ?? z.value;
146
147
  }
147
148
  return c("inventory.transfer.receiveRequest.bulk.wizard.noneYet");
148
149
  });
149
- function ae(n) {
150
- var X, te, fe, se, Ue;
151
- const a = (X = n.doc.profile) != null && X.code ? `#${n.doc.profile.code}` : "", s = [(fe = (te = n.doc.profile) == null ? void 0 : te.address) == null ? void 0 : fe.line1, (Ue = (se = n.doc.profile) == null ? void 0 : se.address) == null ? void 0 : Ue.city].filter(Boolean).join(" · ");
150
+ function le(n) {
151
+ var Z, oe, ye, re, Ue;
152
+ const a = (Z = n.doc.profile) != null && Z.code ? `#${n.doc.profile.code}` : "", s = [(ye = (oe = n.doc.profile) == null ? void 0 : oe.address) == null ? void 0 : ye.line1, (Ue = (re = n.doc.profile) == null ? void 0 : re.address) == null ? void 0 : Ue.city].filter(Boolean).join(" · ");
152
153
  return [a, s].filter(Boolean).join(" · ");
153
154
  }
154
155
  function Be(n) {
155
- var s, X;
156
- return [(s = n.doc.address) == null ? void 0 : s.line1, (X = n.doc.address) == null ? void 0 : X.city].filter(Boolean).join(" · ");
156
+ var s, Z;
157
+ return [(s = n.doc.address) == null ? void 0 : s.line1, (Z = n.doc.address) == null ? void 0 : Z.city].filter(Boolean).join(" · ");
157
158
  }
158
159
  function Te(n) {
159
160
  var a;
160
161
  return n.type === "supplier" ? "" : ((a = n.doc.profile) == null ? void 0 : a.code) ?? "";
161
162
  }
162
163
  function r(n) {
163
- var a, s, X, te, fe, se;
164
- return n.type === "supplier" ? [(a = n.doc.address) == null ? void 0 : a.line1, (s = n.doc.address) == null ? void 0 : s.city].filter(Boolean).join(" · ") : [(te = (X = n.doc.profile) == null ? void 0 : X.address) == null ? void 0 : te.line1, (se = (fe = n.doc.profile) == null ? void 0 : fe.address) == null ? void 0 : se.city].filter(Boolean).join(" · ");
164
+ var a, s, Z, oe, ye, re;
165
+ return n.type === "supplier" ? [(a = n.doc.address) == null ? void 0 : a.line1, (s = n.doc.address) == null ? void 0 : s.city].filter(Boolean).join(" · ") : [(oe = (Z = n.doc.profile) == null ? void 0 : Z.address) == null ? void 0 : oe.line1, (re = (ye = n.doc.profile) == null ? void 0 : ye.address) == null ? void 0 : re.city].filter(Boolean).join(" · ");
165
166
  }
166
167
  const u = L(
167
- () => o.value ? ae(o.value) : ""
168
+ () => o.value ? le(o.value) : ""
168
169
  ), b = L(
169
- () => R.value === "transfer" && N.value ? N.value.type === "supplier" ? Be(N.value) : ae(N.value) : ""
170
+ () => R.value === "transfer" && q.value ? q.value.type === "supplier" ? Be(q.value) : le(q.value) : ""
170
171
  ), T = L(() => {
171
- const a = (me.value.length ? me.value : A.value.items ?? []).filter((s) => s.quantity.amount > 0).length;
172
+ const a = (ve.value.length ? ve.value : $.value.items ?? []).filter((s) => s.quantity.amount > 0).length;
172
173
  return a === 0 ? c("inventory.transfer.receiveRequest.bulk.wizard.noneYet") : `${a} ${a === 1 ? "item" : "items"}`;
173
174
  });
174
175
  function I(n) {
@@ -176,7 +177,7 @@ const qn = {
176
177
  const a = (s = n.purchaseOrder) == null ? void 0 : s.supplier;
177
178
  return a ? a.internal === "warehouse" ? `Transfer from ${a.name}` : a.internal === "restaurant" ? `Transfer from ${a.name}` : `Purchase from ${a.name}` : "";
178
179
  }
179
- function q(n) {
180
+ function N(n) {
180
181
  return {
181
182
  _id: n.doc._id,
182
183
  internal: n.type,
@@ -216,8 +217,8 @@ const qn = {
216
217
  };
217
218
  }
218
219
  function Q() {
219
- var X;
220
- const n = M.value ? d.templates.find((te) => te._id === M.value) : void 0, a = {
220
+ var Z;
221
+ const n = z.value ? d.templates.find((oe) => oe._id === z.value) : void 0, a = {
221
222
  _rev: void 0,
222
223
  email: void 0,
223
224
  internal: void 0,
@@ -228,32 +229,32 @@ const qn = {
228
229
  _id: "",
229
230
  name: "",
230
231
  address: { line2: void 0, line1: "", state: "", city: "", postcode: "", country: "" }
231
- }, s = R.value === "transfer" && N.value ? N.value.type === "supplier" ? W(N.value.doc) : q(N.value) : R.value === "template" && (n != null && n.purchaseOrder.supplier) ? n.purchaseOrder.supplier : a;
232
+ }, s = R.value === "transfer" && q.value ? q.value.type === "supplier" ? W(q.value.doc) : N(q.value) : R.value === "template" && (n != null && n.purchaseOrder.supplier) ? n.purchaseOrder.supplier : a;
232
233
  return {
233
234
  remark: void 0,
234
235
  ref: void 0,
235
236
  stockSnapshotId: void 0,
236
237
  effectiveAt: void 0,
237
- items: R.value === "template" && ((X = n == null ? void 0 : n.purchaseOrder) != null && X.items) ? n.purchaseOrder.items : [],
238
+ items: R.value === "template" && ((Z = n == null ? void 0 : n.purchaseOrder) != null && Z.items) ? n.purchaseOrder.items : [],
238
239
  supplier: s,
239
240
  status: "DRAFT",
240
241
  _id: "",
241
242
  seqNumber: 0,
242
243
  deliveryOrder: [],
243
- template: M.value ?? void 0,
244
+ template: z.value ?? void 0,
244
245
  templateDoc: n
245
246
  };
246
247
  }
247
- const A = k(Q()), Z = k(`${Math.random()}`), U = L(
248
+ const $ = C(Q()), te = C(`${Math.random()}`), V = L(
248
249
  () => {
249
250
  var n;
250
- return ((n = A.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount === 0)) ?? [];
251
+ return ((n = $.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount === 0)) ?? [];
251
252
  }
252
253
  );
253
254
  Ve(
254
255
  () => Y.show,
255
256
  (n) => {
256
- if (n && (i.value = 0, C.value = !1, o.value = null, R.value = null, N.value = null, M.value = null, H.value = "", be.value = "", he.value = "", ne.value = !1, ve.value = !1, me.value = [], A.value = Q(), Z.value = `${Math.random()}`, d.fetchTemplates(), Y.selectedOutletIds && Y.selectedOutletIds.length === 1)) {
257
+ if (n && (i.value = 0, _.value = !1, o.value = null, R.value = null, q.value = null, z.value = null, H.value = "", pe.value = "", G.value = "", ee.value = !1, de.value = !1, ve.value = [], $.value = Q(), te.value = `${Math.random()}`, d.fetchTemplates(), Y.selectedOutletIds && Y.selectedOutletIds.length === 1)) {
257
258
  const a = g.locations.find(
258
259
  (s) => s.doc._id === Y.selectedOutletIds[0]
259
260
  );
@@ -261,13 +262,13 @@ const qn = {
261
262
  }
262
263
  }
263
264
  );
264
- function re() {
265
+ function ie() {
265
266
  if (i.value === 0) {
266
267
  if (!o.value) return;
267
268
  g._currentLocation = o.value, ze(), Me(), i.value = 1;
268
269
  } else if (i.value === 1) {
269
- if (!$e.value) return;
270
- A.value = Q(), Z.value = `${Math.random()}`, me.value = [], i.value = 2;
270
+ if (!Ae.value) return;
271
+ $.value = Q(), te.value = `${Math.random()}`, ve.value = [], i.value = 2;
271
272
  } else i.value === 2 && We();
272
273
  }
273
274
  function Je() {
@@ -277,26 +278,26 @@ const qn = {
277
278
  n < i.value && (i.value = n);
278
279
  }
279
280
  function Le() {
280
- $("update:show", !1);
281
+ O("update:show", !1);
281
282
  }
282
283
  function Ne(n) {
283
- R.value !== n && (R.value = n, N.value = null, M.value = null, me.value = [], A.value = {
284
- ...A.value,
284
+ R.value !== n && (R.value = n, q.value = null, z.value = null, ve.value = [], $.value = {
285
+ ...$.value,
285
286
  items: [],
286
287
  template: void 0,
287
288
  templateDoc: void 0
288
289
  });
289
290
  }
290
291
  function ke(n) {
291
- me.value = n ?? [];
292
+ ve.value = n ?? [];
292
293
  }
293
- Ve(M, (n) => {
294
- R.value === "template" && n && (A.value = Q(), Z.value = `${Math.random()}`);
294
+ Ve(z, (n) => {
295
+ R.value === "template" && n && ($.value = Q(), te.value = `${Math.random()}`);
295
296
  });
296
297
  async function ze() {
297
- ne.value = !1;
298
+ ee.value = !1;
298
299
  try {
299
- await V.readSuppliers(), ne.value = !0;
300
+ await U.readSuppliers(), ee.value = !0;
300
301
  } catch {
301
302
  l.open({
302
303
  title: c("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
@@ -306,57 +307,57 @@ const qn = {
306
307
  }
307
308
  }
308
309
  async function Me() {
309
- _e.value = !0, Ae.value = /* @__PURE__ */ new Map();
310
+ xe.value = !0, $e.value = /* @__PURE__ */ new Map();
310
311
  try {
311
- const n = await v.readStockBalance(), a = /* @__PURE__ */ new Map();
312
+ const n = await p.readStockBalance(), a = /* @__PURE__ */ new Map();
312
313
  for (const s of n.skus ?? [])
313
314
  a.set(s.id, s);
314
- Ae.value = a;
315
+ $e.value = a;
315
316
  } catch {
316
317
  } finally {
317
- _e.value = !1;
318
+ xe.value = !1;
318
319
  }
319
320
  }
320
321
  function je() {
321
322
  var n;
322
- (n = Ee.value) != null && n.getFormData && (A.value = { ...A.value, ...Ee.value.getFormData() });
323
+ (n = Ee.value) != null && n.getFormData && ($.value = { ...$.value, ...Ee.value.getFormData() });
323
324
  }
324
325
  function We() {
325
- if (je(), U.value.length > 0) {
326
+ if (je(), V.value.length > 0) {
326
327
  De.value = !0;
327
328
  return;
328
329
  }
329
- oe();
330
+ ae();
330
331
  }
331
- function x() {
332
+ function w() {
332
333
  var n;
333
- A.value.items = ((n = A.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount > 0)) ?? [], De.value = !1, oe();
334
+ $.value.items = ((n = $.value.items) == null ? void 0 : n.filter((a) => a.quantity.amount > 0)) ?? [], De.value = !1, ae();
334
335
  }
335
- function oe() {
336
- var s, X;
337
- const n = gn.validatePurchaseOrderItems({
338
- skusById: de.skuById ?? {},
339
- items: A.value.items ?? []
336
+ function ae() {
337
+ var s, Z;
338
+ const n = xn.validatePurchaseOrderItems({
339
+ skusById: fe.skuById ?? {},
340
+ items: $.value.items ?? []
340
341
  }), a = Object.values(n).flat();
341
342
  if (a.length > 0) {
342
- const te = a[0];
343
+ const oe = a[0];
343
344
  l.open({
344
- title: `[Row ${te.index + 1}] "${te.poItem.sku.name}"`,
345
- message: `${te.message}`,
345
+ title: `[Row ${oe.index + 1}] "${oe.poItem.sku.name}"`,
346
+ message: `${oe.message}`,
346
347
  type: "error"
347
348
  });
348
349
  return;
349
350
  }
350
- (X = (s = Ee.value) == null ? void 0 : s.validateInputs) == null || X.call(s);
351
+ (Z = (s = Ee.value) == null ? void 0 : s.validateInputs) == null || Z.call(s);
351
352
  }
352
- async function ie() {
353
- const n = A.value;
354
- if (ue.value = !0, n.items = n.items.filter((a) => a.quantity.amount > 0), !n.items.length) {
353
+ async function ce() {
354
+ const n = $.value;
355
+ if (se.value = !0, n.items = n.items.filter((a) => a.quantity.amount > 0), !n.items.length) {
355
356
  l.open({
356
357
  title: "Cannot create order",
357
358
  message: "There are no items with non-zero amount in your request.",
358
359
  type: "error"
359
- }), ue.value = !1;
360
+ }), se.value = !1;
360
361
  return;
361
362
  }
362
363
  (n.supplier.internal === "warehouse" || n.supplier.internal === "restaurant") && (n.items = n.items.map(({ totalCost: a, ...s }) => s));
@@ -365,7 +366,7 @@ const qn = {
365
366
  title: c("inventory.transfer.receiveRequest.create.success"),
366
367
  message: c("inventory.transfer.receiveRequest.create.successMessage"),
367
368
  type: "success"
368
- }), $("submitted"), $("update:show", !1), ce();
369
+ }), O("submitted"), O("update:show", !1), me();
369
370
  } catch (a) {
370
371
  l.open({
371
372
  title: c("inventory.transfer.receiveRequest.create.error.title"),
@@ -373,15 +374,15 @@ const qn = {
373
374
  type: "error"
374
375
  }), console.error("Error creating purchase order", a);
375
376
  } finally {
376
- ue.value = !1;
377
+ se.value = !1;
377
378
  }
378
379
  }
379
- function ce() {
380
- i.value = 0, C.value = !1, o.value = null, R.value = null, N.value = null, M.value = null, H.value = "", be.value = "", he.value = "", ne.value = !1, ve.value = !1, me.value = [], A.value = Q(), Z.value = `${Math.random()}`;
380
+ function me() {
381
+ i.value = 0, _.value = !1, o.value = null, R.value = null, q.value = null, z.value = null, H.value = "", pe.value = "", G.value = "", ee.value = !1, de.value = !1, ve.value = [], $.value = Q(), te.value = `${Math.random()}`;
381
382
  }
382
- return (n, a) => (m(), y(ye, null, [
383
- (m(), le(lt, { to: "body" }, [
384
- E(Dt, {
383
+ return (n, a) => (m(), y(he, null, [
384
+ (m(), ue(lt, { to: "body" }, [
385
+ E(qt, {
385
386
  "enter-active-class": "transition-opacity duration-150 ease-out",
386
387
  "enter-from-class": "opacity-0",
387
388
  "enter-to-class": "opacity-100",
@@ -390,17 +391,17 @@ const qn = {
390
391
  "leave-to-class": "opacity-0"
391
392
  }, {
392
393
  default: Pe(() => [
393
- n.show ? (m(), y("div", qn, [
394
- C.value ? D("", !0) : (m(), y("div", Nn, [
395
- e("span", An, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
396
- e("div", $n, [
397
- E(t(w), {
394
+ n.show ? (m(), y("div", An, [
395
+ _.value ? D("", !0) : (m(), y("div", On, [
396
+ e("span", Bn, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.title")), 1),
397
+ e("div", Tn, [
398
+ E(t(k), {
398
399
  variant: "tertiary",
399
400
  size: "md",
400
401
  label: t(c)("inventory.transfer.receiveRequest.bulk.wizard.cancelBtn"),
401
402
  onClick: Le
402
403
  }, null, 8, ["label"]),
403
- i.value > 0 ? (m(), le(t(w), {
404
+ i.value > 0 ? (m(), ue(t(k), {
404
405
  key: 0,
405
406
  variant: "secondary",
406
407
  size: "md",
@@ -408,17 +409,17 @@ const qn = {
408
409
  label: t(c)("inventory.transfer.receiveRequest.bulk.wizard.backBtn"),
409
410
  onClick: Je
410
411
  }, null, 8, ["label"])) : D("", !0),
411
- E(t(w), {
412
+ E(t(k), {
412
413
  size: "md",
413
414
  disabled: !Oe.value,
414
- loading: ue.value,
415
+ loading: se.value,
415
416
  label: Se.value,
416
- onClick: re
417
+ onClick: ie
417
418
  }, null, 8, ["disabled", "loading", "label"])
418
419
  ])
419
420
  ])),
420
- C.value ? D("", !0) : (m(), y("div", On, [
421
- e("div", Bn, [
421
+ _.value ? D("", !0) : (m(), y("div", In, [
422
+ e("div", Ln, [
422
423
  e("button", {
423
424
  class: "flex flex-col items-center gap-4 min-w-0 group",
424
425
  disabled: i.value <= 0,
@@ -430,16 +431,16 @@ const qn = {
430
431
  i.value > 0 || i.value === 0 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
431
432
  ])
432
433
  }, [
433
- i.value > 0 ? (m(), le(t(S), {
434
+ i.value > 0 ? (m(), ue(t(S), {
434
435
  key: 0,
435
436
  name: "check",
436
437
  size: "sm"
437
- })) : (m(), y("span", In, "1"))
438
+ })) : (m(), y("span", Mn, "1"))
438
439
  ], 2),
439
440
  e("span", {
440
441
  class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 0 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
441
442
  }, " Select destination ", 2)
442
- ], 8, Tn),
443
+ ], 8, zn),
443
444
  e("div", {
444
445
  class: J(["flex-1 h-1 mx-8 transition-colors duration-200", i.value > 0 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
445
446
  }, null, 2),
@@ -454,20 +455,20 @@ const qn = {
454
455
  i.value > 1 || i.value === 1 ? "bg-[#FF7823] text-white" : "bg-[#F0F0F0] text-[#6B6C70]"
455
456
  ])
456
457
  }, [
457
- i.value > 1 ? (m(), le(t(S), {
458
+ i.value > 1 ? (m(), ue(t(S), {
458
459
  key: 0,
459
460
  name: "check",
460
461
  size: "sm"
461
- })) : (m(), y("span", zn, "2"))
462
+ })) : (m(), y("span", Vn, "2"))
462
463
  ], 2),
463
464
  e("span", {
464
465
  class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 1 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
465
- }, p(P.value), 3)
466
- ], 8, Ln),
466
+ }, v(P.value), 3)
467
+ ], 8, Un),
467
468
  e("div", {
468
469
  class: J(["flex-1 h-1 mx-8 transition-colors duration-200", i.value > 1 ? "bg-[#FF7823]" : "bg-[#E0E0E0]"])
469
470
  }, null, 2),
470
- e("button", Mn, [
471
+ e("button", Jn, [
471
472
  e("div", {
472
473
  class: J([
473
474
  "w-32 h-32 rounded-full flex items-center justify-center text-sm font-semibold transition-colors duration-150",
@@ -478,68 +479,68 @@ const qn = {
478
479
  ]), 2),
479
480
  e("span", {
480
481
  class: J(["fm-typo-en-body-xs-500 whitespace-nowrap transition-colors duration-150", i.value >= 2 ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
481
- }, p(F.value), 3)
482
+ }, v(F.value), 3)
482
483
  ])
483
484
  ])
484
485
  ])),
485
- e("div", Un, [
486
- e("div", Vn, [
487
- i.value === 0 ? (m(), y("div", Jn, [
488
- e("div", jn, [
489
- e("h3", Wn, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
490
- e("p", Yn, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
491
- ]),
486
+ e("div", jn, [
487
+ e("div", Wn, [
488
+ i.value === 0 ? (m(), y("div", Yn, [
492
489
  e("div", Hn, [
493
- E(t(z), {
490
+ e("h3", Qn, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Heading")), 1),
491
+ e("p", Kn, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1Desc")), 1)
492
+ ]),
493
+ e("div", Gn, [
494
+ E(t(M), {
494
495
  "model-value": H.value,
495
496
  "onUpdate:modelValue": a[2] || (a[2] = (s) => H.value = s),
496
497
  "prepend-icon": "search",
497
498
  placeholder: t(c)("inventory.transfer.receiveRequest.bulk.wizard.step1SearchPlaceholder")
498
499
  }, null, 8, ["model-value", "placeholder"])
499
500
  ]),
500
- e("div", Qn, [
501
- (m(!0), y(ye, null, Qe(B.value, (s, X) => {
502
- var te, fe, se, Ue, Xe, vt, yt;
501
+ e("div", Xn, [
502
+ (m(!0), y(he, null, Ke(B.value, (s, Z) => {
503
+ var oe, ye, re, Ue, Ze, vt, yt;
503
504
  return m(), y("div", {
504
505
  key: s.dbName,
505
506
  class: J(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
506
- ((te = o.value) == null ? void 0 : te.dbName) === s.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
507
- X > 0 ? "border-t border-[#F0F0F0]" : ""
507
+ ((oe = o.value) == null ? void 0 : oe.dbName) === s.dbName ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
508
+ Z > 0 ? "border-t border-[#F0F0F0]" : ""
508
509
  ]]),
509
- onClick: (ka) => o.value = s
510
+ onClick: (Sa) => o.value = s
510
511
  }, [
511
- e("div", Gn, [
512
- e("span", Xn, p(s.name.slice(0, 2).toUpperCase()), 1)
512
+ e("div", eo, [
513
+ e("span", to, v(s.name.slice(0, 2).toUpperCase()), 1)
513
514
  ]),
514
- e("div", Zn, [
515
- e("div", eo, p(s.name), 1),
516
- e("div", to, [
517
- ot(p(s.doc.profile.code ? `#${s.doc.profile.code}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
518
- (fe = s.doc.profile.address) != null && fe.line1 || (se = s.doc.profile.address) != null && se.city ? (m(), y(ye, { key: 0 }, [
519
- ot(" · " + p([(Ue = s.doc.profile.address) == null ? void 0 : Ue.line1, (Xe = s.doc.profile.address) == null ? void 0 : Xe.city].filter(Boolean).join(" · ")), 1)
515
+ e("div", no, [
516
+ e("div", oo, v(s.name), 1),
517
+ e("div", so, [
518
+ st(v(s.doc.profile.code ? `#${s.doc.profile.code}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
519
+ (ye = s.doc.profile.address) != null && ye.line1 || (re = s.doc.profile.address) != null && re.city ? (m(), y(he, { key: 0 }, [
520
+ st(" · " + v([(Ue = s.doc.profile.address) == null ? void 0 : Ue.line1, (Ze = s.doc.profile.address) == null ? void 0 : Ze.city].filter(Boolean).join(" · ")), 1)
520
521
  ], 64)) : D("", !0)
521
522
  ])
522
523
  ]),
523
- e("span", no, p(s.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
524
+ e("span", ao, v(s.type === "warehouse" ? "Warehouse" : "Restaurant"), 1),
524
525
  e("div", {
525
526
  class: J([
526
527
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
527
528
  ((vt = o.value) == null ? void 0 : vt.dbName) === s.dbName ? "border-[#FF7823]" : "border-[#CCCCCC]"
528
529
  ])
529
530
  }, [
530
- ((yt = o.value) == null ? void 0 : yt.dbName) === s.dbName ? (m(), y("div", oo)) : D("", !0)
531
+ ((yt = o.value) == null ? void 0 : yt.dbName) === s.dbName ? (m(), y("div", ro)) : D("", !0)
531
532
  ], 2)
532
- ], 10, Kn);
533
+ ], 10, Zn);
533
534
  }), 128)),
534
- B.value.length === 0 ? (m(), y("div", so, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
535
+ B.value.length === 0 ? (m(), y("div", lo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
535
536
  ])
536
537
  ])) : D("", !0),
537
- i.value === 1 ? (m(), y("div", ao, [
538
- e("div", ro, [
539
- e("h3", lo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
540
- e("p", io, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
541
- ]),
538
+ i.value === 1 ? (m(), y("div", io, [
542
539
  e("div", uo, [
540
+ e("h3", co, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Heading")), 1),
541
+ e("p", mo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2Desc")), 1)
542
+ ]),
543
+ e("div", fo, [
543
544
  e("div", {
544
545
  class: J([
545
546
  "border rounded-xl p-16 cursor-pointer transition-all duration-150 flex flex-col",
@@ -547,7 +548,7 @@ const qn = {
547
548
  ]),
548
549
  onClick: a[3] || (a[3] = (s) => Ne("transfer"))
549
550
  }, [
550
- e("div", co, [
551
+ e("div", po, [
551
552
  e("div", {
552
553
  class: J(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
553
554
  }, [
@@ -560,7 +561,7 @@ const qn = {
560
561
  e("div", {
561
562
  class: J(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "transfer" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
562
563
  }, [
563
- R.value === "transfer" ? (m(), le(t(S), {
564
+ R.value === "transfer" ? (m(), ue(t(S), {
564
565
  key: 0,
565
566
  name: "check",
566
567
  size: "sm",
@@ -568,8 +569,8 @@ const qn = {
568
569
  })) : D("", !0)
569
570
  ], 2)
570
571
  ]),
571
- e("div", mo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
572
- e("div", fo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
572
+ e("div", vo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutlet")), 1),
573
+ e("div", yo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.outletToOutletDesc")), 1)
573
574
  ], 2),
574
575
  e("div", {
575
576
  class: J([
@@ -578,7 +579,7 @@ const qn = {
578
579
  ]),
579
580
  onClick: a[4] || (a[4] = (s) => Ne("template"))
580
581
  }, [
581
- e("div", po, [
582
+ e("div", bo, [
582
583
  e("div", {
583
584
  class: J(["w-36 h-36 rounded-xl flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "bg-[#F0F0F0]"])
584
585
  }, [
@@ -591,7 +592,7 @@ const qn = {
591
592
  e("div", {
592
593
  class: J(["w-16 h-16 rounded-full flex items-center justify-center shrink-0", R.value === "template" ? "bg-[#FF7823]" : "border border-[#CCCCCC]"])
593
594
  }, [
594
- R.value === "template" ? (m(), le(t(S), {
595
+ R.value === "template" ? (m(), ue(t(S), {
595
596
  key: 0,
596
597
  name: "check",
597
598
  size: "sm",
@@ -599,159 +600,159 @@ const qn = {
599
600
  })) : D("", !0)
600
601
  ], 2)
601
602
  ]),
602
- e("div", vo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
603
- e("div", yo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
603
+ e("div", ho, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplate")), 1),
604
+ e("div", go, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.fromTemplateDesc")), 1)
604
605
  ], 2)
605
606
  ]),
606
- R.value === "transfer" ? (m(), y(ye, { key: 0 }, [
607
- e("div", bo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
608
- e("div", ho, [
609
- E(t(z), {
610
- "model-value": be.value,
611
- "onUpdate:modelValue": a[5] || (a[5] = (s) => be.value = s),
607
+ R.value === "transfer" ? (m(), y(he, { key: 0 }, [
608
+ e("div", _o, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2SourceHeading")), 1),
609
+ e("div", xo, [
610
+ E(t(M), {
611
+ "model-value": pe.value,
612
+ "onUpdate:modelValue": a[5] || (a[5] = (s) => pe.value = s),
612
613
  "prepend-icon": "search",
613
614
  placeholder: t(c)(
614
615
  "inventory.transfer.receiveRequest.bulk.wizard.step2SearchSourcePlaceholder"
615
616
  )
616
617
  }, null, 8, ["model-value", "placeholder"])
617
618
  ]),
618
- e("div", go, [
619
- (m(!0), y(ye, null, Qe(K.value, (s, X) => {
620
- var te, fe, se;
619
+ e("div", wo, [
620
+ (m(!0), y(he, null, Ke(K.value, (s, Z) => {
621
+ var oe, ye, re;
621
622
  return m(), y("div", {
622
623
  key: s.dbName,
623
624
  class: J(["flex items-center gap-8 px-12 h-[67px] cursor-pointer transition-colors duration-150", [
624
- ((te = N.value) == null ? void 0 : te.doc._id) === s.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
625
- X > 0 ? "border-t border-[#F0F0F0]" : ""
625
+ ((oe = q.value) == null ? void 0 : oe.doc._id) === s.doc._id ? "bg-[#FFF5EE]" : "hover:bg-[#FAFAFA]",
626
+ Z > 0 ? "border-t border-[#F0F0F0]" : ""
626
627
  ]]),
627
- onClick: (Ue) => N.value = s
628
+ onClick: (Ue) => q.value = s
628
629
  }, [
629
- e("div", _o, [
630
- e("span", wo, p(s.name.slice(0, 2).toUpperCase()), 1)
630
+ e("div", Co, [
631
+ e("span", Fo, v(s.name.slice(0, 2).toUpperCase()), 1)
631
632
  ]),
632
- e("div", ko, [
633
- e("div", Co, p(s.name), 1),
634
- e("div", Fo, [
635
- ot(p(Te(s) ? `#${Te(s)}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
636
- r(s) ? (m(), y(ye, { key: 0 }, [
637
- ot(" · " + p(r(s)), 1)
633
+ e("div", So, [
634
+ e("div", Ro, v(s.name), 1),
635
+ e("div", Po, [
636
+ st(v(Te(s) ? `#${Te(s)}` : t(c)("inventory.transfer.receiveRequest.bulk.wizard.noCode")) + " ", 1),
637
+ r(s) ? (m(), y(he, { key: 0 }, [
638
+ st(" · " + v(r(s)), 1)
638
639
  ], 64)) : D("", !0)
639
640
  ])
640
641
  ]),
641
- e("span", So, p(s.type === "warehouse" ? "Warehouse" : s.type === "supplier" ? "Supplier" : "Restaurant"), 1),
642
+ e("span", Do, v(s.type === "warehouse" ? "Warehouse" : s.type === "supplier" ? "Supplier" : "Restaurant"), 1),
642
643
  e("div", {
643
644
  class: J([
644
645
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
645
- ((fe = N.value) == null ? void 0 : fe.doc._id) === s.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
646
+ ((ye = q.value) == null ? void 0 : ye.doc._id) === s.doc._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
646
647
  ])
647
648
  }, [
648
- ((se = N.value) == null ? void 0 : se.doc._id) === s.doc._id ? (m(), y("div", Ro)) : D("", !0)
649
+ ((re = q.value) == null ? void 0 : re.doc._id) === s.doc._id ? (m(), y("div", Eo)) : D("", !0)
649
650
  ], 2)
650
- ], 10, xo);
651
+ ], 10, ko);
651
652
  }), 128)),
652
- K.value.length === 0 ? (m(), y("div", Po, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
653
+ K.value.length === 0 ? (m(), y("div", qo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noOutletsAvailable")), 1)) : D("", !0)
653
654
  ])
654
655
  ], 64)) : D("", !0),
655
- R.value === "template" ? (m(), y(ye, { key: 1 }, [
656
- e("div", Do, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
657
- e("div", Eo, [
658
- E(t(z), {
659
- "model-value": he.value,
660
- "onUpdate:modelValue": a[6] || (a[6] = (s) => he.value = s),
656
+ R.value === "template" ? (m(), y(he, { key: 1 }, [
657
+ e("div", No, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.step2TemplateHeading")), 1),
658
+ e("div", $o, [
659
+ E(t(M), {
660
+ "model-value": G.value,
661
+ "onUpdate:modelValue": a[6] || (a[6] = (s) => G.value = s),
661
662
  "prepend-icon": "search",
662
663
  placeholder: t(c)(
663
664
  "inventory.transfer.receiveRequest.bulk.wizard.step2SearchTemplatePlaceholder"
664
665
  )
665
666
  }, null, 8, ["model-value", "placeholder"])
666
667
  ]),
667
- t(d).loading ? (m(), y("div", qo, [
668
+ t(d).loading ? (m(), y("div", Ao, [
668
669
  E(t(S), {
669
670
  name: "progress_activity",
670
671
  class: "text-[#FF7823] animate-spin"
671
672
  })
672
- ])) : G.value.length === 0 ? (m(), y("div", No, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (m(), y("div", Ao, [
673
- (m(!0), y(ye, null, Qe(G.value, (s) => (m(), y("div", {
673
+ ])) : X.value.length === 0 ? (m(), y("div", Oo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.noTemplatesAvailable")), 1)) : (m(), y("div", Bo, [
674
+ (m(!0), y(he, null, Ke(X.value, (s) => (m(), y("div", {
674
675
  key: s._id,
675
676
  class: J([
676
677
  "border rounded-lg px-16 py-12 cursor-pointer transition-all duration-150 flex items-center gap-12",
677
- M.value === s._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
678
+ z.value === s._id ? "border-[#FF7823] bg-[#FFF5EE]" : "border-[#E0E0E0] bg-white hover:bg-[#FAFAFA]"
678
679
  ]),
679
- onClick: (X) => M.value = s._id
680
+ onClick: (Z) => z.value = s._id
680
681
  }, [
681
- e("div", Oo, [
682
- e("div", Bo, p(s.name), 1),
683
- e("div", To, p(I(s)) + " · " + p(s.purchaseOrder.items.length) + " items ", 1)
682
+ e("div", Io, [
683
+ e("div", Lo, v(s.name), 1),
684
+ e("div", zo, v(I(s)) + " · " + v(s.purchaseOrder.items.length) + " items ", 1)
684
685
  ]),
685
686
  e("div", {
686
687
  class: J([
687
688
  "w-[18px] h-[18px] rounded-full border flex items-center justify-center shrink-0 transition-colors duration-150",
688
- M.value === s._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
689
+ z.value === s._id ? "border-[#FF7823]" : "border-[#CCCCCC]"
689
690
  ])
690
691
  }, [
691
- M.value === s._id ? (m(), y("div", Io)) : D("", !0)
692
+ z.value === s._id ? (m(), y("div", Mo)) : D("", !0)
692
693
  ], 2)
693
- ], 10, $o))), 128))
694
+ ], 10, To))), 128))
694
695
  ]))
695
696
  ], 64)) : D("", !0)
696
697
  ])) : D("", !0),
697
- i.value === 2 ? (m(), y("div", Lo, [
698
- e("div", zo, [
699
- e("h3", Mo, p(F.value), 1)
698
+ i.value === 2 ? (m(), y("div", Uo, [
699
+ e("div", Vo, [
700
+ e("h3", Jo, v(F.value), 1)
700
701
  ]),
701
- (m(), le(dn, {
702
+ (m(), ue(fn, {
702
703
  ref_key: "formRef",
703
704
  ref: Ee,
704
705
  class: "w-full",
705
- "onForm:ready": a[7] || (a[7] = () => ve.value = !0),
706
+ "onForm:ready": a[7] || (a[7] = () => de.value = !0),
706
707
  "onForm:dataChange": ke,
707
- onValidationSuccess: ie,
708
- modelValue: A.value,
709
- "onUpdate:modelValue": a[8] || (a[8] = (s) => A.value = s),
710
- disabled: Ge.value,
711
- "locked-supplier": A.value.supplier,
712
- suppliers: t(V).suppliers,
713
- skus: t(de).skus,
714
- key: Z.value,
708
+ onValidationSuccess: ce,
709
+ modelValue: $.value,
710
+ "onUpdate:modelValue": a[8] || (a[8] = (s) => $.value = s),
711
+ disabled: Xe.value,
712
+ "locked-supplier": $.value.supplier,
713
+ suppliers: t(U).suppliers,
714
+ skus: t(fe).skus,
715
+ key: te.value,
715
716
  "last-closing-date": n.lastClosingDate,
716
- "sku-balance-map": Ae.value,
717
- "is-balance-loading": _e.value
717
+ "sku-balance-map": $e.value,
718
+ "is-balance-loading": xe.value
718
719
  }, null, 8, ["modelValue", "disabled", "locked-supplier", "suppliers", "skus", "last-closing-date", "sku-balance-map", "is-balance-loading"]))
719
720
  ])) : D("", !0)
720
721
  ]),
721
- e("div", Uo, [
722
- e("div", Vo, [
723
- e("div", Jo, [
724
- e("div", jo, [
725
- e("div", Wo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
722
+ e("div", jo, [
723
+ e("div", Wo, [
724
+ e("div", Yo, [
725
+ e("div", Ho, [
726
+ e("div", Qo, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryTitle")), 1)
726
727
  ]),
727
- e("div", Yo, [
728
- e("span", Ho, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
728
+ e("div", Ko, [
729
+ e("span", Go, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryDestination")), 1),
729
730
  e("span", {
730
731
  class: J(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", o.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
731
- }, p(Re.value), 3),
732
- u.value ? (m(), y("span", Qo, p(u.value), 1)) : D("", !0)
732
+ }, v(Re.value), 3),
733
+ u.value ? (m(), y("span", Xo, v(u.value), 1)) : D("", !0)
733
734
  ]),
734
- e("div", Ko, [
735
- e("span", Go, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
735
+ e("div", Zo, [
736
+ e("span", es, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryMethod")), 1),
736
737
  e("span", {
737
738
  class: J(["text-[15px] leading-[20px] font-semibold transition-colors duration-200", R.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"])
738
- }, p(we.value), 3)
739
+ }, v(we.value), 3)
739
740
  ]),
740
- e("div", Xo, [
741
- e("span", Zo, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
741
+ e("div", ts, [
742
+ e("span", ns, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summarySource")), 1),
742
743
  e("span", {
743
744
  class: J([
744
745
  "text-[15px] leading-[20px] font-semibold transition-colors duration-200",
745
- N.value || M.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
746
+ q.value || z.value ? "text-[#1C1C1E]" : "text-[#B2B3B6]"
746
747
  ])
747
- }, p(j.value), 3),
748
- b.value ? (m(), y("span", es, p(b.value), 1)) : D("", !0)
748
+ }, v(j.value), 3),
749
+ b.value ? (m(), y("span", os, v(b.value), 1)) : D("", !0)
749
750
  ]),
750
- e("div", ts, [
751
- e("span", ns, p(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
751
+ e("div", ss, [
752
+ e("span", as, v(t(c)("inventory.transfer.receiveRequest.bulk.wizard.summaryItems")), 1),
752
753
  e("span", {
753
754
  class: J(["text-[15px] leading-[20px] font-medium transition-colors duration-200", Fe.value ? "text-[#1C1C1E]" : "text-[#6B6C70]"])
754
- }, p(T.value), 3)
755
+ }, v(T.value), 3)
755
756
  ])
756
757
  ])
757
758
  ])
@@ -762,55 +763,55 @@ const qn = {
762
763
  _: 1
763
764
  })
764
765
  ])),
765
- E(t(O), {
766
+ E(t(A), {
766
767
  modelValue: De.value,
767
768
  "onUpdate:modelValue": a[10] || (a[10] = (s) => De.value = s),
768
769
  overlay: !0
769
770
  }, {
770
771
  "dialog-header": Pe(() => [
771
- e("div", os, p(t(c)("inventory.transfer.template.zeroQuantity.title")), 1)
772
+ e("div", rs, v(t(c)("inventory.transfer.template.zeroQuantity.title")), 1)
772
773
  ]),
773
774
  "dialog-footer": Pe(() => [
774
- e("div", us, [
775
- E(t(w), {
775
+ e("div", ms, [
776
+ E(t(k), {
776
777
  label: t(c)("common.cancel"),
777
778
  variant: "tertiary",
778
779
  size: "md",
779
780
  onClick: a[9] || (a[9] = (s) => De.value = !1)
780
781
  }, null, 8, ["label"]),
781
- E(t(w), {
782
+ E(t(k), {
782
783
  label: t(c)("inventory.transfer.template.zeroQuantity.removeAll"),
783
784
  variant: "primary",
784
785
  size: "md",
785
786
  "prepend-icon": "delete",
786
- onClick: x
787
+ onClick: w
787
788
  }, null, 8, ["label"])
788
789
  ])
789
790
  ]),
790
791
  default: Pe(() => [
791
- e("div", ss, [
792
- e("div", as, p(t(c)("inventory.transfer.template.zeroQuantity.message", {
793
- count: U.value.length
792
+ e("div", ls, [
793
+ e("div", is, v(t(c)("inventory.transfer.template.zeroQuantity.message", {
794
+ count: V.value.length
794
795
  })), 1),
795
- e("div", rs, [
796
- e("ul", ls, [
797
- (m(!0), y(ye, null, Qe(U.value, (s) => (m(), y("li", {
796
+ e("div", us, [
797
+ e("ul", cs, [
798
+ (m(!0), y(he, null, Ke(V.value, (s) => (m(), y("li", {
798
799
  key: s.sku._id,
799
800
  class: "fm-typo-en-body-md-400"
800
- }, p(s.sku.name) + " (" + p(s.sku.code) + ") ", 1))), 128))
801
+ }, v(s.sku.name) + " (" + v(s.sku.code) + ") ", 1))), 128))
801
802
  ])
802
803
  ]),
803
- e("div", is, p(t(c)("inventory.transfer.template.zeroQuantity.prompt")), 1)
804
+ e("div", ds, v(t(c)("inventory.transfer.template.zeroQuantity.prompt")), 1)
804
805
  ])
805
806
  ]),
806
807
  _: 1
807
808
  }, 8, ["modelValue"])
808
809
  ], 64));
809
810
  }
810
- }), ds = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, ms = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, fs = { class: "flex gap-2 items-center" }, ps = ["disabled"], vs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, ys = {
811
+ }), ps = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-2xl overflow-hidden" }, vs = { class: "flex justify-between items-center px-16 py-3 border-b border-gray-200 bg-gray-50" }, ys = { class: "flex gap-2 items-center" }, bs = ["disabled"], hs = { class: "flex-1 overflow-auto bg-gray-100 flex items-center justify-center" }, gs = {
811
812
  key: 0,
812
813
  class: "flex flex-col items-center gap-3 text-gray-500"
813
- }, bs = ["src"], hs = /* @__PURE__ */ tt({
814
+ }, _s = ["src"], xs = /* @__PURE__ */ nt({
814
815
  __name: "PdfPreviewDialog",
815
816
  props: {
816
817
  modelValue: { type: Boolean },
@@ -818,44 +819,44 @@ const qn = {
818
819
  blobUrl: {}
819
820
  },
820
821
  emits: ["update:modelValue"],
821
- setup(_, { emit: h }) {
822
- const w = _, O = h, S = k(null);
823
- function z() {
824
- O("update:modelValue", !1);
822
+ setup(x, { emit: h }) {
823
+ const k = x, A = h, S = C(null);
824
+ function M() {
825
+ A("update:modelValue", !1);
825
826
  }
826
827
  function Y() {
827
- var $, c;
828
- if (w.blobUrl)
828
+ var O, c;
829
+ if (k.blobUrl)
829
830
  try {
830
- (c = ($ = S.value) == null ? void 0 : $.contentWindow) == null || c.print();
831
+ (c = (O = S.value) == null ? void 0 : O.contentWindow) == null || c.print();
831
832
  } catch {
832
833
  const l = document.createElement("a");
833
- l.href = w.blobUrl, l.download = "purchase-order.pdf", document.body.appendChild(l), l.click(), document.body.removeChild(l);
834
+ l.href = k.blobUrl, l.download = "purchase-order.pdf", document.body.appendChild(l), l.click(), document.body.removeChild(l);
834
835
  }
835
836
  }
836
- return ($, c) => (m(), le(lt, { to: "body" }, [
837
- $.modelValue ? (m(), y("div", {
837
+ return (O, c) => (m(), ue(lt, { to: "body" }, [
838
+ O.modelValue ? (m(), y("div", {
838
839
  key: 0,
839
840
  class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
840
- onClick: Et(z, ["self"])
841
+ onClick: Nt(M, ["self"])
841
842
  }, [
842
- e("div", ds, [
843
- e("div", ms, [
843
+ e("div", ps, [
844
+ e("div", vs, [
844
845
  c[0] || (c[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
845
- e("div", fs, [
846
+ e("div", ys, [
846
847
  e("button", {
847
- disabled: $.loading || !$.blobUrl,
848
+ disabled: O.loading || !O.blobUrl,
848
849
  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",
849
850
  onClick: Y
850
- }, " Print ", 8, ps),
851
+ }, " Print ", 8, bs),
851
852
  e("button", {
852
853
  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",
853
- onClick: z
854
+ onClick: M
854
855
  }, " × ")
855
856
  ])
856
857
  ]),
857
- e("div", vs, [
858
- $.loading ? (m(), y("div", ys, c[1] || (c[1] = [
858
+ e("div", hs, [
859
+ O.loading ? (m(), y("div", gs, c[1] || (c[1] = [
859
860
  e("svg", {
860
861
  class: "animate-spin h-10 w-10 text-blue-500",
861
862
  xmlns: "http://www.w3.org/2000/svg",
@@ -877,67 +878,67 @@ const qn = {
877
878
  })
878
879
  ], -1),
879
880
  e("span", { class: "text-sm" }, "Generating PDF…", -1)
880
- ]))) : $.blobUrl ? (m(), y("iframe", {
881
+ ]))) : O.blobUrl ? (m(), y("iframe", {
881
882
  key: 1,
882
883
  ref_key: "iframeRef",
883
884
  ref: S,
884
- src: $.blobUrl,
885
+ src: O.blobUrl,
885
886
  class: "w-full h-full border-none"
886
- }, null, 8, bs)) : D("", !0)
887
+ }, null, 8, _s)) : D("", !0)
887
888
  ])
888
889
  ])
889
890
  ])) : D("", !0)
890
891
  ]));
891
892
  }
892
- }), gs = /* @__PURE__ */ tt({
893
+ }), ws = /* @__PURE__ */ nt({
893
894
  __name: "MultiLocationSelector",
894
- props: /* @__PURE__ */ qt({
895
+ props: /* @__PURE__ */ $t({
895
896
  locations: {}
896
897
  }, {
897
898
  modelValue: { default: () => [] },
898
899
  modelModifiers: {}
899
900
  }),
900
901
  emits: ["update:modelValue"],
901
- setup(_) {
902
- const { t: h } = nt(), w = _, O = Nt(_, "modelValue"), S = k(!1), z = k(""), Y = L(() => {
903
- const f = z.value.trim().toLowerCase();
904
- return f ? w.locations.filter(
902
+ setup(x) {
903
+ const { t: h } = ot(), k = x, A = At(x, "modelValue"), S = C(!1), M = C(""), Y = L(() => {
904
+ const f = M.value.trim().toLowerCase();
905
+ return f ? k.locations.filter(
905
906
  (d) => d.name.toLowerCase().includes(f) || (d.doc.profile.code ?? "").toLowerCase().includes(f)
906
- ) : w.locations;
907
- }), $ = L(() => O.value.length), c = L(
908
- () => Y.value.length > 0 && Y.value.every((f) => O.value.includes(f.dbName))
907
+ ) : k.locations;
908
+ }), O = L(() => A.value.length), c = L(
909
+ () => Y.value.length > 0 && Y.value.every((f) => A.value.includes(f.dbName))
909
910
  ), l = L(
910
- () => Y.value.some((f) => O.value.includes(f.dbName)) && !c.value
911
+ () => Y.value.some((f) => A.value.includes(f.dbName)) && !c.value
911
912
  ), g = L(() => {
912
- if ($.value === 0) return h("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
913
- if ($.value === 1) {
914
- const f = w.locations.find((d) => d.dbName === O.value[0]);
915
- return f ? `${f.name} (${f.doc.profile.code ?? "--"})` : O.value[0];
913
+ if (O.value === 0) return h("inventory.transfer.receiveRequest.bulk.noLocationsSelected");
914
+ if (O.value === 1) {
915
+ const f = k.locations.find((d) => d.dbName === A.value[0]);
916
+ return f ? `${f.name} (${f.doc.profile.code ?? "--"})` : A.value[0];
916
917
  }
917
- return h("inventory.transfer.receiveRequest.bulk.locationsSelected", [$.value]);
918
+ return h("inventory.transfer.receiveRequest.bulk.locationsSelected", [O.value]);
918
919
  });
919
- function V() {
920
+ function U() {
920
921
  const f = Y.value.map((d) => d.dbName);
921
- c.value ? O.value = O.value.filter((d) => !f.includes(d)) : O.value = [.../* @__PURE__ */ new Set([...O.value, ...f])];
922
+ c.value ? A.value = A.value.filter((d) => !f.includes(d)) : A.value = [.../* @__PURE__ */ new Set([...A.value, ...f])];
922
923
  }
923
- function de(f) {
924
- O.value.includes(f) ? O.value = O.value.filter((d) => d !== f) : O.value = [...O.value, f];
924
+ function fe(f) {
925
+ A.value.includes(f) ? A.value = A.value.filter((d) => d !== f) : A.value = [...A.value, f];
925
926
  }
926
- function v(f) {
927
- return O.value.includes(f);
927
+ function p(f) {
928
+ return A.value.includes(f);
928
929
  }
929
930
  return (f, d) => {
930
- const i = Ce("FmIcon"), C = Ce("FmChip"), o = Ce("FmTextField"), H = Ce("FmMenuItem"), R = Ce("FmMenu");
931
- return m(), le(R, {
931
+ const i = Ce("FmIcon"), _ = Ce("FmChip"), o = Ce("FmTextField"), H = Ce("FmMenuItem"), R = Ce("FmMenu");
932
+ return m(), ue(R, {
932
933
  "model-value": S.value,
933
934
  placement: "bottom-end",
934
935
  "close-on-click": !1,
935
- onMenuChanged: d[1] || (d[1] = (N) => {
936
- S.value = N, N || (z.value = "");
936
+ onMenuChanged: d[1] || (d[1] = (q) => {
937
+ S.value = q, q || (M.value = "");
937
938
  })
938
939
  }, {
939
940
  "menu-button": Pe(() => [
940
- E(C, {
941
+ E(_, {
941
942
  label: g.value,
942
943
  class: "text-fm-color-neutral-gray-400 cursor-pointer"
943
944
  }, {
@@ -948,8 +949,8 @@ const qn = {
948
949
  size: "sm"
949
950
  }),
950
951
  e("div", {
951
- class: J(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": $.value > 0 }])
952
- }, p(g.value), 3),
952
+ class: J(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap max-w-[200px]", { "text-fm-color-typo-primary": O.value > 0 }])
953
+ }, v(g.value), 3),
953
954
  E(i, {
954
955
  name: S.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
955
956
  outline: "",
@@ -961,8 +962,8 @@ const qn = {
961
962
  ]),
962
963
  default: Pe(() => [
963
964
  E(o, {
964
- "model-value": z.value,
965
- "onUpdate:modelValue": d[0] || (d[0] = (N) => z.value = N),
965
+ "model-value": M.value,
966
+ "onUpdate:modelValue": d[0] || (d[0] = (q) => M.value = q),
966
967
  placeholder: t(h)("inventory.common.table.toolbar.filterItems"),
967
968
  class: "my-8"
968
969
  }, null, 8, ["model-value", "placeholder"]),
@@ -971,17 +972,17 @@ const qn = {
971
972
  label: t(h)("inventory.common.selectAll"),
972
973
  "has-checkbox": !0,
973
974
  indeterminate: l.value,
974
- onClick: V
975
+ onClick: U
975
976
  }, null, 8, ["model-value", "label", "indeterminate"]),
976
- (m(!0), y(ye, null, Qe(Y.value, (N) => (m(), le(H, {
977
- key: N.dbName,
978
- "model-value": v(N.dbName),
979
- label: `${N.name} (${N.doc.profile.code ?? "--"})`,
980
- sublabel: N.type === "restaurant" ? t(h)("inventory.common.restaurant") : t(h)("inventory.common.warehouse"),
977
+ (m(!0), y(he, null, Ke(Y.value, (q) => (m(), ue(H, {
978
+ key: q.dbName,
979
+ "model-value": p(q.dbName),
980
+ label: `${q.name} (${q.doc.profile.code ?? "--"})`,
981
+ sublabel: q.type === "restaurant" ? t(h)("inventory.common.restaurant") : t(h)("inventory.common.warehouse"),
981
982
  "has-checkbox": !0,
982
- onClick: (M) => de(N.dbName)
983
+ onClick: (z) => fe(q.dbName)
983
984
  }, null, 8, ["model-value", "label", "sublabel", "onClick"]))), 128)),
984
- Y.value.length === 0 ? (m(), le(H, {
985
+ Y.value.length === 0 ? (m(), ue(H, {
985
986
  key: 0,
986
987
  disabled: "",
987
988
  label: t(h)("inventory.common.noResultFound")
@@ -991,105 +992,121 @@ const qn = {
991
992
  }, 8, ["model-value"]);
992
993
  };
993
994
  }
994
- }), Pt = "bulk-jobs-v1";
995
- function xs() {
995
+ }), Et = "bulk-jobs-v1";
996
+ function ks() {
996
997
  try {
997
- const _ = localStorage.getItem(Pt);
998
- return _ ? JSON.parse(_) : [];
998
+ const x = localStorage.getItem(Et);
999
+ return x ? JSON.parse(x) : [];
999
1000
  } catch {
1000
1001
  return [];
1001
1002
  }
1002
1003
  }
1003
- function _s(_) {
1004
+ function Cs(x) {
1004
1005
  try {
1005
- localStorage.setItem(Pt, JSON.stringify(_));
1006
+ localStorage.setItem(Et, JSON.stringify(x));
1006
1007
  } catch {
1007
1008
  }
1008
1009
  }
1009
- const ws = 300, rt = ["completed", "failed", "cancelled"];
1010
- function ks(_, h) {
1011
- var w;
1012
- return _.cancelled ? "cancelled" : _.message === "completed" ? "completed" : _.message === "error" || (w = _.message) != null && w.startsWith("error:") ? "failed" : _.message === "processing" ? "active" : "waiting";
1010
+ const wt = 5e3, kt = 3e3, Fs = 300, Qe = ["completed", "failed", "cancelled"];
1011
+ function Ss(x, h) {
1012
+ var k;
1013
+ return x.cancelled ? "cancelled" : x.message === "completed" ? "completed" : x.message === "error" || (k = x.message) != null && k.startsWith("error:") ? "failed" : x.message === "processing" ? "active" : "waiting";
1013
1014
  }
1014
- const pt = Rn("bulkJob", () => {
1015
- const _ = k(xs()), h = /* @__PURE__ */ new Map();
1016
- let w = null;
1017
- Ve(_, (v) => {
1018
- w && clearTimeout(w), w = setTimeout(() => _s(v), ws);
1015
+ const pt = Dn("bulkJob", () => {
1016
+ const x = C(ks()), h = /* @__PURE__ */ new Map();
1017
+ let k = null;
1018
+ Ve(x, (p) => {
1019
+ k && clearTimeout(k), k = setTimeout(() => Cs(p), Fs);
1019
1020
  }, { deep: !0 });
1020
- function O(v, f) {
1021
+ function A(p, f) {
1021
1022
  var R;
1022
- const d = _.value.find((N) => N.jobId === v);
1023
- let i = ks(f, d == null ? void 0 : d.type);
1024
- const C = f.errorCount ?? 0;
1025
- i === "completed" && C > 0 && (d == null ? void 0 : d.type) === "download" && (i = "failed");
1023
+ const d = x.value.find((q) => q.jobId === p);
1024
+ let i = Ss(f, d == null ? void 0 : d.type);
1025
+ const _ = f.errorCount ?? 0;
1026
+ i === "completed" && _ > 0 && (d == null ? void 0 : d.type) === "download" && (i = "failed");
1026
1027
  const o = f.total ?? 0, H = f.current ?? 0;
1027
- $(v, {
1028
+ O(p, {
1028
1029
  status: i,
1029
1030
  progress: o > 0 ? Math.round(H / o * 100) : 0,
1030
1031
  current: H,
1031
1032
  total: o,
1032
1033
  currentItem: f.currentItem ?? void 0,
1033
- errorCount: C,
1034
+ errorCount: _,
1034
1035
  // Only expose the download button when the job fully succeeded.
1035
1036
  downloadReady: i === "completed" ? f.downloadReady : !1,
1036
1037
  zipSizeBytes: f.zipSizeBytes ?? void 0,
1037
1038
  stalePoIds: (R = f.stalePoIds) != null && R.length ? f.stalePoIds : void 0
1038
- }), rt.includes(i) && z(v);
1039
+ }), Qe.includes(i) && M(p);
1039
1040
  }
1040
- function S(v) {
1041
- if (h.has(v)) return;
1042
- const f = _.value.find((H) => H.jobId === v);
1043
- if (!f) return;
1044
- const d = 5;
1045
- let i = 0;
1046
- const C = async () => {
1047
- const H = Ke();
1048
- try {
1049
- const R = await H.getBulkJobStatus(f.dbName, v);
1050
- R ? (i = 0, O(v, R)) : (i++, i >= d && ($(v, { status: "failed" }), z(v)));
1051
- } catch {
1041
+ function S(p) {
1042
+ if (h.has(p) || !x.value.find((G) => G.jobId === p)) return;
1043
+ const d = Ge();
1044
+ let i = !1, _ = null, o = !1;
1045
+ async function H() {
1046
+ if (o) return;
1047
+ const G = x.value.find((se) => se.jobId === p);
1048
+ if (!(!G || Qe.includes(G.status)))
1049
+ try {
1050
+ const se = await d.getBulkJobStatus(G.dbName, p);
1051
+ if (se && !o) {
1052
+ A(p, se);
1053
+ const ee = x.value.find((de) => de.jobId === p);
1054
+ ee && !Qe.includes(ee.status) && (_ = setTimeout(H, kt));
1055
+ }
1056
+ } catch {
1057
+ o || (_ = setTimeout(H, kt));
1058
+ }
1059
+ }
1060
+ const R = En(), { unsubscribe: q, initialState: z } = R.subscribe(
1061
+ { type: "bulkPo", params: { jobId: p } },
1062
+ (G) => {
1063
+ i = !0, _ && (clearTimeout(_), _ = null), A(p, G);
1052
1064
  }
1065
+ ), pe = () => {
1066
+ o = !0, q(), _ && (clearTimeout(_), _ = null);
1053
1067
  };
1054
- C();
1055
- const o = setInterval(C, 2e3);
1056
- h.set(v, o);
1068
+ h.set(p, pe), z.then((G) => {
1069
+ G != null && G.initialState && (i = !0, A(p, G.initialState));
1070
+ }).catch(() => {
1071
+ }), setTimeout(() => {
1072
+ !i && !o && (console.warn(`[bulkJob] SSE silent for job ${p} after ${wt}ms — starting polling fallback`), H());
1073
+ }, wt);
1057
1074
  }
1058
- function z(v) {
1059
- const f = h.get(v);
1060
- f !== void 0 && (clearInterval(f), h.delete(v));
1075
+ function M(p) {
1076
+ const f = h.get(p);
1077
+ f !== void 0 && (f(), h.delete(p));
1061
1078
  }
1062
- function Y(v) {
1063
- _.value = [v, ..._.value], S(v.jobId);
1079
+ function Y(p) {
1080
+ x.value = [p, ...x.value], S(p.jobId);
1064
1081
  }
1065
- for (const v of _.value)
1066
- rt.includes(v.status) || S(v.jobId);
1067
- function $(v, f) {
1068
- const d = _.value.findIndex((i) => i.jobId === v);
1082
+ for (const p of x.value)
1083
+ Qe.includes(p.status) || S(p.jobId);
1084
+ function O(p, f) {
1085
+ const d = x.value.findIndex((i) => i.jobId === p);
1069
1086
  if (d !== -1) {
1070
- const i = _.value[d], C = f.status ?? i.status, o = rt.includes(C) && !rt.includes(i.status) && !i.completedAt;
1071
- _.value[d] = {
1087
+ const i = x.value[d], _ = f.status ?? i.status, o = Qe.includes(_) && !Qe.includes(i.status) && !i.completedAt;
1088
+ x.value[d] = {
1072
1089
  ...i,
1073
1090
  ...f,
1074
1091
  ...o ? { completedAt: Date.now() } : {}
1075
1092
  };
1076
1093
  }
1077
1094
  }
1078
- function c(v) {
1079
- z(v), _.value = _.value.filter((f) => f.jobId !== v);
1095
+ function c(p) {
1096
+ M(p), x.value = x.value.filter((f) => f.jobId !== p);
1080
1097
  }
1081
- async function l(v) {
1082
- const f = _.value.find((d) => d.jobId === v);
1098
+ async function l(p) {
1099
+ const f = x.value.find((d) => d.jobId === p);
1083
1100
  if (f)
1084
1101
  try {
1085
- await Ke().cancelBulkJob(f.dbName, v);
1102
+ await Ge().cancelBulkJob(f.dbName, p);
1086
1103
  } catch (d) {
1087
- console.warn("[cancelJob] cancel API call failed for job", v, d);
1104
+ console.warn("[cancelJob] cancel API call failed for job", p, d);
1088
1105
  }
1089
1106
  }
1090
- function g(v, f) {
1091
- return _.value.find((d) => d.jobId === v) || Y({
1092
- jobId: v,
1107
+ function g(p, f) {
1108
+ return x.value.find((d) => d.jobId === p) || Y({
1109
+ jobId: p,
1093
1110
  type: "download",
1094
1111
  dbName: f,
1095
1112
  title: "",
@@ -1100,23 +1117,23 @@ const pt = Rn("bulkJob", () => {
1100
1117
  errorCount: 0,
1101
1118
  startedAt: Date.now()
1102
1119
  }), new Promise((d, i) => {
1103
- const C = Ve(
1104
- () => _.value.find((o) => o.jobId === v),
1120
+ const _ = Ve(
1121
+ () => x.value.find((o) => o.jobId === p),
1105
1122
  (o) => {
1106
1123
  if (!o) {
1107
- C(), i(new Error("PDF generation job not found"));
1124
+ _(), i(new Error("PDF generation job not found"));
1108
1125
  return;
1109
1126
  }
1110
1127
  if (o.status === "failed") {
1111
- C(), i(new Error("PDF generation failed"));
1128
+ _(), i(new Error("PDF generation failed"));
1112
1129
  return;
1113
1130
  }
1114
1131
  if (o.status === "cancelled") {
1115
- C(), i(new Error("PDF generation cancelled"));
1132
+ _(), i(new Error("PDF generation cancelled"));
1116
1133
  return;
1117
1134
  }
1118
1135
  if (o.downloadReady) {
1119
- C(), d();
1136
+ _(), d();
1120
1137
  return;
1121
1138
  }
1122
1139
  },
@@ -1124,81 +1141,81 @@ const pt = Rn("bulkJob", () => {
1124
1141
  );
1125
1142
  });
1126
1143
  }
1127
- const V = L(
1128
- () => _.value.filter((v) => v.status === "waiting" || v.status === "active")
1129
- ), de = L(() => V.value.length > 0);
1130
- return { jobs: _, addJob: Y, updateJob: $, removeJob: c, cancelJob: l, waitForPdfJob: g, activeJobs: V, hasActiveJobs: de };
1131
- }), et = k(), pe = k(), dt = k();
1132
- function Cs(_) {
1133
- const h = un(), w = it(), O = Rt(), S = Ft(), z = Ct(), Y = hn(), $ = St(), c = k(!1), l = ut(), { t: g } = nt(), V = Ke(), de = Yt(), v = pt(), f = k([]), d = k([]), i = k(new Array()), C = k(
1144
+ const U = L(
1145
+ () => x.value.filter((p) => p.status === "waiting" || p.status === "active")
1146
+ ), fe = L(() => U.value.length > 0);
1147
+ return { jobs: x, addJob: Y, updateJob: O, removeJob: c, cancelJob: l, waitForPdfJob: g, activeJobs: U, hasActiveJobs: fe };
1148
+ }), tt = C(), be = C(), dt = C();
1149
+ function Rs(x) {
1150
+ const h = dn(), k = it(), A = Dt(), S = Rt(), M = St(), Y = _n(), O = Pt(), c = C(!1), l = ut(), { t: g } = ot(), U = Ge(), fe = Qt(), p = pt(), f = C([]), d = C([]), i = C(new Array()), _ = C(
1134
1151
  new Array()
1135
- ), o = k(
1136
- _ != null && _.startDate && (_ != null && _.endDate) ? _ : ft()
1152
+ ), o = C(
1153
+ x != null && x.startDate && (x != null && x.endDate) ? x : ft()
1137
1154
  ), H = L(() => {
1138
1155
  const r = new Date(o.value.startDate), u = new Date(o.value.endDate);
1139
1156
  return {
1140
- start: Fn(r).toISOString(),
1141
- end: Cn(u).toISOString()
1157
+ start: Rn(r).toISOString(),
1158
+ end: Sn(u).toISOString()
1142
1159
  };
1143
- }), R = zt(), N = k(null), M = k([]), be = k(), he = k(!1), ue = k(null);
1144
- let ne = null;
1145
- function ve() {
1146
- ne && (ne.abort(), ne = null, c.value = !1, he.value = !1, ue.value = null);
1160
+ }), R = Ut(), q = C(null), z = C([]), pe = C(), G = C(!1), se = C(null);
1161
+ let ee = null;
1162
+ function de() {
1163
+ ee && (ee.abort(), ee = null, c.value = !1, G.value = !1, se.value = null);
1147
1164
  }
1148
1165
  function De(r) {
1149
- const u = w.locations.find((b) => b.dbName === r._locationDbName);
1166
+ const u = k.locations.find((b) => b.dbName === r._locationDbName);
1150
1167
  if (!u) return null;
1151
1168
  if (u.type === "restaurant") {
1152
- const b = w.locationRestaurantFromCore(u.doc._id);
1169
+ const b = k.locationRestaurantFromCore(u.doc._id);
1153
1170
  if (b !== null)
1154
1171
  return { ...u, doc: b };
1155
1172
  }
1156
1173
  return u;
1157
1174
  }
1158
- function _e(r) {
1159
- const u = w.locations.find((b) => b.dbName === r._locationDbName);
1160
- u && (w._currentLocation = u);
1175
+ function xe(r) {
1176
+ const u = k.locations.find((b) => b.dbName === r._locationDbName);
1177
+ u && (k._currentLocation = u);
1161
1178
  }
1162
- async function Ae(r, u, b) {
1163
- const T = f.value.map((A) => ({ dbName: A })), I = T.length;
1164
- ue.value = { done: 0, total: I };
1165
- let q = u.cursor, W = u.retryFailed, Q = !0;
1179
+ async function $e(r, u, b) {
1180
+ const T = f.value.map(($) => ({ dbName: $ })), I = T.length;
1181
+ se.value = { done: 0, total: I };
1182
+ let N = u.cursor, W = u.retryFailed, Q = !0;
1166
1183
  for (; Q && !b.aborted; ) {
1167
- const A = await V.getBulkPaginatedPurchaseOrders(
1184
+ const $ = await U.getBulkPaginatedPurchaseOrders(
1168
1185
  {
1169
1186
  locations: T,
1170
1187
  ...H.value,
1171
1188
  pageSize: 100,
1172
- cursor: q,
1189
+ cursor: N,
1173
1190
  retryFailed: W
1174
1191
  },
1175
1192
  b
1176
1193
  );
1177
1194
  if (b.aborted) return;
1178
- W = void 0, ue.value = {
1179
- done: Math.max(0, I - A.pendingLocations),
1195
+ W = void 0, se.value = {
1196
+ done: Math.max(0, I - $.pendingLocations),
1180
1197
  total: I
1181
1198
  }, r.push(
1182
- ...A.data.map(
1183
- ({ locationDbName: Z, ...U }) => ({ ...U, _locationDbName: Z })
1199
+ ...$.data.map(
1200
+ ({ locationDbName: te, ...V }) => ({ ...V, _locationDbName: te })
1184
1201
  )
1185
- ), d.value = [...r].sort((Z, U) => U._id.localeCompare(Z._id)), M.value = A.failed, be.value = A.cursor, Q = A.hasNext, q = A.cursor;
1202
+ ), d.value = [...r].sort((te, V) => V._id.localeCompare(te._id)), z.value = $.failed, pe.value = $.cursor, Q = $.hasNext, N = $.cursor;
1186
1203
  }
1187
1204
  }
1188
1205
  async function Ee() {
1189
1206
  const r = d.value.flatMap((u) => u.shipmentIds || []).filter(Boolean);
1190
- i.value = r.length > 0 ? await de.getShipmentsByIds(r) : [];
1207
+ i.value = r.length > 0 ? await fe.getShipmentsByIds(r) : [];
1191
1208
  }
1192
- async function me(r) {
1209
+ async function ve(r) {
1193
1210
  const u = r.map((b) => {
1194
1211
  var T;
1195
1212
  return ((T = b.request) == null ? void 0 : T.id) ?? "";
1196
1213
  }).filter((b) => b);
1197
- C.value = u.length > 0 ? await V.readRequestByIds(u) : [];
1214
+ _.value = u.length > 0 ? await U.readRequestByIds(u) : [];
1198
1215
  }
1199
1216
  const ge = 25;
1200
- async function $e() {
1201
- if (d.value = [], i.value = [], M.value = [], be.value = void 0, f.value.length === 0)
1217
+ async function Ae() {
1218
+ if (d.value = [], i.value = [], z.value = [], pe.value = void 0, f.value.length === 0)
1202
1219
  return;
1203
1220
  if (f.value.length > ge) {
1204
1221
  l.open({
@@ -1208,17 +1225,17 @@ function Cs(_) {
1208
1225
  });
1209
1226
  return;
1210
1227
  }
1211
- ve();
1228
+ de();
1212
1229
  const r = new AbortController();
1213
- ne = r, c.value = !0;
1230
+ ee = r, c.value = !0;
1214
1231
  try {
1215
- await Ae([], {}, r.signal), M.value.length > 0 && l.open({
1232
+ await $e([], {}, r.signal), z.value.length > 0 && l.open({
1216
1233
  title: "Some locations failed to load",
1217
- message: `Purchase orders could not be loaded for ${M.value.length} location(s)`,
1234
+ message: `Purchase orders could not be loaded for ${z.value.length} location(s)`,
1218
1235
  type: "error"
1219
1236
  }), await Ee();
1220
1237
  const b = await R.readCurrentLocationLastClosing(!0), T = b == null ? void 0 : b._id;
1221
- T && (N.value = Sn(T)), await O.awaitFeatureLoaded(() => O.mustUsePoTemplate) && await $.fetchTemplates();
1238
+ T && (q.value = Pn(T)), await A.awaitFeatureLoaded(() => A.mustUsePoTemplate) && await O.fetchTemplates();
1222
1239
  } catch (u) {
1223
1240
  if (r.signal.aborted) return;
1224
1241
  l.open({
@@ -1228,17 +1245,17 @@ function Cs(_) {
1228
1245
  type: "error"
1229
1246
  });
1230
1247
  } finally {
1231
- ne === r && (ne = null, c.value = !1, ue.value = null);
1248
+ ee === r && (ee = null, c.value = !1, se.value = null);
1232
1249
  }
1233
1250
  }
1234
1251
  async function Fe() {
1235
- if (!be.value || !M.value.some((u) => u.retryable)) return;
1236
- ve();
1252
+ if (!pe.value || !z.value.some((u) => u.retryable)) return;
1253
+ de();
1237
1254
  const r = new AbortController();
1238
- ne = r, he.value = !0;
1255
+ ee = r, G.value = !0;
1239
1256
  try {
1240
1257
  const u = [...d.value];
1241
- if (await Ae(u, { cursor: be.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
1258
+ if (await $e(u, { cursor: pe.value, retryFailed: !0 }, r.signal), r.signal.aborted) return;
1242
1259
  await Ee();
1243
1260
  } catch (u) {
1244
1261
  if (r.signal.aborted) return;
@@ -1248,34 +1265,34 @@ function Cs(_) {
1248
1265
  type: "error"
1249
1266
  });
1250
1267
  } finally {
1251
- ne === r && (ne = null, he.value = !1, ue.value = null);
1268
+ ee === r && (ee = null, G.value = !1, se.value = null);
1252
1269
  }
1253
1270
  }
1254
- function Ge(r, u) {
1255
- o.value = { startDate: r, endDate: u }, $e();
1271
+ function Xe(r, u) {
1272
+ o.value = { startDate: r, endDate: u }, Ae();
1256
1273
  }
1257
- const qe = k();
1274
+ const qe = C();
1258
1275
  async function Oe(r) {
1259
1276
  const u = f.value[0];
1260
1277
  if (u) {
1261
- const I = w.locations.find((q) => q.dbName === u);
1262
- I && (w._currentLocation = I);
1278
+ const I = k.locations.find((N) => N.dbName === u);
1279
+ I && (k._currentLocation = I);
1263
1280
  }
1264
1281
  function b(I) {
1265
- const q = {
1266
- mode: _t.CREATE,
1282
+ const N = {
1283
+ mode: xt.CREATE,
1267
1284
  modelValue: r || void 0,
1268
1285
  show: !0,
1269
1286
  "onUpdate:show"(W) {
1270
- et.value.show = W;
1287
+ tt.value.show = W;
1271
1288
  },
1272
1289
  templateId: I,
1273
- lastClosingDate: N.value
1290
+ lastClosingDate: q.value
1274
1291
  };
1275
- et.value = q;
1292
+ tt.value = N;
1276
1293
  }
1277
1294
  let T;
1278
- O.mustUsePoTemplate && !(r != null && r.template) ? h.open({
1295
+ A.mustUsePoTemplate && !(r != null && r.template) ? h.open({
1279
1296
  title: "Create transfer",
1280
1297
  message: "",
1281
1298
  primaryActions: { text: "Select a template", close: !0 },
@@ -1286,84 +1303,84 @@ function Cs(_) {
1286
1303
  b(void 0);
1287
1304
  }) : b(T);
1288
1305
  }
1289
- const Se = Pn();
1306
+ const Se = qn();
1290
1307
  async function P(r, u) {
1291
- return r.items != null ? r : await V.getPurchaseOrderById(r._id, void 0, u);
1308
+ return r.items != null ? r : await U.getPurchaseOrderById(r._id, void 0, u);
1292
1309
  }
1293
1310
  async function F(r) {
1294
1311
  await Se.run(async (u) => {
1295
- _e(r);
1312
+ xe(r);
1296
1313
  const b = await P(r, u), T = {
1297
- mode: _t.UPDATE,
1298
- modelValue: Vt(b),
1314
+ mode: xt.UPDATE,
1315
+ modelValue: jt(b),
1299
1316
  show: !0,
1300
1317
  "onUpdate:show"(I) {
1301
- et.value.show = I;
1318
+ tt.value.show = I;
1302
1319
  },
1303
- lastClosingDate: N.value
1320
+ lastClosingDate: q.value
1304
1321
  };
1305
- et.value = T;
1322
+ tt.value = T;
1306
1323
  });
1307
1324
  }
1308
1325
  async function B(r) {
1309
- var Q, A, Z;
1310
- if (_e(r), !z.currentBusiness.value) return;
1326
+ var Q, $, te;
1327
+ if (xe(r), !M.currentBusiness.value) return;
1311
1328
  const u = r, b = S.supplierById[r.supplier._id], T = (b == null ? void 0 : b.email) ?? ((Q = r.supplier) == null ? void 0 : Q.email) ?? "";
1312
1329
  let I = null;
1313
- pe.value = {
1330
+ be.value = {
1314
1331
  recipientName: b == null ? void 0 : b.name,
1315
1332
  email: T,
1316
- business: z.currentBusiness.value,
1333
+ business: M.currentBusiness.value,
1317
1334
  pdfLoading: !0,
1318
1335
  show: !0,
1319
- "onUpdate:show"(U) {
1320
- !U && I && (URL.revokeObjectURL(I), I = null), pe.value && (pe.value = { ...pe.value, show: U });
1336
+ "onUpdate:show"(V) {
1337
+ !V && I && (URL.revokeObjectURL(I), I = null), be.value && (be.value = { ...be.value, show: V });
1321
1338
  }
1322
1339
  };
1323
- const q = await Se.run((U) => P(u, U));
1324
- if (!q) {
1325
- pe.value && (pe.value = { ...pe.value, show: !1, pdfLoading: !1 });
1340
+ const N = await Se.run((V) => P(u, V));
1341
+ if (!N) {
1342
+ be.value && (be.value = { ...be.value, show: !1, pdfLoading: !1 });
1326
1343
  return;
1327
1344
  }
1328
- const W = q._rev;
1345
+ const W = N._rev;
1329
1346
  try {
1330
- let U = await V.getPurchaseOrderPdf(r._id, u._locationDbName, W);
1331
- "pending" in U && (await v.waitForPdfJob(U.jobId, u._locationDbName), U = await V.getPurchaseOrderPdf(r._id, u._locationDbName, W));
1332
- const re = URL.createObjectURL(U);
1333
- (A = pe.value) != null && A.show ? (I = re, pe.value = {
1334
- ...pe.value,
1335
- pdfBlobUrl: re,
1347
+ let V = await U.getPurchaseOrderPdf(r._id, u._locationDbName, W);
1348
+ "pending" in V && (await p.waitForPdfJob(V.jobId, u._locationDbName), V = await U.getPurchaseOrderPdf(r._id, u._locationDbName, W));
1349
+ const ie = URL.createObjectURL(V);
1350
+ ($ = be.value) != null && $.show ? (I = ie, be.value = {
1351
+ ...be.value,
1352
+ pdfBlobUrl: ie,
1336
1353
  pdfLoading: !1
1337
- }) : URL.revokeObjectURL(re);
1338
- } catch (U) {
1339
- console.error("[promptEmailDialog] PDF fetch failed:", U), (Z = pe.value) != null && Z.show && (pe.value = { ...pe.value, pdfLoading: !1 }, l.open({
1354
+ }) : URL.revokeObjectURL(ie);
1355
+ } catch (V) {
1356
+ console.error("[promptEmailDialog] PDF fetch failed:", V), (te = be.value) != null && te.show && (be.value = { ...be.value, pdfLoading: !1 }, l.open({
1340
1357
  title: g("inventory.common.somethingWentWrong"),
1341
- message: (U == null ? void 0 : U.message) || g("inventory.common.tryAgain"),
1358
+ message: g("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
1342
1359
  type: "error"
1343
1360
  }));
1344
1361
  }
1345
1362
  }
1346
1363
  async function K(r) {
1347
- if (_e(r), r.items != null)
1364
+ if (xe(r), r.items != null)
1348
1365
  return r;
1349
1366
  try {
1350
- return { ...await V.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
1367
+ return { ...await U.getPurchaseOrderById(r._id), _locationDbName: r._locationDbName };
1351
1368
  } catch (u) {
1352
1369
  throw console.error(`Failed to hydrate PO ${r._id} for action`, u), u;
1353
1370
  }
1354
1371
  }
1355
- async function G(r, u) {
1372
+ async function X(r, u) {
1356
1373
  var W;
1357
- _e(r);
1374
+ xe(r);
1358
1375
  const b = await Se.run((Q) => P(r, Q));
1359
1376
  if (!b) return;
1360
1377
  if (u === void 0 && ((W = r.request) != null && W.id))
1361
1378
  try {
1362
- u = await V.getLatestPurchaseOrderRequest(r._id);
1379
+ u = await U.getLatestPurchaseOrderRequest(r._id);
1363
1380
  } catch (Q) {
1364
1381
  console.warn("[transfer-details] POR fetch failed for", r._id, Q);
1365
1382
  }
1366
- const I = De(r), q = {
1383
+ const I = De(r), N = {
1367
1384
  poRequest: u,
1368
1385
  purchaseOrder: b,
1369
1386
  transferTo: I == null ? void 0 : I.name,
@@ -1374,21 +1391,21 @@ function Cs(_) {
1374
1391
  "onUpdate:show"(Q) {
1375
1392
  qe.value && (qe.value = { ...qe.value, show: Q });
1376
1393
  },
1377
- scope: kt.RECEIVE_REQUEST,
1378
- receivedMap: Gt(b) ?? {},
1394
+ scope: Ft.RECEIVE_REQUEST,
1395
+ receivedMap: Zt(b) ?? {},
1379
1396
  shipments: i.value
1380
1397
  };
1381
- qe.value = q;
1398
+ qe.value = N;
1382
1399
  }
1383
- async function ee(r, u, b, T, I) {
1384
- const q = Xt();
1400
+ async function ne(r, u, b, T, I) {
1401
+ const N = en();
1385
1402
  c.value = !0;
1386
1403
  try {
1387
- await q({
1404
+ await N({
1388
1405
  operate: {
1389
1406
  operation: u,
1390
1407
  doc: r,
1391
- options: (u === Ye.enum.confirmDraft || u === Ye.enum.completeReceive) && O.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
1408
+ options: (u === Ye.enum.confirmDraft || u === Ye.enum.completeReceive) && A.autoReceiveWarehouse ? { autoReceive: !0 } : void 0
1392
1409
  },
1393
1410
  operateV2: {
1394
1411
  _id: r._id,
@@ -1405,49 +1422,49 @@ function Cs(_) {
1405
1422
  type: "error"
1406
1423
  }), console.error("Error when submitting PO operation", u, r, W);
1407
1424
  } finally {
1408
- c.value = !1, $e();
1425
+ c.value = !1, Ae();
1409
1426
  }
1410
1427
  }
1411
1428
  async function Re(r, u, b) {
1412
- _e(r);
1413
- const T = Ht[u];
1429
+ xe(r);
1430
+ const T = Kt[u];
1414
1431
  if (!T) {
1415
1432
  l.open({
1416
1433
  title: "Something went wrong",
1417
- message: `Cannot process order: ${Mt(u)}`,
1434
+ message: `Cannot process order: ${Vt(u)}`,
1418
1435
  type: "error"
1419
1436
  });
1420
1437
  return;
1421
1438
  }
1422
- const { successMessage: I, ...q } = T;
1439
+ const { successMessage: I, ...N } = T;
1423
1440
  if (u === Ye.enum.rejectDraft) {
1424
- let A = "";
1441
+ let $ = "";
1425
1442
  h.open({
1426
- title: q.title,
1427
- message: q.message,
1428
- primaryActions: q.primaryActions,
1429
- contentComponent: Qt,
1443
+ title: N.title,
1444
+ message: N.message,
1445
+ primaryActions: N.primaryActions,
1446
+ contentComponent: Gt,
1430
1447
  contentComponentProps: {
1431
- message: q.message,
1432
- onChange: (Z) => A = Z
1448
+ message: N.message,
1449
+ onChange: (te) => $ = te
1433
1450
  }
1434
1451
  }).onPrimary(() => {
1435
- ee(r, u, I, b, [
1436
- { action: "rejectDraft", payload: { rejectReason: A } }
1452
+ ne(r, u, I, b, [
1453
+ { action: "rejectDraft", payload: { rejectReason: $ } }
1437
1454
  ]);
1438
1455
  });
1439
1456
  return;
1440
1457
  }
1441
- const W = [], Q = Kt();
1458
+ const W = [], Q = Xt();
1442
1459
  Q.init(r), (u === Ye.enum.confirmDraft || u === Ye.enum.submitRequest) && W.push({
1443
1460
  action: "confirmDraft",
1444
- payload: Q.controller.value.toConfirmDraftData(Ut())
1461
+ payload: Q.controller.value.toConfirmDraftData(Jt())
1445
1462
  }), h.open({
1446
- title: q.title,
1447
- message: q.message,
1448
- primaryActions: q.primaryActions
1463
+ title: N.title,
1464
+ message: N.message,
1465
+ primaryActions: N.primaryActions
1449
1466
  }).onPrimary(() => {
1450
- ee(
1467
+ ne(
1451
1468
  r,
1452
1469
  u,
1453
1470
  I,
@@ -1474,11 +1491,11 @@ function Cs(_) {
1474
1491
  async function j() {
1475
1492
  const { start: r, end: u } = H.value;
1476
1493
  return (await Promise.allSettled(
1477
- f.value.map(async (T) => (await V.getPurchaseOrders({ start: r, end: u, dbName: T })).map((q) => ({ ...q, _locationDbName: T })))
1494
+ f.value.map(async (T) => (await U.getPurchaseOrders({ start: r, end: u, dbName: T })).map((N) => ({ ...N, _locationDbName: T })))
1478
1495
  )).flatMap((T) => T.status === "fulfilled" ? T.value : []);
1479
1496
  }
1480
- async function ae(r) {
1481
- return v.activeJobs.find((b) => b.type === r) ? new Promise((b) => {
1497
+ async function le(r) {
1498
+ return p.activeJobs.find((b) => b.type === r) ? new Promise((b) => {
1482
1499
  h.open({
1483
1500
  title: g("inventory.transfer.receiveRequest.bulk.activeJobWarningTitle"),
1484
1501
  message: g("inventory.transfer.receiveRequest.bulk.activeJobWarningMsg", [r]),
@@ -1488,7 +1505,7 @@ function Cs(_) {
1488
1505
  }) : !0;
1489
1506
  }
1490
1507
  async function Be(r) {
1491
- if (!await ae("download")) return;
1508
+ if (!await le("download")) return;
1492
1509
  const { startDate: u, endDate: b } = o.value;
1493
1510
  if (He(b).diff(He(u), "month", !0) > 2) {
1494
1511
  l.open({
@@ -1506,15 +1523,15 @@ function Cs(_) {
1506
1523
  });
1507
1524
  return;
1508
1525
  }
1509
- const T = r.map((q) => {
1510
- var U;
1511
- const Q = (((U = w.locations.find((re) => re.dbName === q._locationDbName)) == null ? void 0 : U.name) || q._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), A = `PO_${q.seqNumber || q._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), Z = `${Q}/${A}`;
1512
- return { poId: q._id, dbName: q._locationDbName, filename: Z, rev: q._rev };
1526
+ const T = r.map((N) => {
1527
+ var V;
1528
+ const Q = (((V = k.locations.find((ie) => ie.dbName === N._locationDbName)) == null ? void 0 : V.name) || N._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), $ = `PO_${N.seqNumber || N._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), te = `${Q}/${$}`;
1529
+ return { poId: N._id, dbName: N._locationDbName, filename: te, rev: N._rev };
1513
1530
  }), I = f.value[0];
1514
1531
  try {
1515
- const { jobId: q, fromCache: W } = await V.enqueueBulkDownload(I, { items: T });
1516
- v.addJob({
1517
- jobId: q,
1532
+ const { jobId: N, fromCache: W } = await U.enqueueBulkDownload(I, { items: T });
1533
+ p.addJob({
1534
+ jobId: N,
1518
1535
  type: "download",
1519
1536
  dbName: I,
1520
1537
  title: `Download All (${r.length} POs)`,
@@ -1533,8 +1550,8 @@ function Cs(_) {
1533
1550
  message: g("inventory.transfer.receiveRequest.bulk.downloadQueued"),
1534
1551
  type: "success"
1535
1552
  });
1536
- } catch (q) {
1537
- console.error("Bulk download enqueue failed", q), l.open({
1553
+ } catch (N) {
1554
+ console.error("Bulk download enqueue failed", N), l.open({
1538
1555
  title: g("inventory.transfer.receiveRequest.bulk.downloadError"),
1539
1556
  message: g("inventory.transfer.receiveRequest.bulk.downloadErrorMsg"),
1540
1557
  type: "error"
@@ -1543,12 +1560,12 @@ function Cs(_) {
1543
1560
  }
1544
1561
  async function Te(r) {
1545
1562
  var Me, je, We;
1546
- if (!await ae("email")) return;
1563
+ if (!await le("email")) return;
1547
1564
  const u = [
1548
1565
  gt.enum.RECEIVING,
1549
1566
  gt.enum.PROCESSING
1550
1567
  // PARTIAL_RECEIVED display status maps from PROCESSING
1551
- ], b = r.filter((x) => u.includes(x.status));
1568
+ ], b = r.filter((w) => u.includes(w.status));
1552
1569
  if (b.length === 0) {
1553
1570
  l.open({
1554
1571
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
@@ -1557,58 +1574,58 @@ function Cs(_) {
1557
1574
  });
1558
1575
  return;
1559
1576
  }
1560
- if (!((Me = z.currentBusiness.value) != null && Me._id)) return;
1561
- await me(b);
1562
- const T = mn(), I = yn(), q = /* @__PURE__ */ new Map(), W = w.locations.map((x) => x.dbName), Q = `business_${z.currentBusiness.value._id}`, A = [.../* @__PURE__ */ new Set([...W, Q])];
1577
+ if (!((Me = M.currentBusiness.value) != null && Me._id)) return;
1578
+ await ve(b);
1579
+ const T = pn(), I = hn(), N = /* @__PURE__ */ new Map(), W = k.locations.map((w) => w.dbName), Q = `business_${M.currentBusiness.value._id}`, $ = [.../* @__PURE__ */ new Set([...W, Q])];
1563
1580
  await Promise.allSettled(
1564
- A.map(async (x) => {
1581
+ $.map(async (w) => {
1565
1582
  try {
1566
- (await I.readSuppliersByDbName(x)).forEach((ie) => {
1567
- const ce = q.get(ie._id);
1568
- (!ce || !ce.email && ie.email) && q.set(ie._id, ie);
1583
+ (await I.readSuppliersByDbName(w)).forEach((ce) => {
1584
+ const me = N.get(ce._id);
1585
+ (!me || !me.email && ce.email) && N.set(ce._id, ce);
1569
1586
  });
1570
- } catch (oe) {
1571
- console.warn("[emailAll] fetch failed for", x, oe);
1587
+ } catch (ae) {
1588
+ console.warn("[emailAll] fetch failed for", w, ae);
1572
1589
  }
1573
1590
  })
1574
1591
  );
1575
- function Z(x) {
1576
- var ie;
1577
- const oe = q.get(x.supplier._id);
1578
- return (oe == null ? void 0 : oe.email) || ((ie = x.supplier) == null ? void 0 : ie.email);
1579
- }
1580
- const U = [], re = [];
1581
- for (const x of b)
1582
- Z(x) ? U.push(x) : re.push(x);
1583
- const Je = xe(
1592
+ function te(w) {
1593
+ var ce;
1594
+ const ae = N.get(w.supplier._id);
1595
+ return (ae == null ? void 0 : ae.email) || ((ce = w.supplier) == null ? void 0 : ce.email);
1596
+ }
1597
+ const V = [], ie = [];
1598
+ for (const w of b)
1599
+ te(w) ? V.push(w) : ie.push(w);
1600
+ const Je = _e(
1584
1601
  "p",
1585
1602
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1586
1603
  g("inventory.transfer.receiveRequest.bulk.emailAllowedStatusInfo")
1587
1604
  );
1588
- if (re.length > 0) {
1589
- const x = /* @__PURE__ */ new Map();
1590
- for (const ce of re) {
1591
- const n = ce.supplier._id;
1592
- x.has(n) || x.set(n, { supplierName: ce.supplier.name, pos: [] }), x.get(n).pos.push(ce);
1605
+ if (ie.length > 0) {
1606
+ const w = /* @__PURE__ */ new Map();
1607
+ for (const me of ie) {
1608
+ const n = me.supplier._id;
1609
+ w.has(n) || w.set(n, { supplierName: me.supplier.name, pos: [] }), w.get(n).pos.push(me);
1593
1610
  }
1594
- const oe = xe("div", { class: "flex flex-col gap-12" }, [
1611
+ const ae = _e("div", { class: "flex flex-col gap-12" }, [
1595
1612
  Je,
1596
- xe(
1613
+ _e(
1597
1614
  "p",
1598
1615
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1599
- g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [re.length])
1616
+ g("inventory.transfer.receiveRequest.bulk.missingEmailMsg", [ie.length])
1600
1617
  ),
1601
- xe(
1618
+ _e(
1602
1619
  "div",
1603
1620
  { class: "flex flex-col gap-4 max-h-[320px] overflow-y-auto rounded-md border border-fm-color-neutral-gray-100 p-8" },
1604
- [...x.values()].map(
1605
- ({ supplierName: ce, pos: n }) => xe("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
1606
- xe("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, ce),
1607
- xe(
1621
+ [...w.values()].map(
1622
+ ({ supplierName: me, pos: n }) => _e("div", { class: "flex flex-col gap-2 py-6 border-b border-fm-color-neutral-gray-100 last:border-0" }, [
1623
+ _e("div", { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, me),
1624
+ _e(
1608
1625
  "div",
1609
1626
  { class: "flex flex-wrap gap-4" },
1610
1627
  n.map(
1611
- (a) => xe("span", {
1628
+ (a) => _e("span", {
1612
1629
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded px-6 py-2"
1613
1630
  }, `PO #${a.seqNumber ?? a._id}`)
1614
1631
  )
@@ -1616,52 +1633,52 @@ function Cs(_) {
1616
1633
  ])
1617
1634
  )
1618
1635
  ),
1619
- xe(
1636
+ _e(
1620
1637
  "p",
1621
1638
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1622
- g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [U.length, b.length])
1639
+ g("inventory.transfer.receiveRequest.bulk.emailWillSendCount", [V.length, b.length])
1623
1640
  ),
1624
- xe(
1641
+ _e(
1625
1642
  "p",
1626
1643
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
1627
1644
  g("inventory.transfer.receiveRequest.bulk.missingEmailConfirm")
1628
1645
  )
1629
1646
  ]);
1630
- if (!await new Promise((ce) => {
1647
+ if (!await new Promise((me) => {
1631
1648
  h.open({
1632
1649
  title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1633
- contentComponent: oe,
1650
+ contentComponent: ae,
1634
1651
  contentComponentProps: {},
1635
1652
  primaryActions: {
1636
1653
  text: g("inventory.transfer.receiveRequest.bulk.skipAndContinue"),
1637
1654
  close: !0
1638
1655
  },
1639
1656
  secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1640
- }).onPrimary(() => ce(!0)).onSecondary(() => ce(!1));
1657
+ }).onPrimary(() => me(!0)).onSecondary(() => me(!1));
1641
1658
  })) return;
1642
1659
  } else {
1643
- const x = xe("div", { class: "flex flex-col gap-12" }, [
1660
+ const w = _e("div", { class: "flex flex-col gap-12" }, [
1644
1661
  Je,
1645
- xe(
1662
+ _e(
1646
1663
  "p",
1647
1664
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1648
- g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [U.length])
1665
+ g("inventory.transfer.receiveRequest.bulk.emailAllConfirmMsg", [V.length])
1649
1666
  )
1650
1667
  ]);
1651
- if (!await new Promise((ie) => {
1668
+ if (!await new Promise((ce) => {
1652
1669
  h.open({
1653
1670
  title: g("inventory.transfer.receiveRequest.bulk.missingEmailTitle"),
1654
- contentComponent: x,
1671
+ contentComponent: w,
1655
1672
  contentComponentProps: {},
1656
1673
  primaryActions: {
1657
1674
  text: g("inventory.transfer.receiveRequest.bulk.emailConfirm"),
1658
1675
  close: !0
1659
1676
  },
1660
1677
  secondaryActions: { text: g("inventory.common.cancel"), close: !0 }
1661
- }).onPrimary(() => ie(!0)).onSecondary(() => ie(!1));
1678
+ }).onPrimary(() => ce(!0)).onSecondary(() => ce(!1));
1662
1679
  })) return;
1663
1680
  }
1664
- if (U.length === 0) {
1681
+ if (V.length === 0) {
1665
1682
  l.open({
1666
1683
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1667
1684
  message: g("inventory.transfer.receiveRequest.bulk.noEmailsToSend"),
@@ -1671,7 +1688,7 @@ function Cs(_) {
1671
1688
  }
1672
1689
  let Ie = [];
1673
1690
  try {
1674
- Ie = await T.getEmailList(z.currentBusiness.value._id);
1691
+ Ie = await T.getEmailList(M.currentBusiness.value._id);
1675
1692
  } catch {
1676
1693
  l.open({
1677
1694
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
@@ -1680,7 +1697,7 @@ function Cs(_) {
1680
1697
  });
1681
1698
  return;
1682
1699
  }
1683
- const Le = Ie.find((x) => x.verified);
1700
+ const Le = Ie.find((w) => w.verified);
1684
1701
  if (!Le) {
1685
1702
  l.open({
1686
1703
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
@@ -1690,34 +1707,34 @@ function Cs(_) {
1690
1707
  return;
1691
1708
  }
1692
1709
  const Ne = /* @__PURE__ */ new Map();
1693
- for (const x of U) {
1694
- const oe = Z(x);
1695
- if (!oe) continue;
1696
- const ce = (((je = w.locations.find((X) => X.dbName === x._locationDbName)) == null ? void 0 : je.name) || x._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), n = `PO_${x.seqNumber || x._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), a = { poId: x._id, dbName: x._locationDbName, filename: `${ce}/${n}` }, s = Ne.get(oe);
1697
- s ? (s.pos.push(a), s.seqNumbers.push(x.seqNumber ?? x._id)) : Ne.set(oe, {
1698
- recipientName: x.supplier.name,
1699
- recipientEmail: oe,
1710
+ for (const w of V) {
1711
+ const ae = te(w);
1712
+ if (!ae) continue;
1713
+ const me = (((je = k.locations.find((Z) => Z.dbName === w._locationDbName)) == null ? void 0 : je.name) || w._locationDbName).replace(/[/\\?%*:|"<>]/g, "-").trim().slice(0, 50), n = `PO_${w.seqNumber || w._id}`.replace(/[/\\?%*:|"<>]/g, "-").slice(0, 50), a = { poId: w._id, dbName: w._locationDbName, filename: `${me}/${n}` }, s = Ne.get(ae);
1714
+ s ? (s.pos.push(a), s.seqNumbers.push(w.seqNumber ?? w._id)) : Ne.set(ae, {
1715
+ recipientName: w.supplier.name,
1716
+ recipientEmail: ae,
1700
1717
  pos: [a],
1701
- seqNumbers: [x.seqNumber ?? x._id]
1718
+ seqNumbers: [w.seqNumber ?? w._id]
1702
1719
  });
1703
1720
  }
1704
- const ke = [...Ne.values()].map((x) => ({
1705
- subject: x.pos.length > 1 ? `Purchase Orders (${x.pos.length})` : `Purchase Order #${x.seqNumbers[0]}`,
1706
- recipientName: x.recipientName,
1707
- recipientEmail: x.recipientEmail,
1708
- pos: x.pos
1721
+ const ke = [...Ne.values()].map((w) => ({
1722
+ subject: w.pos.length > 1 ? `Purchase Orders (${w.pos.length})` : `Purchase Order #${w.seqNumbers[0]}`,
1723
+ recipientName: w.recipientName,
1724
+ recipientEmail: w.recipientEmail,
1725
+ pos: w.pos
1709
1726
  })), ze = f.value[0];
1710
1727
  try {
1711
- const { jobId: x } = await V.enqueueBulkEmail(ze, {
1728
+ const { jobId: w } = await U.enqueueBulkEmail(ze, {
1712
1729
  senderEmail: Le.emailAddress,
1713
- senderName: Le.name || ((We = z.currentBusiness.value) == null ? void 0 : We.name) || "FeedMe Inventory",
1730
+ senderName: Le.name || ((We = M.currentBusiness.value) == null ? void 0 : We.name) || "FeedMe Inventory",
1714
1731
  items: ke
1715
1732
  });
1716
- v.addJob({
1717
- jobId: x,
1733
+ p.addJob({
1734
+ jobId: w,
1718
1735
  type: "email",
1719
1736
  dbName: ze,
1720
- title: `Email All (${ke.length} supplier${ke.length === 1 ? "" : "s"}, ${U.length} POs)`,
1737
+ title: `Email All (${ke.length} supplier${ke.length === 1 ? "" : "s"}, ${V.length} POs)`,
1721
1738
  status: "waiting",
1722
1739
  progress: 0,
1723
1740
  current: 0,
@@ -1729,8 +1746,8 @@ function Cs(_) {
1729
1746
  message: g("inventory.transfer.receiveRequest.bulk.emailQueued"),
1730
1747
  type: "success"
1731
1748
  });
1732
- } catch (x) {
1733
- console.error("Bulk email enqueue failed", x), l.open({
1749
+ } catch (w) {
1750
+ console.error("Bulk email enqueue failed", w), l.open({
1734
1751
  title: g("inventory.transfer.receiveRequest.bulk.emailSendError"),
1735
1752
  message: g("inventory.transfer.receiveRequest.bulk.emailErrorMsg"),
1736
1753
  type: "error"
@@ -1741,60 +1758,60 @@ function Cs(_) {
1741
1758
  selectedLocationDbNames: f,
1742
1759
  purchaseOrders: d,
1743
1760
  shipments: i,
1744
- purchaseRequests: C,
1761
+ purchaseRequests: _,
1745
1762
  rowAction: Se,
1746
- updateDateRange: Ge,
1747
- fetchData: $e,
1748
- failedLocations: M,
1763
+ updateDateRange: Xe,
1764
+ fetchData: Ae,
1765
+ failedLocations: z,
1749
1766
  retryFailedLocations: Fe,
1750
- retryingFailed: he,
1751
- fetchProgress: ue,
1752
- abortOngoingBrowse: ve,
1767
+ retryingFailed: G,
1768
+ fetchProgress: se,
1769
+ abortOngoingBrowse: de,
1753
1770
  fetchFullPurchaseOrders: j,
1754
1771
  loading: c,
1755
- transferDialogProps: et,
1772
+ transferDialogProps: tt,
1756
1773
  promptCreateTransferDialog: Oe,
1757
1774
  promptUpdateTransferDialog: F,
1758
1775
  transferDetailsProps: qe,
1759
- promptShowTransferDetails: G,
1776
+ promptShowTransferDetails: X,
1760
1777
  resolvePO: K,
1761
1778
  submitAction: Re,
1762
1779
  xilnexImportDialogProps: dt,
1763
1780
  promptUploadTransferDialog: we,
1764
- emailDialogProps: pe,
1781
+ emailDialogProps: be,
1765
1782
  promptEmailDialog: B,
1766
1783
  downloadAll: Be,
1767
1784
  emailAll: Te,
1768
- lastClosingDate: N
1785
+ lastClosingDate: q
1769
1786
  };
1770
1787
  }
1771
- function Fs(_, h, w) {
1772
- const O = _._locationDbName;
1773
- if (!O) return null;
1774
- const S = h.find((z) => z.dbName === O);
1788
+ function Ps(x, h, k) {
1789
+ const A = x._locationDbName;
1790
+ if (!A) return null;
1791
+ const S = h.find((M) => M.dbName === A);
1775
1792
  if (!S) return null;
1776
1793
  if (S.type === "restaurant") {
1777
- const z = w(S.doc._id);
1778
- if (z !== null) return { ...S, doc: z };
1794
+ const M = k(S.doc._id);
1795
+ if (M !== null) return { ...S, doc: M };
1779
1796
  }
1780
1797
  return S;
1781
1798
  }
1782
- function Ss(_, h) {
1783
- return h.find((w) => w.purchaseOrderId === _._id);
1799
+ function Ds(x, h) {
1800
+ return h.find((k) => k.purchaseOrderId === x._id);
1784
1801
  }
1785
- function Rs(_, h) {
1786
- const w = it(), { t: O } = nt(), S = Ke(), z = ut(), Y = pt(), $ = k(!1), c = k(!1), l = k(null);
1787
- async function g(v, f) {
1788
- if (v !== at.PrintPdf) return !1;
1789
- const i = f._locationDbName, C = f._rev;
1790
- l.value && (URL.revokeObjectURL(l.value), l.value = null), c.value = !0, $.value = !0;
1802
+ function Es(x, h) {
1803
+ const k = it(), { t: A } = ot(), S = Ge(), M = ut(), Y = pt(), O = C(!1), c = C(!1), l = C(null);
1804
+ async function g(p, f) {
1805
+ if (p !== rt.PrintPdf) return !1;
1806
+ const i = f._locationDbName, _ = f._rev;
1807
+ l.value && (URL.revokeObjectURL(l.value), l.value = null), c.value = !0, O.value = !0;
1791
1808
  try {
1792
- let o = await S.getPurchaseOrderPdf(f._id, i, C);
1793
- "pending" in o && (await Y.waitForPdfJob(o.jobId, i), o = await S.getPurchaseOrderPdf(f._id, i, C)), l.value = URL.createObjectURL(o);
1794
- } catch (o) {
1795
- $.value = !1, z.open({
1796
- title: O("inventory.common.somethingWentWrong"),
1797
- message: (o == null ? void 0 : o.message) || O("inventory.common.tryAgain"),
1809
+ let o = await S.getPurchaseOrderPdf(f._id, i, _);
1810
+ "pending" in o && (await Y.waitForPdfJob(o.jobId, i), o = await S.getPurchaseOrderPdf(f._id, i, _)), l.value = URL.createObjectURL(o);
1811
+ } catch {
1812
+ O.value = !1, M.open({
1813
+ title: A("inventory.common.somethingWentWrong"),
1814
+ message: A("inventory.transfer.receiveRequest.bulk.pdfUnavailableMsg"),
1798
1815
  type: "error"
1799
1816
  });
1800
1817
  } finally {
@@ -1802,104 +1819,104 @@ function Rs(_, h) {
1802
1819
  }
1803
1820
  return !0;
1804
1821
  }
1805
- const V = Zt(
1806
- kt.RECEIVE_REQUEST,
1807
- _,
1822
+ const U = tn(
1823
+ Ft.RECEIVE_REQUEST,
1824
+ x,
1808
1825
  h,
1809
1826
  {
1810
1827
  // Bulk rows are summaries (no items) — print needs the full doc from the
1811
1828
  // row's own location db, independent of the global current location.
1812
1829
  // Runs behind the shared cancellable loading state; undefined (failed or
1813
1830
  // cancelled) becomes null, which aborts the print.
1814
- fetchFullPo: async (v) => {
1815
- const f = v._locationDbName;
1816
- return await _.rowAction.run(
1817
- (i) => S.getPurchaseOrderById(v._id, f, i)
1831
+ fetchFullPo: async (p) => {
1832
+ const f = p._locationDbName;
1833
+ return await x.rowAction.run(
1834
+ (i) => S.getPurchaseOrderById(p._id, f, i)
1818
1835
  ) ?? null;
1819
1836
  },
1820
- resolveLocation: (v) => Fs(
1821
- v,
1822
- w.locations,
1823
- w.locationRestaurantFromCore
1837
+ resolveLocation: (p) => Ps(
1838
+ p,
1839
+ k.locations,
1840
+ k.locationRestaurantFromCore
1824
1841
  ),
1825
- resolvePurchaseRequest: (v) => Ss(v, _.purchaseRequests.value),
1842
+ resolvePurchaseRequest: (p) => Ds(p, x.purchaseRequests.value),
1826
1843
  // Exclude both legacy Print and Print (Beta) — the bulk listing uses
1827
1844
  // Lambda-generated PDF via PrintPdf instead.
1828
- excludeRowActions: [at.Print, at.PrintCustom],
1845
+ excludeRowActions: [rt.Print, rt.PrintCustom],
1829
1846
  // Inject the Lambda PDF print action into every row's context menu.
1830
- appendRowActions: () => [Dn[at.PrintPdf]],
1847
+ appendRowActions: () => [Nn[rt.PrintPdf]],
1831
1848
  // Handle the PrintPdf action before the default handler runs.
1832
- onCustomAction: (v, f) => g(v, f)
1849
+ onCustomAction: (p, f) => g(p, f)
1833
1850
  }
1834
1851
  );
1835
1852
  return {
1836
1853
  columnDefs: L(() => {
1837
- const v = V.columnDefs.value, f = {
1854
+ const p = U.columnDefs.value, f = {
1838
1855
  id: "location",
1839
- header: () => O("inventory.transfer.receiveRequest.bulk.locationColumn"),
1856
+ header: () => A("inventory.transfer.receiveRequest.bulk.locationColumn"),
1840
1857
  cell(i) {
1841
- const C = i.row.original._locationDbName, o = w.locations.find((H) => H.dbName === C);
1842
- return o ? `${o.name} (${o.doc.profile.code ?? "--"})` : C;
1858
+ const _ = i.row.original._locationDbName, o = k.locations.find((H) => H.dbName === _);
1859
+ return o ? `${o.name} (${o.doc.profile.code ?? "--"})` : _;
1843
1860
  },
1844
1861
  enableSorting: !1,
1845
1862
  size: 160
1846
- }, d = [...v];
1863
+ }, d = [...p];
1847
1864
  return d.splice(1, 0, f), d;
1848
1865
  }),
1849
- showPdfDialog: $,
1866
+ showPdfDialog: O,
1850
1867
  pdfPreviewLoading: c,
1851
1868
  pdfPreviewBlobUrl: l
1852
1869
  };
1853
1870
  }
1854
- const Ps = {
1871
+ const qs = {
1855
1872
  key: 0,
1856
1873
  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"
1857
- }, Ds = {
1874
+ }, Ns = {
1858
1875
  key: 1,
1859
1876
  class: "bg-white rounded-lg shadow-xl border border-fm-color-neutral-gray-100 w-[360px] max-h-[480px] flex flex-col overflow-hidden"
1860
- }, Es = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, qs = { class: "fm-typo-en-title-sm-600" }, Ns = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, As = { class: "flex items-start justify-between gap-8" }, $s = { class: "flex flex-col gap-2" }, Os = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, Bs = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, Ts = { class: "flex items-center gap-4" }, Is = ["disabled", "onClick"], Ls = ["disabled", "onClick"], zs = ["onClick"], Ms = {
1877
+ }, $s = { class: "flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, As = { class: "fm-typo-en-title-sm-600" }, Os = { class: "overflow-y-auto flex-1 divide-y divide-fm-color-neutral-gray-100" }, Bs = { class: "flex items-start justify-between gap-8" }, Ts = { class: "flex flex-col gap-2" }, Is = { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary line-clamp-1" }, Ls = { class: "fm-typo-en-body-xs-400 text-fm-color-typo-secondary capitalize" }, zs = { class: "flex items-center gap-4" }, Ms = ["disabled", "onClick"], Us = ["disabled", "onClick"], Vs = ["onClick"], Js = {
1861
1878
  key: 0,
1862
1879
  class: "flex flex-col gap-4"
1863
- }, Us = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, Vs = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Js = {
1880
+ }, js = { class: "w-full bg-fm-color-neutral-gray-200 rounded-full h-[3px]" }, Ws = { class: "flex justify-between fm-typo-en-body-xs-400 text-fm-color-typo-secondary" }, Ys = {
1864
1881
  key: 0,
1865
1882
  class: "truncate max-w-[200px]"
1866
- }, js = { class: "ml-auto" }, Ws = {
1883
+ }, Hs = { class: "ml-auto" }, Qs = {
1867
1884
  key: 1,
1868
1885
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-success"
1869
- }, Ys = {
1886
+ }, Ks = {
1870
1887
  key: 2,
1871
1888
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-warning"
1872
- }, Hs = {
1889
+ }, Gs = {
1873
1890
  key: 3,
1874
1891
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-secondary"
1875
- }, Qs = {
1892
+ }, Xs = {
1876
1893
  key: 4,
1877
1894
  class: "flex items-center gap-4 fm-typo-en-body-xs-400 text-fm-color-typo-error"
1878
- }, Ks = { key: 0 }, Gs = { key: 1 }, Xs = {
1895
+ }, Zs = { key: 0 }, ea = { key: 1 }, ta = {
1879
1896
  key: 5,
1880
1897
  class: "flex items-center gap-[5px] text-[11px] leading-none text-fm-color-typo-secondary"
1881
- }, Zs = /* @__PURE__ */ tt({
1898
+ }, na = /* @__PURE__ */ nt({
1882
1899
  __name: "BulkJobProgressPanel",
1883
- setup(_) {
1884
- const { t: h } = En(), w = pt(), O = Ke(), S = k(!1), z = k(null);
1900
+ setup(x) {
1901
+ const { t: h } = $n(), k = pt(), A = Ge(), S = C(!1), M = C(null);
1885
1902
  function Y(d) {
1886
- S.value && z.value && !z.value.contains(d.target) && (S.value = !1);
1903
+ S.value && M.value && !M.value.contains(d.target) && (S.value = !1);
1887
1904
  }
1888
- At(() => {
1905
+ Ot(() => {
1889
1906
  document.addEventListener("click", Y, !0);
1890
- }), $t(() => {
1907
+ }), Bt(() => {
1891
1908
  document.removeEventListener("click", Y, !0);
1892
1909
  });
1893
- const $ = k(/* @__PURE__ */ new Set()), c = k(/* @__PURE__ */ new Set());
1910
+ const O = C(/* @__PURE__ */ new Set()), c = C(/* @__PURE__ */ new Set());
1894
1911
  async function l(d) {
1895
- if (!$.value.has(d.jobId)) {
1896
- $.value = /* @__PURE__ */ new Set([...$.value, d.jobId]);
1912
+ if (!O.value.has(d.jobId)) {
1913
+ O.value = /* @__PURE__ */ new Set([...O.value, d.jobId]);
1897
1914
  try {
1898
- const i = await O.downloadBulkJob(d.dbName, d.jobId), C = URL.createObjectURL(i), o = document.createElement("a");
1899
- o.href = C, o.download = "purchase-orders.zip", document.body.appendChild(o), o.click(), document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(C), 1e3);
1915
+ const i = await A.downloadBulkJob(d.dbName, d.jobId), _ = URL.createObjectURL(i), o = document.createElement("a");
1916
+ o.href = _, o.download = "purchase-orders.zip", document.body.appendChild(o), o.click(), document.body.removeChild(o), setTimeout(() => URL.revokeObjectURL(_), 1e3);
1900
1917
  } finally {
1901
- const i = new Set($.value);
1902
- i.delete(d.jobId), $.value = i;
1918
+ const i = new Set(O.value);
1919
+ i.delete(d.jobId), O.value = i;
1903
1920
  }
1904
1921
  }
1905
1922
  }
@@ -1907,33 +1924,33 @@ const Ps = {
1907
1924
  if (!c.value.has(d.jobId)) {
1908
1925
  c.value = /* @__PURE__ */ new Set([...c.value, d.jobId]);
1909
1926
  try {
1910
- await w.cancelJob(d.jobId);
1927
+ await k.cancelJob(d.jobId);
1911
1928
  } finally {
1912
1929
  const i = new Set(c.value);
1913
1930
  i.delete(d.jobId), c.value = i;
1914
1931
  }
1915
1932
  }
1916
1933
  }
1917
- function V(d) {
1918
- w.removeJob(d);
1934
+ function U(d) {
1935
+ k.removeJob(d);
1919
1936
  }
1920
- function de(d) {
1937
+ function fe(d) {
1921
1938
  return d === "completed" || d === "failed" || d === "cancelled";
1922
1939
  }
1923
- function v(d) {
1924
- const i = Math.round(d / 1e3), C = Math.floor(i / 60), o = i % 60;
1925
- return C > 0 ? `${C}m ${o}s` : `${o}s`;
1940
+ function p(d) {
1941
+ const i = Math.round(d / 1e3), _ = Math.floor(i / 60), o = i % 60;
1942
+ return _ > 0 ? `${_}m ${o}s` : `${o}s`;
1926
1943
  }
1927
1944
  function f(d) {
1928
1945
  return d < 1024 ? `${d} B` : d < 1024 * 1024 ? `${(d / 1024).toFixed(1)} KB` : `${(d / (1024 * 1024)).toFixed(1)} MB`;
1929
1946
  }
1930
1947
  return (d, i) => {
1931
- const C = Ce("FmIcon");
1932
- return m(), le(lt, { to: "body" }, [
1933
- t(w).jobs.length > 0 ? (m(), y("div", {
1948
+ const _ = Ce("FmIcon");
1949
+ return m(), ue(lt, { to: "body" }, [
1950
+ t(k).jobs.length > 0 ? (m(), y("div", {
1934
1951
  key: 0,
1935
1952
  ref_key: "panelRef",
1936
- ref: z,
1953
+ ref: M,
1937
1954
  class: "fixed bottom-24 right-24 z-[9998] flex flex-col items-end gap-8"
1938
1955
  }, [
1939
1956
  S.value ? D("", !0) : (m(), y("button", {
@@ -1941,53 +1958,53 @@ const Ps = {
1941
1958
  class: "flex items-center gap-8 bg-fm-color-primary text-white rounded-full px-16 py-[6px] shadow-lg fm-typo-en-body-sm-600 cursor-pointer",
1942
1959
  onClick: i[0] || (i[0] = (o) => S.value = !0)
1943
1960
  }, [
1944
- E(C, {
1961
+ E(_, {
1945
1962
  name: "cloud_upload",
1946
1963
  size: "sm"
1947
1964
  }),
1948
- e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1949
- t(w).activeJobs.length > 0 ? (m(), y("span", Ps, p(t(w).activeJobs.length), 1)) : D("", !0)
1965
+ e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1966
+ t(k).activeJobs.length > 0 ? (m(), y("span", qs, v(t(k).activeJobs.length), 1)) : D("", !0)
1950
1967
  ])),
1951
- S.value ? (m(), y("div", Ds, [
1952
- e("div", Es, [
1953
- e("span", qs, p(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1968
+ S.value ? (m(), y("div", Ns, [
1969
+ e("div", $s, [
1970
+ e("span", As, v(t(h)("inventory.transfer.receiveRequest.bulk.backgroundJobsTitle")), 1),
1954
1971
  e("button", {
1955
1972
  "aria-label": "Collapse",
1956
1973
  onClick: i[1] || (i[1] = (o) => S.value = !1),
1957
1974
  class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary"
1958
1975
  }, [
1959
- E(C, {
1976
+ E(_, {
1960
1977
  name: "close",
1961
1978
  size: "sm"
1962
1979
  })
1963
1980
  ])
1964
1981
  ]),
1965
- e("div", Ns, [
1966
- (m(!0), y(ye, null, Qe(t(w).jobs, (o) => {
1982
+ e("div", Os, [
1983
+ (m(!0), y(he, null, Ke(t(k).jobs, (o) => {
1967
1984
  var H;
1968
1985
  return m(), y("div", {
1969
1986
  key: o.jobId,
1970
1987
  class: "px-16 py-12 flex flex-col gap-8"
1971
1988
  }, [
1972
- e("div", As, [
1973
- e("div", $s, [
1974
- e("span", Os, p(o.title), 1),
1975
- e("span", Bs, p(o.status), 1)
1976
- ]),
1989
+ e("div", Bs, [
1977
1990
  e("div", Ts, [
1991
+ e("span", Is, v(o.title), 1),
1992
+ e("span", Ls, v(o.status), 1)
1993
+ ]),
1994
+ e("div", zs, [
1978
1995
  o.downloadReady ? (m(), y("button", {
1979
1996
  key: 0,
1980
1997
  class: "text-fm-color-primary hover:opacity-80 disabled:opacity-40",
1981
- disabled: $.value.has(o.jobId),
1998
+ disabled: O.value.has(o.jobId),
1982
1999
  title: "Download",
1983
2000
  "aria-label": "Download",
1984
2001
  onClick: (R) => l(o)
1985
2002
  }, [
1986
- E(C, {
1987
- name: $.value.has(o.jobId) ? "progress_activity" : "download",
2003
+ E(_, {
2004
+ name: O.value.has(o.jobId) ? "progress_activity" : "download",
1988
2005
  size: "sm"
1989
2006
  }, null, 8, ["name"])
1990
- ], 8, Is)) : D("", !0),
2007
+ ], 8, Ms)) : D("", !0),
1991
2008
  o.status === "waiting" || o.status === "active" ? (m(), y("button", {
1992
2009
  key: 1,
1993
2010
  class: "text-fm-color-semantic-error-500 hover:opacity-80 disabled:opacity-40",
@@ -1996,70 +2013,70 @@ const Ps = {
1996
2013
  "aria-label": "Cancel",
1997
2014
  onClick: (R) => g(o)
1998
2015
  }, [
1999
- E(C, {
2016
+ E(_, {
2000
2017
  name: c.value.has(o.jobId) ? "progress_activity" : "cancel",
2001
2018
  size: "sm"
2002
2019
  }, null, 8, ["name"])
2003
- ], 8, Ls)) : D("", !0),
2004
- de(o.status) ? (m(), y("button", {
2020
+ ], 8, Us)) : D("", !0),
2021
+ fe(o.status) ? (m(), y("button", {
2005
2022
  key: 2,
2006
2023
  class: "text-fm-color-typo-secondary hover:text-fm-color-typo-primary",
2007
2024
  title: "Dismiss",
2008
2025
  "aria-label": "Dismiss",
2009
- onClick: (R) => V(o.jobId)
2026
+ onClick: (R) => U(o.jobId)
2010
2027
  }, [
2011
- E(C, {
2028
+ E(_, {
2012
2029
  name: "close",
2013
2030
  size: "sm"
2014
2031
  })
2015
- ], 8, zs)) : D("", !0)
2032
+ ], 8, Vs)) : D("", !0)
2016
2033
  ])
2017
2034
  ]),
2018
- o.status === "active" || o.status === "waiting" ? (m(), y("div", Ms, [
2019
- e("div", Us, [
2035
+ o.status === "active" || o.status === "waiting" ? (m(), y("div", Js, [
2036
+ e("div", js, [
2020
2037
  e("div", {
2021
2038
  class: "bg-fm-color-primary h-[3px] rounded-full transition-all duration-300",
2022
2039
  style: mt({ width: `${o.progress}%` })
2023
2040
  }, null, 4)
2024
2041
  ]),
2025
- e("div", Vs, [
2026
- o.currentItem ? (m(), y("span", Js, p(o.currentItem), 1)) : D("", !0),
2027
- e("span", js, p(o.current) + " / " + p(o.total), 1)
2042
+ e("div", Ws, [
2043
+ o.currentItem ? (m(), y("span", Ys, v(o.currentItem), 1)) : D("", !0),
2044
+ e("span", Hs, v(o.current) + " / " + v(o.total), 1)
2028
2045
  ])
2029
2046
  ])) : D("", !0),
2030
- o.status === "completed" && o.errorCount === 0 ? (m(), y("div", Ws, [
2031
- E(C, {
2047
+ o.status === "completed" && o.errorCount === 0 ? (m(), y("div", Qs, [
2048
+ E(_, {
2032
2049
  name: "check_circle",
2033
2050
  size: "sm"
2034
2051
  }),
2035
- e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
2052
+ e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobDone")), 1)
2036
2053
  ])) : D("", !0),
2037
- o.status === "completed" && (((H = o.stalePoIds) == null ? void 0 : H.length) ?? 0) > 0 ? (m(), y("div", Ys, [
2038
- E(C, {
2054
+ o.status === "completed" && (((H = o.stalePoIds) == null ? void 0 : H.length) ?? 0) > 0 ? (m(), y("div", Ks, [
2055
+ E(_, {
2039
2056
  name: "warning",
2040
2057
  size: "sm"
2041
2058
  }),
2042
- e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobStalePos", [o.stalePoIds.length])), 1)
2059
+ e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobStalePos", [o.stalePoIds.length])), 1)
2043
2060
  ])) : D("", !0),
2044
- o.status === "cancelled" ? (m(), y("div", Hs, [
2045
- E(C, {
2061
+ o.status === "cancelled" ? (m(), y("div", Gs, [
2062
+ E(_, {
2046
2063
  name: "do_not_disturb_on",
2047
2064
  size: "sm"
2048
2065
  }),
2049
- e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
2066
+ e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobCancelled")), 1)
2050
2067
  ])) : D("", !0),
2051
- o.status === "failed" ? (m(), y("div", Qs, [
2052
- E(C, {
2068
+ o.status === "failed" ? (m(), y("div", Xs, [
2069
+ E(_, {
2053
2070
  name: "cancel",
2054
2071
  size: "sm"
2055
2072
  }),
2056
- o.errorCount > 0 ? (m(), y("span", Ks, p(t(h)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [o.errorCount])), 1)) : (m(), y("span", Gs, p(t(h)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
2073
+ o.errorCount > 0 ? (m(), y("span", Zs, v(t(h)("inventory.transfer.receiveRequest.bulk.jobDoneWithErrors", [o.errorCount])), 1)) : (m(), y("span", ea, v(t(h)("inventory.transfer.receiveRequest.bulk.jobFailed")), 1))
2057
2074
  ])) : D("", !0),
2058
- de(o.status) && o.completedAt ? (m(), y("div", Xs, [
2059
- e("span", null, p(t(h)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [v(o.completedAt - o.startedAt)])), 1),
2060
- o.zipSizeBytes ? (m(), y(ye, { key: 0 }, [
2075
+ fe(o.status) && o.completedAt ? (m(), y("div", ta, [
2076
+ e("span", null, v(t(h)("inventory.transfer.receiveRequest.bulk.jobCompletedIn", [p(o.completedAt - o.startedAt)])), 1),
2077
+ o.zipSizeBytes ? (m(), y(he, { key: 0 }, [
2061
2078
  i[2] || (i[2] = e("span", null, "·", -1)),
2062
- e("span", null, p(f(o.zipSizeBytes)), 1)
2079
+ e("span", null, v(f(o.zipSizeBytes)), 1)
2063
2080
  ], 64)) : D("", !0)
2064
2081
  ])) : D("", !0)
2065
2082
  ]);
@@ -2070,45 +2087,45 @@ const Ps = {
2070
2087
  ]);
2071
2088
  };
2072
2089
  }
2073
- }), ea = {
2090
+ }), oa = {
2074
2091
  key: 0,
2075
2092
  class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
2076
- }, ta = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, na = { class: "flex-1 xs:w-full sm:w-full" }, oa = {
2093
+ }, sa = { class: "flex-1 w-full flex items-center gap-4 xs:flex-col-reverse sm:flex-col-reverse" }, aa = { class: "flex-1 xs:w-full sm:w-full" }, ra = {
2077
2094
  key: 0,
2078
2095
  class: "flex-1"
2079
- }, sa = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, aa = {
2096
+ }, la = { class: "w-full max-w-[343px] xs:max-w-[unset] sm:max-w-[unset]" }, ia = {
2080
2097
  key: 0,
2081
2098
  class: "flex flex-col items-center justify-center py-48 gap-8 text-fm-color-typo-secondary"
2082
- }, ra = { class: "fm-typo-en-body-md-400" }, la = {
2099
+ }, ua = { class: "fm-typo-en-body-md-400" }, ca = {
2083
2100
  key: 1,
2084
2101
  class: "relative"
2085
- }, ia = {
2102
+ }, da = {
2086
2103
  key: 0,
2087
2104
  class: "flex items-center gap-12 mb-8"
2088
- }, ua = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, ca = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, da = {
2105
+ }, ma = { class: "flex-1 h-4 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, fa = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-nowrap" }, pa = {
2089
2106
  key: 1,
2090
2107
  class: "flex items-center justify-between gap-12 rounded-md border border-red-200 bg-red-50 px-16 py-8 mb-8"
2091
- }, ma = { class: "fm-typo-en-body-md-400 text-red-800" }, fa = { class: "flex flex-col py-8" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, va = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ya = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, ha = {
2108
+ }, va = { class: "fm-typo-en-body-md-400 text-red-800" }, ya = { class: "flex flex-col py-8" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ha = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ga = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, _a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, xa = {
2092
2109
  key: 0,
2093
2110
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
2094
- }, ga = { class: "pt-8" }, xa = {
2111
+ }, wa = { class: "pt-8" }, ka = {
2095
2112
  key: 2,
2096
2113
  class: "absolute inset-0 z-10 flex items-center justify-center bg-fm-color-opacity-sm"
2097
- }, _a = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, wa = { class: "fm-typo-en-body-md-400" }, wt = "BulkReceiveRequestViewSearchCriteria", Za = /* @__PURE__ */ tt({
2114
+ }, Ca = { class: "flex items-center gap-12 rounded-md bg-white px-16 py-8 shadow-lg" }, Fa = { class: "fm-typo-en-body-md-400" }, Ct = "BulkReceiveRequestViewSearchCriteria", or = /* @__PURE__ */ nt({
2098
2115
  __name: "BulkReceiveRequestView",
2099
- setup(_) {
2100
- const { t: h } = nt(), w = ut();
2101
- st.object({
2102
- name: st.string().optional().nullable(),
2103
- startDate: st.string().optional().nullable(),
2104
- endDate: st.string().optional().nullable()
2116
+ setup(x) {
2117
+ const { t: h } = ot(), k = ut();
2118
+ at.object({
2119
+ name: at.string().optional().nullable(),
2120
+ startDate: at.string().optional().nullable(),
2121
+ endDate: at.string().optional().nullable()
2105
2122
  });
2106
- const O = sn(), S = Rt(), z = Tt();
2123
+ const A = rn(), S = Dt(), M = Lt();
2107
2124
  function Y() {
2108
2125
  const P = {
2109
2126
  name: "",
2110
2127
  ...ft()
2111
- }, F = O.getItem(wt);
2128
+ }, F = A.getItem(Ct);
2112
2129
  if (!F) return P;
2113
2130
  try {
2114
2131
  return JSON.parse(F);
@@ -2116,20 +2133,20 @@ const Ps = {
2116
2133
  return P;
2117
2134
  }
2118
2135
  }
2119
- function $() {
2120
- O.setItem(wt, JSON.stringify(c.value));
2136
+ function O() {
2137
+ A.setItem(Ct, JSON.stringify(c.value));
2121
2138
  }
2122
- const c = k(Y()), l = Cs(c.value), g = k(!1), { selectedLocationDbNames: V } = l, de = L(() => R.value.filter((P) => V.value.includes(P.dbName)).map((P) => P.doc._id)), {
2123
- columnDefs: v,
2139
+ const c = C(Y()), l = Rs(c.value), g = C(!1), { selectedLocationDbNames: U } = l, fe = L(() => R.value.filter((P) => U.value.includes(P.dbName)).map((P) => P.doc._id)), {
2140
+ columnDefs: p,
2124
2141
  showPdfDialog: f,
2125
2142
  pdfPreviewLoading: d,
2126
2143
  pdfPreviewBlobUrl: i
2127
- } = Rs(l, l.shipments), C = it(), o = Jt(), H = Ct(), R = k([]);
2128
- Ot(() => {
2129
- const P = C.locations;
2144
+ } = Es(l, l.shipments), _ = it(), o = Wt(), H = St(), R = C([]);
2145
+ Tt(() => {
2146
+ const P = _.locations;
2130
2147
  P.length > 0 && (R.value = P);
2131
2148
  });
2132
- async function N() {
2149
+ async function q() {
2133
2150
  var F;
2134
2151
  if ((F = H.currentBusiness.value) != null && F._id)
2135
2152
  try {
@@ -2141,25 +2158,25 @@ const Ps = {
2141
2158
  Ve(
2142
2159
  [() => H.sessionUser.value, () => H.currentBusiness.value],
2143
2160
  ([P, F]) => {
2144
- P && F && N();
2161
+ P && F && q();
2145
2162
  },
2146
2163
  { immediate: !0 }
2147
2164
  );
2148
- const M = L(() => l.loading.value), be = L(
2165
+ const z = L(() => l.loading.value), pe = L(
2149
2166
  () => l.failedLocations.value.map((P) => {
2150
2167
  var F;
2151
- return ((F = C.locations.find((B) => B.dbName === P.dbName)) == null ? void 0 : F.name) ?? P.dbName;
2168
+ return ((F = _.locations.find((B) => B.dbName === P.dbName)) == null ? void 0 : F.name) ?? P.dbName;
2152
2169
  }).join(", ")
2153
- ), he = L(
2170
+ ), G = L(
2154
2171
  () => l.failedLocations.value.some((P) => P.retryable)
2155
2172
  );
2156
- async function ue() {
2173
+ async function se() {
2157
2174
  const P = `inventory-record_${He(c.value.startDate).format("DD-MM-YYYY_HH-mm")}-${He(c.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`;
2158
2175
  let F = [];
2159
2176
  try {
2160
2177
  F = await l.fetchFullPurchaseOrders();
2161
2178
  } catch {
2162
- w.open({
2179
+ k.open({
2163
2180
  title: h("inventory.transfer.receiveRequest.export.error"),
2164
2181
  message: h("inventory.transfer.receiveRequest.export.fetchError"),
2165
2182
  type: "error"
@@ -2167,24 +2184,24 @@ const Ps = {
2167
2184
  return;
2168
2185
  }
2169
2186
  const B = F.flatMap(
2170
- (G) => G.items.map((ee) => {
2187
+ (X) => X.items.map((ne) => {
2171
2188
  var r, u;
2172
- const Re = new Date(nn(G._id) ?? ""), we = G.effectiveAt ? new Date(G.effectiveAt) : void 0, j = xt(
2173
- tn(ee.sku, G.deliveryOrder || [])
2174
- ), ae = xt(ee.quantity), Be = ((r = ee == null ? void 0 : ee.measurement) == null ? void 0 : r.abbrev) || ee.sku.unit.abbrev;
2189
+ const Re = new Date(sn(X._id) ?? ""), we = X.effectiveAt ? new Date(X.effectiveAt) : void 0, j = _t(
2190
+ on(ne.sku, X.deliveryOrder || [])
2191
+ ), le = _t(ne.quantity), Be = ((r = ne == null ? void 0 : ne.measurement) == null ? void 0 : r.abbrev) || ne.sku.unit.abbrev;
2175
2192
  return {
2176
- Location: ((u = C.locations.find((b) => b.dbName === G._locationDbName)) == null ? void 0 : u.name) ?? "",
2177
- "SKU code": ee.code,
2178
- "SKU name": ee.name,
2179
- "PO #": G.seqNumber,
2193
+ Location: ((u = _.locations.find((b) => b.dbName === X._locationDbName)) == null ? void 0 : u.name) ?? "",
2194
+ "SKU code": ne.code,
2195
+ "SKU name": ne.name,
2196
+ "PO #": X.seqNumber,
2180
2197
  "Effective at": we,
2181
2198
  Date: Re,
2182
- Status: G.status,
2183
- Reference: G.ref ?? "",
2199
+ Status: X.status,
2200
+ Reference: X.ref ?? "",
2184
2201
  "Received quantity": j,
2185
- "Ordered quantity": ae,
2202
+ "Ordered quantity": le,
2186
2203
  Unit: Be,
2187
- "Total cost": ee.totalCost ? Wt(ee.totalCost) : null
2204
+ "Total cost": ne.totalCost ? Ht(ne.totalCost) : null
2188
2205
  };
2189
2206
  })
2190
2207
  ), K = [
@@ -2199,45 +2216,45 @@ const Ps = {
2199
2216
  "Ordered quantity",
2200
2217
  "Unit"
2201
2218
  ];
2202
- S.enableBackdatePo && K.insert("Effective at", 5), S.enableTotalCost && K.push("Total cost"), await on([{ name: "purchases", data: B, columns: K }], P), w.open({
2219
+ S.enableBackdatePo && K.insert("Effective at", 5), S.enableTotalCost && K.push("Total cost"), await an([{ name: "purchases", data: B, columns: K }], P), k.open({
2203
2220
  title: h("inventory.transfer.receiveRequest.export.success"),
2204
2221
  message: h("inventory.transfer.receiveRequest.export.message", [P]),
2205
2222
  type: "success"
2206
2223
  });
2207
2224
  }
2208
- const ne = k(ft()), ve = k("");
2209
- Ve([() => ne.value], ([P]) => {
2225
+ const ee = C(ft()), de = C("");
2226
+ Ve([() => ee.value], ([P]) => {
2210
2227
  if (!P.startDate || !P.endDate) return;
2211
2228
  if (He(P.endDate).diff(He(P.startDate), "day") > 60) {
2212
- w.open({
2229
+ k.open({
2213
2230
  title: h("inventory.transfer.receiveRequest.bulk.dateRangeLimitTitle"),
2214
2231
  message: h("inventory.transfer.receiveRequest.bulk.dateRangeLimitMsg"),
2215
2232
  type: "warning"
2216
- }), ne.value = {
2233
+ }), ee.value = {
2217
2234
  startDate: P.startDate,
2218
2235
  endDate: He(P.startDate).add(60, "day").format("YYYY-MM-DD")
2219
2236
  };
2220
2237
  return;
2221
2238
  }
2222
- c.value.startDate = P.startDate, c.value.endDate = P.endDate, l.updateDateRange(c.value.startDate, c.value.endDate), $();
2223
- }), Ve([() => ve.value], () => {
2224
- $();
2239
+ c.value.startDate = P.startDate, c.value.endDate = P.endDate, l.updateDateRange(c.value.startDate, c.value.endDate), O();
2240
+ }), Ve([() => de.value], () => {
2241
+ O();
2225
2242
  });
2226
- const De = It.debounce(() => l.fetchData(), 1500);
2243
+ const De = zt.debounce(() => l.fetchData(), 1500);
2227
2244
  Ve(
2228
- () => V.value,
2245
+ () => U.value,
2229
2246
  () => {
2230
2247
  l.abortOngoingBrowse(), De();
2231
2248
  }
2232
2249
  );
2233
- function _e(P) {
2250
+ function xe(P) {
2234
2251
  if (P === "create") {
2235
- if (M.value) {
2236
- w.open({ title: "Loading data...", message: "Please wait.", type: "info" });
2252
+ if (z.value) {
2253
+ k.open({ title: "Loading data...", message: "Please wait.", type: "info" });
2237
2254
  return;
2238
2255
  }
2239
- if (V.value.length === 0) {
2240
- w.open({
2256
+ if (U.value.length === 0) {
2257
+ k.open({
2241
2258
  title: "No outlets selected",
2242
2259
  message: "Please select at least one outlet to create a transfer.",
2243
2260
  type: "warning"
@@ -2250,13 +2267,13 @@ const Ps = {
2250
2267
  if (P === "upload" && S.enableXilnexTransferNote)
2251
2268
  return l.promptUploadTransferDialog();
2252
2269
  if (P === "refresh") return l.fetchData();
2253
- if (P === "export") return ue();
2254
- if (P === "downloadAll") return Ae();
2270
+ if (P === "export") return se();
2271
+ if (P === "downloadAll") return $e();
2255
2272
  if (P === "emailAll") return Ee();
2256
2273
  }
2257
- async function Ae() {
2258
- if (V.value.length === 0) {
2259
- w.open({
2274
+ async function $e() {
2275
+ if (U.value.length === 0) {
2276
+ k.open({
2260
2277
  title: h("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
2261
2278
  message: "",
2262
2279
  type: "warning"
@@ -2267,8 +2284,8 @@ const Ps = {
2267
2284
  }
2268
2285
  async function Ee() {
2269
2286
  if (S.enablePurchaseOrderEmail) {
2270
- if (V.value.length === 0) {
2271
- w.open({
2287
+ if (U.value.length === 0) {
2288
+ k.open({
2272
2289
  title: h("inventory.transfer.receiveRequest.bulk.noLocationsSelected"),
2273
2290
  message: "",
2274
2291
  type: "warning"
@@ -2278,7 +2295,7 @@ const Ps = {
2278
2295
  await l.emailAll(Se.value);
2279
2296
  }
2280
2297
  }
2281
- const { breakpoints: me } = cn(), ge = L(() => me.value.xs || me.value.sm), $e = L(() => ge.value ? 10 : 20), Fe = an(), Ge = L(() => S.enableReceiveRequestBeta ? [
2298
+ const { breakpoints: ve } = mn(), ge = L(() => ve.value.xs || ve.value.sm), Ae = L(() => ge.value ? 10 : 20), Fe = ln(), Xe = L(() => S.enableReceiveRequestBeta ? [
2282
2299
  {
2283
2300
  label: h("inventory.transfer.receiveRequest.actions.create"),
2284
2301
  value: "create",
@@ -2288,14 +2305,14 @@ const Ps = {
2288
2305
  ...S.enableXilnexTransferNote ? [{ label: h("inventory.common.upload"), value: "upload" }] : [],
2289
2306
  { label: h("inventory.common.refresh"), value: "refresh" },
2290
2307
  { label: h("inventory.common.export"), value: "export" },
2291
- ...S.enablePrintTemplate && !M.value ? [
2308
+ ...S.enablePrintTemplate && !z.value ? [
2292
2309
  {
2293
2310
  label: h("inventory.transfer.receiveRequest.bulk.downloadAll"),
2294
2311
  value: "downloadAll",
2295
2312
  prependIcon: "download"
2296
2313
  }
2297
2314
  ] : [],
2298
- ...S.enablePurchaseOrderEmail && !M.value ? [
2315
+ ...S.enablePurchaseOrderEmail && !z.value ? [
2299
2316
  {
2300
2317
  label: h("inventory.transfer.receiveRequest.bulk.emailAll"),
2301
2318
  value: "emailAll",
@@ -2323,7 +2340,7 @@ const Ps = {
2323
2340
  values: Array.from(
2324
2341
  new Set(
2325
2342
  l.purchaseOrders.value.map((B) => {
2326
- const K = C.locations.find((G) => G.dbName === B._locationDbName);
2343
+ const K = _.locations.find((X) => X.dbName === B._locationDbName);
2327
2344
  return (K == null ? void 0 : K.name) ?? B._locationDbName;
2328
2345
  })
2329
2346
  )
@@ -2335,8 +2352,8 @@ const Ps = {
2335
2352
  key: "netsuiteTransactionNumber",
2336
2353
  entity: "purchaseOrder",
2337
2354
  values: l.purchaseOrders.value.map((B) => {
2338
- var K, G;
2339
- return (G = (K = B.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : G.transactionnumber;
2355
+ var K, X;
2356
+ return (X = (K = B.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : X.transactionnumber;
2340
2357
  }).filter((B) => B != null)
2341
2358
  },
2342
2359
  {
@@ -2358,16 +2375,16 @@ const Ps = {
2358
2375
  }).filter((B) => B != null)
2359
2376
  }
2360
2377
  ];
2361
- return [...P, ...z.isEnabled ? F : []];
2362
- }), Oe = k(null), Se = L(() => {
2378
+ return [...P, ...M.isEnabled ? F : []];
2379
+ }), Oe = C(null), Se = L(() => {
2363
2380
  if (!Oe.value) return l.purchaseOrders.value;
2364
- const P = _n.build(Oe.value);
2381
+ const P = kn.build(Oe.value);
2365
2382
  return l.purchaseOrders.value.filter((F) => {
2366
- var K, G, ee, Re, we;
2367
- const B = ((K = C.locations.find((j) => j.dbName === F._locationDbName)) == null ? void 0 : K.name) ?? F._locationDbName;
2368
- return wn(
2383
+ var K, X, ne, Re, we;
2384
+ const B = ((K = _.locations.find((j) => j.dbName === F._locationDbName)) == null ? void 0 : K.name) ?? F._locationDbName;
2385
+ return Cn(
2369
2386
  {
2370
- netsuiteTransactionNumber: (ee = (G = F.netSuite) == null ? void 0 : G.additionalInfo) == null ? void 0 : ee.transactionnumber,
2387
+ netsuiteTransactionNumber: (ne = (X = F.netSuite) == null ? void 0 : X.additionalInfo) == null ? void 0 : ne.transactionnumber,
2371
2388
  netsuiteOrderNo: (Re = F.netSuite) == null ? void 0 : Re.refNo,
2372
2389
  netsuiteOrderId: (we = F.netSuite) == null ? void 0 : we.id,
2373
2390
  status: F.status,
@@ -2379,22 +2396,22 @@ const Ps = {
2379
2396
  });
2380
2397
  });
2381
2398
  return (P, F) => {
2382
- const B = Ce("FmIcon"), K = Ce("FmTextField"), G = Ce("FmButton"), ee = Ce("FmTable"), Re = Ce("FmCircularProgress");
2383
- return m(), le(rn, {
2399
+ const B = Ce("FmIcon"), K = Ce("FmTextField"), X = Ce("FmButton"), ne = Ce("FmTable"), Re = Ce("FmCircularProgress");
2400
+ return m(), ue(un, {
2384
2401
  title: t(h)("inventory.transfer.receiveRequest.bulk.title"),
2385
- actions: Ge.value,
2386
- "onClick:action": _e
2402
+ actions: Xe.value,
2403
+ "onClick:action": xe
2387
2404
  }, {
2388
2405
  default: Pe(() => {
2389
2406
  var we;
2390
2407
  return [
2391
- t(S).isLoaded && !t(S).enableReceiveRequestBeta ? (m(), y("div", ea, [
2408
+ t(S).isLoaded && !t(S).enableReceiveRequestBeta ? (m(), y("div", oa, [
2392
2409
  E(B, {
2393
2410
  name: "block",
2394
2411
  size: "xl"
2395
2412
  }),
2396
2413
  F[9] || (F[9] = e("p", { class: "fm-typo-en-body-md-400" }, "Not available", -1))
2397
- ])) : t(S).enableReceiveRequestBeta ? (m(), y(ye, { key: 1 }, [
2414
+ ])) : t(S).enableReceiveRequestBeta ? (m(), y(he, { key: 1 }, [
2398
2415
  e("div", {
2399
2416
  class: J(["flex flex-col gap-8 max-h-full", { "p-0": ge.value, "px-24": !ge.value }])
2400
2417
  }, [
@@ -2414,29 +2431,29 @@ const Ps = {
2414
2431
  e("div", {
2415
2432
  class: J(["flex gap-8 items-center", { "w-full overflow-x-auto": ge.value }])
2416
2433
  }, [
2417
- E(gs, {
2418
- modelValue: t(V),
2419
- "onUpdate:modelValue": F[0] || (F[0] = (j) => bt(V) ? V.value = j : null),
2434
+ E(ws, {
2435
+ modelValue: t(U),
2436
+ "onUpdate:modelValue": F[0] || (F[0] = (j) => bt(U) ? U.value = j : null),
2420
2437
  locations: R.value
2421
2438
  }, null, 8, ["modelValue", "locations"]),
2422
- E(jt, {
2423
- "model-value": ne.value,
2424
- "onUpdate:modelValue": F[1] || (F[1] = (j) => ne.value = j)
2439
+ E(Yt, {
2440
+ "model-value": ee.value,
2441
+ "onUpdate:modelValue": F[1] || (F[1] = (j) => ee.value = j)
2425
2442
  }, null, 8, ["model-value"])
2426
2443
  ], 2),
2427
- e("div", ta, [
2428
- e("div", na, [
2429
- E(t(kn), {
2444
+ e("div", sa, [
2445
+ e("div", aa, [
2446
+ E(t(Fn), {
2430
2447
  modelValue: Oe.value,
2431
2448
  "onUpdate:modelValue": F[2] || (F[2] = (j) => Oe.value = j),
2432
2449
  attributes: qe.value
2433
2450
  }, null, 8, ["modelValue", "attributes"])
2434
2451
  ]),
2435
- ge.value ? D("", !0) : (m(), y("div", oa)),
2436
- e("div", sa, [
2452
+ ge.value ? D("", !0) : (m(), y("div", ra)),
2453
+ e("div", la, [
2437
2454
  E(K, {
2438
- "model-value": ve.value,
2439
- "onUpdate:modelValue": F[3] || (F[3] = (j) => ve.value = j),
2455
+ "model-value": de.value,
2456
+ "onUpdate:modelValue": F[3] || (F[3] = (j) => de.value = j),
2440
2457
  "prepend-icon": "search",
2441
2458
  placeholder: t(h)("inventory.common.table.toolbar.filterItems"),
2442
2459
  class: "w-full"
@@ -2445,15 +2462,15 @@ const Ps = {
2445
2462
  ])
2446
2463
  ], 2)
2447
2464
  ], 512),
2448
- t(V).length === 0 && !M.value ? (m(), y("div", aa, [
2465
+ t(U).length === 0 && !z.value ? (m(), y("div", ia, [
2449
2466
  E(B, {
2450
2467
  name: "storefront",
2451
2468
  size: "xl"
2452
2469
  }),
2453
- e("p", ra, p(t(h)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
2454
- ])) : (m(), y("div", la, [
2455
- (M.value || t(l).retryingFailed.value) && t(l).fetchProgress.value ? (m(), y("div", ia, [
2456
- e("div", ua, [
2470
+ e("p", ua, v(t(h)("inventory.transfer.receiveRequest.bulk.selectLocationsHint")), 1)
2471
+ ])) : (m(), y("div", ca, [
2472
+ (z.value || t(l).retryingFailed.value) && t(l).fetchProgress.value ? (m(), y("div", da, [
2473
+ e("div", ma, [
2457
2474
  e("div", {
2458
2475
  class: "h-full rounded-full bg-fm-color-primary transition-all duration-300",
2459
2476
  style: mt({
@@ -2461,65 +2478,65 @@ const Ps = {
2461
2478
  })
2462
2479
  }, null, 4)
2463
2480
  ]),
2464
- e("span", ca, p(t(l).fetchProgress.value.done) + "/" + p(t(l).fetchProgress.value.total) + " locations ", 1)
2481
+ e("span", fa, v(t(l).fetchProgress.value.done) + "/" + v(t(l).fetchProgress.value.total) + " locations ", 1)
2465
2482
  ])) : D("", !0),
2466
- t(l).failedLocations.value.length > 0 ? (m(), y("div", da, [
2467
- e("span", ma, " Failed to load: " + p(be.value), 1),
2468
- he.value ? (m(), le(G, {
2483
+ t(l).failedLocations.value.length > 0 ? (m(), y("div", pa, [
2484
+ e("span", va, " Failed to load: " + v(pe.value), 1),
2485
+ G.value ? (m(), ue(X, {
2469
2486
  key: 0,
2470
2487
  variant: "secondary",
2471
- disabled: t(l).retryingFailed.value || M.value,
2488
+ disabled: t(l).retryingFailed.value || z.value,
2472
2489
  label: t(l).retryingFailed.value ? "Retrying…" : "Retry failed locations",
2473
2490
  onClick: t(l).retryFailedLocations
2474
2491
  }, null, 8, ["disabled", "label", "onClick"])) : D("", !0)
2475
2492
  ])) : D("", !0),
2476
- E(ee, {
2493
+ E(ne, {
2477
2494
  style: mt(t(Fe).tableHeight),
2478
- "column-defs": t(v),
2495
+ "column-defs": t(p),
2479
2496
  "row-data": Se.value,
2480
- "search-value": ve.value,
2481
- loading: M.value,
2497
+ "search-value": de.value,
2498
+ loading: z.value,
2482
2499
  onRowClick: F[6] || (F[6] = (j) => t(l).promptShowTransferDetails(j.original)),
2483
- "page-size": $e.value
2500
+ "page-size": Ae.value
2484
2501
  }, {
2485
2502
  "list-row": Pe((j) => [
2486
- E(xn, {
2503
+ E(wn, {
2487
2504
  row: j,
2488
2505
  onRowClick: t(l).promptShowTransferDetails
2489
2506
  }, {
2490
- default: Pe((ae) => {
2491
- var Be, Te, r, u, b, T, I, q, W, Q, A, Z, U, re, Je, Ie, Le, Ne, ke, ze, Me, je, We, x, oe;
2507
+ default: Pe((le) => {
2508
+ var Be, Te, r, u, b, T, I, N, W, Q, $, te, V, ie, Je, Ie, Le, Ne, ke, ze, Me, je, We, w, ae;
2492
2509
  return [
2493
- e("div", fa, [
2494
- e("div", pa, [
2495
- E(t(Ze), {
2496
- render: (r = (Te = (Be = ae._id) == null ? void 0 : Be.column) == null ? void 0 : Te.columnDef) == null ? void 0 : r.cell,
2497
- props: (b = (u = ae._id) == null ? void 0 : u.getContext) == null ? void 0 : b.call(u)
2510
+ e("div", ya, [
2511
+ e("div", ba, [
2512
+ E(t(et), {
2513
+ render: (r = (Te = (Be = le._id) == null ? void 0 : Be.column) == null ? void 0 : Te.columnDef) == null ? void 0 : r.cell,
2514
+ props: (b = (u = le._id) == null ? void 0 : u.getContext) == null ? void 0 : b.call(u)
2498
2515
  }, null, 8, ["render", "props"])
2499
2516
  ]),
2500
- e("div", va, [
2501
- E(t(Ze), {
2502
- render: (q = (I = (T = ae.location) == null ? void 0 : T.column) == null ? void 0 : I.columnDef) == null ? void 0 : q.cell,
2503
- props: (Q = (W = ae.location) == null ? void 0 : W.getContext) == null ? void 0 : Q.call(W)
2517
+ e("div", ha, [
2518
+ E(t(et), {
2519
+ render: (N = (I = (T = le.location) == null ? void 0 : T.column) == null ? void 0 : I.columnDef) == null ? void 0 : N.cell,
2520
+ props: (Q = (W = le.location) == null ? void 0 : W.getContext) == null ? void 0 : Q.call(W)
2504
2521
  }, null, 8, ["render", "props"])
2505
2522
  ]),
2506
- e("div", ya, [
2507
- E(t(Ze), {
2508
- render: (U = (Z = (A = ae.supplier_name) == null ? void 0 : A.column) == null ? void 0 : Z.columnDef) == null ? void 0 : U.cell,
2509
- props: (Je = (re = ae.supplier_name) == null ? void 0 : re.getContext) == null ? void 0 : Je.call(re)
2523
+ e("div", ga, [
2524
+ E(t(et), {
2525
+ render: (V = (te = ($ = le.supplier_name) == null ? void 0 : $.column) == null ? void 0 : te.columnDef) == null ? void 0 : V.cell,
2526
+ props: (Je = (ie = le.supplier_name) == null ? void 0 : ie.getContext) == null ? void 0 : Je.call(ie)
2510
2527
  }, null, 8, ["render", "props"])
2511
2528
  ]),
2512
- e("div", ba, p(j.original.items.map((ie) => `${ie.name}`).join(", ")), 1),
2513
- j.original.ref ? (m(), y("div", ha, [
2514
- E(t(Ze), {
2515
- render: (Ne = (Le = (Ie = ae.ref) == null ? void 0 : Ie.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Ne.cell,
2516
- props: (ze = (ke = ae.ref) == null ? void 0 : ke.getContext) == null ? void 0 : ze.call(ke)
2529
+ e("div", _a, v(j.original.items.map((ce) => `${ce.name}`).join(", ")), 1),
2530
+ j.original.ref ? (m(), y("div", xa, [
2531
+ E(t(et), {
2532
+ render: (Ne = (Le = (Ie = le.ref) == null ? void 0 : Ie.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Ne.cell,
2533
+ props: (ze = (ke = le.ref) == null ? void 0 : ke.getContext) == null ? void 0 : ze.call(ke)
2517
2534
  }, null, 8, ["render", "props"])
2518
2535
  ])) : D("", !0),
2519
- e("div", ga, [
2520
- E(t(Ze), {
2521
- render: (We = (je = (Me = ae.status) == null ? void 0 : Me.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
2522
- props: (oe = (x = ae.status) == null ? void 0 : x.getContext) == null ? void 0 : oe.call(x)
2536
+ e("div", wa, [
2537
+ E(t(et), {
2538
+ render: (We = (je = (Me = le.status) == null ? void 0 : Me.column) == null ? void 0 : je.columnDef) == null ? void 0 : We.cell,
2539
+ props: (ae = (w = le.status) == null ? void 0 : w.getContext) == null ? void 0 : ae.call(w)
2523
2540
  }, null, 8, ["render", "props"])
2524
2541
  ])
2525
2542
  ])
@@ -2530,11 +2547,11 @@ const Ps = {
2530
2547
  ]),
2531
2548
  _: 1
2532
2549
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]),
2533
- t(l).rowAction.pending.value ? (m(), y("div", xa, [
2534
- e("div", _a, [
2550
+ t(l).rowAction.pending.value ? (m(), y("div", ka, [
2551
+ e("div", Ca, [
2535
2552
  E(Re, { size: "md" }),
2536
- e("span", wa, p(t(h)("inventory.common.loading")), 1),
2537
- E(G, {
2553
+ e("span", Fa, v(t(h)("inventory.common.loading")), 1),
2554
+ E(X, {
2538
2555
  variant: "secondary",
2539
2556
  label: t(h)("inventory.common.cancel"),
2540
2557
  onClick: t(l).rowAction.cancel
@@ -2543,28 +2560,28 @@ const Ps = {
2543
2560
  ])) : D("", !0)
2544
2561
  ]))
2545
2562
  ], 2),
2546
- (m(), le(lt, { to: "body" }, [
2547
- E(Zs),
2548
- t(S).enablePurchaseOrderEmail ? (m(), le(fn, ht(ct({ key: 0 }, t(l).emailDialogProps.value)), null, 16)) : D("", !0),
2549
- E(cs, {
2563
+ (m(), ue(lt, { to: "body" }, [
2564
+ E(na),
2565
+ t(S).enablePurchaseOrderEmail ? (m(), ue(vn, ht(ct({ key: 0 }, t(l).emailDialogProps.value)), null, 16)) : D("", !0),
2566
+ E(fs, {
2550
2567
  show: g.value,
2551
2568
  "onUpdate:show": F[7] || (F[7] = (j) => g.value = j),
2552
2569
  "last-closing-date": t(l).lastClosingDate.value,
2553
- "selected-outlet-ids": de.value,
2570
+ "selected-outlet-ids": fe.value,
2554
2571
  onSubmitted: t(l).fetchData
2555
2572
  }, null, 8, ["show", "last-closing-date", "selected-outlet-ids", "onSubmitted"]),
2556
- E(pn, ct(t(l).transferDialogProps.value, {
2573
+ E(yn, ct(t(l).transferDialogProps.value, {
2557
2574
  onSubmitted: t(l).fetchData
2558
2575
  }), null, 16, ["onSubmitted"]),
2559
- t(l).transferDetailsProps.value != null ? (m(), le(en, ct({ key: 1 }, {
2576
+ t(l).transferDetailsProps.value != null ? (m(), ue(nn, ct({ key: 1 }, {
2560
2577
  ...t(l).transferDetailsProps.value,
2561
2578
  receivedMap: ((we = t(l).transferDetailsProps.value) == null ? void 0 : we.receivedMap) ?? {},
2562
2579
  shipments: t(l).shipments.value ?? []
2563
2580
  }, {
2564
2581
  onSubmitted: t(l).fetchData
2565
2582
  }), null, 16, ["onSubmitted"])) : D("", !0),
2566
- E(vn, ht(Bt(t(l).xilnexImportDialogProps.value)), null, 16),
2567
- E(hs, {
2583
+ E(bn, ht(It(t(l).xilnexImportDialogProps.value)), null, 16),
2584
+ E(xs, {
2568
2585
  modelValue: t(f),
2569
2586
  "onUpdate:modelValue": F[8] || (F[8] = (j) => bt(f) ? f.value = j : null),
2570
2587
  loading: t(d),
@@ -2580,5 +2597,5 @@ const Ps = {
2580
2597
  }
2581
2598
  });
2582
2599
  export {
2583
- Za as default
2600
+ or as default
2584
2601
  };