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

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 (219) hide show
  1. package/dist/App-BTUjyQbn.js +1466 -0
  2. package/dist/{ApprovalView-C8_ax05b.js → ApprovalView-CTOTedxc.js} +26 -25
  3. package/dist/{BindingsDialog-t0ZY9eh5.js → BindingsDialog-C9v4TTzJ.js} +2 -2
  4. package/dist/{BindingsPicker-C0Qblmml.js → BindingsPicker-B5b0lavg.js} +8 -8
  5. package/dist/{BindingsTable-CsqUBbRA.js → BindingsTable-CQPan4pU.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-DAG-TMox.js → BulkReceiveRequestView-BVrrjoYW.js} +21 -21
  7. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D4Z56y7h.js +151 -0
  8. package/dist/{ClosingDraftView-CdKp4Ny6.js → ClosingDraftView-5ETKikfT.js} +748 -746
  9. package/dist/ClosingHistoryView-GM0DRWhq.js +769 -0
  10. package/dist/{ClosingTemplateView-C326DL4q.js → ClosingTemplateView-Czz--dWq.js} +303 -291
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CXjubRbj.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-Bjs8hW_q.js} +1 -1
  12. package/dist/{DefaultView-CsIMmQAY.js → DefaultView-Baksd_Lk.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-eTrMvJzA.js → DeliveryOrderPrintPreview-CUdMQmLf.js} +9 -9
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-B7nBbxMo.js → EmailDialog.vue_vue_type_script_setup_true_lang-CDta65pB.js} +6228 -6216
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CrCdJfOf.js +47 -0
  16. package/dist/FeatureCapabilityGate-C34Z4k5D.js +74 -0
  17. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CI2KTzDs.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-C43lHbmc.js} +1 -1
  18. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Db_FiSRe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CIMCZnY9.js} +2 -2
  19. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UbMV3dKh.js +120 -0
  20. package/dist/{FmMultiselectDialog-CYUxtxnS.js → FmMultiselectDialog-DYM4qyMH.js} +2 -2
  21. package/dist/FmMultiselectDialog-tbS01AI7.js +123 -0
  22. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DOkV11NN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DaOKC6RQ.js} +72 -73
  23. package/dist/ImportView-CPf8zj0t.js +1290 -0
  24. package/dist/{IngredientsView-CZ6E7cXf.js → IngredientsView-N4CH6zdo.js} +656 -649
  25. package/dist/{IntegrationExplorerView-B15ND4Fg.js → IntegrationExplorerView-Ds5fTNi3.js} +602 -614
  26. package/dist/IntegrationPlatformView-wuOLFIQR.js +13073 -0
  27. package/dist/{IntegrationView-hkNhsqx2.js → IntegrationView-Bhxwz6Ha.js} +2956 -2922
  28. package/dist/{InventoryBindingForm-SfuUF0_O.js → InventoryBindingForm-DWm9pOH_.js} +1 -1
  29. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-TvwD5HcR.js +472 -0
  30. package/dist/{InventoryBindingSummary-DUcukkyJ.js → InventoryBindingSummary-DI6H0ehi.js} +1 -1
  31. package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
  32. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ngeYJhtg.js +79 -0
  33. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-Cr1LFRUd.js +274 -0
  34. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-CtoPkGo2.js +79 -0
  35. package/dist/{ProductionRunDetailView-BwgRX-14.js → ProductionRunDetailView-rGGuDANE.js} +4 -4
  36. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BbNXNhpr.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CTseB9Sn.js} +9 -9
  37. package/dist/{ProductionRunView-CZU7LY9-.js → ProductionRunView-BLBIYhKd.js} +16 -15
  38. package/dist/{PublishView-DS2FZ66p.js → PublishView-D_H_LAq2.js} +3 -3
  39. package/dist/{PurchaseOrderPrintPreview-CZa0MVAs.js → PurchaseOrderPrintPreview-DZy57dQ6.js} +7 -7
  40. package/dist/{ReceiveRequestView-Bk5b3nVB.js → ReceiveRequestView-qFQPah64.js} +15 -15
  41. package/dist/RecipeView-BPQ_MlxJ.js +3440 -0
  42. package/dist/SettingsView-DF_HGtkr.js +1032 -0
  43. package/dist/StockView-De_R8pxv.js +2651 -0
  44. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DdZg9T4n.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B3tBgcH7.js} +1 -1
  45. package/dist/{SupplierView-D8q6siZW.js → SupplierView-DvvB_Nn0.js} +577 -571
  46. package/dist/{SurchargeView-Db_5YFoR.js → SurchargeView-6gQPyGqi.js} +7 -7
  47. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-WOVs4Fr1.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6gnQpe-.js} +2 -2
  48. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
  49. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BtoP4XgE.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CiuRBHBL.js} +1 -1
  50. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bljc4Vuy.js → TransferDetails.vue_vue_type_script_setup_true_lang-B-1-jtmF.js} +1707 -1657
  51. package/dist/TransferTemplateView-Dcc9K-AJ.js +2343 -0
  52. package/dist/{UnitCostHistoryView-BqDiQ4IE.js → UnitCostHistoryView-e1MYu0_N.js} +4 -4
  53. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BjSmg5LX.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DQWOi2ol.js} +4 -4
  54. package/dist/{UnitView-CM695-VI.js → UnitView-BaLqtGk3.js} +84 -84
  55. package/dist/{WarehouseView-BdidU4p6.js → WarehouseView-CKYdpZoP.js} +194 -189
  56. package/dist/{WastageTemplateView-DdhwdXT6.js → WastageTemplateView-DazO6lu1.js} +19 -18
  57. package/dist/api/feature-flags.d.ts +12 -0
  58. package/dist/api/integration-sync-log.d.ts +0 -13
  59. package/dist/api/inventory.d.ts +9 -9
  60. package/dist/api/license.d.ts +8 -0
  61. package/dist/{app-Cb5s4jMu.js → app-ZyQBMnlh.js} +6102 -6066
  62. package/dist/app.d.ts +36 -150
  63. package/dist/app.js +1 -1
  64. package/dist/{closing-template-DnqnpXxn.js → closing-template-BZfYcHAK.js} +1 -1
  65. package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
  66. package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
  67. package/dist/components/FeatureCapabilityBadge.vue.d.ts +29 -0
  68. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  69. package/dist/components/FeatureCapabilityGate.vue.d.ts +29 -0
  70. package/dist/components/FmUnitInputRules.d.ts +1 -1
  71. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  72. package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
  73. package/dist/components/{PremiumBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
  74. package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
  75. package/dist/composable/useNavigationMenu.d.ts +2 -1
  76. package/dist/{date2-BPhD_1Of.js → date2-CtVXF-Pl.js} +1 -1
  77. package/dist/{dayjs.min-Zbd6-uVD.js → dayjs.min-BG2xA9Zk.js} +1 -1
  78. package/dist/{decimal-Df6a50Ld.js → decimal-C0ERI9wc.js} +2 -2
  79. package/dist/{defineDeepModel-Brbsikbi.js → defineDeepModel-CAK0Fghp.js} +6 -6
  80. package/dist/{duplicate-template-B9kuShaF.js → duplicate-template-DwAQVTH7.js} +1 -1
  81. package/dist/{inventory-core-dart.default-DDRxXXnt.js → feature-1IL43YWw.js} +766 -398
  82. package/dist/feature-flags/core.d.ts +28 -0
  83. package/dist/feature-flags/core.spec.d.ts +1 -0
  84. package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
  85. package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
  86. package/dist/feature-flags/plan-tier.d.ts +6 -0
  87. package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
  88. package/dist/feature-flags/portal-feature-catalog.d.ts +19 -0
  89. package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
  90. package/dist/feature-flags/vue.d.ts +16 -0
  91. package/dist/feature-flags/vue.spec.d.ts +1 -0
  92. package/dist/{format-time-from-id-DmUjUcVj.js → format-time-from-id-QIs7t8ML.js} +1 -1
  93. package/dist/{format-unit-display-CsQA0SQd.js → format-unit-display-DiTPPgut.js} +118 -119
  94. package/dist/helper/menu-usage-module.d.ts +1 -1
  95. package/dist/helper/number.d.ts +5 -1
  96. package/dist/helper/rules.d.ts +1 -1
  97. package/dist/id-to-date-DcuC_yKQ.js +67 -0
  98. package/dist/{import-export.helper-DCQ6oX9s.js → import-export.helper-grsZqa63.js} +16 -17
  99. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  100. package/dist/{index-UmM6gHJ1.js → index-DN5mjbXr.js} +1 -1
  101. package/dist/{index-C-mazZwS.js → index-DdSQrnuw.js} +3 -3
  102. package/dist/index-eGvSlWMU.js +1892 -0
  103. package/dist/{index-BXaIMGnI.js → index-twVxfWIB.js} +190 -190
  104. package/dist/{lz-string-Bibw5D_6.js → lz-string-DrKhkO_Q.js} +1 -1
  105. package/dist/{netsuite-Bev0OtQT.js → netsuite-C_EH9MVy.js} +9 -3
  106. package/dist/{predefined-templates-BHvUnTk_.js → predefined-templates-mWX1M2Dn.js} +1 -1
  107. package/dist/{purchase-order-template-DgOKEzhS.js → purchase-order-template-DZ3DsIUr.js} +1 -1
  108. package/dist/{recalculationUtils-Dv__DzZh.js → recalculationUtils-BZ5ccSeX.js} +1 -1
  109. package/dist/router/name.d.ts +2 -2
  110. package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-B2z1DXD9.js} +2 -2
  111. package/dist/rules-BpTWt_Y_.js +238 -0
  112. package/dist/stock-BO2mbTLO.js +74 -0
  113. package/dist/{stock-CxCRZo_D.js → stock-D9dhzEKk.js} +1 -1
  114. package/dist/stores/feature.d.ts +20 -2
  115. package/dist/stores/integration/netsuite.d.ts +2 -2
  116. package/dist/stores/inventory.d.ts +0 -47
  117. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  118. package/dist/stores/location.d.ts +42 -42
  119. package/dist/stores/supplier.d.ts +49 -49
  120. package/dist/stores/warehouse.d.ts +1 -1
  121. package/dist/style.css +1 -1
  122. package/dist/{supplier-CkZdeMcl.js → supplier-C-Ra1omj.js} +2 -2
  123. package/dist/{surcharge-FRSFqjGl.js → surcharge-BFDrFP1T.js} +1 -1
  124. package/dist/tsconfig.app.tsbuildinfo +1 -1
  125. package/dist/{uom-rules-Cm1styDr.js → uom-rules-B8pou4DQ.js} +1 -1
  126. package/dist/{use-ingredient-select-dialog-ntAqHX04.js → use-ingredient-select-dialog-DJvcL3EP.js} +2 -2
  127. package/dist/use-inventory-binding-dialog-DQBcnw0G.js +113 -0
  128. package/dist/{use-template-enabled-locations-CIZqw-Z8.js → use-template-enabled-locations-CSgJma2Z.js} +2 -2
  129. package/dist/{use-transfer-locations-CM5vNttA.js → use-transfer-locations-CkeJ5Nng.js} +14 -14
  130. package/dist/{useHrmPermission-CslLuBoP.js → useHrmPermission-BDc1xULx.js} +1 -1
  131. package/dist/useNavigationMenu-B7jkRkTi.js +346 -0
  132. package/dist/{useSseClient-CCV4mPzD.js → useSseClient-Bxl6D4Xs.js} +1 -1
  133. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  134. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  135. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  136. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  137. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  138. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  139. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
  140. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  141. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  142. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  143. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  144. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  145. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  146. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  147. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
  148. package/dist/{components/PreviewBadge.vue.d.ts → views/integration/IntegrationPlatformView.vue.d.ts} +11 -13
  149. package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
  150. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  151. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  152. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  153. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  154. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  155. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  156. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  157. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  158. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  159. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +5 -5
  160. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +39 -39
  161. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +35 -35
  162. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  163. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +34 -34
  164. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +6 -6
  165. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  166. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  167. package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
  168. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  169. package/dist/views/{ingredient-group/IngredientGroupView.vue.d.ts → settings/FeatureFlagView.vue.d.ts} +0 -1
  170. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  171. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → settings/PlanLicenseDisplay.vue.d.ts} +2 -2
  172. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  173. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  174. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  175. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  176. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  177. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  178. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  179. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  180. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  181. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  182. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -2
  183. package/dist/{vue-i18n-C5j4EQhi.js → vue-i18n-gaCwgS41.js} +355 -355
  184. package/dist/{xlsx.util-B50OvX4z.js → xlsx.util-lW-27xp-.js} +2 -2
  185. package/package.json +71 -66
  186. package/dist/App-BXgpGzGR.js +0 -1476
  187. package/dist/ClosingHistoryView-Blyq9-BS.js +0 -761
  188. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-zcEv1Swg.js +0 -243
  189. package/dist/FmMultiselectDialog-BAw-gp5K.js +0 -77
  190. package/dist/ImportView-BmotFC-3.js +0 -1302
  191. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVCCpvS4.js +0 -51
  192. package/dist/IngredientGroupView-qrR9ksEn.js +0 -985
  193. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-Zq81p_MF.js +0 -563
  194. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmfROiLM.js +0 -72
  195. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-3e3kDsbN.js +0 -93
  196. package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
  197. package/dist/RecipeView-DvI6X-uN.js +0 -3625
  198. package/dist/SettingsView-sThYErMz.js +0 -698
  199. package/dist/StockView-Z9wGihT7.js +0 -2612
  200. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  201. package/dist/TransferTemplateView-DtsJzmUr.js +0 -2327
  202. package/dist/feature-Ckn5ra3z.js +0 -1136
  203. package/dist/number-y_W4pn_d.js +0 -138
  204. package/dist/random-CSbEbElR.js +0 -10
  205. package/dist/rules-CZTBvenw.js +0 -98
  206. package/dist/stock-XINW8JOM.js +0 -75
  207. package/dist/use-inventory-binding-dialog-DVIJO8Cl.js +0 -152
  208. package/dist/useNavigationMenu-CSinmNCY.js +0 -172
  209. package/dist/usePromise-CbVUCxhj.js +0 -29
  210. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  211. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  212. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  213. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  214. package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
  215. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  216. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  217. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
  218. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
  219. /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
@@ -0,0 +1,1290 @@
1
+ import { defineComponent as Me, ref as $, computed as J, watch as De, resolveComponent as Y, createElementBlock as D, openBlock as C, createVNode as A, createCommentVNode as Z, unref as l, normalizeClass as ve, createSlots as Be, withCtx as Q, createElementVNode as n, createBlock as ae, toDisplayString as m, Fragment as Te, renderList as Ue, shallowRef as Ce, h as _e, createTextVNode as S } from "vue";
2
+ import { u as je, _ as Se } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
+ import { useCoreStore as ke, useI18n as Fe } from "@feedmepos/mf-common";
4
+ import { useDialogChild as Pe, useSnackbar as $e, useDialog as ze, useBreakpoints as He } from "@feedmepos/ui-library";
5
+ import { u as Ve } from "./feature-1IL43YWw.js";
6
+ import { a as le, s as We } from "./app-ZyQBMnlh.js";
7
+ import "./dayjs.min-BG2xA9Zk.js";
8
+ import "./app-C39bYJmq.js";
9
+ import "./FmAdminBadge-DlplQOHb.js";
10
+ import { s as Ge, a as Oe, d as Le, t as Re, r as Ke } from "./xlsx.util-lW-27xp-.js";
11
+ import { s as Je, g as qe, b as Xe, d as Ne } from "./import-export.helper-grsZqa63.js";
12
+ import { r as Qe, a as Ee } from "./rules-BpTWt_Y_.js";
13
+ import { F as Ye } from "./FmDroppableField-J0tG_U3w.js";
14
+ function* Ze(h) {
15
+ for (; ; )
16
+ yield h[Math.floor(Math.random() * h.length)];
17
+ }
18
+ function et(h = 4, e = Ze("qwertyuiopasdfghjklzxcvbnm".split(""))) {
19
+ return Array.from({ length: h }).map(() => e.next().value).join("");
20
+ }
21
+ function we() {
22
+ return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${et()}`;
23
+ }
24
+ function tt(h) {
25
+ const [
26
+ e,
27
+ k,
28
+ p,
29
+ g,
30
+ w,
31
+ b,
32
+ ...r
33
+ ] = Ge(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 i = e.map((d) => d.split(":")[1]), y = ["name", "symbol", "precision"].filter((d) => !i.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 a in i) {
44
+ const v = i[a];
45
+ Object.assign(o, { [v]: d[a] });
46
+ }
47
+ return {
48
+ index: f,
49
+ data: o
50
+ };
51
+ });
52
+ }
53
+ function nt(h) {
54
+ try {
55
+ const e = tt(h).filter((r) => {
56
+ const { name: i, symbol: s, precision: y, measurement_name: c, measurement_symbol: d, measurement_conversion: f } = r.data;
57
+ return i || s || y || c || d || f;
58
+ }), p = le().units, g = [], w = [], 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 i = Object.keys(b)[Object.keys(b).length - 1];
80
+ i && b[i] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && b[i].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[i].unit.precision)),
86
+ precision: b[i].unit.precision
87
+ }
88
+ });
89
+ }
90
+ for (const [r, { unit: i, rowNumber: s }] of Object.entries(b)) {
91
+ const y = p.find((c) => {
92
+ var d, f;
93
+ return c.abbrev === i.abbrev && ((d = c.name) == null ? void 0 : d.trim()) === ((f = i.name) == null ? void 0 : f.trim());
94
+ });
95
+ y ? w.push({
96
+ type: "update",
97
+ original: y,
98
+ unit: {
99
+ ...y,
100
+ name: i.name || y.name,
101
+ abbrev: i.abbrev || y.abbrev,
102
+ precision: i.precision !== void 0 ? i.precision : y.precision,
103
+ measurements: i.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
+ ...i,
114
+ measurements: i.measurements.map((c) => ({ ...c, id: we() }))
115
+ },
116
+ errors: [],
117
+ excelRowNumber: s
118
+ });
119
+ }
120
+ return {
121
+ invalidExcel: !1,
122
+ importCreateResult: g,
123
+ importUpdateResult: w
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 ot(h, { ignoreErrors: e = !1 } = {}) {
135
+ var k;
136
+ try {
137
+ const p = le(), g = p.skuByCode, w = p.recipeByName, b = p.units, r = [], i = {};
138
+ for (const o of h) {
139
+ const a = [];
140
+ let v = "";
141
+ if (o.data.type === "INGREDIENT") {
142
+ const E = g[o.data.code];
143
+ E ? v = E._id : a.push(`Ingredient with code '${o.data.code}' not found`);
144
+ } else if (o.data.type === "RECIPE") {
145
+ const E = w[o.data.name];
146
+ E ? v = E._id : a.push(`Recipe with name '${o.data.name}' not found`);
147
+ } else
148
+ a.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT' or 'RECIPE'`);
149
+ const G = !!o.data.amount && Qe(o.data.amount);
150
+ G || a.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
151
+ let B;
152
+ if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && (B = b.find((E) => {
153
+ var T, U;
154
+ return E.abbrev === o.data.baseUnit && ((T = E.name) == null ? void 0 : T.trim()) === ((U = o.data.unit) == null ? void 0 : U.trim());
155
+ }), B || (o.data.baseUnit && o.data.unit ? a.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? a.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && a.push(`Cannot find unit with name '${o.data.unit}'`))), a.length > 0 && r.push(`Row ${o.index + 6}: ${a.join(", ")}`), e || a.length === 0) {
156
+ let E;
157
+ o.data.type === "RECIPE" ? E = void 0 : E = (k = B == null ? void 0 : B.measurements) == null ? void 0 : k.find((F) => F.abbrev === o.data.measurementName);
158
+ const T = G ? {
159
+ type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
160
+ id: v,
161
+ amount: We.fromNumber(+o.data.amount),
162
+ measurement: E || void 0
163
+ } : null, U = a.length > 0 ? `Row ${o.index + 6}: ${a.join(", ")}` : null;
164
+ if (o.data.recipeName)
165
+ i[o.data.recipeName] = {
166
+ name: o.data.recipeName,
167
+ customAttributes: o.data.customAttributes ? Je(o.data.customAttributes) : {},
168
+ contains: T ? [T] : []
169
+ }, r[o.data.recipeName] = U ?? [];
170
+ else {
171
+ const F = Object.keys(i)[Object.keys(i).length - 1];
172
+ if (F && i[F]) {
173
+ i[F] = {
174
+ ...i[F],
175
+ contains: T ? [...i[F].contains, T] : i[F].contains
176
+ };
177
+ const ee = r[F], oe = typeof ee == "string" && ee.length > 0;
178
+ U ? r[F] = oe ? `${ee}, ${U}` : U : oe || (r[F] = []);
179
+ }
180
+ }
181
+ }
182
+ }
183
+ const s = Object.values(i), y = s.filter((o) => !w[o.name]), c = s.filter((o) => w[o.name]), d = y.map((o, a) => ({
184
+ type: "create",
185
+ recipe: o,
186
+ // Type assertion - _id will be assigned by backend
187
+ errors: r[o.name],
188
+ excelRowNumber: a + 6
189
+ // Assuming header rows
190
+ })), f = c.map((o, a) => {
191
+ const v = w[o.name];
192
+ return {
193
+ type: "update",
194
+ original: v,
195
+ recipe: {
196
+ ...v,
197
+ name: o.name || v.name,
198
+ contains: o.contains.length > 0 ? o.contains : v.contains,
199
+ customAttributes: o.customAttributes || v.customAttributes
200
+ },
201
+ errors: r[o.name],
202
+ excelRowNumber: a + 6
203
+ };
204
+ });
205
+ return {
206
+ invalidExcel: r.length > 0,
207
+ invalidExcelMessage: r.length > 0 ? `Import completed with ${r.length} error(s): ${r.join("; ")}` : void 0,
208
+ importCreateResult: d,
209
+ importUpdateResult: f
210
+ };
211
+ } catch (p) {
212
+ return {
213
+ invalidExcel: !0,
214
+ invalidExcelMessage: p instanceof Error ? p.message : "Unknown error occurred",
215
+ importCreateResult: [],
216
+ importUpdateResult: []
217
+ };
218
+ }
219
+ }
220
+ function rt(h) {
221
+ const [
222
+ e,
223
+ k,
224
+ p,
225
+ g,
226
+ w,
227
+ b,
228
+ ...r
229
+ ] = Ge(h);
230
+ if (!e || !e.length || e.some((d) => d.length && !d.startsWith("system:")))
231
+ throw new Error("Missing meta header. Excel file does not come from the template.");
232
+ const i = e.map((d) => d.split(":")[1]), y = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((d) => !i.includes(d));
233
+ if (y.length)
234
+ throw new Error(
235
+ `Missing meta headers (${y.join()}). Excel file does not come from the template.`
236
+ );
237
+ return r.map((d, f) => {
238
+ const o = {};
239
+ for (const a in i) {
240
+ const v = i[a];
241
+ Object.assign(o, { [v]: d[a] });
242
+ }
243
+ return {
244
+ index: f,
245
+ data: o
246
+ };
247
+ }).filter((d) => {
248
+ const { recipeName: f, type: o, code: a, name: v, amount: G, unit: B, baseUnit: E, measurementName: T, customAttributes: U } = d.data;
249
+ return f || o || a || v || G || B || E || T || U;
250
+ });
251
+ }
252
+ function st() {
253
+ const e = ke().currentBusiness.value, k = le(), p = [
254
+ { id: "name", name: "Unit Name" },
255
+ { id: "symbol", name: "Symbol" },
256
+ { id: "precision", name: "Precision" },
257
+ { id: "measurement_name", name: "Measurement Symbol" },
258
+ { id: "measurement_symbol", name: "Measurement Symbol" },
259
+ { id: "measurement_conversion", name: "Measurement Conversion" }
260
+ ];
261
+ let g = [];
262
+ k.units.length > 0 ? k.units.forEach((r) => {
263
+ if (r.measurements.length === 0)
264
+ g.push([
265
+ r.name,
266
+ r.abbrev,
267
+ r.precision,
268
+ "",
269
+ "",
270
+ ""
271
+ ]);
272
+ else {
273
+ g.push([
274
+ r.name,
275
+ r.abbrev,
276
+ r.precision,
277
+ r.measurements[0].name,
278
+ r.measurements[0].abbrev,
279
+ +Ee(r.measurements[0].conversion)
280
+ ]);
281
+ for (let i = 1; i < r.measurements.length; i++)
282
+ g.push([
283
+ "",
284
+ "",
285
+ "",
286
+ r.measurements[i].name,
287
+ r.measurements[i].abbrev,
288
+ +Ee(r.measurements[i].conversion)
289
+ ]);
290
+ }
291
+ }) : g = [
292
+ ["Length", "m", 2, "Meter", "m", 1],
293
+ ["", "", "", "Centimeter", "cm", 0.01],
294
+ ["", "", "", "Millimeter", "mm", 1e-3],
295
+ ["Weight", "kg", 3, "Kilogram", "kg", 1],
296
+ ["", "", "", "Gram", "g", 1e-3],
297
+ ["", "", "", "Pound", "lb", 0.453592]
298
+ ];
299
+ const w = [
300
+ ["Business name:", e == null ? void 0 : e.name],
301
+ ["Business ID:", e == null ? void 0 : e._id],
302
+ ["Menu version", e == null ? void 0 : e.menuVersion],
303
+ [],
304
+ p.map((r) => r.name),
305
+ ...g
306
+ ], b = p.map((r) => `system:${r.id}`);
307
+ return Re(w, b);
308
+ }
309
+ function it() {
310
+ const e = ke().currentBusiness.value, k = le(), p = Xe();
311
+ let g = [];
312
+ k.skus.length > 0 ? g = k.skus.map((r) => {
313
+ var i, s, y, c, d, f, o, a;
314
+ return [
315
+ r.code,
316
+ r.name,
317
+ ((i = r.unit) == null ? void 0 : i.name) || "",
318
+ ((s = r.unit) == null ? void 0 : s.abbrev) || "",
319
+ ((c = (y = r.unit) == null ? void 0 : y.measurements.find((v) => v.id === r.trackingMeasurement)) == null ? void 0 : c.abbrev) ?? r.unit.abbrev,
320
+ r.valuation || "WAVG",
321
+ (d = r.defaultCost) != null && d.costPerUnit ? +Ee((f = r.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
322
+ ((o = r.thresholds) == null ? void 0 : o.low) ?? Ne().low,
323
+ ((a = r.thresholds) == null ? void 0 : a.mid) ?? Ne().mid,
324
+ r.customAttributes ? Object.entries(r.customAttributes).map(([v, G]) => `${v}:${G}`).join("|") : ""
325
+ ];
326
+ }) : g = [
327
+ ["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
328
+ ];
329
+ const w = [
330
+ ["Business name:", e == null ? void 0 : e.name],
331
+ ["Business ID:", e == null ? void 0 : e._id],
332
+ ["Menu version", e == null ? void 0 : e.menuVersion],
333
+ [],
334
+ p.map((r) => r.name),
335
+ ...g
336
+ ], b = p.map((r) => `system:${r.id}`);
337
+ return Re(w, b);
338
+ }
339
+ function at() {
340
+ const e = ke().currentBusiness.value, k = le(), p = [
341
+ { id: "recipeName", name: "Recipe Name" },
342
+ { id: "type", name: "Type" },
343
+ { id: "code", name: "Code" },
344
+ { id: "name", name: "Item Name" },
345
+ { id: "amount", name: "Amount" },
346
+ { id: "unit", name: "Unit" },
347
+ { id: "baseUnit", name: "Unit Symbol" },
348
+ { id: "measurementName", name: "Measurement Symbol" },
349
+ { id: "customAttributes", name: "Custom Attributes" }
350
+ ];
351
+ let g = [];
352
+ if (k.recipes.length > 0) {
353
+ const r = k.recipeById, i = k.skuById;
354
+ g = k.recipes.flatMap((s) => {
355
+ var c;
356
+ const y = s.customAttributes ? Object.entries(s.customAttributes).map(([d, f]) => `${d}:${f}`).join("|") : "";
357
+ if ((c = s.contains) != null && c.length) {
358
+ const d = s.contains.filter((o) => o.type === "RECIPE"), f = s.contains.filter((o) => o.type === "SKU");
359
+ return [
360
+ ...d.map((o, a) => {
361
+ var v;
362
+ return [
363
+ a === 0 ? s.name : "",
364
+ "RECIPE",
365
+ "",
366
+ ((v = r[o.id]) == null ? void 0 : v.name) || "",
367
+ o.amount.amount,
368
+ "",
369
+ "unit",
370
+ "Unit",
371
+ a === 0 ? y : ""
372
+ ];
373
+ }),
374
+ ...f.map((o, a) => {
375
+ var v, G, B, E, T, U, F, ee, oe, ye, ge, me, fe, ue, be, he;
376
+ return [
377
+ !d.length && a === 0 ? s.name : "",
378
+ "INGREDIENT",
379
+ ((v = i[o.id]) == null ? void 0 : v.code) || "",
380
+ ((G = i[o.id]) == null ? void 0 : G.name) || "",
381
+ +Ee(o.amount),
382
+ o.measurement ? ((E = (B = i[o.id]) == null ? void 0 : B.unit) == null ? void 0 : E.name) || "" : ((U = (T = i[o.id]) == null ? void 0 : T.unit) == null ? void 0 : U.name) || "",
383
+ o.measurement ? ((ee = (F = i[o.id]) == null ? void 0 : F.unit) == null ? void 0 : ee.abbrev) || "" : ((ye = (oe = i[o.id]) == null ? void 0 : oe.unit) == null ? void 0 : ye.abbrev) || "",
384
+ o.measurement ? o.measurement.abbrev : ((ue = (fe = (me = (ge = i[o.id]) == null ? void 0 : ge.unit) == null ? void 0 : me.measurements) == null ? void 0 : fe.find((Ie) => {
385
+ var xe;
386
+ return Ie.id === ((xe = i[o.id]) == null ? void 0 : xe.trackingMeasurement);
387
+ })) == null ? void 0 : ue.abbrev) || ((he = (be = i[o.id]) == null ? void 0 : be.unit) == null ? void 0 : he.abbrev) || "",
388
+ !d.length && a === 0 ? y : ""
389
+ ];
390
+ })
391
+ ];
392
+ }
393
+ return [];
394
+ });
395
+ } else
396
+ g = [
397
+ ["Pizza Dough", "INGREDIENT", "FLOUR001", "Flour", "500", "Weight", "g", "Gram", "difficulty:easy, category:italian"],
398
+ ["", "INGREDIENT", "WATER001", "Water", "300", "Volume", "ml", "Milliliter", ""],
399
+ ["", "INGREDIENT", "SALT001", "Salt", "10", "Weight", "g", "Gram", ""]
400
+ ];
401
+ const w = [
402
+ ["Business name:", e == null ? void 0 : e.name],
403
+ ["Business ID:", e == null ? void 0 : e._id],
404
+ ["Menu version", e == null ? void 0 : e.menuVersion],
405
+ [],
406
+ p.map((r) => r.name),
407
+ ...g
408
+ ], b = p.map((r) => `system:${r.id}`);
409
+ return Re(w, b);
410
+ }
411
+ function lt() {
412
+ const h = Oe({
413
+ unit: st(),
414
+ ingredient: it(),
415
+ recipe: at()
416
+ }), e = "FeedMe comprehensive template.xlsx";
417
+ return Le(h, e), e;
418
+ }
419
+ async function mt(h) {
420
+ if (!h) return null;
421
+ try {
422
+ return nt(h);
423
+ } catch (e) {
424
+ throw console.error("Error in processUnitsSheet:", e), e;
425
+ }
426
+ }
427
+ async function ut(h) {
428
+ if (!h) return null;
429
+ try {
430
+ return qe(h);
431
+ } catch (e) {
432
+ throw console.error("Error in processIngredientsSheet:", e), e;
433
+ }
434
+ }
435
+ async function dt(h) {
436
+ if (!h) return null;
437
+ try {
438
+ const e = rt(h);
439
+ return ot(e, { ignoreErrors: !0 });
440
+ } catch (e) {
441
+ throw console.error("Error in processRecipesSheet:", e), e;
442
+ }
443
+ }
444
+ function ie(h) {
445
+ return (h ?? []).filter((e) => !e.errors || e.errors.length === 0).map(({ errors: e, ...k }) => k);
446
+ }
447
+ const ct = { class: "flex flex-col gap-24" }, pt = { class: "flex flex-col gap-8" }, vt = { class: "flex flex-col flex-1 gap-4" }, yt = { class: "fm-typo-en-body-md-600" }, gt = {
448
+ key: 2,
449
+ class: "shrink-0"
450
+ }, ft = {
451
+ key: 0,
452
+ class: "flex flex-col"
453
+ }, bt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ht = {
454
+ key: 0,
455
+ class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
456
+ }, xt = { class: "fm-typo-en-body-lg-600" }, _t = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, wt = /* @__PURE__ */ Me({
457
+ __name: "ImportDialog",
458
+ setup(h) {
459
+ const e = $(null), k = Pe();
460
+ $e();
461
+ const p = $(!1), g = $(new Array()), w = $(null), b = $([]), r = $([]), i = J(() => !!g.value.length), s = J(() => !!w.value && b.value.length > 0), { t: y } = Fe();
462
+ async function c(o) {
463
+ g.value = [], w.value = null, b.value = [], r.value = [];
464
+ try {
465
+ p.value = !0;
466
+ const [a] = await Promise.all([
467
+ Ke(o),
468
+ // fake buffer for UX
469
+ new Promise((v) => setTimeout(v, 1e3))
470
+ ]);
471
+ w.value = a, d();
472
+ } catch (a) {
473
+ console.error("Error parsing Excel file:", a), g.value.push((a == null ? void 0 : a.message) || "Unknown error occurred");
474
+ } finally {
475
+ p.value = !1;
476
+ }
477
+ }
478
+ function d() {
479
+ if (g.value = [], !w.value) return;
480
+ const a = ["unit", "ingredient", "recipe"].filter((v) => w.value.Sheets[v]);
481
+ if (a.length === 0) {
482
+ g.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
483
+ return;
484
+ }
485
+ b.value = a, k.emitData({ availableSheets: a, workbook: w.value });
486
+ }
487
+ De(e, (o) => {
488
+ o && c(o);
489
+ });
490
+ function f() {
491
+ if (!w.value || b.value.length === 0) return "";
492
+ const o = [];
493
+ return b.value.forEach((a) => {
494
+ switch (a) {
495
+ case "unit":
496
+ o.push("Units sheet found");
497
+ break;
498
+ case "ingredient":
499
+ o.push("Ingredients sheet found");
500
+ break;
501
+ case "recipe":
502
+ o.push("Recipes sheet found");
503
+ break;
504
+ }
505
+ }), o.length > 0 ? `Ready to process: ${o.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
506
+ }
507
+ return (o, a) => {
508
+ const v = Y("FmCircularProgress"), G = Y("FmIcon"), B = Y("FmButton");
509
+ return C(), D("div", ct, [
510
+ A(Ye, {
511
+ class: ve({
512
+ "w-full": !0,
513
+ "h-[200px]": !e.value
514
+ }),
515
+ accept: ".xlsx,.xls",
516
+ onFileUpload: a[0] || (a[0] = (E) => e.value = E),
517
+ label: l(y)("inventory.ingredient.import.uploadTemplate"),
518
+ "button-label": l(y)("inventory.ingredient.import.selectFile")
519
+ }, Be({ _: 2 }, [
520
+ e.value ? {
521
+ name: "default",
522
+ fn: Q(({ openFileDialog: E }) => [
523
+ n("div", pt, [
524
+ n("div", {
525
+ class: ve([
526
+ "fm-corner-radius-md p-16 flex items-center gap-16",
527
+ {
528
+ "border border-fm-color-neutral-gray-100": p.value,
529
+ "border border-fm-color-neutral-gray-200": !p.value && !i.value,
530
+ "border border-fm-color-system-error-200": i.value
531
+ }
532
+ ])
533
+ }, [
534
+ p.value ? (C(), ae(v, {
535
+ key: 0,
536
+ size: "md",
537
+ color: "neutral-gray-200"
538
+ })) : (C(), ae(G, {
539
+ key: 1,
540
+ name: i.value ? "error" : "check_circle",
541
+ color: i.value ? "system-error-300" : "system-success-400",
542
+ size: "lg"
543
+ }, null, 8, ["name", "color"])),
544
+ n("div", vt, [
545
+ n("div", yt, m(e.value.name), 1),
546
+ n("div", {
547
+ class: ve([
548
+ "fm-typo-en-body-sm-400",
549
+ {
550
+ "text-fm-color-system-error-300": i.value,
551
+ "text-fm-color-typo-secondary": !i.value
552
+ }
553
+ ])
554
+ }, m(i.value ? l(y)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
555
+ ]),
556
+ p.value ? Z("", !0) : (C(), D("div", gt, [
557
+ A(B, {
558
+ label: l(y)("inventory.ingredient.import.replaceFile"),
559
+ variant: i.value ? "destructive" : "secondary",
560
+ "prepend-icon": i.value ? void 0 : "autorenew",
561
+ onClick: E
562
+ }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
563
+ ]))
564
+ ], 2),
565
+ g.value.length ? (C(), D("div", ft, [
566
+ (C(!0), D(Te, null, Ue(g.value, (T, U) => (C(), D("div", {
567
+ key: U,
568
+ class: "flex gap-8 items-center"
569
+ }, [
570
+ A(G, {
571
+ name: "error",
572
+ size: "sm",
573
+ color: "system-error-300"
574
+ }),
575
+ n("div", bt, m(T), 1)
576
+ ]))), 128))
577
+ ])) : Z("", !0)
578
+ ])
579
+ ]),
580
+ key: "0"
581
+ } : void 0
582
+ ]), 1032, ["class", "label", "button-label"]),
583
+ s.value ? (C(), D("div", ht, [
584
+ n("div", xt, m(l(y)("inventory.ingredient.import.summary")), 1),
585
+ n("div", _t, m(f()), 1)
586
+ ])) : Z("", !0)
587
+ ]);
588
+ };
589
+ }
590
+ }), Et = {
591
+ key: 0,
592
+ class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
593
+ }, It = { class: "flex items-start gap-12" }, St = { class: "flex flex-col gap-8" }, kt = { class: "fm-typo-en-body-md-400 text-blue-800" }, Rt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Ct = { class: "mb-8" }, Nt = ["innerHTML"], Mt = ["innerHTML"], Tt = { class: "mb-8" }, Ut = { class: "mb-12" }, Ft = { class: "mb-12" }, $t = { class: "mb-8" }, Gt = { class: "text-orange-600" }, At = {
594
+ key: 1,
595
+ class: "bg-white rounded-lg shadow"
596
+ }, Dt = { class: "flex items-center justify-between p-16 border-b" }, Bt = { class: "fm-typo-en-title-md-600" }, jt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Pt = {
597
+ key: 0,
598
+ class: "text-red-600"
599
+ }, zt = {
600
+ key: 1,
601
+ class: "text-orange-600"
602
+ }, Ht = {
603
+ key: 2,
604
+ class: "text-green-600"
605
+ }, Vt = { class: "flex gap-8" }, Wt = { class: "p-16" }, Ot = {
606
+ key: 2,
607
+ class: "bg-white rounded-lg shadow"
608
+ }, Lt = { class: "flex items-center justify-between p-16 border-b" }, Kt = { class: "fm-typo-en-title-md-600 text-red-800" }, Jt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, qt = { class: "flex gap-8" }, Xt = { class: "p-16" }, Qt = {
609
+ key: 0,
610
+ class: "flex flex-col gap-16 p-16"
611
+ }, Yt = { class: "fm-typo-en-title-sm-600 mb-12" }, Zt = { class: "grid grid-cols-2 gap-12" }, en = { class: "fm-typo-en-body-sm-400 text-gray-600" }, tn = { class: "fm-typo-en-body-md-600" }, nn = { key: 0 }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, an = { class: "fm-typo-en-body-md-600" }, ln = { class: "fm-typo-en-body-sm-400 text-gray-600" }, mn = { class: "fm-typo-en-body-md-600" }, un = { class: "fm-typo-en-body-sm-400 text-gray-600" }, dn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, cn = { class: "space-y-8" }, pn = { class: "fm-typo-en-body-md-400 text-red-800" }, vn = { class: "fm-typo-en-title-sm-600 mb-12" }, yn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, gn = { class: "text-sm" }, fn = { class: "flex gap-8" }, bn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, hn = { class: "text-center" }, xn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, _n = { class: "flex flex-col items-center justify-center h-64 gap-16" }, wn = { class: "text-center" }, En = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, In = { class: "fm-typo-en-body-md-400 text-gray-500" }, Bn = /* @__PURE__ */ Me({
612
+ __name: "ImportView",
613
+ setup(h) {
614
+ const { t: e } = Fe(), k = ze(), p = $e();
615
+ je();
616
+ const g = Ve(), { breakpoints: w } = He(), b = le(), r = $("");
617
+ $(!1);
618
+ const i = $(!1), s = $(null), y = $(!1), c = $(null), d = $(!1), f = $([]), o = $(null), a = $([]), v = $(!1), G = J(() => w.value.xs || w.value.sm), B = J(() => G.value ? 10 : 20), E = J(() => {
619
+ const u = s.value;
620
+ if (!u) return [];
621
+ const t = [], { units: R, skus: j, recipes: L, _invalidExcel: W, _invalidExcelMessage: q } = u, X = (M) => {
622
+ var z;
623
+ return ((z = M.errors) == null ? void 0 : z.length) > 0 ? Array.isArray(M.errors) ? M.errors.join(", ") : M.errors || e("inventory.common.validationFailed") : W ? q || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
624
+ }, V = (M, H) => {
625
+ if (M)
626
+ for (const z of ["create", "update"]) {
627
+ const O = M[z];
628
+ if (O)
629
+ for (const P of O)
630
+ t.push({
631
+ name: P.name || P.abbrev || P.code || e("inventory.common.unknown"),
632
+ type: H,
633
+ operation: e(z === "create" ? "inventory.common.create" : "inventory.common.update"),
634
+ status: X(P),
635
+ errors: P.errors || [],
636
+ details: P
637
+ });
638
+ }
639
+ };
640
+ return V(R, e("inventory.common.unit")), V(j, e("inventory.common.ingredient")), V(L, e("inventory.common.recipe")), t;
641
+ }), T = J(() => E.value.some(
642
+ (u) => u.errors && u.errors.length > 0
643
+ )), U = J(() => E.value.some(
644
+ (u) => u.status && u.status.includes("Invalid Excel")
645
+ )), F = J(() => {
646
+ const u = E.value.find(
647
+ (t) => t.status && t.status.includes("Invalid Excel")
648
+ );
649
+ return (u == null ? void 0 : u.status) || e("inventory.common.invalidExcelFormatDetected");
650
+ }), ee = J(() => !a.value || a.value.length === 0 ? [] : a.value.map((u, t) => {
651
+ var R, j;
652
+ return {
653
+ id: t + 1,
654
+ name: ((R = u.error.data) == null ? void 0 : R.name) || e("inventory.common.unknown"),
655
+ type: u.type || e("inventory.common.general"),
656
+ message: ((j = u.error) == null ? void 0 : j.message) || JSON.stringify(u.error)
657
+ };
658
+ }));
659
+ function oe(u) {
660
+ switch (u) {
661
+ case "import":
662
+ return ye();
663
+ }
664
+ }
665
+ function ye() {
666
+ k.open({
667
+ title: e("inventory.common.import"),
668
+ contentComponent: wt,
669
+ overlay: !0,
670
+ closeButton: !0,
671
+ primaryActions: {
672
+ text: e("inventory.common.next"),
673
+ close: !1
674
+ },
675
+ secondaryActions: {
676
+ text: e("inventory.common.close"),
677
+ close: !0
678
+ },
679
+ tertiaryActions: {
680
+ text: e("inventory.ingredient.import.actions.downloadTemplate"),
681
+ close: !1,
682
+ variant: "plain"
683
+ }
684
+ }).onPrimary(async (u) => {
685
+ u && u.workbook && u.availableSheets && (await ge(u), k.close()), f.value.length === 0 && k.close();
686
+ }).onTertiary(() => {
687
+ try {
688
+ const u = lt();
689
+ p.open({
690
+ title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
691
+ message: e("inventory.common.templateDownloaded", [u]),
692
+ type: "success"
693
+ });
694
+ } catch (u) {
695
+ p.open({
696
+ title: e("inventory.common.downloadFailed"),
697
+ message: e("inventory.common.failedDownloadTemplate"),
698
+ type: "error"
699
+ }), console.error("Error downloading template:", u);
700
+ }
701
+ });
702
+ }
703
+ async function ge(u) {
704
+ o.value = u.workbook, f.value = [...u.availableSheets], s.value = {}, a.value = [], await me();
705
+ }
706
+ async function me() {
707
+ var t, R, j, L, W, q, X, V, M, H, z, O, P, de, ce;
708
+ if (!o.value || f.value.length === 0) {
709
+ y.value = !0;
710
+ return;
711
+ }
712
+ const u = f.value[0];
713
+ try {
714
+ switch (u) {
715
+ case "unit": {
716
+ const K = o.value.Sheets.unit, I = await mt(K);
717
+ I && (s.value = {
718
+ ...s.value,
719
+ _invalidExcel: I.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
720
+ _invalidExcelMessage: I.invalidExcelMessage || ((R = s.value) == null ? void 0 : R._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
721
+ units: I.importCreateResult || I.importUpdateResult ? {
722
+ create: ((j = I.importCreateResult) == null ? void 0 : j.map((x) => ({
723
+ ...x.unit,
724
+ errors: x.errors
725
+ }))) || [],
726
+ update: ((L = I.importUpdateResult) == null ? void 0 : L.map((x) => ({
727
+ ...x.unit,
728
+ errors: x.errors
729
+ }))) || []
730
+ } : (W = s.value) == null ? void 0 : W.units
731
+ });
732
+ break;
733
+ }
734
+ case "ingredient": {
735
+ const K = o.value.Sheets.ingredient, I = await ut(K);
736
+ I && (s.value = {
737
+ ...s.value,
738
+ _invalidExcel: I.invalidExcel || ((q = s.value) == null ? void 0 : q._invalidExcel),
739
+ _invalidExcelMessage: I.invalidExcelMessage || ((X = s.value) == null ? void 0 : X._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
740
+ skus: I.importCreateResult || I.importUpdateResult ? {
741
+ create: ((V = I.importCreateResult) == null ? void 0 : V.map((x) => ({
742
+ ...x.sku,
743
+ errors: x.errors
744
+ }))) || [],
745
+ update: ((M = I.importUpdateResult) == null ? void 0 : M.map((x) => ({
746
+ ...x.sku,
747
+ errors: x.errors
748
+ }))) || []
749
+ } : (H = s.value) == null ? void 0 : H.skus
750
+ });
751
+ break;
752
+ }
753
+ case "recipe": {
754
+ const K = o.value.Sheets.recipe, I = await dt(K);
755
+ I && (s.value = {
756
+ ...s.value,
757
+ _invalidExcel: I.invalidExcel || ((z = s.value) == null ? void 0 : z._invalidExcel),
758
+ _invalidExcelMessage: I.invalidExcelMessage || ((O = s.value) == null ? void 0 : O._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
759
+ recipes: I.importCreateResult || I.importUpdateResult ? {
760
+ create: ((P = I.importCreateResult) == null ? void 0 : P.map((x) => ({
761
+ ...x.recipe,
762
+ errors: x.errors
763
+ }))) || [],
764
+ update: ((de = I.importUpdateResult) == null ? void 0 : de.map((x) => ({
765
+ ...x.recipe,
766
+ errors: x.errors
767
+ }))) || []
768
+ } : (ce = s.value) == null ? void 0 : ce.recipes
769
+ });
770
+ break;
771
+ }
772
+ }
773
+ f.value.shift(), y.value = !0;
774
+ } catch (K) {
775
+ console.error(`Error processing ${u} sheet:`, K), p.open({
776
+ title: e("inventory.common.processingError"),
777
+ message: e("inventory.common.failedToProcessSheet", [u]),
778
+ type: "error"
779
+ });
780
+ }
781
+ }
782
+ async function fe() {
783
+ var u, t, R, j, L, W, q, X, V, M, H, z, O, P, de, ce, K, I;
784
+ if (s.value) {
785
+ if (U.value) {
786
+ p.open({
787
+ title: e("inventory.common.invalidExcelFormatTitle"),
788
+ message: F.value,
789
+ type: "error"
790
+ });
791
+ return;
792
+ }
793
+ if (T.value) {
794
+ p.open({
795
+ title: e("inventory.ingredient.import.error.invalidContent"),
796
+ message: e("inventory.ingredient.import.error.hasErrors"),
797
+ type: "error"
798
+ });
799
+ return;
800
+ }
801
+ i.value = !0;
802
+ try {
803
+ let x = 0, re = "";
804
+ if (s.value.units && ((u = s.value.units.create) != null && u.length || (t = s.value.units.update) != null && t.length)) {
805
+ const N = {
806
+ create: ie(s.value.units.create),
807
+ update: ie(s.value.units.update)
808
+ };
809
+ if (N.create.length || N.update.length) {
810
+ const _ = await b.importUnits(N);
811
+ ((R = _ == null ? void 0 : _.errors) == null ? void 0 : R.length) > 0 && a.value.push(..._.errors.map((se) => ({
812
+ type: "units",
813
+ error: se
814
+ })));
815
+ const te = N.create.length + N.update.length, ne = ((j = _ == null ? void 0 : _.errors) == null ? void 0 : j.length) || 0;
816
+ x = te - ne, re = "units", s.value = {
817
+ ...s.value,
818
+ units: null
819
+ };
820
+ }
821
+ } else if (s.value.skus && ((L = s.value.skus.create) != null && L.length || (W = s.value.skus.update) != null && W.length)) {
822
+ const N = {
823
+ create: ie(s.value.skus.create),
824
+ update: ie(s.value.skus.update)
825
+ };
826
+ if (N.create.length || N.update.length) {
827
+ const _ = await b.importSkus(N);
828
+ ((q = _ == null ? void 0 : _.errors) == null ? void 0 : q.length) > 0 && a.value.push(..._.errors.map((se) => ({
829
+ type: "ingredients",
830
+ error: se
831
+ })));
832
+ const te = N.create.length + N.update.length, ne = ((X = _ == null ? void 0 : _.errors) == null ? void 0 : X.length) || 0;
833
+ x = te - ne, re = "ingredients", s.value = {
834
+ ...s.value,
835
+ skus: null
836
+ };
837
+ }
838
+ } else if (s.value.recipes && ((V = s.value.recipes.create) != null && V.length || (M = s.value.recipes.update) != null && M.length)) {
839
+ const N = {
840
+ create: ie(s.value.recipes.create),
841
+ update: ie(s.value.recipes.update)
842
+ };
843
+ if (N.create.length || N.update.length) {
844
+ const _ = await b.importRecipes(N);
845
+ ((H = _ == null ? void 0 : _.errors) == null ? void 0 : H.length) > 0 && a.value.push(..._.errors.map((se) => ({
846
+ type: "recipes",
847
+ error: se
848
+ })));
849
+ const te = N.create.length + N.update.length, ne = ((z = _ == null ? void 0 : _.errors) == null ? void 0 : z.length) || 0;
850
+ x = te - ne, re = "recipes", s.value = {
851
+ ...s.value,
852
+ recipes: null
853
+ };
854
+ }
855
+ }
856
+ if (x > 0) {
857
+ const N = a.value.filter((_) => _.type === re);
858
+ N.length > 0 ? p.open({
859
+ title: e("inventory.common.importCompletedWithIssues"),
860
+ message: e("inventory.common.successfullyImported", [x, re, N.length, re]),
861
+ type: "warning"
862
+ }) : p.open({
863
+ title: e("inventory.ingredient.import.success"),
864
+ message: e("inventory.common.successfullyImported", [x, re, "0", ""]),
865
+ type: "success"
866
+ });
867
+ }
868
+ if (f.value.length > 0)
869
+ await me();
870
+ else if (!(s.value.units && (((O = s.value.units.create) == null ? void 0 : O.length) || ((P = s.value.units.update) == null ? void 0 : P.length)) || s.value.skus && (((de = s.value.skus.create) == null ? void 0 : de.length) || ((ce = s.value.skus.update) == null ? void 0 : ce.length)) || s.value.recipes && (((K = s.value.recipes.create) == null ? void 0 : K.length) || ((I = s.value.recipes.update) == null ? void 0 : I.length))))
871
+ if (ue(), a.value.length > 0) {
872
+ const _ = a.value.filter((pe) => pe.type === "units").length, te = a.value.filter((pe) => pe.type === "ingredients").length, ne = a.value.filter((pe) => pe.type === "recipes").length, se = _ + te + ne;
873
+ v.value = !0, p.open({
874
+ title: e("inventory.common.importCompletedWithIssues"),
875
+ message: e("inventory.common.importFinishedWithFailedItems", [se, _, te, ne]),
876
+ type: "warning"
877
+ }), console.error("Import errors:", a.value);
878
+ } else
879
+ p.open({
880
+ title: e("inventory.common.importComplete"),
881
+ message: e("inventory.common.allDataSuccessfullyImported"),
882
+ type: "success"
883
+ });
884
+ } catch (x) {
885
+ p.open({
886
+ title: e("inventory.ingredient.import.error.failed"),
887
+ message: (x == null ? void 0 : x.message) || e("inventory.common.unknownErrorOccurred"),
888
+ type: "error"
889
+ }), console.error("Error during import:", x);
890
+ } finally {
891
+ i.value = !1;
892
+ }
893
+ }
894
+ }
895
+ function ue() {
896
+ y.value = !1, v.value = !1, s.value = null, f.value = [], o.value = null;
897
+ }
898
+ function be() {
899
+ v.value = !1, a.value = [];
900
+ }
901
+ function he() {
902
+ d.value = !1, c.value = null;
903
+ }
904
+ const Ie = J(() => [
905
+ {
906
+ label: e("inventory.common.import"),
907
+ value: "import",
908
+ isPrimary: !1,
909
+ prependIcon: "upload"
910
+ }
911
+ ]), xe = Ce([
912
+ {
913
+ id: "name",
914
+ accessorKey: "name",
915
+ header: () => e("inventory.common.name"),
916
+ size: 200
917
+ },
918
+ {
919
+ id: "type",
920
+ accessorKey: "type",
921
+ header: () => e("inventory.common.type"),
922
+ size: 120
923
+ },
924
+ {
925
+ id: "operation",
926
+ accessorKey: "operation",
927
+ header: () => e("inventory.common.operation"),
928
+ size: 100
929
+ },
930
+ {
931
+ id: "status",
932
+ accessorKey: "status",
933
+ header: () => e("inventory.common.status"),
934
+ size: 120,
935
+ cell: (u) => {
936
+ const t = u.row.original.status;
937
+ let R = "px-8 py-4 rounded";
938
+ 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);
939
+ }
940
+ }
941
+ ]), Ae = Ce([
942
+ {
943
+ id: "name",
944
+ accessorKey: "name",
945
+ header: () => e("inventory.common.name"),
946
+ cell: (u) => _e("div", { class: "text-gray-800 text-sm py-2" }, u.row.original.name || e("inventory.common.unknown"))
947
+ },
948
+ {
949
+ id: "type",
950
+ accessorKey: "type",
951
+ header: () => e("inventory.common.errorType"),
952
+ cell: (u) => {
953
+ 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");
954
+ return _e("div", { class: "text-gray-800 text-sm py-2" }, R);
955
+ }
956
+ },
957
+ {
958
+ id: "message",
959
+ accessorKey: "message",
960
+ header: () => e("inventory.common.errorMessage"),
961
+ cell: (u) => _e(
962
+ "div",
963
+ { class: "text-red-800 text-sm py-2", title: u.row.original.message },
964
+ u.row.original.message
965
+ )
966
+ }
967
+ ]);
968
+ return (u, t) => {
969
+ const R = Y("FmIcon"), j = Y("FmButton"), L = Y("FmTable"), W = Y("FmCard"), q = Y("FmSideSheet"), X = Y("FmSpinner");
970
+ return l(g).isLoaded && l(g).enableBulkImport ? (C(), ae(Se, {
971
+ key: 0,
972
+ title: l(e)("inventory.common.import"),
973
+ actions: Ie.value,
974
+ "onClick:action": oe
975
+ }, {
976
+ default: Q(() => {
977
+ var V;
978
+ return [
979
+ n("div", {
980
+ class: ve([
981
+ "flex flex-col gap-8 max-h-full",
982
+ {
983
+ "p-0": G.value,
984
+ "px-24": !G.value
985
+ }
986
+ ])
987
+ }, [
988
+ y.value ? Z("", !0) : (C(), D("div", Et, [
989
+ n("div", It, [
990
+ A(R, {
991
+ name: "info",
992
+ class: "text-blue-600 mt-2"
993
+ }),
994
+ n("div", St, [
995
+ n("div", kt, m(l(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
996
+ n("div", Rt, [
997
+ n("div", Ct, [
998
+ n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
999
+ ]),
1000
+ t[39] || (t[39] = S(" 1. ")),
1001
+ n("span", {
1002
+ innerHTML: l(e)("inventory.ingredient.import.importInstructions.step1")
1003
+ }, null, 8, Nt),
1004
+ t[40] || (t[40] = n("br", null, null, -1)),
1005
+ t[41] || (t[41] = S(" 2. ")),
1006
+ n("span", {
1007
+ innerHTML: l(e)("inventory.ingredient.import.importInstructions.step2")
1008
+ }, null, 8, Mt),
1009
+ t[42] || (t[42] = n("br", null, null, -1)),
1010
+ S(" 3. " + m(l(e)("inventory.ingredient.import.importInstructions.step3")), 1),
1011
+ t[43] || (t[43] = n("br", null, null, -1)),
1012
+ S(" 4. " + m(l(e)("inventory.ingredient.import.importInstructions.step4")), 1),
1013
+ t[44] || (t[44] = n("br", null, null, -1)),
1014
+ t[45] || (t[45] = n("br", null, null, -1)),
1015
+ n("div", Tt, [
1016
+ n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
1017
+ ]),
1018
+ n("div", Ut, [
1019
+ n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
1020
+ S(" " + m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
1021
+ t[1] || (t[1] = n("br", null, null, -1)),
1022
+ t[2] || (t[2] = S(" • ")),
1023
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
1024
+ t[3] || (t[3] = n("br", null, null, -1)),
1025
+ t[4] || (t[4] = S(" • ")),
1026
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
1027
+ t[5] || (t[5] = n("br", null, null, -1)),
1028
+ t[6] || (t[6] = S(" • ")),
1029
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
1030
+ t[7] || (t[7] = n("br", null, null, -1)),
1031
+ t[8] || (t[8] = S(" • ")),
1032
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
1033
+ t[9] || (t[9] = n("br", null, null, -1)),
1034
+ t[10] || (t[10] = S(" • ")),
1035
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
1036
+ t[11] || (t[11] = n("br", null, null, -1)),
1037
+ t[12] || (t[12] = S(" • ")),
1038
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
1039
+ ]),
1040
+ n("div", Ft, [
1041
+ n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
1042
+ S(" " + m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
1043
+ t[13] || (t[13] = n("br", null, null, -1)),
1044
+ t[14] || (t[14] = S(" • ")),
1045
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
1046
+ t[15] || (t[15] = n("br", null, null, -1)),
1047
+ t[16] || (t[16] = S(" • ")),
1048
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
1049
+ t[17] || (t[17] = n("br", null, null, -1)),
1050
+ t[18] || (t[18] = S(" • ")),
1051
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
1052
+ t[19] || (t[19] = n("br", null, null, -1)),
1053
+ t[20] || (t[20] = S(" • ")),
1054
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
1055
+ t[21] || (t[21] = n("br", null, null, -1)),
1056
+ t[22] || (t[22] = S(" • ")),
1057
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
1058
+ ]),
1059
+ n("div", $t, [
1060
+ n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
1061
+ S(" " + m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
1062
+ t[23] || (t[23] = n("br", null, null, -1)),
1063
+ t[24] || (t[24] = S(" • ")),
1064
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
1065
+ t[25] || (t[25] = n("br", null, null, -1)),
1066
+ t[26] || (t[26] = S(" • ")),
1067
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
1068
+ t[27] || (t[27] = n("br", null, null, -1)),
1069
+ t[28] || (t[28] = S(" • ")),
1070
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
1071
+ t[29] || (t[29] = n("br", null, null, -1)),
1072
+ t[30] || (t[30] = S(" • ")),
1073
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
1074
+ t[31] || (t[31] = n("br", null, null, -1)),
1075
+ t[32] || (t[32] = S(" • ")),
1076
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
1077
+ t[33] || (t[33] = n("br", null, null, -1)),
1078
+ t[34] || (t[34] = S(" • ")),
1079
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
1080
+ t[35] || (t[35] = n("br", null, null, -1)),
1081
+ t[36] || (t[36] = S(" • ")),
1082
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
1083
+ t[37] || (t[37] = n("br", null, null, -1)),
1084
+ t[38] || (t[38] = S(" • ")),
1085
+ n("em", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
1086
+ ]),
1087
+ n("div", Gt, [
1088
+ n("strong", null, m(l(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
1089
+ ])
1090
+ ])
1091
+ ])
1092
+ ])
1093
+ ])),
1094
+ y.value ? (C(), D("div", At, [
1095
+ n("div", Dt, [
1096
+ n("div", null, [
1097
+ n("div", Bt, m(l(e)("inventory.common.importPreview")), 1),
1098
+ n("div", jt, [
1099
+ U.value ? (C(), D("span", Pt, m(l(e)("inventory.common.errorExist")) + ": " + m(F.value), 1)) : T.value ? (C(), D("span", zt, m(l(e)("inventory.common.someItemsValidationErrors")), 1)) : (C(), D("span", Ht, m(l(e)("inventory.common.allItemsValidReadyImport")), 1))
1100
+ ])
1101
+ ]),
1102
+ n("div", Vt, [
1103
+ A(j, {
1104
+ variant: "secondary",
1105
+ onClick: ue,
1106
+ label: l(e)("inventory.common.cancel")
1107
+ }, null, 8, ["label"]),
1108
+ A(j, {
1109
+ variant: "primary",
1110
+ onClick: fe,
1111
+ loading: i.value,
1112
+ disabled: i.value || T.value || U.value,
1113
+ label: l(e)("inventory.common.import")
1114
+ }, null, 8, ["loading", "disabled", "label"])
1115
+ ])
1116
+ ]),
1117
+ n("div", Wt, [
1118
+ A(L, {
1119
+ "column-defs": xe.value,
1120
+ "row-data": E.value,
1121
+ "page-size": B.value,
1122
+ "search-value": r.value,
1123
+ loading: !1,
1124
+ "row-hover": ""
1125
+ }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1126
+ ])
1127
+ ])) : Z("", !0),
1128
+ v.value && a.value.length > 0 ? (C(), D("div", Ot, [
1129
+ n("div", Lt, [
1130
+ n("div", null, [
1131
+ n("div", Kt, m(l(e)("inventory.common.importErrors")), 1),
1132
+ n("div", Jt, m(a.value.length) + " " + m(l(e)("inventory.common.itemsFailedImport")), 1)
1133
+ ]),
1134
+ n("div", qt, [
1135
+ A(j, {
1136
+ variant: "secondary",
1137
+ onClick: be,
1138
+ label: l(e)("inventory.common.close")
1139
+ }, null, 8, ["label"])
1140
+ ])
1141
+ ]),
1142
+ n("div", Xt, [
1143
+ A(L, {
1144
+ "column-defs": Ae.value,
1145
+ "row-data": ee.value,
1146
+ "page-size": B.value,
1147
+ "search-value": r.value,
1148
+ loading: !1,
1149
+ "row-hover": ""
1150
+ }, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
1151
+ ])
1152
+ ])) : Z("", !0)
1153
+ ], 2),
1154
+ A(q, {
1155
+ "model-value": d.value,
1156
+ "onUpdate:modelValue": t[0] || (t[0] = (M) => d.value = M),
1157
+ header: `${(V = c.value) == null ? void 0 : V.type} Details`,
1158
+ "max-width": 600,
1159
+ "dismiss-away": ""
1160
+ }, {
1161
+ "side-sheet-footer": Q(() => [
1162
+ n("div", fn, [
1163
+ A(j, {
1164
+ label: l(e)("inventory.common.close"),
1165
+ variant: "tertiary",
1166
+ onClick: he
1167
+ }, null, 8, ["label"])
1168
+ ])
1169
+ ]),
1170
+ default: Q(() => [
1171
+ c.value != null ? (C(), D("div", Qt, [
1172
+ A(W, {
1173
+ variant: "outlined",
1174
+ class: "p-16"
1175
+ }, {
1176
+ default: Q(() => {
1177
+ var M, H, z, O, P;
1178
+ return [
1179
+ n("div", Yt, m(l(e)("inventory.common.basicInformation")), 1),
1180
+ n("div", Zt, [
1181
+ n("div", null, [
1182
+ n("div", en, m(l(e)("inventory.common.name")), 1),
1183
+ n("div", tn, m(((H = (M = c.value) == null ? void 0 : M.details) == null ? void 0 : H.name) || ((z = c.value) == null ? void 0 : z.name)), 1)
1184
+ ]),
1185
+ (P = (O = c.value) == null ? void 0 : O.details) != null && P.code ? (C(), D("div", nn, [
1186
+ n("div", on, m(l(e)("inventory.common.code")), 1),
1187
+ n("div", rn, m(c.value.details.code), 1)
1188
+ ])) : Z("", !0),
1189
+ n("div", null, [
1190
+ n("div", sn, m(l(e)("inventory.common.type")), 1),
1191
+ n("div", an, m(c.value.type), 1)
1192
+ ]),
1193
+ n("div", null, [
1194
+ n("div", ln, m(l(e)("inventory.common.operation")), 1),
1195
+ n("div", mn, m(c.value.operation), 1)
1196
+ ]),
1197
+ n("div", null, [
1198
+ n("div", un, m(l(e)("inventory.common.status")), 1),
1199
+ n("div", {
1200
+ class: ve([
1201
+ "inline-block px-8 py-4 rounded text-sm",
1202
+ 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"
1203
+ ])
1204
+ }, m(c.value.status), 3)
1205
+ ])
1206
+ ])
1207
+ ];
1208
+ }),
1209
+ _: 1
1210
+ }),
1211
+ c.value.errors && c.value.errors.length > 0 ? (C(), ae(W, {
1212
+ key: 0,
1213
+ variant: "outlined",
1214
+ class: "p-16"
1215
+ }, {
1216
+ default: Q(() => [
1217
+ n("div", dn, m(l(e)("inventory.common.validationErrors")), 1),
1218
+ n("div", cn, [
1219
+ (C(!0), D(Te, null, Ue(c.value.errors, (M, H) => (C(), D("div", {
1220
+ key: H,
1221
+ class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
1222
+ }, [
1223
+ A(R, {
1224
+ name: "error",
1225
+ class: "text-red-600 mt-2",
1226
+ size: "sm"
1227
+ }),
1228
+ n("div", pn, m(M), 1)
1229
+ ]))), 128))
1230
+ ])
1231
+ ]),
1232
+ _: 1
1233
+ })) : Z("", !0),
1234
+ A(W, {
1235
+ variant: "outlined",
1236
+ class: "p-16"
1237
+ }, {
1238
+ default: Q(() => [
1239
+ n("div", vn, m(l(e)("inventory.common.rawData")), 1),
1240
+ n("div", yn, [
1241
+ n("pre", gn, m(JSON.stringify(c.value.details, null, 2)), 1)
1242
+ ])
1243
+ ]),
1244
+ _: 1
1245
+ })
1246
+ ])) : Z("", !0)
1247
+ ]),
1248
+ _: 1
1249
+ }, 8, ["model-value", "header"])
1250
+ ];
1251
+ }),
1252
+ _: 1
1253
+ }, 8, ["title", "actions"])) : l(g).isLoaded ? (C(), ae(Se, {
1254
+ key: 2,
1255
+ title: l(e)("inventory.common.import")
1256
+ }, {
1257
+ default: Q(() => [
1258
+ n("div", _n, [
1259
+ A(R, {
1260
+ name: "block",
1261
+ class: "text-gray-400",
1262
+ size: "xl"
1263
+ }),
1264
+ n("div", wn, [
1265
+ n("div", En, m(l(e)("inventory.common.featureNotAvailable")), 1),
1266
+ n("div", In, m(l(e)("inventory.common.bulkImportNotEnabled")), 1)
1267
+ ])
1268
+ ])
1269
+ ]),
1270
+ _: 1
1271
+ }, 8, ["title"])) : (C(), ae(Se, {
1272
+ key: 1,
1273
+ title: l(e)("inventory.common.import")
1274
+ }, {
1275
+ default: Q(() => [
1276
+ n("div", bn, [
1277
+ A(X, { size: "lg" }),
1278
+ n("div", hn, [
1279
+ n("div", xn, m(l(e)("inventory.common.loading")), 1)
1280
+ ])
1281
+ ])
1282
+ ]),
1283
+ _: 1
1284
+ }, 8, ["title"]));
1285
+ };
1286
+ }
1287
+ });
1288
+ export {
1289
+ Bn as default
1290
+ };