@feedmepos/mf-inventory-portal 1.8.0-dev.1 → 1.8.0-dev.3

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 (156) hide show
  1. package/dist/App-DRXADP0k.js +1498 -0
  2. package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-hV1msz5Y.js} +9 -9
  3. package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-BX1Lopf0.js} +2 -2
  4. package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-BNKW8-XY.js} +2 -2
  5. package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-DiLDsL83.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-oQh6kFLc.js} +20 -20
  7. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BaMcGU-x.js +151 -0
  8. package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-sgLoaSf4.js} +20 -20
  9. package/dist/{ClosingHistoryView-Blyq9-BS.js → ClosingHistoryView-BnE9HrzA.js} +5 -5
  10. package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-BD3Pa11r.js} +302 -291
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DlbyxkMQ.js} +1 -1
  12. package/dist/{DefaultView-CsIMmQAY.js → DefaultView-CuzvVkfE.js} +5 -5
  13. package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-w-1aAOY1.js} +2 -2
  14. package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-Bp8bjDU1.js +58 -0
  15. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-CxD12Qct.js} +1668 -1671
  16. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CMoQKl_a.js +308 -0
  17. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BqCh_vTP.js} +1 -1
  18. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CAXnmdUy.js} +2 -2
  19. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NhOdW33O.js +120 -0
  20. package/dist/{FmMultiselectDialog-BAw-gp5K.js → FmMultiselectDialog-BqZgHP8s.js} +1 -1
  21. package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-CULwA_hi.js} +2 -2
  22. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CI3Y9kDl.js} +6 -6
  23. package/dist/{ImportView-BmotFC-3.js → ImportView-DqQG673_.js} +6 -6
  24. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DfvNUu80.js} +1 -1
  25. package/dist/IngredientGroupView-CyngKxPo.js +1000 -0
  26. package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-pzpP6oXT.js} +309 -296
  27. package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-C5aAhB6e.js} +4 -4
  28. package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-Bqun7nX0.js} +2403 -2408
  29. package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-r_Ua1C4a.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYDuu4kU.js} +5 -5
  31. package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-BQuZLohR.js} +1 -1
  32. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-7r-QcJdU.js} +1 -1
  33. package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-95fu_CfH.js} +4 -4
  34. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CdOca1tV.js} +7 -7
  35. package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-DIjor_Ix.js} +3 -3
  36. package/dist/{PublishView-DS2FZ66p.js → PublishView-DYObyHQq.js} +3 -3
  37. package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-C0jCmI9L.js} +2 -2
  38. package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-i7ibPfIE.js} +14 -14
  39. package/dist/{RecipeView-DvI6X-uN.js → RecipeView-C5VO7yr3.js} +18 -18
  40. package/dist/SettingsView-CdBloj9k.js +983 -0
  41. package/dist/{StockView-Z9wGihT7.js → StockView-g_6eJ62R.js} +327 -322
  42. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C1rKc7MA.js} +1 -1
  43. package/dist/{SupplierView-D8q6siZW.js → SupplierView-DkYp_Frj.js} +451 -447
  44. package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-CfkV4Y3y.js} +7 -7
  45. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-2MtN1p5t.js} +2 -2
  46. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CYMjKXq4.js} +1 -1
  47. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-D0zNr_vQ.js} +21 -21
  48. package/dist/{TransferTemplateView-DtsJzmUr.js → TransferTemplateView-Ne2gYUSn.js} +21 -21
  49. package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-Db0_otOb.js} +4 -4
  50. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BzO1lq7j.js} +4 -4
  51. package/dist/{UnitView-CM695-VI.js → UnitView-CiCeQ63i.js} +8 -8
  52. package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-BcuJSOMF.js} +193 -189
  53. package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-CPQmtOKQ.js} +15 -15
  54. package/dist/api/feature-flags.d.ts +10 -0
  55. package/dist/api/inventory.d.ts +9 -9
  56. package/dist/api/license.d.ts +9 -0
  57. package/dist/{app-Cb5s4jMu.js → app-DqJp3dcI.js} +146 -108
  58. package/dist/app.d.ts +36 -0
  59. package/dist/app.js +1 -1
  60. package/dist/{closing-template-DnqnpXxn.js → closing-template-BNlgZviN.js} +1 -1
  61. package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
  62. package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
  63. package/dist/components/FeatureCapabilityBadge.vue.d.ts +29 -0
  64. package/dist/components/{PreviewBadge.vue.d.ts → FeatureCapabilityGate.vue.d.ts} +10 -7
  65. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  66. package/dist/components/{PremiumBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
  67. package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
  68. package/dist/composable/useNavigationMenu.d.ts +2 -1
  69. package/dist/{inventory-core-dart.default-DDRxXXnt.js → core-Js7d-3Pv.js} +121 -118
  70. package/dist/{date2-BPhD_1Of.js → date2-Ci7521dn.js} +1 -1
  71. package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-Cyp32v4J.js} +1 -1
  72. package/dist/{decimal-Df6a50Ld.js → decimal-BGdm5R3A.js} +2 -2
  73. package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-B2cJ-rtd.js} +1 -1
  74. package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-By5WeKZ0.js} +1 -1
  75. package/dist/feature-fG7d73oi.js +371 -0
  76. package/dist/feature-flags/core.d.ts +27 -0
  77. package/dist/feature-flags/core.spec.d.ts +1 -0
  78. package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
  79. package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
  80. package/dist/feature-flags/plan-tier.d.ts +6 -0
  81. package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
  82. package/dist/feature-flags/portal-feature-catalog.d.ts +24 -0
  83. package/dist/feature-flags/vue.d.ts +14 -0
  84. package/dist/{format-time-from-id-DmUjUcVj.js → format-time-from-id-Q8C2P96H.js} +1 -1
  85. package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-CICrmm8r.js} +13 -13
  86. package/dist/id-to-date-DeN5x0LR.js +67 -0
  87. package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-BOTQWxr6.js} +28 -28
  88. package/dist/{index-C-mazZwS.js → index-BbbqCCfp.js} +3 -3
  89. package/dist/{index-BXaIMGnI.js → index-Cxm3Sgfv.js} +1 -1
  90. package/dist/index-Dqf27vLH.js +841 -0
  91. package/dist/{index-UmM6gHJ1.js → index-tCYhLCKP.js} +1 -1
  92. package/dist/{lz-string-Bibw5D_6.js → lz-string-Dy4Pg8mh.js} +1 -1
  93. package/dist/{netsuite-Bev0OtQT.js → netsuite-BaJjkDM8.js} +2 -2
  94. package/dist/{number-y_W4pn_d.js → number-CB36d2PQ.js} +3 -3
  95. package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-DLm93Bpx.js} +1 -1
  96. package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-CDhn9ZIF.js} +1 -1
  97. package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-Cqvefakh.js} +1 -1
  98. package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-NTfVmGY8.js} +2 -2
  99. package/dist/{rules-CZTBvenw.js → rules-C8dfM84-.js} +2 -2
  100. package/dist/{stock-XINW8JOM.js → stock-BGB0Siue.js} +3 -3
  101. package/dist/{stock-CxCRZo_D.js → stock-Qu5IiN2_.js} +1 -1
  102. package/dist/stores/feature.d.ts +12 -0
  103. package/dist/stores/integration/netsuite.d.ts +2 -2
  104. package/dist/stores/location.d.ts +42 -42
  105. package/dist/stores/supplier.d.ts +48 -48
  106. package/dist/stores/warehouse.d.ts +1 -1
  107. package/dist/{supplier-CkZdeMcl.js → supplier-CZdNOSMN.js} +17 -17
  108. package/dist/{surcharge-FRSFqjGl.js → surcharge-Cm40oJvU.js} +1 -1
  109. package/dist/tsconfig.app.tsbuildinfo +1 -1
  110. package/dist/{uom-rules-Cm1styDr.js → uom-rules-L-IW4Nwk.js} +1 -1
  111. package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-B2TDVJM6.js} +2 -2
  112. package/dist/{use-inventory-binding-dialog-DVIJO8Cl.js → use-inventory-binding-dialog-BJ00hl5f.js} +2 -2
  113. package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-DYAPMvo9.js} +2 -2
  114. package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-w-9tymYS.js} +2 -2
  115. package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BFCIo5sA.js} +1 -1
  116. package/dist/useNavigationMenu-BPHAH5sJ.js +352 -0
  117. package/dist/{useSseClient-CCV4mPzD.js → useSseClient-CWjRacRs.js} +1 -1
  118. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  119. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  120. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  121. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  122. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  123. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  124. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
  125. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  126. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  127. package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
  128. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  129. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  130. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  131. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
  132. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
  133. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
  134. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
  135. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
  136. package/dist/views/settings/FeatureFlagView.vue.d.ts +2 -0
  137. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  138. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  139. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  140. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  141. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  142. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  143. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  144. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  145. package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-S4YQ9w6a.js} +295 -295
  146. package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-CP8_VajN.js} +2 -2
  147. package/package.json +5 -5
  148. package/dist/App-BXgpGzGR.js +0 -1476
  149. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
  150. package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
  151. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js +0 -93
  152. package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
  153. package/dist/SettingsView-sThYErMz.js +0 -698
  154. package/dist/feature-Ckn5ra3z.js +0 -1136
  155. package/dist/useNavigationMenu-CSinmNCY.js +0 -172
  156. /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
@@ -0,0 +1,983 @@
1
+ import { defineComponent as oe, ref as k, computed as N, watch as W, resolveComponent as E, createElementBlock as c, openBlock as o, createElementVNode as l, toDisplayString as D, Fragment as U, renderList as Y, createBlock as O, createCommentVNode as X, createVNode as m, nextTick as _e, createSlots as xe, withCtx as z, normalizeClass as ie, unref as S, withModifiers as he, h as $, Teleport as ke } from "vue";
2
+ import { _ as we } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
+ import { B as G, g as Fe, r as Te, s as Se, u as Ce, a as te, b as De, c as $e, d as ye, e as Be, f as Ve } from "./predefined-templates-DLm93Bpx.js";
4
+ import { useSnackbar as Ie, components as Q } from "@feedmepos/ui-library";
5
+ import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ import { H as le, I as Oe, d as Pe } from "./app-DqJp3dcI.js";
7
+ import { useCoreStore as fe, useI18n as Ee } from "@feedmepos/mf-common";
8
+ import "./dayjs.min-Cyp32v4J.js";
9
+ import { I as Ue } from "./core-Js7d-3Pv.js";
10
+ import { u as Ae } from "./index-Dqf27vLH.js";
11
+ import { b as Le, a as He, D as Ne } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CMoQKl_a.js";
12
+ import { _ as Me } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BaMcGU-x.js";
13
+ const Re = { class: "p-3" }, je = { class: "text-sm font-semibold text-gray-700 mb-4 pb-2 border-b border-gray-200" }, Ke = { class: "flex flex-col gap-3" }, qe = {
14
+ key: 0,
15
+ class: "flex items-center justify-between py-1"
16
+ }, Ge = { class: "text-[13px] text-gray-600" }, Ye = { class: "text-[13px] text-gray-600" }, We = ["value", "rows", "placeholder", "onInput"], Je = {
17
+ key: 5,
18
+ class: "flex items-center justify-between py-1"
19
+ }, Qe = { class: "text-[13px] text-gray-600" }, Xe = ["value", "onInput"], Ze = /* @__PURE__ */ oe({
20
+ __name: "BlockConfigPanel",
21
+ props: {
22
+ block: {}
23
+ },
24
+ emits: ["update"],
25
+ setup(A, { emit: _ }) {
26
+ const w = A, T = _;
27
+ function C(u) {
28
+ var x;
29
+ if ((x = u.config) != null && x.configFields && Array.isArray(u.config.configFields)) {
30
+ const d = u.config.configFields.map((v) => ({ ...v })), h = new Set(d.map((v) => v.key)), a = G[u.tag], b = a ? a.initialConfigFields().filter((v) => !h.has(v.key)) : [];
31
+ return [...d, ...b];
32
+ }
33
+ const i = G[u.tag];
34
+ return i ? i.initialConfigFields() : [];
35
+ }
36
+ const p = k(C(w.block)), P = N(() => {
37
+ const u = G[w.block.tag];
38
+ return (u == null ? void 0 : u.label) ?? w.block.tag;
39
+ });
40
+ W(
41
+ () => w.block,
42
+ (u) => {
43
+ p.value = C(u);
44
+ },
45
+ { deep: !0 }
46
+ );
47
+ function f(u, i) {
48
+ const x = p.value[u];
49
+ x && (x.value = i, y());
50
+ }
51
+ function y() {
52
+ T("update", {
53
+ ...w.block.config || {},
54
+ configFields: p.value.map((u) => ({ ...u }))
55
+ });
56
+ }
57
+ return (u, i) => {
58
+ const x = E("FmSwitch"), d = E("FmTextField"), h = E("FmSelect");
59
+ return o(), c("div", Re, [
60
+ l("div", je, D(P.value) + " Settings ", 1),
61
+ l("div", Ke, [
62
+ (o(!0), c(U, null, Y(p.value, (a, b) => (o(), c("div", {
63
+ key: a.key
64
+ }, [
65
+ a.type === "toggle" ? (o(), c("div", qe, [
66
+ l("label", Ge, D(a.label), 1),
67
+ m(x, {
68
+ "model-value": a.value,
69
+ "onUpdate:modelValue": (v) => f(b, v)
70
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
71
+ ])) : a.type === "text" ? (o(), O(d, {
72
+ key: 1,
73
+ label: a.label,
74
+ "model-value": a.value,
75
+ placeholder: a.placeholder,
76
+ "onUpdate:modelValue": (v) => f(b, v)
77
+ }, null, 8, ["label", "model-value", "placeholder", "onUpdate:modelValue"])) : a.type === "textarea" ? (o(), c(U, { key: 2 }, [
78
+ l("div", Ye, D(a.label), 1),
79
+ l("textarea", {
80
+ class: "w-full font-mono text-[13px] p-2 border border-gray-300 rounded resize-y box-border focus:outline-none focus:border-blue-600",
81
+ value: a.value,
82
+ rows: a.rows ?? 8,
83
+ placeholder: a.placeholder,
84
+ onInput: (v) => f(b, v.target.value)
85
+ }, null, 40, We)
86
+ ], 64)) : a.type === "select" ? (o(), O(h, {
87
+ key: 3,
88
+ label: a.label,
89
+ "model-value": a.value,
90
+ items: a.options || [],
91
+ "item-label": "label",
92
+ "item-value": "value",
93
+ "onUpdate:modelValue": (v) => f(b, v)
94
+ }, null, 8, ["label", "model-value", "items", "onUpdate:modelValue"])) : a.type === "number" ? (o(), O(d, {
95
+ key: 4,
96
+ label: a.label,
97
+ type: "number",
98
+ "model-value": String(a.value),
99
+ "onUpdate:modelValue": (v) => f(b, Number(v))
100
+ }, null, 8, ["label", "model-value", "onUpdate:modelValue"])) : a.type === "color" ? (o(), c("div", Je, [
101
+ l("label", Qe, D(a.label), 1),
102
+ l("input", {
103
+ type: "color",
104
+ value: a.value,
105
+ class: "color-input w-9 h-7 p-0 border border-gray-300 rounded cursor-pointer bg-transparent",
106
+ onInput: (v) => f(b, v.target.value)
107
+ }, null, 40, Xe)
108
+ ])) : X("", !0)
109
+ ]))), 128))
110
+ ])
111
+ ]);
112
+ };
113
+ }
114
+ }), et = /* @__PURE__ */ ze(Ze, [["__scopeId", "data-v-840687bf"]]), tt = { class: "h-full flex flex-col" }, lt = { class: "flex-1 overflow-auto p-4 bg-gray-100" }, ot = /* @__PURE__ */ oe({
115
+ __name: "TemplatePreview",
116
+ props: {
117
+ blocks: {},
118
+ previewData: {},
119
+ selectedBlockId: {},
120
+ templateType: {}
121
+ },
122
+ setup(A) {
123
+ const _ = A, w = k(null);
124
+ let T = null;
125
+ function C() {
126
+ return !T && w.value && (T = w.value.attachShadow({ mode: "open" })), T;
127
+ }
128
+ const p = N(() => _.previewData ?? Fe(_.templateType));
129
+ W(
130
+ () => [_.blocks, p.value, w.value],
131
+ () => {
132
+ const f = C();
133
+ if (f) {
134
+ try {
135
+ const y = Te(_.blocks, p.value), u = Se(y);
136
+ f.innerHTML = `
137
+ <style>
138
+ :host { display: block; }
139
+ .preview-scale-wrapper {
140
+ transform-origin: top left;
141
+ transform: scale(0.75);
142
+ width: 133.33%;
143
+ }
144
+ .preview-content {
145
+ max-width: 800px;
146
+ margin: auto;
147
+ padding: 30px;
148
+ border: 1px solid #eee;
149
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
150
+ background: white;
151
+ font-size: 16px;
152
+ line-height: 1.5;
153
+ font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
154
+ color: #555;
155
+ }
156
+ </style>
157
+ <div class="preview-scale-wrapper">
158
+ <div class="preview-content">${u}</div>
159
+ </div>
160
+ `;
161
+ } catch (y) {
162
+ f.innerHTML = `<div style="color:red;padding:20px;">Error rendering template: ${y}</div>`;
163
+ }
164
+ _e(() => P(_.selectedBlockId));
165
+ }
166
+ },
167
+ { deep: !0, immediate: !0 }
168
+ ), W(
169
+ () => _.selectedBlockId,
170
+ (f) => P(f)
171
+ );
172
+ function P(f) {
173
+ if (!T || (T.querySelectorAll("[data-block-id].highlight").forEach((u) => {
174
+ u.classList.remove("highlight");
175
+ }), !f)) return;
176
+ const y = T.querySelector(`[data-block-id="${f}"]`);
177
+ y && (y.classList.add("highlight"), y.scrollIntoView({ behavior: "smooth", block: "nearest" }));
178
+ }
179
+ return (f, y) => (o(), c("div", tt, [
180
+ y[0] || (y[0] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 border-b border-gray-200" }, " Live Preview ", -1)),
181
+ l("div", lt, [
182
+ l("div", {
183
+ ref_key: "shadowHost",
184
+ ref: w
185
+ }, null, 512)
186
+ ])
187
+ ]));
188
+ }
189
+ }), at = { class: "flex items-center gap-2 text-base font-semibold" }, nt = { key: 1 }, st = { key: 2 }, rt = {
190
+ key: 0,
191
+ class: "p-6"
192
+ }, it = {
193
+ key: 0,
194
+ class: "flex justify-center items-center h-40 text-gray-400"
195
+ }, ut = {
196
+ key: 1,
197
+ class: "grid grid-cols-2 gap-8"
198
+ }, ct = ["onClick"], dt = { class: "flex items-center justify-center w-12 h-12 rounded-xl bg-gray-100 text-gray-500 group-hover:bg-blue-100 group-hover:text-blue-600 transition-colors" }, pt = { class: "text-center" }, mt = { class: "text-sm font-semibold text-gray-700 group-hover:text-blue-700" }, vt = { class: "text-xs text-gray-400 mt-1" }, ft = {
199
+ key: 0,
200
+ class: "absolute top-2.5 right-2.5 text-[10px] font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full"
201
+ }, gt = {
202
+ key: 1,
203
+ class: "absolute top-2.5 right-2.5 text-[10px] font-medium text-gray-400 bg-gray-100 px-2 py-0.5 rounded-full"
204
+ }, yt = {
205
+ key: 1,
206
+ class: "flex justify-center items-center h-[400px] text-gray-400"
207
+ }, bt = {
208
+ key: 2,
209
+ class: "flex h-[calc(100vh-120px)] border-t border-gray-200"
210
+ }, _t = { class: "w-[280px] border-r border-gray-200 overflow-y-auto shrink-0" }, xt = { class: "px-3 pt-3 pb-2" }, ht = { class: "flex flex-col" }, kt = ["onClick"], wt = { class: "border-y border-gray-100" }, Ft = ["onDragstart", "onDragover", "onDrop", "onClick"], Tt = { class: "flex-1" }, St = { class: "flex gap-1 opacity-50 hover:opacity-100" }, Ct = {
211
+ key: 0,
212
+ class: "py-6 px-4 text-center text-gray-400 text-[13px]"
213
+ }, Dt = {
214
+ key: 0,
215
+ class: "border-t border-gray-200"
216
+ }, $t = {
217
+ key: 1,
218
+ class: "flex items-center justify-center text-gray-400 text-[13px] py-8"
219
+ }, Bt = { class: "p-3 border-t border-gray-200" }, Vt = { class: "flex-1 overflow-hidden" }, It = { class: "ml-auto flex gap-2" }, zt = { class: "p-4" }, Ot = { class: "flex items-center gap-1.5 mt-3 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2" }, Pt = { class: "p-4" }, Et = { class: "flex items-center gap-1.5 mt-3 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded px-3 py-2" }, Ut = /* @__PURE__ */ oe({
220
+ __name: "PrintTemplateEditorDialog",
221
+ props: {
222
+ modelValue: { type: Boolean }
223
+ },
224
+ emits: ["update:modelValue", "saved"],
225
+ setup(A, { emit: _ }) {
226
+ const w = A, T = _, C = Ce(), p = Ie(), P = fe(), f = N({
227
+ get: () => w.modelValue,
228
+ set: (n) => T("update:modelValue", n)
229
+ }), y = k(!1), u = k(!1), i = k(te()), x = k(null), d = k(le.Enum.purchaseOrder), h = k("Purchase Order Template"), a = k(null), b = k(!1), v = k(!1), V = k("select-type"), ae = [
230
+ {
231
+ label: "Purchase Order",
232
+ value: le.Enum.purchaseOrder,
233
+ icon: "receipt_long",
234
+ description: "Customize the layout for purchase order printouts"
235
+ },
236
+ {
237
+ label: "Transfer Order",
238
+ value: le.Enum.transferOrder,
239
+ icon: "swap_horiz",
240
+ description: "Customize the layout for transfer order printouts"
241
+ },
242
+ {
243
+ label: "Goods Received Note",
244
+ value: le.Enum.goodsReceivedNote,
245
+ icon: "fact_check",
246
+ description: "Customize the layout for GRN printouts"
247
+ },
248
+ {
249
+ label: "Delivery Order",
250
+ value: le.Enum.deliveryOrder,
251
+ icon: "local_shipping",
252
+ description: "Customize the layout for delivery order printouts"
253
+ }
254
+ ], M = k(/* @__PURE__ */ new Set()), Z = N(
255
+ () => i.value.find((n) => n.id === x.value) ?? null
256
+ ), L = k(null), H = k(null);
257
+ W(f, async (n) => {
258
+ if (n) {
259
+ V.value = "select-type", y.value = !0;
260
+ try {
261
+ const e = await C.browse();
262
+ M.value = new Set(e.map((g) => g.type));
263
+ } catch {
264
+ } finally {
265
+ y.value = !1;
266
+ }
267
+ }
268
+ }), W(d, async () => {
269
+ x.value = null, await ne();
270
+ });
271
+ async function ue(n) {
272
+ d.value = n, await ne(), V.value = "editor";
273
+ }
274
+ function J() {
275
+ return {
276
+ purchaseOrder: "Purchase Order Template",
277
+ transferOrder: "Transfer Order Template",
278
+ goodsReceivedNote: "Goods Received Note Template",
279
+ deliveryOrder: "Delivery Order Template"
280
+ }[d.value] ?? "Purchase Order Template";
281
+ }
282
+ async function ne() {
283
+ y.value = !0;
284
+ try {
285
+ const n = await C.browse();
286
+ M.value = new Set(n.map((g) => g.type));
287
+ const e = n.find((g) => g.type === d.value);
288
+ e ? (a.value = e._id, h.value = e.name, i.value = e.blocks.map((g) => ({ ...g }))) : (a.value = null, i.value = te(), h.value = J());
289
+ } catch {
290
+ i.value = te(), h.value = J();
291
+ } finally {
292
+ y.value = !1;
293
+ }
294
+ }
295
+ function ce(n) {
296
+ const e = {
297
+ id: $e(),
298
+ tag: n,
299
+ config: De(n)
300
+ };
301
+ i.value.push(e), x.value = e.id;
302
+ }
303
+ function se(n) {
304
+ const e = i.value.findIndex((g) => g.id === n);
305
+ e >= 0 && (i.value.splice(e, 1), x.value === n && (x.value = null));
306
+ }
307
+ function de(n) {
308
+ const e = i.value.find((g) => g.id === x.value);
309
+ if (e) {
310
+ const g = n.configFields || [], ee = ye(e.tag);
311
+ e.config = { configFields: g, templateHtml: ee };
312
+ }
313
+ }
314
+ function pe(n) {
315
+ L.value = n;
316
+ }
317
+ function me(n, e) {
318
+ n.preventDefault(), H.value = e;
319
+ }
320
+ function ve() {
321
+ H.value = null;
322
+ }
323
+ function t(n) {
324
+ if (L.value === null || L.value === n) {
325
+ L.value = null, H.value = null;
326
+ return;
327
+ }
328
+ const e = i.value.splice(L.value, 1)[0];
329
+ i.value.splice(n, 0, e), L.value = null, H.value = null;
330
+ }
331
+ function s() {
332
+ L.value = null, H.value = null;
333
+ }
334
+ async function B() {
335
+ var n;
336
+ u.value = !0;
337
+ try {
338
+ const e = (n = P.currentBusiness.value) == null ? void 0 : n._id;
339
+ if (!e)
340
+ throw new Error("Business ID is missing. Please select a business first.");
341
+ const g = i.value.map((r) => {
342
+ var ge;
343
+ const I = ((ge = r.config) == null ? void 0 : ge.configFields) || [], q = ye(r.tag, I);
344
+ return {
345
+ ...r,
346
+ config: { configFields: I, templateHtml: q }
347
+ };
348
+ }), ee = Be(g), R = {
349
+ name: h.value,
350
+ type: d.value,
351
+ blocks: ee,
352
+ businessId: e,
353
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
354
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
355
+ };
356
+ let j;
357
+ a.value ? j = await C.update(a.value, {
358
+ _id: a.value,
359
+ ...R
360
+ }) : (j = await C.create(R), a.value = j._id), M.value.add(d.value), v.value = !1, p == null || p.open({
361
+ title: "Success",
362
+ message: "Print template saved",
363
+ type: "success"
364
+ }), T("saved", j), f.value = !1;
365
+ } catch (e) {
366
+ p == null || p.open({
367
+ title: "Error",
368
+ message: (e == null ? void 0 : e.message) || "Failed to save template",
369
+ type: "error"
370
+ });
371
+ } finally {
372
+ u.value = !1;
373
+ }
374
+ }
375
+ async function K() {
376
+ if (a.value) {
377
+ u.value = !0;
378
+ try {
379
+ await C.delete(a.value), a.value = null, i.value = te(), h.value = J(), M.value.delete(d.value), b.value = !1, p == null || p.open({
380
+ title: "Deleted",
381
+ message: "Print template deleted. Default layout will be used.",
382
+ type: "success"
383
+ }), T("saved", null), f.value = !1;
384
+ } catch (n) {
385
+ p == null || p.open({
386
+ title: "Error",
387
+ message: (n == null ? void 0 : n.message) || "Failed to delete template",
388
+ type: "error"
389
+ });
390
+ } finally {
391
+ u.value = !1;
392
+ }
393
+ }
394
+ }
395
+ function F() {
396
+ i.value = te(), x.value = null;
397
+ }
398
+ function re(n) {
399
+ var e;
400
+ return ((e = G[n]) == null ? void 0 : e.label) ?? n;
401
+ }
402
+ function be(n) {
403
+ var e;
404
+ return ((e = G[n]) == null ? void 0 : e.icon) ?? "widgets";
405
+ }
406
+ return (n, e) => {
407
+ const g = E("FmIcon"), ee = E("FmTextField"), R = E("FmButton"), j = E("FmDialog");
408
+ return o(), c(U, null, [
409
+ m(j, {
410
+ modelValue: f.value,
411
+ "onUpdate:modelValue": e[4] || (e[4] = (r) => f.value = r),
412
+ overlay: !0,
413
+ "close-button": "",
414
+ "max-width": "98vw",
415
+ "max-height": "98vh"
416
+ }, xe({
417
+ "dialog-header": z(() => {
418
+ var r;
419
+ return [
420
+ l("div", at, [
421
+ V.value === "editor" ? (o(), c("button", {
422
+ key: 0,
423
+ class: "flex items-center justify-center w-7 h-7 rounded hover:bg-gray-100 transition-colors text-gray-500",
424
+ onClick: e[0] || (e[0] = (I) => V.value = "select-type")
425
+ }, [
426
+ m(g, {
427
+ name: "arrow_back",
428
+ size: "sm"
429
+ })
430
+ ])) : X("", !0),
431
+ V.value === "select-type" ? (o(), c("span", nt, "Print Template Editor")) : (o(), c("span", st, D((r = ae.find((I) => I.value === d.value)) == null ? void 0 : r.label) + " Template", 1))
432
+ ])
433
+ ];
434
+ }),
435
+ default: z(() => [
436
+ V.value === "select-type" ? (o(), c("div", rt, [
437
+ e[7] || (e[7] = l("p", { class: "text-sm text-gray-500 mb-5" }, " Select a template type to customize its print layout. ", -1)),
438
+ y.value ? (o(), c("div", it, " Loading... ")) : (o(), c("div", ut, [
439
+ (o(), c(U, null, Y(ae, (r) => l("div", {
440
+ key: r.value,
441
+ class: ie(["group relative flex flex-col items-center gap-3 p-6 rounded-xl border-2 border-gray-200 cursor-pointer transition-all hover:border-blue-400 hover:shadow-md", {
442
+ "border-blue-500 bg-blue-50/50 shadow-md": d.value === r.value && V.value === "select-type"
443
+ }]),
444
+ onClick: (I) => ue(r.value)
445
+ }, [
446
+ l("div", dt, [
447
+ m(g, {
448
+ name: r.icon,
449
+ size: "sm"
450
+ }, null, 8, ["name"])
451
+ ]),
452
+ l("div", pt, [
453
+ l("div", mt, D(r.label), 1),
454
+ l("div", vt, D(r.description), 1)
455
+ ]),
456
+ M.value.has(r.value) ? (o(), c("span", ft, "Customized")) : (o(), c("span", gt, "Default"))
457
+ ], 10, ct)), 64))
458
+ ]))
459
+ ])) : y.value ? (o(), c("div", yt, e[8] || (e[8] = [
460
+ l("div", null, "Loading template...", -1)
461
+ ]))) : (o(), c("div", bt, [
462
+ l("div", _t, [
463
+ l("div", xt, [
464
+ m(ee, {
465
+ modelValue: h.value,
466
+ "onUpdate:modelValue": e[1] || (e[1] = (r) => h.value = r),
467
+ placeholder: "Template name",
468
+ label: "Template Name"
469
+ }, null, 8, ["modelValue"])
470
+ ]),
471
+ e[9] || (e[9] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2" }, " Add Blocks ", -1)),
472
+ l("div", ht, [
473
+ (o(!0), c(U, null, Y(S(Oe).Values, (r) => (o(), c("div", {
474
+ key: r,
475
+ class: "group flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 transition-colors hover:bg-gray-100",
476
+ onClick: (I) => ce(r)
477
+ }, [
478
+ m(g, {
479
+ name: S(G)[r].icon,
480
+ size: "sm"
481
+ }, null, 8, ["name"]),
482
+ l("span", null, D(S(G)[r].label), 1),
483
+ m(g, {
484
+ name: "add",
485
+ size: "sm",
486
+ class: "ml-auto opacity-0 text-blue-600 group-hover:opacity-100"
487
+ })
488
+ ], 8, kt))), 128))
489
+ ]),
490
+ e[10] || (e[10] = l("div", { class: "text-xs font-semibold text-gray-400 uppercase tracking-wider px-3 py-2 mt-2" }, " Block Order ", -1)),
491
+ l("div", wt, [
492
+ (o(!0), c(U, null, Y(i.value, (r, I) => (o(), c("div", {
493
+ key: r.id,
494
+ class: ie(["flex items-center gap-2 px-3 py-2 cursor-pointer text-[13px] text-gray-600 border-b border-gray-100 transition-colors hover:bg-gray-100", {
495
+ "bg-blue-50 border-l-[3px] border-l-blue-600": r.id === x.value,
496
+ "border-t-2 border-t-blue-600": H.value === I
497
+ }]),
498
+ draggable: "true",
499
+ onDragstart: (q) => pe(I),
500
+ onDragover: (q) => me(q, I),
501
+ onDragleave: ve,
502
+ onDrop: (q) => t(I),
503
+ onDragend: s,
504
+ onClick: (q) => x.value = r.id
505
+ }, [
506
+ m(g, {
507
+ name: "drag_indicator",
508
+ size: "sm",
509
+ class: "cursor-grab text-gray-300"
510
+ }),
511
+ m(g, {
512
+ name: be(r.tag),
513
+ size: "sm"
514
+ }, null, 8, ["name"]),
515
+ l("span", Tt, D(re(r.tag)), 1),
516
+ l("div", St, [
517
+ m(g, {
518
+ name: "delete",
519
+ size: "sm",
520
+ class: "cursor-pointer text-gray-400 hover:text-red-500",
521
+ onClick: he((q) => se(r.id), ["stop"])
522
+ }, null, 8, ["onClick"])
523
+ ])
524
+ ], 42, Ft))), 128)),
525
+ i.value.length === 0 ? (o(), c("div", Ct, " Click a block above to add it ")) : X("", !0)
526
+ ]),
527
+ Z.value ? (o(), c("div", Dt, [
528
+ (o(), O(et, {
529
+ key: Z.value.id,
530
+ block: Z.value,
531
+ onUpdate: de
532
+ }, null, 8, ["block"]))
533
+ ])) : (o(), c("div", $t, " Select a block to configure it ")),
534
+ l("div", Bt, [
535
+ m(R, {
536
+ label: "Reset to Default",
537
+ variant: "plain",
538
+ size: "md",
539
+ onClick: F
540
+ })
541
+ ])
542
+ ]),
543
+ l("div", Vt, [
544
+ m(ot, {
545
+ blocks: i.value,
546
+ "selected-block-id": x.value,
547
+ "template-type": d.value
548
+ }, null, 8, ["blocks", "selected-block-id", "template-type"])
549
+ ])
550
+ ]))
551
+ ]),
552
+ _: 2
553
+ }, [
554
+ V.value === "editor" ? {
555
+ name: "dialog-footer",
556
+ fn: z(() => [
557
+ l("div", It, [
558
+ a.value ? (o(), O(R, {
559
+ key: 0,
560
+ label: "Delete Template",
561
+ variant: "destructive",
562
+ size: "md",
563
+ onClick: e[2] || (e[2] = (r) => b.value = !0)
564
+ })) : X("", !0),
565
+ m(R, {
566
+ label: "Save Template",
567
+ variant: "primary",
568
+ size: "md",
569
+ onClick: e[3] || (e[3] = (r) => v.value = !0)
570
+ })
571
+ ])
572
+ ]),
573
+ key: "0"
574
+ } : void 0
575
+ ]), 1032, ["modelValue"]),
576
+ m(j, {
577
+ modelValue: v.value,
578
+ "onUpdate:modelValue": e[5] || (e[5] = (r) => v.value = r),
579
+ overlay: !0,
580
+ dismissAway: !0,
581
+ "close-button": "",
582
+ "max-width": "400px"
583
+ }, {
584
+ "dialog-header": z(() => e[11] || (e[11] = [
585
+ l("span", null, "Save Print Template?", -1)
586
+ ])),
587
+ "dialog-footer": z(() => [
588
+ m(R, {
589
+ class: "ml-auto",
590
+ label: "Save",
591
+ variant: "primary",
592
+ size: "md",
593
+ loading: u.value,
594
+ onClick: B
595
+ }, null, 8, ["loading"])
596
+ ]),
597
+ default: z(() => [
598
+ l("div", zt, [
599
+ e[13] || (e[13] = l("p", null, "Are you sure you want to save this print template?", -1)),
600
+ e[14] || (e[14] = l("p", { class: "text-gray-500 text-sm mt-2" }, " This template will be used for all future prints of this type. ", -1)),
601
+ l("div", Ot, [
602
+ m(g, {
603
+ name: "warning",
604
+ size: "sm"
605
+ }),
606
+ e[12] || (e[12] = l("span", null, "This will affect all locations under this business.", -1))
607
+ ])
608
+ ])
609
+ ]),
610
+ _: 1
611
+ }, 8, ["modelValue"]),
612
+ m(j, {
613
+ modelValue: b.value,
614
+ "onUpdate:modelValue": e[6] || (e[6] = (r) => b.value = r),
615
+ overlay: !0,
616
+ dismissAway: !0,
617
+ "close-button": "",
618
+ "max-width": "400px"
619
+ }, {
620
+ "dialog-header": z(() => e[15] || (e[15] = [
621
+ l("span", null, "Delete Print Template?", -1)
622
+ ])),
623
+ "dialog-footer": z(() => [
624
+ m(R, {
625
+ class: "ml-auto",
626
+ label: "Delete",
627
+ variant: "destructive",
628
+ size: "md",
629
+ loading: u.value,
630
+ onClick: K
631
+ }, null, 8, ["loading"])
632
+ ]),
633
+ default: z(() => [
634
+ l("div", Pt, [
635
+ e[17] || (e[17] = l("p", null, "Are you sure you want to delete this print template?", -1)),
636
+ e[18] || (e[18] = l("p", { class: "text-gray-500 text-sm mt-2" }, " The default print layout will be used for all future prints. ", -1)),
637
+ l("div", Et, [
638
+ m(g, {
639
+ name: "warning",
640
+ size: "sm"
641
+ }),
642
+ e[16] || (e[16] = l("span", null, "This will affect all locations under this business.", -1))
643
+ ])
644
+ ])
645
+ ]),
646
+ _: 1
647
+ }, 8, ["modelValue"])
648
+ ], 64);
649
+ };
650
+ }
651
+ }), At = Pe((A, _) => ({
652
+ async listForScope(w) {
653
+ return await _.get(`${A.inventoryBackendUrl}/${w}/feature-flags`);
654
+ }
655
+ })), Lt = { class: "flex min-h-0 w-full flex-col gap-12" }, Ht = { class: "flex w-full flex-wrap items-center gap-8" }, Nt = /* @__PURE__ */ oe({
656
+ __name: "FeatureFlagView",
657
+ setup(A) {
658
+ const { flags: _ } = Ae(), w = fe(), T = At(), C = Q.FmSwitch, p = Q.FmTable, P = Q.FmMenu, f = Q.FmMenuDivider, y = Q.FmMenuHeader, u = Q.FmMenuItem, i = /* @__PURE__ */ new Set(["inventory_ingredient_group"]), x = {
659
+ inventory_pos_closing_v1: "Use v2: Closing Draft and Closing Template.",
660
+ inventory_pos_convert_v1: "Use Production Item instead."
661
+ }, d = k([]), h = k(null), a = ["In use", "Deprecate Soon", "Deprecated"], b = k(null), v = k({}), V = k(!1), ae = {
662
+ inventory_netsuite_inventory_transfer_out: ["netsuite"],
663
+ inventory_portal_accept_require_fulfillment: ["mobile"],
664
+ inventory_portal_must_use_transfer_template: ["mobile"],
665
+ inventory_portal_po_operate_v2: ["mobile"],
666
+ inventory_portal_xilnex_transfer_note: ["mobile"],
667
+ inventory_pos_adjust_v1: ["mobile", "pos-v7", "pos-7.8"],
668
+ inventory_pos_adjust_v2_wastage: ["mobile", "pos-v7", "pos-7.8"],
669
+ inventory_pos_allow_receive_order: ["mobile", "pos-v7", "pos-7.8"],
670
+ inventory_pos_closing_recalculation: ["mobile"],
671
+ inventory_pos_closing_v1: ["mobile", "pos-v7", "pos-7.8"],
672
+ inventory_pos_closing_v2: ["mobile", "pos-v7", "pos-7.8"],
673
+ inventory_pos_convert_v1: ["mobile", "pos-v7", "pos-7.8"],
674
+ inventory_pos_costing: ["mobile"],
675
+ inventory_pos_stock_return: ["mobile"],
676
+ inventory_pos_transfer_require_fulfillment: ["mobile", "pos-v7", "pos-7.8"],
677
+ inventory_purchase_order_approval: ["mobile"]
678
+ }, M = N(
679
+ () => Object.values(Ue).map((t) => {
680
+ const s = _.value.find((B) => B.feature.name === t);
681
+ return {
682
+ name: t,
683
+ enabled: (s == null ? void 0 : s.enabled) ?? null,
684
+ domains: ["portal", ...ae[t] ?? []],
685
+ feature: Le(t)
686
+ };
687
+ })
688
+ ), Z = N(
689
+ () => [...new Set(M.value.flatMap((t) => t.domains))].sort()
690
+ ), L = N(
691
+ () => M.value.filter(
692
+ (t) => (d.value.length === 0 || d.value.some((s) => t.domains.includes(s))) && (!h.value || se(t) === h.value)
693
+ )
694
+ );
695
+ function H(t) {
696
+ d.value = d.value.includes(t) ? d.value.filter((s) => s !== t) : [...d.value, t];
697
+ }
698
+ function ue() {
699
+ d.value = [], h.value = null;
700
+ }
701
+ function J(t) {
702
+ return t.domains.includes("mobile") || t.domains.some((s) => s.startsWith("pos-"));
703
+ }
704
+ function ne(t) {
705
+ return b.value && J(t) ? v.value[t.name] === !0 : t.enabled === !0;
706
+ }
707
+ async function ce(t) {
708
+ if (!t) {
709
+ v.value = {};
710
+ return;
711
+ }
712
+ const s = t;
713
+ V.value = !0;
714
+ try {
715
+ const { flags: B } = await T.listForScope(s);
716
+ b.value === s && (v.value = Object.fromEntries(B.map((K) => [K.name, K.enabled])));
717
+ } catch (B) {
718
+ console.error("Unable to load feature flags for the selected scope", B), b.value === s && (v.value = {});
719
+ } finally {
720
+ b.value === s && (V.value = !1);
721
+ }
722
+ }
723
+ W(
724
+ () => {
725
+ var t;
726
+ return (t = w.currentBusiness.value) != null && t._id ? `business_${w.currentBusiness.value._id}` : null;
727
+ },
728
+ (t) => {
729
+ b.value || (b.value = t);
730
+ },
731
+ { immediate: !0 }
732
+ ), W(b, ce, { immediate: !0 });
733
+ function se(t) {
734
+ return i.has(t.name) ? "Deprecated" : x[t.name] ? "Deprecate Soon" : "In use";
735
+ }
736
+ function de(t) {
737
+ return t === "Deprecated" ? "bg-red-50 text-red-700" : t === "Deprecate Soon" ? "bg-fm-color-state-warning-subtle text-fm-color-state-warning-base" : "bg-green-50 text-green-700";
738
+ }
739
+ function pe(t) {
740
+ var s;
741
+ return ((s = t.feature) == null ? void 0 : s.controls) ?? "Controls the availability of this inventory feature.";
742
+ }
743
+ function me(t) {
744
+ return i.has(t.name) ? "This flag is deprecated. Use its supported replacement for new work." : x[t.name];
745
+ }
746
+ const ve = N(() => [
747
+ {
748
+ accessorKey: "name",
749
+ header: "Feature flag",
750
+ meta: { width: "27%" },
751
+ cell: ({ row: t }) => $("div", { class: "flex flex-wrap items-center gap-2" }, [
752
+ $("span", { class: "break-all font-mono text-xs text-gray-700" }, t.original.name),
753
+ ...t.original.feature ? [
754
+ $(He, {
755
+ tier: t.original.feature.category === "premium" ? "premium" : "standard",
756
+ category: t.original.feature.category,
757
+ deprecateSoon: t.original.feature.deprecateSoon,
758
+ informative: !0
759
+ })
760
+ ] : []
761
+ ])
762
+ },
763
+ {
764
+ id: "domains",
765
+ header: "Domains",
766
+ meta: { width: "19%" },
767
+ cell: ({ row: t }) => $(
768
+ "div",
769
+ { class: "flex flex-wrap gap-2" },
770
+ t.original.domains.map(
771
+ (s) => $(
772
+ "span",
773
+ {
774
+ class: "rounded-full bg-fm-color-neutral-gray-100 px-2 py-0.5 text-xs font-medium text-fm-color-typo-secondary"
775
+ },
776
+ s
777
+ )
778
+ )
779
+ )
780
+ },
781
+ {
782
+ id: "description",
783
+ header: "Description",
784
+ meta: { width: "29%" },
785
+ cell: ({ row: t }) => {
786
+ const s = me(t.original);
787
+ return $("div", { class: "flex flex-col gap-2 text-xs" }, [
788
+ $("span", { class: "text-fm-color-typo-secondary" }, pe(t.original)),
789
+ ...s ? [$("span", { class: "text-fm-color-state-warning-base" }, s)] : []
790
+ ]);
791
+ }
792
+ },
793
+ {
794
+ id: "status",
795
+ header: "Status",
796
+ meta: { width: "13%" },
797
+ cell: ({ row: t }) => {
798
+ const s = se(t.original);
799
+ return s === "Deprecate Soon" ? $(Ne) : $(
800
+ "span",
801
+ {
802
+ class: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${de(s)}`
803
+ },
804
+ s
805
+ );
806
+ }
807
+ },
808
+ {
809
+ id: "availability",
810
+ header: "Availability",
811
+ meta: { width: "12%" },
812
+ cell: ({ row: t }) => {
813
+ var B;
814
+ const s = !!b.value && J(t.original);
815
+ return $("div", { class: "flex flex-col items-end gap-2" }, [
816
+ $(C, { modelValue: ne(t.original), disabled: !0, showIcon: !0 }),
817
+ ...s && V.value ? [$("span", { class: "text-xs text-gray-500" }, "Loading location value…")] : [],
818
+ ...((B = t.original.feature) == null ? void 0 : B.category) === "premium" && t.original.enabled !== !0 && !s ? [$("span", { class: "text-xs text-gray-500" }, "Controlled by the Premium plan")] : []
819
+ ]);
820
+ }
821
+ }
822
+ ]);
823
+ return (t, s) => {
824
+ const B = E("FmChip"), K = E("FmButton");
825
+ return o(), c("div", Lt, [
826
+ l("div", Ht, [
827
+ m(Me, {
828
+ "model-value": b.value,
829
+ "onUpdate:modelValue": s[0] || (s[0] = (F) => b.value = F),
830
+ "selection-only": "",
831
+ "show-business": ""
832
+ }, null, 8, ["model-value"]),
833
+ (o(!0), c(U, null, Y(d.value, (F) => (o(), O(B, {
834
+ key: F,
835
+ label: `domain in ${F}`,
836
+ removable: "",
837
+ onChipClosed: (re) => H(F)
838
+ }, null, 8, ["label", "onChipClosed"]))), 128)),
839
+ h.value ? (o(), O(B, {
840
+ key: 0,
841
+ label: `status in ${h.value}`,
842
+ removable: "",
843
+ onChipClosed: s[1] || (s[1] = (F) => h.value = null)
844
+ }, null, 8, ["label"])) : X("", !0),
845
+ m(S(P), {
846
+ "close-on-click": !1,
847
+ width: 288,
848
+ "max-height": 420,
849
+ placement: "bottom-start"
850
+ }, {
851
+ "menu-button": z(() => [
852
+ m(K, {
853
+ label: "Filter",
854
+ "prepend-icon": "add",
855
+ variant: "secondary"
856
+ })
857
+ ]),
858
+ default: z(() => [
859
+ m(S(y), { label: "Domains" }),
860
+ (o(!0), c(U, null, Y(Z.value, (F) => (o(), O(S(u), {
861
+ key: F,
862
+ label: F,
863
+ selectable: "",
864
+ "has-checkbox": "",
865
+ "model-value": d.value.includes(F),
866
+ onClick: (re) => H(F)
867
+ }, null, 8, ["label", "model-value", "onClick"]))), 128)),
868
+ m(S(f)),
869
+ m(S(y), { label: "Status" }),
870
+ (o(), c(U, null, Y(a, (F) => m(S(u), {
871
+ key: F,
872
+ label: F,
873
+ selectable: "",
874
+ "has-checkbox": "",
875
+ "model-value": h.value === F,
876
+ onClick: (re) => h.value = h.value === F ? null : F
877
+ }, null, 8, ["label", "model-value", "onClick"])), 64))
878
+ ]),
879
+ _: 1
880
+ }),
881
+ d.value.length || h.value ? (o(), O(K, {
882
+ key: 1,
883
+ label: "Clear all",
884
+ variant: "tertiary",
885
+ onClick: ue
886
+ })) : X("", !0)
887
+ ]),
888
+ m(S(p), {
889
+ "column-defs": ve.value,
890
+ "row-data": L.value,
891
+ "page-size": 50,
892
+ "hide-footer": "",
893
+ "shrink-at": !1
894
+ }, null, 8, ["column-defs", "row-data"])
895
+ ]);
896
+ };
897
+ }
898
+ }), Mt = { class: "flex w-full flex-col gap-16 p-16" }, Rt = {
899
+ key: 0,
900
+ class: "py-32 text-center"
901
+ }, jt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = {
902
+ class: "flex gap-2 border-b border-gray-200",
903
+ role: "tablist"
904
+ }, qt = ["aria-selected"], Gt = ["aria-selected"], Yt = { key: 0 }, Wt = { class: "flex items-center justify-between gap-12" }, Jt = { class: "fm-typo-en-heading-sm-600 text-fm-color-typo-primary" }, Qt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xt = {
905
+ key: 1,
906
+ class: "w-full"
907
+ }, Zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pl = /* @__PURE__ */ oe({
908
+ __name: "SettingsView",
909
+ setup(A) {
910
+ const { t: _ } = Ee(), w = fe(), T = Ve(), C = k(!1), p = k("order"), P = N(() => {
911
+ var u, i;
912
+ return ((i = (u = w.sessionUser.value) == null ? void 0 : u.role) == null ? void 0 : i.isAdmin) === !0;
913
+ });
914
+ function f() {
915
+ T.invalidate(), T.fetchTemplates();
916
+ }
917
+ function y() {
918
+ T.fetchTemplates(), C.value = !0;
919
+ }
920
+ return (u, i) => {
921
+ const x = E("FmButton");
922
+ return o(), O(we, {
923
+ title: S(_)("inventory.settings.title")
924
+ }, {
925
+ default: z(() => [
926
+ l("div", Mt, [
927
+ P.value ? (o(), c(U, { key: 1 }, [
928
+ l("div", Kt, [
929
+ l("button", {
930
+ type: "button",
931
+ role: "tab",
932
+ "aria-selected": p.value === "order",
933
+ class: ie([
934
+ "border-b-2 px-3 py-2 text-sm font-medium",
935
+ p.value === "order" ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-gray-500"
936
+ ]),
937
+ onClick: i[0] || (i[0] = (d) => p.value = "order")
938
+ }, D(S(_)("inventory.settings.order.title")), 11, qt),
939
+ l("button", {
940
+ type: "button",
941
+ role: "tab",
942
+ "aria-selected": p.value === "features",
943
+ class: ie([
944
+ "border-b-2 px-3 py-2 text-sm font-medium",
945
+ p.value === "features" ? "border-fm-color-primary text-fm-color-primary" : "border-transparent text-gray-500"
946
+ ]),
947
+ onClick: i[1] || (i[1] = (d) => p.value = "features")
948
+ }, D(S(_)("inventory.settings.features.title")), 11, Gt)
949
+ ]),
950
+ p.value === "order" ? (o(), c("div", Yt, [
951
+ l("div", Wt, [
952
+ l("h2", Jt, D(S(_)("inventory.settings.order.printTemplates")), 1),
953
+ m(x, {
954
+ onClick: y,
955
+ variant: "secondary",
956
+ label: S(_)("inventory.settings.printTemplate.edit")
957
+ }, null, 8, ["label"])
958
+ ]),
959
+ l("p", Qt, D(S(_)("inventory.settings.printTemplate.description")), 1)
960
+ ])) : (o(), c("div", Xt, [
961
+ l("p", Zt, D(S(_)("inventory.settings.features.description")), 1),
962
+ m(Nt)
963
+ ]))
964
+ ], 64)) : (o(), c("div", Rt, [
965
+ l("p", jt, D(S(_)("inventory.settings.adminOnly")), 1)
966
+ ]))
967
+ ]),
968
+ (o(), O(ke, { to: "body" }, [
969
+ m(Ut, {
970
+ modelValue: C.value,
971
+ "onUpdate:modelValue": i[2] || (i[2] = (d) => C.value = d),
972
+ onSaved: f
973
+ }, null, 8, ["modelValue"])
974
+ ]))
975
+ ]),
976
+ _: 1
977
+ }, 8, ["title"]);
978
+ };
979
+ }
980
+ });
981
+ export {
982
+ pl as default
983
+ };