@feedmepos/mf-inventory-portal 1.8.0-dev.2 → 1.8.0-dev.21

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 (248) hide show
  1. package/dist/App-BxpqrT2x.js +1445 -0
  2. package/dist/{ApprovalView-RaXuWWSu.js → ApprovalView-DZBM9n1Y.js} +26 -25
  3. package/dist/{BindingsDialog-DomvXijP.js → BindingsDialog-jjHrmqY_.js} +2 -2
  4. package/dist/{BindingsPicker-DGnzxEs7.js → BindingsPicker-Dv1KwHIQ.js} +2 -2
  5. package/dist/{BindingsTable-DfG9kWrv.js → BindingsTable-Ch_TlrZu.js} +10 -10
  6. package/dist/BulkReceiveRequestPage-BVB3PNxF.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CVekIoiN.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DpHYhOmI.js} +1 -1
  8. package/dist/{ClosingDraftView-C3n66bbh.js → ClosingDraftView-DQQkWYOh.js} +748 -746
  9. package/dist/ClosingHistoryView-CXXd0Csp.js +769 -0
  10. package/dist/{ClosingTemplateView-DwGloYxn.js → ClosingTemplateView-Bf5Ivxjw.js} +22 -21
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-9eY_r8LF.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-C3Y_rwNE.js} +1 -1
  12. package/dist/{DefaultView-JC_e4xgC.js → DefaultView-Bt8ZFV10.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-BBCvI67S.js → DeliveryOrderPrintPreview-BS5ZKe1f.js} +15 -15
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-H4FWc9ga.js → EmailDialog.vue_vue_type_script_setup_true_lang-BvDFKrFF.js} +10077 -9950
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-B389iY-f.js +48 -0
  16. package/dist/FeatureCapabilityGate-BAOroN-j.js +82 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-Xapa8xyy.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Q8Mptiv3.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CgbvPK8u.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CE1_yyHe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DnCj1qv6.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CGJi3f86.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CUb4VGOc.js} +2 -2
  21. package/dist/{FmMultiselectDialog-DCaRlBIy.js → FmMultiselectDialog-Bz8bNuK2.js} +2 -2
  22. package/dist/FmMultiselectDialog-CosTDuNE.js +123 -0
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-ClaLVtpK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-3OrHiybe.js} +105 -99
  24. package/dist/ImportView-BoTmcCyn.js +1540 -0
  25. package/dist/{IngredientsView-DPj9lBTK.js → IngredientsView-VED94pGW.js} +691 -689
  26. package/dist/{IntegrationExplorerView-CO2wpUR_.js → IntegrationExplorerView-B9ZY9hG1.js} +1537 -1620
  27. package/dist/IntegrationPlatformView-Bar1zj3R.js +13385 -0
  28. package/dist/{IntegrationView-DIeZoey0.js → IntegrationView-BvzBDBGp.js} +2604 -2565
  29. package/dist/{InventoryBindingForm-Cj4_Chue.js → InventoryBindingForm-DWhXHIaL.js} +1 -1
  30. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-mZRrPywY.js +472 -0
  31. package/dist/{InventoryBindingSummary-yzGzd7jJ.js → InventoryBindingSummary-Imo2J8O2.js} +1 -1
  32. package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
  33. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CChCnKxa.js +79 -0
  34. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
  35. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js +79 -0
  36. package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
  37. package/dist/ProductionRunDetailPage-KFKeWhhY.js +2317 -0
  38. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BYyiiAWb.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CobaPkUr.js} +3053 -3163
  39. package/dist/ProductionRunPage-BrXsPo-A.js +954 -0
  40. package/dist/{PublishView-CPK9NeVF.js → PublishView-_k3N44Pl.js} +3 -3
  41. package/dist/{PurchaseOrderPrintPreview-DosqWQeN.js → PurchaseOrderPrintPreview-DXVEhy-G.js} +17 -17
  42. package/dist/{ReceiveRequestView-BxSkpK2t.js → ReceiveRequestView-ByWddqiL.js} +17 -16
  43. package/dist/RecipeView-C29uNZxj.js +3272 -0
  44. package/dist/SettingsView-CyE6ZM8x.js +1005 -0
  45. package/dist/StockView-BBR404Ie.js +3003 -0
  46. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-GdGJCuc0.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cmnk66T9.js} +1 -1
  47. package/dist/{SupplierView-BKxKoi_0.js → SupplierView-CIB5GCwp.js} +304 -301
  48. package/dist/{SurchargeView-Db4cwhZv.js → SurchargeView-DNtEbO7I.js} +7 -7
  49. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CpkF77Ow.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-ClCi5rLI.js} +2 -2
  50. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
  51. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C19KOLrQ.js +332 -0
  52. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DD5nMsrn.js +4953 -0
  53. package/dist/TransferTemplateView-BftwH1_W.js +2347 -0
  54. package/dist/{UnitCostHistoryView-CqcyjCCd.js → UnitCostHistoryView-CE-1joTV.js} +4 -4
  55. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DO80_8SZ.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-reJFavQF.js} +4 -4
  56. package/dist/{UnitView-BqdK1AM_.js → UnitView-T-Vo8IpV.js} +111 -106
  57. package/dist/{WarehouseView-COJM9IXM.js → WarehouseView-CzQcj5VY.js} +12 -11
  58. package/dist/{WastageTemplateView-DW3viTHN.js → WastageTemplateView-Cm5_V2zN.js} +19 -18
  59. package/dist/api/bill.d.ts +4 -2
  60. package/dist/api/bill.spec.d.ts +1 -0
  61. package/dist/api/closing.d.ts +1 -0
  62. package/dist/api/feature-flags.d.ts +4 -0
  63. package/dist/api/integration-sync-log.d.ts +0 -13
  64. package/dist/api/license.d.ts +0 -2
  65. package/dist/api/netsuite-explorer.d.ts +1 -0
  66. package/dist/api/stock.d.ts +1 -1
  67. package/dist/{app-yvK__CBL.js → app-DnOtng5V.js} +10177 -10126
  68. package/dist/app.d.ts +151 -164
  69. package/dist/app.js +1 -1
  70. package/dist/bulk-edit-simulation.helper-BZRyNbpM.js +178 -0
  71. package/dist/{closing-template-DezidSM0.js → closing-template-BiJRchG9.js} +4 -4
  72. package/dist/components/FeatureCapabilityBadge.vue.d.ts +4 -0
  73. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  74. package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
  75. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  76. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  77. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  78. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  79. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  80. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  81. package/dist/components/FmUnitInputProps.d.ts +1 -0
  82. package/dist/components/FmUnitInputRules.d.ts +1 -1
  83. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  84. package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
  85. package/dist/{views/ingredient-group/IngredientGroupView.vue.d.ts → components/PremiumUpgradePage.vue.d.ts} +0 -1
  86. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  87. package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
  88. package/dist/composable/defineApi.d.ts +1 -1
  89. package/dist/{date2-2XjepIqc.js → date2-Bzlk0lSj.js} +1 -1
  90. package/dist/{dayjs.min-CNp5DLBB.js → dayjs.min-B8gqMYa7.js} +1 -1
  91. package/dist/{decimal-Z7oJdGk8.js → decimal-utE08Cjv.js} +2 -2
  92. package/dist/{defineDeepModel-CMxJn_H2.js → defineDeepModel-D_tKNP-n.js} +5 -5
  93. package/dist/{duplicate-template-BetV5oy_.js → duplicate-template-lCi99jVD.js} +1 -1
  94. package/dist/{feature-CkWaZ-5K.js → feature-Zeyz4pJe.js} +2089 -2854
  95. package/dist/feature-flags/core.d.ts +4 -2
  96. package/dist/feature-flags/portal-feature-catalog.d.ts +1 -6
  97. package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
  98. package/dist/feature-flags/vue.d.ts +24 -1
  99. package/dist/feature-flags/vue.spec.d.ts +1 -0
  100. package/dist/{format-time-from-id-DatSI9uD.js → format-time-from-id-v_KvI4jM.js} +1 -1
  101. package/dist/{format-unit-display-DM5We5cx.js → format-unit-display-C8oexlpM.js} +209 -208
  102. package/dist/helper/country.spec.d.ts +1 -0
  103. package/dist/helper/menu-usage-module.d.ts +2 -1
  104. package/dist/helper/number.d.ts +5 -1
  105. package/dist/helper/rules.d.ts +1 -1
  106. package/dist/{id-to-date-Dxw2jKhy.js → id-to-date-Doi1vn9Q.js} +1 -1
  107. package/dist/{import-export.helper-BOmADwUw.js → import-export.helper-DyRPa4wa.js} +17 -17
  108. package/dist/{index-CIH9NCvs.js → index-B-SVjo8N.js} +1 -1
  109. package/dist/{index-ClYgfwW7.js → index-Bl8qrC1m.js} +2234 -2163
  110. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  111. package/dist/{index-7fz5sGDO.js → index-DZ9i-1uy.js} +3 -3
  112. package/dist/index-eGvSlWMU.js +1892 -0
  113. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  114. package/dist/{lz-string-CCsc2X7t.js → lz-string-pPNhTzCj.js} +1 -1
  115. package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
  116. package/dist/{netsuite-COumFXC2.js → netsuite-C5s0JXRA.js} +254 -263
  117. package/dist/netsuite-explorer-BF-bujxD.js +79 -0
  118. package/dist/{predefined-templates-Bw9A9LNA.js → predefined-templates-C6hmqqhm.js} +1 -1
  119. package/dist/production-run-list-DR1WsaBR.js +61 -0
  120. package/dist/{purchase-order-template-BaZjdGq8.js → purchase-order-template-C0XlITpK.js} +1 -1
  121. package/dist/{recalculationUtils-t32wAurN.js → recalculationUtils-CnzCEyIJ.js} +1 -1
  122. package/dist/router/name.d.ts +2 -2
  123. package/dist/{row-action.enum-BDeudY4d.js → row-action.enum-Ci5mHFdS.js} +1 -1
  124. package/dist/rules-rAD4INHX.js +243 -0
  125. package/dist/{stock-B59sfN28.js → stock-CukGlv0u.js} +1 -1
  126. package/dist/stock-DUQYl3xe.js +78 -0
  127. package/dist/stores/feature.d.ts +41 -11
  128. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  129. package/dist/stores/inventory.d.ts +0 -47
  130. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  131. package/dist/stores/supplier.d.ts +1 -1
  132. package/dist/stores/warehouse.d.ts +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/{supplier-DnbLJ_cS.js → supplier-CDPdi2B5.js} +2 -2
  135. package/dist/{surcharge-C1uE3uQa.js → surcharge-XABFccMt.js} +1 -1
  136. package/dist/tsconfig.app.tsbuildinfo +1 -1
  137. package/dist/{uom-rules-DjfyrFHJ.js → uom-rules-BbNTM-Xw.js} +1 -1
  138. package/dist/{use-ingredient-select-dialog-7A7fWyEH.js → use-ingredient-select-dialog-CxrFXfoM.js} +2 -2
  139. package/dist/use-inventory-binding-dialog-BZpguHE1.js +113 -0
  140. package/dist/{use-template-enabled-locations-C-Hqqgzt.js → use-template-enabled-locations-B9n-uc36.js} +2 -2
  141. package/dist/{use-transfer-locations-CqsXvOI2.js → use-transfer-locations-z78M6XgR.js} +14 -14
  142. package/dist/{useHrmPermission-BzwD3Ctc.js → useHrmPermission-CfMWeFGZ.js} +1 -1
  143. package/dist/{useNavigationMenu-PrZg9HS7.js → useNavigationMenu-B6dCSflb.js} +111 -117
  144. package/dist/{useSseClient-FCyLWq8k.js → useSseClient-ICUObHUB.js} +1 -1
  145. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  146. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1 -1
  147. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  148. package/dist/views/import/helper/submit-rows.d.ts +1 -1
  149. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  150. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  151. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  152. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  153. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  154. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
  155. package/dist/views/{ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts → integration/IntegrationPlatformView.vue.d.ts} +11 -24
  156. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  157. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  158. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  159. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  160. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  161. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
  162. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  163. package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
  164. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
  165. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
  166. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
  167. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
  168. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
  169. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
  170. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
  171. package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
  172. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
  173. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  174. package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
  175. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  176. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  177. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  178. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  179. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  180. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  181. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  182. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +9 -9
  183. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  184. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
  185. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  186. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  187. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  188. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +20 -20
  189. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  190. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +2 -2
  191. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  192. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  193. package/dist/views/recipe/helper/import-recipe.d.ts +32 -2
  194. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  195. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  196. package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
  197. package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
  198. package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
  199. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  200. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
  201. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
  202. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  203. package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
  204. package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
  205. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  206. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  207. package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
  208. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  209. package/dist/vue-DBxqzbt5.js +295 -0
  210. package/dist/{vue-i18n-C34f-Tph.js → vue-i18n-CdbY8MsR.js} +539 -539
  211. package/dist/{xlsx.util-X4amwe_k.js → xlsx.util-CD5NablT.js} +2 -2
  212. package/package.json +71 -66
  213. package/dist/App-DVHgBTHP.js +0 -1499
  214. package/dist/BulkReceiveRequestView-DxHWrfbi.js +0 -2656
  215. package/dist/ClosingHistoryView-kdpYGy1Y.js +0 -761
  216. package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-5Cc08Svt.js +0 -58
  217. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-C1C8aDA6.js +0 -61
  218. package/dist/FmMultiselectDialog-yVPY5aBV.js +0 -77
  219. package/dist/ImportView-DQrVMzxN.js +0 -1302
  220. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-7lT5UZc8.js +0 -51
  221. package/dist/IngredientGroupView-BMUnEaY7.js +0 -1000
  222. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CaBOK7NC.js +0 -563
  223. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DzzTPdyF.js +0 -72
  224. package/dist/ProductionRunDetailView-Cw-ecaey.js +0 -2312
  225. package/dist/ProductionRunView-C11eseXQ.js +0 -930
  226. package/dist/RecipeView-oHDWsT0P.js +0 -3624
  227. package/dist/SettingsView-QlUNwFhM.js +0 -983
  228. package/dist/StockView-a8LbVZ_7.js +0 -2614
  229. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  230. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CCCj4WVF.js +0 -299
  231. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CFNPXqt5.js +0 -4796
  232. package/dist/TransferTemplateView-CzwxOBMQ.js +0 -2326
  233. package/dist/menu-usage-module-BdjYEk3s.js +0 -57
  234. package/dist/number-gSLvxNqA.js +0 -138
  235. package/dist/portal-feature-catalog-yGIESKTc.js +0 -246
  236. package/dist/random-CSbEbElR.js +0 -10
  237. package/dist/rules-C1btu0Md.js +0 -98
  238. package/dist/stock-BF86TMW0.js +0 -75
  239. package/dist/use-inventory-binding-dialog-Cc1tjTfV.js +0 -152
  240. package/dist/usePromise-CbVUCxhj.js +0 -29
  241. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  242. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  243. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  244. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  245. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  246. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  247. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
  248. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
@@ -0,0 +1,1540 @@
1
+ import { defineComponent as Oe, ref as z, computed as Z, watch as Ve, resolveComponent as ne, createElementBlock as F, openBlock as R, createVNode as O, createCommentVNode as Q, unref as l, normalizeClass as ve, createSlots as qe, withCtx as X, createElementVNode as t, createBlock as ue, toDisplayString as a, Fragment as Se, renderList as Re, shallowRef as Me, h as we, createTextVNode as C } from "vue";
2
+ import { u as Ke, _ as Ne } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
+ import { useCoreStore as $e, useI18n as ze } from "@feedmepos/mf-common";
4
+ import { useDialogChild as Je, useSnackbar as Pe, useDialog as Xe, useBreakpoints as Qe } from "@feedmepos/ui-library";
5
+ import { u as Ye } from "./feature-Zeyz4pJe.js";
6
+ import { a as ce, s as Ze, _ as et } from "./app-DnOtng5V.js";
7
+ import "./dayjs.min-B8gqMYa7.js";
8
+ import "./app-C39bYJmq.js";
9
+ import "./FmAdminBadge-DlplQOHb.js";
10
+ import { s as We, a as tt, d as nt, t as Ue, r as rt } from "./xlsx.util-CD5NablT.js";
11
+ import { s as ot, c as st, g as it, b as at, d as Fe } from "./import-export.helper-DyRPa4wa.js";
12
+ import { s as lt, a as fe } from "./rules-rAD4INHX.js";
13
+ import { n as ke } from "./bulk-edit-simulation.helper-BZRyNbpM.js";
14
+ import { F as ut } from "./FmDroppableField-J0tG_U3w.js";
15
+ function* mt(u) {
16
+ for (; ; )
17
+ yield u[Math.floor(Math.random() * u.length)];
18
+ }
19
+ function dt(u = 4, e = mt("qwertyuiopasdfghjklzxcvbnm".split(""))) {
20
+ return Array.from({ length: u }).map(() => e.next().value).join("");
21
+ }
22
+ function Ee() {
23
+ return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${dt()}`;
24
+ }
25
+ function ct(u) {
26
+ const [
27
+ e,
28
+ p,
29
+ d,
30
+ m,
31
+ h,
32
+ c,
33
+ ...r
34
+ ] = We(u);
35
+ if (!e || !e.length || e.some((x) => x.length && !x.startsWith("system:")))
36
+ throw new Error("Missing meta header. Excel file does not come from the template.");
37
+ const s = e.map((x) => x.split(":")[1]), g = ["name", "symbol", "precision"].filter((x) => !s.includes(x));
38
+ if (g.length)
39
+ throw new Error(
40
+ `Missing meta headers (${g.join()}). Excel file does not come from the template.`
41
+ );
42
+ return r.map((x, w) => {
43
+ const y = {};
44
+ for (const b in s) {
45
+ const i = s[b];
46
+ Object.assign(y, { [i]: x[b] });
47
+ }
48
+ return {
49
+ index: w,
50
+ data: y
51
+ };
52
+ });
53
+ }
54
+ function pt(u) {
55
+ try {
56
+ const e = ct(u).filter((r) => {
57
+ const { name: s, symbol: o, precision: g, measurement_name: v, measurement_symbol: x, measurement_conversion: w } = r.data;
58
+ return s || o || g || v || x || w;
59
+ }), d = ce().units, m = [], h = [], c = {};
60
+ for (const r of e)
61
+ if (r.data.name && r.data.symbol)
62
+ c[r.data.name] = {
63
+ unit: {
64
+ name: r.data.name,
65
+ abbrev: r.data.symbol,
66
+ precision: Math.max(0, Math.min(10, Math.floor(r.data.precision || 2))),
67
+ measurements: []
68
+ },
69
+ rowNumber: r.index
70
+ }, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && c[r.data.name].unit.measurements.push({
71
+ id: Ee(),
72
+ name: r.data.measurement_name,
73
+ abbrev: r.data.measurement_symbol,
74
+ conversion: {
75
+ amount: Math.round(r.data.measurement_conversion * Math.pow(10, c[r.data.name].unit.precision)),
76
+ precision: c[r.data.name].unit.precision
77
+ }
78
+ });
79
+ else {
80
+ const s = Object.keys(c)[Object.keys(c).length - 1];
81
+ s && c[s] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && c[s].unit.measurements.push({
82
+ id: Ee(),
83
+ name: r.data.measurement_name,
84
+ abbrev: r.data.measurement_symbol,
85
+ conversion: {
86
+ amount: Math.round(r.data.measurement_conversion * Math.pow(10, c[s].unit.precision)),
87
+ precision: c[s].unit.precision
88
+ }
89
+ });
90
+ }
91
+ for (const [r, { unit: s, rowNumber: o }] of Object.entries(c)) {
92
+ const g = d.find((v) => {
93
+ var x, w;
94
+ return v.abbrev === s.abbrev && ((x = v.name) == null ? void 0 : x.trim()) === ((w = s.name) == null ? void 0 : w.trim());
95
+ });
96
+ g ? h.push({
97
+ type: "update",
98
+ original: g,
99
+ unit: {
100
+ ...g,
101
+ name: s.name || g.name,
102
+ abbrev: s.abbrev || g.abbrev,
103
+ precision: s.precision !== void 0 ? s.precision : g.precision,
104
+ measurements: s.measurements.map((v) => {
105
+ const x = g.measurements.find((w) => w.name === v.name && w.abbrev === v.abbrev);
106
+ return x ? { ...x, ...v, id: x.id } : { ...v, id: Ee() };
107
+ })
108
+ },
109
+ errors: [],
110
+ excelRowNumber: o
111
+ }) : m.push({
112
+ type: "create",
113
+ unit: {
114
+ ...s,
115
+ measurements: s.measurements.map((v) => ({ ...v, id: Ee() }))
116
+ },
117
+ errors: [],
118
+ excelRowNumber: o
119
+ });
120
+ }
121
+ return {
122
+ invalidExcel: !1,
123
+ importCreateResult: m,
124
+ importUpdateResult: h
125
+ };
126
+ } catch (e) {
127
+ return {
128
+ invalidExcel: !0,
129
+ invalidExcelMessage: (e == null ? void 0 : e.message) ?? "Invalid excel",
130
+ importCreateResult: [],
131
+ importUpdateResult: []
132
+ };
133
+ }
134
+ }
135
+ const vt = /^(\S+)\s+(not in|in)\s+(.+)$/i;
136
+ function yt(u) {
137
+ const e = u.trim();
138
+ if (e.startsWith("{")) {
139
+ const p = JSON.parse(e);
140
+ if (!p || typeof p != "object" || Array.isArray(p))
141
+ throw new Error(`Invalid rules '${e}'. JSON rules must be an object`);
142
+ return p;
143
+ }
144
+ return {
145
+ $and: e.split(";").map((p) => p.trim()).filter(Boolean).map((p) => {
146
+ const d = p.match(vt);
147
+ if (!d)
148
+ throw new Error(`Invalid rule '${p}'. Use '<attribute> in <value>, <value>'`);
149
+ const [, m, h, c] = d;
150
+ return {
151
+ [m]: {
152
+ [h.toLowerCase() === "in" ? "$in" : "$nin"]: c.split(",").map((r) => r.trim()).filter(Boolean)
153
+ }
154
+ };
155
+ })
156
+ };
157
+ }
158
+ function Ae(u) {
159
+ if (!u || !ke(u)) return "";
160
+ const p = (Array.isArray(u.$and) && Object.keys(u).length === 1 ? u.$and : [u]).map((d) => {
161
+ const m = Object.entries(d ?? {});
162
+ if (m.length !== 1) return null;
163
+ const [h, c] = m[0], r = c && typeof c == "object" ? Object.entries(c) : [];
164
+ if (h.startsWith("$") || r.length !== 1) return null;
165
+ const [s, o] = r[0];
166
+ return s !== "$in" && s !== "$nin" || !Array.isArray(o) || o.some((g) => typeof g != "string" || /[,;]/.test(g)) ? null : `${h} ${s === "$in" ? "in" : "not in"} ${o.join(", ")}`;
167
+ });
168
+ return p.every(Boolean) ? p.join("; ") : JSON.stringify(u);
169
+ }
170
+ function Ie(u) {
171
+ if (!u || !ke(u)) return null;
172
+ const e = Array.isArray(u.$and) && Object.keys(u).length === 1 ? u.$and : Object.entries(u).map(([p, d]) => ({ [p]: d }));
173
+ return JSON.stringify(e.map((p) => JSON.stringify(p)).sort());
174
+ }
175
+ function gt(u, e, p) {
176
+ const d = [...u], m = /* @__PURE__ */ new Set(), h = [];
177
+ for (const c of e) {
178
+ const r = u.map((v, x) => ({ b: v, index: x })).filter(({ b: v }) => v.type === c.type && v.id === c.id), s = c.rules ? r.filter(({ b: v }) => Ie(v.rules) === Ie(c.rules)) : [], o = s.length ? s : r.length === 1 ? r : [];
179
+ if (r.length > 1 && o.length !== 1) {
180
+ h.push(
181
+ `${p(c)}: item is bound ${r.length} times in this recipe, set Rules to the exact rules of the binding to update`
182
+ );
183
+ continue;
184
+ }
185
+ if (!o.length) {
186
+ d.push(c);
187
+ continue;
188
+ }
189
+ const { index: g } = o[0];
190
+ if (m.has(g)) {
191
+ h.push(`${p(c)}: another row already updates this binding`);
192
+ continue;
193
+ }
194
+ m.add(g), d[g] = {
195
+ ...d[g],
196
+ amount: c.amount,
197
+ measurement: c.measurement,
198
+ ...c.rules && Ie(c.rules) !== Ie(d[g].rules) ? { rules: c.rules } : {}
199
+ };
200
+ }
201
+ return { contains: d, errors: h };
202
+ }
203
+ function Be(u, e, p) {
204
+ var s, o;
205
+ const d = u.type === "SKU" ? e[u.id] : void 0, m = u.type === "SKU" ? d ? `${d.code} ${d.name}` : `SKU ${u.id}` : `Recipe ${((s = p[u.id]) == null ? void 0 : s.name) ?? u.id}`, h = ((o = u.measurement) == null ? void 0 : o.abbrev) ?? (d == null ? void 0 : d.unit.abbrev) ?? "UNIT", c = Ae(u.rules), r = (u.alternatives ?? []).map((g) => {
206
+ var v;
207
+ return `${((v = e[g._id]) == null ? void 0 : v.code) ?? g._id} (p${g.priority ?? "-"})`;
208
+ }).join(", ");
209
+ return {
210
+ item: m,
211
+ qty: `${+fe(u.amount)} ${h}`,
212
+ extra: [c && `rules: ${c}`, r && `alt ${r}`].filter(Boolean).join(" · ")
213
+ };
214
+ }
215
+ function je(u, e) {
216
+ const { skuById: p, recipeById: d } = ce(), m = e.contains.map((c, r) => {
217
+ const s = Be(c, p, d), o = u == null ? void 0 : u.contains[r];
218
+ if (!o) return { status: "added", item: s.item, qtyAfter: s.qty, extraAfter: s.extra };
219
+ const g = Be(o, p, d);
220
+ return {
221
+ status: g.qty === s.qty && g.extra === s.extra ? "same" : "changed",
222
+ item: s.item,
223
+ qtyBefore: g.qty,
224
+ qtyAfter: s.qty,
225
+ extraBefore: g.extra,
226
+ extraAfter: s.extra
227
+ };
228
+ }), h = (c) => st(c.customAttributes);
229
+ return u && h(u) !== h(e) && m.push({
230
+ status: "changed",
231
+ item: "Custom attributes",
232
+ qtyAfter: "",
233
+ extraBefore: h(u),
234
+ extraAfter: h(e)
235
+ }), m;
236
+ }
237
+ const Ge = 5;
238
+ function Te(u, e) {
239
+ return Object.entries(u).every(([p, d]) => {
240
+ if (p === "$and") return d.every((h) => Te(h, e));
241
+ if (p === "$or") return d.some((h) => Te(h, e));
242
+ if (p.startsWith("$")) throw new Error(`unsupported rule operator ${p}`);
243
+ const m = e[p] == null ? void 0 : String(e[p]);
244
+ return !d || typeof d != "object" ? String(d) === m : Object.entries(d).every(([h, c]) => {
245
+ const r = () => m !== void 0 && c.map(String).includes(m);
246
+ if (h === "$in") return r();
247
+ if (h === "$nin") return !r();
248
+ if (h === "$eq") return String(c) === m;
249
+ if (h === "$ne") return String(c) !== m;
250
+ throw new Error(`unsupported rule operator ${h}`);
251
+ });
252
+ });
253
+ }
254
+ function De(u) {
255
+ if (!u.some((m) => ke(m.rules))) return [];
256
+ const e = $e().restaurants.value;
257
+ let p;
258
+ try {
259
+ p = e.filter((m) => {
260
+ const h = et.buildCustomAttributeContext({
261
+ profile: m.profile,
262
+ settingCustomAttributes: m.customAttributes ?? null
263
+ });
264
+ return !u.some((c) => !ke(c.rules) || Te(c.rules, h));
265
+ }).map(
266
+ (m) => m.profile.code ? `${m.profile.name} (${m.profile.code})` : m.profile.name
267
+ );
268
+ } catch (m) {
269
+ return [`Rules cannot be checked against outlets: ${m.message}`];
270
+ }
271
+ if (!p.length) return [];
272
+ const d = p.length - Ge;
273
+ return [
274
+ `Rules leave ${p.length} of ${e.length} outlets with zero bindings: ${p.slice(0, Ge).join(", ")}${d > 0 ? ` +${d}` : ""}`
275
+ ];
276
+ }
277
+ function ft(u, { ignoreErrors: e = !1 } = {}) {
278
+ var p, d;
279
+ try {
280
+ const m = ce(), h = m.skuByCode, c = m.recipeByName, r = m.units, s = [], o = {}, g = /* @__PURE__ */ new Map();
281
+ for (const i of u) {
282
+ const E = [];
283
+ let A = "";
284
+ if (i.data.type === "INGREDIENT") {
285
+ const N = h[i.data.code];
286
+ N ? A = N._id : E.push(`Ingredient with code '${i.data.code}' not found`);
287
+ } else if (i.data.type === "RECIPE") {
288
+ const N = c[i.data.name];
289
+ N ? A = N._id : E.push(`Recipe with name '${i.data.name}' not found`);
290
+ } else
291
+ E.push(`Invalid type '${i.data.type}'. Must be 'INGREDIENT' or 'RECIPE'`);
292
+ const T = !!i.data.amount && lt(i.data.amount);
293
+ T || E.push(`Invalid amount '${i.data.amount}'. Must be a valid number`);
294
+ let B;
295
+ (i.data.unit || i.data.baseUnit) && i.data.type !== "RECIPE" && (B = r.find((N) => {
296
+ var H, q;
297
+ return N.abbrev === i.data.baseUnit && ((H = N.name) == null ? void 0 : H.trim()) === ((q = i.data.unit) == null ? void 0 : q.trim());
298
+ }), B || (i.data.baseUnit && i.data.unit ? E.push(`Cannot find unit with symbol '${i.data.baseUnit}' and name '${i.data.unit}'`) : i.data.baseUnit ? E.push(`Cannot find unit with symbol '${i.data.baseUnit}'`) : i.data.unit && E.push(`Cannot find unit with name '${i.data.unit}'`)));
299
+ let j;
300
+ if ((p = i.data.rules) != null && p.trim())
301
+ try {
302
+ j = yt(i.data.rules);
303
+ } catch (N) {
304
+ E.push(N instanceof Error ? N.message : `Invalid rules '${i.data.rules}'`);
305
+ }
306
+ if (E.length > 0 && s.push(`Row ${i.index + 6}: ${E.join(", ")}`), e || E.length === 0) {
307
+ let N;
308
+ i.data.type === "RECIPE" ? N = void 0 : N = (d = B == null ? void 0 : B.measurements) == null ? void 0 : d.find((P) => P.abbrev === i.data.measurementName);
309
+ const H = T ? {
310
+ type: i.data.type === "INGREDIENT" ? "SKU" : i.data.type,
311
+ id: A,
312
+ amount: Ze.fromNumber(+i.data.amount),
313
+ measurement: N || void 0,
314
+ ...j ? { rules: j } : {}
315
+ } : null;
316
+ H && g.set(H, i.index);
317
+ const q = E.length > 0 ? `Row ${i.index + 6}: ${E.join(", ")}` : null;
318
+ if (i.data.recipeName)
319
+ o[i.data.recipeName] = {
320
+ name: i.data.recipeName,
321
+ customAttributes: i.data.customAttributes ? ot(i.data.customAttributes) : {},
322
+ contains: H ? [H] : []
323
+ }, s[i.data.recipeName] = q ?? [];
324
+ else {
325
+ const P = Object.keys(o)[Object.keys(o).length - 1];
326
+ if (P && o[P]) {
327
+ o[P] = {
328
+ ...o[P],
329
+ contains: H ? [...o[P].contains, H] : o[P].contains
330
+ };
331
+ const re = s[P], oe = typeof re == "string" && re.length > 0;
332
+ q ? s[P] = oe ? `${re}, ${q}` : q : oe || (s[P] = []);
333
+ }
334
+ }
335
+ }
336
+ }
337
+ const v = Object.values(o), x = v.filter((i) => !c[i.name]), w = v.filter((i) => c[i.name]), y = x.map((i, E) => {
338
+ const A = s[i.name];
339
+ return {
340
+ type: "create",
341
+ recipe: i,
342
+ // Type assertion - _id will be assigned by backend
343
+ errors: A,
344
+ warnings: A.length ? [] : De(i.contains),
345
+ changes: je(void 0, i),
346
+ excelRowNumber: E + 6
347
+ // Assuming header rows
348
+ };
349
+ }), b = w.map((i, E) => {
350
+ const A = c[i.name], T = gt(
351
+ A.contains,
352
+ i.contains,
353
+ (N) => `Row ${g.get(N) + 6}`
354
+ );
355
+ s.push(...T.errors);
356
+ const B = T.errors.length ? [s[i.name], ...T.errors].filter((N) => N.length).join(", ") : s[i.name], j = {
357
+ ...A,
358
+ name: i.name || A.name,
359
+ contains: T.contains,
360
+ customAttributes: { ...A.customAttributes, ...i.customAttributes }
361
+ };
362
+ return {
363
+ type: "update",
364
+ original: A,
365
+ recipe: j,
366
+ errors: B,
367
+ warnings: B.length ? [] : De(T.contains),
368
+ changes: je(A, j),
369
+ excelRowNumber: E + 6
370
+ };
371
+ });
372
+ return {
373
+ invalidExcel: s.length > 0,
374
+ invalidExcelMessage: s.length > 0 ? `Import completed with ${s.length} error(s): ${s.join("; ")}` : void 0,
375
+ importCreateResult: y,
376
+ importUpdateResult: b
377
+ };
378
+ } catch (m) {
379
+ return {
380
+ invalidExcel: !0,
381
+ invalidExcelMessage: m instanceof Error ? m.message : "Unknown error occurred",
382
+ importCreateResult: [],
383
+ importUpdateResult: []
384
+ };
385
+ }
386
+ }
387
+ function ht(u) {
388
+ const [
389
+ e,
390
+ p,
391
+ d,
392
+ m,
393
+ h,
394
+ c,
395
+ ...r
396
+ ] = We(u);
397
+ if (!e || !e.length || e.some((x) => x.length && !x.startsWith("system:")))
398
+ throw new Error("Missing meta header. Excel file does not come from the template.");
399
+ const s = e.map((x) => x.split(":")[1]), g = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((x) => !s.includes(x));
400
+ if (g.length)
401
+ throw new Error(
402
+ `Missing meta headers (${g.join()}). Excel file does not come from the template.`
403
+ );
404
+ return r.map((x, w) => {
405
+ const y = {};
406
+ for (const b in s) {
407
+ const i = s[b];
408
+ Object.assign(y, { [i]: x[b] });
409
+ }
410
+ return {
411
+ index: w,
412
+ data: y
413
+ };
414
+ }).filter((x) => {
415
+ const { recipeName: w, type: y, code: b, name: i, amount: E, unit: A, baseUnit: T, measurementName: B, customAttributes: j } = x.data;
416
+ return w || y || b || i || E || A || T || B || j;
417
+ });
418
+ }
419
+ function bt() {
420
+ const e = $e().currentBusiness.value, p = ce(), d = [
421
+ { id: "name", name: "Unit Name" },
422
+ { id: "symbol", name: "Symbol" },
423
+ { id: "precision", name: "Precision" },
424
+ { id: "measurement_name", name: "Measurement Symbol" },
425
+ { id: "measurement_symbol", name: "Measurement Symbol" },
426
+ { id: "measurement_conversion", name: "Measurement Conversion" }
427
+ ];
428
+ let m = [];
429
+ p.units.length > 0 ? p.units.forEach((r) => {
430
+ if (r.measurements.length === 0)
431
+ m.push([
432
+ r.name,
433
+ r.abbrev,
434
+ r.precision,
435
+ "",
436
+ "",
437
+ ""
438
+ ]);
439
+ else {
440
+ m.push([
441
+ r.name,
442
+ r.abbrev,
443
+ r.precision,
444
+ r.measurements[0].name,
445
+ r.measurements[0].abbrev,
446
+ +fe(r.measurements[0].conversion)
447
+ ]);
448
+ for (let s = 1; s < r.measurements.length; s++)
449
+ m.push([
450
+ "",
451
+ "",
452
+ "",
453
+ r.measurements[s].name,
454
+ r.measurements[s].abbrev,
455
+ +fe(r.measurements[s].conversion)
456
+ ]);
457
+ }
458
+ }) : m = [
459
+ ["Length", "m", 2, "Meter", "m", 1],
460
+ ["", "", "", "Centimeter", "cm", 0.01],
461
+ ["", "", "", "Millimeter", "mm", 1e-3],
462
+ ["Weight", "kg", 3, "Kilogram", "kg", 1],
463
+ ["", "", "", "Gram", "g", 1e-3],
464
+ ["", "", "", "Pound", "lb", 0.453592]
465
+ ];
466
+ const h = [
467
+ ["Business name:", e == null ? void 0 : e.name],
468
+ ["Business ID:", e == null ? void 0 : e._id],
469
+ ["Menu version", e == null ? void 0 : e.menuVersion],
470
+ [],
471
+ d.map((r) => r.name),
472
+ ...m
473
+ ], c = d.map((r) => `system:${r.id}`);
474
+ return Ue(h, c);
475
+ }
476
+ function xt() {
477
+ const e = $e().currentBusiness.value, p = ce(), d = at();
478
+ let m = [];
479
+ p.skus.length > 0 ? m = p.skus.map((r) => {
480
+ var s, o, g, v, x, w, y, b;
481
+ return [
482
+ r.code,
483
+ r.name,
484
+ ((s = r.unit) == null ? void 0 : s.name) || "",
485
+ ((o = r.unit) == null ? void 0 : o.abbrev) || "",
486
+ ((v = (g = r.unit) == null ? void 0 : g.measurements.find((i) => i.id === r.trackingMeasurement)) == null ? void 0 : v.abbrev) ?? r.unit.abbrev,
487
+ r.valuation || "WAVG",
488
+ (x = r.defaultCost) != null && x.costPerUnit ? +fe((w = r.defaultCost) == null ? void 0 : w.costPerUnit) : 0,
489
+ ((y = r.thresholds) == null ? void 0 : y.low) ?? Fe().low,
490
+ ((b = r.thresholds) == null ? void 0 : b.mid) ?? Fe().mid,
491
+ r.customAttributes ? Object.entries(r.customAttributes).map(([i, E]) => `${i}:${E}`).join("|") : ""
492
+ ];
493
+ }) : m = [
494
+ ["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
495
+ ];
496
+ const h = [
497
+ ["Business name:", e == null ? void 0 : e.name],
498
+ ["Business ID:", e == null ? void 0 : e._id],
499
+ ["Menu version", e == null ? void 0 : e.menuVersion],
500
+ [],
501
+ d.map((r) => r.name),
502
+ ...m
503
+ ], c = d.map((r) => `system:${r.id}`);
504
+ return Ue(h, c);
505
+ }
506
+ function _t() {
507
+ const e = $e().currentBusiness.value, p = ce(), d = [
508
+ { id: "recipeName", name: "Recipe Name" },
509
+ { id: "type", name: "Type" },
510
+ { id: "code", name: "Code" },
511
+ { id: "name", name: "Item Name" },
512
+ { id: "amount", name: "Amount" },
513
+ { id: "unit", name: "Unit" },
514
+ { id: "baseUnit", name: "Unit Symbol" },
515
+ { id: "measurementName", name: "Measurement Symbol" },
516
+ { id: "customAttributes", name: "Custom Attributes" },
517
+ { id: "rules", name: "Rules" }
518
+ ];
519
+ let m = [];
520
+ if (p.recipes.length > 0) {
521
+ const r = p.recipeById, s = p.skuById;
522
+ m = p.recipes.flatMap((o) => {
523
+ var v;
524
+ const g = o.customAttributes ? Object.entries(o.customAttributes).map(([x, w]) => `${x}:${w}`).join("|") : "";
525
+ if ((v = o.contains) != null && v.length) {
526
+ const x = o.contains.filter((y) => y.type === "RECIPE"), w = o.contains.filter((y) => y.type === "SKU");
527
+ return [
528
+ ...x.map((y, b) => {
529
+ var i;
530
+ return [
531
+ b === 0 ? o.name : "",
532
+ "RECIPE",
533
+ "",
534
+ ((i = r[y.id]) == null ? void 0 : i.name) || "",
535
+ y.amount.amount,
536
+ "",
537
+ "unit",
538
+ "Unit",
539
+ b === 0 ? g : "",
540
+ Ae(y.rules)
541
+ ];
542
+ }),
543
+ ...w.map((y, b) => {
544
+ var i, E, A, T, B, j, N, H, q, P, re, oe, he, ye, be, xe;
545
+ return [
546
+ !x.length && b === 0 ? o.name : "",
547
+ "INGREDIENT",
548
+ ((i = s[y.id]) == null ? void 0 : i.code) || "",
549
+ ((E = s[y.id]) == null ? void 0 : E.name) || "",
550
+ +fe(y.amount),
551
+ y.measurement ? ((T = (A = s[y.id]) == null ? void 0 : A.unit) == null ? void 0 : T.name) || "" : ((j = (B = s[y.id]) == null ? void 0 : B.unit) == null ? void 0 : j.name) || "",
552
+ y.measurement ? ((H = (N = s[y.id]) == null ? void 0 : N.unit) == null ? void 0 : H.abbrev) || "" : ((P = (q = s[y.id]) == null ? void 0 : q.unit) == null ? void 0 : P.abbrev) || "",
553
+ y.measurement ? y.measurement.abbrev : ((ye = (he = (oe = (re = s[y.id]) == null ? void 0 : re.unit) == null ? void 0 : oe.measurements) == null ? void 0 : he.find((Ce) => {
554
+ var _e;
555
+ return Ce.id === ((_e = s[y.id]) == null ? void 0 : _e.trackingMeasurement);
556
+ })) == null ? void 0 : ye.abbrev) || ((xe = (be = s[y.id]) == null ? void 0 : be.unit) == null ? void 0 : xe.abbrev) || "",
557
+ !x.length && b === 0 ? g : "",
558
+ Ae(y.rules)
559
+ ];
560
+ })
561
+ ];
562
+ }
563
+ return [];
564
+ });
565
+ } else
566
+ m = [
567
+ ["Pizza Dough", "INGREDIENT", "FLOUR001", "Flour", "500", "Weight", "g", "Gram", "difficulty:easy, category:italian", ""],
568
+ ["", "INGREDIENT", "WATER001", "Water", "300", "Volume", "ml", "Milliliter", "", "outlet in OUTLET01, OUTLET02"],
569
+ ["", "INGREDIENT", "SALT001", "Salt", "10", "Weight", "g", "Gram", "", ""]
570
+ ];
571
+ const h = [
572
+ ["Business name:", e == null ? void 0 : e.name],
573
+ ["Business ID:", e == null ? void 0 : e._id],
574
+ ["Menu version", e == null ? void 0 : e.menuVersion],
575
+ [],
576
+ d.map((r) => r.name),
577
+ ...m
578
+ ], c = d.map((r) => `system:${r.id}`);
579
+ return Ue(h, c);
580
+ }
581
+ function wt() {
582
+ const u = tt({
583
+ unit: bt(),
584
+ ingredient: xt(),
585
+ recipe: _t()
586
+ }), e = "FeedMe comprehensive template.xlsx";
587
+ return nt(u, e), e;
588
+ }
589
+ async function Et(u) {
590
+ if (!u) return null;
591
+ try {
592
+ return pt(u);
593
+ } catch (e) {
594
+ throw console.error("Error in processUnitsSheet:", e), e;
595
+ }
596
+ }
597
+ async function It(u) {
598
+ if (!u) return null;
599
+ try {
600
+ return it(u);
601
+ } catch (e) {
602
+ throw console.error("Error in processIngredientsSheet:", e), e;
603
+ }
604
+ }
605
+ async function St(u) {
606
+ if (!u) return null;
607
+ try {
608
+ const e = ht(u);
609
+ return ft(e, { ignoreErrors: !0 });
610
+ } catch (e) {
611
+ throw console.error("Error in processRecipesSheet:", e), e;
612
+ }
613
+ }
614
+ function pe(u) {
615
+ return (u ?? []).filter((e) => !e.errors || e.errors.length === 0).map(({ errors: e, warnings: p, changes: d, ...m }) => m);
616
+ }
617
+ const Rt = { class: "flex flex-col gap-24" }, kt = { class: "flex flex-col gap-8" }, $t = { class: "flex flex-col flex-1 gap-4" }, Ct = { class: "fm-typo-en-body-md-600" }, Nt = {
618
+ key: 2,
619
+ class: "shrink-0"
620
+ }, At = {
621
+ key: 0,
622
+ class: "flex flex-col"
623
+ }, Tt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Ut = {
624
+ key: 0,
625
+ class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
626
+ }, Mt = { class: "fm-typo-en-body-lg-600" }, Ft = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bt = /* @__PURE__ */ Oe({
627
+ __name: "ImportDialog",
628
+ setup(u) {
629
+ const e = z(null), p = Je();
630
+ Pe();
631
+ const d = z(!1), m = z(new Array()), h = z(null), c = z([]), r = z([]), s = Z(() => !!m.value.length), o = Z(() => !!h.value && c.value.length > 0), { t: g } = ze();
632
+ async function v(y) {
633
+ m.value = [], h.value = null, c.value = [], r.value = [];
634
+ try {
635
+ d.value = !0;
636
+ const [b] = await Promise.all([
637
+ rt(y),
638
+ // fake buffer for UX
639
+ new Promise((i) => setTimeout(i, 1e3))
640
+ ]);
641
+ h.value = b, x();
642
+ } catch (b) {
643
+ console.error("Error parsing Excel file:", b), m.value.push((b == null ? void 0 : b.message) || "Unknown error occurred");
644
+ } finally {
645
+ d.value = !1;
646
+ }
647
+ }
648
+ function x() {
649
+ if (m.value = [], !h.value) return;
650
+ const b = ["unit", "ingredient", "recipe"].filter((i) => h.value.Sheets[i]);
651
+ if (b.length === 0) {
652
+ m.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
653
+ return;
654
+ }
655
+ c.value = b, p.emitData({ availableSheets: b, workbook: h.value });
656
+ }
657
+ Ve(e, (y) => {
658
+ y && v(y);
659
+ });
660
+ function w() {
661
+ if (!h.value || c.value.length === 0) return "";
662
+ const y = [];
663
+ return c.value.forEach((b) => {
664
+ switch (b) {
665
+ case "unit":
666
+ y.push("Units sheet found");
667
+ break;
668
+ case "ingredient":
669
+ y.push("Ingredients sheet found");
670
+ break;
671
+ case "recipe":
672
+ y.push("Recipes sheet found");
673
+ break;
674
+ }
675
+ }), y.length > 0 ? `Ready to process: ${y.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
676
+ }
677
+ return (y, b) => {
678
+ const i = ne("FmCircularProgress"), E = ne("FmIcon"), A = ne("FmButton");
679
+ return R(), F("div", Rt, [
680
+ O(ut, {
681
+ class: ve({
682
+ "w-full": !0,
683
+ "h-[200px]": !e.value
684
+ }),
685
+ accept: ".xlsx,.xls",
686
+ onFileUpload: b[0] || (b[0] = (T) => e.value = T),
687
+ label: l(g)("inventory.ingredient.import.uploadTemplate"),
688
+ "button-label": l(g)("inventory.ingredient.import.selectFile")
689
+ }, qe({ _: 2 }, [
690
+ e.value ? {
691
+ name: "default",
692
+ fn: X(({ openFileDialog: T }) => [
693
+ t("div", kt, [
694
+ t("div", {
695
+ class: ve([
696
+ "fm-corner-radius-md p-16 flex items-center gap-16",
697
+ {
698
+ "border border-fm-color-neutral-gray-100": d.value,
699
+ "border border-fm-color-neutral-gray-200": !d.value && !s.value,
700
+ "border border-fm-color-system-error-200": s.value
701
+ }
702
+ ])
703
+ }, [
704
+ d.value ? (R(), ue(i, {
705
+ key: 0,
706
+ size: "md",
707
+ color: "neutral-gray-200"
708
+ })) : (R(), ue(E, {
709
+ key: 1,
710
+ name: s.value ? "error" : "check_circle",
711
+ color: s.value ? "system-error-300" : "system-success-400",
712
+ size: "lg"
713
+ }, null, 8, ["name", "color"])),
714
+ t("div", $t, [
715
+ t("div", Ct, a(e.value.name), 1),
716
+ t("div", {
717
+ class: ve([
718
+ "fm-typo-en-body-sm-400",
719
+ {
720
+ "text-fm-color-system-error-300": s.value,
721
+ "text-fm-color-typo-secondary": !s.value
722
+ }
723
+ ])
724
+ }, a(s.value ? l(g)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
725
+ ]),
726
+ d.value ? Q("", !0) : (R(), F("div", Nt, [
727
+ O(A, {
728
+ label: l(g)("inventory.ingredient.import.replaceFile"),
729
+ variant: s.value ? "destructive" : "secondary",
730
+ "prepend-icon": s.value ? void 0 : "autorenew",
731
+ onClick: T
732
+ }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
733
+ ]))
734
+ ], 2),
735
+ m.value.length ? (R(), F("div", At, [
736
+ (R(!0), F(Se, null, Re(m.value, (B, j) => (R(), F("div", {
737
+ key: j,
738
+ class: "flex gap-8 items-center"
739
+ }, [
740
+ O(E, {
741
+ name: "error",
742
+ size: "sm",
743
+ color: "system-error-300"
744
+ }),
745
+ t("div", Tt, a(B), 1)
746
+ ]))), 128))
747
+ ])) : Q("", !0)
748
+ ])
749
+ ]),
750
+ key: "0"
751
+ } : void 0
752
+ ]), 1032, ["class", "label", "button-label"]),
753
+ o.value ? (R(), F("div", Ut, [
754
+ t("div", Mt, a(l(g)("inventory.ingredient.import.summary")), 1),
755
+ t("div", Ft, a(w()), 1)
756
+ ])) : Q("", !0)
757
+ ]);
758
+ };
759
+ }
760
+ }), jt = {
761
+ key: 0,
762
+ class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
763
+ }, Gt = { class: "flex items-start gap-12" }, Dt = { class: "flex flex-col gap-8" }, Ot = { class: "fm-typo-en-body-md-400 text-blue-800" }, zt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Pt = { class: "mb-8" }, Wt = ["innerHTML"], Ht = ["innerHTML"], Lt = { class: "mb-8" }, Vt = { class: "mb-12" }, qt = { class: "mb-12" }, Kt = { class: "mb-8" }, Jt = { class: "text-orange-600" }, Xt = {
764
+ key: 1,
765
+ class: "bg-white rounded-lg shadow"
766
+ }, Qt = { class: "flex items-center justify-between p-16 border-b" }, Yt = { class: "fm-typo-en-title-md-600" }, Zt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, en = {
767
+ key: 0,
768
+ class: "text-red-600"
769
+ }, tn = {
770
+ key: 1,
771
+ class: "text-orange-600"
772
+ }, nn = {
773
+ key: 2,
774
+ class: "text-green-600"
775
+ }, rn = { class: "flex gap-8" }, on = { class: "p-16" }, sn = {
776
+ key: 2,
777
+ class: "bg-white rounded-lg shadow"
778
+ }, an = { class: "flex items-center justify-between p-16 border-b" }, ln = { class: "fm-typo-en-title-md-600 text-red-800" }, un = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, mn = { class: "flex gap-8" }, dn = { class: "p-16" }, cn = {
779
+ key: 0,
780
+ class: "flex flex-col gap-16 p-16"
781
+ }, pn = { class: "fm-typo-en-title-sm-600 mb-12" }, vn = { class: "grid grid-cols-2 gap-12" }, yn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, gn = { class: "fm-typo-en-body-md-600" }, fn = { key: 0 }, hn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, bn = { class: "fm-typo-en-body-md-600" }, xn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, _n = { class: "fm-typo-en-body-md-600" }, wn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, En = { class: "fm-typo-en-body-md-600" }, In = { class: "fm-typo-en-body-sm-400 text-gray-600" }, Sn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, Rn = { class: "space-y-8" }, kn = { class: "fm-typo-en-body-md-400 text-red-800" }, $n = { class: "fm-typo-en-title-sm-600 mb-12 text-yellow-800" }, Cn = { class: "space-y-8" }, Nn = { class: "fm-typo-en-body-md-400 text-yellow-800" }, An = { class: "fm-typo-en-title-sm-600 mb-12" }, Tn = { class: "overflow-auto" }, Un = { class: "w-full fm-typo-en-body-sm-400" }, Mn = { class: "text-left text-gray-600" }, Fn = { class: "p-8" }, Bn = { class: "p-8" }, jn = { class: "p-8" }, Gn = { class: "p-8" }, Dn = { class: "p-8" }, On = { class: "p-8" }, zn = { class: "p-8" }, Pn = { class: "p-8" }, Wn = { class: "p-8" }, Hn = { class: "p-8" }, Ln = { class: "p-8" }, Vn = { class: "fm-typo-en-title-sm-600 mb-12" }, qn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, Kn = { class: "text-sm" }, Jn = { class: "flex gap-8" }, Xn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, Qn = { class: "text-center" }, Yn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, Zn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, er = { class: "text-center" }, tr = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, nr = { class: "fm-typo-en-body-md-400 text-gray-500" }, fr = /* @__PURE__ */ Oe({
782
+ __name: "ImportView",
783
+ setup(u) {
784
+ const { t: e } = ze(), p = Xe(), d = Pe();
785
+ Ke();
786
+ const m = Ye(), { breakpoints: h } = Qe(), c = ce(), r = z("");
787
+ z(!1);
788
+ const s = z(!1), o = z(null), g = z(!1), v = z(null), x = z(!1), w = z([]), y = z(null), b = z([]), i = z(!1), E = Z(() => h.value.xs || h.value.sm), A = Z(() => E.value ? 10 : 20), T = Z(() => {
789
+ const f = o.value;
790
+ if (!f) return [];
791
+ const n = [], { units: k, skus: G, recipes: L, _invalidExcel: V, _invalidExcelMessage: ee } = f, te = (M) => {
792
+ var I;
793
+ return ((I = M.errors) == null ? void 0 : I.length) > 0 ? Array.isArray(M.errors) ? M.errors.join(", ") : M.errors || e("inventory.common.validationFailed") : V ? ee || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
794
+ }, K = (M, J) => {
795
+ if (M)
796
+ for (const I of ["create", "update"]) {
797
+ const D = M[I];
798
+ if (D)
799
+ for (const W of D)
800
+ n.push({
801
+ name: W.name || W.abbrev || W.code || e("inventory.common.unknown"),
802
+ type: J,
803
+ operation: e(I === "create" ? "inventory.common.create" : "inventory.common.update"),
804
+ status: te(W),
805
+ errors: W.errors || [],
806
+ warnings: W.warnings || [],
807
+ details: W
808
+ });
809
+ }
810
+ };
811
+ return K(k, e("inventory.common.unit")), K(G, e("inventory.common.ingredient")), K(L, e("inventory.common.recipe")), n;
812
+ }), B = Z(() => T.value.some(
813
+ (f) => f.errors && f.errors.length > 0
814
+ )), j = Z(() => T.value.some(
815
+ (f) => f.status && f.status.includes("Invalid Excel")
816
+ )), N = Z(() => {
817
+ const f = T.value.find(
818
+ (n) => n.status && n.status.includes("Invalid Excel")
819
+ );
820
+ return (f == null ? void 0 : f.status) || e("inventory.common.invalidExcelFormatDetected");
821
+ }), H = Z(() => !b.value || b.value.length === 0 ? [] : b.value.map((f, n) => {
822
+ var k, G;
823
+ return {
824
+ id: n + 1,
825
+ name: ((k = f.error.data) == null ? void 0 : k.name) || e("inventory.common.unknown"),
826
+ type: f.type || e("inventory.common.general"),
827
+ message: ((G = f.error) == null ? void 0 : G.message) || JSON.stringify(f.error)
828
+ };
829
+ }));
830
+ function q(f) {
831
+ switch (f) {
832
+ case "import":
833
+ return P();
834
+ }
835
+ }
836
+ function P() {
837
+ p.open({
838
+ title: e("inventory.common.import"),
839
+ contentComponent: Bt,
840
+ overlay: !0,
841
+ closeButton: !0,
842
+ primaryActions: {
843
+ text: e("inventory.common.next"),
844
+ close: !1
845
+ },
846
+ secondaryActions: {
847
+ text: e("inventory.common.close"),
848
+ close: !0
849
+ },
850
+ tertiaryActions: {
851
+ text: e("inventory.ingredient.import.actions.downloadTemplate"),
852
+ close: !1,
853
+ variant: "plain"
854
+ }
855
+ }).onPrimary(async (f) => {
856
+ f && f.workbook && f.availableSheets && (await re(f), p.close()), w.value.length === 0 && p.close();
857
+ }).onTertiary(() => {
858
+ try {
859
+ const f = wt();
860
+ d.open({
861
+ title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
862
+ message: e("inventory.common.templateDownloaded", [f]),
863
+ type: "success"
864
+ });
865
+ } catch (f) {
866
+ d.open({
867
+ title: e("inventory.common.downloadFailed"),
868
+ message: e("inventory.common.failedDownloadTemplate"),
869
+ type: "error"
870
+ }), console.error("Error downloading template:", f);
871
+ }
872
+ });
873
+ }
874
+ async function re(f) {
875
+ y.value = f.workbook, w.value = [...f.availableSheets], o.value = {}, b.value = [], await oe();
876
+ }
877
+ async function oe() {
878
+ var n, k, G, L, V, ee, te, K, M, J, I, D, W, se, ie;
879
+ if (!y.value || w.value.length === 0) {
880
+ g.value = !0;
881
+ return;
882
+ }
883
+ const f = w.value[0];
884
+ try {
885
+ switch (f) {
886
+ case "unit": {
887
+ const Y = y.value.Sheets.unit, $ = await Et(Y);
888
+ $ && (o.value = {
889
+ ...o.value,
890
+ _invalidExcel: $.invalidExcel || ((n = o.value) == null ? void 0 : n._invalidExcel),
891
+ _invalidExcelMessage: $.invalidExcelMessage || ((k = o.value) == null ? void 0 : k._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
892
+ units: $.importCreateResult || $.importUpdateResult ? {
893
+ create: ((G = $.importCreateResult) == null ? void 0 : G.map((_) => ({
894
+ ..._.unit,
895
+ errors: _.errors
896
+ }))) || [],
897
+ update: ((L = $.importUpdateResult) == null ? void 0 : L.map((_) => ({
898
+ ..._.unit,
899
+ errors: _.errors
900
+ }))) || []
901
+ } : (V = o.value) == null ? void 0 : V.units
902
+ });
903
+ break;
904
+ }
905
+ case "ingredient": {
906
+ const Y = y.value.Sheets.ingredient, $ = await It(Y);
907
+ $ && (o.value = {
908
+ ...o.value,
909
+ _invalidExcel: $.invalidExcel || ((ee = o.value) == null ? void 0 : ee._invalidExcel),
910
+ _invalidExcelMessage: $.invalidExcelMessage || ((te = o.value) == null ? void 0 : te._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
911
+ skus: $.importCreateResult || $.importUpdateResult ? {
912
+ create: ((K = $.importCreateResult) == null ? void 0 : K.map((_) => ({
913
+ ..._.sku,
914
+ errors: _.errors
915
+ }))) || [],
916
+ update: ((M = $.importUpdateResult) == null ? void 0 : M.map((_) => ({
917
+ ..._.sku,
918
+ errors: _.errors
919
+ }))) || []
920
+ } : (J = o.value) == null ? void 0 : J.skus
921
+ });
922
+ break;
923
+ }
924
+ case "recipe": {
925
+ const Y = y.value.Sheets.recipe, $ = await St(Y);
926
+ $ && (o.value = {
927
+ ...o.value,
928
+ _invalidExcel: $.invalidExcel || ((I = o.value) == null ? void 0 : I._invalidExcel),
929
+ _invalidExcelMessage: $.invalidExcelMessage || ((D = o.value) == null ? void 0 : D._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
930
+ recipes: $.importCreateResult || $.importUpdateResult ? {
931
+ create: ((W = $.importCreateResult) == null ? void 0 : W.map((_) => ({
932
+ ..._.recipe,
933
+ errors: _.errors,
934
+ warnings: _.warnings,
935
+ changes: _.changes
936
+ }))) || [],
937
+ update: ((se = $.importUpdateResult) == null ? void 0 : se.map((_) => ({
938
+ ..._.recipe,
939
+ errors: _.errors,
940
+ warnings: _.warnings,
941
+ changes: _.changes
942
+ }))) || []
943
+ } : (ie = o.value) == null ? void 0 : ie.recipes
944
+ });
945
+ break;
946
+ }
947
+ }
948
+ w.value.shift(), g.value = !0;
949
+ } catch (Y) {
950
+ console.error(`Error processing ${f} sheet:`, Y), d.open({
951
+ title: e("inventory.common.processingError"),
952
+ message: e("inventory.common.failedToProcessSheet", [f]),
953
+ type: "error"
954
+ });
955
+ }
956
+ }
957
+ async function he() {
958
+ var f, n, k, G, L, V, ee, te, K, M, J, I, D, W, se, ie, Y, $;
959
+ if (o.value) {
960
+ if (j.value) {
961
+ d.open({
962
+ title: e("inventory.common.invalidExcelFormatTitle"),
963
+ message: N.value,
964
+ type: "error"
965
+ });
966
+ return;
967
+ }
968
+ if (B.value) {
969
+ d.open({
970
+ title: e("inventory.ingredient.import.error.invalidContent"),
971
+ message: e("inventory.ingredient.import.error.hasErrors"),
972
+ type: "error"
973
+ });
974
+ return;
975
+ }
976
+ s.value = !0;
977
+ try {
978
+ let _ = 0, me = "";
979
+ if (o.value.units && ((f = o.value.units.create) != null && f.length || (n = o.value.units.update) != null && n.length)) {
980
+ const U = {
981
+ create: pe(o.value.units.create),
982
+ update: pe(o.value.units.update)
983
+ };
984
+ if (U.create.length || U.update.length) {
985
+ const S = await c.importUnits(U);
986
+ ((k = S == null ? void 0 : S.errors) == null ? void 0 : k.length) > 0 && b.value.push(...S.errors.map((de) => ({
987
+ type: "units",
988
+ error: de
989
+ })));
990
+ const ae = U.create.length + U.update.length, le = ((G = S == null ? void 0 : S.errors) == null ? void 0 : G.length) || 0;
991
+ _ = ae - le, me = "units", o.value = {
992
+ ...o.value,
993
+ units: null
994
+ };
995
+ }
996
+ } else if (o.value.skus && ((L = o.value.skus.create) != null && L.length || (V = o.value.skus.update) != null && V.length)) {
997
+ const U = {
998
+ create: pe(o.value.skus.create),
999
+ update: pe(o.value.skus.update)
1000
+ };
1001
+ if (U.create.length || U.update.length) {
1002
+ const S = await c.importSkus(U);
1003
+ ((ee = S == null ? void 0 : S.errors) == null ? void 0 : ee.length) > 0 && b.value.push(...S.errors.map((de) => ({
1004
+ type: "ingredients",
1005
+ error: de
1006
+ })));
1007
+ const ae = U.create.length + U.update.length, le = ((te = S == null ? void 0 : S.errors) == null ? void 0 : te.length) || 0;
1008
+ _ = ae - le, me = "ingredients", o.value = {
1009
+ ...o.value,
1010
+ skus: null
1011
+ };
1012
+ }
1013
+ } else if (o.value.recipes && ((K = o.value.recipes.create) != null && K.length || (M = o.value.recipes.update) != null && M.length)) {
1014
+ const U = {
1015
+ create: pe(o.value.recipes.create),
1016
+ update: pe(o.value.recipes.update)
1017
+ };
1018
+ if (U.create.length || U.update.length) {
1019
+ const S = await c.importRecipes(U);
1020
+ ((J = S == null ? void 0 : S.errors) == null ? void 0 : J.length) > 0 && b.value.push(...S.errors.map((de) => ({
1021
+ type: "recipes",
1022
+ error: de
1023
+ })));
1024
+ const ae = U.create.length + U.update.length, le = ((I = S == null ? void 0 : S.errors) == null ? void 0 : I.length) || 0;
1025
+ _ = ae - le, me = "recipes", o.value = {
1026
+ ...o.value,
1027
+ recipes: null
1028
+ };
1029
+ }
1030
+ }
1031
+ if (_ > 0) {
1032
+ const U = b.value.filter((S) => S.type === me);
1033
+ U.length > 0 ? d.open({
1034
+ title: e("inventory.common.importCompletedWithIssues"),
1035
+ message: e("inventory.common.successfullyImported", [_, me, U.length, me]),
1036
+ type: "warning"
1037
+ }) : d.open({
1038
+ title: e("inventory.ingredient.import.success"),
1039
+ message: e("inventory.common.successfullyImported", [_, me, "0", ""]),
1040
+ type: "success"
1041
+ });
1042
+ }
1043
+ if (w.value.length > 0)
1044
+ await oe();
1045
+ else if (!(o.value.units && (((D = o.value.units.create) == null ? void 0 : D.length) || ((W = o.value.units.update) == null ? void 0 : W.length)) || o.value.skus && (((se = o.value.skus.create) == null ? void 0 : se.length) || ((ie = o.value.skus.update) == null ? void 0 : ie.length)) || o.value.recipes && (((Y = o.value.recipes.create) == null ? void 0 : Y.length) || (($ = o.value.recipes.update) == null ? void 0 : $.length))))
1046
+ if (ye(), b.value.length > 0) {
1047
+ const S = b.value.filter((ge) => ge.type === "units").length, ae = b.value.filter((ge) => ge.type === "ingredients").length, le = b.value.filter((ge) => ge.type === "recipes").length, de = S + ae + le;
1048
+ i.value = !0, d.open({
1049
+ title: e("inventory.common.importCompletedWithIssues"),
1050
+ message: e("inventory.common.importFinishedWithFailedItems", [de, S, ae, le]),
1051
+ type: "warning"
1052
+ }), console.error("Import errors:", b.value);
1053
+ } else
1054
+ d.open({
1055
+ title: e("inventory.common.importComplete"),
1056
+ message: e("inventory.common.allDataSuccessfullyImported"),
1057
+ type: "success"
1058
+ });
1059
+ } catch (_) {
1060
+ d.open({
1061
+ title: e("inventory.ingredient.import.error.failed"),
1062
+ message: (_ == null ? void 0 : _.message) || e("inventory.common.unknownErrorOccurred"),
1063
+ type: "error"
1064
+ }), console.error("Error during import:", _);
1065
+ } finally {
1066
+ s.value = !1;
1067
+ }
1068
+ }
1069
+ }
1070
+ function ye() {
1071
+ g.value = !1, i.value = !1, o.value = null, w.value = [], y.value = null;
1072
+ }
1073
+ function be() {
1074
+ i.value = !1, b.value = [];
1075
+ }
1076
+ function xe(f) {
1077
+ v.value = f, x.value = !0;
1078
+ }
1079
+ function Ce() {
1080
+ x.value = !1, v.value = null;
1081
+ }
1082
+ const _e = Z(() => [
1083
+ {
1084
+ label: e("inventory.common.import"),
1085
+ value: "import",
1086
+ isPrimary: !1,
1087
+ prependIcon: "upload"
1088
+ }
1089
+ ]), He = Me([
1090
+ {
1091
+ id: "name",
1092
+ accessorKey: "name",
1093
+ header: () => e("inventory.common.name"),
1094
+ size: 200
1095
+ },
1096
+ {
1097
+ id: "type",
1098
+ accessorKey: "type",
1099
+ header: () => e("inventory.common.type"),
1100
+ size: 120
1101
+ },
1102
+ {
1103
+ id: "operation",
1104
+ accessorKey: "operation",
1105
+ header: () => e("inventory.common.operation"),
1106
+ size: 100
1107
+ },
1108
+ {
1109
+ id: "status",
1110
+ accessorKey: "status",
1111
+ header: () => e("inventory.common.status"),
1112
+ size: 120,
1113
+ cell: (f) => {
1114
+ var L;
1115
+ const n = f.row.original.status;
1116
+ let k = "px-8 py-4 rounded";
1117
+ n === e("inventory.common.readyToImport") && ((L = f.row.original.warnings) != null && L.length) ? k += " bg-yellow-100 text-yellow-800 border border-yellow-200" : n === e("inventory.common.readyToImport") ? k += " bg-blue-100 text-blue-800 border border-blue-200" : n === "Imported" || n === "Successfully Imported" ? k += " bg-green-100 text-green-800 border border-green-200" : n === "Failed" ? k += " bg-red-100 text-red-800 border border-red-200" : n === e("inventory.common.validationFailed") ? k += " bg-orange-100 text-orange-800 border border-orange-200" : (n.includes("Invalid Excel"), k += " bg-red-100 text-red-800 border border-red-200");
1118
+ const G = [n, ...f.row.original.warnings ?? []].join(`
1119
+ `);
1120
+ return we("div", { class: k, title: G }, n);
1121
+ }
1122
+ }
1123
+ ]), Le = Me([
1124
+ {
1125
+ id: "name",
1126
+ accessorKey: "name",
1127
+ header: () => e("inventory.common.name"),
1128
+ cell: (f) => we("div", { class: "text-gray-800 text-sm py-2" }, f.row.original.name || e("inventory.common.unknown"))
1129
+ },
1130
+ {
1131
+ id: "type",
1132
+ accessorKey: "type",
1133
+ header: () => e("inventory.common.errorType"),
1134
+ cell: (f) => {
1135
+ const n = f.row.original.type, k = e(n === "units" ? "inventory.common.unit" : n === "ingredients" ? "inventory.common.ingredient" : n === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
1136
+ return we("div", { class: "text-gray-800 text-sm py-2" }, k);
1137
+ }
1138
+ },
1139
+ {
1140
+ id: "message",
1141
+ accessorKey: "message",
1142
+ header: () => e("inventory.common.errorMessage"),
1143
+ cell: (f) => we(
1144
+ "div",
1145
+ { class: "text-red-800 text-sm py-2", title: f.row.original.message },
1146
+ f.row.original.message
1147
+ )
1148
+ }
1149
+ ]);
1150
+ return (f, n) => {
1151
+ const k = ne("FmIcon"), G = ne("FmButton"), L = ne("FmTable"), V = ne("FmCard"), ee = ne("FmSideSheet"), te = ne("FmSpinner");
1152
+ return l(m).isLoaded && l(m).enableBulkImport ? (R(), ue(Ne, {
1153
+ key: 0,
1154
+ title: l(e)("inventory.common.import"),
1155
+ actions: _e.value,
1156
+ "onClick:action": q
1157
+ }, {
1158
+ default: X(() => {
1159
+ var K;
1160
+ return [
1161
+ t("div", {
1162
+ class: ve([
1163
+ "flex flex-col gap-8 max-h-full",
1164
+ {
1165
+ "p-0": E.value,
1166
+ "px-24": !E.value
1167
+ }
1168
+ ])
1169
+ }, [
1170
+ g.value ? Q("", !0) : (R(), F("div", jt, [
1171
+ t("div", Gt, [
1172
+ O(k, {
1173
+ name: "info",
1174
+ class: "text-blue-600 mt-2"
1175
+ }),
1176
+ t("div", Dt, [
1177
+ t("div", Ot, a(l(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
1178
+ t("div", zt, [
1179
+ t("div", Pt, [
1180
+ t("strong", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1181
+ ]),
1182
+ n[40] || (n[40] = C(" 1. ")),
1183
+ t("span", {
1184
+ innerHTML: l(e)("inventory.ingredient.import.importInstructions.step1")
1185
+ }, null, 8, Wt),
1186
+ n[41] || (n[41] = t("br", null, null, -1)),
1187
+ n[42] || (n[42] = C(" 2. ")),
1188
+ t("span", {
1189
+ innerHTML: l(e)("inventory.ingredient.import.importInstructions.step2")
1190
+ }, null, 8, Ht),
1191
+ n[43] || (n[43] = t("br", null, null, -1)),
1192
+ C(" 3. " + a(l(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1193
+ n[44] || (n[44] = t("br", null, null, -1)),
1194
+ C(" 4. " + a(l(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1195
+ n[45] || (n[45] = t("br", null, null, -1)),
1196
+ n[46] || (n[46] = t("br", null, null, -1)),
1197
+ t("div", Lt, [
1198
+ t("strong", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1199
+ ]),
1200
+ t("div", Vt, [
1201
+ t("strong", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
1202
+ C(" " + a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1203
+ n[2] || (n[2] = t("br", null, null, -1)),
1204
+ n[3] || (n[3] = C(" • ")),
1205
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
1206
+ n[4] || (n[4] = t("br", null, null, -1)),
1207
+ n[5] || (n[5] = C(" • ")),
1208
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
1209
+ n[6] || (n[6] = t("br", null, null, -1)),
1210
+ n[7] || (n[7] = C(" • ")),
1211
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
1212
+ n[8] || (n[8] = t("br", null, null, -1)),
1213
+ n[9] || (n[9] = C(" • ")),
1214
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
1215
+ n[10] || (n[10] = t("br", null, null, -1)),
1216
+ n[11] || (n[11] = C(" • ")),
1217
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
1218
+ n[12] || (n[12] = t("br", null, null, -1)),
1219
+ n[13] || (n[13] = C(" • ")),
1220
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
1221
+ ]),
1222
+ t("div", qt, [
1223
+ t("strong", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
1224
+ C(" " + a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1225
+ n[14] || (n[14] = t("br", null, null, -1)),
1226
+ n[15] || (n[15] = C(" • ")),
1227
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
1228
+ n[16] || (n[16] = t("br", null, null, -1)),
1229
+ n[17] || (n[17] = C(" • ")),
1230
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
1231
+ n[18] || (n[18] = t("br", null, null, -1)),
1232
+ n[19] || (n[19] = C(" • ")),
1233
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
1234
+ n[20] || (n[20] = t("br", null, null, -1)),
1235
+ n[21] || (n[21] = C(" • ")),
1236
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
1237
+ n[22] || (n[22] = t("br", null, null, -1)),
1238
+ n[23] || (n[23] = C(" • ")),
1239
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
1240
+ ]),
1241
+ t("div", Kt, [
1242
+ t("strong", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
1243
+ C(" " + a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1244
+ n[24] || (n[24] = t("br", null, null, -1)),
1245
+ n[25] || (n[25] = C(" • ")),
1246
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
1247
+ n[26] || (n[26] = t("br", null, null, -1)),
1248
+ n[27] || (n[27] = C(" • ")),
1249
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
1250
+ n[28] || (n[28] = t("br", null, null, -1)),
1251
+ n[29] || (n[29] = C(" • ")),
1252
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
1253
+ n[30] || (n[30] = t("br", null, null, -1)),
1254
+ n[31] || (n[31] = C(" • ")),
1255
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
1256
+ n[32] || (n[32] = t("br", null, null, -1)),
1257
+ n[33] || (n[33] = C(" • ")),
1258
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
1259
+ n[34] || (n[34] = t("br", null, null, -1)),
1260
+ n[35] || (n[35] = C(" • ")),
1261
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
1262
+ n[36] || (n[36] = t("br", null, null, -1)),
1263
+ n[37] || (n[37] = C(" • ")),
1264
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
1265
+ n[38] || (n[38] = t("br", null, null, -1)),
1266
+ n[39] || (n[39] = C(" • ")),
1267
+ t("em", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
1268
+ ]),
1269
+ t("div", Jt, [
1270
+ t("strong", null, a(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
1271
+ ])
1272
+ ])
1273
+ ])
1274
+ ])
1275
+ ])),
1276
+ g.value ? (R(), F("div", Xt, [
1277
+ t("div", Qt, [
1278
+ t("div", null, [
1279
+ t("div", Yt, a(l(e)("inventory.common.importPreview")), 1),
1280
+ t("div", Zt, [
1281
+ j.value ? (R(), F("span", en, a(l(e)("inventory.common.errorExist")) + ": " + a(N.value), 1)) : B.value ? (R(), F("span", tn, a(l(e)("inventory.common.someItemsValidationErrors")), 1)) : (R(), F("span", nn, a(l(e)("inventory.common.allItemsValidReadyImport")), 1))
1282
+ ])
1283
+ ]),
1284
+ t("div", rn, [
1285
+ O(G, {
1286
+ variant: "secondary",
1287
+ onClick: ye,
1288
+ label: l(e)("inventory.common.cancel")
1289
+ }, null, 8, ["label"]),
1290
+ O(G, {
1291
+ variant: "primary",
1292
+ onClick: he,
1293
+ loading: s.value,
1294
+ disabled: s.value || B.value || j.value,
1295
+ label: l(e)("inventory.common.import")
1296
+ }, null, 8, ["loading", "disabled", "label"])
1297
+ ])
1298
+ ]),
1299
+ t("div", on, [
1300
+ O(L, {
1301
+ "column-defs": He.value,
1302
+ "row-data": T.value,
1303
+ "page-size": A.value,
1304
+ "search-value": r.value,
1305
+ loading: !1,
1306
+ "row-hover": "",
1307
+ onRowClick: n[0] || (n[0] = (M) => xe(M.original))
1308
+ }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1309
+ ])
1310
+ ])) : Q("", !0),
1311
+ i.value && b.value.length > 0 ? (R(), F("div", sn, [
1312
+ t("div", an, [
1313
+ t("div", null, [
1314
+ t("div", ln, a(l(e)("inventory.common.importErrors")), 1),
1315
+ t("div", un, a(b.value.length) + " " + a(l(e)("inventory.common.itemsFailedImport")), 1)
1316
+ ]),
1317
+ t("div", mn, [
1318
+ O(G, {
1319
+ variant: "secondary",
1320
+ onClick: be,
1321
+ label: l(e)("inventory.common.close")
1322
+ }, null, 8, ["label"])
1323
+ ])
1324
+ ]),
1325
+ t("div", dn, [
1326
+ O(L, {
1327
+ "column-defs": Le.value,
1328
+ "row-data": H.value,
1329
+ "page-size": A.value,
1330
+ "search-value": r.value,
1331
+ loading: !1,
1332
+ "row-hover": ""
1333
+ }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1334
+ ])
1335
+ ])) : Q("", !0)
1336
+ ], 2),
1337
+ O(ee, {
1338
+ "model-value": x.value,
1339
+ "onUpdate:modelValue": n[1] || (n[1] = (M) => x.value = M),
1340
+ header: `${(K = v.value) == null ? void 0 : K.type} Details`,
1341
+ "max-width": 900,
1342
+ "dismiss-away": ""
1343
+ }, {
1344
+ "side-sheet-footer": X(() => [
1345
+ t("div", Jn, [
1346
+ O(G, {
1347
+ label: l(e)("inventory.common.close"),
1348
+ variant: "tertiary",
1349
+ onClick: Ce
1350
+ }, null, 8, ["label"])
1351
+ ])
1352
+ ]),
1353
+ default: X(() => {
1354
+ var M, J;
1355
+ return [
1356
+ v.value != null ? (R(), F("div", cn, [
1357
+ O(V, {
1358
+ variant: "outlined",
1359
+ class: "p-16"
1360
+ }, {
1361
+ default: X(() => {
1362
+ var I, D, W, se, ie;
1363
+ return [
1364
+ t("div", pn, a(l(e)("inventory.common.basicInformation")), 1),
1365
+ t("div", vn, [
1366
+ t("div", null, [
1367
+ t("div", yn, a(l(e)("inventory.common.name")), 1),
1368
+ t("div", gn, a(((D = (I = v.value) == null ? void 0 : I.details) == null ? void 0 : D.name) || ((W = v.value) == null ? void 0 : W.name)), 1)
1369
+ ]),
1370
+ (ie = (se = v.value) == null ? void 0 : se.details) != null && ie.code ? (R(), F("div", fn, [
1371
+ t("div", hn, a(l(e)("inventory.common.code")), 1),
1372
+ t("div", bn, a(v.value.details.code), 1)
1373
+ ])) : Q("", !0),
1374
+ t("div", null, [
1375
+ t("div", xn, a(l(e)("inventory.common.type")), 1),
1376
+ t("div", _n, a(v.value.type), 1)
1377
+ ]),
1378
+ t("div", null, [
1379
+ t("div", wn, a(l(e)("inventory.common.operation")), 1),
1380
+ t("div", En, a(v.value.operation), 1)
1381
+ ]),
1382
+ t("div", null, [
1383
+ t("div", In, a(l(e)("inventory.common.status")), 1),
1384
+ t("div", {
1385
+ class: ve([
1386
+ "inline-block px-8 py-4 rounded text-sm",
1387
+ v.value.status !== l(e)("inventory.common.readyToImport") ? "bg-red-100 text-red-800 border border-red-200" : "bg-green-100 text-green-800 border border-green-200"
1388
+ ])
1389
+ }, a(v.value.status), 3)
1390
+ ])
1391
+ ])
1392
+ ];
1393
+ }),
1394
+ _: 1
1395
+ }),
1396
+ v.value.errors && v.value.errors.length > 0 ? (R(), ue(V, {
1397
+ key: 0,
1398
+ variant: "outlined",
1399
+ class: "p-16"
1400
+ }, {
1401
+ default: X(() => [
1402
+ t("div", Sn, a(l(e)("inventory.common.validationErrors")), 1),
1403
+ t("div", Rn, [
1404
+ (R(!0), F(Se, null, Re(v.value.errors, (I, D) => (R(), F("div", {
1405
+ key: D,
1406
+ class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
1407
+ }, [
1408
+ O(k, {
1409
+ name: "error",
1410
+ class: "text-red-600 mt-2",
1411
+ size: "sm"
1412
+ }),
1413
+ t("div", kn, a(I), 1)
1414
+ ]))), 128))
1415
+ ])
1416
+ ]),
1417
+ _: 1
1418
+ })) : Q("", !0),
1419
+ v.value.warnings && v.value.warnings.length > 0 ? (R(), ue(V, {
1420
+ key: 1,
1421
+ variant: "outlined",
1422
+ class: "p-16"
1423
+ }, {
1424
+ default: X(() => [
1425
+ t("div", $n, a(l(e)("inventory.common.warnings")), 1),
1426
+ t("div", Cn, [
1427
+ (R(!0), F(Se, null, Re(v.value.warnings, (I, D) => (R(), F("div", {
1428
+ key: D,
1429
+ class: "flex items-start gap-8 p-12 bg-yellow-50 border border-yellow-200 rounded"
1430
+ }, [
1431
+ O(k, {
1432
+ name: "warning",
1433
+ class: "text-yellow-600 mt-2",
1434
+ size: "sm"
1435
+ }),
1436
+ t("div", Nn, a(I), 1)
1437
+ ]))), 128))
1438
+ ])
1439
+ ]),
1440
+ _: 1
1441
+ })) : Q("", !0),
1442
+ (J = (M = v.value.details) == null ? void 0 : M.changes) != null && J.length ? (R(), ue(V, {
1443
+ key: 2,
1444
+ variant: "outlined",
1445
+ class: "p-16"
1446
+ }, {
1447
+ default: X(() => [
1448
+ t("div", An, a(l(e)("inventory.common.recipeChanges.title")), 1),
1449
+ t("div", Tn, [
1450
+ t("table", Un, [
1451
+ t("thead", null, [
1452
+ t("tr", Mn, [
1453
+ n[47] || (n[47] = t("th", { class: "p-8" }, null, -1)),
1454
+ t("th", Fn, a(l(e)("inventory.common.recipeChanges.item")), 1),
1455
+ t("th", Bn, a(l(e)("inventory.common.recipeChanges.qtyBefore")), 1),
1456
+ t("th", jn, a(l(e)("inventory.common.recipeChanges.qtyAfter")), 1),
1457
+ t("th", Gn, a(l(e)("inventory.common.recipeChanges.extraBefore")), 1),
1458
+ t("th", Dn, a(l(e)("inventory.common.recipeChanges.extraAfter")), 1)
1459
+ ])
1460
+ ]),
1461
+ t("tbody", null, [
1462
+ (R(!0), F(Se, null, Re(v.value.details.changes, (I, D) => (R(), F("tr", {
1463
+ key: D,
1464
+ class: ve({
1465
+ "bg-green-50": I.status === "added",
1466
+ "bg-yellow-50": I.status === "changed",
1467
+ "text-gray-500": I.status === "same"
1468
+ })
1469
+ }, [
1470
+ t("td", On, a(l(e)(`inventory.common.recipeChanges.${I.status}`)), 1),
1471
+ t("td", zn, a(I.item), 1),
1472
+ t("td", Pn, a(I.qtyBefore), 1),
1473
+ t("td", Wn, a(I.qtyAfter), 1),
1474
+ t("td", Hn, a(I.extraBefore), 1),
1475
+ t("td", Ln, a(I.extraAfter), 1)
1476
+ ], 2))), 128))
1477
+ ])
1478
+ ])
1479
+ ])
1480
+ ]),
1481
+ _: 1
1482
+ })) : Q("", !0),
1483
+ O(V, {
1484
+ variant: "outlined",
1485
+ class: "p-16"
1486
+ }, {
1487
+ default: X(() => [
1488
+ t("div", Vn, a(l(e)("inventory.common.rawData")), 1),
1489
+ t("div", qn, [
1490
+ t("pre", Kn, a(JSON.stringify(v.value.details, null, 2)), 1)
1491
+ ])
1492
+ ]),
1493
+ _: 1
1494
+ })
1495
+ ])) : Q("", !0)
1496
+ ];
1497
+ }),
1498
+ _: 1
1499
+ }, 8, ["model-value", "header"])
1500
+ ];
1501
+ }),
1502
+ _: 1
1503
+ }, 8, ["title", "actions"])) : l(m).isLoaded ? (R(), ue(Ne, {
1504
+ key: 2,
1505
+ title: l(e)("inventory.common.import")
1506
+ }, {
1507
+ default: X(() => [
1508
+ t("div", Zn, [
1509
+ O(k, {
1510
+ name: "block",
1511
+ class: "text-gray-400",
1512
+ size: "xl"
1513
+ }),
1514
+ t("div", er, [
1515
+ t("div", tr, a(l(e)("inventory.common.featureNotAvailable")), 1),
1516
+ t("div", nr, a(l(e)("inventory.common.bulkImportNotEnabled")), 1)
1517
+ ])
1518
+ ])
1519
+ ]),
1520
+ _: 1
1521
+ }, 8, ["title"])) : (R(), ue(Ne, {
1522
+ key: 1,
1523
+ title: l(e)("inventory.common.import")
1524
+ }, {
1525
+ default: X(() => [
1526
+ t("div", Xn, [
1527
+ O(te, { size: "lg" }),
1528
+ t("div", Qn, [
1529
+ t("div", Yn, a(l(e)("inventory.common.loading")), 1)
1530
+ ])
1531
+ ])
1532
+ ]),
1533
+ _: 1
1534
+ }, 8, ["title"]));
1535
+ };
1536
+ }
1537
+ });
1538
+ export {
1539
+ fr as default
1540
+ };