@tabres/react 1.0.32 → 1.0.34
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.
- package/dist/components/BackIcon/BackIcon.d.ts +1 -1
- package/dist/components/Events/Events.d.ts +1 -1
- package/dist/components/Events/EventsToolbar.d.ts +1 -1
- package/dist/components/PublicMenu/Branches/BranchCard/BranchCard.d.ts +1 -1
- package/dist/components/PublicMenu/Branches/BranchCard/Parent.d.ts +1 -1
- package/dist/components/PublicMenu/Branches/Branches.d.ts +1 -1
- package/dist/components/PublicMenu/Categories/Categories.d.ts +1 -1
- package/dist/components/PublicMenu/Customer/CustomerAddress/AddressContent/AddressContent.d.ts +1 -1
- package/dist/components/PublicMenu/Customer/CustomerAddress/CustomerAddress.d.ts +1 -1
- package/dist/components/PublicMenu/Customer/CustomerAddress/NoAddressContent/NoAddressContent.d.ts +1 -1
- package/dist/components/PublicMenu/Header/BranchBusinessHours/BranchBusinessHours.d.ts +1 -1
- package/dist/components/PublicMenu/Header/BranchBusinessHours/HoursList/HoursList.d.ts +1 -1
- package/dist/components/PublicMenu/Header/BranchHeader/BranchHeader.d.ts +1 -1
- package/dist/components/PublicMenu/Header/BranchHeader/HeaderLinks/HeaderLinks.d.ts +1 -1
- package/dist/components/PublicMenu/Header/BusinessHeader/BusinessHeader.d.ts +1 -1
- package/dist/components/PublicMenu/Header/Header.d.ts +1 -1
- package/dist/components/PublicMenu/Header/Languages/Languages.d.ts +1 -1
- package/dist/components/PublicMenu/MenuContent/MenuContent.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/AddUpdateAddress/AddUpdateAddress.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/AddUpdateNote/AddUpdateNote.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/Auth/Auth.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/Auth/EmailStep.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/Auth/OTPStep.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/Auth/PhoneStep.d.ts +1 -1
- package/dist/components/PublicMenu/Modals/BranchBusinessHours/BranchBusinessHours.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawer.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerCart.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerCompleted.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerDetails.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderDrawerFooter.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderPaymentMethods/OrderPaymentMethods.d.ts +2 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderPaymentMethods/index.d.ts +1 -0
- package/dist/components/PublicMenu/OrderDrawer/OrderTable/OrderTable.d.ts +1 -1
- package/dist/components/PublicMenu/OrderDrawer/OrderTable/OrderTableUI.d.ts +1 -1
- package/dist/components/PublicMenu/OrderFAB/OrderFAB.d.ts +1 -1
- package/dist/components/PublicMenu/OrderFAB/OrderFABContainer.d.ts +1 -1
- package/dist/components/PublicMenu/OrderItemsList/OrderItemsList.d.ts +1 -1
- package/dist/components/PublicMenu/OrderItemsList/OrderNoItems.d.ts +1 -1
- package/dist/components/PublicMenu/OrderListItem/OrderListItem.d.ts +1 -1
- package/dist/components/PublicMenu/OrderMethods/OrderMethods.d.ts +1 -1
- package/dist/components/PublicMenu/OrderPaymentSummary/OrderPaymentSummary.d.ts +1 -1
- package/dist/components/PublicMenu/OrderStepper/OrderStepper.d.ts +1 -1
- package/dist/components/PublicMenu/ProductAddons/ProductAddons.d.ts +1 -1
- package/dist/components/PublicMenu/ProductDetails/ProductDetails.d.ts +1 -1
- package/dist/components/PublicMenu/ProductDetails/ProductDetailsUI.d.ts +1 -1
- package/dist/components/PublicMenu/ProductInOrder/ProductInOrder.d.ts +1 -1
- package/dist/components/PublicMenu/ProductQuantity/ProductQuantity.d.ts +1 -1
- package/dist/components/PublicMenu/ProductVariants/ProductVariants.d.ts +1 -1
- package/dist/components/PublicMenu/Products/Products.d.ts +1 -1
- package/dist/components/PublicMenu/ProductsGridItem/ProductsGridItem.d.ts +1 -1
- package/dist/components/PublicMenu/ProductsGridItem/ProductsGridItemContainer.d.ts +1 -1
- package/dist/components/PublicMenu/ProductsListItem/ProductsListItem.d.ts +1 -1
- package/dist/components/PublicMenu/PublicMenu.d.ts +1 -1
- package/dist/components/PublicMenu/Videos/Video/Actions/Actions.d.ts +1 -1
- package/dist/components/PublicMenu/Videos/Video/Video.d.ts +1 -1
- package/dist/components/PublicMenu/Videos/Video/VideoData/VideoData.d.ts +1 -1
- package/dist/components/PublicMenu/Videos/VideoFeed/VideoFeed.d.ts +1 -1
- package/dist/components/Quantity/Quantity.d.ts +1 -1
- package/dist/components/ScrollToTop/ScrollToTop.d.ts +1 -1
- package/dist/constants/index.esm.js.map +1 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/models/index.esm.js.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/modules/branch/models.d.ts +2 -0
- package/dist/models/modules/order/constants.d.ts +1 -1
- package/dist/models/modules/order/models.d.ts +1 -1
- package/dist/models/services/translation/locales/az/index.d.ts +0 -1
- package/dist/models/services/translation/locales/az/order.d.ts +0 -1
- package/dist/models/services/translation/locales/es/index.d.ts +0 -1
- package/dist/models/services/translation/locales/es/order.d.ts +0 -1
- package/dist/models/services/translation/locales/et/index.d.ts +0 -1
- package/dist/models/services/translation/locales/et/order.d.ts +0 -1
- package/dist/models/services/translation/locales/hr/index.d.ts +0 -1
- package/dist/models/services/translation/locales/hr/order.d.ts +0 -1
- package/dist/models/services/translation/locales/index.d.ts +0 -9
- package/dist/models/services/translation/locales/nl/index.d.ts +0 -1
- package/dist/models/services/translation/locales/nl/order.d.ts +0 -1
- package/dist/models/services/translation/locales/pl/index.d.ts +0 -1
- package/dist/models/services/translation/locales/pl/order.d.ts +0 -1
- package/dist/models/services/translation/locales/pt/index.d.ts +0 -1
- package/dist/models/services/translation/locales/pt/order.d.ts +0 -1
- package/dist/models/services/translation/locales/ru/index.d.ts +0 -1
- package/dist/models/services/translation/locales/ru/order.d.ts +0 -1
- package/dist/models/services/translation/locales/tr/index.d.ts +0 -1
- package/dist/models/services/translation/locales/tr/order.d.ts +0 -1
- package/dist/models/store/index.d.ts +1 -1
- package/dist/models/store/order.d.ts +1 -1
- package/dist/modules/branch/models.d.ts +2 -0
- package/dist/modules/order/constants.d.ts +1 -1
- package/dist/modules/order/models.d.ts +1 -1
- package/dist/modules/order/preview.d.ts +1 -1
- package/dist/services/translation/locales/az/index.d.ts +0 -1
- package/dist/services/translation/locales/az/order.d.ts +0 -1
- package/dist/services/translation/locales/es/index.d.ts +0 -1
- package/dist/services/translation/locales/es/order.d.ts +0 -1
- package/dist/services/translation/locales/et/index.d.ts +0 -1
- package/dist/services/translation/locales/et/order.d.ts +0 -1
- package/dist/services/translation/locales/hr/index.d.ts +0 -1
- package/dist/services/translation/locales/hr/order.d.ts +0 -1
- package/dist/services/translation/locales/index.d.ts +0 -9
- package/dist/services/translation/locales/nl/index.d.ts +0 -1
- package/dist/services/translation/locales/nl/order.d.ts +0 -1
- package/dist/services/translation/locales/pl/index.d.ts +0 -1
- package/dist/services/translation/locales/pl/order.d.ts +0 -1
- package/dist/services/translation/locales/pt/index.d.ts +0 -1
- package/dist/services/translation/locales/pt/order.d.ts +0 -1
- package/dist/services/translation/locales/ru/index.d.ts +0 -1
- package/dist/services/translation/locales/ru/order.d.ts +0 -1
- package/dist/services/translation/locales/tr/index.d.ts +0 -1
- package/dist/services/translation/locales/tr/order.d.ts +0 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/order.d.ts +1 -1
- package/dist/styles/ui.css +1 -1
- package/dist/styles/ui.css.map +1 -1
- package/dist/utils/index.esm.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/modules/branch/models.d.ts +2 -0
- package/dist/utils/modules/order/constants.d.ts +1 -1
- package/dist/utils/modules/order/models.d.ts +1 -1
- package/dist/utils/services/translation/locales/az/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/az/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/es/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/es/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/et/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/et/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/hr/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/hr/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/index.d.ts +0 -9
- package/dist/utils/services/translation/locales/nl/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/nl/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/pl/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/pl/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/pt/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/pt/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/ru/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/ru/order.d.ts +0 -1
- package/dist/utils/services/translation/locales/tr/index.d.ts +0 -1
- package/dist/utils/services/translation/locales/tr/order.d.ts +0 -1
- package/dist/utils/store/index.d.ts +1 -1
- package/dist/utils/store/order.d.ts +1 -1
- package/package.json +12 -11
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/modules/product/models.ts","../../../src/modules/product/utils/listing-price.ts","../../../src/modules/addon/models.ts","../../../src/modules/product/utils/order-price.ts","../../../src/modules/order/models.ts","../../../src/modules/order/constants.ts","../../../src/modules/order/utils/item-price.ts","../../../src/modules/customer/models.ts","../../../src/modules/feature/models.ts","../../../src/modules/feature/constants.ts","../../../src/modules/view/constants.ts","../../../src/modules/view/utils.ts","../../../src/modules/category/utils.ts","../../../src/modules/user/models.ts","../../../src/modules/order/utils.ts","../../../src/modules/customer/utils.ts","../../../src/modules/addon/utils.ts","../../../src/modules/user/utils.ts","../../../src/modules/feature/utils.ts","../../../src/modules/product/utils.ts","../../../src/modules/menu/utils.ts"],"sourcesContent":["import { MenuAddon } from \"../addon/models\";\n\nexport interface LocalizedContent {\n\tname: string;\n\tdescription: string;\n}\n\nexport interface ProductVariant {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied.\n\t */\n\tlistingPrice: number;\n\t/** Title keyed by language code, e.g. { en: \"Large\", az: \"Böyük\" }. */\n\ttitle: Record<string, string>;\n\tproductId?: number;\n\tremove?: boolean;\n}\n\nexport interface Product {\n\tid: number;\n\tcategoryId: number;\n\t/** Net price (tax-exclusive). Nullable when the product has no own price (variant-only). */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied,\n\t * and is null when `price` itself is null.\n\t */\n\tlistingPrice?: number | null;\n\tvolume?: string; // 100qr/250ml/1kq\n\timage160?: string;\n\timage580?: string;\n\timage1024?: string;\n\ttranslations: Record<string, LocalizedContent>;\n\tvariants: ProductVariant[];\n\taddons: MenuAddon[];\n\tavailable?: boolean;\n\tvisible?: boolean;\n\tposition?: number;\n\tvideoUrl?: string;\n\tsellUnitType?: SellUnitType;\n\ttaxClassId?: number | null;\n}\n\nexport enum ProductView {\n\tLIST = \"list\",\n\tGRID = \"grid\",\n}\n\nexport interface DashboardProduct extends Omit<Product, \"addons\"> {\n\taddons: number[];\n}\n\nexport enum SellUnitType {\n\tPIECE = \"PIECE\",\n\tWEIGHT = \"WEIGHT\",\n\tVOLUME = \"VOLUME\",\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { Product, ProductVariant } from \"../models\";\nimport { MenuAddonOption } from \"src/models\";\n\nexport const getUnitListingPrice = (item: {\n\tprice?: number | null;\n\tlistingPrice?: number | null;\n}) => item?.listingPrice ?? item?.price ?? 0;\n\nexport const getProductListingPrice = (product: Product, currency: string, language: string) => {\n\tconst listingPrice = getUnitListingPrice(product);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getVariantListingPrice = (\n\tvariant: ProductVariant,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(variant);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getOptionListingPrice = (\n\toption: MenuAddonOption,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(option);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n","export enum MenuAddonSelectType {\n\tSINGLE = \"SINGLE\",\n\tMULTIPLE = \"MULTIPLE\",\n}\n\nexport interface MenuAddonOption {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus the parent product's\n\t * `addToListingPrice` taxes. Equals `price` when no branch context is\n\t * supplied (e.g. addon detached from a branch tax setup).\n\t */\n\tlistingPrice: number;\n\ttitle: Record<string, string>;\n\tremove?: boolean;\n}\n\nexport interface MenuAddon {\n\tid?: number;\n\tselectType: MenuAddonSelectType;\n\toptions: MenuAddonOption[];\n\tbusinessId?: number;\n\ttitle: Record<string, string>;\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport { MenuAddonSelectType } from \"src/modules/addon/models\";\nimport * as orderModels from \"src/modules/order/models\";\n\nimport { Product } from \"../models\";\nimport { getUnitListingPrice } from \"./listing-price\";\n\nexport const getAllSelectedOptionsListingPrice = (\n\tproduct: Pick<Product, \"addons\">,\n\tselectedAddons: orderModels.SelectedAddons = {},\n): number => {\n\tlet total = 0;\n\n\tfor (const addon of product?.addons || []) {\n\t\tconst { id: addonId, selectType, options } = addon;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(selectedAddons, addonId)) continue;\n\n\t\tconst selection = selectedAddons[addonId];\n\t\tconst selectedOptionIds =\n\t\t\tselectType === MenuAddonSelectType.SINGLE\n\t\t\t\t? [selection as number]\n\t\t\t\t: ((selection || []) as number[]);\n\n\t\tfor (const optionId of selectedOptionIds) {\n\t\t\tconst option = (options || []).find(({ id }) => id === optionId);\n\t\t\tif (option) total += getUnitListingPrice(option);\n\t\t}\n\t}\n\n\treturn total;\n};\n\nexport const getProductOrderPrice = ({\n\tproduct,\n\tquantity,\n\tlanguage,\n\tcurrency,\n\tvariantId,\n\tselectedAddons,\n}: {\n\tproduct: Product;\n\tquantity: number;\n\tlanguage: string;\n\tcurrency: string;\n\tvariantId?: number;\n\tselectedAddons?: Record<number, number | number[]>;\n}) => {\n\tif (!product || Object.keys(product).length === 0) {\n\t\treturn priceFormatter(0, currency, language);\n\t}\n\n\tconst variant = variantId\n\t\t? (product.variants || []).find(({ id }) => id === variantId)\n\t\t: undefined;\n\n\tconst baseUnitPrice = variantId ? getUnitListingPrice(variant) : getUnitListingPrice(product);\n\tconst optionsUnitPrice = getAllSelectedOptionsListingPrice(product, selectedAddons);\n\n\tconst totalPrice = (baseUnitPrice + optionsUnitPrice) * quantity;\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","import * as customerModels from \"../customer/models\";\nimport * as productModels from \"../product/models\";\n\nexport enum OrderType {\n\tDINE_IN = \"DINE_IN\",\n\tPICK_UP = \"PICK_UP\",\n\tDELIVERY = \"DELIVERY\",\n}\n\nexport enum OrderStatus {\n\tDRAFT = \"DRAFT\",\n\tPENDING = \"PENDING\",\n\tCONFIRMED = \"CONFIRMED\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tOUT_FOR_DELIVERY = \"OUT_FOR_DELIVERY\",\n\tDELIVERED = \"DELIVERED\",\n\tCOMPLETED = \"COMPLETED\",\n\tCANCELLED = \"CANCELLED\",\n\tFAILED = \"FAILED\",\n}\n\nexport enum OrderItemStatus {\n\tPENDING = \"PENDING\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tSERVED = \"SERVED\",\n}\n\nexport enum PaymentMethod {\n\tCASH = \"CASH\",\n\tCARD = \"CARD\",\n\tWALLET = \"WALLET\",\n\tTERMINAL = \"TERMINAL\",\n}\n\nexport interface OrderAddonOption {\n\toptionId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderAddon {\n\tid?: number;\n\taddonId: number;\n\toptions: OrderAddonOption[];\n}\n\nexport interface SelectedAddons {\n\t[key: number]: number | number[];\n}\n\nexport interface OrderItemVariant {\n\tid?: number;\n\tvariantId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderItem {\n\tid?: number;\n\tproductId: number;\n\torderId?: number;\n\tquantity: number;\n\t/**\n\t * Gross unit price (listingPrice) at the moment the line was added. The\n\t * server recomputes authoritative totals on create/preview; this value is\n\t * what the cart UI displays.\n\t */\n\tprice?: number;\n\tvariant?: OrderItemVariant;\n\taddons: OrderAddon[];\n\tnote?: string;\n\tstatus?: OrderItemStatus;\n\tisPaid?: boolean;\n\tsellUnitType: productModels.SellUnitType;\n}\n\nexport interface Order {\n\tid?: number;\n\tbusinessId?: number;\n\tbranchId?: number;\n\tworkingDayId?: number;\n\ttableId?: number;\n\temployeeId?: number;\n\torderType: OrderType;\n\titems: OrderItem[];\n\tstatus?: OrderStatus;\n\tpaymentMethod?: PaymentMethod;\n\tnote?: string;\n\tcreatedAt?: number;\n\tupdatedAt?: number;\n\tcustomer?: customerModels.Customer;\n\tcurrency?: string;\n\ttrackingId?: string;\n}\n\nexport interface OrderItems {\n\t[key: string]: OrderItem;\n}\n\nexport enum OrderStep {\n\tCART = \"CART\",\n\tDETAILS = \"DETAILS\",\n\tCOMPLETED = \"COMPLETED\",\n}\n\nexport interface OrderPayload extends Order {\n\tcustomerAddressId: number;\n\tcustomerId: number;\n\tlanguage?: string;\n}\n\nexport interface CalculatePreviewItemRequest {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tvariant?: { variantId: number };\n\taddons?: Array<{\n\t\taddonId: number;\n\t\toptions: Array<{ optionId: number }>;\n\t}>;\n}\n\nexport interface CalculatePreviewRequest {\n\tbusinessId?: number;\n\tbranchId: number;\n\torderType: OrderType;\n\titems: CalculatePreviewItemRequest[];\n}\n\nexport interface CalculatePreviewTax {\n\tbranchTaxId: number;\n\tname: Record<string, string>;\n\trate: number;\n\ttype: \"percentage\" | \"fixed\";\n\taddToListingPrice: boolean;\n\tamount: number;\n}\n\nexport interface CalculatePreviewLine {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tprice: number;\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface CalculatePreviewResponse {\n\ttotalPriceWithoutTax: number;\n\ttotalPriceWithTax: number;\n\ttotalPriceWithTaxAndFees: number;\n\ttotalTax: number;\n\tdeliveryFee: number;\n\tserviceFee: number;\n\titems: CalculatePreviewLine[];\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface OrderPreviewState {\n\tdata: CalculatePreviewResponse | null;\n\tisLoading: boolean;\n\terror: string | null;\n}\n","import { OrderPreviewState, OrderStep, PaymentMethod } from \"./models\";\n\nexport const initialOrder = {\n\torderType: null,\n\tpaymentMethod: PaymentMethod.CASH,\n};\n\nexport const ORDER_STEPS = [OrderStep.CART, OrderStep.DETAILS, OrderStep.COMPLETED];\n\nexport const initialPreviewState: OrderPreviewState = {\n\tdata: null,\n\tisLoading: false,\n\terror: null,\n};\n\nexport enum OrderErrors {\n\tFIELD_REQUIRED_ERROR = \"This field is required\",\n\tTABLE_NOT_SELECTED = \"Please select a table\",\n\tADDRESS_IS_EMPTY = \"Please enter an address\",\n\tEMPTY_ITEMS = \"Please choose product\",\n\tBRANCH_NOT_SELECTED = \"Please select a branch\",\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { OrderItem } from \"../models\";\n\nexport const getOrderItemListingRawPrice = (orderItem: OrderItem) => {\n\tconst { price, variant, addons, quantity } = orderItem || {};\n\n\tconst baseUnitPrice = variant?.price ?? price ?? 0;\n\n\tconst addonsUnitPrice = (addons || []).reduce(\n\t\t(addonSum, addon) =>\n\t\t\taddonSum +\n\t\t\t(addon?.options || []).reduce((optionSum, option) => optionSum + (option?.price ?? 0), 0),\n\t\t0,\n\t);\n\n\tconst unitPrice = baseUnitPrice + addonsUnitPrice;\n\treturn unitPrice * (quantity ?? 1);\n};\n\nexport const getOrderItemListingPrice = (\n\torderItem: OrderItem,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst totalPrice = getOrderItemListingRawPrice(orderItem);\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","export enum CustomerAuthStep {\n\tPHONE = \"PHONE\",\n\tOTP = \"OTP\",\n\tEMAIL = \"EMAIL\",\n}\n\nexport enum CustomerAddressType {\n\tHOME = \"HOME\",\n\tWORK = \"WORK\",\n\tTRAVEL = \"TRAVEL\",\n}\n\nexport interface CustomerAddress {\n\tid?: number;\n\taddressId?: number; // Update address temporary\n\tcountryCode: string;\n\tcityName: string;\n\tstreet: string;\n\thouseNumber: string;\n\tadditionalNumber?: string;\n\tpostCode?: string;\n\tinstructions?: string;\n\tfloor?: number;\n\tlongitude?: number;\n\tlatitude?: number;\n\ttitle?: string;\n\ttype?: CustomerAddressType;\n}\n\nexport interface CustomerAuthForm {\n\totp: string;\n\temail: string;\n}\n\nexport interface CustomerAuthPhoneForm {\n\tcountryCode: string;\n\tphoneNumber: string;\n}\n\nexport interface AuthResponse {\n\taccessToken: string;\n\trefreshToken: string;\n}\n\nexport interface Customer {\n\tid?: number;\n\temail: string;\n\tphoneNumber: string;\n\tfullName: string;\n\tsmsVerified?: boolean;\n\temailVerified?: boolean;\n\taddress?: CustomerAddress;\n\taddresses?: CustomerAddress[];\n}\n\nexport type CustomerUpdatePayload = Partial<Customer>;\n","export enum Feature {\n\tUPLOAD_VIDEO = \"UPLOAD_VIDEO\",\n}\nexport enum FeatureSegment {\n\tALPHA = \"ALPHA\",\n\tBETA = \"BETA\",\n\tALL = \"ALL\",\n}\n","import { Feature, FeatureSegment } from \"./models\";\n\nexport const FEATURES_LIST: { [key in FeatureSegment]: Feature[] } = {\n\t[FeatureSegment.ALPHA]: [Feature.UPLOAD_VIDEO],\n\t[FeatureSegment.BETA]: [],\n\t[FeatureSegment.ALL]: [],\n};\n","export const MODALS = {\n\tADD_UPDATE_NOTES: \"ADD_UPDATE_NOTES\",\n\tAUTH: \"AUTH\",\n\tADD_UPDATE_ADDRESS: \"ADD_UPDATE_ADDRESS\",\n\tBRANCH_BUSINESS_HOURS: \"BRANCH_BUSINESS_HOURS\",\n\tPRODUCT_DETAILS: \"PRODUCT_DETAILS\",\n};\n\nexport const SUPPORTED_LOCALES = [\"en\", \"az\", \"nl\", \"et\", \"tr\", \"ru\", \"pl\", \"pt\", \"hr\"];\nexport const SUPPORTED_COUNTRIES = [\n\t{\n\t\tname: \"Azerbaijan\",\n\t\tcode: \"AZ\",\n\t\tphoneCode: \"+994\",\n\t},\n];\n\nexport const DOMAIN = \"tabres.com\";\n\nexport const DEFAULT_HOSTNAME = DOMAIN;\n\nexport const IMAGE_BASE_URL = \"https://images.tabres.com\";\n","import { DOMAIN, IMAGE_BASE_URL } from \"./constants\";\n\ninterface ValidationResult {\n\tisValid: boolean;\n\terror?: string;\n}\n\ntype Validator = (cleanedNumber: string) => ValidationResult;\n\nconst validators: Record<string, Validator> = {\n\t\"994\": (number) => {\n\t\tconst AZERBAIJANI_PREFIXES = [\"50\", \"51\", \"10\", \"55\", \"99\", \"70\", \"77\", \"60\"];\n\t\tconst pattern = new RegExp(`^(${AZERBAIJANI_PREFIXES.join(\"|\")})\\\\d{7}$`);\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: `Azerbaijani numbers must be 9 digits and start with ${AZERBAIJANI_PREFIXES.join(\n\t\t\t\t\t\", \"\n\t\t\t\t)}`,\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n\n\t\"31\": (number) => {\n\t\tconst pattern = /^\\d{9}$/;\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: \"Dutch numbers must be exactly 9 digits\",\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n};\n\nexport function validatePhoneNumber(phoneNumber: string): ValidationResult {\n\tif (!phoneNumber) {\n\t\treturn { isValid: false, error: \"FIELD_REQUIRED\" };\n\t}\n\n\tconst cleaned = phoneNumber.replace(/\\D/g, \"\");\n\n\tconst countryCode = cleaned.startsWith(\"994\") ? \"994\" : cleaned.startsWith(\"31\") ? \"31\" : null;\n\n\tif (!countryCode) {\n\t\treturn { isValid: false, error: \"Unsupported country code\" };\n\t}\n\n\tconst nationalNumber = cleaned.slice(countryCode.length);\n\tconst validator = validators[countryCode];\n\n\treturn validator(nationalNumber);\n}\n\nexport const getBaseUrl = (hostname: string, language: string) => {\n\tconst locale = language || \"en\";\n\t// Local env\n\tif (hostname === \"localhost:3000\") {\n\t\treturn { url: `http://localhost:3000/${locale}`, domain: DOMAIN };\n\t}\n\t// Prod env\n\treturn { url: `https://${DOMAIN}/${locale}`, domain: DOMAIN };\n};\n\nexport const getRegisterUrl = (language: string, source: string) => {\n\treturn `https://app.tabres.com/auth/register?lang=${language}&utm_source=${source}`;\n};\n\nexport const getImageSource = (image?: string) => {\n\tif (!image) return \"\";\n\n\tif (image.includes(\"base64\") || image.startsWith(\"https://\")) return image;\n\n\treturn `${IMAGE_BASE_URL}/${image}`;\n};\n\nexport const getLogoImageSource = (logoImage?: string) => {\n\tif (!logoImage) return \"https://images.tabres.com/no-photo-128.webp\";\n\n\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n};\n\nexport const getCoverPhotoSource = (coverPhoto?: string) => {\n\tif (!coverPhoto) return \"https://images.tabres.com/tabres-doodle.webp\";\n\n\tif (coverPhoto.includes(\"base64\") || coverPhoto.startsWith(\"https://\")) return coverPhoto;\n\n\treturn `${IMAGE_BASE_URL}/${coverPhoto}`;\n};\n\nconst keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\nconst triplet = (e1: number, e2: number, e3: number) =>\n\tkeyStr.charAt(e1 >> 2) +\n\tkeyStr.charAt(((e1 & 3) << 4) | (e2 >> 4)) +\n\tkeyStr.charAt(((e2 & 15) << 2) | (e3 >> 6)) +\n\tkeyStr.charAt(e3 & 63);\n\nexport const rgbDataURL = (r: number, g: number, b: number) =>\n\t`data:image/gif;base64,R0lGODlhAQABAPAA${\n\t\ttriplet(0, r, g) + triplet(b, 255, 255)\n\t}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`;\n\nexport const getVideoSource = (video?: string) => {\n\tif (!video) return \"\";\n\n\tif (video.includes(\"base64\") || video.startsWith(\"https://\")) return video;\n\n\treturn `${IMAGE_BASE_URL}/${video}`;\n};\n\nexport const adjustLightness = (hex: string, deltaPct: number) => {\n\tconst n = parseInt(hex.replace(\"#\", \"\"), 16);\n\tconst r = ((n >> 16) & 0xff) / 255;\n\tconst g = ((n >> 8) & 0xff) / 255;\n\tconst b = (n & 0xff) / 255;\n\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\tconst l = (max + min) / 2;\n\tlet h = 0;\n\tlet s = 0;\n\tif (max !== min) {\n\t\tconst d = max - min;\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t\tswitch (max) {\n\t\t\tcase r:\n\t\t\t\th = (g - b) / d + (g < b ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase g:\n\t\t\t\th = (b - r) / d + 2;\n\t\t\t\tbreak;\n\t\t\tcase b:\n\t\t\t\th = (r - g) / d + 4;\n\t\t\t\tbreak;\n\t\t}\n\t\th /= 6;\n\t}\n\n\tconst newL = Math.max(0, Math.min(1, l + deltaPct / 100));\n\n\tconst hueToRgb = (p: number, q: number, t: number) => {\n\t\tif (t < 0) t += 1;\n\t\tif (t > 1) t -= 1;\n\t\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\t\tif (t < 1 / 2) return q;\n\t\tif (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n\t\treturn p;\n\t};\n\n\tlet r2 = newL;\n\tlet g2 = newL;\n\tlet b2 = newL;\n\tif (s !== 0) {\n\t\tconst q = newL < 0.5 ? newL * (1 + s) : newL + s - newL * s;\n\t\tconst p = 2 * newL - q;\n\t\tr2 = hueToRgb(p, q, h + 1 / 3);\n\t\tg2 = hueToRgb(p, q, h);\n\t\tb2 = hueToRgb(p, q, h - 1 / 3);\n\t}\n\n\tconst toHex = (x: number) =>\n\t\tMath.round(x * 255)\n\t\t\t.toString(16)\n\t\t\t.padStart(2, \"0\");\n\treturn `#${toHex(r2)}${toHex(g2)}${toHex(b2)}`;\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\nimport { Category, CategoryTranslation } from \"./models\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n\nexport const getCategoryNameById = (\n\tcategoryId: number,\n\tcategories: Category[],\n\tlanguage: string\n): string => {\n\tconst category = categories?.find?.(({ id }) => id === categoryId);\n\n\tif (isEmpty(category)) return \"\";\n\n\tconst { name } = getCategoryTranslation(category, language);\n\n\treturn name || \"\";\n};\n","export enum EmployeePermission {\n\tVIEW_BUSINESS = \"VIEW_BUSINESS\",\n\tUPDATE_BUSINESS = \"UPDATE_BUSINESS\",\n\tVIEW_BUSINESS_FINANCIALS = \"VIEW_BUSINESS_FINANCIALS\",\n\tVIEW_ORDERS = \"VIEW_ORDERS\",\n\tUPDATE_ORDER = \"UPDATE_ORDER\",\n\tCREATE_ORDER = \"CREATE_ORDER\",\n\tAPPLY_DISCOUNT = \"APPLY_DISCOUNT\",\n\tVIEW_QR_MENU = \"VIEW_QR_MENU\",\n\tUPDATE_QR_MENU = \"UPDATE_QR_MENU\",\n\tVIEW_MENU = \"VIEW_MENU\",\n\tVIEW_MENU_ITEMS = \"VIEW_MENU_ITEMS\",\n\tCREATE_MENU_ITEM = \"CREATE_MENU_ITEM\",\n\tUPDATE_MENU_ITEM = \"UPDATE_MENU_ITEM\",\n\tDELETE_MENU_ITEM = \"DELETE_MENU_ITEM\",\n\tVIEW_CATEGORIES = \"VIEW_CATEGORIES\",\n\tUPDATE_CATEGORY = \"UPDATE_CATEGORY\",\n\tCREATE_CATEGORY = \"CREATE_CATEGORY\",\n\tDELETE_CATEGORY = \"DELETE_CATEGORY\",\n\tVIEW_ADDONS = \"VIEW_ADDONS\",\n\tUPDATE_ADDON = \"UPDATE_ADDON\",\n\tCREATE_ADDON = \"CREATE_ADDON\",\n\tDELETE_ADDON = \"DELETE_ADDON\",\n\tVIEW_TABLES = \"VIEW_TABLES\",\n\tUPDATE_TABLE = \"UPDATE_TABLE\",\n\tUPDATE_TABLE_STATUS = \"UPDATE_TABLE_STATUS\",\n\tCREATE_TABLE = \"CREATE_TABLE\",\n\tDELETE_TABLE = \"DELETE_TABLE\",\n\tVIEW_BRANCHES = \"VIEW_BRANCHES\",\n\tUPDATE_BRANCH = \"UPDATE_BRANCH\",\n\tCREATE_BRANCH = \"CREATE_BRANCH\",\n\tDELETE_BRANCH = \"DELETE_BRANCH\",\n\tVIEW_EMPLOYEES = \"VIEW_EMPLOYEES\",\n\tUPDATE_EMPLOYEE = \"UPDATE_EMPLOYEE\",\n\tCREATE_EMPLOYEE = \"CREATE_EMPLOYEE\",\n\tDELETE_EMPLOYEE = \"DELETE_EMPLOYEE\",\n\tVIEW_ANALYTICS = \"VIEW_ANALYTICS\",\n\tVIEW_SALES_REPORTS = \"VIEW_SALES_REPORTS\",\n\tVIEW_SUBSCRIPTION = \"VIEW_SUBSCRIPTION\",\n\tUPDATE_SUBSCRIPTION = \"UPDATE_SUBSCRIPTION\",\n\tVIEW_QR_CODES = \"VIEW_QR_CODES\",\n\tCREATE_QR_CODE = \"CREATE_QR_CODE\",\n\tDELETE_QR_CODE = \"DELETE_QR_CODE\",\n\tALL = \"ALL\",\n\t// Inventory\n\tVIEW_INVENTORY = \"VIEW_INVENTORY\",\n\tVIEW_PURCHASES = \"VIEW_PURCHASES\",\n\tVIEW_PURCHASE_DETAIL = \"VIEW_PURCHASE_DETAIL\",\n\tCREATE_PURCHASE = \"CREATE_PURCHASE\",\n\tUPDATE_PURCHASE = \"UPDATE_PURCHASE\",\n\tDELETE_PURCHASE = \"DELETE_PURCHASE\",\n\tVIEW_INVENTORY_PRODUCTS = \"VIEW_INVENTORY_PRODUCTS\",\n\tCREATE_INVENTORY_PRODUCT = \"CREATE_INVENTORY_PRODUCT\",\n\tUPDATE_INVENTORY_PRODUCT = \"UPDATE_INVENTORY_PRODUCT\",\n\tDELETE_INVENTORY_PRODUCT = \"DELETE_INVENTORY_PRODUCT\",\n\tVIEW_BUSINESS_BALANCE = \"VIEW_BUSINESS_BALANCE\",\n\tVIEW_BRANCH_BALANCE = \"VIEW_BRANCH_BALANCE\",\n\tUPDATE_PRODUCT_INGREDIENTS = \"UPDATE_PRODUCT_INGREDIENTS\",\n\tDELETE_PRODUCT_INGREDIENTS = \"DELETE_PRODUCT_INGREDIENTS\",\n\tAI_ASSISTANT = \"AI_ASSISTANT\",\n\tVIEW_PAYMENTS = \"VIEW_PAYMENTS\",\n\tTAKE_PAYMENT = \"TAKE_PAYMENT\",\n\tREFUND_PAYMENT = \"REFUND_PAYMENT\",\n\tPAYMENT_COMP = \"COMP\",\n}\n\nexport enum UserRole {\n\tOWNER = \"OWNER\",\n\tBRANCH_MANAGER = \"BRANCH_MANAGER\",\n\tGENERAL_MANAGER = \"GENERAL_MANAGER\",\n\tCHEF = \"CHEF\",\n\tSOUS_CHEF = \"SOUS_CHEF\",\n\tPASTRY_CHEF = \"PASTRY_CHEF\",\n\tLINE_COOK = \"LINE_COOK\",\n\tPREP_COOK = \"PREP_COOK\",\n\tKITCHEN_ASSISTANT = \"KITCHEN_ASSISTANT\",\n\tDISHWASHER = \"DISHWASHER\",\n\tHEAD_WAITER = \"HEAD_WAITER\",\n\tWAITER = \"WAITER\",\n\tRUNNER = \"RUNNER\",\n\tBARISTA = \"BARISTA\",\n\tBARTENDER = \"BARTENDER\",\n\tSOMMELIER = \"SOMMELIER\",\n\tACCOUNTANT = \"ACCOUNTANT\",\n\tROOM_SERVICE_STAFF = \"ROOM_SERVICE_STAFF\",\n\tDELIVERY_DRIVER = \"DELIVERY_DRIVER\",\n\tINVENTORY_MANAGER = \"INVENTORY_MANAGER\",\n\tPURCHASING_MANAGER = \"PURCHASING_MANAGER\",\n\tWAREHOUSE_STAFF = \"WAREHOUSE_STAFF\",\n\tCASHIER = \"CASHIER\"\n}\n\nexport interface User {\n\tid?: number;\n\temail: string;\n\tfullName: string;\n\trole?: UserRole;\n\tavatar64?: string | null;\n\tavatar128?: string | null;\n\tavatar256?: string | null;\n\tbusinessId?: number;\n\tbranchId?: number | null;\n\tcreatedAt: string;\n\temailVerified?: boolean;\n\tpermissions?: EmployeePermission[];\n}\n","import { isEmpty, sortNumbers } from \"@sorocraft/js-utils\";\nimport { IconType } from \"@sorocraft/ui\";\nimport { Check, BagCheck, Delivery, Chef, FileCheck, HourglassHalf } from \"@sorocraft/ui/icons\";\n\nimport {\n\tCalculatePreviewResponse,\n\tOrder,\n\tOrderAddon,\n\tOrderAddonOption,\n\tOrderItem,\n\tOrderStatus,\n\tOrderType,\n\tSelectedAddons,\n} from \"./models\";\n\nimport * as addonModels from \"../addon/models\";\nimport * as branchModels from \"../branch/models\";\nimport { OrderErrors } from \"./constants\";\n\nexport const generateOrderItemsId = (\n\tproductId: number,\n\tvariantId: number | null,\n\tselectedAddons?: SelectedAddons,\n): string => {\n\tif (!productId) throw new Error(\"Product ID is required\");\n\n\t// Build the order items ID base with productId and variantId\n\tlet orderItemsId = `${productId}`;\n\tif (variantId) {\n\t\torderItemsId += `-${variantId}`;\n\t}\n\n\t// Build the addon part of the ID\n\tconst addonIdsPart = Object.entries(selectedAddons || {})\n\t\t.map(([addonId, option]) => {\n\t\t\tif (!addonId || !option) return null; // Skip invalid entries\n\t\t\tconst optionIds = Array.isArray(option)\n\t\t\t\t? sortNumbers(option).filter(Boolean).join(\"-\")\n\t\t\t\t: `${option}`;\n\t\t\tif (!optionIds) return null;\n\t\t\treturn `${addonId}-${optionIds}`;\n\t\t})\n\t\t.filter(Boolean) // Remove null/undefined values\n\t\t.join(\"-\");\n\n\t// Append addonIdsPart if it's not empty\n\tif (addonIdsPart) {\n\t\torderItemsId += `-${addonIdsPart}`;\n\t}\n\n\treturn orderItemsId;\n};\n\nexport const getSelectedAddonsFromOrderItems = (item: OrderItem): SelectedAddons => {\n\tconst selectedAddons: SelectedAddons = {};\n\n\tfor (const { addonId, options = [] } of item.addons || []) {\n\t\tconst optionIds = options.map(({ optionId }) => optionId);\n\t\tselectedAddons[addonId] = optionIds.length === 1 ? optionIds[0] : optionIds;\n\t}\n\n\treturn selectedAddons;\n};\n\nexport const getStatusIcon = (status: OrderStatus): IconType => {\n\tswitch (status) {\n\t\tcase OrderStatus.COMPLETED:\n\t\t\treturn Check;\n\t\tcase OrderStatus.DELIVERED:\n\t\t\treturn BagCheck;\n\t\tcase OrderStatus.OUT_FOR_DELIVERY:\n\t\t\treturn Delivery;\n\t\tcase OrderStatus.PREPARING:\n\t\t\treturn Chef;\n\t\tcase OrderStatus.CONFIRMED:\n\t\t\treturn FileCheck;\n\t\tcase OrderStatus.PENDING:\n\t\t\treturn HourglassHalf;\n\n\t\tdefault:\n\t\t\treturn HourglassHalf;\n\t}\n};\n\nexport const buildSelectedAddonsPayload = (\n\tproductAddons: addonModels.MenuAddon[] = [],\n\tselectedAddons: SelectedAddons = {},\n): OrderAddon[] => {\n\treturn Object.entries(selectedAddons).map(([addonIdStr, selected]) => {\n\t\tconst addonId = Number(addonIdStr);\n\t\tconst selectedOptionIds = Array.isArray(selected) ? selected : [selected];\n\n\t\tconst addon = productAddons.find((addon) => addon.id === addonId);\n\t\tif (isEmpty(addon)) {\n\t\t\treturn {\n\t\t\t\taddonId,\n\t\t\t\toptions: [],\n\t\t\t};\n\t\t}\n\n\t\tconst options: OrderAddonOption[] = (addon.options || [])\n\t\t\t.filter((option) => selectedOptionIds.includes(option.id))\n\t\t\t.map((option) => ({\n\t\t\t\toptionId: option.id,\n\t\t\t\tprice: option.listingPrice ?? option.price,\n\t\t\t}));\n\n\t\treturn {\n\t\t\taddonId,\n\t\t\toptions,\n\t\t};\n\t});\n};\n\nexport const getDefaultOrderType = (\n\tsettings: branchModels.BranchSettings,\n\tisOpen: boolean,\n\tisDelivering: boolean,\n): OrderType | null => {\n\tif (!settings) return null;\n\n\tconst { deliveryOrderEnabled, dineInOrderEnabled, pickupOrderEnabled } = settings;\n\n\tif (deliveryOrderEnabled && isDelivering) {\n\t\treturn OrderType.DELIVERY;\n\t}\n\n\tif (dineInOrderEnabled && isOpen) {\n\t\treturn OrderType.DINE_IN;\n\t}\n\n\tif (pickupOrderEnabled && isOpen) {\n\t\treturn OrderType.PICK_UP;\n\t}\n\n\treturn null;\n};\n\n// Defensive shape check for the /order/calculate response. The service is\n// typed as CalculatePreviewResponse, but the network can return malformed\n// payloads (empty body, HTML error page) that would corrupt preview state\n// and break price-line lookups downstream.\nexport const isValidPreviewResponse = (data: unknown): data is CalculatePreviewResponse => {\n\tif (!data || typeof data !== \"object\") return false;\n\tconst d = data as Partial<CalculatePreviewResponse>;\n\treturn (\n\t\ttypeof d.totalPriceWithoutTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTaxAndFees === \"number\" &&\n\t\ttypeof d.totalTax === \"number\" &&\n\t\ttypeof d.deliveryFee === \"number\" &&\n\t\ttypeof d.serviceFee === \"number\" &&\n\t\tArray.isArray(d.items) &&\n\t\tArray.isArray(d.taxes)\n\t);\n};\n\nexport const getOrderErrorMessages = (field: keyof Order) => {\n\tswitch (field) {\n\t\tcase \"customer\":\n\t\t\treturn OrderErrors.ADDRESS_IS_EMPTY;\n\n\t\tcase \"tableId\":\n\t\t\treturn OrderErrors.TABLE_NOT_SELECTED;\n\n\t\tcase \"items\":\n\t\t\treturn OrderErrors.EMPTY_ITEMS;\n\n\t\tcase \"branchId\":\n\t\t\treturn OrderErrors.BRANCH_NOT_SELECTED;\n\n\t\tdefault:\n\t\t\treturn OrderErrors.FIELD_REQUIRED_ERROR;\n\t}\n};\n\nexport * from \"./utils/item-price\";\n","import { FormErrors } from \"@sorocraft/ui\";\nimport { checkIsValidEmail } from \"@sorocraft/js-utils\";\n\nimport {\n\tCustomerAddress,\n\tCustomerAuthForm,\n\tCustomerAuthPhoneForm,\n\tCustomerAuthStep,\n} from \"./models\";\n\nexport const preparePhoneNumber = (form: CustomerAuthPhoneForm) => {\n\tconst phoneNumber = `${form.countryCode}${form.phoneNumber}`.replaceAll(\"+\", \"\");\n\n\treturn phoneNumber;\n};\n\nexport const validateForm = (form: CustomerAuthForm, step: CustomerAuthStep): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { email, otp } = form || {};\n\n\tswitch (step) {\n\t\tcase CustomerAuthStep.OTP: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\n\t\t\tif (!otp || otp.length !== 6) {\n\t\t\t\terrors.otp = \"Invalid OTP\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase CustomerAuthStep.EMAIL: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn errors;\n};\n\nexport const validateAddressForm = (form: CustomerAddress): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { countryCode, cityName, street, houseNumber } = form || {};\n\n\tif (!countryCode) errors.countryCode = \"COUNTRY_REQUIRED\";\n\tif (!cityName) errors.cityName = \"CITY_REQUIRED\";\n\tif (!street) errors.street = \"STREET_REQUIRED\";\n\tif (!houseNumber) errors.houseNumber = \"STREET_NUMBER_REQUIRED\";\n\n\treturn errors;\n};\n\nexport const formatCityLine = (fields: (string | undefined)[]) => {\n\treturn (fields || []).filter(Boolean).join(\", \");\n};\n\nexport const formatAddressLine = (\n\tstreet: string,\n\thouseNumber: string,\n\tadditionalNumber: string,\n) => {\n\tconst house = [houseNumber, additionalNumber].filter(Boolean).join(\"/\");\n\tconst fullAddress = [street, house].filter(Boolean).join(\" \");\n\n\treturn fullAddress;\n};\n","import { MenuAddon, MenuAddonOption } from \"./models\";\n\nexport const getAddonTranslation = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n\nexport const getAddonOptionTranslation = (option: MenuAddonOption, language: string): string => {\n\treturn option?.title?.[language] || \"\";\n};\n\nexport const getOptionTitles = (\n\toptions: MenuAddonOption[],\n\toptionIds: number | number[],\n\tlanguage: string,\n): string => {\n\tif (Array.isArray(optionIds)) {\n\t\treturn (options || [])\n\t\t\t.filter(({ id }) => optionIds.includes(id))\n\t\t\t.map(({ title }) => title?.[language] || \"\")\n\t\t\t.filter(Boolean)\n\t\t\t.join(\", \");\n\t} else {\n\t\tconst option = (options || []).find(({ id }) => id === optionIds);\n\t\treturn option?.title?.[language] || \"\";\n\t}\n};\n\nexport const getAddonTitle = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\n\nimport { EmployeePermission, UserRole } from \"./models\";\n\nexport const getPermissionsByRole = (role?: UserRole) => {\n\tswitch (role) {\n\t\t/** Owner - Has every permission */\n\t\tcase UserRole.OWNER:\n\t\t\treturn [EmployeePermission.ALL];\n\n\t\t/** General Manager - All except subscription updates */\n\t\tcase UserRole.GENERAL_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.UPDATE_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_BRANCHES,\n\t\t\t\tEmployeePermission.UPDATE_BRANCH,\n\t\t\t\tEmployeePermission.CREATE_BRANCH,\n\t\t\t\tEmployeePermission.DELETE_BRANCH,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.CREATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.DELETE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Branch Manager - Controls operations within one branch */\n\t\tcase UserRole.BRANCH_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Chef - Manages menu and kitchen orders */\n\t\tcase UserRole.CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Sous Chef - Assists chef with orders and menu */\n\t\tcase UserRole.SOUS_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Pastry Chef - Limited to dessert menu items */\n\t\tcase UserRole.PASTRY_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Line Cook / Prep Cook / Kitchen Assistant - Read-only menu & order updates */\n\t\tcase UserRole.LINE_COOK:\n\t\tcase UserRole.PREP_COOK:\n\t\tcase UserRole.KITCHEN_ASSISTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Head Waiter - Full service control */\n\t\tcase UserRole.HEAD_WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t];\n\n\t\t/** Waiter - Handles orders and table service */\n\t\tcase UserRole.WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t];\n\n\t\t/** Runner - Sees and updates order delivery progress */\n\t\tcase UserRole.RUNNER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** ☕ Barista / Bartender / Sommelier / Room Service */\n\t\tcase UserRole.BARISTA:\n\t\tcase UserRole.BARTENDER:\n\t\tcase UserRole.SOMMELIER:\n\t\tcase UserRole.ROOM_SERVICE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Accountant - Analytics, reports, subscriptions */\n\t\tcase UserRole.ACCOUNTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t];\n\n\t\t/** Delivery Driver - Delivery orders only */\n\t\tcase UserRole.DELIVERY_DRIVER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** Inventory Manager - Controls menu stock-related items */\n\t\tcase UserRole.INVENTORY_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_PURCHASES,\n\t\t\t\tEmployeePermission.CREATE_PURCHASE,\n\t\t\t\tEmployeePermission.UPDATE_PURCHASE,\n\t\t\t\tEmployeePermission.DELETE_PURCHASE,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY_PRODUCTS,\n\t\t\t\tEmployeePermission.CREATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.UPDATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.DELETE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.VIEW_PURCHASE_DETAIL,\n\t\t\t\tEmployeePermission.VIEW_BRANCH_BALANCE,\n\t\t\t\tEmployeePermission.UPDATE_PRODUCT_INGREDIENTS,\n\t\t\t\tEmployeePermission.DELETE_PRODUCT_INGREDIENTS,\n\t\t\t];\n\n\t\t/** Purchasing Manager - Similar to inventory but more on creation/deletion */\n\t\tcase UserRole.PURCHASING_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t];\n\n\t\t/** Warehouse Staff - View only */\n\t\tcase UserRole.WAREHOUSE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t];\n\n\t\tdefault:\n\t\t\treturn [];\n\t}\n};\n\nexport const getHasUserPermission = (\n\trequiredPermissions: EmployeePermission[],\n\tuserPermissions: EmployeePermission[],\n) => {\n\tif (isEmpty(requiredPermissions)) return true;\n\tif (isEmpty(userPermissions)) return false;\n\tif (userPermissions.includes(EmployeePermission.ALL)) return true;\n\n\treturn requiredPermissions.some((permission) => userPermissions.includes(permission));\n};\n","import { getQueryParam } from \"@sorocraft/js-utils\";\n\nimport { FeatureSegment, type Feature } from \"./models\";\n\nimport { FEATURES_LIST } from \"./constants\";\n\nexport const getIsFeatureActive = (feature: Feature, businessSegment: FeatureSegment): boolean => {\n\t// Feature is force-enabled via query param\n\tif (getQueryParam(feature) === \"1\") return true;\n\n\t// Build the list of enabled segments for the current businessSegment\n\tconst enabledSegments: FeatureSegment[] =\n\t\tbusinessSegment === FeatureSegment.ALPHA\n\t\t\t? [FeatureSegment.ALPHA, FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: businessSegment === FeatureSegment.BETA\n\t\t\t? [FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: [FeatureSegment.ALL];\n\n\t// Check if feature exists in any of the enabled segments\n\treturn enabledSegments.some((segment) => FEATURES_LIST[segment]?.includes(feature));\n};\n","import { LocalizedContent, Product, ProductVariant, SellUnitType } from \"./models\";\n\nimport { MenuAddon } from \"src/modules/addon/models\";\n\nexport const getProductTranslation = (\n\tproduct: Pick<Product, \"translations\">,\n\tlanguage: string,\n): LocalizedContent => {\n\treturn product?.translations?.[language] || ({} as LocalizedContent);\n};\n\nexport const getProductVariant = (\n\tproduct: Pick<Product, \"variants\">,\n\tvariantId: number,\n): ProductVariant => {\n\treturn product?.variants?.find?.((item) => item.id === variantId) || ({} as ProductVariant);\n};\n\nexport const getProductVariantTranslation = (variant: ProductVariant, language: string): string => {\n\treturn variant?.title?.[language] || \"\";\n};\n\nexport const getProductAddon = (product: Product, addonId: number): MenuAddon => {\n\treturn (product?.addons || []).find(({ id }) => id === addonId) || ({} as MenuAddon);\n};\n\nexport const getPriceSuffix = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn \" / kg\";\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn \" / l\";\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n};\n\nexport const getProductSellUnitShortCuts = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn {\n\t\t\t\t\"50gr\": 0.05,\n\t\t\t\t\"100gr\": 0.1,\n\t\t\t\t\"150gr\": 0.15,\n\t\t\t\t\"200gr\": 0.2,\n\t\t\t\t\"250gr\": 0.25,\n\t\t\t\t\"300gr\": 0.3,\n\t\t\t\t\"350gr\": 0.35,\n\t\t\t\t\"400gr\": 0.4,\n\t\t\t\t\"450gr\": 0.45,\n\t\t\t\t\"500gr\": 0.5,\n\t\t\t\t\"600gr\": 0.6,\n\t\t\t\t\"700gr\": 0.7,\n\t\t\t\t\"750gr\": 0.75,\n\t\t\t\t\"800gr\": 0.8,\n\t\t\t\t\"850gr\": 0.85,\n\t\t\t\t\"900gr\": 0.9,\n\t\t\t\t\"950gr\": 0.95,\n\t\t\t\t\"1kg\": 1,\n\t\t\t\t\"2kg\": 2,\n\t\t\t\t\"5kg\": 5,\n\t\t\t\t\"10kg\": 10,\n\t\t\t\t\"20kg\": 20,\n\t\t\t};\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn {\n\t\t\t\t\"50ml\": 0.05,\n\t\t\t\t\"100ml\": 0.1,\n\t\t\t\t\"150ml\": 0.15,\n\t\t\t\t\"200ml\": 0.2,\n\t\t\t\t\"250ml\": 0.25,\n\t\t\t\t\"300ml\": 0.3,\n\t\t\t\t\"350ml\": 0.35,\n\t\t\t\t\"400ml\": 0.4,\n\t\t\t\t\"450ml\": 0.45,\n\t\t\t\t\"500ml\": 0.5,\n\t\t\t\t\"600ml\": 0.6,\n\t\t\t\t\"700ml\": 0.7,\n\t\t\t\t\"750ml\": 0.75,\n\t\t\t\t\"800ml\": 0.8,\n\t\t\t\t\"850ml\": 0.85,\n\t\t\t\t\"900ml\": 0.9,\n\t\t\t\t\"950ml\": 0.95,\n\t\t\t\t\"1l\": 1,\n\t\t\t\t\"2l\": 2,\n\t\t\t\t\"5l\": 5,\n\t\t\t\t\"10l\": 10,\n\t\t\t\t\"20l\": 20,\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {};\n\t}\n};\n\nexport * from \"./utils/listing-price\";\nexport * from \"./utils/order-price\";\n","import * as categoryModels from \"src/modules/category/models\";\nimport * as productModels from \"src/modules/product/models\";\n\nimport { CategoryProductMap } from \"./models\";\n\nexport const prepareCategoryAndProductMap = (\n\tcategories: categoryModels.Category[],\n\tproducts: productModels.Product[]\n): CategoryProductMap[] => {\n\tconst productMap = products.reduce<Record<number, productModels.Product[]>>((map, product) => {\n\t\tif (!product.visible) return map;\n\n\t\tconst categoryId = Number(product.categoryId);\n\t\tif (!map[categoryId]) {\n\t\t\tmap[categoryId] = [];\n\t\t}\n\t\tmap[categoryId].push(product);\n\t\treturn map;\n\t}, {});\n\n\treturn categories\n\t\t.map((category) => ({\n\t\t\t...category,\n\t\t\tproducts: (productMap[Number(category.id)] || []) as productModels.Product[],\n\t\t}))\n\t\t.filter((category) => category?.products?.length > 0);\n};\n"],"names":["ProductView","SellUnitType","getUnitListingPrice","item","_a","_b","listingPrice","price","MenuAddonSelectType","getAllSelectedOptionsListingPrice","product","selectedAddons","total","addon","addons","id","addonId","selectType","options","Object","prototype","hasOwnProperty","call","selection","selectedOptionIds","SINGLE","optionId","option","find","OrderType","OrderStatus","OrderItemStatus","PaymentMethod","OrderStep","OrderErrors","CASH","CART","DETAILS","COMPLETED","getOrderItemListingRawPrice","orderItem","variant","quantity","baseUnitPrice","addonsUnitPrice","reduce","addonSum","optionSum","CustomerAuthStep","CustomerAddressType","Feature","FeatureSegment","FEATURES_LIST","ALPHA","UPLOAD_VIDEO","BETA","ALL","DOMAIN","IMAGE_BASE_URL","validators","number","AZERBAIJANI_PREFIXES","RegExp","join","test","isValid","error","keyStr","triplet","e1","e2","e3","charAt","getCategoryTranslation","category","language","translations","EmployeePermission","UserRole","hex","deltaPct","n","parseInt","replace","r","g","b","max","Math","min","l","h","s","d","newL","hueToRgb","p","q","t","r2","g2","b2","toHex","x","round","toString","padStart","productAddons","entries","map","addonIdStr","selected","Number","Array","isArray","isEmpty","filter","includes","street","houseNumber","additionalNumber","Boolean","fields","productId","variantId","Error","orderItemsId","addonIdsPart","optionIds","sortNumbers","title","hostname","locale","url","domain","categoryId","categories","name","coverPhoto","startsWith","settings","isOpen","isDelivering","deliveryOrderEnabled","dineInOrderEnabled","pickupOrderEnabled","DELIVERY","DINE_IN","PICK_UP","requiredPermissions","userPermissions","some","permission","image","feature","businessSegment","getQueryParam","segment","logoImage","currency","priceFormatter","field","ADDRESS_IS_EMPTY","TABLE_NOT_SELECTED","EMPTY_ITEMS","BRANCH_NOT_SELECTED","FIELD_REQUIRED_ERROR","totalPrice","role","OWNER","GENERAL_MANAGER","VIEW_BUSINESS","UPDATE_BUSINESS","VIEW_ORDERS","UPDATE_ORDER","CREATE_ORDER","VIEW_QR_MENU","VIEW_QR_CODES","VIEW_MENU","VIEW_MENU_ITEMS","UPDATE_MENU_ITEM","CREATE_MENU_ITEM","DELETE_MENU_ITEM","VIEW_CATEGORIES","UPDATE_CATEGORY","CREATE_CATEGORY","DELETE_CATEGORY","VIEW_ADDONS","UPDATE_ADDON","CREATE_ADDON","DELETE_ADDON","VIEW_TABLES","UPDATE_TABLE","CREATE_TABLE","DELETE_TABLE","VIEW_BRANCHES","UPDATE_BRANCH","CREATE_BRANCH","DELETE_BRANCH","VIEW_EMPLOYEES","UPDATE_EMPLOYEE","CREATE_EMPLOYEE","DELETE_EMPLOYEE","VIEW_ANALYTICS","VIEW_SALES_REPORTS","VIEW_SUBSCRIPTION","CREATE_QR_CODE","DELETE_QR_CODE","AI_ASSISTANT","BRANCH_MANAGER","CHEF","SOUS_CHEF","PASTRY_CHEF","LINE_COOK","PREP_COOK","KITCHEN_ASSISTANT","HEAD_WAITER","UPDATE_TABLE_STATUS","WAITER","RUNNER","BARISTA","BARTENDER","SOMMELIER","ROOM_SERVICE_STAFF","ACCOUNTANT","DELIVERY_DRIVER","INVENTORY_MANAGER","VIEW_PURCHASES","CREATE_PURCHASE","UPDATE_PURCHASE","DELETE_PURCHASE","VIEW_INVENTORY","VIEW_INVENTORY_PRODUCTS","CREATE_INVENTORY_PRODUCT","UPDATE_INVENTORY_PRODUCT","DELETE_INVENTORY_PRODUCT","VIEW_PURCHASE_DETAIL","VIEW_BRANCH_BALANCE","UPDATE_PRODUCT_INGREDIENTS","DELETE_PRODUCT_INGREDIENTS","PURCHASING_MANAGER","WAREHOUSE_STAFF","sellUnitType","WEIGHT","VOLUME","keys","length","variants","undefined","source","status","Check","DELIVERED","BagCheck","OUT_FOR_DELIVERY","Delivery","PREPARING","Chef","CONFIRMED","FileCheck","PENDING","HourglassHalf","video","data","totalPriceWithoutTax","totalPriceWithTax","totalPriceWithTaxAndFees","totalTax","deliveryFee","serviceFee","items","taxes","products","productMap","visible","push","assign","form","countryCode","phoneNumber","replaceAll","errors","cityName","step","email","otp","OTP","checkIsValidEmail","EMAIL","cleaned","nationalNumber","slice","validator"],"mappings":"mFAgDA,IAAYA,EASAC,GATZ,SAAYD,GACXA,EAAA,KAAA,OACAA,EAAA,KAAA,MACA,CAHD,CAAYA,IAAAA,EAAW,CAAA,IASvB,SAAYC,GACXA,EAAA,MAAA,QACAA,EAAA,OAAA,SACAA,EAAA,OAAA,QACA,CAJD,CAAYA,IAAAA,EAAY,CAAA,ICrDjB,MAAMC,EAAuBC,IAG/B,IAAAC,EAAAC,EAAC,OAAiC,QAAjCA,EAAkB,QAAlBD,EAAAD,aAAI,EAAJA,EAAMG,oBAAY,IAAAF,EAAAA,EAAID,aAAI,EAAJA,EAAMI,aAAK,IAAAF,EAAAA,EAAI,GCP3C,IAAYG,GAAZ,SAAYA,GACXA,EAAA,OAAA,SACAA,EAAA,SAAA,UACA,CAHD,CAA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EAAAA,EAAEkP,QAAS,gCLflB+B,GACd,GAAGA,EAAKC,cAAcD,EAAKE,cAAcC,WAAW,IAAK,uBJ8FpD,CAACpM,EAAWC,EAAWC,IAChD,yCACClB,EAAQ,EAAGgB,EAAGC,GAAKjB,EAAQkB,EAAG,IAAK,uEI7DD+L,IACnC,MAAMI,EAAqB,CAAA,GACrBH,YAAEA,EAAWI,SAAEA,EAAQpK,OAAEA,EAAMC,YAAEA,GAAgB8J,GAAQ,CAAA,EAO/D,OALKC,IAAaG,EAAOH,YAAc,oBAClCI,IAAUD,EAAOC,SAAW,iBAC5BpK,IAAQmK,EAAOnK,OAAS,mBACxBC,IAAakK,EAAOlK,YAAc,0BAEhCkK,wBAvCoB,CAACJ,EAAwBM,KACpD,MAAMF,EAAqB,CAAA,GACrBG,MAAEA,EAAKC,IAAEA,GAAQR,GAAQ,CAAA,EAE/B,OAAQM,GACP,KAAK3O,EAAiB8O,IAChBF,GAAUG,EAAAA,kBAAkBH,KAChCH,EAAOG,MAAQ,yBAGXC,GAAsB,IAAfA,EAAIvC,SACfmC,EAAOI,IAAM,eAEd,MAGD,KAAK7O,EAAiBgP,MAChBJ,GAAUG,EAAAA,kBAAkBH,KAChCH,EAAOG,MAAQ,yBASlB,OAAOH,+BJHF,SAA8BF,GACnC,IAAKA,EACJ,MAAO,CAAEtN,SAAS,EAAOC,MAAO,kBAGjC,MAAM+N,EAAUV,EAAYpM,QAAQ,MAAO,IAErCmM,EAAcW,EAAQtJ,WAAW,OAAS,MAAQsJ,EAAQtJ,WAAW,MAAQ,KAAO,KAE1F,IAAK2I,EACJ,MAAO,CAAErN,SAAS,EAAOC,MAAO,4BAGjC,MAAMgO,EAAiBD,EAAQE,MAAMb,EAAYhC,QAGjD,OAAO8C,EAFWzO,EAAW2N,IAEZY,EAClB"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/modules/product/models.ts","../../../src/modules/product/utils/listing-price.ts","../../../src/modules/addon/models.ts","../../../src/modules/product/utils/order-price.ts","../../../src/modules/order/models.ts","../../../src/modules/order/constants.ts","../../../src/modules/order/utils/item-price.ts","../../../src/modules/customer/models.ts","../../../src/modules/feature/models.ts","../../../src/modules/feature/constants.ts","../../../src/modules/view/constants.ts","../../../src/modules/view/utils.ts","../../../src/modules/category/utils.ts","../../../src/modules/user/models.ts","../../../src/modules/order/utils.ts","../../../src/modules/customer/utils.ts","../../../src/modules/addon/utils.ts","../../../src/modules/user/utils.ts","../../../src/modules/feature/utils.ts","../../../src/modules/product/utils.ts","../../../src/modules/menu/utils.ts"],"sourcesContent":["import { MenuAddon } from \"../addon/models\";\n\nexport interface LocalizedContent {\n\tname: string;\n\tdescription: string;\n}\n\nexport interface ProductVariant {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied.\n\t */\n\tlistingPrice: number;\n\t/** Title keyed by language code, e.g. { en: \"Large\", az: \"Böyük\" }. */\n\ttitle: Record<string, string>;\n\tproductId?: number;\n\tremove?: boolean;\n}\n\nexport interface Product {\n\tid: number;\n\tcategoryId: number;\n\t/** Net price (tax-exclusive). Nullable when the product has no own price (variant-only). */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus any branch taxes flagged\n\t * `addToListingPrice`. Equals `price` when no branch context is supplied,\n\t * and is null when `price` itself is null.\n\t */\n\tlistingPrice?: number | null;\n\tvolume?: string; // 100qr/250ml/1kq\n\timage160?: string;\n\timage580?: string;\n\timage1024?: string;\n\ttranslations: Record<string, LocalizedContent>;\n\tvariants: ProductVariant[];\n\taddons: MenuAddon[];\n\tavailable?: boolean;\n\tvisible?: boolean;\n\tposition?: number;\n\tvideoUrl?: string;\n\tsellUnitType?: SellUnitType;\n\ttaxClassId?: number | null;\n}\n\nexport enum ProductView {\n\tLIST = \"list\",\n\tGRID = \"grid\",\n}\n\nexport interface DashboardProduct extends Omit<Product, \"addons\"> {\n\taddons: number[];\n}\n\nexport enum SellUnitType {\n\tPIECE = \"PIECE\",\n\tWEIGHT = \"WEIGHT\",\n\tVOLUME = \"VOLUME\",\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { Product, ProductVariant } from \"../models\";\nimport { MenuAddonOption } from \"src/models\";\n\nexport const getUnitListingPrice = (item: {\n\tprice?: number | null;\n\tlistingPrice?: number | null;\n}) => item?.listingPrice ?? item?.price ?? 0;\n\nexport const getProductListingPrice = (product: Product, currency: string, language: string) => {\n\tconst listingPrice = getUnitListingPrice(product);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getVariantListingPrice = (\n\tvariant: ProductVariant,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(variant);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n\nexport const getOptionListingPrice = (\n\toption: MenuAddonOption,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst listingPrice = getUnitListingPrice(option);\n\treturn priceFormatter(listingPrice, currency, language);\n};\n","export enum MenuAddonSelectType {\n\tSINGLE = \"SINGLE\",\n\tMULTIPLE = \"MULTIPLE\",\n}\n\nexport interface MenuAddonOption {\n\tid?: number;\n\t/** Net price (tax-exclusive) — server-of-record value. */\n\tprice: number;\n\t/**\n\t * Gross price for menu display: net price plus the parent product's\n\t * `addToListingPrice` taxes. Equals `price` when no branch context is\n\t * supplied (e.g. addon detached from a branch tax setup).\n\t */\n\tlistingPrice: number;\n\ttitle: Record<string, string>;\n\tremove?: boolean;\n}\n\nexport interface MenuAddon {\n\tid?: number;\n\tselectType: MenuAddonSelectType;\n\toptions: MenuAddonOption[];\n\tbusinessId?: number;\n\ttitle: Record<string, string>;\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport { MenuAddonSelectType } from \"src/modules/addon/models\";\nimport * as orderModels from \"src/modules/order/models\";\n\nimport { Product } from \"../models\";\nimport { getUnitListingPrice } from \"./listing-price\";\n\nexport const getAllSelectedOptionsListingPrice = (\n\tproduct: Pick<Product, \"addons\">,\n\tselectedAddons: orderModels.SelectedAddons = {},\n): number => {\n\tlet total = 0;\n\n\tfor (const addon of product?.addons || []) {\n\t\tconst { id: addonId, selectType, options } = addon;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(selectedAddons, addonId)) continue;\n\n\t\tconst selection = selectedAddons[addonId];\n\t\tconst selectedOptionIds =\n\t\t\tselectType === MenuAddonSelectType.SINGLE\n\t\t\t\t? [selection as number]\n\t\t\t\t: ((selection || []) as number[]);\n\n\t\tfor (const optionId of selectedOptionIds) {\n\t\t\tconst option = (options || []).find(({ id }) => id === optionId);\n\t\t\tif (option) total += getUnitListingPrice(option);\n\t\t}\n\t}\n\n\treturn total;\n};\n\nexport const getProductOrderPrice = ({\n\tproduct,\n\tquantity,\n\tlanguage,\n\tcurrency,\n\tvariantId,\n\tselectedAddons,\n}: {\n\tproduct: Product;\n\tquantity: number;\n\tlanguage: string;\n\tcurrency: string;\n\tvariantId?: number;\n\tselectedAddons?: Record<number, number | number[]>;\n}) => {\n\tif (!product || Object.keys(product).length === 0) {\n\t\treturn priceFormatter(0, currency, language);\n\t}\n\n\tconst variant = variantId\n\t\t? (product.variants || []).find(({ id }) => id === variantId)\n\t\t: undefined;\n\n\tconst baseUnitPrice = variantId ? getUnitListingPrice(variant) : getUnitListingPrice(product);\n\tconst optionsUnitPrice = getAllSelectedOptionsListingPrice(product, selectedAddons);\n\n\tconst totalPrice = (baseUnitPrice + optionsUnitPrice) * quantity;\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","import * as customerModels from \"../customer/models\";\nimport * as productModels from \"../product/models\";\n\nexport enum OrderType {\n\tDINE_IN = \"DINE_IN\",\n\tPICK_UP = \"PICK_UP\",\n\tDELIVERY = \"DELIVERY\",\n}\n\nexport enum OrderStatus {\n\tDRAFT = \"DRAFT\",\n\tPENDING = \"PENDING\",\n\tCONFIRMED = \"CONFIRMED\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tOUT_FOR_DELIVERY = \"OUT_FOR_DELIVERY\",\n\tDELIVERED = \"DELIVERED\",\n\tCOMPLETED = \"COMPLETED\",\n\tCANCELLED = \"CANCELLED\",\n\tFAILED = \"FAILED\",\n}\n\nexport enum OrderItemStatus {\n\tPENDING = \"PENDING\",\n\tPREPARING = \"PREPARING\",\n\tREADY = \"READY\",\n\tSERVED = \"SERVED\",\n}\n\nexport enum PaymentMethod {\n\tCASH = \"CASH\",\n\tCARD = \"CARD\",\n\tWALLET = \"WALLET\",\n\tTERMINAL = \"TERMINAL\",\n}\n\nexport interface OrderAddonOption {\n\toptionId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderAddon {\n\tid?: number;\n\taddonId: number;\n\toptions: OrderAddonOption[];\n}\n\nexport interface SelectedAddons {\n\t[key: number]: number | number[];\n}\n\nexport interface OrderItemVariant {\n\tid?: number;\n\tvariantId: number;\n\t/** Gross unit price (listingPrice from the menu listing). */\n\tprice: number;\n}\n\nexport interface OrderItem {\n\tid?: number;\n\tproductId: number;\n\torderId?: number;\n\tquantity: number;\n\t/**\n\t * Gross unit price (listingPrice) at the moment the line was added. The\n\t * server recomputes authoritative totals on create/preview; this value is\n\t * what the cart UI displays.\n\t */\n\tprice?: number;\n\tvariant?: OrderItemVariant;\n\taddons: OrderAddon[];\n\tnote?: string;\n\tstatus?: OrderItemStatus;\n\tisPaid?: boolean;\n\tsellUnitType: productModels.SellUnitType;\n}\n\nexport interface Order {\n\tid?: number;\n\tbusinessId?: number;\n\tbranchId?: number;\n\tworkingDayId?: number;\n\ttableId?: number;\n\temployeeId?: number;\n\torderType: OrderType;\n\titems: OrderItem[];\n\tstatus?: OrderStatus;\n\tpreferredPaymentMethod?: PaymentMethod;\n\tnote?: string;\n\tcreatedAt?: number;\n\tupdatedAt?: number;\n\tcustomer?: customerModels.Customer;\n\tcurrency?: string;\n\ttrackingId?: string;\n}\n\nexport interface OrderItems {\n\t[key: string]: OrderItem;\n}\n\nexport enum OrderStep {\n\tCART = \"CART\",\n\tDETAILS = \"DETAILS\",\n\tCOMPLETED = \"COMPLETED\",\n}\n\nexport interface OrderPayload extends Order {\n\tcustomerAddressId: number;\n\tcustomerId: number;\n\tlanguage?: string;\n}\n\nexport interface CalculatePreviewItemRequest {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tvariant?: { variantId: number };\n\taddons?: Array<{\n\t\taddonId: number;\n\t\toptions: Array<{ optionId: number }>;\n\t}>;\n}\n\nexport interface CalculatePreviewRequest {\n\tbusinessId?: number;\n\tbranchId: number;\n\torderType: OrderType;\n\titems: CalculatePreviewItemRequest[];\n}\n\nexport interface CalculatePreviewTax {\n\tbranchTaxId: number;\n\tname: Record<string, string>;\n\trate: number;\n\ttype: \"percentage\" | \"fixed\";\n\taddToListingPrice: boolean;\n\tamount: number;\n}\n\nexport interface CalculatePreviewLine {\n\torderItemsId: string;\n\tproductId: number;\n\tquantity: number;\n\tprice: number;\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface CalculatePreviewResponse {\n\ttotalPriceWithoutTax: number;\n\ttotalPriceWithTax: number;\n\ttotalPriceWithTaxAndFees: number;\n\ttotalTax: number;\n\tdeliveryFee: number;\n\tserviceFee: number;\n\titems: CalculatePreviewLine[];\n\ttaxes: CalculatePreviewTax[];\n}\n\nexport interface OrderPreviewState {\n\tdata: CalculatePreviewResponse | null;\n\tisLoading: boolean;\n\terror: string | null;\n}\n","import { OrderPreviewState, OrderStep, PaymentMethod } from \"./models\";\n\nexport const initialOrder = {\n\torderType: null,\n\tpreferredPaymentMethod: PaymentMethod.CASH,\n};\n\nexport const ORDER_STEPS = [OrderStep.CART, OrderStep.DETAILS, OrderStep.COMPLETED];\n\nexport const initialPreviewState: OrderPreviewState = {\n\tdata: null,\n\tisLoading: false,\n\terror: null,\n};\n\nexport enum OrderErrors {\n\tFIELD_REQUIRED_ERROR = \"This field is required\",\n\tTABLE_NOT_SELECTED = \"Please select a table\",\n\tADDRESS_IS_EMPTY = \"Please enter an address\",\n\tEMPTY_ITEMS = \"Please choose product\",\n\tBRANCH_NOT_SELECTED = \"Please select a branch\",\n}\n","import { priceFormatter } from \"@sorocraft/js-utils\";\nimport { OrderItem } from \"../models\";\n\nexport const getOrderItemListingRawPrice = (orderItem: OrderItem) => {\n\tconst { price, variant, addons, quantity } = orderItem || {};\n\n\tconst baseUnitPrice = variant?.price ?? price ?? 0;\n\n\tconst addonsUnitPrice = (addons || []).reduce(\n\t\t(addonSum, addon) =>\n\t\t\taddonSum +\n\t\t\t(addon?.options || []).reduce((optionSum, option) => optionSum + (option?.price ?? 0), 0),\n\t\t0,\n\t);\n\n\tconst unitPrice = baseUnitPrice + addonsUnitPrice;\n\treturn unitPrice * (quantity ?? 1);\n};\n\nexport const getOrderItemListingPrice = (\n\torderItem: OrderItem,\n\tcurrency: string,\n\tlanguage: string,\n) => {\n\tconst totalPrice = getOrderItemListingRawPrice(orderItem);\n\n\treturn priceFormatter(totalPrice, currency, language);\n};\n","export enum CustomerAuthStep {\n\tPHONE = \"PHONE\",\n\tOTP = \"OTP\",\n\tEMAIL = \"EMAIL\",\n}\n\nexport enum CustomerAddressType {\n\tHOME = \"HOME\",\n\tWORK = \"WORK\",\n\tTRAVEL = \"TRAVEL\",\n}\n\nexport interface CustomerAddress {\n\tid?: number;\n\taddressId?: number; // Update address temporary\n\tcountryCode: string;\n\tcityName: string;\n\tstreet: string;\n\thouseNumber: string;\n\tadditionalNumber?: string;\n\tpostCode?: string;\n\tinstructions?: string;\n\tfloor?: number;\n\tlongitude?: number;\n\tlatitude?: number;\n\ttitle?: string;\n\ttype?: CustomerAddressType;\n}\n\nexport interface CustomerAuthForm {\n\totp: string;\n\temail: string;\n}\n\nexport interface CustomerAuthPhoneForm {\n\tcountryCode: string;\n\tphoneNumber: string;\n}\n\nexport interface AuthResponse {\n\taccessToken: string;\n\trefreshToken: string;\n}\n\nexport interface Customer {\n\tid?: number;\n\temail: string;\n\tphoneNumber: string;\n\tfullName: string;\n\tsmsVerified?: boolean;\n\temailVerified?: boolean;\n\taddress?: CustomerAddress;\n\taddresses?: CustomerAddress[];\n}\n\nexport type CustomerUpdatePayload = Partial<Customer>;\n","export enum Feature {\n\tUPLOAD_VIDEO = \"UPLOAD_VIDEO\",\n}\nexport enum FeatureSegment {\n\tALPHA = \"ALPHA\",\n\tBETA = \"BETA\",\n\tALL = \"ALL\",\n}\n","import { Feature, FeatureSegment } from \"./models\";\n\nexport const FEATURES_LIST: { [key in FeatureSegment]: Feature[] } = {\n\t[FeatureSegment.ALPHA]: [Feature.UPLOAD_VIDEO],\n\t[FeatureSegment.BETA]: [],\n\t[FeatureSegment.ALL]: [],\n};\n","export const MODALS = {\n\tADD_UPDATE_NOTES: \"ADD_UPDATE_NOTES\",\n\tAUTH: \"AUTH\",\n\tADD_UPDATE_ADDRESS: \"ADD_UPDATE_ADDRESS\",\n\tBRANCH_BUSINESS_HOURS: \"BRANCH_BUSINESS_HOURS\",\n\tPRODUCT_DETAILS: \"PRODUCT_DETAILS\",\n};\n\nexport const SUPPORTED_LOCALES = [\"en\", \"az\", \"nl\", \"et\", \"tr\", \"ru\", \"pl\", \"pt\", \"hr\"];\nexport const SUPPORTED_COUNTRIES = [\n\t{\n\t\tname: \"Azerbaijan\",\n\t\tcode: \"AZ\",\n\t\tphoneCode: \"+994\",\n\t},\n];\n\nexport const DOMAIN = \"tabres.com\";\n\nexport const DEFAULT_HOSTNAME = DOMAIN;\n\nexport const IMAGE_BASE_URL = \"https://images.tabres.com\";\n","import { DOMAIN, IMAGE_BASE_URL } from \"./constants\";\n\ninterface ValidationResult {\n\tisValid: boolean;\n\terror?: string;\n}\n\ntype Validator = (cleanedNumber: string) => ValidationResult;\n\nconst validators: Record<string, Validator> = {\n\t\"994\": (number) => {\n\t\tconst AZERBAIJANI_PREFIXES = [\"50\", \"51\", \"10\", \"55\", \"99\", \"70\", \"77\", \"60\"];\n\t\tconst pattern = new RegExp(`^(${AZERBAIJANI_PREFIXES.join(\"|\")})\\\\d{7}$`);\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: `Azerbaijani numbers must be 9 digits and start with ${AZERBAIJANI_PREFIXES.join(\n\t\t\t\t\t\", \"\n\t\t\t\t)}`,\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n\n\t\"31\": (number) => {\n\t\tconst pattern = /^\\d{9}$/;\n\n\t\tif (!pattern.test(number)) {\n\t\t\treturn {\n\t\t\t\tisValid: false,\n\t\t\t\terror: \"Dutch numbers must be exactly 9 digits\",\n\t\t\t};\n\t\t}\n\n\t\treturn { isValid: true };\n\t},\n};\n\nexport function validatePhoneNumber(phoneNumber: string): ValidationResult {\n\tif (!phoneNumber) {\n\t\treturn { isValid: false, error: \"FIELD_REQUIRED\" };\n\t}\n\n\tconst cleaned = phoneNumber.replace(/\\D/g, \"\");\n\n\tconst countryCode = cleaned.startsWith(\"994\") ? \"994\" : cleaned.startsWith(\"31\") ? \"31\" : null;\n\n\tif (!countryCode) {\n\t\treturn { isValid: false, error: \"Unsupported country code\" };\n\t}\n\n\tconst nationalNumber = cleaned.slice(countryCode.length);\n\tconst validator = validators[countryCode];\n\n\treturn validator(nationalNumber);\n}\n\nexport const getBaseUrl = (hostname: string, language: string) => {\n\tconst locale = language || \"en\";\n\t// Local env\n\tif (hostname === \"localhost:3000\") {\n\t\treturn { url: `http://localhost:3000/${locale}`, domain: DOMAIN };\n\t}\n\t// Prod env\n\treturn { url: `https://${DOMAIN}/${locale}`, domain: DOMAIN };\n};\n\nexport const getRegisterUrl = (language: string, source: string) => {\n\treturn `https://app.tabres.com/auth/register?lang=${language}&utm_source=${source}`;\n};\n\nexport const getImageSource = (image?: string) => {\n\tif (!image) return \"\";\n\n\tif (image.includes(\"base64\") || image.startsWith(\"https://\")) return image;\n\n\treturn `${IMAGE_BASE_URL}/${image}`;\n};\n\nexport const getLogoImageSource = (logoImage?: string) => {\n\tif (!logoImage) return \"https://images.tabres.com/no-photo-128.webp\";\n\n\tif (logoImage.includes(\"base64\") || logoImage.startsWith(\"https://\")) return logoImage;\n\n\treturn `${IMAGE_BASE_URL}/${logoImage}`;\n};\n\nexport const getCoverPhotoSource = (coverPhoto?: string) => {\n\tif (!coverPhoto) return \"https://images.tabres.com/tabres-doodle.webp\";\n\n\tif (coverPhoto.includes(\"base64\") || coverPhoto.startsWith(\"https://\")) return coverPhoto;\n\n\treturn `${IMAGE_BASE_URL}/${coverPhoto}`;\n};\n\nconst keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\nconst triplet = (e1: number, e2: number, e3: number) =>\n\tkeyStr.charAt(e1 >> 2) +\n\tkeyStr.charAt(((e1 & 3) << 4) | (e2 >> 4)) +\n\tkeyStr.charAt(((e2 & 15) << 2) | (e3 >> 6)) +\n\tkeyStr.charAt(e3 & 63);\n\nexport const rgbDataURL = (r: number, g: number, b: number) =>\n\t`data:image/gif;base64,R0lGODlhAQABAPAA${\n\t\ttriplet(0, r, g) + triplet(b, 255, 255)\n\t}/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`;\n\nexport const getVideoSource = (video?: string) => {\n\tif (!video) return \"\";\n\n\tif (video.includes(\"base64\") || video.startsWith(\"https://\")) return video;\n\n\treturn `${IMAGE_BASE_URL}/${video}`;\n};\n\nexport const adjustLightness = (hex: string, deltaPct: number) => {\n\tconst n = parseInt(hex.replace(\"#\", \"\"), 16);\n\tconst r = ((n >> 16) & 0xff) / 255;\n\tconst g = ((n >> 8) & 0xff) / 255;\n\tconst b = (n & 0xff) / 255;\n\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\tconst l = (max + min) / 2;\n\tlet h = 0;\n\tlet s = 0;\n\tif (max !== min) {\n\t\tconst d = max - min;\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t\tswitch (max) {\n\t\t\tcase r:\n\t\t\t\th = (g - b) / d + (g < b ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase g:\n\t\t\t\th = (b - r) / d + 2;\n\t\t\t\tbreak;\n\t\t\tcase b:\n\t\t\t\th = (r - g) / d + 4;\n\t\t\t\tbreak;\n\t\t}\n\t\th /= 6;\n\t}\n\n\tconst newL = Math.max(0, Math.min(1, l + deltaPct / 100));\n\n\tconst hueToRgb = (p: number, q: number, t: number) => {\n\t\tif (t < 0) t += 1;\n\t\tif (t > 1) t -= 1;\n\t\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\t\tif (t < 1 / 2) return q;\n\t\tif (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n\t\treturn p;\n\t};\n\n\tlet r2 = newL;\n\tlet g2 = newL;\n\tlet b2 = newL;\n\tif (s !== 0) {\n\t\tconst q = newL < 0.5 ? newL * (1 + s) : newL + s - newL * s;\n\t\tconst p = 2 * newL - q;\n\t\tr2 = hueToRgb(p, q, h + 1 / 3);\n\t\tg2 = hueToRgb(p, q, h);\n\t\tb2 = hueToRgb(p, q, h - 1 / 3);\n\t}\n\n\tconst toHex = (x: number) =>\n\t\tMath.round(x * 255)\n\t\t\t.toString(16)\n\t\t\t.padStart(2, \"0\");\n\treturn `#${toHex(r2)}${toHex(g2)}${toHex(b2)}`;\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\nimport { Category, CategoryTranslation } from \"./models\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n\nexport const getCategoryNameById = (\n\tcategoryId: number,\n\tcategories: Category[],\n\tlanguage: string\n): string => {\n\tconst category = categories?.find?.(({ id }) => id === categoryId);\n\n\tif (isEmpty(category)) return \"\";\n\n\tconst { name } = getCategoryTranslation(category, language);\n\n\treturn name || \"\";\n};\n","export enum EmployeePermission {\n\tVIEW_BUSINESS = \"VIEW_BUSINESS\",\n\tUPDATE_BUSINESS = \"UPDATE_BUSINESS\",\n\tVIEW_BUSINESS_FINANCIALS = \"VIEW_BUSINESS_FINANCIALS\",\n\tVIEW_ORDERS = \"VIEW_ORDERS\",\n\tUPDATE_ORDER = \"UPDATE_ORDER\",\n\tCREATE_ORDER = \"CREATE_ORDER\",\n\tAPPLY_DISCOUNT = \"APPLY_DISCOUNT\",\n\tVIEW_QR_MENU = \"VIEW_QR_MENU\",\n\tUPDATE_QR_MENU = \"UPDATE_QR_MENU\",\n\tVIEW_MENU = \"VIEW_MENU\",\n\tVIEW_MENU_ITEMS = \"VIEW_MENU_ITEMS\",\n\tCREATE_MENU_ITEM = \"CREATE_MENU_ITEM\",\n\tUPDATE_MENU_ITEM = \"UPDATE_MENU_ITEM\",\n\tDELETE_MENU_ITEM = \"DELETE_MENU_ITEM\",\n\tVIEW_CATEGORIES = \"VIEW_CATEGORIES\",\n\tUPDATE_CATEGORY = \"UPDATE_CATEGORY\",\n\tCREATE_CATEGORY = \"CREATE_CATEGORY\",\n\tDELETE_CATEGORY = \"DELETE_CATEGORY\",\n\tVIEW_ADDONS = \"VIEW_ADDONS\",\n\tUPDATE_ADDON = \"UPDATE_ADDON\",\n\tCREATE_ADDON = \"CREATE_ADDON\",\n\tDELETE_ADDON = \"DELETE_ADDON\",\n\tVIEW_TABLES = \"VIEW_TABLES\",\n\tUPDATE_TABLE = \"UPDATE_TABLE\",\n\tUPDATE_TABLE_STATUS = \"UPDATE_TABLE_STATUS\",\n\tCREATE_TABLE = \"CREATE_TABLE\",\n\tDELETE_TABLE = \"DELETE_TABLE\",\n\tVIEW_BRANCHES = \"VIEW_BRANCHES\",\n\tUPDATE_BRANCH = \"UPDATE_BRANCH\",\n\tCREATE_BRANCH = \"CREATE_BRANCH\",\n\tDELETE_BRANCH = \"DELETE_BRANCH\",\n\tVIEW_EMPLOYEES = \"VIEW_EMPLOYEES\",\n\tUPDATE_EMPLOYEE = \"UPDATE_EMPLOYEE\",\n\tCREATE_EMPLOYEE = \"CREATE_EMPLOYEE\",\n\tDELETE_EMPLOYEE = \"DELETE_EMPLOYEE\",\n\tVIEW_ANALYTICS = \"VIEW_ANALYTICS\",\n\tVIEW_SALES_REPORTS = \"VIEW_SALES_REPORTS\",\n\tVIEW_SUBSCRIPTION = \"VIEW_SUBSCRIPTION\",\n\tUPDATE_SUBSCRIPTION = \"UPDATE_SUBSCRIPTION\",\n\tVIEW_QR_CODES = \"VIEW_QR_CODES\",\n\tCREATE_QR_CODE = \"CREATE_QR_CODE\",\n\tDELETE_QR_CODE = \"DELETE_QR_CODE\",\n\tALL = \"ALL\",\n\t// Inventory\n\tVIEW_INVENTORY = \"VIEW_INVENTORY\",\n\tVIEW_PURCHASES = \"VIEW_PURCHASES\",\n\tVIEW_PURCHASE_DETAIL = \"VIEW_PURCHASE_DETAIL\",\n\tCREATE_PURCHASE = \"CREATE_PURCHASE\",\n\tUPDATE_PURCHASE = \"UPDATE_PURCHASE\",\n\tDELETE_PURCHASE = \"DELETE_PURCHASE\",\n\tVIEW_INVENTORY_PRODUCTS = \"VIEW_INVENTORY_PRODUCTS\",\n\tCREATE_INVENTORY_PRODUCT = \"CREATE_INVENTORY_PRODUCT\",\n\tUPDATE_INVENTORY_PRODUCT = \"UPDATE_INVENTORY_PRODUCT\",\n\tDELETE_INVENTORY_PRODUCT = \"DELETE_INVENTORY_PRODUCT\",\n\tVIEW_BUSINESS_BALANCE = \"VIEW_BUSINESS_BALANCE\",\n\tVIEW_BRANCH_BALANCE = \"VIEW_BRANCH_BALANCE\",\n\tUPDATE_PRODUCT_INGREDIENTS = \"UPDATE_PRODUCT_INGREDIENTS\",\n\tDELETE_PRODUCT_INGREDIENTS = \"DELETE_PRODUCT_INGREDIENTS\",\n\tAI_ASSISTANT = \"AI_ASSISTANT\",\n\tVIEW_PAYMENTS = \"VIEW_PAYMENTS\",\n\tTAKE_PAYMENT = \"TAKE_PAYMENT\",\n\tREFUND_PAYMENT = \"REFUND_PAYMENT\",\n\tPAYMENT_COMP = \"COMP\",\n}\n\nexport enum UserRole {\n\tOWNER = \"OWNER\",\n\tBRANCH_MANAGER = \"BRANCH_MANAGER\",\n\tGENERAL_MANAGER = \"GENERAL_MANAGER\",\n\tCHEF = \"CHEF\",\n\tSOUS_CHEF = \"SOUS_CHEF\",\n\tPASTRY_CHEF = \"PASTRY_CHEF\",\n\tLINE_COOK = \"LINE_COOK\",\n\tPREP_COOK = \"PREP_COOK\",\n\tKITCHEN_ASSISTANT = \"KITCHEN_ASSISTANT\",\n\tDISHWASHER = \"DISHWASHER\",\n\tHEAD_WAITER = \"HEAD_WAITER\",\n\tWAITER = \"WAITER\",\n\tRUNNER = \"RUNNER\",\n\tBARISTA = \"BARISTA\",\n\tBARTENDER = \"BARTENDER\",\n\tSOMMELIER = \"SOMMELIER\",\n\tACCOUNTANT = \"ACCOUNTANT\",\n\tROOM_SERVICE_STAFF = \"ROOM_SERVICE_STAFF\",\n\tDELIVERY_DRIVER = \"DELIVERY_DRIVER\",\n\tINVENTORY_MANAGER = \"INVENTORY_MANAGER\",\n\tPURCHASING_MANAGER = \"PURCHASING_MANAGER\",\n\tWAREHOUSE_STAFF = \"WAREHOUSE_STAFF\",\n\tCASHIER = \"CASHIER\"\n}\n\nexport interface User {\n\tid?: number;\n\temail: string;\n\tfullName: string;\n\trole?: UserRole;\n\tavatar64?: string | null;\n\tavatar128?: string | null;\n\tavatar256?: string | null;\n\tbusinessId?: number;\n\tbranchId?: number | null;\n\tcreatedAt: string;\n\temailVerified?: boolean;\n\tpermissions?: EmployeePermission[];\n}\n","import { isEmpty, sortNumbers } from \"@sorocraft/js-utils\";\nimport { IconType } from \"@sorocraft/ui\";\nimport { Check, BagCheck, Delivery, Chef, FileCheck, HourglassHalf } from \"@sorocraft/ui/icons\";\n\nimport {\n\tCalculatePreviewResponse,\n\tOrder,\n\tOrderAddon,\n\tOrderAddonOption,\n\tOrderItem,\n\tOrderStatus,\n\tOrderType,\n\tSelectedAddons,\n} from \"./models\";\n\nimport * as addonModels from \"../addon/models\";\nimport * as branchModels from \"../branch/models\";\nimport { OrderErrors } from \"./constants\";\n\nexport const generateOrderItemsId = (\n\tproductId: number,\n\tvariantId: number | null,\n\tselectedAddons?: SelectedAddons,\n): string => {\n\tif (!productId) throw new Error(\"Product ID is required\");\n\n\t// Build the order items ID base with productId and variantId\n\tlet orderItemsId = `${productId}`;\n\tif (variantId) {\n\t\torderItemsId += `-${variantId}`;\n\t}\n\n\t// Build the addon part of the ID\n\tconst addonIdsPart = Object.entries(selectedAddons || {})\n\t\t.map(([addonId, option]) => {\n\t\t\tif (!addonId || !option) return null; // Skip invalid entries\n\t\t\tconst optionIds = Array.isArray(option)\n\t\t\t\t? sortNumbers(option).filter(Boolean).join(\"-\")\n\t\t\t\t: `${option}`;\n\t\t\tif (!optionIds) return null;\n\t\t\treturn `${addonId}-${optionIds}`;\n\t\t})\n\t\t.filter(Boolean) // Remove null/undefined values\n\t\t.join(\"-\");\n\n\t// Append addonIdsPart if it's not empty\n\tif (addonIdsPart) {\n\t\torderItemsId += `-${addonIdsPart}`;\n\t}\n\n\treturn orderItemsId;\n};\n\nexport const getSelectedAddonsFromOrderItems = (item: OrderItem): SelectedAddons => {\n\tconst selectedAddons: SelectedAddons = {};\n\n\tfor (const { addonId, options = [] } of item.addons || []) {\n\t\tconst optionIds = options.map(({ optionId }) => optionId);\n\t\tselectedAddons[addonId] = optionIds.length === 1 ? optionIds[0] : optionIds;\n\t}\n\n\treturn selectedAddons;\n};\n\nexport const getStatusIcon = (status: OrderStatus): IconType => {\n\tswitch (status) {\n\t\tcase OrderStatus.COMPLETED:\n\t\t\treturn Check;\n\t\tcase OrderStatus.DELIVERED:\n\t\t\treturn BagCheck;\n\t\tcase OrderStatus.OUT_FOR_DELIVERY:\n\t\t\treturn Delivery;\n\t\tcase OrderStatus.PREPARING:\n\t\t\treturn Chef;\n\t\tcase OrderStatus.CONFIRMED:\n\t\t\treturn FileCheck;\n\t\tcase OrderStatus.PENDING:\n\t\t\treturn HourglassHalf;\n\n\t\tdefault:\n\t\t\treturn HourglassHalf;\n\t}\n};\n\nexport const buildSelectedAddonsPayload = (\n\tproductAddons: addonModels.MenuAddon[] = [],\n\tselectedAddons: SelectedAddons = {},\n): OrderAddon[] => {\n\treturn Object.entries(selectedAddons).map(([addonIdStr, selected]) => {\n\t\tconst addonId = Number(addonIdStr);\n\t\tconst selectedOptionIds = Array.isArray(selected) ? selected : [selected];\n\n\t\tconst addon = productAddons.find((addon) => addon.id === addonId);\n\t\tif (isEmpty(addon)) {\n\t\t\treturn {\n\t\t\t\taddonId,\n\t\t\t\toptions: [],\n\t\t\t};\n\t\t}\n\n\t\tconst options: OrderAddonOption[] = (addon.options || [])\n\t\t\t.filter((option) => selectedOptionIds.includes(option.id))\n\t\t\t.map((option) => ({\n\t\t\t\toptionId: option.id,\n\t\t\t\tprice: option.listingPrice ?? option.price,\n\t\t\t}));\n\n\t\treturn {\n\t\t\taddonId,\n\t\t\toptions,\n\t\t};\n\t});\n};\n\nexport const getDefaultOrderType = (\n\tsettings: branchModels.BranchSettings,\n\tisOpen: boolean,\n\tisDelivering: boolean,\n): OrderType | null => {\n\tif (!settings) return null;\n\n\tconst { deliveryOrderEnabled, dineInOrderEnabled, pickupOrderEnabled } = settings;\n\n\tif (deliveryOrderEnabled && isDelivering) {\n\t\treturn OrderType.DELIVERY;\n\t}\n\n\tif (dineInOrderEnabled && isOpen) {\n\t\treturn OrderType.DINE_IN;\n\t}\n\n\tif (pickupOrderEnabled && isOpen) {\n\t\treturn OrderType.PICK_UP;\n\t}\n\n\treturn null;\n};\n\n// Defensive shape check for the /order/calculate response. The service is\n// typed as CalculatePreviewResponse, but the network can return malformed\n// payloads (empty body, HTML error page) that would corrupt preview state\n// and break price-line lookups downstream.\nexport const isValidPreviewResponse = (data: unknown): data is CalculatePreviewResponse => {\n\tif (!data || typeof data !== \"object\") return false;\n\tconst d = data as Partial<CalculatePreviewResponse>;\n\treturn (\n\t\ttypeof d.totalPriceWithoutTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTax === \"number\" &&\n\t\ttypeof d.totalPriceWithTaxAndFees === \"number\" &&\n\t\ttypeof d.totalTax === \"number\" &&\n\t\ttypeof d.deliveryFee === \"number\" &&\n\t\ttypeof d.serviceFee === \"number\" &&\n\t\tArray.isArray(d.items) &&\n\t\tArray.isArray(d.taxes)\n\t);\n};\n\nexport const getOrderErrorMessages = (field: keyof Order) => {\n\tswitch (field) {\n\t\tcase \"customer\":\n\t\t\treturn OrderErrors.ADDRESS_IS_EMPTY;\n\n\t\tcase \"tableId\":\n\t\t\treturn OrderErrors.TABLE_NOT_SELECTED;\n\n\t\tcase \"items\":\n\t\t\treturn OrderErrors.EMPTY_ITEMS;\n\n\t\tcase \"branchId\":\n\t\t\treturn OrderErrors.BRANCH_NOT_SELECTED;\n\n\t\tdefault:\n\t\t\treturn OrderErrors.FIELD_REQUIRED_ERROR;\n\t}\n};\n\nexport * from \"./utils/item-price\";\n","import { FormErrors } from \"@sorocraft/ui\";\nimport { checkIsValidEmail } from \"@sorocraft/js-utils\";\n\nimport {\n\tCustomerAddress,\n\tCustomerAuthForm,\n\tCustomerAuthPhoneForm,\n\tCustomerAuthStep,\n} from \"./models\";\n\nexport const preparePhoneNumber = (form: CustomerAuthPhoneForm) => {\n\tconst phoneNumber = `${form.countryCode}${form.phoneNumber}`.replaceAll(\"+\", \"\");\n\n\treturn phoneNumber;\n};\n\nexport const validateForm = (form: CustomerAuthForm, step: CustomerAuthStep): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { email, otp } = form || {};\n\n\tswitch (step) {\n\t\tcase CustomerAuthStep.OTP: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\n\t\t\tif (!otp || otp.length !== 6) {\n\t\t\t\terrors.otp = \"Invalid OTP\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase CustomerAuthStep.EMAIL: {\n\t\t\tif (!email || !checkIsValidEmail(email)) {\n\t\t\t\terrors.email = \"Invalid Email Address\";\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\treturn errors;\n};\n\nexport const validateAddressForm = (form: CustomerAddress): FormErrors => {\n\tconst errors: FormErrors = {};\n\tconst { countryCode, cityName, street, houseNumber } = form || {};\n\n\tif (!countryCode) errors.countryCode = \"COUNTRY_REQUIRED\";\n\tif (!cityName) errors.cityName = \"CITY_REQUIRED\";\n\tif (!street) errors.street = \"STREET_REQUIRED\";\n\tif (!houseNumber) errors.houseNumber = \"STREET_NUMBER_REQUIRED\";\n\n\treturn errors;\n};\n\nexport const formatCityLine = (fields: (string | undefined)[]) => {\n\treturn (fields || []).filter(Boolean).join(\", \");\n};\n\nexport const formatAddressLine = (\n\tstreet: string,\n\thouseNumber: string,\n\tadditionalNumber: string,\n) => {\n\tconst house = [houseNumber, additionalNumber].filter(Boolean).join(\"/\");\n\tconst fullAddress = [street, house].filter(Boolean).join(\" \");\n\n\treturn fullAddress;\n};\n","import { MenuAddon, MenuAddonOption } from \"./models\";\n\nexport const getAddonTranslation = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n\nexport const getAddonOptionTranslation = (option: MenuAddonOption, language: string): string => {\n\treturn option?.title?.[language] || \"\";\n};\n\nexport const getOptionTitles = (\n\toptions: MenuAddonOption[],\n\toptionIds: number | number[],\n\tlanguage: string,\n): string => {\n\tif (Array.isArray(optionIds)) {\n\t\treturn (options || [])\n\t\t\t.filter(({ id }) => optionIds.includes(id))\n\t\t\t.map(({ title }) => title?.[language] || \"\")\n\t\t\t.filter(Boolean)\n\t\t\t.join(\", \");\n\t} else {\n\t\tconst option = (options || []).find(({ id }) => id === optionIds);\n\t\treturn option?.title?.[language] || \"\";\n\t}\n};\n\nexport const getAddonTitle = (addon: MenuAddon, language: string): string => {\n\treturn addon?.title?.[language] || \"\";\n};\n","import { isEmpty } from \"@sorocraft/js-utils\";\n\nimport { EmployeePermission, UserRole } from \"./models\";\n\nexport const getPermissionsByRole = (role?: UserRole) => {\n\tswitch (role) {\n\t\t/** Owner - Has every permission */\n\t\tcase UserRole.OWNER:\n\t\t\treturn [EmployeePermission.ALL];\n\n\t\t/** General Manager - All except subscription updates */\n\t\tcase UserRole.GENERAL_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.UPDATE_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_BRANCHES,\n\t\t\t\tEmployeePermission.UPDATE_BRANCH,\n\t\t\t\tEmployeePermission.CREATE_BRANCH,\n\t\t\t\tEmployeePermission.DELETE_BRANCH,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.CREATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.DELETE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Branch Manager - Controls operations within one branch */\n\t\tcase UserRole.BRANCH_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_BUSINESS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE,\n\t\t\t\tEmployeePermission.CREATE_TABLE,\n\t\t\t\tEmployeePermission.DELETE_TABLE,\n\t\t\t\tEmployeePermission.VIEW_EMPLOYEES,\n\t\t\t\tEmployeePermission.UPDATE_EMPLOYEE,\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.CREATE_QR_CODE,\n\t\t\t\tEmployeePermission.DELETE_QR_CODE,\n\t\t\t\tEmployeePermission.AI_ASSISTANT,\n\t\t\t];\n\n\t\t/** Chef - Manages menu and kitchen orders */\n\t\tcase UserRole.CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Sous Chef - Assists chef with orders and menu */\n\t\tcase UserRole.SOUS_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Pastry Chef - Limited to dessert menu items */\n\t\tcase UserRole.PASTRY_CHEF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Line Cook / Prep Cook / Kitchen Assistant - Read-only menu & order updates */\n\t\tcase UserRole.LINE_COOK:\n\t\tcase UserRole.PREP_COOK:\n\t\tcase UserRole.KITCHEN_ASSISTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Head Waiter - Full service control */\n\t\tcase UserRole.HEAD_WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_QR_MENU,\n\t\t\t\tEmployeePermission.VIEW_QR_CODES,\n\t\t\t];\n\n\t\t/** Waiter - Handles orders and table service */\n\t\tcase UserRole.WAITER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t\tEmployeePermission.VIEW_TABLES,\n\t\t\t\tEmployeePermission.UPDATE_TABLE_STATUS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t];\n\n\t\t/** Runner - Sees and updates order delivery progress */\n\t\tcase UserRole.RUNNER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** ☕ Barista / Bartender / Sommelier / Room Service */\n\t\tcase UserRole.BARISTA:\n\t\tcase UserRole.BARTENDER:\n\t\tcase UserRole.SOMMELIER:\n\t\tcase UserRole.ROOM_SERVICE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_ORDERS,\n\t\t\t\tEmployeePermission.CREATE_ORDER,\n\t\t\t\tEmployeePermission.UPDATE_ORDER,\n\t\t\t];\n\n\t\t/** Accountant - Analytics, reports, subscriptions */\n\t\tcase UserRole.ACCOUNTANT:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_ANALYTICS,\n\t\t\t\tEmployeePermission.VIEW_SALES_REPORTS,\n\t\t\t\tEmployeePermission.VIEW_SUBSCRIPTION,\n\t\t\t];\n\n\t\t/** Delivery Driver - Delivery orders only */\n\t\tcase UserRole.DELIVERY_DRIVER:\n\t\t\treturn [EmployeePermission.VIEW_ORDERS, EmployeePermission.UPDATE_ORDER];\n\n\t\t/** Inventory Manager - Controls menu stock-related items */\n\t\tcase UserRole.INVENTORY_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.DELETE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.DELETE_ADDON,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.UPDATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.CREATE_MENU_ITEM,\n\t\t\t\tEmployeePermission.DELETE_MENU_ITEM,\n\t\t\t\tEmployeePermission.VIEW_PURCHASES,\n\t\t\t\tEmployeePermission.CREATE_PURCHASE,\n\t\t\t\tEmployeePermission.UPDATE_PURCHASE,\n\t\t\t\tEmployeePermission.DELETE_PURCHASE,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY,\n\t\t\t\tEmployeePermission.VIEW_INVENTORY_PRODUCTS,\n\t\t\t\tEmployeePermission.CREATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.UPDATE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.DELETE_INVENTORY_PRODUCT,\n\t\t\t\tEmployeePermission.VIEW_PURCHASE_DETAIL,\n\t\t\t\tEmployeePermission.VIEW_BRANCH_BALANCE,\n\t\t\t\tEmployeePermission.UPDATE_PRODUCT_INGREDIENTS,\n\t\t\t\tEmployeePermission.DELETE_PRODUCT_INGREDIENTS,\n\t\t\t];\n\n\t\t/** Purchasing Manager - Similar to inventory but more on creation/deletion */\n\t\tcase UserRole.PURCHASING_MANAGER:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.CREATE_CATEGORY,\n\t\t\t\tEmployeePermission.UPDATE_CATEGORY,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.CREATE_ADDON,\n\t\t\t\tEmployeePermission.UPDATE_ADDON,\n\t\t\t];\n\n\t\t/** Warehouse Staff - View only */\n\t\tcase UserRole.WAREHOUSE_STAFF:\n\t\t\treturn [\n\t\t\t\tEmployeePermission.VIEW_CATEGORIES,\n\t\t\t\tEmployeePermission.VIEW_ADDONS,\n\t\t\t\tEmployeePermission.VIEW_MENU,\n\t\t\t\tEmployeePermission.VIEW_MENU_ITEMS,\n\t\t\t];\n\n\t\tdefault:\n\t\t\treturn [];\n\t}\n};\n\nexport const getHasUserPermission = (\n\trequiredPermissions: EmployeePermission[],\n\tuserPermissions: EmployeePermission[],\n) => {\n\tif (isEmpty(requiredPermissions)) return true;\n\tif (isEmpty(userPermissions)) return false;\n\tif (userPermissions.includes(EmployeePermission.ALL)) return true;\n\n\treturn requiredPermissions.some((permission) => userPermissions.includes(permission));\n};\n","import { getQueryParam } from \"@sorocraft/js-utils\";\n\nimport { FeatureSegment, type Feature } from \"./models\";\n\nimport { FEATURES_LIST } from \"./constants\";\n\nexport const getIsFeatureActive = (feature: Feature, businessSegment: FeatureSegment): boolean => {\n\t// Feature is force-enabled via query param\n\tif (getQueryParam(feature) === \"1\") return true;\n\n\t// Build the list of enabled segments for the current businessSegment\n\tconst enabledSegments: FeatureSegment[] =\n\t\tbusinessSegment === FeatureSegment.ALPHA\n\t\t\t? [FeatureSegment.ALPHA, FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: businessSegment === FeatureSegment.BETA\n\t\t\t? [FeatureSegment.BETA, FeatureSegment.ALL]\n\t\t\t: [FeatureSegment.ALL];\n\n\t// Check if feature exists in any of the enabled segments\n\treturn enabledSegments.some((segment) => FEATURES_LIST[segment]?.includes(feature));\n};\n","import { LocalizedContent, Product, ProductVariant, SellUnitType } from \"./models\";\n\nimport { MenuAddon } from \"src/modules/addon/models\";\n\nexport const getProductTranslation = (\n\tproduct: Pick<Product, \"translations\">,\n\tlanguage: string,\n): LocalizedContent => {\n\treturn product?.translations?.[language] || ({} as LocalizedContent);\n};\n\nexport const getProductVariant = (\n\tproduct: Pick<Product, \"variants\">,\n\tvariantId: number,\n): ProductVariant => {\n\treturn product?.variants?.find?.((item) => item.id === variantId) || ({} as ProductVariant);\n};\n\nexport const getProductVariantTranslation = (variant: ProductVariant, language: string): string => {\n\treturn variant?.title?.[language] || \"\";\n};\n\nexport const getProductAddon = (product: Product, addonId: number): MenuAddon => {\n\treturn (product?.addons || []).find(({ id }) => id === addonId) || ({} as MenuAddon);\n};\n\nexport const getPriceSuffix = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn \" / kg\";\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn \" / l\";\n\n\t\tdefault:\n\t\t\treturn \"\";\n\t}\n};\n\nexport const getProductSellUnitShortCuts = (sellUnitType: SellUnitType) => {\n\tswitch (sellUnitType) {\n\t\tcase SellUnitType.WEIGHT:\n\t\t\treturn {\n\t\t\t\t\"50gr\": 0.05,\n\t\t\t\t\"100gr\": 0.1,\n\t\t\t\t\"150gr\": 0.15,\n\t\t\t\t\"200gr\": 0.2,\n\t\t\t\t\"250gr\": 0.25,\n\t\t\t\t\"300gr\": 0.3,\n\t\t\t\t\"350gr\": 0.35,\n\t\t\t\t\"400gr\": 0.4,\n\t\t\t\t\"450gr\": 0.45,\n\t\t\t\t\"500gr\": 0.5,\n\t\t\t\t\"600gr\": 0.6,\n\t\t\t\t\"700gr\": 0.7,\n\t\t\t\t\"750gr\": 0.75,\n\t\t\t\t\"800gr\": 0.8,\n\t\t\t\t\"850gr\": 0.85,\n\t\t\t\t\"900gr\": 0.9,\n\t\t\t\t\"950gr\": 0.95,\n\t\t\t\t\"1kg\": 1,\n\t\t\t\t\"2kg\": 2,\n\t\t\t\t\"5kg\": 5,\n\t\t\t\t\"10kg\": 10,\n\t\t\t\t\"20kg\": 20,\n\t\t\t};\n\t\tcase SellUnitType.VOLUME:\n\t\t\treturn {\n\t\t\t\t\"50ml\": 0.05,\n\t\t\t\t\"100ml\": 0.1,\n\t\t\t\t\"150ml\": 0.15,\n\t\t\t\t\"200ml\": 0.2,\n\t\t\t\t\"250ml\": 0.25,\n\t\t\t\t\"300ml\": 0.3,\n\t\t\t\t\"350ml\": 0.35,\n\t\t\t\t\"400ml\": 0.4,\n\t\t\t\t\"450ml\": 0.45,\n\t\t\t\t\"500ml\": 0.5,\n\t\t\t\t\"600ml\": 0.6,\n\t\t\t\t\"700ml\": 0.7,\n\t\t\t\t\"750ml\": 0.75,\n\t\t\t\t\"800ml\": 0.8,\n\t\t\t\t\"850ml\": 0.85,\n\t\t\t\t\"900ml\": 0.9,\n\t\t\t\t\"950ml\": 0.95,\n\t\t\t\t\"1l\": 1,\n\t\t\t\t\"2l\": 2,\n\t\t\t\t\"5l\": 5,\n\t\t\t\t\"10l\": 10,\n\t\t\t\t\"20l\": 20,\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {};\n\t}\n};\n\nexport * from \"./utils/listing-price\";\nexport * from \"./utils/order-price\";\n","import * as categoryModels from \"src/modules/category/models\";\nimport * as productModels from \"src/modules/product/models\";\n\nimport { CategoryProductMap } from \"./models\";\n\nexport const prepareCategoryAndProductMap = (\n\tcategories: categoryModels.Category[],\n\tproducts: productModels.Product[]\n): CategoryProductMap[] => {\n\tconst productMap = products.reduce<Record<number, productModels.Product[]>>((map, product) => {\n\t\tif (!product.visible) return map;\n\n\t\tconst categoryId = Number(product.categoryId);\n\t\tif (!map[categoryId]) {\n\t\t\tmap[categoryId] = [];\n\t\t}\n\t\tmap[categoryId].push(product);\n\t\treturn map;\n\t}, {});\n\n\treturn categories\n\t\t.map((category) => ({\n\t\t\t...category,\n\t\t\tproducts: (productMap[Number(category.id)] || []) as productModels.Product[],\n\t\t}))\n\t\t.filter((category) => category?.products?.length > 0);\n};\n"],"names":["ProductView","SellUnitType","getUnitListingPrice","item","_a","_b","listingPrice","price","MenuAddonSelectType","getAllSelectedOptionsListingPrice","product","selectedAddons","total","addon","addons","id","addonId","selectType","options","Object","prototype","hasOwnProperty","call","selection","selectedOptionIds","SINGLE","optionId","option","find","OrderType","OrderStatus","OrderItemStatus","PaymentMethod","OrderStep","OrderErrors","CASH","CART","DETAILS","COMPLETED","getOrderItemListingRawPrice","orderItem","variant","quantity","baseUnitPrice","addonsUnitPrice","reduce","addonSum","optionSum","CustomerAuthStep","CustomerAddressType","Feature","FeatureSegment","FEATURES_LIST","ALPHA","UPLOAD_VIDEO","BETA","ALL","DOMAIN","IMAGE_BASE_URL","validators","number","AZERBAIJANI_PREFIXES","RegExp","join","test","isValid","error","keyStr","triplet","e1","e2","e3","charAt","getCategoryTranslation","category","language","translations","EmployeePermission","UserRole","hex","deltaPct","n","parseInt","replace","r","g","b","max","Math","min","l","h","s","d","newL","hueToRgb","p","q","t","r2","g2","b2","toHex","x","round","toString","padStart","productAddons","entries","map","addonIdStr","selected","Number","Array","isArray","isEmpty","filter","includes","street","houseNumber","additionalNumber","Boolean","fields","productId","variantId","Error","orderItemsId","addonIdsPart","optionIds","sortNumbers","title","hostname","locale","url","domain","categoryId","categories","name","coverPhoto","startsWith","settings","isOpen","isDelivering","deliveryOrderEnabled","dineInOrderEnabled","pickupOrderEnabled","DELIVERY","DINE_IN","PICK_UP","requiredPermissions","userPermissions","some","permission","image","feature","businessSegment","getQueryParam","segment","logoImage","currency","priceFormatter","field","ADDRESS_IS_EMPTY","TABLE_NOT_SELECTED","EMPTY_ITEMS","BRANCH_NOT_SELECTED","FIELD_REQUIRED_ERROR","totalPrice","role","OWNER","GENERAL_MANAGER","VIEW_BUSINESS","UPDATE_BUSINESS","VIEW_ORDERS","UPDATE_ORDER","CREATE_ORDER","VIEW_QR_MENU","VIEW_QR_CODES","VIEW_MENU","VIEW_MENU_ITEMS","UPDATE_MENU_ITEM","CREATE_MENU_ITEM","DELETE_MENU_ITEM","VIEW_CATEGORIES","UPDATE_CATEGORY","CREATE_CATEGORY","DELETE_CATEGORY","VIEW_ADDONS","UPDATE_ADDON","CREATE_ADDON","DELETE_ADDON","VIEW_TABLES","UPDATE_TABLE","CREATE_TABLE","DELETE_TABLE","VIEW_BRANCHES","UPDATE_BRANCH","CREATE_BRANCH","DELETE_BRANCH","VIEW_EMPLOYEES","UPDATE_EMPLOYEE","CREATE_EMPLOYEE","DELETE_EMPLOYEE","VIEW_ANALYTICS","VIEW_SALES_REPORTS","VIEW_SUBSCRIPTION","CREATE_QR_CODE","DELETE_QR_CODE","AI_ASSISTANT","BRANCH_MANAGER","CHEF","SOUS_CHEF","PASTRY_CHEF","LINE_COOK","PREP_COOK","KITCHEN_ASSISTANT","HEAD_WAITER","UPDATE_TABLE_STATUS","WAITER","RUNNER","BARISTA","BARTENDER","SOMMELIER","ROOM_SERVICE_STAFF","ACCOUNTANT","DELIVERY_DRIVER","INVENTORY_MANAGER","VIEW_PURCHASES","CREATE_PURCHASE","UPDATE_PURCHASE","DELETE_PURCHASE","VIEW_INVENTORY","VIEW_INVENTORY_PRODUCTS","CREATE_INVENTORY_PRODUCT","UPDATE_INVENTORY_PRODUCT","DELETE_INVENTORY_PRODUCT","VIEW_PURCHASE_DETAIL","VIEW_BRANCH_BALANCE","UPDATE_PRODUCT_INGREDIENTS","DELETE_PRODUCT_INGREDIENTS","PURCHASING_MANAGER","WAREHOUSE_STAFF","sellUnitType","WEIGHT","VOLUME","keys","length","variants","undefined","source","status","Check","DELIVERED","BagCheck","OUT_FOR_DELIVERY","Delivery","PREPARING","Chef","CONFIRMED","FileCheck","PENDING","HourglassHalf","video","data","totalPriceWithoutTax","totalPriceWithTax","totalPriceWithTaxAndFees","totalTax","deliveryFee","serviceFee","items","taxes","products","productMap","visible","push","assign","form","countryCode","phoneNumber","replaceAll","errors","cityName","step","email","otp","OTP","checkIsValidEmail","EMAIL","cleaned","nationalNumber","slice","validator"],"mappings":"mFAgDA,IAAYA,EASAC,GATZ,SAAYD,GACXA,EAAA,KAAA,OACAA,EAAA,KAAA,MACA,CAHD,CAAYA,IAAAA,EAAW,CAAA,IASvB,SAAYC,GACXA,EAAA,MAAA,QACAA,EAAA,OAAA,SACAA,EAAA,OAAA,QACA,CAJD,CAAYA,IAAAA,EAAY,CAAA,ICrDjB,MAAMC,EAAuBC,IAG/B,IAAAC,EAAAC,EAAC,OAAiC,QAAjCA,EAAkB,QAAlBD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AAQE,MAAMb,EAAYhC,QAGjD,OAAO8C,EAFWzO,EAAW2N,IAEZY,EAClB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OrderPreviewState, OrderStep, PaymentMethod } from "./models";
|
|
2
2
|
export declare const initialOrder: {
|
|
3
3
|
orderType: any;
|
|
4
|
-
|
|
4
|
+
preferredPaymentMethod: PaymentMethod;
|
|
5
5
|
};
|
|
6
6
|
export declare const ORDER_STEPS: OrderStep[];
|
|
7
7
|
export declare const initialPreviewState: OrderPreviewState;
|
|
@@ -40,7 +40,6 @@ declare const _default: {
|
|
|
40
40
|
"Not available": string;
|
|
41
41
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
42
42
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
43
|
-
"Go to checkout": string;
|
|
44
43
|
"Add an order note": string;
|
|
45
44
|
"Your Order is Completed!": string;
|
|
46
45
|
Delivery: string;
|
|
@@ -15,7 +15,6 @@ declare const _default: {
|
|
|
15
15
|
"Not available": string;
|
|
16
16
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
17
17
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
18
|
-
"Go to checkout": string;
|
|
19
18
|
"Add an order note": string;
|
|
20
19
|
"Your Order is Completed!": string;
|
|
21
20
|
Delivery: string;
|
|
@@ -49,7 +49,6 @@ declare const _default: {
|
|
|
49
49
|
Tax: string;
|
|
50
50
|
Total: string;
|
|
51
51
|
"Special instructions, allergies, etc.": string;
|
|
52
|
-
"Go to checkout": string;
|
|
53
52
|
"Place order": string;
|
|
54
53
|
Continue: string;
|
|
55
54
|
"Not available": string;
|
|
@@ -240,7 +239,6 @@ declare const _default: {
|
|
|
240
239
|
Tax: string;
|
|
241
240
|
Total: string;
|
|
242
241
|
"Special instructions, allergies, etc.": string;
|
|
243
|
-
"Go to checkout": string;
|
|
244
242
|
"Place order": string;
|
|
245
243
|
Continue: string;
|
|
246
244
|
"Not available": string;
|
|
@@ -308,7 +306,6 @@ declare const _default: {
|
|
|
308
306
|
"Not available": string;
|
|
309
307
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
310
308
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
311
|
-
"Go to checkout": string;
|
|
312
309
|
"Add an order note": string;
|
|
313
310
|
"Your Order is Completed!": string;
|
|
314
311
|
Delivery: string;
|
|
@@ -423,7 +420,6 @@ declare const _default: {
|
|
|
423
420
|
"Not available": string;
|
|
424
421
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
425
422
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
426
|
-
"Go to checkout": string;
|
|
427
423
|
"Add an order note": string;
|
|
428
424
|
"Your Order is Completed!": string;
|
|
429
425
|
Delivery: string;
|
|
@@ -538,7 +534,6 @@ declare const _default: {
|
|
|
538
534
|
"Not available": string;
|
|
539
535
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
540
536
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
541
|
-
"Go to checkout": string;
|
|
542
537
|
"Add an order note": string;
|
|
543
538
|
"Your Order is Completed!": string;
|
|
544
539
|
Delivery: string;
|
|
@@ -653,7 +648,6 @@ declare const _default: {
|
|
|
653
648
|
"Not available": string;
|
|
654
649
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
655
650
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
656
|
-
"Go to checkout": string;
|
|
657
651
|
"Add an order note": string;
|
|
658
652
|
"Your Order is Completed!": string;
|
|
659
653
|
Delivery: string;
|
|
@@ -776,7 +770,6 @@ declare const _default: {
|
|
|
776
770
|
Tax: string;
|
|
777
771
|
Total: string;
|
|
778
772
|
"Special instructions, allergies, etc.": string;
|
|
779
|
-
"Go to checkout": string;
|
|
780
773
|
"Place order": string;
|
|
781
774
|
Continue: string;
|
|
782
775
|
"Not available": string;
|
|
@@ -893,7 +886,6 @@ declare const _default: {
|
|
|
893
886
|
Tax: string;
|
|
894
887
|
Total: string;
|
|
895
888
|
"Special instructions, allergies, etc.": string;
|
|
896
|
-
"Go to checkout": string;
|
|
897
889
|
"Place order": string;
|
|
898
890
|
Continue: string;
|
|
899
891
|
"Not available": string;
|
|
@@ -1010,7 +1002,6 @@ declare const _default: {
|
|
|
1010
1002
|
Tax: string;
|
|
1011
1003
|
Total: string;
|
|
1012
1004
|
"Special instructions, allergies, etc.": string;
|
|
1013
|
-
"Go to checkout": string;
|
|
1014
1005
|
"Place order": string;
|
|
1015
1006
|
Continue: string;
|
|
1016
1007
|
"Not available": string;
|
|
@@ -40,7 +40,6 @@ declare const _default: {
|
|
|
40
40
|
"Not available": string;
|
|
41
41
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
42
42
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
43
|
-
"Go to checkout": string;
|
|
44
43
|
"Add an order note": string;
|
|
45
44
|
"Your Order is Completed!": string;
|
|
46
45
|
Delivery: string;
|
|
@@ -15,7 +15,6 @@ declare const _default: {
|
|
|
15
15
|
"Not available": string;
|
|
16
16
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
17
17
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
18
|
-
"Go to checkout": string;
|
|
19
18
|
"Add an order note": string;
|
|
20
19
|
"Your Order is Completed!": string;
|
|
21
20
|
Delivery: string;
|
|
@@ -40,7 +40,6 @@ declare const _default: {
|
|
|
40
40
|
"Not available": string;
|
|
41
41
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
42
42
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
43
|
-
"Go to checkout": string;
|
|
44
43
|
"Add an order note": string;
|
|
45
44
|
"Your Order is Completed!": string;
|
|
46
45
|
Delivery: string;
|
|
@@ -15,7 +15,6 @@ declare const _default: {
|
|
|
15
15
|
"Not available": string;
|
|
16
16
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
17
17
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
18
|
-
"Go to checkout": string;
|
|
19
18
|
"Add an order note": string;
|
|
20
19
|
"Your Order is Completed!": string;
|
|
21
20
|
Delivery: string;
|
|
@@ -40,7 +40,6 @@ declare const _default: {
|
|
|
40
40
|
"Not available": string;
|
|
41
41
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
42
42
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
43
|
-
"Go to checkout": string;
|
|
44
43
|
"Add an order note": string;
|
|
45
44
|
"Your Order is Completed!": string;
|
|
46
45
|
Delivery: string;
|
|
@@ -15,7 +15,6 @@ declare const _default: {
|
|
|
15
15
|
"Not available": string;
|
|
16
16
|
"Specify any allergies, special requests, or ingredients you want to add or remove": string;
|
|
17
17
|
"Thank you! We've received your order and it will be delivered shortly.": string;
|
|
18
|
-
"Go to checkout": string;
|
|
19
18
|
"Add an order note": string;
|
|
20
19
|
"Your Order is Completed!": string;
|
|
21
20
|
Delivery: string;
|