@feedmepos/mf-menu 0.0.3 → 0.0.54

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 (382) hide show
  1. package/README.md +1 -1
  2. package/dist/App-DohOU1oV.js +12631 -0
  3. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-i6t88Eel.js +161 -0
  4. package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js +74 -0
  5. package/dist/Catalog-DLqeJUzk.js +641 -0
  6. package/dist/Category-B1_5y7Mc.js +392 -0
  7. package/dist/CookingGuide-L4a90U-7.js +880 -0
  8. package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +26 -0
  9. package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +50 -0
  10. package/dist/Group-4FKRzniJ.js +48 -0
  11. package/dist/Group-Cggfw5se.js +4 -0
  12. package/dist/Group.vue_vue_type_script_setup_true_lang-DP3PgguY.js +594 -0
  13. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DsoLGvHp.js +211 -0
  14. package/dist/ImportProductDialog.vue_vue_type_script_setup_true_lang-DJ70FzxC.js +72778 -0
  15. package/dist/Ingredient-BiIebw2u.js +495 -0
  16. package/dist/InventoryBinding.vue_vue_type_script_setup_true_lang-DhEEjc_i.js +21910 -0
  17. package/dist/LinkProductSideSheet-u1jj74-0.js +110 -0
  18. package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-BShs7c1r.js +68 -0
  19. package/dist/MenuSetting-Dqd5iQG6.js +185 -0
  20. package/dist/PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js +34 -0
  21. package/dist/PrintRoute-Cne9zCcz.js +420 -0
  22. package/dist/Product-kFxciKdY.js +4 -0
  23. package/dist/Product.vue_vue_type_script_setup_true_lang-CbcEfD6X.js +9408 -0
  24. package/dist/Products-CGWuSZFG.js +2660 -0
  25. package/dist/Publish-zzFK26fy.js +547 -0
  26. package/dist/Recipe-CYCPMkar.js +330 -0
  27. package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
  28. package/dist/Scheduler-Dl881fmO.js +227 -0
  29. package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-BOfrY4Jc.js +33 -0
  30. package/dist/ServingSequence-C1EmqZWu.js +347 -0
  31. package/dist/Setting-CwAoMp-i.js +258 -0
  32. package/dist/Takeaway-CcRWIXdA.js +64 -0
  33. package/dist/Takeaway-DIrpbY-C.js +4 -0
  34. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-bykZsQyj.js +306 -0
  35. package/dist/TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js +20 -0
  36. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CvOTKNYT.js +63 -0
  37. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BikIegit.js +6170 -0
  38. package/dist/Unit-Cux3fhlO.js +144 -0
  39. package/dist/Variant-CCtG3acp.js +229 -0
  40. package/dist/_id_-Mp6ineI6.js +196 -0
  41. package/dist/app-B1I12pXb.js +2030 -0
  42. package/dist/app-D9DQSTFD.js +68 -0
  43. package/dist/app.js +8 -94
  44. package/dist/{App.vue.d.ts → apps/mf-menu/src/App.vue.d.ts} +1 -1
  45. package/dist/apps/mf-menu/src/Entry.vue.d.ts +3 -0
  46. package/dist/apps/mf-menu/src/api/index.d.ts +5 -0
  47. package/dist/apps/mf-menu/src/api/menu.d.ts +31 -0
  48. package/dist/apps/mf-menu/src/api/public.d.ts +5 -0
  49. package/dist/apps/mf-menu/src/app.d.ts +4486 -0
  50. package/dist/apps/mf-menu/src/assets/icons/index.d.ts +4 -0
  51. package/dist/apps/mf-menu/src/components/ApplyProducts.vue.d.ts +44 -0
  52. package/dist/apps/mf-menu/src/components/CustomAttributeChip.vue.d.ts +29 -0
  53. package/dist/{Entry.vue.d.ts → apps/mf-menu/src/components/Migrate.vue.d.ts} +1 -1
  54. package/dist/{components → apps/mf-menu/src/components}/Navigator.vue.d.ts +1 -1
  55. package/dist/apps/mf-menu/src/components/NumberPrecisionInput.vue.d.ts +26 -0
  56. package/dist/apps/mf-menu/src/components/OrderFromChip.vue.d.ts +15 -0
  57. package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProduct.vue.d.ts +1034 -0
  58. package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProductDialog.vue.d.ts +533 -0
  59. package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +3194 -0
  60. package/dist/apps/mf-menu/src/components/feature/CatalogManager/Form.vue.d.ts +13 -0
  61. package/dist/apps/mf-menu/src/components/feature/CatalogManager/index.d.ts +25 -0
  62. package/dist/apps/mf-menu/src/components/feature/CatalogSchedulerSelector.vue.d.ts +19 -0
  63. package/dist/apps/mf-menu/src/components/feature/CategoryManager/Form.vue.d.ts +27 -0
  64. package/dist/apps/mf-menu/src/components/feature/CategoryManager/index.d.ts +43 -0
  65. package/dist/apps/mf-menu/src/components/feature/CategorySelector.vue.d.ts +6 -0
  66. package/dist/apps/mf-menu/src/components/feature/CategorySelectorSingle.vue.d.ts +18 -0
  67. package/dist/apps/mf-menu/src/components/feature/EmptyDataTemplate/Icon.vue.d.ts +2 -0
  68. package/dist/apps/mf-menu/src/components/feature/EmptyDataTemplate/index.d.ts +1 -0
  69. package/dist/apps/mf-menu/src/components/feature/EmptyDataTemplate/index.vue.d.ts +27 -0
  70. package/dist/apps/mf-menu/src/components/feature/Fields/CurrencyInput.vue.d.ts +45 -0
  71. package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +21 -0
  72. package/dist/apps/mf-menu/src/components/feature/Fields/OrderFrom.vue.d.ts +91 -0
  73. package/dist/apps/mf-menu/src/components/feature/GroupManager/AddForm.vue.d.ts +11 -0
  74. package/dist/apps/mf-menu/src/components/feature/GroupManager/Form.vue.d.ts +42 -0
  75. package/dist/apps/mf-menu/src/components/feature/GroupManager/OptionTable.vue.d.ts +793 -0
  76. package/dist/apps/mf-menu/src/components/feature/GroupManager/UpdateForm.vue.d.ts +537 -0
  77. package/dist/apps/mf-menu/src/components/feature/GroupManager/index.d.ts +2231 -0
  78. package/dist/apps/mf-menu/src/components/feature/InventoryManager/Form.vue.d.ts +67 -0
  79. package/dist/apps/mf-menu/src/components/feature/InventoryManager/InventoryBinding.vue.d.ts +54 -0
  80. package/dist/apps/mf-menu/src/components/feature/InventoryManager/index.d.ts +223 -0
  81. package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +64 -0
  82. package/dist/apps/mf-menu/src/components/feature/MenuSelector.vue.d.ts +47 -0
  83. package/dist/apps/mf-menu/src/components/feature/Picker.vue.d.ts +37 -0
  84. package/dist/apps/mf-menu/src/components/feature/PriceTier/LinkPriceTier.vue.d.ts +12 -0
  85. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +1593 -0
  86. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +1606 -0
  87. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierNotice.vue.d.ts +15 -0
  88. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierSheet.vue.d.ts +27 -0
  89. package/dist/apps/mf-menu/src/components/feature/PrintDeptManager/Form.vue.d.ts +25 -0
  90. package/dist/apps/mf-menu/src/components/feature/PrintDeptManager/index.d.ts +43 -0
  91. package/dist/apps/mf-menu/src/components/feature/RecipeManager/Form.vue.d.ts +45 -0
  92. package/dist/apps/mf-menu/src/components/feature/RecipeManager/index.d.ts +70 -0
  93. package/dist/apps/mf-menu/src/components/feature/RemyButton.vue.d.ts +15 -0
  94. package/dist/apps/mf-menu/src/components/feature/RemyDialog.vue.d.ts +15 -0
  95. package/dist/apps/mf-menu/src/components/feature/ResponsiveFabButton.vue.d.ts +12 -0
  96. package/dist/apps/mf-menu/src/components/feature/RevertDialog.vue.d.ts +15 -0
  97. package/dist/apps/mf-menu/src/components/feature/SchedulerSelector.vue.d.ts +2 -0
  98. package/dist/apps/mf-menu/src/components/feature/SelectGroupDialog.vue.d.ts +15 -0
  99. package/dist/apps/mf-menu/src/components/feature/SelectVariantDialog.vue.d.ts +15 -0
  100. package/dist/apps/mf-menu/src/components/feature/ServingSequenceManager/Form.vue.d.ts +32 -0
  101. package/dist/apps/mf-menu/src/components/feature/ServingSequenceManager/index.d.ts +62 -0
  102. package/dist/apps/mf-menu/src/components/feature/SkuManager/Form.vue.d.ts +49 -0
  103. package/dist/apps/mf-menu/src/components/feature/SkuManager/index.d.ts +85 -0
  104. package/dist/apps/mf-menu/src/components/feature/TakeAwayManager/Form.vue.d.ts +35 -0
  105. package/dist/apps/mf-menu/src/components/feature/TakeAwayManager/index.d.ts +95 -0
  106. package/dist/apps/mf-menu/src/components/feature/TreeEditor/ProductsTree.vue.d.ts +22 -0
  107. package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreeEditor.vue.d.ts +19 -0
  108. package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreeEditorForm.vue.d.ts +36 -0
  109. package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreeEditorLayout.vue.d.ts +11 -0
  110. package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreeEditorOpenner.vue.d.ts +12 -0
  111. package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreePanel.vue.d.ts +22 -0
  112. package/dist/apps/mf-menu/src/components/feature/TreeEditor/TreeTopButton.vue.d.ts +17 -0
  113. package/dist/apps/mf-menu/src/components/feature/TreeEditor/components/OrderFrom.vue.d.ts +15 -0
  114. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/catalog.d.ts +9 -0
  115. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/category.d.ts +32 -0
  116. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +786 -0
  117. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +1165 -0
  118. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/tree.d.ts +12 -0
  119. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +788 -0
  120. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemSelection.d.ts +8 -0
  121. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/variant.d.ts +3 -0
  122. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/FmTipTreeIcon.vue.d.ts +35 -0
  123. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/FmTree.vue.d.ts +26 -0
  124. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/FmTreeChip.vue.d.ts +15 -0
  125. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/FmTreeIcon.vue.d.ts +31 -0
  126. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/FmTreeNode.vue.d.ts +52 -0
  127. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/HighlightableSpan.vue.d.ts +17 -0
  128. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/dragging.d.ts +36 -0
  129. package/dist/apps/mf-menu/src/components/feature/TreeEditor/fmtree/type.d.ts +70 -0
  130. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/AddForm.vue.d.ts +11 -0
  131. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/Form.vue.d.ts +42 -0
  132. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/OptionTable.vue.d.ts +793 -0
  133. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/UpdateForm.vue.d.ts +537 -0
  134. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +2231 -0
  135. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/SelectGroupDialog.vue.d.ts +15 -0
  136. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/SelectVariantDialog.vue.d.ts +15 -0
  137. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/VariantManagerForm.vue.d.ts +24 -0
  138. package/dist/apps/mf-menu/src/components/feature/TreeEditor/history/index.d.ts +15 -0
  139. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadDialog.vue.d.ts +3 -0
  140. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadForm.vue.d.ts +32 -0
  141. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +2393 -0
  142. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductDetail.vue.d.ts +19 -0
  143. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductGroup.vue.d.ts +19 -0
  144. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductInventory.vue.d.ts +27 -0
  145. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductPrice.vue.d.ts +18 -0
  146. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductPrint.vue.d.ts +24 -0
  147. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductTakeaway.vue.d.ts +19 -0
  148. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductVariants.vue.d.ts +19 -0
  149. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/anchor.d.ts +9 -0
  150. package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +823 -0
  151. package/dist/apps/mf-menu/src/components/feature/TreeEditor/openner.d.ts +2 -0
  152. package/dist/apps/mf-menu/src/components/feature/TreeEditor/service/menuLocal.d.ts +16 -0
  153. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +6986 -0
  154. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/tree.d.ts +641 -0
  155. package/dist/apps/mf-menu/src/components/feature/TreeEditor/treeUtils.d.ts +59 -0
  156. package/dist/apps/mf-menu/src/components/feature/TreeEditor/type.d.ts +73 -0
  157. package/dist/apps/mf-menu/src/components/feature/UnitManager/Form.vue.d.ts +27 -0
  158. package/dist/apps/mf-menu/src/components/feature/UnitManager/UnitMeasurement.vue.d.ts +75 -0
  159. package/dist/apps/mf-menu/src/components/feature/UnitManager/index.d.ts +40 -0
  160. package/dist/apps/mf-menu/src/components/feature/VariantManager/Form.vue.d.ts +30 -0
  161. package/dist/apps/mf-menu/src/components/feature/VariantManager/index.d.ts +40 -0
  162. package/dist/apps/mf-menu/src/components/feature/overview/OverviewSheet.vue.d.ts +12 -0
  163. package/dist/apps/mf-menu/src/components/feature/overview/ProductOverview.vue.d.ts +29 -0
  164. package/dist/apps/mf-menu/src/components/feature/overview/ViewLayout.vue.d.ts +46 -0
  165. package/dist/apps/mf-menu/src/components/feature/overview/comp/ProductBaseInfo.vue.d.ts +12 -0
  166. package/dist/apps/mf-menu/src/components/feature/overview/comp/ProductViewer.vue.d.ts +12 -0
  167. package/dist/apps/mf-menu/src/components/feature/overview/type.d.ts +5 -0
  168. package/dist/apps/mf-menu/src/components/feature/overview/views/GroupView.vue.d.ts +12 -0
  169. package/dist/apps/mf-menu/src/components/feature/overview/views/GroupViewTable.vue.d.ts +24 -0
  170. package/dist/apps/mf-menu/src/components/feature/overview/views/ProductView.vue.d.ts +12 -0
  171. package/dist/apps/mf-menu/src/components/feature/overview/views/ProductViewTable.vue.d.ts +18 -0
  172. package/dist/apps/mf-menu/src/components/feature/overview/views/SchedulerView.vue.d.ts +2 -0
  173. package/dist/apps/mf-menu/src/components/feature/overview/views/VariantView.vue.d.ts +2 -0
  174. package/dist/apps/mf-menu/src/components/feature/publish.d.ts +27 -0
  175. package/dist/apps/mf-menu/src/components/import/ImportButton.vue.d.ts +12 -0
  176. package/dist/apps/mf-menu/src/components/import/ItemCard.vue.d.ts +18 -0
  177. package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +71 -0
  178. package/dist/apps/mf-menu/src/components/import/PreviewContent.vue.d.ts +36 -0
  179. package/dist/apps/mf-menu/src/components/import/PreviewContent2.vue.d.ts +55 -0
  180. package/dist/apps/mf-menu/src/components/import/PreviewImportForm.vue.d.ts +26 -0
  181. package/dist/apps/mf-menu/src/components/import/PreviewImportFormFeedme.vue.d.ts +27 -0
  182. package/dist/apps/mf-menu/src/components/layout/FullScreenForm.vue.d.ts +30 -0
  183. package/dist/apps/mf-menu/src/components/layout/PageLayout.vue.d.ts +23 -0
  184. package/dist/apps/mf-menu/src/components/layout/ToggleCard.vue.d.ts +28 -0
  185. package/dist/apps/mf-menu/src/composable/dragResize.d.ts +16 -0
  186. package/dist/apps/mf-menu/src/composable/menu.d.ts +9 -0
  187. package/dist/apps/mf-menu/src/composable/menuNotifer.d.ts +3 -0
  188. package/dist/apps/mf-menu/src/composable/navigator.d.ts +11 -0
  189. package/dist/apps/mf-menu/src/composable/search.d.ts +5 -0
  190. package/dist/apps/mf-menu/src/helper/check.d.ts +6 -0
  191. package/dist/apps/mf-menu/src/helper/currency.d.ts +2 -0
  192. package/dist/apps/mf-menu/src/helper/feedmeModify/definitions.d.ts +449 -0
  193. package/dist/apps/mf-menu/src/helper/feedmeModify/fromExcel.d.ts +8 -0
  194. package/dist/apps/mf-menu/src/helper/feedmeModify/toExcel.d.ts +19 -0
  195. package/dist/apps/mf-menu/src/helper/import-export.d.ts +7070 -0
  196. package/dist/apps/mf-menu/src/helper/item.d.ts +22 -0
  197. package/dist/apps/mf-menu/src/helper/iteration.d.ts +7 -0
  198. package/dist/apps/mf-menu/src/helper/menu.d.ts +872 -0
  199. package/dist/apps/mf-menu/src/helper/number.d.ts +14 -0
  200. package/dist/apps/mf-menu/src/helper/object.d.ts +6 -0
  201. package/dist/apps/mf-menu/src/helper/recipe.d.ts +3 -0
  202. package/dist/apps/mf-menu/src/helper/remy.d.ts +5 -0
  203. package/dist/apps/mf-menu/src/helper/setting/catalogSetting.d.ts +37 -0
  204. package/dist/apps/mf-menu/src/helper/sku.d.ts +9 -0
  205. package/dist/apps/mf-menu/src/helper/string.d.ts +1 -0
  206. package/dist/apps/mf-menu/src/init.d.ts +1 -0
  207. package/dist/apps/mf-menu/src/manager/cooking_guide.d.ts +5 -0
  208. package/dist/apps/mf-menu/src/manager/menu/catalog.d.ts +27 -0
  209. package/dist/apps/mf-menu/src/manager/menu/category.d.ts +38 -0
  210. package/dist/apps/mf-menu/src/manager/menu/group.d.ts +62 -0
  211. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +6919 -0
  212. package/dist/apps/mf-menu/src/manager/menu/priceTier.d.ts +15 -0
  213. package/dist/apps/mf-menu/src/manager/menu/scheduler.d.ts +26 -0
  214. package/dist/apps/mf-menu/src/manager/menu/takeaway.d.ts +6 -0
  215. package/dist/apps/mf-menu/src/manager/print_department.d.ts +5 -0
  216. package/dist/apps/mf-menu/src/manager/scheduler.d.ts +5 -0
  217. package/dist/apps/mf-menu/src/plugins.d.ts +4 -0
  218. package/dist/apps/mf-menu/src/router/shared.d.ts +17 -0
  219. package/dist/apps/mf-menu/src/stores/app.d.ts +217 -0
  220. package/dist/apps/mf-menu/src/stores/manager/catalog.d.ts +7 -0
  221. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +2384 -0
  222. package/dist/apps/mf-menu/src/stores/manager/recipe.d.ts +733 -0
  223. package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +1165 -0
  224. package/dist/apps/mf-menu/src/stores/manager/sku.d.ts +1621 -0
  225. package/dist/apps/mf-menu/src/stores/manager/takeaway.d.ts +107 -0
  226. package/dist/apps/mf-menu/src/stores/manager/unit.d.ts +397 -0
  227. package/dist/apps/mf-menu/src/stores/manager/variant.d.ts +11 -0
  228. package/dist/apps/mf-menu/src/stores/menu.d.ts +6983 -0
  229. package/dist/apps/mf-menu/src/stores/menuEdit.d.ts +7 -0
  230. package/dist/apps/mf-menu/src/types/recipe.d.ts +4 -0
  231. package/dist/apps/mf-menu/src/types/rule.d.ts +64 -0
  232. package/dist/apps/mf-menu/src/utils/createComponentProgrammatically.d.ts +7 -0
  233. package/dist/apps/mf-menu/src/utils/input.d.ts +1 -0
  234. package/dist/apps/mf-menu/src/utils/inventory.d.ts +6 -0
  235. package/dist/apps/mf-menu/src/utils/table.d.ts +1 -0
  236. package/dist/apps/mf-menu/src/utils/tooltip.d.ts +8 -0
  237. package/dist/apps/mf-menu/src/utils/worker.d.ts +1 -0
  238. package/dist/{views → apps/mf-menu/src/views}/Catalog/Catalog.vue.d.ts +1 -1
  239. package/dist/apps/mf-menu/src/views/Catalog/CatalogUsageTable.vue.d.ts +16 -0
  240. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddCategoryDialogContentComponent.vue.d.ts +14 -0
  241. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +1595 -0
  242. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductDetail.vue.d.ts +20 -0
  243. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductGroup.vue.d.ts +19 -0
  244. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductInventory.vue.d.ts +27 -0
  245. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductPrice.vue.d.ts +18 -0
  246. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductPrint.vue.d.ts +24 -0
  247. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductTakeaway.vue.d.ts +19 -0
  248. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/ProductVariants.vue.d.ts +19 -0
  249. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/index.d.ts +3981 -0
  250. package/dist/apps/mf-menu/src/views/Catalog/Edit/Group.vue.d.ts +6 -0
  251. package/dist/apps/mf-menu/src/views/Catalog/Edit/GroupMarkupPriceDialog.vue.d.ts +31 -0
  252. package/dist/apps/mf-menu/src/views/Catalog/Edit/ImportProductDialog.vue.d.ts +18 -0
  253. package/dist/apps/mf-menu/src/views/Catalog/Edit/Product.vue.d.ts +2 -0
  254. package/dist/apps/mf-menu/src/views/Catalog/Edit/ProductTable.vue.d.ts +37 -0
  255. package/dist/apps/mf-menu/src/views/Catalog/Edit/SelectUploadFile.vue.d.ts +23 -0
  256. package/dist/apps/mf-menu/src/views/Catalog/Edit/SelectUploadFiles.vue.d.ts +21 -0
  257. package/dist/apps/mf-menu/src/views/Catalog/Edit/Setting.vue.d.ts +2 -0
  258. package/dist/apps/mf-menu/src/views/Catalog/Edit/Takeaway.vue.d.ts +6 -0
  259. package/dist/apps/mf-menu/src/views/Catalog/Edit/Thumbnail.vue.d.ts +20 -0
  260. package/dist/apps/mf-menu/src/views/Catalog/Edit/[id].vue.d.ts +2 -0
  261. package/dist/apps/mf-menu/src/views/Catalog/type.d.ts +16 -0
  262. package/dist/apps/mf-menu/src/views/Category/Category.vue.d.ts +2 -0
  263. package/dist/apps/mf-menu/src/views/Category/CategoryTable.vue.d.ts +2 -0
  264. package/dist/{views → apps/mf-menu/src/views}/CookingGuide/CookingGuide.vue.d.ts +1 -1
  265. package/dist/apps/mf-menu/src/views/CookingGuide/CookingGuideDialog.vue.d.ts +186 -0
  266. package/dist/apps/mf-menu/src/views/CookingGuide/CookingGuideStepDialog.vue.d.ts +36 -0
  267. package/dist/apps/mf-menu/src/views/CookingGuide/CookingGuideStepOverrideDialog.vue.d.ts +70 -0
  268. package/dist/apps/mf-menu/src/views/Group/Group.vue.d.ts +2 -0
  269. package/dist/apps/mf-menu/src/views/Ingredient/Ingredient.vue.d.ts +2 -0
  270. package/dist/apps/mf-menu/src/views/MenuSetting/AddPriceGroupDialog.vue.d.ts +2 -0
  271. package/dist/apps/mf-menu/src/views/MenuSetting/MenuSetting.vue.d.ts +2 -0
  272. package/dist/{views → apps/mf-menu/src/views}/Overview/Overview.vue.d.ts +1 -1
  273. package/dist/apps/mf-menu/src/views/PrintRoute/PrintDepartmentDialog.vue.d.ts +35 -0
  274. package/dist/apps/mf-menu/src/views/PrintRoute/PrintRoute.vue.d.ts +7 -0
  275. package/dist/apps/mf-menu/src/views/Product/Products.vue.d.ts +2 -0
  276. package/dist/apps/mf-menu/src/views/ProductOverviewDemo.vue.d.ts +2 -0
  277. package/dist/{views → apps/mf-menu/src/views}/Publish/Publish.vue.d.ts +1 -1
  278. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +3473 -0
  279. package/dist/apps/mf-menu/src/views/Recipe/Recipe.vue.d.ts +6 -0
  280. package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +847 -0
  281. package/dist/{views → apps/mf-menu/src/views}/Scheduler/Scheduler.vue.d.ts +1 -1
  282. package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +862 -0
  283. package/dist/apps/mf-menu/src/views/ServingSequence/ServingSequence.vue.d.ts +2 -0
  284. package/dist/apps/mf-menu/src/views/Takeaway/Takeaway.vue.d.ts +2 -0
  285. package/dist/apps/mf-menu/src/views/TaxSetting/TaxSetting.vue.d.ts +2 -0
  286. package/dist/apps/mf-menu/src/views/TreeEditorDemo.vue.d.ts +2 -0
  287. package/dist/apps/mf-menu/src/views/Unit/Unit.vue.d.ts +2 -0
  288. package/dist/{views → apps/mf-menu/src/views}/Variant/Variant.vue.d.ts +1 -1
  289. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -0
  290. package/dist/assets/linked-status-T3O-XXdn.js +24 -0
  291. package/dist/assets/override-menu-CPwBtTX9.js +24 -0
  292. package/dist/assets/validate-menu-CkDDM692.js +24 -0
  293. package/dist/catalog-B1UQHu6j.js +202 -0
  294. package/dist/catalogSetting-DdxZ0nKg.js +65 -0
  295. package/dist/check-C9mY6LiX.js +9 -0
  296. package/dist/createComponentProgrammatically-Bt2rn1IQ.js +11 -0
  297. package/dist/createForm-BoUQeZTd.js +16 -0
  298. package/dist/currency-Bmje2XMW.js +7 -0
  299. package/dist/dayjs.min-CcDoWv_V.js +6 -0
  300. package/dist/discardConfirm-Br8AbO7y.js +3704 -0
  301. package/dist/index-Ce4v8o7D.js +106 -0
  302. package/dist/index-DJ2C-NTK.js +273 -0
  303. package/dist/index-wAygpONg.js +239 -0
  304. package/dist/index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js +57 -0
  305. package/dist/item-DIYt3BTF.js +6897 -0
  306. package/dist/menu-BqPh15La.js +34 -0
  307. package/dist/menu-NS-_m-8z.js +126229 -0
  308. package/dist/mf-menu.css +1 -0
  309. package/dist/object-VfpKsK3I.js +166 -0
  310. package/dist/packages/shared/src/api/index.d.ts +3 -0
  311. package/dist/packages/shared/src/api/public.d.ts +5 -0
  312. package/dist/packages/shared/src/components/button/ResponsiveFabButton.vue.d.ts +12 -0
  313. package/dist/packages/shared/src/components/dialog/ConfirmActionDialog.vue.d.ts +30 -0
  314. package/dist/packages/shared/src/components/form/DynamicSheet.vue.d.ts +19 -0
  315. package/dist/packages/shared/src/components/form/FormLabel.vue.d.ts +33 -0
  316. package/dist/packages/shared/src/components/form/ImageDropField.vue.d.ts +46 -0
  317. package/dist/packages/shared/src/components/form/RestaurantSelector.vue.d.ts +37 -0
  318. package/dist/packages/shared/src/components/form/RestaurantSelectorMultiple.vue.d.ts +22 -0
  319. package/dist/packages/shared/src/components/info/InfoBasic.vue.d.ts +20 -0
  320. package/dist/packages/shared/src/components/info/Summary.vue.d.ts +19 -0
  321. package/dist/packages/shared/src/components/info/TextChip.vue.d.ts +36 -0
  322. package/dist/packages/shared/src/components/layout/FormColumn.vue.d.ts +21 -0
  323. package/dist/packages/shared/src/components/layout/FormItem.vue.d.ts +23 -0
  324. package/dist/packages/shared/src/components/layout/FormRow.vue.d.ts +9 -0
  325. package/dist/packages/shared/src/components/layout/FormSection.vue.d.ts +24 -0
  326. package/dist/packages/shared/src/components/layout/FullScreenForm.vue.d.ts +45 -0
  327. package/dist/packages/shared/src/components/layout/FullWrapper.vue.d.ts +9 -0
  328. package/dist/packages/shared/src/components/layout/HorizontalSplitter.vue.d.ts +2 -0
  329. package/dist/packages/shared/src/components/layout/Indent.vue.d.ts +9 -0
  330. package/dist/packages/shared/src/components/layout/ListLayout.vue.d.ts +2 -0
  331. package/dist/packages/shared/src/components/layout/LottieAnimation.vue.d.ts +39 -0
  332. package/dist/packages/shared/src/components/layout/MobileXScrollable.vue.d.ts +9 -0
  333. package/dist/packages/shared/src/components/layout/PageLayout.vue.d.ts +24 -0
  334. package/dist/packages/shared/src/components/loading/AppLoading.vue.d.ts +20 -0
  335. package/dist/packages/shared/src/components/loading/PageLoading.vue.d.ts +2 -0
  336. package/dist/packages/shared/src/components/loading/index.d.ts +1 -0
  337. package/dist/packages/shared/src/components/map/GoogleMap.vue.d.ts +79 -0
  338. package/dist/packages/shared/src/components/menu/BottomSheetMenu.vue.d.ts +10 -0
  339. package/dist/packages/shared/src/components/menu/BottomSheetMenuItem.vue.d.ts +24 -0
  340. package/dist/packages/shared/src/components/menu/ResponsiveContextMenu.vue.d.ts +22 -0
  341. package/dist/packages/shared/src/components/table/EmptyDataTemplate/Icon.vue.d.ts +2 -0
  342. package/dist/packages/shared/src/components/table/EmptyDataTemplate/index.d.ts +1 -0
  343. package/dist/packages/shared/src/components/table/EmptyDataTemplate/index.vue.d.ts +27 -0
  344. package/dist/packages/shared/src/components/types.d.ts +95 -0
  345. package/dist/packages/shared/src/composable/clipboard.d.ts +3 -0
  346. package/dist/packages/shared/src/composable/dateRange.d.ts +18 -0
  347. package/dist/packages/shared/src/composable/discardConfirm.d.ts +1 -0
  348. package/dist/packages/shared/src/composable/elementPosition.d.ts +17 -0
  349. package/dist/packages/shared/src/composable/filterSelector.d.ts +12 -0
  350. package/dist/packages/shared/src/composable/loading.d.ts +29 -0
  351. package/dist/packages/shared/src/composable/prompt.d.ts +9 -0
  352. package/dist/packages/shared/src/composable/sheet.d.ts +17 -0
  353. package/dist/packages/shared/src/feature/featureMinVersion.d.ts +34 -0
  354. package/dist/packages/shared/src/helpers/actionButton.d.ts +8 -0
  355. package/dist/packages/shared/src/helpers/browser.d.ts +1 -0
  356. package/dist/packages/shared/src/helpers/contextMenu.d.ts +13 -0
  357. package/dist/packages/shared/src/helpers/createComponent.d.ts +7 -0
  358. package/dist/packages/shared/src/helpers/createForm.d.ts +2 -0
  359. package/dist/packages/shared/src/helpers/iteration.d.ts +11 -0
  360. package/dist/packages/shared/src/helpers/map.d.ts +370 -0
  361. package/dist/packages/shared/src/helpers/object.d.ts +6 -0
  362. package/dist/packages/shared/src/helpers/rules.d.ts +1 -0
  363. package/dist/packages/shared/src/helpers/string.d.ts +12 -0
  364. package/dist/packages/shared/src/stores/app.d.ts +217 -0
  365. package/dist/packages/shared/src/types/types.d.ts +5 -0
  366. package/dist/priceTier-xXhsXzsB.js +87 -0
  367. package/dist/scheduler-B2Mo-xyA.js +473 -0
  368. package/dist/search-BAPEUu1R.js +15 -0
  369. package/dist/string-DpfFixWH.js +4 -0
  370. package/dist/toExcel-D_BNnNoP.js +1439 -0
  371. package/dist/tooltip-B5BiPMx9.js +32 -0
  372. package/dist/unit--oJkBunJ.js +370 -0
  373. package/dist/vuedraggable-CK8z7qA8.js +1728 -0
  374. package/package.json +55 -13
  375. package/dist/api/index.d.ts +0 -1
  376. package/dist/app.d.ts +0 -2
  377. package/dist/router/shared.d.ts +0 -2
  378. package/dist/stores/counter.d.ts +0 -13
  379. package/dist/tsconfig.app.tsbuildinfo +0 -1
  380. package/dist/views/PrintRoute/PrintRoute.vue.d.ts +0 -2
  381. /package/dist/{main.d.ts → apps/mf-menu/src/main.d.ts} +0 -0
  382. /package/dist/{router → apps/mf-menu/src/router}/index.d.ts +0 -0
@@ -0,0 +1,1439 @@
1
+ import { b as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-DJ70FzxC.js";
2
+ import "./discardConfirm-Br8AbO7y.js";
3
+ var Z = {
4
+ defaultAmount: 0,
5
+ defaultCurrency: "USD",
6
+ defaultPrecision: 2
7
+ }, J = {
8
+ globalLocale: "en-US",
9
+ globalFormat: "$0,0.00",
10
+ globalRoundingMode: "HALF_EVEN",
11
+ globalFormatRoundingMode: "HALF_AWAY_FROM_ZERO",
12
+ globalExchangeRatesApi: {
13
+ endpoint: void 0,
14
+ headers: void 0,
15
+ propertyPath: void 0
16
+ }
17
+ };
18
+ function U(t) {
19
+ "@babel/helpers - typeof";
20
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? U = function(i) {
21
+ return typeof i;
22
+ } : U = function(i) {
23
+ return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
24
+ }, U(t);
25
+ }
26
+ function w(t) {
27
+ return k(t) || B(t) || Q(t) || Y();
28
+ }
29
+ function k(t) {
30
+ if (Array.isArray(t)) return t;
31
+ }
32
+ function B(t) {
33
+ if (typeof Symbol < "u" && Symbol.iterator in Object(t)) return Array.from(t);
34
+ }
35
+ function Q(t, i) {
36
+ if (t) {
37
+ if (typeof t == "string") return H(t, i);
38
+ var n = Object.prototype.toString.call(t).slice(8, -1);
39
+ if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set") return Array.from(t);
40
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return H(t, i);
41
+ }
42
+ }
43
+ function H(t, i) {
44
+ (i == null || i > t.length) && (i = t.length);
45
+ for (var n = 0, e = new Array(i); n < i; n++) e[n] = t[n];
46
+ return e;
47
+ }
48
+ function Y() {
49
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
51
+ }
52
+ var tt = {
53
+ /**
54
+ * Returns an array of Dinero objects, normalized to the same precision (the highest).
55
+ *
56
+ * @memberof module:Dinero
57
+ * @method
58
+ *
59
+ * @param {Dinero[]} objects - An array of Dinero objects
60
+ *
61
+ * @example
62
+ * // returns an array of Dinero objects
63
+ * // both with a precision of 3
64
+ * // and an amount of 1000
65
+ * Dinero.normalizePrecision([
66
+ * Dinero({ amount: 100, precision: 2 }),
67
+ * Dinero({ amount: 1000, precision: 3 })
68
+ * ])
69
+ *
70
+ * @return {Dinero[]}
71
+ */
72
+ normalizePrecision: function(i) {
73
+ var n = i.reduce(function(e, r) {
74
+ return Math.max(e.getPrecision(), r.getPrecision());
75
+ });
76
+ return i.map(function(e) {
77
+ return e.getPrecision() !== n ? e.convertPrecision(n) : e;
78
+ });
79
+ },
80
+ /**
81
+ * Returns the smallest Dinero object from an array of Dinero objects
82
+ *
83
+ * @memberof module:Dinero
84
+ * @method
85
+ *
86
+ * @param {Dinero[]} objects - An array of Dinero objects
87
+ *
88
+ * @example
89
+ * // returns the smallest Dinero object with amount of 500 from an array of Dinero objects with different precisions
90
+ * Dinero.minimum([
91
+ * Dinero({ amount: 500, precision: 3 }),
92
+ * Dinero({ amount: 100, precision: 2 })
93
+ * ])
94
+ * @example
95
+ * // returns the smallest Dinero object with amount of 50 from an array of Dinero objects
96
+ * Dinero.minimum([
97
+ * Dinero({ amount: 50 }),
98
+ * Dinero({ amount: 100 })
99
+ * ])
100
+ *
101
+ * @return {Dinero[]}
102
+ */
103
+ minimum: function(i) {
104
+ var n = w(i), e = n[0], r = n.slice(1), a = e;
105
+ return r.forEach(function(u) {
106
+ a = a.lessThan(u) ? a : u;
107
+ }), a;
108
+ },
109
+ /**
110
+ * Returns the biggest Dinero object from an array of Dinero objects
111
+ *
112
+ * @memberof module:Dinero
113
+ * @method
114
+ *
115
+ * @param {Dinero[]} objects - An array of Dinero objects
116
+ *
117
+ * @example
118
+ * // returns the biggest Dinero object with amount of 20, from an array of Dinero objects with different precisions
119
+ * Dinero.maximum([
120
+ * Dinero({ amount: 20, precision: 2 }),
121
+ * Dinero({ amount: 150, precision: 3 })
122
+ * ])
123
+ * @example
124
+ * // returns the biggest Dinero object with amount of 100, from an array of Dinero objects
125
+ * Dinero.maximum([
126
+ * Dinero({ amount: 100 }),
127
+ * Dinero({ amount: 50 })
128
+ * ])
129
+ *
130
+ * @return {Dinero[]}
131
+ */
132
+ maximum: function(i) {
133
+ var n = w(i), e = n[0], r = n.slice(1), a = e;
134
+ return r.forEach(function(u) {
135
+ a = a.greaterThan(u) ? a : u;
136
+ }), a;
137
+ }
138
+ };
139
+ function W(t) {
140
+ return !isNaN(parseInt(t)) && isFinite(t);
141
+ }
142
+ function et(t) {
143
+ return W(t) && t <= 100 && t >= 0;
144
+ }
145
+ function nt(t) {
146
+ return t.length > 0 && t.every(function(i) {
147
+ return i >= 0;
148
+ }) && t.some(function(i) {
149
+ return i > 0;
150
+ });
151
+ }
152
+ function x(t) {
153
+ return t % 2 === 0;
154
+ }
155
+ function G(t) {
156
+ return W(t) && !Number.isInteger(t);
157
+ }
158
+ function rt() {
159
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, i = t.toString();
160
+ if (i.indexOf("e-") > 0)
161
+ return parseInt(i.split("e-")[1]);
162
+ var n = i.split(".")[1];
163
+ return n ? n.length : 0;
164
+ }
165
+ function R(t) {
166
+ return Math.abs(t) % 1 === 0.5;
167
+ }
168
+ function it(t) {
169
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
170
+ return new Promise(function(n, e) {
171
+ var r = Object.assign(new XMLHttpRequest(), {
172
+ onreadystatechange: function() {
173
+ r.readyState === 4 && (r.status >= 200 && r.status < 400 ? n(JSON.parse(r.responseText)) : e(new Error(r.statusText)));
174
+ },
175
+ onerror: function() {
176
+ e(new Error("Network error"));
177
+ }
178
+ });
179
+ r.open("GET", t, !0), ot(r, i.headers), r.send();
180
+ });
181
+ }
182
+ function ot(t) {
183
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
184
+ for (var n in i)
185
+ t.setRequestHeader(n, i[n]);
186
+ return t;
187
+ }
188
+ function P(t) {
189
+ return typeof t > "u";
190
+ }
191
+ function z(t) {
192
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ".", n = {};
193
+ return Object.entries(t).forEach(function(e) {
194
+ if (U(e[1]) === "object") {
195
+ var r = z(e[1]);
196
+ Object.entries(r).forEach(function(a) {
197
+ n[e[0] + i + a[0]] = a[1];
198
+ });
199
+ } else
200
+ n[e[0]] = e[1];
201
+ }), n;
202
+ }
203
+ function at(t) {
204
+ return !!t && (U(t) === "object" || typeof t == "function") && typeof t.then == "function";
205
+ }
206
+ function q() {
207
+ var t = function(e, r) {
208
+ var a = function(g) {
209
+ return Math.pow(10, rt(g));
210
+ }, u = Math.max(a(e), a(r));
211
+ return Math.round(e * u) * Math.round(r * u) / (u * u);
212
+ }, i = {
213
+ HALF_ODD: function(e) {
214
+ var r = Math.round(e);
215
+ return R(e) && x(r) ? r - 1 : r;
216
+ },
217
+ HALF_EVEN: function(e) {
218
+ var r = Math.round(e);
219
+ return R(e) ? x(r) ? r : r - 1 : r;
220
+ },
221
+ HALF_UP: function(e) {
222
+ return Math.round(e);
223
+ },
224
+ HALF_DOWN: function(e) {
225
+ return R(e) ? Math.floor(e) : Math.round(e);
226
+ },
227
+ HALF_TOWARDS_ZERO: function(e) {
228
+ return R(e) ? Math.sign(e) * Math.floor(Math.abs(e)) : Math.round(e);
229
+ },
230
+ HALF_AWAY_FROM_ZERO: function(e) {
231
+ return R(e) ? Math.sign(e) * Math.ceil(Math.abs(e)) : Math.round(e);
232
+ },
233
+ DOWN: function(e) {
234
+ return Math.floor(e);
235
+ }
236
+ };
237
+ return {
238
+ /**
239
+ * Returns the sum of two numbers.
240
+ * @ignore
241
+ *
242
+ * @param {Number} a - The first number to add.
243
+ * @param {Number} b - The second number to add.
244
+ *
245
+ * @return {Number}
246
+ */
247
+ add: function(e, r) {
248
+ return e + r;
249
+ },
250
+ /**
251
+ * Returns the difference of two numbers.
252
+ * @ignore
253
+ *
254
+ * @param {Number} a - The first number to subtract.
255
+ * @param {Number} b - The second number to subtract.
256
+ *
257
+ * @return {Number}
258
+ */
259
+ subtract: function(e, r) {
260
+ return e - r;
261
+ },
262
+ /**
263
+ * Returns the product of two numbers.
264
+ * @ignore
265
+ *
266
+ * @param {Number} a - The first number to multiply.
267
+ * @param {Number} b - The second number to multiply.
268
+ *
269
+ * @return {Number}
270
+ */
271
+ multiply: function(e, r) {
272
+ return G(e) || G(r) ? t(e, r) : e * r;
273
+ },
274
+ /**
275
+ * Returns the quotient of two numbers.
276
+ * @ignore
277
+ *
278
+ * @param {Number} a - The first number to divide.
279
+ * @param {Number} b - The second number to divide.
280
+ *
281
+ * @return {Number}
282
+ */
283
+ divide: function(e, r) {
284
+ return e / r;
285
+ },
286
+ /**
287
+ * Returns the remainder of two numbers.
288
+ * @ignore
289
+ *
290
+ * @param {Number} a - The first number to divide.
291
+ * @param {Number} b - The second number to divide.
292
+ *
293
+ * @return {Number}
294
+ */
295
+ modulo: function(e, r) {
296
+ return e % r;
297
+ },
298
+ /**
299
+ * Returns a rounded number based off a specific rounding mode.
300
+ * @ignore
301
+ *
302
+ * @param {Number} number - The number to round.
303
+ * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use.
304
+ *
305
+ * @returns {Number}
306
+ */
307
+ round: function(e) {
308
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "HALF_EVEN";
309
+ return i[r](e);
310
+ }
311
+ };
312
+ }
313
+ var ut = q();
314
+ function st(t) {
315
+ var i = /^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);
316
+ return {
317
+ /**
318
+ * Returns the matches.
319
+ * @ignore
320
+ *
321
+ * @return {Array}
322
+ */
323
+ getMatches: function() {
324
+ return i !== null ? i.slice(1).filter(function(e) {
325
+ return !P(e);
326
+ }) : [];
327
+ },
328
+ /**
329
+ * Returns the amount of fraction digits to display.
330
+ * @ignore
331
+ *
332
+ * @return {Number}
333
+ */
334
+ getMinimumFractionDigits: function() {
335
+ var e = function(a) {
336
+ return a === ".";
337
+ };
338
+ return P(this.getMatches().find(e)) ? 0 : this.getMatches()[ut.add(this.getMatches().findIndex(e), 1)].split("").length;
339
+ },
340
+ /**
341
+ * Returns the currency display mode.
342
+ * @ignore
343
+ *
344
+ * @return {String}
345
+ */
346
+ getCurrencyDisplay: function() {
347
+ var e = {
348
+ USD: "code",
349
+ dollar: "name",
350
+ $: "symbol"
351
+ };
352
+ return e[this.getMatches().find(function(r) {
353
+ return r === "USD" || r === "dollar" || r === "$";
354
+ })];
355
+ },
356
+ /**
357
+ * Returns the formatting style.
358
+ * @ignore
359
+ *
360
+ * @return {String}
361
+ */
362
+ getStyle: function() {
363
+ return P(this.getCurrencyDisplay(this.getMatches())) ? "decimal" : "currency";
364
+ },
365
+ /**
366
+ * Returns whether grouping should be used or not.
367
+ * @ignore
368
+ *
369
+ * @return {Boolean}
370
+ */
371
+ getUseGrouping: function() {
372
+ return !P(this.getMatches().find(function(e) {
373
+ return e === ",";
374
+ }));
375
+ }
376
+ };
377
+ }
378
+ function ct(t) {
379
+ var i = function() {
380
+ var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", a = arguments.length > 1 ? arguments[1] : void 0;
381
+ for (var u in a)
382
+ r = r.replace("{{".concat(u, "}}"), a[u]);
383
+ return r;
384
+ }, n = function(r, a) {
385
+ return it(i(t.endpoint, {
386
+ from: r,
387
+ to: a
388
+ }), {
389
+ headers: t.headers
390
+ });
391
+ };
392
+ return {
393
+ /**
394
+ * Returns the exchange rate.
395
+ * @ignore
396
+ *
397
+ * @param {String} from - The base currency.
398
+ * @param {String} to - The destination currency.
399
+ *
400
+ * @return {Promise}
401
+ */
402
+ getExchangeRate: function(r, a) {
403
+ return (at(t.endpoint) ? t.endpoint : n(r, a)).then(function(u) {
404
+ return z(u)[i(t.propertyPath, {
405
+ from: r,
406
+ to: a
407
+ })];
408
+ });
409
+ }
410
+ };
411
+ }
412
+ function N(t, i) {
413
+ var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Error;
414
+ if (!t) throw new n(i);
415
+ }
416
+ function lt(t) {
417
+ N(et(t), "You must provide a numeric value between 0 and 100.", RangeError);
418
+ }
419
+ function dt(t) {
420
+ N(nt(t), "You must provide a non-empty array of numeric values greater than 0.", TypeError);
421
+ }
422
+ function F(t) {
423
+ N(Number.isInteger(t), "You must provide an integer.", TypeError);
424
+ }
425
+ var d = q(), mt = function t(i) {
426
+ var n = Object.assign({}, {
427
+ amount: t.defaultAmount,
428
+ currency: t.defaultCurrency,
429
+ precision: t.defaultPrecision
430
+ }, i), e = n.amount, r = n.currency, a = n.precision;
431
+ F(e), F(a);
432
+ var u = t.globalLocale, p = t.globalFormat, g = t.globalRoundingMode, _ = t.globalFormatRoundingMode, M = Object.assign({}, t.globalExchangeRatesApi), f = function(o) {
433
+ var s = Object.assign({}, Object.assign({}, {
434
+ amount: e,
435
+ currency: r,
436
+ precision: a
437
+ }, o), Object.assign({}, {
438
+ locale: this.locale
439
+ }, o));
440
+ return Object.assign(t({
441
+ amount: s.amount,
442
+ currency: s.currency,
443
+ precision: s.precision
444
+ }), {
445
+ locale: s.locale
446
+ });
447
+ }, v = function(o) {
448
+ N(this.hasSameCurrency(o), "You must provide a Dinero instance with the same currency.", TypeError);
449
+ };
450
+ return {
451
+ /**
452
+ * Returns the amount.
453
+ *
454
+ * @example
455
+ * // returns 500
456
+ * Dinero({ amount: 500 }).getAmount()
457
+ *
458
+ * @return {Number}
459
+ */
460
+ getAmount: function() {
461
+ return e;
462
+ },
463
+ /**
464
+ * Returns the currency.
465
+ *
466
+ * @example
467
+ * // returns 'EUR'
468
+ * Dinero({ currency: 'EUR' }).getCurrency()
469
+ *
470
+ * @return {String}
471
+ */
472
+ getCurrency: function() {
473
+ return r;
474
+ },
475
+ /**
476
+ * Returns the locale.
477
+ *
478
+ * @example
479
+ * // returns 'fr-FR'
480
+ * Dinero().setLocale('fr-FR').getLocale()
481
+ *
482
+ * @return {String}
483
+ */
484
+ getLocale: function() {
485
+ return this.locale || u;
486
+ },
487
+ /**
488
+ * Returns a new Dinero object with an embedded locale.
489
+ *
490
+ * @param {String} newLocale - The new locale as an {@link http://tools.ietf.org/html/rfc5646 BCP 47 language tag}.
491
+ *
492
+ * @example
493
+ * // Returns a Dinero object with locale 'ja-JP'
494
+ * Dinero().setLocale('ja-JP')
495
+ *
496
+ * @return {Dinero}
497
+ */
498
+ setLocale: function(o) {
499
+ return f.call(this, {
500
+ locale: o
501
+ });
502
+ },
503
+ /**
504
+ * Returns the precision.
505
+ *
506
+ * @example
507
+ * // returns 3
508
+ * Dinero({ precision: 3 }).getPrecision()
509
+ *
510
+ * @return {Number}
511
+ */
512
+ getPrecision: function() {
513
+ return a;
514
+ },
515
+ /**
516
+ * Returns a new Dinero object with a new precision and a converted amount.
517
+ *
518
+ * By default, fractional minor currency units are rounded using the **half to even** rule ([banker's rounding](http://wiki.c2.com/?BankersRounding)).
519
+ * This can be necessary when you need to convert objects to a smaller precision.
520
+ *
521
+ * Rounding *can* lead to accuracy issues as you chain many times. Consider a minimal amount of subsequent conversions for safer results.
522
+ * You can also specify a different `roundingMode` to better fit your needs.
523
+ *
524
+ * @param {Number} newPrecision - The new precision.
525
+ * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
526
+ *
527
+ * @example
528
+ * // Returns a Dinero object with precision 3 and amount 1000
529
+ * Dinero({ amount: 100, precision: 2 }).convertPrecision(3)
530
+ *
531
+ * @throws {TypeError} If `newPrecision` is invalid.
532
+ *
533
+ * @return {Dinero}
534
+ */
535
+ convertPrecision: function(o) {
536
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _;
537
+ F(o);
538
+ var l = this.getPrecision(), m = o > l, A = m ? d.multiply : d.divide, y = m ? [o, l] : [l, o], O = Math.pow(10, d.subtract.apply(d, y));
539
+ return f.call(this, {
540
+ amount: d.round(A(this.getAmount(), O), s),
541
+ precision: o
542
+ });
543
+ },
544
+ /**
545
+ * Returns a new Dinero object that represents the sum of this and an other Dinero object.
546
+ *
547
+ * If Dinero objects have a different `precision`, they will be first converted to the highest.
548
+ *
549
+ * @param {Dinero} addend - The Dinero object to add.
550
+ *
551
+ * @example
552
+ * // returns a Dinero object with amount 600
553
+ * Dinero({ amount: 400 }).add(Dinero({ amount: 200 }))
554
+ * @example
555
+ * // returns a Dinero object with amount 144545 and precision 4
556
+ * Dinero({ amount: 400 }).add(Dinero({ amount: 104545, precision: 4 }))
557
+ *
558
+ * @throws {TypeError} If `addend` has a different currency.
559
+ *
560
+ * @return {Dinero}
561
+ */
562
+ add: function(o) {
563
+ v.call(this, o);
564
+ var s = t.normalizePrecision([this, o]);
565
+ return f.call(this, {
566
+ amount: d.add(s[0].getAmount(), s[1].getAmount()),
567
+ precision: s[0].getPrecision()
568
+ });
569
+ },
570
+ /**
571
+ * Returns a new Dinero object that represents the difference of this and an other Dinero object.
572
+ *
573
+ * If Dinero objects have a different `precision`, they will be first converted to the highest.
574
+ *
575
+ * @param {Dinero} subtrahend - The Dinero object to subtract.
576
+ *
577
+ * @example
578
+ * // returns a Dinero object with amount 200
579
+ * Dinero({ amount: 400 }).subtract(Dinero({ amount: 200 }))
580
+ * @example
581
+ * // returns a Dinero object with amount 64545 and precision 4
582
+ * Dinero({ amount: 104545, precision: 4 }).subtract(Dinero({ amount: 400 }))
583
+ *
584
+ * @throws {TypeError} If `subtrahend` has a different currency.
585
+ *
586
+ * @return {Dinero}
587
+ */
588
+ subtract: function(o) {
589
+ v.call(this, o);
590
+ var s = t.normalizePrecision([this, o]);
591
+ return f.call(this, {
592
+ amount: d.subtract(s[0].getAmount(), s[1].getAmount()),
593
+ precision: s[0].getPrecision()
594
+ });
595
+ },
596
+ /**
597
+ * Returns a new Dinero object that represents the multiplied value by the given factor.
598
+ *
599
+ * By default, fractional minor currency units are rounded using the **half to even** rule ([banker's rounding](http://wiki.c2.com/?BankersRounding)).
600
+ *
601
+ * Rounding *can* lead to accuracy issues as you chain many times. Consider a minimal amount of subsequent calculations for safer results.
602
+ * You can also specify a different `roundingMode` to better fit your needs.
603
+ *
604
+ * @param {Number} multiplier - The factor to multiply by.
605
+ * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
606
+ *
607
+ * @example
608
+ * // returns a Dinero object with amount 1600
609
+ * Dinero({ amount: 400 }).multiply(4)
610
+ * @example
611
+ * // returns a Dinero object with amount 800
612
+ * Dinero({ amount: 400 }).multiply(2.001)
613
+ * @example
614
+ * // returns a Dinero object with amount 801
615
+ * Dinero({ amount: 400 }).multiply(2.00125, 'HALF_UP')
616
+ *
617
+ * @return {Dinero}
618
+ */
619
+ multiply: function(o) {
620
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : g;
621
+ return f.call(this, {
622
+ amount: d.round(d.multiply(this.getAmount(), o), s)
623
+ });
624
+ },
625
+ /**
626
+ * Returns a new Dinero object that represents the divided value by the given factor.
627
+ *
628
+ * By default, fractional minor currency units are rounded using the **half to even** rule ([banker's rounding](http://wiki.c2.com/?BankersRounding)).
629
+ *
630
+ * Rounding *can* lead to accuracy issues as you chain many times. Consider a minimal amount of subsequent calculations for safer results.
631
+ * You can also specify a different `roundingMode` to better fit your needs.
632
+ *
633
+ * As rounding is applied, precision may be lost in the process. If you want to accurately split a Dinero object, use {@link module:Dinero~allocate allocate} instead.
634
+ *
635
+ * @param {Number} divisor - The factor to divide by.
636
+ * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
637
+ *
638
+ * @example
639
+ * // returns a Dinero object with amount 100
640
+ * Dinero({ amount: 400 }).divide(4)
641
+ * @example
642
+ * // returns a Dinero object with amount 52
643
+ * Dinero({ amount: 105 }).divide(2)
644
+ * @example
645
+ * // returns a Dinero object with amount 53
646
+ * Dinero({ amount: 105 }).divide(2, 'HALF_UP')
647
+ *
648
+ * @return {Dinero}
649
+ */
650
+ divide: function(o) {
651
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : g;
652
+ return f.call(this, {
653
+ amount: d.round(d.divide(this.getAmount(), o), s)
654
+ });
655
+ },
656
+ /**
657
+ * Returns a new Dinero object that represents a percentage of this.
658
+ *
659
+ * As rounding is applied, precision may be lost in the process. If you want to accurately split a Dinero object, use {@link module:Dinero~allocate allocate} instead.
660
+ *
661
+ * @param {Number} percentage - The percentage to extract (between 0 and 100).
662
+ * @param {String} [roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
663
+ *
664
+ * @example
665
+ * // returns a Dinero object with amount 5000
666
+ * Dinero({ amount: 10000 }).percentage(50)
667
+ * @example
668
+ * // returns a Dinero object with amount 29
669
+ * Dinero({ amount: 57 }).percentage(50, "HALF_ODD")
670
+ *
671
+ * @throws {RangeError} If `percentage` is out of range.
672
+ *
673
+ * @return {Dinero}
674
+ */
675
+ percentage: function(o) {
676
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : g;
677
+ return lt(o), this.multiply(d.divide(o, 100), s);
678
+ },
679
+ /**
680
+ * Allocates the amount of a Dinero object according to a list of ratios.
681
+ *
682
+ * Sometimes you need to split monetary values but percentages can't cut it without adding or losing pennies.
683
+ * A good example is invoicing: let's say you need to bill $1,000.03 and you want a 50% downpayment.
684
+ * If you use {@link module:Dinero~percentage percentage}, you'll get an accurate Dinero object but the amount won't be billable: you can't split a penny.
685
+ * If you round it, you'll bill a penny extra.
686
+ * With {@link module:Dinero~allocate allocate}, you can split a monetary amount then distribute the remainder as evenly as possible.
687
+ *
688
+ * You can use percentage style or ratio style for `ratios`: `[25, 75]` and `[1, 3]` will do the same thing.
689
+ *
690
+ * Since v1.8.0, you can use zero ratios (such as [0, 50, 50]). If there's a remainder to distribute, zero ratios are skipped and return a Dinero object with amount zero.
691
+ *
692
+ * @param {Number[]} ratios - The ratios to allocate the money to.
693
+ *
694
+ * @example
695
+ * // returns an array of two Dinero objects
696
+ * // the first one with an amount of 502
697
+ * // the second one with an amount of 501
698
+ * Dinero({ amount: 1003 }).allocate([50, 50])
699
+ * @example
700
+ * // returns an array of two Dinero objects
701
+ * // the first one with an amount of 25
702
+ * // the second one with an amount of 75
703
+ * Dinero({ amount: 100 }).allocate([1, 3])
704
+ * @example
705
+ * // since version 1.8.0
706
+ * // returns an array of three Dinero objects
707
+ * // the first one with an amount of 0
708
+ * // the second one with an amount of 502
709
+ * // the third one with an amount of 501
710
+ * Dinero({ amount: 1003 }).allocate([0, 50, 50])
711
+ *
712
+ * @throws {TypeError} If ratios are invalid.
713
+ *
714
+ * @return {Dinero[]}
715
+ */
716
+ allocate: function(o) {
717
+ var s = this;
718
+ dt(o);
719
+ for (var l = o.reduce(function(O, b) {
720
+ return d.add(O, b);
721
+ }), m = this.getAmount(), A = o.map(function(O) {
722
+ var b = Math.floor(d.divide(d.multiply(s.getAmount(), O), l));
723
+ return m = d.subtract(m, b), f.call(s, {
724
+ amount: b
725
+ });
726
+ }), y = 0; m > 0; )
727
+ o[y] > 0 && (A[y] = A[y].add(f.call(this, {
728
+ amount: 1
729
+ })), m = d.subtract(m, 1)), y += 1;
730
+ return A;
731
+ },
732
+ /**
733
+ * Returns a Promise containing a new Dinero object converted to another currency.
734
+ *
735
+ * You have two options to provide the exchange rates:
736
+ *
737
+ * 1. **Use an exchange rate REST API, and let Dinero handle the fetching and conversion.**
738
+ * This is a simple option if you have access to an exchange rate REST API and want Dinero to do the rest.
739
+ * 2. **Fetch the exchange rates on your own and provide them directly.**
740
+ * This is useful if you're fetching your rates from somewhere else (a file, a database), use a different protocol or query language than REST (SOAP, GraphQL) or want to fetch rates once and cache them instead of making new requests every time.
741
+ *
742
+ * **If you want to use a REST API**, you must provide a third-party endpoint yourself. Dinero doesn't come bundled with an exchange rates endpoint.
743
+ *
744
+ * Here are some exchange rate APIs you can use:
745
+ *
746
+ * * [Fixer](https://fixer.io)
747
+ * * [Open Exchange Rates](https://openexchangerates.org)
748
+ * * [Coinbase](https://api.coinbase.com/v2/exchange-rates)
749
+ * * More [foreign](https://github.com/toddmotto/public-apis#currency-exchange) and [crypto](https://github.com/toddmotto/public-apis#cryptocurrency) exchange rate APIs.
750
+ *
751
+ * **If you want to fetch your own rates and provide them directly**, you need to pass a promise that resolves to the exchanges rates.
752
+ *
753
+ * In both cases, you need to specify at least:
754
+ *
755
+ * * a **destination currency**: the currency in which you want to convert your Dinero object. You can specify it with `currency`.
756
+ * * an **endpoint**: the API URL to query exchange rates, with parameters, or a promise that resolves to the exchange rates. You can specify it with `options.endpoint`.
757
+ * * a **property path**: the path to access the wanted rate in your API's JSON response (or the custom promise's payload). For example, with a response of:
758
+ * ```json
759
+ * {
760
+ * "data": {
761
+ * "base": "USD",
762
+ * "destination": "EUR",
763
+ * "rate": "0.827728919"
764
+ * }
765
+ * }
766
+ * ```
767
+ * Then the property path is `'data.rate'`. You can specify it with `options.propertyPath`.
768
+ *
769
+ * The base currency (the one of your Dinero object) and the destination currency can be used as "merge tags" with the mustache syntax, respectively `{{from}}` and `{{to}}`.
770
+ * You can use these tags to refer to these values in `options.endpoint` and `options.propertyPath`.
771
+ *
772
+ * For example, if you need to specify the base currency as a query parameter, you can do the following:
773
+ *
774
+ * ```js
775
+ * {
776
+ * endpoint: 'https://yourexchangerates.api/latest?base={{from}}'
777
+ * }
778
+ * ```
779
+ *
780
+ * @param {String} currency - The destination currency, expressed as an {@link https://en.wikipedia.org/wiki/ISO_4217#Active_codes ISO 4217 currency code}.
781
+ * @param {(String|Promise)} options.endpoint - The API endpoint to retrieve exchange rates. You can substitute this with a promise that resolves to the exchanges rates if you already have them.
782
+ * @param {String} [options.propertyPath='rates.{{to}}'] - The property path to the rate.
783
+ * @param {Object} [options.headers] - The HTTP headers to provide, if needed.
784
+ * @param {String} [options.roundingMode='HALF_EVEN'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
785
+ *
786
+ * @example
787
+ * // your global API parameters
788
+ * Dinero.globalExchangeRatesApi = { ... }
789
+ *
790
+ * // returns a Promise containing a Dinero object with the destination currency
791
+ * // and the initial amount converted to the new currency.
792
+ * Dinero({ amount: 500 }).convert('EUR')
793
+ * @example
794
+ * // returns a Promise containing a Dinero object,
795
+ * // with specific API parameters and rounding mode for this specific instance.
796
+ * Dinero({ amount: 500 })
797
+ * .convert('XBT', {
798
+ * endpoint: 'https://yourexchangerates.api/latest?base={{from}}',
799
+ * propertyPath: 'data.rates.{{to}}',
800
+ * headers: {
801
+ * 'user-key': 'xxxxxxxxx'
802
+ * },
803
+ * roundingMode: 'HALF_UP'
804
+ * })
805
+ * @example
806
+ * // usage with exchange rates provided as a custom promise
807
+ * // using the default `propertyPath` format (so it doesn't have to be specified)
808
+ * const rates = {
809
+ * rates: {
810
+ * EUR: 0.81162
811
+ * }
812
+ * }
813
+ *
814
+ * Dinero({ amount: 500 })
815
+ * .convert('EUR', {
816
+ * endpoint: new Promise(resolve => resolve(rates))
817
+ * })
818
+ * @example
819
+ * // usage with Promise.prototype.then and Promise.prototype.catch
820
+ * Dinero({ amount: 500 })
821
+ * .convert('EUR')
822
+ * .then(dinero => {
823
+ * dinero.getCurrency() // returns 'EUR'
824
+ * })
825
+ * .catch(err => {
826
+ * // handle errors
827
+ * })
828
+ * @example
829
+ * // usage with async/await
830
+ * (async () => {
831
+ * const price = await Dinero({ amount: 500 }).convert('EUR')
832
+ * price.getCurrency() // returns 'EUR'
833
+ * })()
834
+ *
835
+ * @return {Promise}
836
+ */
837
+ convert: function(o) {
838
+ var s = this, l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.endpoint, A = m === void 0 ? M.endpoint : m, y = l.propertyPath, O = y === void 0 ? M.propertyPath || "rates.{{to}}" : y, b = l.headers, V = b === void 0 ? M.headers : b, L = l.roundingMode, X = L === void 0 ? g : L, j = Object.assign({}, {
839
+ endpoint: A,
840
+ propertyPath: O,
841
+ headers: V,
842
+ roundingMode: X
843
+ });
844
+ return ct(j).getExchangeRate(this.getCurrency(), o).then(function(I) {
845
+ return N(!P(I), 'No rate was found for the destination currency "'.concat(o, '".'), TypeError), f.call(s, {
846
+ amount: d.round(d.multiply(s.getAmount(), parseFloat(I)), j.roundingMode),
847
+ currency: o
848
+ });
849
+ });
850
+ },
851
+ /**
852
+ * Checks whether the value represented by this object equals to the other.
853
+ *
854
+ * @param {Dinero} comparator - The Dinero object to compare to.
855
+ *
856
+ * @example
857
+ * // returns true
858
+ * Dinero({ amount: 500, currency: 'EUR' }).equalsTo(Dinero({ amount: 500, currency: 'EUR' }))
859
+ * @example
860
+ * // returns false
861
+ * Dinero({ amount: 500, currency: 'EUR' }).equalsTo(Dinero({ amount: 800, currency: 'EUR' }))
862
+ * @example
863
+ * // returns false
864
+ * Dinero({ amount: 500, currency: 'USD' }).equalsTo(Dinero({ amount: 500, currency: 'EUR' }))
865
+ * @example
866
+ * // returns false
867
+ * Dinero({ amount: 500, currency: 'USD' }).equalsTo(Dinero({ amount: 800, currency: 'EUR' }))
868
+ * @example
869
+ * // returns true
870
+ * Dinero({ amount: 1000, currency: 'EUR', precision: 2 }).equalsTo(Dinero({ amount: 10000, currency: 'EUR', precision: 3 }))
871
+ * @example
872
+ * // returns false
873
+ * Dinero({ amount: 10000, currency: 'EUR', precision: 2 }).equalsTo(Dinero({ amount: 10000, currency: 'EUR', precision: 3 }))
874
+ *
875
+ * @return {Boolean}
876
+ */
877
+ equalsTo: function(o) {
878
+ return this.hasSameAmount(o) && this.hasSameCurrency(o);
879
+ },
880
+ /**
881
+ * Checks whether the value represented by this object is less than the other.
882
+ *
883
+ * @param {Dinero} comparator - The Dinero object to compare to.
884
+ *
885
+ * @example
886
+ * // returns true
887
+ * Dinero({ amount: 500 }).lessThan(Dinero({ amount: 800 }))
888
+ * @example
889
+ * // returns false
890
+ * Dinero({ amount: 800 }).lessThan(Dinero({ amount: 500 }))
891
+ * @example
892
+ * // returns true
893
+ * Dinero({ amount: 5000, precision: 3 }).lessThan(Dinero({ amount: 800 }))
894
+ * @example
895
+ * // returns false
896
+ * Dinero({ amount: 800 }).lessThan(Dinero({ amount: 5000, precision: 3 }))
897
+ *
898
+ * @throws {TypeError} If `comparator` has a different currency.
899
+ *
900
+ * @return {Boolean}
901
+ */
902
+ lessThan: function(o) {
903
+ v.call(this, o);
904
+ var s = t.normalizePrecision([this, o]);
905
+ return s[0].getAmount() < s[1].getAmount();
906
+ },
907
+ /**
908
+ * Checks whether the value represented by this object is less than or equal to the other.
909
+ *
910
+ * @param {Dinero} comparator - The Dinero object to compare to.
911
+ *
912
+ * @example
913
+ * // returns true
914
+ * Dinero({ amount: 500 }).lessThanOrEqual(Dinero({ amount: 800 }))
915
+ * @example
916
+ * // returns true
917
+ * Dinero({ amount: 500 }).lessThanOrEqual(Dinero({ amount: 500 }))
918
+ * @example
919
+ * // returns false
920
+ * Dinero({ amount: 500 }).lessThanOrEqual(Dinero({ amount: 300 }))
921
+ * @example
922
+ * // returns true
923
+ * Dinero({ amount: 5000, precision: 3 }).lessThanOrEqual(Dinero({ amount: 800 }))
924
+ * @example
925
+ * // returns true
926
+ * Dinero({ amount: 5000, precision: 3 }).lessThanOrEqual(Dinero({ amount: 500 }))
927
+ * @example
928
+ * // returns false
929
+ * Dinero({ amount: 800 }).lessThanOrEqual(Dinero({ amount: 5000, precision: 3 }))
930
+ *
931
+ * @throws {TypeError} If `comparator` has a different currency.
932
+ *
933
+ * @return {Boolean}
934
+ */
935
+ lessThanOrEqual: function(o) {
936
+ v.call(this, o);
937
+ var s = t.normalizePrecision([this, o]);
938
+ return s[0].getAmount() <= s[1].getAmount();
939
+ },
940
+ /**
941
+ * Checks whether the value represented by this object is greater than the other.
942
+ *
943
+ * @param {Dinero} comparator - The Dinero object to compare to.
944
+ *
945
+ * @example
946
+ * // returns false
947
+ * Dinero({ amount: 500 }).greaterThan(Dinero({ amount: 800 }))
948
+ * @example
949
+ * // returns true
950
+ * Dinero({ amount: 800 }).greaterThan(Dinero({ amount: 500 }))
951
+ * @example
952
+ * // returns true
953
+ * Dinero({ amount: 800 }).greaterThan(Dinero({ amount: 5000, precision: 3 }))
954
+ * @example
955
+ * // returns false
956
+ * Dinero({ amount: 5000, precision: 3 }).greaterThan(Dinero({ amount: 800 }))
957
+ *
958
+ * @throws {TypeError} If `comparator` has a different currency.
959
+ *
960
+ * @return {Boolean}
961
+ */
962
+ greaterThan: function(o) {
963
+ v.call(this, o);
964
+ var s = t.normalizePrecision([this, o]);
965
+ return s[0].getAmount() > s[1].getAmount();
966
+ },
967
+ /**
968
+ * Checks whether the value represented by this object is greater than or equal to the other.
969
+ *
970
+ * @param {Dinero} comparator - The Dinero object to compare to.
971
+ *
972
+ * @example
973
+ * // returns true
974
+ * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 300 }))
975
+ * @example
976
+ * // returns true
977
+ * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 500 }))
978
+ * @example
979
+ * // returns false
980
+ * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 800 }))
981
+ * @example
982
+ * // returns true
983
+ * Dinero({ amount: 800 }).greaterThanOrEqual(Dinero({ amount: 5000, precision: 3 }))
984
+ * @example
985
+ * // returns true
986
+ * Dinero({ amount: 500 }).greaterThanOrEqual(Dinero({ amount: 5000, precision: 3 }))
987
+ * @example
988
+ * // returns false
989
+ * Dinero({ amount: 5000, precision: 3 }).greaterThanOrEqual(Dinero({ amount: 800 }))
990
+ *
991
+ * @throws {TypeError} If `comparator` has a different currency.
992
+ *
993
+ * @return {Boolean}
994
+ */
995
+ greaterThanOrEqual: function(o) {
996
+ v.call(this, o);
997
+ var s = t.normalizePrecision([this, o]);
998
+ return s[0].getAmount() >= s[1].getAmount();
999
+ },
1000
+ /**
1001
+ * Checks if the value represented by this object is zero.
1002
+ *
1003
+ * @example
1004
+ * // returns true
1005
+ * Dinero({ amount: 0 }).isZero()
1006
+ * @example
1007
+ * // returns false
1008
+ * Dinero({ amount: 100 }).isZero()
1009
+ *
1010
+ * @return {Boolean}
1011
+ */
1012
+ isZero: function() {
1013
+ return this.getAmount() === 0;
1014
+ },
1015
+ /**
1016
+ * Checks if the value represented by this object is positive.
1017
+ *
1018
+ * @example
1019
+ * // returns false
1020
+ * Dinero({ amount: -10 }).isPositive()
1021
+ * @example
1022
+ * // returns true
1023
+ * Dinero({ amount: 10 }).isPositive()
1024
+ * @example
1025
+ * // returns true
1026
+ * Dinero({ amount: 0 }).isPositive()
1027
+ *
1028
+ * @return {Boolean}
1029
+ */
1030
+ isPositive: function() {
1031
+ return this.getAmount() >= 0;
1032
+ },
1033
+ /**
1034
+ * Checks if the value represented by this object is negative.
1035
+ *
1036
+ * @example
1037
+ * // returns true
1038
+ * Dinero({ amount: -10 }).isNegative()
1039
+ * @example
1040
+ * // returns false
1041
+ * Dinero({ amount: 10 }).isNegative()
1042
+ * @example
1043
+ * // returns false
1044
+ * Dinero({ amount: 0 }).isNegative()
1045
+ *
1046
+ * @return {Boolean}
1047
+ */
1048
+ isNegative: function() {
1049
+ return this.getAmount() < 0;
1050
+ },
1051
+ /**
1052
+ * Checks if this has minor currency units.
1053
+ * Deprecates {@link module:Dinero~hasCents hasCents}.
1054
+ *
1055
+ * @example
1056
+ * // returns false
1057
+ * Dinero({ amount: 1100 }).hasSubUnits()
1058
+ * @example
1059
+ * // returns true
1060
+ * Dinero({ amount: 1150 }).hasSubUnits()
1061
+ *
1062
+ * @return {Boolean}
1063
+ */
1064
+ hasSubUnits: function() {
1065
+ return d.modulo(this.getAmount(), Math.pow(10, a)) !== 0;
1066
+ },
1067
+ /**
1068
+ * Checks if this has minor currency units.
1069
+ *
1070
+ * @deprecated since version 1.4.0, will be removed in 2.0.0
1071
+ * Use {@link module:Dinero~hasSubUnits hasSubUnits} instead.
1072
+ *
1073
+ * @example
1074
+ * // returns false
1075
+ * Dinero({ amount: 1100 }).hasCents()
1076
+ * @example
1077
+ * // returns true
1078
+ * Dinero({ amount: 1150 }).hasCents()
1079
+ *
1080
+ * @return {Boolean}
1081
+ */
1082
+ hasCents: function() {
1083
+ return d.modulo(this.getAmount(), Math.pow(10, a)) !== 0;
1084
+ },
1085
+ /**
1086
+ * Checks whether the currency represented by this object equals to the other.
1087
+ *
1088
+ * @param {Dinero} comparator - The Dinero object to compare to.
1089
+ *
1090
+ * @example
1091
+ * // returns true
1092
+ * Dinero({ amount: 2000, currency: 'EUR' }).hasSameCurrency(Dinero({ amount: 1000, currency: 'EUR' }))
1093
+ * @example
1094
+ * // returns false
1095
+ * Dinero({ amount: 1000, currency: 'EUR' }).hasSameCurrency(Dinero({ amount: 1000, currency: 'USD' }))
1096
+ *
1097
+ * @return {Boolean}
1098
+ */
1099
+ hasSameCurrency: function(o) {
1100
+ return this.getCurrency() === o.getCurrency();
1101
+ },
1102
+ /**
1103
+ * Checks whether the amount represented by this object equals to the other.
1104
+ *
1105
+ * @param {Dinero} comparator - The Dinero object to compare to.
1106
+ *
1107
+ * @example
1108
+ * // returns true
1109
+ * Dinero({ amount: 1000, currency: 'EUR' }).hasSameAmount(Dinero({ amount: 1000 }))
1110
+ * @example
1111
+ * // returns false
1112
+ * Dinero({ amount: 2000, currency: 'EUR' }).hasSameAmount(Dinero({ amount: 1000, currency: 'EUR' }))
1113
+ * @example
1114
+ * // returns true
1115
+ * Dinero({ amount: 1000, currency: 'EUR', precision: 2 }).hasSameAmount(Dinero({ amount: 10000, precision: 3 }))
1116
+ * @example
1117
+ * // returns false
1118
+ * Dinero({ amount: 10000, currency: 'EUR', precision: 2 }).hasSameAmount(Dinero({ amount: 10000, precision: 3 }))
1119
+ *
1120
+ * @return {Boolean}
1121
+ */
1122
+ hasSameAmount: function(o) {
1123
+ var s = t.normalizePrecision([this, o]);
1124
+ return s[0].getAmount() === s[1].getAmount();
1125
+ },
1126
+ /**
1127
+ * Returns this object formatted as a string.
1128
+ *
1129
+ * The format is a mask which defines how the output string will be formatted.
1130
+ * It defines whether to display a currency, in what format, how many fraction digits to display and whether to use grouping separators.
1131
+ * The output is formatted according to the applying locale.
1132
+ *
1133
+ * Object | Format | String
1134
+ * :--------------------------- | :---------------- | :---
1135
+ * `Dinero({ amount: 500050 })` | `'$0,0.00'` | $5,000.50
1136
+ * `Dinero({ amount: 500050 })` | `'$0,0'` | $5,001
1137
+ * `Dinero({ amount: 500050 })` | `'$0'` | $5001
1138
+ * `Dinero({ amount: 500050 })` | `'$0.0'` | $5000.5
1139
+ * `Dinero({ amount: 500050 })` | `'USD0,0.0'` | USD5,000.5
1140
+ * `Dinero({ amount: 500050 })` | `'0,0.0 dollar'` | 5,000.5 dollars
1141
+ *
1142
+ * Don't try to substitute the `$` sign or the `USD` code with your target currency, nor adapt the format string to the exact format you want.
1143
+ * The format is a mask which defines a pattern and returns a valid, localized currency string.
1144
+ * If you want to display the object in a custom way, either use {@link module:Dinero~getAmount getAmount}, {@link module:Dinero~toUnit toUnit} or {@link module:Dinero~toRoundedUnit toRoundedUnit} and manipulate the output string as you wish.
1145
+ *
1146
+ * {@link module:Dinero~toFormat toFormat} wraps around `Number.prototype.toLocaleString`. For that reason, **format will vary depending on how it's implemented in the end user's environment**.
1147
+ *
1148
+ * You can also use `toLocaleString` directly:
1149
+ * `Dinero().toRoundedUnit(digits, roundingMode).toLocaleString(locale, options)`.
1150
+ *
1151
+ * By default, amounts are rounded using the **half away from zero** rule ([commercial rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero)).
1152
+ * You can also specify a different `roundingMode` to better fit your needs.
1153
+ *
1154
+ * @param {String} [format='$0,0.00'] - The format mask to format to.
1155
+ * @param {String} [roundingMode='HALF_AWAY_FROM_ZERO'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
1156
+ *
1157
+ * @example
1158
+ * // returns $2,000
1159
+ * Dinero({ amount: 200000 }).toFormat('$0,0')
1160
+ * @example
1161
+ * // returns €50.5
1162
+ * Dinero({ amount: 5050, currency: 'EUR' }).toFormat('$0,0.0')
1163
+ * @example
1164
+ * // returns 100 euros
1165
+ * Dinero({ amount: 10000, currency: 'EUR' }).setLocale('fr-FR').toFormat('0,0 dollar')
1166
+ * @example
1167
+ * // returns 2000
1168
+ * Dinero({ amount: 200000, currency: 'EUR' }).toFormat()
1169
+ * @example
1170
+ * // returns $10
1171
+ * Dinero({ amount: 1050 }).toFormat('$0', 'HALF_EVEN')
1172
+ *
1173
+ * @return {String}
1174
+ */
1175
+ toFormat: function() {
1176
+ var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : p, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _, l = st(o);
1177
+ return this.toRoundedUnit(l.getMinimumFractionDigits(), s).toLocaleString(this.getLocale(), {
1178
+ currencyDisplay: l.getCurrencyDisplay(),
1179
+ useGrouping: l.getUseGrouping(),
1180
+ minimumFractionDigits: l.getMinimumFractionDigits(),
1181
+ style: l.getStyle(),
1182
+ currency: this.getCurrency()
1183
+ });
1184
+ },
1185
+ /**
1186
+ * Returns the amount represented by this object in units.
1187
+ *
1188
+ * @example
1189
+ * // returns 10.5
1190
+ * Dinero({ amount: 1050 }).toUnit()
1191
+ * @example
1192
+ * // returns 10.545
1193
+ * Dinero({ amount: 10545, precision: 3 }).toUnit()
1194
+ *
1195
+ * @return {Number}
1196
+ */
1197
+ toUnit: function() {
1198
+ return d.divide(this.getAmount(), Math.pow(10, a));
1199
+ },
1200
+ /**
1201
+ * Returns the amount represented by this object in rounded units.
1202
+ *
1203
+ * By default, the method uses the **half away from zero** rule ([commercial rounding](https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero)).
1204
+ * You can also specify a different `roundingMode` to better fit your needs.
1205
+ *
1206
+ * @example
1207
+ * // returns 10.6
1208
+ * Dinero({ amount: 1055 }).toRoundedUnit(1)
1209
+ * @example
1210
+ * // returns 10
1211
+ * Dinero({ amount: 1050 }).toRoundedUnit(0, 'HALF_EVEN')
1212
+ *
1213
+ * @param {Number} digits - The number of fraction digits to round to.
1214
+ * @param {String} [roundingMode='HALF_AWAY_FROM_ZERO'] - The rounding mode to use: `'HALF_ODD'`, `'HALF_EVEN'`, `'HALF_UP'`, `'HALF_DOWN'`, `'HALF_TOWARDS_ZERO'`, `'HALF_AWAY_FROM_ZERO'` or `'DOWN'`.
1215
+ *
1216
+ * @return {Number}
1217
+ */
1218
+ toRoundedUnit: function(o) {
1219
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _, l = Math.pow(10, o);
1220
+ return d.divide(d.round(d.multiply(this.toUnit(), l), s), l);
1221
+ },
1222
+ /**
1223
+ * Returns the object's data as an object literal.
1224
+ *
1225
+ * @example
1226
+ * // returns { amount: 500, currency: 'EUR', precision: 2 }
1227
+ * Dinero({ amount: 500, currency: 'EUR', precision: 2 }).toObject()
1228
+ *
1229
+ * @return {Object}
1230
+ */
1231
+ toObject: function() {
1232
+ return {
1233
+ amount: e,
1234
+ currency: r,
1235
+ precision: a
1236
+ };
1237
+ },
1238
+ /**
1239
+ * Returns the object's data as an object literal.
1240
+ *
1241
+ * Alias of {@link module:Dinero~toObject toObject}.
1242
+ * It is defined so that calling `JSON.stringify` on a Dinero object will automatically extract the relevant data.
1243
+ *
1244
+ * @example
1245
+ * // returns '{"amount":500,"currency":"EUR","precision":2}'
1246
+ * JSON.stringify(Dinero({ amount: 500, currency: 'EUR', precision: 2 }))
1247
+ *
1248
+ * @return {Object}
1249
+ */
1250
+ toJSON: function() {
1251
+ return this.toObject();
1252
+ }
1253
+ };
1254
+ }, D = Object.assign(mt, Z, J, tt), S = /* @__PURE__ */ ((t) => (t.PRODUCT_PRICE = "PRODUCT_PRICE", t.PRODUCT_VARIANT_PRICE = "PRODUCT_VARIANT_PRICE", t.PRODUCT_ORDER_FROM = "PRODUCT_ORDER_FROM", t.PRODUCT_NAME = "PRODUCT_NAME", t.PRODUCT_SCHEDULE = "PRODUCT_SCHEDULE", t.PRODUCT_SCHEDULE_PRICE = "PRODUCT_SCHEDULE_PRICE", t.PRODUCT_CODE = "PRODUCT_CODE", t.PRODUCT_VARIANT_CODE = "PRODUCT_VARIANT_CODE", t.PRODUCT_VARIANT_SCHEDULE_PRICE = "PRODUCT_VARIANT_SCHEDULE_PRICE", t.ADDON_AVAILABLE = "ADDON_AVAILABLE", t.ADDON_NAME = "ADDON_NAME", t.ADDON_PRICE = "ADDON_PRICE", t.ADDON_VARIANT_PRICE = "ADDON_VARIANT_PRICE", t.ADDON_ORDER_FROM = "ADDON_ORDER_FROM", t))(S || {});
1255
+ function h(t) {
1256
+ return t = t.split("/").map((i) => {
1257
+ const n = i.split("_");
1258
+ return n.length === 1 ? $(n[0]) : n.length === 2 ? (n[0] = $(n[0]), n.join("_")) : (n[1] = $(n[1]), n.join("_"));
1259
+ }).join("/"), t;
1260
+ }
1261
+ function T(t) {
1262
+ return t ? (t = t.split("/").map((i) => {
1263
+ const n = i.split("_");
1264
+ return n.length === 1 ? E(n[0]) : n.length === 2 ? (n[0] = E(n[0]), n.join("_")) : (n[1] = E(n[1]), n.join("_"));
1265
+ }).join("/"), t) : "";
1266
+ }
1267
+ function $(t) {
1268
+ return parseInt(`${new Date(t).getTime()}`).toString(36);
1269
+ }
1270
+ function E(t) {
1271
+ return new Date(parseInt(t, 36)).toISOString();
1272
+ }
1273
+ function gt(t, i = !1) {
1274
+ let n = [];
1275
+ return t.subModule.product.forEach((e) => {
1276
+ var u;
1277
+ const r = t.subModule.category.find((p) => p._id === e.category), a = [];
1278
+ e.addonGroupUsed.forEach((p) => {
1279
+ const g = t.subModule.addonGroup.find((_) => _._id === p);
1280
+ a.push(`${g == null ? void 0 : g.name} (${h((g == null ? void 0 : g._id) ?? "")})`);
1281
+ }), n.push({
1282
+ _id: h(e._id),
1283
+ code: e.code || "",
1284
+ name: e.name,
1285
+ variantKey: "",
1286
+ variant: "",
1287
+ vcStatus: "",
1288
+ price: D(e.price).toFormat("0.00"),
1289
+ perXUnit: e.unit ? ((u = e.perXUnit) == null ? void 0 : u.toString()) ?? "" : "",
1290
+ unit: e.unit || "",
1291
+ categoryName: (r == null ? void 0 : r.name) ?? "",
1292
+ description: e.description || "",
1293
+ addonGroup: a.join(" || ")
1294
+ }), e.variantCombination.length > 0 && e.variantCombination.forEach((p) => {
1295
+ var g;
1296
+ n.push({
1297
+ _id: h(e._id),
1298
+ code: p.code || "",
1299
+ name: e.name,
1300
+ variantKey: h(p.combinationKey),
1301
+ variant: p.selectionName.join("/"),
1302
+ vcStatus: p.active ? "active" : "inactive",
1303
+ price: p.price ? D(p.price).toFormat("0.00") : D(e.price).toFormat("0.00"),
1304
+ perXUnit: e.unit ? ((g = e.perXUnit) == null ? void 0 : g.toString()) ?? "" : "",
1305
+ unit: e.unit || "",
1306
+ categoryName: (r == null ? void 0 : r.name) ?? "",
1307
+ description: e.description || "",
1308
+ addonGroup: a.join(" || ")
1309
+ });
1310
+ });
1311
+ }), n = n.map((e) => {
1312
+ let r = {};
1313
+ const a = t.subModule.product.find((u) => h(u._id) === e._id);
1314
+ return (t.subModule.catalog || []).forEach((u) => {
1315
+ var p, g, _, M;
1316
+ if (u.productAvailable.includes((a == null ? void 0 : a._id) ?? "")) {
1317
+ const f = e.variantKey, v = f ? (p = u.override.product[(a == null ? void 0 : a._id) ?? ""]) == null ? void 0 : p.find(
1318
+ (m) => m.combinationKey === T(e.variantKey) && m.type == S.PRODUCT_VARIANT_PRICE
1319
+ ) : null, c = (g = u.override.product[(a == null ? void 0 : a._id) ?? ""]) == null ? void 0 : g.find(
1320
+ (m) => m.type === S.PRODUCT_PRICE
1321
+ ), o = f ? (_ = u.override.product[(a == null ? void 0 : a._id) ?? ""]) == null ? void 0 : _.find(
1322
+ (m) => m.combinationKey === T(e.variantKey) && m.type == S.PRODUCT_VARIANT_CODE
1323
+ ) : null, s = (M = u.override.product[(a == null ? void 0 : a._id) ?? ""]) == null ? void 0 : M.find(
1324
+ (m) => m.type === S.PRODUCT_CODE
1325
+ ), l = f ? a == null ? void 0 : a.variantCombination.find(
1326
+ (m) => m.combinationKey === T(e.variantKey)
1327
+ ) : null;
1328
+ f && v ? r = {
1329
+ ...r,
1330
+ [`${u.name} (${h(u._id)})`]: D(
1331
+ v.value
1332
+ ).toFormat("0.00")
1333
+ } : f && !v && (l != null && l.price) ? r = {
1334
+ ...r,
1335
+ [`${u.name} (${h(u._id)})`]: D(
1336
+ l.price
1337
+ ).toFormat("0.00")
1338
+ } : f && !v && !(l != null && l.price) && c ? r = {
1339
+ ...r,
1340
+ [`${u.name} (${h(u._id)})`]: D(
1341
+ c.value
1342
+ ).toFormat("0.00")
1343
+ } : f && !v && !(l != null && l.price) && !c ? r = {
1344
+ ...r,
1345
+ [`${u.name} (${h(u._id)})`]: e.price
1346
+ } : !f && c ? r = {
1347
+ ...r,
1348
+ [`${u.name} (${h(u._id)})`]: D(
1349
+ c.value
1350
+ ).toFormat("0.00")
1351
+ } : r = {
1352
+ ...r,
1353
+ [`${u.name} (${h(u._id)})`]: e.price
1354
+ }, o ? r = {
1355
+ ...r,
1356
+ [`${u.name} (${h(u._id)})`]: `${r[`${u.name} (${h(u._id)})`]} , ${o.value}`
1357
+ } : s ? r = {
1358
+ ...r,
1359
+ [`${u.name} (${h(u._id)})`]: `${r[`${u.name} (${h(u._id)})`]} , ${s.value}`
1360
+ } : r = {
1361
+ ...r,
1362
+ [`${u.name} (${h(u._id)})`]: `${r[`${u.name} (${h(u._id)})`]} , ${e.code}`
1363
+ };
1364
+ } else
1365
+ r = {
1366
+ ...r,
1367
+ [`${u.name} (${h(u._id)})`]: "N/A"
1368
+ };
1369
+ }), { ...e, ...r };
1370
+ }), n;
1371
+ }
1372
+ function yt(t) {
1373
+ const i = gt(t);
1374
+ let n = C.json_to_sheet(i, {
1375
+ header: [
1376
+ "_id",
1377
+ "code",
1378
+ "name",
1379
+ "variantKey",
1380
+ "variant",
1381
+ "vcStatus",
1382
+ "price",
1383
+ "perXUnit",
1384
+ "unit",
1385
+ "categoryName",
1386
+ "description",
1387
+ "addonGroup"
1388
+ ]
1389
+ });
1390
+ if (i.length > 0) {
1391
+ const r = ft(n);
1392
+ n = K(n, i), n["!merges"] = [C.decode_range(`M1:${r}1`)];
1393
+ } else
1394
+ n = K(n);
1395
+ let e = C.book_new();
1396
+ return C.book_append_sheet(e, n, "sheet 1"), e = ht(e), e;
1397
+ }
1398
+ function ft(t) {
1399
+ const i = Object.keys(t).filter((e) => {
1400
+ if (e.length === 2 && e.endsWith("2"))
1401
+ return e;
1402
+ if (e.length === 3 && !Number(e[1]) && e.endsWith("2"))
1403
+ return e;
1404
+ }), n = i[i.length - 1];
1405
+ return n.substring(0, n.length - 1);
1406
+ }
1407
+ function K(t, i) {
1408
+ const n = C.sheet_to_json(t, {
1409
+ header: 1
1410
+ });
1411
+ if (n.splice(0, 0, [
1412
+ "System ID for product (Do not modify!)",
1413
+ "Order code for customer and kitchen display purpose ",
1414
+ "Product name for display purpose",
1415
+ "System ID for product variant (Do not modify!)",
1416
+ "Variant for display purpose, empty mean no variant (Do not modify, will be ignored when import)",
1417
+ "Status for product variant (active/inactive)",
1418
+ "Price for product with variant",
1419
+ "Price of product per unit, should not empty if unit is not empty (Do not modify, will be ignored when import)",
1420
+ "If product can be sold by other measurement, eg: Gram (Do not modify, will be ignored when import)",
1421
+ "Category product belong to ",
1422
+ "Product description for display purpose",
1423
+ "(Do not modify, will be ignored when import)"
1424
+ ]), i) {
1425
+ const e = Object.keys(i[0]);
1426
+ n.splice(1, 1, [...e]);
1427
+ }
1428
+ return C.aoa_to_sheet(n);
1429
+ }
1430
+ function ht(t) {
1431
+ for (const i of Object.keys(t.Sheets["sheet 1"])) {
1432
+ const n = t.Sheets["sheet 1"][i];
1433
+ n.t === "n" && (n.z = "0.00");
1434
+ }
1435
+ return t;
1436
+ }
1437
+ export {
1438
+ yt as m
1439
+ };