@feedmepos/mf-inventory-portal 1.8.0-dev.7 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/App-BPdZMhM8.js +1445 -0
  2. package/dist/{ApprovalView-1Y_jh_UJ.js → ApprovalView-UzjSuZ2L.js} +26 -25
  3. package/dist/{BindingsDialog-VMvTLguN.js → BindingsDialog-Cb6WRlKq.js} +2 -2
  4. package/dist/{BindingsPicker-KNRM5rMU.js → BindingsPicker-CtD4U4lv.js} +2 -2
  5. package/dist/{BindingsTable-CSyNlNCL.js → BindingsTable-CX-3403K.js} +10 -10
  6. package/dist/BulkReceiveRequestPage-CUq1Lmww.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DQuI04Yj.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-C5cA-lGH.js} +1 -1
  8. package/dist/{ClosingDraftView-A2pJuhIb.js → ClosingDraftView-Ca_SvdWQ.js} +748 -746
  9. package/dist/ClosingHistoryView-DzkeJYoe.js +769 -0
  10. package/dist/{ClosingTemplateView-DpkNCyoB.js → ClosingTemplateView-DSrelbso.js} +22 -21
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DOpIDvsy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuOuXPy1.js} +1 -1
  12. package/dist/{DefaultView-B4UuAqYu.js → DefaultView-Dw-7Y8vD.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-w0YcNH3F.js → DeliveryOrderPrintPreview-C5qJsv_O.js} +15 -15
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BimIEHsW.js → EmailDialog.vue_vue_type_script_setup_true_lang-D8od7aKT.js} +10075 -9949
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js +48 -0
  16. package/dist/FeatureCapabilityGate-C-IM5_7n.js +82 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-DEDU1XUC.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B861gqIJ.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B7j4ZSOe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ckli_nZx.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js} +2 -2
  21. package/dist/{FmMultiselectDialog-DMA5eR0C.js → FmMultiselectDialog-CShFKSIW.js} +2 -2
  22. package/dist/{FmMultiselectDialog-BnZInvgp.js → FmMultiselectDialog-Ci-6NMsV.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BXTUsnwN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dkx5vVap.js} +105 -99
  24. package/dist/ImportView-7ij7RUHI.js +1540 -0
  25. package/dist/{IngredientsView-C4-8qNGD.js → IngredientsView-fIPtTyFD.js} +685 -688
  26. package/dist/{IntegrationExplorerView-D3leld2Z.js → IntegrationExplorerView-DLYT4T-I.js} +1537 -1620
  27. package/dist/IntegrationPlatformView-CwywuK_y.js +13385 -0
  28. package/dist/{IntegrationView-BhRzry3g.js → IntegrationView-DnyVHXge.js} +2380 -2340
  29. package/dist/{InventoryBindingForm-ewAgZ6e-.js → InventoryBindingForm-BBs8v7CL.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bpo7Yv9A.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang--pI5wz_M.js} +134 -134
  31. package/dist/{InventoryBindingSummary-e67GzHYr.js → InventoryBindingSummary-CwIrQ8lG.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-DJSbskyn.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-C_WC4qfP.js +2317 -0
  38. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-7u0HQH67.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BIkoMOM2.js} +3051 -3161
  39. package/dist/ProductionRunPage-DuzVrjbZ.js +954 -0
  40. package/dist/{PublishView-BXA3k8Cp.js → PublishView-BVg44yke.js} +3 -3
  41. package/dist/{PurchaseOrderPrintPreview-DRugr4BU.js → PurchaseOrderPrintPreview-CNx6unyj.js} +17 -17
  42. package/dist/{ReceiveRequestView-CeJs9NTD.js → ReceiveRequestView-DeNrYOUt.js} +17 -16
  43. package/dist/RecipeView-De3pLsPR.js +3272 -0
  44. package/dist/SettingsView-B5ud0KtI.js +1005 -0
  45. package/dist/StockView-4N3NRjY8.js +3003 -0
  46. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ckw1_xIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvlRRKdt.js} +1 -1
  47. package/dist/{SupplierView-DH9u6e2M.js → SupplierView-fC9oe5nu.js} +304 -301
  48. package/dist/{SurchargeView-BPVEpc0f.js → SurchargeView-H6rv7u8A.js} +7 -7
  49. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRwxKmwb.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DFdrmR2Z.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-BivHE94R.js +332 -0
  52. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Df01LqHp.js +4953 -0
  53. package/dist/TransferTemplateView-CVUnofkI.js +2347 -0
  54. package/dist/{UnitCostHistoryView-06rIaX_M.js → UnitCostHistoryView-DjD2WAFI.js} +4 -4
  55. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CE0zHU6c.js} +4 -4
  56. package/dist/{UnitView-Xk_F9SYG.js → UnitView-DCfsbE8e.js} +111 -106
  57. package/dist/{WarehouseView-bmpLmpcX.js → WarehouseView-BCebmbcj.js} +12 -11
  58. package/dist/{WastageTemplateView-CWV1pFxM.js → WastageTemplateView-BXYNMBun.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 +2 -0
  63. package/dist/api/integration-sync-log.d.ts +0 -13
  64. package/dist/api/inventory.d.ts +9 -9
  65. package/dist/api/netsuite-explorer.d.ts +1 -0
  66. package/dist/api/stock.d.ts +1 -1
  67. package/dist/{app-CURawLhs.js → app-VtVYHCDF.js} +9785 -9546
  68. package/dist/app.d.ts +151 -14
  69. package/dist/app.js +1 -1
  70. package/dist/bulk-edit-simulation.helper-Nd6CtWGf.js +178 -0
  71. package/dist/{closing-template-q_KGB4jO.js → closing-template-LCe0U9w9.js} +4 -4
  72. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  73. package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
  74. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  75. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  76. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  77. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  78. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  79. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  80. package/dist/components/FmUnitInputProps.d.ts +1 -0
  81. package/dist/components/FmUnitInputRules.d.ts +1 -1
  82. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  83. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  84. package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
  85. package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
  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-3kdweNLp.js → date2-Cfb6DXM4.js} +1 -1
  90. package/dist/{dayjs.min-DHE73-wM.js → dayjs.min-BOndKK7B.js} +1 -1
  91. package/dist/{decimal-CAnQe2Ib.js → decimal-nbuisP61.js} +2 -2
  92. package/dist/{defineDeepModel-CctS67Do.js → defineDeepModel-DKySrdwp.js} +5 -5
  93. package/dist/{duplicate-template-Jk2V2Ezg.js → duplicate-template-BxcKb3Jp.js} +1 -1
  94. package/dist/{feature-D9n0IC0c.js → feature-VDUlSvM1.js} +452 -354
  95. package/dist/feature-flags/core.d.ts +1 -0
  96. package/dist/feature-flags/vue.d.ts +22 -1
  97. package/dist/feature-flags/vue.spec.d.ts +1 -0
  98. package/dist/{format-time-from-id-Bmzpbg-8.js → format-time-from-id-CfVH4LZ_.js} +1 -1
  99. package/dist/{format-unit-display-CVg4Bl5L.js → format-unit-display-BjTeAtgS.js} +209 -208
  100. package/dist/helper/country.spec.d.ts +1 -0
  101. package/dist/helper/menu-usage-module.d.ts +2 -1
  102. package/dist/helper/number.d.ts +5 -1
  103. package/dist/helper/rules.d.ts +1 -1
  104. package/dist/{id-to-date-DPCcxufP.js → id-to-date-Jr9SlHLO.js} +1 -1
  105. package/dist/{import-export.helper-bmGZwUBB.js → import-export.helper-FT9Wbigh.js} +17 -17
  106. package/dist/{index-zCBA-X6R.js → index-BV9b3Ulp.js} +2234 -2163
  107. package/dist/{index-yt6MlAFG.js → index-By5-VjVg.js} +1 -1
  108. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  109. package/dist/{index-CFNNQo-7.js → index-DXHVgUHU.js} +3 -3
  110. package/dist/index-eGvSlWMU.js +1892 -0
  111. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  112. package/dist/{lz-string-CqlY9MC2.js → lz-string-BAzqO9xf.js} +1 -1
  113. package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
  114. package/dist/{netsuite-DudeltN_.js → netsuite-BhGuduqd.js} +254 -263
  115. package/dist/netsuite-explorer-9Qj7qAum.js +79 -0
  116. package/dist/{predefined-templates-DT32p04n.js → predefined-templates-BlRafgnc.js} +1 -1
  117. package/dist/production-run-list-DR1WsaBR.js +61 -0
  118. package/dist/{purchase-order-template-LaRpWA04.js → purchase-order-template-By_Zxu1b.js} +1 -1
  119. package/dist/{recalculationUtils-BYN393eE.js → recalculationUtils-VsBar7jB.js} +1 -1
  120. package/dist/router/name.d.ts +2 -1
  121. package/dist/{row-action.enum-BiP5wkT6.js → row-action.enum-76yLYmPA.js} +1 -1
  122. package/dist/rules-fOcvgt4t.js +243 -0
  123. package/dist/{stock-B9XerL9c.js → stock-C-dQaxY2.js} +1 -1
  124. package/dist/stock-Dh0KXA1P.js +78 -0
  125. package/dist/stores/feature.d.ts +31 -2
  126. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  127. package/dist/stores/integration/netsuite.d.ts +2 -2
  128. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  129. package/dist/stores/location.d.ts +42 -42
  130. package/dist/stores/supplier.d.ts +48 -48
  131. package/dist/stores/warehouse.d.ts +2 -2
  132. package/dist/style.css +1 -1
  133. package/dist/{supplier-dpHijd2E.js → supplier-XHHHN8vZ.js} +2 -2
  134. package/dist/{surcharge-BZ4STY5J.js → surcharge-0-oBiYoF.js} +1 -1
  135. package/dist/tsconfig.app.tsbuildinfo +1 -1
  136. package/dist/{uom-rules-Da5Lngvp.js → uom-rules-DrRuSFgM.js} +1 -1
  137. package/dist/{use-ingredient-select-dialog-C3YsT5l-.js → use-ingredient-select-dialog-mQ7aQChK.js} +2 -2
  138. package/dist/{use-inventory-binding-dialog-BSsyrcGe.js → use-inventory-binding-dialog-5Wu0ItnH.js} +2 -2
  139. package/dist/{use-template-enabled-locations-BmJUzSUm.js → use-template-enabled-locations-CgpPMl8g.js} +2 -2
  140. package/dist/{use-transfer-locations-frEk_aBH.js → use-transfer-locations-DZ6B7eMT.js} +14 -14
  141. package/dist/{useHrmPermission-Cyjm0y9a.js → useHrmPermission-BaGxz4EV.js} +1 -1
  142. package/dist/{useNavigationMenu-CnTsOF9T.js → useNavigationMenu-CyP39v3U.js} +50 -49
  143. package/dist/{useSseClient-D_7o9nuf.js → useSseClient-CaD4MVg0.js} +1 -1
  144. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  145. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  146. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  147. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  148. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  149. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  150. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  151. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +19 -19
  152. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  153. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  154. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  155. package/dist/views/import/helper/submit-rows.d.ts +1 -1
  156. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  157. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
  158. package/dist/views/integration/IntegrationPlatformView.vue.d.ts +24 -0
  159. package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
  160. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  161. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  162. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  163. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  164. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  165. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  166. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  167. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
  168. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  169. package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
  170. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
  171. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
  172. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
  173. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
  174. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
  175. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
  176. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
  177. package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
  178. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
  179. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  180. package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
  181. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  182. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  183. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  184. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  185. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  186. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  187. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  188. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -6
  189. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +48 -48
  190. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  191. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -42
  192. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  193. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  194. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  195. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +54 -54
  196. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  197. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +8 -8
  198. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  199. package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
  200. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  201. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  202. package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
  203. package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
  204. package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
  205. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  206. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
  207. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
  208. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  209. package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
  210. package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
  211. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  212. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  213. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  214. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  215. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  216. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  217. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  218. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  219. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  220. package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
  221. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +4 -4
  222. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js → vue-KHCpiw_e.js} +106 -108
  223. package/dist/{vue-i18n-DwAcG7yc.js → vue-i18n-D6btLtve.js} +422 -422
  224. package/dist/{xlsx.util-C7S-uyqm.js → xlsx.util-Dr5i_LBa.js} +2 -2
  225. package/package.json +71 -66
  226. package/dist/App-Bo29Nwt0.js +0 -1537
  227. package/dist/BulkReceiveRequestView-vOeHbWM_.js +0 -2656
  228. package/dist/ClosingHistoryView-woRmvmYT.js +0 -761
  229. package/dist/ImportView-C7Hah7MM.js +0 -1291
  230. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKEzy2Uo.js +0 -72
  231. package/dist/ProductionRunDetailView-Ct7kr5Ht.js +0 -2312
  232. package/dist/ProductionRunView-odWyBZGx.js +0 -930
  233. package/dist/RecipeView-BH0REMB3.js +0 -3428
  234. package/dist/SettingsView-Dc27wyk-.js +0 -977
  235. package/dist/StockView-DrHLzosW.js +0 -2616
  236. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  237. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BpiePSmo.js +0 -299
  238. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DOQGPKiv.js +0 -4820
  239. package/dist/TransferTemplateView-CEVRsKL7.js +0 -2326
  240. package/dist/menu-usage-module-BdjYEk3s.js +0 -57
  241. package/dist/number-BoePMDs8.js +0 -138
  242. package/dist/rules-CQT0uAAo.js +0 -98
  243. package/dist/stock-CVybjhUm.js +0 -75
  244. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
@@ -1,1291 +0,0 @@
1
- import { defineComponent as Te, ref as F, computed as K, watch as Be, resolveComponent as Q, createElementBlock as G, openBlock as N, createVNode as $, createCommentVNode as Y, unref as l, normalizeClass as ce, createSlots as je, withCtx as X, createElementVNode as n, createBlock as re, toDisplayString as m, Fragment as Ue, renderList as Fe, shallowRef as Ce, h as _e, createTextVNode as S } from "vue";
2
- import { u as Pe, _ as Se } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { useCoreStore as ke, useI18n as $e } from "@feedmepos/mf-common";
4
- import { useDialogChild as ze, useSnackbar as Ge, useDialog as He, useBreakpoints as Ve } from "@feedmepos/ui-library";
5
- import { u as We } from "./feature-D9n0IC0c.js";
6
- import { a as se } from "./app-CURawLhs.js";
7
- import "./dayjs.min-DHE73-wM.js";
8
- import "./app-C39bYJmq.js";
9
- import "./FmAdminBadge-DlplQOHb.js";
10
- import { s as Ae, a as Oe, d as Le, t as Re, r as Ke } from "./xlsx.util-C7S-uyqm.js";
11
- import { s as Je, g as qe, b as Xe, d as Ne } from "./import-export.helper-bmGZwUBB.js";
12
- import { c as Me, a as Ie } from "./number-BoePMDs8.js";
13
- import { F as Qe } from "./FmDroppableField-J0tG_U3w.js";
14
- function* Ye(h) {
15
- for (; ; )
16
- yield h[Math.floor(Math.random() * h.length)];
17
- }
18
- function Ze(h = 4, e = Ye("qwertyuiopasdfghjklzxcvbnm".split(""))) {
19
- return Array.from({ length: h }).map(() => e.next().value).join("");
20
- }
21
- function we() {
22
- return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Ze()}`;
23
- }
24
- function et(h) {
25
- const [
26
- e,
27
- k,
28
- p,
29
- g,
30
- I,
31
- b,
32
- ...r
33
- ] = Ae(h);
34
- if (!e || !e.length || e.some((d) => d.length && !d.startsWith("system:")))
35
- throw new Error("Missing meta header. Excel file does not come from the template.");
36
- const a = e.map((d) => d.split(":")[1]), y = ["name", "symbol", "precision"].filter((d) => !a.includes(d));
37
- if (y.length)
38
- throw new Error(
39
- `Missing meta headers (${y.join()}). Excel file does not come from the template.`
40
- );
41
- return r.map((d, f) => {
42
- const o = {};
43
- for (const i in a) {
44
- const v = a[i];
45
- Object.assign(o, { [v]: d[i] });
46
- }
47
- return {
48
- index: f,
49
- data: o
50
- };
51
- });
52
- }
53
- function tt(h) {
54
- try {
55
- const e = et(h).filter((r) => {
56
- const { name: a, symbol: s, precision: y, measurement_name: c, measurement_symbol: d, measurement_conversion: f } = r.data;
57
- return a || s || y || c || d || f;
58
- }), p = se().units, g = [], I = [], b = {};
59
- for (const r of e)
60
- if (r.data.name && r.data.symbol)
61
- b[r.data.name] = {
62
- unit: {
63
- name: r.data.name,
64
- abbrev: r.data.symbol,
65
- precision: Math.max(0, Math.min(10, Math.floor(r.data.precision || 2))),
66
- measurements: []
67
- },
68
- rowNumber: r.index
69
- }, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && b[r.data.name].unit.measurements.push({
70
- id: we(),
71
- name: r.data.measurement_name,
72
- abbrev: r.data.measurement_symbol,
73
- conversion: {
74
- amount: Math.round(r.data.measurement_conversion * Math.pow(10, b[r.data.name].unit.precision)),
75
- precision: b[r.data.name].unit.precision
76
- }
77
- });
78
- else {
79
- const a = Object.keys(b)[Object.keys(b).length - 1];
80
- a && b[a] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && b[a].unit.measurements.push({
81
- id: we(),
82
- name: r.data.measurement_name,
83
- abbrev: r.data.measurement_symbol,
84
- conversion: {
85
- amount: Math.round(r.data.measurement_conversion * Math.pow(10, b[a].unit.precision)),
86
- precision: b[a].unit.precision
87
- }
88
- });
89
- }
90
- for (const [r, { unit: a, rowNumber: s }] of Object.entries(b)) {
91
- const y = p.find((c) => {
92
- var d, f;
93
- return c.abbrev === a.abbrev && ((d = c.name) == null ? void 0 : d.trim()) === ((f = a.name) == null ? void 0 : f.trim());
94
- });
95
- y ? I.push({
96
- type: "update",
97
- original: y,
98
- unit: {
99
- ...y,
100
- name: a.name || y.name,
101
- abbrev: a.abbrev || y.abbrev,
102
- precision: a.precision !== void 0 ? a.precision : y.precision,
103
- measurements: a.measurements.map((c) => {
104
- const d = y.measurements.find((f) => f.name === c.name && f.abbrev === c.abbrev);
105
- return d ? { ...d, ...c, id: d.id } : { ...c, id: we() };
106
- })
107
- },
108
- errors: [],
109
- excelRowNumber: s
110
- }) : g.push({
111
- type: "create",
112
- unit: {
113
- ...a,
114
- measurements: a.measurements.map((c) => ({ ...c, id: we() }))
115
- },
116
- errors: [],
117
- excelRowNumber: s
118
- });
119
- }
120
- return {
121
- invalidExcel: !1,
122
- importCreateResult: g,
123
- importUpdateResult: I
124
- };
125
- } catch (e) {
126
- return {
127
- invalidExcel: !0,
128
- invalidExcelMessage: (e == null ? void 0 : e.message) ?? "Invalid excel",
129
- importCreateResult: [],
130
- importUpdateResult: []
131
- };
132
- }
133
- }
134
- function nt(h, { ignoreErrors: e = !1 } = {}) {
135
- var k;
136
- try {
137
- const p = se(), g = p.skuByCode, I = p.recipeByName, b = p.units, r = [], a = {};
138
- for (const o of h) {
139
- const i = [];
140
- let v = "";
141
- if (o.data.type === "INGREDIENT") {
142
- const C = g[o.data.code];
143
- C ? v = C._id : i.push(`Ingredient with code '${o.data.code}' not found`);
144
- } else if (o.data.type === "RECIPE") {
145
- const C = I[o.data.name];
146
- C ? v = C._id : i.push(`Recipe with name '${o.data.name}' not found`);
147
- } else
148
- i.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT' or 'RECIPE'`);
149
- o.data.amount || i.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
150
- let U;
151
- if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && (U = b.find((C) => {
152
- var w, j;
153
- return C.abbrev === o.data.baseUnit && ((w = C.name) == null ? void 0 : w.trim()) === ((j = o.data.unit) == null ? void 0 : j.trim());
154
- }), U || (o.data.baseUnit && o.data.unit ? i.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? i.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && i.push(`Cannot find unit with name '${o.data.unit}'`))), i.length > 0 && r.push(`Row ${o.index + 6}: ${i.join(", ")}`), e || i.length === 0) {
155
- let C;
156
- if (o.data.type === "RECIPE" ? C = void 0 : C = (k = U == null ? void 0 : U.measurements) == null ? void 0 : k.find((w) => w.abbrev === o.data.measurementName), o.data.recipeName)
157
- a[o.data.recipeName] = {
158
- name: o.data.recipeName,
159
- customAttributes: o.data.customAttributes ? Je(o.data.customAttributes) : {},
160
- contains: [{
161
- type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
162
- id: v,
163
- amount: Me(+o.data.amount),
164
- measurement: C || void 0
165
- }]
166
- }, r[o.data.recipeName] = i.length > 0 ? `Row ${o.index + 6}: ${i.join(", ")}` : [];
167
- else {
168
- const w = Object.keys(a)[Object.keys(a).length - 1];
169
- w && a[w] && (a[w] = {
170
- ...a[w],
171
- contains: [
172
- ...a[w].contains,
173
- {
174
- type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
175
- id: v,
176
- amount: Me(+o.data.amount),
177
- measurement: C || void 0
178
- }
179
- ]
180
- }, r[w] = i.length > 0 ? r[w] ? `${r[w]}, Row ${o.index + 6}: ${i.join(", ")}` : `Row ${o.index + 6}: ${i.join(", ")}` : []);
181
- }
182
- }
183
- }
184
- const s = Object.values(a), y = s.filter((o) => !I[o.name]), c = s.filter((o) => I[o.name]), d = y.map((o, i) => ({
185
- type: "create",
186
- recipe: o,
187
- // Type assertion - _id will be assigned by backend
188
- errors: r[o.name],
189
- excelRowNumber: i + 6
190
- // Assuming header rows
191
- })), f = c.map((o, i) => {
192
- const v = I[o.name];
193
- return {
194
- type: "update",
195
- original: v,
196
- recipe: {
197
- ...v,
198
- name: o.name || v.name,
199
- contains: o.contains.length > 0 ? o.contains : v.contains,
200
- customAttributes: o.customAttributes || v.customAttributes
201
- },
202
- errors: r[o.name],
203
- excelRowNumber: i + 6
204
- };
205
- });
206
- return {
207
- invalidExcel: r.length > 0,
208
- invalidExcelMessage: r.length > 0 ? `Import completed with ${r.length} error(s): ${r.join("; ")}` : void 0,
209
- importCreateResult: d,
210
- importUpdateResult: f
211
- };
212
- } catch (p) {
213
- return {
214
- invalidExcel: !0,
215
- invalidExcelMessage: p instanceof Error ? p.message : "Unknown error occurred",
216
- importCreateResult: [],
217
- importUpdateResult: []
218
- };
219
- }
220
- }
221
- function ot(h) {
222
- const [
223
- e,
224
- k,
225
- p,
226
- g,
227
- I,
228
- b,
229
- ...r
230
- ] = Ae(h);
231
- if (!e || !e.length || e.some((d) => d.length && !d.startsWith("system:")))
232
- throw new Error("Missing meta header. Excel file does not come from the template.");
233
- const a = e.map((d) => d.split(":")[1]), y = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((d) => !a.includes(d));
234
- if (y.length)
235
- throw new Error(
236
- `Missing meta headers (${y.join()}). Excel file does not come from the template.`
237
- );
238
- return r.map((d, f) => {
239
- const o = {};
240
- for (const i in a) {
241
- const v = a[i];
242
- Object.assign(o, { [v]: d[i] });
243
- }
244
- return {
245
- index: f,
246
- data: o
247
- };
248
- }).filter((d) => {
249
- const { recipeName: f, type: o, code: i, name: v, amount: U, unit: C, baseUnit: w, measurementName: j, customAttributes: W } = d.data;
250
- return f || o || i || v || U || C || w || j || W;
251
- });
252
- }
253
- function rt() {
254
- const e = ke().currentBusiness.value, k = se(), p = [
255
- { id: "name", name: "Unit Name" },
256
- { id: "symbol", name: "Symbol" },
257
- { id: "precision", name: "Precision" },
258
- { id: "measurement_name", name: "Measurement Symbol" },
259
- { id: "measurement_symbol", name: "Measurement Symbol" },
260
- { id: "measurement_conversion", name: "Measurement Conversion" }
261
- ];
262
- let g = [];
263
- k.units.length > 0 ? k.units.forEach((r) => {
264
- if (r.measurements.length === 0)
265
- g.push([
266
- r.name,
267
- r.abbrev,
268
- r.precision,
269
- "",
270
- "",
271
- ""
272
- ]);
273
- else {
274
- g.push([
275
- r.name,
276
- r.abbrev,
277
- r.precision,
278
- r.measurements[0].name,
279
- r.measurements[0].abbrev,
280
- +Ie(r.measurements[0].conversion)
281
- ]);
282
- for (let a = 1; a < r.measurements.length; a++)
283
- g.push([
284
- "",
285
- "",
286
- "",
287
- r.measurements[a].name,
288
- r.measurements[a].abbrev,
289
- +Ie(r.measurements[a].conversion)
290
- ]);
291
- }
292
- }) : g = [
293
- ["Length", "m", 2, "Meter", "m", 1],
294
- ["", "", "", "Centimeter", "cm", 0.01],
295
- ["", "", "", "Millimeter", "mm", 1e-3],
296
- ["Weight", "kg", 3, "Kilogram", "kg", 1],
297
- ["", "", "", "Gram", "g", 1e-3],
298
- ["", "", "", "Pound", "lb", 0.453592]
299
- ];
300
- const I = [
301
- ["Business name:", e == null ? void 0 : e.name],
302
- ["Business ID:", e == null ? void 0 : e._id],
303
- ["Menu version", e == null ? void 0 : e.menuVersion],
304
- [],
305
- p.map((r) => r.name),
306
- ...g
307
- ], b = p.map((r) => `system:${r.id}`);
308
- return Re(I, b);
309
- }
310
- function st() {
311
- const e = ke().currentBusiness.value, k = se(), p = Xe();
312
- let g = [];
313
- k.skus.length > 0 ? g = k.skus.map((r) => {
314
- var a, s, y, c, d, f, o, i;
315
- return [
316
- r.code,
317
- r.name,
318
- ((a = r.unit) == null ? void 0 : a.name) || "",
319
- ((s = r.unit) == null ? void 0 : s.abbrev) || "",
320
- ((c = (y = r.unit) == null ? void 0 : y.measurements.find((v) => v.id === r.trackingMeasurement)) == null ? void 0 : c.abbrev) ?? r.unit.abbrev,
321
- r.valuation || "WAVG",
322
- (d = r.defaultCost) != null && d.costPerUnit ? +Ie((f = r.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
323
- ((o = r.thresholds) == null ? void 0 : o.low) ?? Ne().low,
324
- ((i = r.thresholds) == null ? void 0 : i.mid) ?? Ne().mid,
325
- r.customAttributes ? Object.entries(r.customAttributes).map(([v, U]) => `${v}:${U}`).join("|") : ""
326
- ];
327
- }) : g = [
328
- ["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
329
- ];
330
- const I = [
331
- ["Business name:", e == null ? void 0 : e.name],
332
- ["Business ID:", e == null ? void 0 : e._id],
333
- ["Menu version", e == null ? void 0 : e.menuVersion],
334
- [],
335
- p.map((r) => r.name),
336
- ...g
337
- ], b = p.map((r) => `system:${r.id}`);
338
- return Re(I, b);
339
- }
340
- function it() {
341
- const e = ke().currentBusiness.value, k = se(), p = [
342
- { id: "recipeName", name: "Recipe Name" },
343
- { id: "type", name: "Type" },
344
- { id: "code", name: "Code" },
345
- { id: "name", name: "Item Name" },
346
- { id: "amount", name: "Amount" },
347
- { id: "unit", name: "Unit" },
348
- { id: "baseUnit", name: "Unit Symbol" },
349
- { id: "measurementName", name: "Measurement Symbol" },
350
- { id: "customAttributes", name: "Custom Attributes" }
351
- ];
352
- let g = [];
353
- if (k.recipes.length > 0) {
354
- const r = k.recipeById, a = k.skuById;
355
- g = k.recipes.flatMap((s) => {
356
- var c;
357
- const y = s.customAttributes ? Object.entries(s.customAttributes).map(([d, f]) => `${d}:${f}`).join("|") : "";
358
- if ((c = s.contains) != null && c.length) {
359
- const d = s.contains.filter((o) => o.type === "RECIPE"), f = s.contains.filter((o) => o.type === "SKU");
360
- return [
361
- ...d.map((o, i) => {
362
- var v;
363
- return [
364
- i === 0 ? s.name : "",
365
- "RECIPE",
366
- "",
367
- ((v = r[o.id]) == null ? void 0 : v.name) || "",
368
- o.amount.amount,
369
- "",
370
- "unit",
371
- "Unit",
372
- i === 0 ? y : ""
373
- ];
374
- }),
375
- ...f.map((o, i) => {
376
- var v, U, C, w, j, W, ie, pe, ve, ye, ge, ae, fe, le, be, he;
377
- return [
378
- !d.length && i === 0 ? s.name : "",
379
- "INGREDIENT",
380
- ((v = a[o.id]) == null ? void 0 : v.code) || "",
381
- ((U = a[o.id]) == null ? void 0 : U.name) || "",
382
- +Ie(o.amount),
383
- o.measurement ? ((w = (C = a[o.id]) == null ? void 0 : C.unit) == null ? void 0 : w.name) || "" : ((W = (j = a[o.id]) == null ? void 0 : j.unit) == null ? void 0 : W.name) || "",
384
- o.measurement ? ((pe = (ie = a[o.id]) == null ? void 0 : ie.unit) == null ? void 0 : pe.abbrev) || "" : ((ye = (ve = a[o.id]) == null ? void 0 : ve.unit) == null ? void 0 : ye.abbrev) || "",
385
- o.measurement ? o.measurement.abbrev : ((le = (fe = (ae = (ge = a[o.id]) == null ? void 0 : ge.unit) == null ? void 0 : ae.measurements) == null ? void 0 : fe.find((Ee) => {
386
- var xe;
387
- return Ee.id === ((xe = a[o.id]) == null ? void 0 : xe.trackingMeasurement);
388
- })) == null ? void 0 : le.abbrev) || ((he = (be = a[o.id]) == null ? void 0 : be.unit) == null ? void 0 : he.abbrev) || "",
389
- !d.length && i === 0 ? y : ""
390
- ];
391
- })
392
- ];
393
- }
394
- return [];
395
- });
396
- } else
397
- g = [
398
- ["Pizza Dough", "INGREDIENT", "FLOUR001", "Flour", "500", "Weight", "g", "Gram", "difficulty:easy, category:italian"],
399
- ["", "INGREDIENT", "WATER001", "Water", "300", "Volume", "ml", "Milliliter", ""],
400
- ["", "INGREDIENT", "SALT001", "Salt", "10", "Weight", "g", "Gram", ""]
401
- ];
402
- const I = [
403
- ["Business name:", e == null ? void 0 : e.name],
404
- ["Business ID:", e == null ? void 0 : e._id],
405
- ["Menu version", e == null ? void 0 : e.menuVersion],
406
- [],
407
- p.map((r) => r.name),
408
- ...g
409
- ], b = p.map((r) => `system:${r.id}`);
410
- return Re(I, b);
411
- }
412
- function at() {
413
- const h = Oe({
414
- unit: rt(),
415
- ingredient: st(),
416
- recipe: it()
417
- }), e = "FeedMe comprehensive template.xlsx";
418
- return Le(h, e), e;
419
- }
420
- async function lt(h) {
421
- if (!h) return null;
422
- try {
423
- return tt(h);
424
- } catch (e) {
425
- throw console.error("Error in processUnitsSheet:", e), e;
426
- }
427
- }
428
- async function mt(h) {
429
- if (!h) return null;
430
- try {
431
- return qe(h);
432
- } catch (e) {
433
- throw console.error("Error in processIngredientsSheet:", e), e;
434
- }
435
- }
436
- async function ut(h) {
437
- if (!h) return null;
438
- try {
439
- const e = ot(h);
440
- return nt(e, { ignoreErrors: !0 });
441
- } catch (e) {
442
- throw console.error("Error in processRecipesSheet:", e), e;
443
- }
444
- }
445
- function oe(h) {
446
- return (h ?? []).filter((e) => !e.errors || e.errors.length === 0).map(({ errors: e, ...k }) => k);
447
- }
448
- const dt = { class: "flex flex-col gap-24" }, ct = { class: "flex flex-col gap-8" }, pt = { class: "flex flex-col flex-1 gap-4" }, vt = { class: "fm-typo-en-body-md-600" }, yt = {
449
- key: 2,
450
- class: "shrink-0"
451
- }, gt = {
452
- key: 0,
453
- class: "flex flex-col"
454
- }, ft = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, bt = {
455
- key: 0,
456
- class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
457
- }, ht = { class: "fm-typo-en-body-lg-600" }, xt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _t = /* @__PURE__ */ Te({
458
- __name: "ImportDialog",
459
- setup(h) {
460
- const e = F(null), k = ze();
461
- Ge();
462
- const p = F(!1), g = F(new Array()), I = F(null), b = F([]), r = F([]), a = K(() => !!g.value.length), s = K(() => !!I.value && b.value.length > 0), { t: y } = $e();
463
- async function c(o) {
464
- g.value = [], I.value = null, b.value = [], r.value = [];
465
- try {
466
- p.value = !0;
467
- const [i] = await Promise.all([
468
- Ke(o),
469
- // fake buffer for UX
470
- new Promise((v) => setTimeout(v, 1e3))
471
- ]);
472
- I.value = i, d();
473
- } catch (i) {
474
- console.error("Error parsing Excel file:", i), g.value.push((i == null ? void 0 : i.message) || "Unknown error occurred");
475
- } finally {
476
- p.value = !1;
477
- }
478
- }
479
- function d() {
480
- if (g.value = [], !I.value) return;
481
- const i = ["unit", "ingredient", "recipe"].filter((v) => I.value.Sheets[v]);
482
- if (i.length === 0) {
483
- g.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
484
- return;
485
- }
486
- b.value = i, k.emitData({ availableSheets: i, workbook: I.value });
487
- }
488
- Be(e, (o) => {
489
- o && c(o);
490
- });
491
- function f() {
492
- if (!I.value || b.value.length === 0) return "";
493
- const o = [];
494
- return b.value.forEach((i) => {
495
- switch (i) {
496
- case "unit":
497
- o.push("Units sheet found");
498
- break;
499
- case "ingredient":
500
- o.push("Ingredients sheet found");
501
- break;
502
- case "recipe":
503
- o.push("Recipes sheet found");
504
- break;
505
- }
506
- }), o.length > 0 ? `Ready to process: ${o.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
507
- }
508
- return (o, i) => {
509
- const v = Q("FmCircularProgress"), U = Q("FmIcon"), C = Q("FmButton");
510
- return N(), G("div", dt, [
511
- $(Qe, {
512
- class: ce({
513
- "w-full": !0,
514
- "h-[200px]": !e.value
515
- }),
516
- accept: ".xlsx,.xls",
517
- onFileUpload: i[0] || (i[0] = (w) => e.value = w),
518
- label: l(y)("inventory.ingredient.import.uploadTemplate"),
519
- "button-label": l(y)("inventory.ingredient.import.selectFile")
520
- }, je({ _: 2 }, [
521
- e.value ? {
522
- name: "default",
523
- fn: X(({ openFileDialog: w }) => [
524
- n("div", ct, [
525
- n("div", {
526
- class: ce([
527
- "fm-corner-radius-md p-16 flex items-center gap-16",
528
- {
529
- "border border-fm-color-neutral-gray-100": p.value,
530
- "border border-fm-color-neutral-gray-200": !p.value && !a.value,
531
- "border border-fm-color-system-error-200": a.value
532
- }
533
- ])
534
- }, [
535
- p.value ? (N(), re(v, {
536
- key: 0,
537
- size: "md",
538
- color: "neutral-gray-200"
539
- })) : (N(), re(U, {
540
- key: 1,
541
- name: a.value ? "error" : "check_circle",
542
- color: a.value ? "system-error-300" : "system-success-400",
543
- size: "lg"
544
- }, null, 8, ["name", "color"])),
545
- n("div", pt, [
546
- n("div", vt, m(e.value.name), 1),
547
- n("div", {
548
- class: ce([
549
- "fm-typo-en-body-sm-400",
550
- {
551
- "text-fm-color-system-error-300": a.value,
552
- "text-fm-color-typo-secondary": !a.value
553
- }
554
- ])
555
- }, m(a.value ? l(y)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
556
- ]),
557
- p.value ? Y("", !0) : (N(), G("div", yt, [
558
- $(C, {
559
- label: l(y)("inventory.ingredient.import.replaceFile"),
560
- variant: a.value ? "destructive" : "secondary",
561
- "prepend-icon": a.value ? void 0 : "autorenew",
562
- onClick: w
563
- }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
564
- ]))
565
- ], 2),
566
- g.value.length ? (N(), G("div", gt, [
567
- (N(!0), G(Ue, null, Fe(g.value, (j, W) => (N(), G("div", {
568
- key: W,
569
- class: "flex gap-8 items-center"
570
- }, [
571
- $(U, {
572
- name: "error",
573
- size: "sm",
574
- color: "system-error-300"
575
- }),
576
- n("div", ft, m(j), 1)
577
- ]))), 128))
578
- ])) : Y("", !0)
579
- ])
580
- ]),
581
- key: "0"
582
- } : void 0
583
- ]), 1032, ["class", "label", "button-label"]),
584
- s.value ? (N(), G("div", bt, [
585
- n("div", ht, m(l(y)("inventory.ingredient.import.summary")), 1),
586
- n("div", xt, m(f()), 1)
587
- ])) : Y("", !0)
588
- ]);
589
- };
590
- }
591
- }), wt = {
592
- key: 0,
593
- class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
594
- }, It = { class: "flex items-start gap-12" }, Et = { class: "flex flex-col gap-8" }, St = { class: "fm-typo-en-body-md-400 text-blue-800" }, kt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Rt = { class: "mb-8" }, Ct = ["innerHTML"], Nt = ["innerHTML"], Mt = { class: "mb-8" }, Tt = { class: "mb-12" }, Ut = { class: "mb-12" }, Ft = { class: "mb-8" }, $t = { class: "text-orange-600" }, Gt = {
595
- key: 1,
596
- class: "bg-white rounded-lg shadow"
597
- }, At = { class: "flex items-center justify-between p-16 border-b" }, Dt = { class: "fm-typo-en-title-md-600" }, Bt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, jt = {
598
- key: 0,
599
- class: "text-red-600"
600
- }, Pt = {
601
- key: 1,
602
- class: "text-orange-600"
603
- }, zt = {
604
- key: 2,
605
- class: "text-green-600"
606
- }, Ht = { class: "flex gap-8" }, Vt = { class: "p-16" }, Wt = {
607
- key: 2,
608
- class: "bg-white rounded-lg shadow"
609
- }, Ot = { class: "flex items-center justify-between p-16 border-b" }, Lt = { class: "fm-typo-en-title-md-600 text-red-800" }, Kt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Jt = { class: "flex gap-8" }, qt = { class: "p-16" }, Xt = {
610
- key: 0,
611
- class: "flex flex-col gap-16 p-16"
612
- }, Qt = { class: "fm-typo-en-title-sm-600 mb-12" }, Yt = { class: "grid grid-cols-2 gap-12" }, Zt = { class: "fm-typo-en-body-sm-400 text-gray-600" }, en = { class: "fm-typo-en-body-md-600" }, tn = { key: 0 }, nn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, on = { class: "fm-typo-en-body-md-600" }, rn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, sn = { class: "fm-typo-en-body-md-600" }, an = { class: "fm-typo-en-body-sm-400 text-gray-600" }, ln = { class: "fm-typo-en-body-md-600" }, mn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, un = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, dn = { class: "space-y-8" }, cn = { class: "fm-typo-en-body-md-400 text-red-800" }, pn = { class: "fm-typo-en-title-sm-600 mb-12" }, vn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, yn = { class: "text-sm" }, gn = { class: "flex gap-8" }, fn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, bn = { class: "text-center" }, hn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, xn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, _n = { class: "text-center" }, wn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, In = { class: "fm-typo-en-body-md-400 text-gray-500" }, Dn = /* @__PURE__ */ Te({
613
- __name: "ImportView",
614
- setup(h) {
615
- const { t: e } = $e(), k = He(), p = Ge();
616
- Pe();
617
- const g = We(), { breakpoints: I } = Ve(), b = se(), r = F("");
618
- F(!1);
619
- const a = F(!1), s = F(null), y = F(!1), c = F(null), d = F(!1), f = F([]), o = F(null), i = F([]), v = F(!1), U = K(() => I.value.xs || I.value.sm), C = K(() => U.value ? 10 : 20), w = K(() => {
620
- const u = s.value;
621
- if (!u) return [];
622
- const t = [], { units: R, skus: A, recipes: O, _invalidExcel: H, _invalidExcelMessage: J } = u, q = (T) => {
623
- var B;
624
- return ((B = T.errors) == null ? void 0 : B.length) > 0 ? Array.isArray(T.errors) ? T.errors.join(", ") : T.errors || e("inventory.common.validationFailed") : H ? J || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
625
- }, z = (T, P) => {
626
- if (T)
627
- for (const B of ["create", "update"]) {
628
- const V = T[B];
629
- if (V)
630
- for (const D of V)
631
- t.push({
632
- name: D.name || D.abbrev || D.code || e("inventory.common.unknown"),
633
- type: P,
634
- operation: e(B === "create" ? "inventory.common.create" : "inventory.common.update"),
635
- status: q(D),
636
- errors: D.errors || [],
637
- details: D
638
- });
639
- }
640
- };
641
- return z(R, e("inventory.common.unit")), z(A, e("inventory.common.ingredient")), z(O, e("inventory.common.recipe")), t;
642
- }), j = K(() => w.value.some(
643
- (u) => u.errors && u.errors.length > 0
644
- )), W = K(() => w.value.some(
645
- (u) => u.status && u.status.includes("Invalid Excel")
646
- )), ie = K(() => {
647
- const u = w.value.find(
648
- (t) => t.status && t.status.includes("Invalid Excel")
649
- );
650
- return (u == null ? void 0 : u.status) || e("inventory.common.invalidExcelFormatDetected");
651
- }), pe = K(() => !i.value || i.value.length === 0 ? [] : i.value.map((u, t) => {
652
- var R, A;
653
- return {
654
- id: t + 1,
655
- name: ((R = u.error.data) == null ? void 0 : R.name) || e("inventory.common.unknown"),
656
- type: u.type || e("inventory.common.general"),
657
- message: ((A = u.error) == null ? void 0 : A.message) || JSON.stringify(u.error)
658
- };
659
- }));
660
- function ve(u) {
661
- switch (u) {
662
- case "import":
663
- return ye();
664
- }
665
- }
666
- function ye() {
667
- k.open({
668
- title: e("inventory.common.import"),
669
- contentComponent: _t,
670
- overlay: !0,
671
- closeButton: !0,
672
- primaryActions: {
673
- text: e("inventory.common.next"),
674
- close: !1
675
- },
676
- secondaryActions: {
677
- text: e("inventory.common.close"),
678
- close: !0
679
- },
680
- tertiaryActions: {
681
- text: e("inventory.ingredient.import.actions.downloadTemplate"),
682
- close: !1,
683
- variant: "plain"
684
- }
685
- }).onPrimary(async (u) => {
686
- u && u.workbook && u.availableSheets && (await ge(u), k.close()), f.value.length === 0 && k.close();
687
- }).onTertiary(() => {
688
- try {
689
- const u = at();
690
- p.open({
691
- title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
692
- message: e("inventory.common.templateDownloaded", [u]),
693
- type: "success"
694
- });
695
- } catch (u) {
696
- p.open({
697
- title: e("inventory.common.downloadFailed"),
698
- message: e("inventory.common.failedDownloadTemplate"),
699
- type: "error"
700
- }), console.error("Error downloading template:", u);
701
- }
702
- });
703
- }
704
- async function ge(u) {
705
- o.value = u.workbook, f.value = [...u.availableSheets], s.value = {}, i.value = [], await ae();
706
- }
707
- async function ae() {
708
- var t, R, A, O, H, J, q, z, T, P, B, V, D, me, ue;
709
- if (!o.value || f.value.length === 0) {
710
- y.value = !0;
711
- return;
712
- }
713
- const u = f.value[0];
714
- try {
715
- switch (u) {
716
- case "unit": {
717
- const L = o.value.Sheets.unit, E = await lt(L);
718
- E && (s.value = {
719
- ...s.value,
720
- _invalidExcel: E.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
721
- _invalidExcelMessage: E.invalidExcelMessage || ((R = s.value) == null ? void 0 : R._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
722
- units: E.importCreateResult || E.importUpdateResult ? {
723
- create: ((A = E.importCreateResult) == null ? void 0 : A.map((x) => ({
724
- ...x.unit,
725
- errors: x.errors
726
- }))) || [],
727
- update: ((O = E.importUpdateResult) == null ? void 0 : O.map((x) => ({
728
- ...x.unit,
729
- errors: x.errors
730
- }))) || []
731
- } : (H = s.value) == null ? void 0 : H.units
732
- });
733
- break;
734
- }
735
- case "ingredient": {
736
- const L = o.value.Sheets.ingredient, E = await mt(L);
737
- E && (s.value = {
738
- ...s.value,
739
- _invalidExcel: E.invalidExcel || ((J = s.value) == null ? void 0 : J._invalidExcel),
740
- _invalidExcelMessage: E.invalidExcelMessage || ((q = s.value) == null ? void 0 : q._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
741
- skus: E.importCreateResult || E.importUpdateResult ? {
742
- create: ((z = E.importCreateResult) == null ? void 0 : z.map((x) => ({
743
- ...x.sku,
744
- errors: x.errors
745
- }))) || [],
746
- update: ((T = E.importUpdateResult) == null ? void 0 : T.map((x) => ({
747
- ...x.sku,
748
- errors: x.errors
749
- }))) || []
750
- } : (P = s.value) == null ? void 0 : P.skus
751
- });
752
- break;
753
- }
754
- case "recipe": {
755
- const L = o.value.Sheets.recipe, E = await ut(L);
756
- E && (s.value = {
757
- ...s.value,
758
- _invalidExcel: E.invalidExcel || ((B = s.value) == null ? void 0 : B._invalidExcel),
759
- _invalidExcelMessage: E.invalidExcelMessage || ((V = s.value) == null ? void 0 : V._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
760
- recipes: E.importCreateResult || E.importUpdateResult ? {
761
- create: ((D = E.importCreateResult) == null ? void 0 : D.map((x) => ({
762
- ...x.recipe,
763
- errors: x.errors
764
- }))) || [],
765
- update: ((me = E.importUpdateResult) == null ? void 0 : me.map((x) => ({
766
- ...x.recipe,
767
- errors: x.errors
768
- }))) || []
769
- } : (ue = s.value) == null ? void 0 : ue.recipes
770
- });
771
- break;
772
- }
773
- }
774
- f.value.shift(), y.value = !0;
775
- } catch (L) {
776
- console.error(`Error processing ${u} sheet:`, L), p.open({
777
- title: e("inventory.common.processingError"),
778
- message: e("inventory.common.failedToProcessSheet", [u]),
779
- type: "error"
780
- });
781
- }
782
- }
783
- async function fe() {
784
- var u, t, R, A, O, H, J, q, z, T, P, B, V, D, me, ue, L, E;
785
- if (s.value) {
786
- if (W.value) {
787
- p.open({
788
- title: e("inventory.common.invalidExcelFormatTitle"),
789
- message: ie.value,
790
- type: "error"
791
- });
792
- return;
793
- }
794
- if (j.value) {
795
- p.open({
796
- title: e("inventory.ingredient.import.error.invalidContent"),
797
- message: e("inventory.ingredient.import.error.hasErrors"),
798
- type: "error"
799
- });
800
- return;
801
- }
802
- a.value = !0;
803
- try {
804
- let x = 0, te = "";
805
- if (s.value.units && ((u = s.value.units.create) != null && u.length || (t = s.value.units.update) != null && t.length)) {
806
- const M = {
807
- create: oe(s.value.units.create),
808
- update: oe(s.value.units.update)
809
- };
810
- if (M.create.length || M.update.length) {
811
- const _ = await b.importUnits(M);
812
- ((R = _ == null ? void 0 : _.errors) == null ? void 0 : R.length) > 0 && i.value.push(..._.errors.map((ne) => ({
813
- type: "units",
814
- error: ne
815
- })));
816
- const Z = M.create.length + M.update.length, ee = ((A = _ == null ? void 0 : _.errors) == null ? void 0 : A.length) || 0;
817
- x = Z - ee, te = "units", s.value = {
818
- ...s.value,
819
- units: null
820
- };
821
- }
822
- } else if (s.value.skus && ((O = s.value.skus.create) != null && O.length || (H = s.value.skus.update) != null && H.length)) {
823
- const M = {
824
- create: oe(s.value.skus.create),
825
- update: oe(s.value.skus.update)
826
- };
827
- if (M.create.length || M.update.length) {
828
- const _ = await b.importSkus(M);
829
- ((J = _ == null ? void 0 : _.errors) == null ? void 0 : J.length) > 0 && i.value.push(..._.errors.map((ne) => ({
830
- type: "ingredients",
831
- error: ne
832
- })));
833
- const Z = M.create.length + M.update.length, ee = ((q = _ == null ? void 0 : _.errors) == null ? void 0 : q.length) || 0;
834
- x = Z - ee, te = "ingredients", s.value = {
835
- ...s.value,
836
- skus: null
837
- };
838
- }
839
- } else if (s.value.recipes && ((z = s.value.recipes.create) != null && z.length || (T = s.value.recipes.update) != null && T.length)) {
840
- const M = {
841
- create: oe(s.value.recipes.create),
842
- update: oe(s.value.recipes.update)
843
- };
844
- if (M.create.length || M.update.length) {
845
- const _ = await b.importRecipes(M);
846
- ((P = _ == null ? void 0 : _.errors) == null ? void 0 : P.length) > 0 && i.value.push(..._.errors.map((ne) => ({
847
- type: "recipes",
848
- error: ne
849
- })));
850
- const Z = M.create.length + M.update.length, ee = ((B = _ == null ? void 0 : _.errors) == null ? void 0 : B.length) || 0;
851
- x = Z - ee, te = "recipes", s.value = {
852
- ...s.value,
853
- recipes: null
854
- };
855
- }
856
- }
857
- if (x > 0) {
858
- const M = i.value.filter((_) => _.type === te);
859
- M.length > 0 ? p.open({
860
- title: e("inventory.common.importCompletedWithIssues"),
861
- message: e("inventory.common.successfullyImported", [x, te, M.length, te]),
862
- type: "warning"
863
- }) : p.open({
864
- title: e("inventory.ingredient.import.success"),
865
- message: e("inventory.common.successfullyImported", [x, te, "0", ""]),
866
- type: "success"
867
- });
868
- }
869
- if (f.value.length > 0)
870
- await ae();
871
- else if (!(s.value.units && (((V = s.value.units.create) == null ? void 0 : V.length) || ((D = s.value.units.update) == null ? void 0 : D.length)) || s.value.skus && (((me = s.value.skus.create) == null ? void 0 : me.length) || ((ue = s.value.skus.update) == null ? void 0 : ue.length)) || s.value.recipes && (((L = s.value.recipes.create) == null ? void 0 : L.length) || ((E = s.value.recipes.update) == null ? void 0 : E.length))))
872
- if (le(), i.value.length > 0) {
873
- const _ = i.value.filter((de) => de.type === "units").length, Z = i.value.filter((de) => de.type === "ingredients").length, ee = i.value.filter((de) => de.type === "recipes").length, ne = _ + Z + ee;
874
- v.value = !0, p.open({
875
- title: e("inventory.common.importCompletedWithIssues"),
876
- message: e("inventory.common.importFinishedWithFailedItems", [ne, _, Z, ee]),
877
- type: "warning"
878
- }), console.error("Import errors:", i.value);
879
- } else
880
- p.open({
881
- title: e("inventory.common.importComplete"),
882
- message: e("inventory.common.allDataSuccessfullyImported"),
883
- type: "success"
884
- });
885
- } catch (x) {
886
- p.open({
887
- title: e("inventory.ingredient.import.error.failed"),
888
- message: (x == null ? void 0 : x.message) || e("inventory.common.unknownErrorOccurred"),
889
- type: "error"
890
- }), console.error("Error during import:", x);
891
- } finally {
892
- a.value = !1;
893
- }
894
- }
895
- }
896
- function le() {
897
- y.value = !1, v.value = !1, s.value = null, f.value = [], o.value = null;
898
- }
899
- function be() {
900
- v.value = !1, i.value = [];
901
- }
902
- function he() {
903
- d.value = !1, c.value = null;
904
- }
905
- const Ee = K(() => [
906
- {
907
- label: e("inventory.common.import"),
908
- value: "import",
909
- isPrimary: !1,
910
- prependIcon: "upload"
911
- }
912
- ]), xe = Ce([
913
- {
914
- id: "name",
915
- accessorKey: "name",
916
- header: () => e("inventory.common.name"),
917
- size: 200
918
- },
919
- {
920
- id: "type",
921
- accessorKey: "type",
922
- header: () => e("inventory.common.type"),
923
- size: 120
924
- },
925
- {
926
- id: "operation",
927
- accessorKey: "operation",
928
- header: () => e("inventory.common.operation"),
929
- size: 100
930
- },
931
- {
932
- id: "status",
933
- accessorKey: "status",
934
- header: () => e("inventory.common.status"),
935
- size: 120,
936
- cell: (u) => {
937
- const t = u.row.original.status;
938
- let R = "px-8 py-4 rounded";
939
- return t === e("inventory.common.readyToImport") ? R += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? R += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? R += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? R += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), R += " bg-red-100 text-red-800 border border-red-200"), _e("div", { class: R, title: t }, t);
940
- }
941
- }
942
- ]), De = Ce([
943
- {
944
- id: "name",
945
- accessorKey: "name",
946
- header: () => e("inventory.common.name"),
947
- cell: (u) => _e("div", { class: "text-gray-800 text-sm py-2" }, u.row.original.name || e("inventory.common.unknown"))
948
- },
949
- {
950
- id: "type",
951
- accessorKey: "type",
952
- header: () => e("inventory.common.errorType"),
953
- cell: (u) => {
954
- const t = u.row.original.type, R = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
955
- return _e("div", { class: "text-gray-800 text-sm py-2" }, R);
956
- }
957
- },
958
- {
959
- id: "message",
960
- accessorKey: "message",
961
- header: () => e("inventory.common.errorMessage"),
962
- cell: (u) => _e(
963
- "div",
964
- { class: "text-red-800 text-sm py-2", title: u.row.original.message },
965
- u.row.original.message
966
- )
967
- }
968
- ]);
969
- return (u, t) => {
970
- const R = Q("FmIcon"), A = Q("FmButton"), O = Q("FmTable"), H = Q("FmCard"), J = Q("FmSideSheet"), q = Q("FmSpinner");
971
- return l(g).isLoaded && l(g).enableBulkImport ? (N(), re(Se, {
972
- key: 0,
973
- title: l(e)("inventory.common.import"),
974
- actions: Ee.value,
975
- "onClick:action": ve
976
- }, {
977
- default: X(() => {
978
- var z;
979
- return [
980
- n("div", {
981
- class: ce([
982
- "flex flex-col gap-8 max-h-full",
983
- {
984
- "p-0": U.value,
985
- "px-24": !U.value
986
- }
987
- ])
988
- }, [
989
- y.value ? Y("", !0) : (N(), G("div", wt, [
990
- n("div", It, [
991
- $(R, {
992
- name: "info",
993
- class: "text-blue-600 mt-2"
994
- }),
995
- n("div", Et, [
996
- n("div", St, m(l(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
997
- n("div", kt, [
998
- n("div", Rt, [
999
- n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1000
- ]),
1001
- t[39] || (t[39] = S(" 1. ")),
1002
- n("span", {
1003
- innerHTML: l(e)("inventory.ingredient.import.importInstructions.step1")
1004
- }, null, 8, Ct),
1005
- t[40] || (t[40] = n("br", null, null, -1)),
1006
- t[41] || (t[41] = S(" 2. ")),
1007
- n("span", {
1008
- innerHTML: l(e)("inventory.ingredient.import.importInstructions.step2")
1009
- }, null, 8, Nt),
1010
- t[42] || (t[42] = n("br", null, null, -1)),
1011
- S(" 3. " + m(l(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1012
- t[43] || (t[43] = n("br", null, null, -1)),
1013
- S(" 4. " + m(l(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1014
- t[44] || (t[44] = n("br", null, null, -1)),
1015
- t[45] || (t[45] = n("br", null, null, -1)),
1016
- n("div", Mt, [
1017
- n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1018
- ]),
1019
- n("div", Tt, [
1020
- n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
1021
- S(" " + m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1022
- t[1] || (t[1] = n("br", null, null, -1)),
1023
- t[2] || (t[2] = S(" • ")),
1024
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
1025
- t[3] || (t[3] = n("br", null, null, -1)),
1026
- t[4] || (t[4] = S(" • ")),
1027
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
1028
- t[5] || (t[5] = n("br", null, null, -1)),
1029
- t[6] || (t[6] = S(" • ")),
1030
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
1031
- t[7] || (t[7] = n("br", null, null, -1)),
1032
- t[8] || (t[8] = S(" • ")),
1033
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
1034
- t[9] || (t[9] = n("br", null, null, -1)),
1035
- t[10] || (t[10] = S(" • ")),
1036
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
1037
- t[11] || (t[11] = n("br", null, null, -1)),
1038
- t[12] || (t[12] = S(" • ")),
1039
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
1040
- ]),
1041
- n("div", Ut, [
1042
- n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
1043
- S(" " + m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1044
- t[13] || (t[13] = n("br", null, null, -1)),
1045
- t[14] || (t[14] = S(" • ")),
1046
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
1047
- t[15] || (t[15] = n("br", null, null, -1)),
1048
- t[16] || (t[16] = S(" • ")),
1049
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
1050
- t[17] || (t[17] = n("br", null, null, -1)),
1051
- t[18] || (t[18] = S(" • ")),
1052
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
1053
- t[19] || (t[19] = n("br", null, null, -1)),
1054
- t[20] || (t[20] = S(" • ")),
1055
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
1056
- t[21] || (t[21] = n("br", null, null, -1)),
1057
- t[22] || (t[22] = S(" • ")),
1058
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
1059
- ]),
1060
- n("div", Ft, [
1061
- n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
1062
- S(" " + m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1063
- t[23] || (t[23] = n("br", null, null, -1)),
1064
- t[24] || (t[24] = S(" • ")),
1065
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
1066
- t[25] || (t[25] = n("br", null, null, -1)),
1067
- t[26] || (t[26] = S(" • ")),
1068
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
1069
- t[27] || (t[27] = n("br", null, null, -1)),
1070
- t[28] || (t[28] = S(" • ")),
1071
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
1072
- t[29] || (t[29] = n("br", null, null, -1)),
1073
- t[30] || (t[30] = S(" • ")),
1074
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
1075
- t[31] || (t[31] = n("br", null, null, -1)),
1076
- t[32] || (t[32] = S(" • ")),
1077
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
1078
- t[33] || (t[33] = n("br", null, null, -1)),
1079
- t[34] || (t[34] = S(" • ")),
1080
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
1081
- t[35] || (t[35] = n("br", null, null, -1)),
1082
- t[36] || (t[36] = S(" • ")),
1083
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
1084
- t[37] || (t[37] = n("br", null, null, -1)),
1085
- t[38] || (t[38] = S(" • ")),
1086
- n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
1087
- ]),
1088
- n("div", $t, [
1089
- n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
1090
- ])
1091
- ])
1092
- ])
1093
- ])
1094
- ])),
1095
- y.value ? (N(), G("div", Gt, [
1096
- n("div", At, [
1097
- n("div", null, [
1098
- n("div", Dt, m(l(e)("inventory.common.importPreview")), 1),
1099
- n("div", Bt, [
1100
- W.value ? (N(), G("span", jt, m(l(e)("inventory.common.errorExist")) + ": " + m(ie.value), 1)) : j.value ? (N(), G("span", Pt, m(l(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), G("span", zt, m(l(e)("inventory.common.allItemsValidReadyImport")), 1))
1101
- ])
1102
- ]),
1103
- n("div", Ht, [
1104
- $(A, {
1105
- variant: "secondary",
1106
- onClick: le,
1107
- label: l(e)("inventory.common.cancel")
1108
- }, null, 8, ["label"]),
1109
- $(A, {
1110
- variant: "primary",
1111
- onClick: fe,
1112
- loading: a.value,
1113
- disabled: a.value || j.value || W.value,
1114
- label: l(e)("inventory.common.import")
1115
- }, null, 8, ["loading", "disabled", "label"])
1116
- ])
1117
- ]),
1118
- n("div", Vt, [
1119
- $(O, {
1120
- "column-defs": xe.value,
1121
- "row-data": w.value,
1122
- "page-size": C.value,
1123
- "search-value": r.value,
1124
- loading: !1,
1125
- "row-hover": ""
1126
- }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1127
- ])
1128
- ])) : Y("", !0),
1129
- v.value && i.value.length > 0 ? (N(), G("div", Wt, [
1130
- n("div", Ot, [
1131
- n("div", null, [
1132
- n("div", Lt, m(l(e)("inventory.common.importErrors")), 1),
1133
- n("div", Kt, m(i.value.length) + " " + m(l(e)("inventory.common.itemsFailedImport")), 1)
1134
- ]),
1135
- n("div", Jt, [
1136
- $(A, {
1137
- variant: "secondary",
1138
- onClick: be,
1139
- label: l(e)("inventory.common.close")
1140
- }, null, 8, ["label"])
1141
- ])
1142
- ]),
1143
- n("div", qt, [
1144
- $(O, {
1145
- "column-defs": De.value,
1146
- "row-data": pe.value,
1147
- "page-size": C.value,
1148
- "search-value": r.value,
1149
- loading: !1,
1150
- "row-hover": ""
1151
- }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1152
- ])
1153
- ])) : Y("", !0)
1154
- ], 2),
1155
- $(J, {
1156
- "model-value": d.value,
1157
- "onUpdate:modelValue": t[0] || (t[0] = (T) => d.value = T),
1158
- header: `${(z = c.value) == null ? void 0 : z.type} Details`,
1159
- "max-width": 600,
1160
- "dismiss-away": ""
1161
- }, {
1162
- "side-sheet-footer": X(() => [
1163
- n("div", gn, [
1164
- $(A, {
1165
- label: l(e)("inventory.common.close"),
1166
- variant: "tertiary",
1167
- onClick: he
1168
- }, null, 8, ["label"])
1169
- ])
1170
- ]),
1171
- default: X(() => [
1172
- c.value != null ? (N(), G("div", Xt, [
1173
- $(H, {
1174
- variant: "outlined",
1175
- class: "p-16"
1176
- }, {
1177
- default: X(() => {
1178
- var T, P, B, V, D;
1179
- return [
1180
- n("div", Qt, m(l(e)("inventory.common.basicInformation")), 1),
1181
- n("div", Yt, [
1182
- n("div", null, [
1183
- n("div", Zt, m(l(e)("inventory.common.name")), 1),
1184
- n("div", en, m(((P = (T = c.value) == null ? void 0 : T.details) == null ? void 0 : P.name) || ((B = c.value) == null ? void 0 : B.name)), 1)
1185
- ]),
1186
- (D = (V = c.value) == null ? void 0 : V.details) != null && D.code ? (N(), G("div", tn, [
1187
- n("div", nn, m(l(e)("inventory.common.code")), 1),
1188
- n("div", on, m(c.value.details.code), 1)
1189
- ])) : Y("", !0),
1190
- n("div", null, [
1191
- n("div", rn, m(l(e)("inventory.common.type")), 1),
1192
- n("div", sn, m(c.value.type), 1)
1193
- ]),
1194
- n("div", null, [
1195
- n("div", an, m(l(e)("inventory.common.operation")), 1),
1196
- n("div", ln, m(c.value.operation), 1)
1197
- ]),
1198
- n("div", null, [
1199
- n("div", mn, m(l(e)("inventory.common.status")), 1),
1200
- n("div", {
1201
- class: ce([
1202
- "inline-block px-8 py-4 rounded text-sm",
1203
- c.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"
1204
- ])
1205
- }, m(c.value.status), 3)
1206
- ])
1207
- ])
1208
- ];
1209
- }),
1210
- _: 1
1211
- }),
1212
- c.value.errors && c.value.errors.length > 0 ? (N(), re(H, {
1213
- key: 0,
1214
- variant: "outlined",
1215
- class: "p-16"
1216
- }, {
1217
- default: X(() => [
1218
- n("div", un, m(l(e)("inventory.common.validationErrors")), 1),
1219
- n("div", dn, [
1220
- (N(!0), G(Ue, null, Fe(c.value.errors, (T, P) => (N(), G("div", {
1221
- key: P,
1222
- class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
1223
- }, [
1224
- $(R, {
1225
- name: "error",
1226
- class: "text-red-600 mt-2",
1227
- size: "sm"
1228
- }),
1229
- n("div", cn, m(T), 1)
1230
- ]))), 128))
1231
- ])
1232
- ]),
1233
- _: 1
1234
- })) : Y("", !0),
1235
- $(H, {
1236
- variant: "outlined",
1237
- class: "p-16"
1238
- }, {
1239
- default: X(() => [
1240
- n("div", pn, m(l(e)("inventory.common.rawData")), 1),
1241
- n("div", vn, [
1242
- n("pre", yn, m(JSON.stringify(c.value.details, null, 2)), 1)
1243
- ])
1244
- ]),
1245
- _: 1
1246
- })
1247
- ])) : Y("", !0)
1248
- ]),
1249
- _: 1
1250
- }, 8, ["model-value", "header"])
1251
- ];
1252
- }),
1253
- _: 1
1254
- }, 8, ["title", "actions"])) : l(g).isLoaded ? (N(), re(Se, {
1255
- key: 2,
1256
- title: l(e)("inventory.common.import")
1257
- }, {
1258
- default: X(() => [
1259
- n("div", xn, [
1260
- $(R, {
1261
- name: "block",
1262
- class: "text-gray-400",
1263
- size: "xl"
1264
- }),
1265
- n("div", _n, [
1266
- n("div", wn, m(l(e)("inventory.common.featureNotAvailable")), 1),
1267
- n("div", In, m(l(e)("inventory.common.bulkImportNotEnabled")), 1)
1268
- ])
1269
- ])
1270
- ]),
1271
- _: 1
1272
- }, 8, ["title"])) : (N(), re(Se, {
1273
- key: 1,
1274
- title: l(e)("inventory.common.import")
1275
- }, {
1276
- default: X(() => [
1277
- n("div", fn, [
1278
- $(q, { size: "lg" }),
1279
- n("div", bn, [
1280
- n("div", hn, m(l(e)("inventory.common.loading")), 1)
1281
- ])
1282
- ])
1283
- ]),
1284
- _: 1
1285
- }, 8, ["title"]));
1286
- };
1287
- }
1288
- });
1289
- export {
1290
- Dn as default
1291
- };