@kosdev-code/kos-dispense-sdk 3.0.28 → 3.0.29
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/.kos.json +7 -0
- package/{dispense-registration-manager-Dtb31fcI.cjs → dispense-registration-manager-CfWgJqfq.cjs} +590 -172
- package/dispense-registration-manager-CfWgJqfq.cjs.map +1 -0
- package/{dispense-registration-manager-Da9CW_cN.js → dispense-registration-manager-DtN0T_JG.js} +623 -205
- package/dispense-registration-manager-DtN0T_JG.js.map +1 -0
- package/{extension-utils-Cfhe358W.cjs → extension-utils-BWYG2dYG.cjs} +2 -2
- package/extension-utils-BWYG2dYG.cjs.map +1 -0
- package/{extension-utils-D_dnBLH6.js → extension-utils-BoXtjU5_.js} +2 -2
- package/extension-utils-BoXtjU5_.js.map +1 -0
- package/index.cjs +7 -5
- package/index.cjs.map +1 -1
- package/index.js +67 -65
- package/index.js.map +1 -1
- package/models/models/assembly/assembly-model.d.ts +8 -0
- package/models/models/assembly/assembly-model.d.ts.map +1 -1
- package/models/models/assembly/assembly-registration.d.ts +2 -0
- package/models/models/assembly/assembly-registration.d.ts.map +1 -1
- package/models/models/assembly/board-utils.d.ts.map +1 -1
- package/models/models/assembly/nozzle-utils.d.ts.map +1 -1
- package/models/models/assembly/pump-utils.d.ts.map +1 -1
- package/models/models/assembly/services/assembly-services.d.ts.map +1 -1
- package/models/models/assembly/types/index.d.ts +6 -0
- package/models/models/availability/availability-model.d.ts +2 -0
- package/models/models/availability/availability-model.d.ts.map +1 -1
- package/models/models/availability/types/index.d.ts +4 -0
- package/models/models/board/board-container-model.d.ts +8 -0
- package/models/models/board/board-container-model.d.ts.map +1 -1
- package/models/models/board/board-container-registration.d.ts +2 -0
- package/models/models/board/board-container-registration.d.ts.map +1 -1
- package/models/models/board/board-registration.d.ts +2 -0
- package/models/models/board/board-registration.d.ts.map +1 -1
- package/models/models/board/types/index.d.ts +12 -0
- package/models/models/cui-kit-state/cui-kit-state-model.d.ts +133 -0
- package/models/models/cui-kit-state/cui-kit-state-model.d.ts.map +1 -0
- package/models/models/cui-kit-state/index.d.ts +4 -0
- package/models/models/cui-kit-state/index.d.ts.map +1 -0
- package/models/models/cui-kit-state/types/index.d.ts +82 -0
- package/models/models/device-assembly/device-assembly-model.d.ts +4 -0
- package/models/models/device-assembly/device-assembly-model.d.ts.map +1 -1
- package/models/models/device-assembly/device-assembly-registration.d.ts +2 -0
- package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
- package/models/models/device-assembly/types/index.d.ts +4 -0
- package/models/models/generic-pour/generic-pour-model.d.ts +16 -0
- package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
- package/models/models/generic-pour/generic-pour-registration.d.ts +2 -0
- package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
- package/models/models/generic-pour/types/index.d.ts +4 -0
- package/models/models/holder/holder-model.d.ts +6 -0
- package/models/models/holder/holder-model.d.ts.map +1 -1
- package/models/models/holder/services/holder-services.d.ts.map +1 -1
- package/models/models/holder/types/index.d.ts +6 -0
- package/models/models/holder-container/holder-container-model.d.ts +2 -0
- package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
- package/models/models/holder-container/types/index.d.ts +14 -0
- package/models/models/index.d.ts +1 -0
- package/models/models/index.d.ts.map +1 -1
- package/models/models/ingredient/ingredient-model.d.ts +2 -0
- package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
- package/models/models/ingredient/types/index.d.ts +4 -1
- package/models/models/ingredient-container/ingredient-container-model.d.ts +2 -0
- package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
- package/models/models/ingredient-container/types/index.d.ts +6 -0
- package/models/models/nozzle/nozzle-model.d.ts +4 -2
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models/models/nozzle/types/index.d.ts +6 -0
- package/models/models/pump/pump-model.d.ts +2 -0
- package/models/models/pump/pump-model.d.ts.map +1 -1
- package/models/models/pump/types/index.d.ts +6 -0
- package/models/models/pump-container/pump-container-model.d.ts +6 -0
- package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
- package/models/models/pump-container/types/index.d.ts +6 -0
- package/models/utils/dispense-registration-manager.d.ts +29 -4
- package/models/utils/dispense-registration-manager.d.ts.map +1 -1
- package/models/utils/extension-utils.d.ts +22 -0
- package/models/utils/extension-utils.d.ts.map +1 -1
- package/models/utils/pour-context.d.ts +8 -0
- package/models/utils/pour-context.d.ts.map +1 -0
- package/models/utils/service.d.ts +1 -1
- package/models/utils/services/dispense/1.6.5/service.d.ts +1 -1
- package/models/utils/services/dispense/1.8.1/service.d.ts +1 -1
- package/models/utils/services/dispense/daily/service.d.ts +1 -1
- package/models.cjs +4 -2
- package/models.cjs.map +1 -1
- package/models.js +17 -15
- package/package.json +2 -2
- package/{pump-provider-uNNMh9uh.cjs → pump-provider-B4WR3LiY.cjs} +402 -443
- package/pump-provider-B4WR3LiY.cjs.map +1 -0
- package/{pump-provider-BQmCKz7S.js → pump-provider-CPUsLke5.js} +448 -489
- package/pump-provider-CPUsLke5.js.map +1 -0
- package/ui/contexts/assembly/assembly-provider.d.ts +8 -0
- package/ui/contexts/assembly/assembly-provider.d.ts.map +1 -1
- package/ui/contexts/availability/availability-provider.d.ts +8 -0
- package/ui/contexts/availability/availability-provider.d.ts.map +1 -1
- package/ui/contexts/board/board-provider.d.ts +8 -0
- package/ui/contexts/board/board-provider.d.ts.map +1 -1
- package/ui/contexts/board-container/board-container-provider.d.ts +8 -0
- package/ui/contexts/board-container/board-container-provider.d.ts.map +1 -1
- package/ui/contexts/cui-kit/cui-kit.d.ts +16 -1
- package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -1
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts +8 -0
- package/ui/contexts/device-assembly/device-assembly-provider.d.ts.map +1 -1
- package/ui/contexts/holder/holder-provider.d.ts +8 -0
- package/ui/contexts/holder/holder-provider.d.ts.map +1 -1
- package/ui/contexts/holder-container/holder-container-provider.d.ts +8 -0
- package/ui/contexts/holder-container/holder-container-provider.d.ts.map +1 -1
- package/ui/contexts/ingredient/ingredient-provider.d.ts +8 -0
- package/ui/contexts/ingredient/ingredient-provider.d.ts.map +1 -1
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts +8 -0
- package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts.map +1 -1
- package/ui/contexts/nozzle/nozzle-provider.d.ts +8 -0
- package/ui/contexts/nozzle/nozzle-provider.d.ts.map +1 -1
- package/ui/contexts/pump/pump-provider.d.ts +8 -0
- package/ui/contexts/pump/pump-provider.d.ts.map +1 -1
- package/ui/hooks/assembly/use-assembly.d.ts +4 -0
- package/ui/hooks/assembly/use-assembly.d.ts.map +1 -1
- package/ui/hooks/assembly/with-assembly.d.ts +4 -0
- package/ui/hooks/assembly/with-assembly.d.ts.map +1 -1
- package/ui/hooks/availability/use-availability.d.ts +4 -0
- package/ui/hooks/availability/use-availability.d.ts.map +1 -1
- package/ui/hooks/board/use-board.d.ts +4 -0
- package/ui/hooks/board/use-board.d.ts.map +1 -1
- package/ui/hooks/board/with-board.d.ts +4 -0
- package/ui/hooks/board/with-board.d.ts.map +1 -1
- package/ui/hooks/board-container/use-board-container.d.ts +4 -0
- package/ui/hooks/board-container/use-board-container.d.ts.map +1 -1
- package/ui/hooks/board-container/with-board-container.d.ts +4 -0
- package/ui/hooks/board-container/with-board-container.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +50 -5
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -1
- package/ui/hooks/device-assembly/use-device-assembly.d.ts +4 -0
- package/ui/hooks/device-assembly/use-device-assembly.d.ts.map +1 -1
- package/ui/hooks/device-assembly/with-device-assembly.d.ts +4 -0
- package/ui/hooks/device-assembly/with-device-assembly.d.ts.map +1 -1
- package/ui/hooks/generic-pour/use-generic-pour.d.ts +4 -0
- package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
- package/ui/hooks/generic-pour/with-generic-pour.d.ts +4 -0
- package/ui/hooks/generic-pour/with-generic-pour.d.ts.map +1 -1
- package/ui/hooks/holder/use-holder.d.ts +4 -0
- package/ui/hooks/holder/use-holder.d.ts.map +1 -1
- package/ui/hooks/holder/with-holder.d.ts +4 -0
- package/ui/hooks/holder/with-holder.d.ts.map +1 -1
- package/ui/hooks/holder-container/use-holder-container.d.ts +4 -0
- package/ui/hooks/holder-container/use-holder-container.d.ts.map +1 -1
- package/ui/hooks/holder-container/with-holder-container.d.ts +4 -0
- package/ui/hooks/holder-container/with-holder-container.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts +7 -1
- package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
- package/ui/hooks/ingredient/use-ingredient.d.ts +4 -0
- package/ui/hooks/ingredient/use-ingredient.d.ts.map +1 -1
- package/ui/hooks/ingredient/with-ingredient.d.ts +4 -0
- package/ui/hooks/ingredient/with-ingredient.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts +4 -0
- package/ui/hooks/ingredient-container/use-ingredient-container.d.ts.map +1 -1
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts +4 -0
- package/ui/hooks/ingredient-container/with-ingredient-container.d.ts.map +1 -1
- package/ui/hooks/nozzle/use-nozzle.d.ts +4 -0
- package/ui/hooks/nozzle/use-nozzle.d.ts.map +1 -1
- package/ui/hooks/nozzle/with-nozzle.d.ts +4 -0
- package/ui/hooks/nozzle/with-nozzle.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +7 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
- package/ui/hooks/pour/use-pour.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +10 -0
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts +4 -0
- package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
- package/ui/utils/pour-context.d.ts +1 -7
- package/ui/utils/pour-context.d.ts.map +1 -1
- package/ui.cjs +3 -2
- package/ui.cjs.map +1 -1
- package/ui.js +49 -48
- package/ui.js.map +1 -1
- package/dispense-registration-manager-Da9CW_cN.js.map +0 -1
- package/dispense-registration-manager-Dtb31fcI.cjs.map +0 -1
- package/extension-utils-Cfhe358W.cjs.map +0 -1
- package/extension-utils-D_dnBLH6.js.map +0 -1
- package/pump-provider-BQmCKz7S.js.map +0 -1
- package/pump-provider-uNNMh9uh.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pump-provider-B4WR3LiY.cjs","sources":["../../../packages/kos-dispense-sdk/src/ui/hooks/assembly/use-assembly.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/assembly/with-assembly.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/availability/use-availability.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/availability/with-availability.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/board/use-board.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/board/with-board.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/board-container/use-board-container.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/board-container/with-board-container.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/nozzle/use-nozzle.ts","../../../packages/kos-dispense-sdk/src/ui/contexts/nozzle/nozzle-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-beverages.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-brands.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-cui-kit.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-ambient-attract-timers.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/dispense-topics.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-dispense-lifecycle.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-dispense-timers.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/cui-kit/use-flavors.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/device-assembly/use-device-assembly.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/device-assembly/with-device-assembly.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/holder/use-holder.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/holder/with-holder.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/holder-container/use-holder-container.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/holder-container/with-holder-container.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/ingredient/use-ingredient.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/ingredient/use-ingredient-pour.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/ingredient/with-ingredient.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/ingredient-container/use-ingredient-container.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/ingredient-container/with-ingredient-container.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/nozzle/with-nozzle.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/nozzle-pour/use-nozzle-pour.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/pour/use-pour.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/generic-pour/use-generic-pour.ts","../../../packages/kos-dispense-sdk/src/ui/hooks/generic-pour/with-generic-pour.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/assembly/assembly-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/availability/availability-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/board/board-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/board-container/board-container-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/device-assembly/device-assembly-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/cui-kit/cui-kit.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/holder/holder-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/holder-container/holder-container-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/ingredient/ingredient-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/contexts/ingredient-container/ingredient-container-provider.tsx","../../../packages/kos-dispense-sdk/src/ui/hooks/pump/use-pump.ts","../../../packages/kos-dispense-sdk/src/ui/contexts/pump/pump-provider.tsx"],"sourcesContent":["import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Assembly, type AssemblyModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-assembly\n * @kosApiLevel 2\n */\nexport const useAssembly = () => {\n const modelId = Assembly.type;\n const result = useKosModel<AssemblyModel>({\n modelId,\n modelType: Assembly.type,\n options: {},\n });\n\n return result;\n};\n","import type { AssemblyModel } from \"../../../models\";\nimport { useAssembly } from \"./use-assembly\";\n\ninterface AssemblyProps {\n assembly: AssemblyModel;\n}\n// react HOC to provide a Assembly to a component\n/**\n * @kosService dispense.use-assembly\n * @kosApiLevel 2\n */\nexport function withAssembly<T extends AssemblyProps = AssemblyProps>(\n WrappedComponent: React.ComponentType<T>\n) {\n return (props: Omit<T, keyof AssemblyProps>) => {\n const { model, status, KosModelLoader } = useAssembly();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} assembly={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Availability, type AvailabilityModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-availability\n * @kosApiLevel 2\n */\nexport const useAvailability = () => {\n const modelId = Availability.type;\n const result = useKosModel<AvailabilityModel>({\n modelId,\n modelType: Availability.type,\n options: {},\n });\n\n return result;\n};\n","import type { AvailabilityModel } from \"../../../models\";\nimport { useAvailability } from \"./use-availability\";\n\ninterface AvailabilityProps {\n beverage: AvailabilityModel;\n}\n// react HOC to provide a Beverage to a component\nexport function withBeverage<T extends AvailabilityProps = AvailabilityProps>(\n WrappedComponent: React.ComponentType<T>\n) {\n return (props: Omit<T, keyof AvailabilityProps>) => {\n const { model, status, KosModelLoader } = useAvailability();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} beverage={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Board, type BoardModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport const useBoard = (id: string) => {\n const modelId = id;\n const result = useKosModel<BoardModel>({\n modelId,\n modelType: Board.type,\n options: {},\n });\n\n return result;\n};\n","import type { BoardModel } from \"../../../models\";\nimport { useBoard } from \"./use-board\";\n\ninterface BoardProps {\n board: BoardModel;\n}\n// react HOC to provide a Board to a component\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport function withBoard<T extends BoardProps = BoardProps>(\n WrappedComponent: React.ComponentType<T>\n) {\n return (id: string) => (props: Omit<T, keyof BoardProps>) => {\n const { model, status, KosModelLoader } = useBoard(id);\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} board={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { BoardContainer, type BoardContainerModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport const useBoardContainer = () => {\n const modelId = BoardContainer.type;\n const result = useKosModel<BoardContainerModel>({\n modelId,\n modelType: BoardContainer.type,\n options: {},\n });\n\n return result;\n};\n","import type { BoardContainerModel } from \"../../../models\";\nimport { useBoardContainer } from \"./use-board-container\";\n\ninterface BoardContainerProps {\n boardContainer: BoardContainerModel;\n}\n// react HOC to provide a BoardContainer to a component\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport function withBoardContainer<\n T extends BoardContainerProps = BoardContainerProps\n>(WrappedComponent: React.ComponentType<T>) {\n return (props: Omit<T, keyof BoardContainerProps>) => {\n const { model, status, KosModelLoader } = useBoardContainer();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} boardContainer={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Nozzle, type NozzleModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-nozzle\n * @kosApiLevel 2\n */\nexport const useNozzle = (path: string) => {\n const modelId = path;\n const result = useKosModel<NozzleModel>({\n modelId,\n modelType: Nozzle.type,\n options: {\n path,\n },\n });\n\n return result;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport { NozzleModel } from \"../../../models\";\nimport { useNozzle } from \"../../hooks/nozzle/use-nozzle\";\n\ninterface NozzleType {\n model?: NozzleModel;\n}\nconst Nozzle = createContext<NozzleType | undefined>(undefined);\n\ninterface NozzleProviderProps {\n path: string;\n}\n\n/**\n * @kosService dispense.use-nozzle\n * @kosApiLevel 2\n */\nexport const NozzleProvider: React.FunctionComponent<\n PropsWithChildren<NozzleProviderProps>\n> = ({ children, path }) => {\n const { model, ready } = useNozzle(path);\n const value: NozzleType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return <Nozzle.Provider value={value}>{children}</Nozzle.Provider>;\n};\n/**\n * @kosService dispense.use-nozzle\n * @kosApiLevel 2\n */\nexport const useNozzleContext = () => {\n const context = useContext(Nozzle);\n if (!context) {\n throw new Error(\"useNozzleContext must be used within a NozzleProvider\");\n }\n return context;\n};\n","import {\n getKosCompanionModel,\n kosAutoEffect,\n type IKosDataModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { AvailabilityModel } from \"../../../models\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\n\ninterface Props {\n onBeverageSelected?: (brand: AvailabilityModel) => void;\n onClearBeverage?: () => void;\n onBeverageListUpdated?: (beverages: AvailabilityModel[]) => void;\n companionType?: string;\n}\nexport const useBeverages = <\n B extends Record<string, any> = any,\n C extends IKosDataModel = IKosDataModel\n>({\n onBeverageSelected,\n onBeverageListUpdated,\n onClearBeverage,\n companionType,\n}: Props) => {\n const { model: nozzle } = useNozzleContext();\n const [beverages, setBeverages] = useState<AvailabilityModel<B>[]>([]);\n const [selectedBeverage, setSelectedBeverage] =\n useState<AvailabilityModel<B> | null>(null);\n\n const companions = useMemo(() => {\n if (!companionType) return [];\n return beverages.map((brand) =>\n getKosCompanionModel<C>(brand, companionType)\n );\n }, [beverages, companionType]);\n const selectBeverage = useCallback(\n async (\n beverage: AvailabilityModel,\n context?: Record<string, any>,\n forceUpdate?: boolean\n ) => {\n setSelectedBeverage(beverage);\n await nozzle?.setSelectedPourable({ beverage, context }, forceUpdate);\n onBeverageSelected?.(beverage);\n },\n [nozzle, onBeverageSelected]\n );\n\n const clearBeverage = useCallback(async () => {\n setSelectedBeverage(null);\n await nozzle?.setSelectedPourable({ beverage: undefined });\n onClearBeverage?.();\n }, [nozzle, onClearBeverage]);\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n if (!nozzle) return;\n const selectedBrand = nozzle.selectedBrand;\n if (!selectedBrand) {\n const allBeverages = nozzle\n .getGroupAvailabilityItems<B>(\"beverages\")\n .filter((beverage) => beverage.visible);\n setBeverages(allBeverages ?? []);\n onBeverageListUpdated?.(allBeverages);\n return;\n }\n const beverages = nozzle\n .getAvailabilityByParent<B>(selectedBrand.id)\n .filter((b) => b.visible);\n setBeverages(beverages ?? []);\n onBeverageListUpdated?.(beverages);\n });\n return () => {\n disposer();\n };\n }, [nozzle]);\n return {\n beverages,\n beverageCompanions: companions,\n selectBeverage,\n selectedBeverage,\n clearBeverage,\n };\n};\n","import {\n getKosCompanionModel,\n kosAutoEffect,\n KosLog,\n LogGroup,\n type IKosDataModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { AvailabilityModel } from \"../../../models\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\n\nconst log = KosLog.createLogger({ group: LogGroup.ui, name: \"use-brands\" });\ninterface Props {\n onBrandSelected?: (brand: AvailabilityModel) => void;\n onBrandCleared?: () => void;\n companionType?: string;\n}\nexport const useBrands = <\n B extends Record<string, any> = any,\n C extends IKosDataModel = IKosDataModel\n>({\n onBrandSelected,\n onBrandCleared,\n companionType,\n}: Props) => {\n const { model: nozzle } = useNozzleContext();\n const [selectedBrand, setSelectedBrand] =\n useState<AvailabilityModel<B> | null>(null);\n\n const [brands, setBrands] = useState<AvailabilityModel<B>[]>([]);\n\n const companions = useMemo(() => {\n if (!companionType) return [];\n return brands.map((brand) => getKosCompanionModel<C>(brand, companionType));\n }, [brands, companionType]);\n\n const selectBrand = useCallback(\n async (\n brand: AvailabilityModel<B>,\n context?: Record<string, any>,\n forceUpdate?: boolean\n ) => {\n setSelectedBrand(brand);\n if (forceUpdate) {\n log.warn(`forceUpdate is not currently supported when setting brand`);\n }\n nozzle?.setSelectedBrand(brand, context);\n onBrandSelected?.(brand);\n },\n [nozzle, onBrandSelected]\n );\n\n const clearBrand = useCallback(() => {\n setSelectedBrand(null);\n nozzle?.setSelectedBrand(undefined);\n onBrandCleared?.();\n }, [nozzle, onBrandCleared]);\n\n useEffect(() => {\n const disposer = kosAutoEffect(() => {\n if (!nozzle) return;\n setBrands(nozzle.visibleBrands);\n });\n return () => {\n disposer();\n };\n }, [nozzle]);\n\n return {\n brands,\n brandCompanions: companions,\n selectedBrand,\n selectBrand,\n clearBrand,\n };\n};\n","import { KosLog, LogGroup } from \"@kosdev-code/kos-ui-sdk\";\nimport type { IntentAware } from \"../../../../models\";\nimport type { PourStrategy } from \"./pour-strategy\";\n\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"HoldToPourIntentStrategy\",\n});\n/**\n * @kosService dispense.pour-strategy\n * @kosApiLevel 2\n */\nexport const HoldToPourIntentStrategy: PourStrategy<IntentAware> = {\n name: \"HoldToPourIntentStrategy\",\n requiresHold: true,\n async initiate(model?: IntentAware, intent?: string): Promise<void> {\n if (!model?.canPour) {\n logger.debug(`${model?.id} cannot pour. Returning early.`);\n return;\n }\n if (intent) {\n logger.debug(`performing intent: ${intent}`);\n await model?.performIntent(intent);\n } else {\n logger.debug(\"no intent provided. Returning early.\");\n }\n },\n\n async initiateEnded(nozzle?: IntentAware): Promise<void> {\n await nozzle?.cancelPour();\n },\n};\n","import { KosLog, LogGroup } from \"@kosdev-code/kos-ui-sdk\";\nimport type { PourStrategyAware } from \"../../../../models/models/nozzle/types\";\nimport type { PourStrategy } from \"./pour-strategy\";\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"HoldToPourStrategy\",\n});\n\n/**\n * @kosService dispense.pour-strategy\n * @kosApiLevel 2\n */\nexport const HoldToPourStrategy: PourStrategy = {\n name: \"HoldToPourStrategy\",\n requiresHold: true,\n async initiate(nozzle?: PourStrategyAware): Promise<void> {\n if (!nozzle?.canPour) {\n logger.debug(`Nozzle ${nozzle?.id} cannot pour. Returning early.`);\n return;\n }\n await nozzle?.pour();\n },\n\n async initiateEnded(nozzle?: PourStrategyAware): Promise<void> {\n await nozzle?.cancelPour();\n },\n};\n","import { KosLog, LogGroup } from \"@kosdev-code/kos-ui-sdk\";\nimport type { IntentAware } from \"../../../../models\";\nimport type { PourStrategy } from \"./pour-strategy\";\n\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"TapOrHoldIntentStrategy\",\n});\n\n/**\n * @kosService dispense.pour-strategy\n * @kosApiLevel 2\n */\nexport class TapOrHoldIntentStrategy implements PourStrategy<IntentAware> {\n intent: string;\n name = \"TapOrHoldIntentStrategy\";\n isHold = false;\n private disposer?: NodeJS.Timeout | null = null;\n constructor(intent: string) {\n this.intent = intent;\n }\n\n async initiate(\n model?: IntentAware,\n intent: string = this.intent\n ): Promise<void> {\n this.isHold = false;\n this.disposer = setTimeout(() => {\n this.isHold = true;\n }, 250);\n\n if (model?.isPouring && !this.isHold) {\n logger.debug(`additional tap detected. cancelling pour`);\n await model.cancelPour();\n return;\n }\n if (!model?.canPour) {\n logger.debug(`${model?.id} cannot pour. Returning early.`);\n return;\n }\n if (intent) {\n logger.debug(`performing intent: ${intent}`);\n await model?.performIntent(intent);\n } else {\n logger.debug(\"no intent provided. Returning early.\");\n }\n }\n async initiateEnded(nozzle?: IntentAware): Promise<boolean> {\n if (this.disposer) clearTimeout(this.disposer);\n this.disposer = null;\n if (!this.isHold) {\n logger.debug(\"Tap detected. don't cancel and return.\");\n return true;\n }\n await nozzle?.cancelPour();\n return false;\n }\n}\n","import { KosLog, LogGroup } from \"@kosdev-code/kos-ui-sdk\";\nimport type { IntentAware } from \"../../../../models\";\nimport type { PourStrategy } from \"./pour-strategy\";\n\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"TapToPourIntentStrategy\",\n});\n/**\n * @kosService dispense.pour-strategy\n * @kosApiLevel 2\n */\nexport const TapToPourIntentStrategy: PourStrategy<IntentAware> = {\n name: \"TapToPourIntentStrategy\",\n async initiate(model?: IntentAware, intent?: string): Promise<void> {\n if (model?.isPouring) {\n logger.debug(`Nozzle ${model?.id} is already pouring. cancelling pour`);\n await model.cancelPour();\n return;\n }\n if (!model?.canPour) {\n logger.debug(`Nozzle ${model?.id} cannot pour. Returning early.`);\n return;\n }\n if (intent) {\n logger.debug(`performing intent: ${intent}`);\n await model?.performIntent(intent);\n } else {\n logger.debug(\"no intent provided. Returning early.\");\n }\n },\n\n async initiateEnded(_nozzle?: IntentAware): Promise<boolean> {\n return true;\n },\n};\n","import { KosLog, LogGroup } from \"@kosdev-code/kos-ui-sdk\";\nimport type { PourStrategyAware } from \"../../../../models/models/nozzle/types\";\nimport type { PourStrategy } from \"./pour-strategy\";\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"HoldToPourStrategy\",\n});\n/**\n * @kosService dispense.pour-strategy\n * @kosApiLevel 2\n */\nexport const TapToPourStrategy: PourStrategy = {\n name: \"TapToPourStrategy\",\n async initiate(nozzle?: PourStrategyAware): Promise<void> {\n if (nozzle?.isPouring) {\n logger.debug(`Nozzle ${nozzle?.id} is already pouring. cancelling pour`);\n await nozzle.cancelPour();\n return;\n }\n if (!nozzle?.canPour) {\n logger.debug(`Nozzle ${nozzle?.id} cannot pour. Returning early.`);\n return;\n }\n await nozzle?.pour();\n },\n\n async initiateEnded(_nozzle?: PourStrategyAware): Promise<boolean> {\n return true;\n },\n};\n","import type { IKosDataModel, KosTimer } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n KosLog,\n LogGroup,\n kosAutoEffect,\n usePressGesture,\n whenReady,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport type {\n AvailabilityModel,\n CuiKitSteps,\n CuiPourOptions,\n CuiPourResult,\n} from \"../../../models\";\nimport { CuiKitState, type CuiKitStateModel } from \"../../../models\";\nimport { cuiKitId } from \"../../../models/models/cui-kit-state/cui-kit-state-model\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\nimport type { PourContext } from \"../../utils/pour-context\";\nimport type { NozzlePourResponse } from \"../nozzle-pour/use-nozzle-pour\";\nimport { HoldToPourStrategy, type PourStrategy } from \"../utils/pour-strategy\";\nexport const DISPENSE_GROUP_BRAND = \"brands\";\nexport const DISPENSE_GROUP_BEVERAGE = \"beverages\";\nexport const DISPENSE_GROUP_FLAVOR = \"flavors\";\n\nconst log = KosLog.createLogger({ group: LogGroup.ui, name: \"use-cui-kit\" });\ntype InitialGroup =\n | typeof DISPENSE_GROUP_BRAND\n | typeof DISPENSE_GROUP_BEVERAGE;\nexport interface UseCuiKitProps {\n /**\n * The initial group to display when the cui kit is first rendered.\n * The default is to start at the list of brands however for simpler cases\n * it may be desirable to start at the list of beverages.\n *\n * @deprecated Use `steps`; `steps.brands` decides whether navigation starts at brands.\n */\n initialGroup?: InitialGroup;\n\n /**\n * The steps the kit shows. `beverages` is always on; `brands`, `flavors` and `pour` are\n * opt-in. Without it the kit keeps its original brand → beverage → flavor flow. Cannot be\n * combined with `initialGroup`.\n *\n * @kosApiLevel 17\n */\n steps?: CuiKitSteps;\n\n /**\n * Options to configure the behavior of the cui kit.\n */\n options?: {\n /** Pour defaults for every pour the kit starts. */\n pour?: {\n /** Gesture strategy for pours that do not name one. Default: hold to pour. */\n strategy?: PourStrategy;\n };\n\n /**\n * Called when a pour ends on its own (a fixed or automated pour finishing, or a pour\n * failing) rather than being cancelled. A hold-to-pour release never calls it.\n */\n onPourComplete?: (result: CuiPourResult) => void;\n\n /**\n * The companion types to associate with the brand, beverage, and flavor models. This\n * is useful when companion models have been created to represent the brand, beverage, and flavor\n * models rather than merely augmenting the AvailabilityModel data.\n */\n companionTypes?: {\n /**\n * The model type of the brand companion.\n */\n brand?: string;\n /**\n * The model type of the beverage companion.\n */\n beverage?: string;\n /**\n * The model type of the flavor companion.\n */\n flavor?: string;\n };\n };\n}\n\ninterface DispenseGroupType<\n AdditionalData extends Record<string, any> = any,\n Companion extends IKosDataModel = IKosDataModel\n> {\n /**\n * The list of AvailabilityModels to display in the group.\n */\n models: AvailabilityModel<AdditionalData>[];\n\n /**\n * The list of companion models that are associated with the models in the group.\n *\n * If no companion model types are provided in the options, this list will be empty.\n */\n companions?: Companion[];\n\n /**\n * Clear the current selection in the group. This will reset the group to its initial state.\n */\n clear: VoidFunction;\n\n /**\n * The event handlers for the group. These handlers will be called when a model in the group is selected.\n */\n handlers: {\n /**\n * The handler to call when a model in the group is selected.\n */\n onSelected: (\n model: AvailabilityModel<AdditionalData>,\n context?: Record<string, any>,\n forceUpdate?: boolean\n ) => Promise<void>;\n };\n}\n/**\n * The kit's pour control.\n * @kosService dispense.cui-kit\n * @kosApiLevel 17\n */\nexport interface CuiKitPour extends NozzlePourResponse {\n /** Starts a pour without a gesture: a click-to-pour button or an automated pour. */\n start: (options?: CuiPourOptions) => Promise<boolean>;\n /** The press half of a custom pour gesture; prefer the kit's `useCuiPour` hook. */\n press: (options?: CuiPourOptions) => Promise<boolean>;\n /** The release half of a custom pour gesture. */\n release: (options?: CuiPourOptions) => void;\n}\n\nexport interface CuiKitType<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any,\n BrandCompanion extends IKosDataModel = IKosDataModel,\n BeverageCompanion extends IKosDataModel = IKosDataModel,\n FlavorCompanion extends IKosDataModel = IKosDataModel\n> {\n /**\n * Provides functions and status related to the timers in the cui kit if available.\n */\n timers: {\n /**\n * Adds a timer to the cui kit. This will be used by a cui kit lifecycle manager to\n * manage the timers in the kit.\n * The timers will be paused and restarted as needed based on the lifecycle of the cui kit\n * @param timer - the timer to add to the cui kit.\n * @returns void\n */\n add: (timer?: KosTimer | null) => void;\n /**\n * Pauses all timers in the cui kit.\n */\n pause: VoidFunction;\n\n /**\n * Restarts all timers in the cui kit.\n */\n restart: VoidFunction;\n };\n /**\n * The navigation state of the cui kit.\n */\n nav: {\n /**\n * The current group that is being displayed.\n */\n currentGroup: string;\n\n /**\n * The handler to navigate back to the previous group.\n */\n back: VoidFunction;\n\n /**\n * The handler to navigate to the initial group as defined in the options.\n */\n home: VoidFunction;\n\n /** The steps shown, in order. */\n steps?: string[];\n\n /** Whether `back()` has a step to move to. */\n canBack?: boolean;\n\n /**\n * Moves to the pour step; only available when `steps.pour` is on. With `start`, also\n * starts a pour, unless its strategy needs a held button.\n */\n toPour?: (options?: CuiPourOptions & { start?: boolean }) => void;\n };\n\n /**\n * Provides functions and status related to the pour operation.\n */\n pour: CuiKitPour;\n\n updateOnBeforePour: (\n callback: (context?: PourContext) => Promise<boolean>\n ) => void;\n\n /**\n * The current selections of the cui kit.\n */\n selections: {\n /**\n * The selected brand model.\n */\n [DISPENSE_GROUP_BRAND]: AvailabilityModel<BrandData> | null;\n\n /**\n * The selected beverage model.\n */\n [DISPENSE_GROUP_BEVERAGE]: AvailabilityModel<BeverageData> | null;\n\n /**\n * The selected flavor models.\n */\n [DISPENSE_GROUP_FLAVOR]: AvailabilityModel<FlavorData>[] | null;\n };\n\n /**\n * The brands modules provides the state and handlers required to manage the set of brands for the dispenser:\n *\n * @property {AvailabilityModel<BrandData>[]} models - The list of brands for the dispenser.\n *\n * The models will be instances of AvailabilityModel<BrandData> with any data mappings already\n * applied to the data property on the model.\n *\n * Since these are KOS models, any changes to the model state will be automatically reflected in any components consuming them.\n *\n * @property {BrandCompanion[]} companions - In more advanced cases, the KOS framework allows you to define additional models\n * that will get created alongside the brand AvailabilityModels instances.\n * Using these companions as a form of extension, this field will return the corresponding set of companion models that\n * represent your custom brands.\n \n * @property {Object} handlers - Contains handler methods.\n * @property {Function} handlers.onSelected - When a user selects a brand, this handler can be called with the selected AvailabilityModel\n * to ensure that the CUI Kit state is kept up to date.\n *\n * @property {Function} clear - Calling this function will clear the selected brand and beverage in the CUI Kit. This updates the state both locally\n * and in the backend by clearing the selection in the Dispense SDK NozzleModel.\n */\n [DISPENSE_GROUP_BRAND]: DispenseGroupType<BrandData, BrandCompanion>;\n /**\n * The beverages modules provides the state and handlers required to manage the set of beverages for the current brand selection:\n *\n * @property {AvailabilityModel<BeverageData>[]} models - The list of beverages for the current brand selection. As the user selects brands\n * in the UI then this list of beverages will be updated to reflect new selection. If there are no brands\n * defined in the brandset then this will always return the full list of beverages.\n *\n * The models will be instances of AvailabilityModel<T> with any data mappings (shown in the next section) already\n * applied to the data property on the model.\n *\n * Since these are KOS models, any changes to the model state will be automatically reflected in any components consuming them.\n *\n * @property {BeverageCompanion[]} companions - In more advanced cases, the KOS framework allows you to define additional models\n * that will get created alongside the “beverage” AvailabilityModels instances.\n *\n * This is useful in cases where new functionality beyond what is exposed in the AvailabilityModel is required. For\n * example, if in your application, you need Beverages to be able to fetch nutritional information on selection then\n * you could create a companion model that will get created for each AvailabilityModel and expose the methods and\n * data to retrieve this information.\n *\n * Using these companions as a form of extension, this field will return the corresponding set of companion models that\n * represent your custom beverages.\n \n * @property {Object} handlers - Contains handler methods.\n * @property {Function} handlers.onSelected - When a user selects a beverage, this handler can be called with the selected AvailabilityModel\n * to ensure that the CUI Kit state is kept up to date.\n *\n * @property {Function} clear - Calling this function will clear the selected beverage in the CUI Kit. This updates the state both locally\n * and in the backend by clearing the selection in the Dispense SDK NozzleModel.\n */\n [DISPENSE_GROUP_BEVERAGE]: DispenseGroupType<BeverageData, BeverageCompanion>;\n\n /**\n * The group of flavors to display. This list will be filtered\n * based on previous selections and the relationships of the models in the graph.\n * For example, if a beverage has been selected, this will return the list of flavors that\n * are associated with the selected beverage. Otherwise, it will return the list of all flavors.\n */\n [DISPENSE_GROUP_FLAVOR]: DispenseGroupType<FlavorData, FlavorCompanion>;\n}\n\nexport const useCuiKit = <\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any,\n BrandCompanion extends IKosDataModel = IKosDataModel,\n BeverageCompanion extends IKosDataModel = IKosDataModel,\n FlavorCompanion extends IKosDataModel = IKosDataModel\n>({\n initialGroup,\n steps,\n options = {},\n}: UseCuiKitProps): CuiKitType<\n BrandData,\n BeverageData,\n FlavorData,\n BrandCompanion,\n BeverageCompanion,\n FlavorCompanion\n> => {\n const { model: nozzle } = useNozzleContext();\n const timersRef = useRef<KosTimer[]>([]);\n\n const kit = useMemo<CuiKitStateModel | undefined>(() => {\n if (!nozzle) return undefined;\n try {\n return CuiKitState.instance(cuiKitId(nozzle.path))\n .options({\n nozzlePath: nozzle.path,\n initialGroup: steps\n ? initialGroup\n : initialGroup ?? DISPENSE_GROUP_BRAND,\n steps,\n companionTypes: options.companionTypes,\n pour: { strategy: options.pour?.strategy ?? HoldToPourStrategy },\n onPourComplete: options.onPourComplete,\n })\n .build();\n } catch (error) {\n throw new Error(\n \"The CUI Kit models are not registered: call KosModelRegistry.cuiKit.models() \" +\n `in the app's registration chain (${(error as Error).message})`\n );\n }\n // Built once per nozzle; later option changes do not rebuild the kit.\n }, [nozzle]);\n\n // Re-render on any kit change so the returned value is rebuilt, as React state did.\n const [ready, setReady] = useState(false);\n const [, setVersion] = useState(0);\n useEffect(() => {\n if (!kit) return undefined;\n let dispose: VoidFunction | undefined;\n let cancelled = false;\n let attached = false;\n whenReady(kit).then(() => {\n if (cancelled) return;\n attached = true;\n // The kit outlives the component; a newly mounted kit starts from the beginning.\n if (kit.attach()) {\n kit.reset();\n }\n setReady(true);\n dispose = kosAutoEffect(() => {\n readKitState(kit);\n setVersion((version) => version + 1);\n });\n });\n return () => {\n cancelled = true;\n dispose?.();\n if (attached) kit.detach();\n };\n }, [kit]);\n\n const updateOnBeforePour = useCallback(\n (callback: (context?: PourContext) => Promise<boolean>) => {\n kit?.setBeforePour(callback);\n },\n [kit]\n );\n\n const gesture = usePressGesture({\n onPressed: () => void kit?.pressPour(),\n onRelease: () => kit?.releasePour(),\n });\n\n const pour: CuiKitPour = {\n handlers: gesture.dom,\n cancel: () => void kit?.cancelPour(),\n start: async (pourOptions) => (await kit?.startPour(pourOptions)) ?? false,\n press: async (pourOptions) => (await kit?.pressPour(pourOptions)) ?? false,\n release: (pourOptions) => kit?.releasePour(pourOptions),\n updatePourContext: (key, value) => kit?.pourContext.set(key, value),\n removeFromPourContext: (key) => kit?.pourContext.remove(key),\n status: nozzle,\n };\n\n const pauseTimers = useCallback(() => {\n if (timersRef.current.length === 0) {\n log.debug(\"No timers to pause.\");\n return;\n }\n log.debug(`Pausing ${timersRef.current.length} timers.`);\n timersRef.current.forEach((timer) => {\n log.debug(`Pausing timer with id ${timer.id}.`);\n timer.pause();\n });\n }, []);\n\n const restartTimers = useCallback(() => {\n if (timersRef.current.length === 0) {\n log.debug(\"No timers to restart.\");\n return;\n }\n log.debug(`Restarting ${timersRef.current.length} timers.`);\n timersRef.current.forEach((timer) => {\n log.debug(`Restarting timer with id ${timer.id}.`);\n timer.restart();\n });\n }, []);\n\n const addTimer = useCallback((timer?: KosTimer | null) => {\n if (!timer) {\n return;\n }\n if (timersRef.current.some((t) => t.id === timer.id)) {\n log.debug(`Timer with id ${timer.id} already exists.`);\n return;\n }\n timersRef.current.push(timer);\n }, []);\n\n const active = ready ? kit : undefined;\n return {\n timers: {\n add: addTimer,\n pause: pauseTimers,\n restart: restartTimers,\n },\n nav: {\n currentGroup:\n active?.currentGroup ??\n (steps\n ? steps.brands\n ? DISPENSE_GROUP_BRAND\n : DISPENSE_GROUP_BEVERAGE\n : initialGroup ?? DISPENSE_GROUP_BRAND),\n back: () => active?.back(),\n home: () => active?.home(),\n steps: active?.enabledSteps,\n canBack: active?.canBack ?? false,\n toPour: (pourOptions) => active?.toPour(pourOptions),\n },\n\n pour,\n\n updateOnBeforePour,\n\n selections: {\n [DISPENSE_GROUP_BRAND]:\n (active?.selectedBrand as AvailabilityModel<BrandData>) ?? null,\n [DISPENSE_GROUP_BEVERAGE]:\n (active?.selectedBeverage as AvailabilityModel<BeverageData>) ?? null,\n [DISPENSE_GROUP_FLAVOR]: (active?.selectedFlavors ??\n []) as AvailabilityModel<FlavorData>[],\n },\n [DISPENSE_GROUP_BRAND]: {\n models: (active?.brands ?? []) as AvailabilityModel<BrandData>[],\n companions: (active?.brandCompanions ?? []) as BrandCompanion[],\n clear: () => active?.clearBrand(),\n handlers: {\n onSelected: async (model, context, forceUpdate) => {\n if (forceUpdate) {\n log.warn(\n `forceUpdate is not currently supported when setting brand`\n );\n }\n active?.selectBrand(model, context);\n },\n },\n },\n [DISPENSE_GROUP_BEVERAGE]: {\n models: (active?.beverages ?? []) as AvailabilityModel<BeverageData>[],\n companions: (active?.beverageCompanions ?? []) as BeverageCompanion[],\n clear: () => void active?.clearBeverage(),\n handlers: {\n onSelected: async (model, context, forceUpdate) =>\n active?.selectBeverage(model, context, forceUpdate),\n },\n },\n [DISPENSE_GROUP_FLAVOR]: {\n models: (active?.flavors ?? []) as AvailabilityModel<FlavorData>[],\n companions: (active?.flavorCompanions ?? []) as FlavorCompanion[],\n clear: () => void active?.clearFlavors(),\n handlers: {\n onSelected: async (model, context, forceUpdate) =>\n active?.selectFlavor(model, context, forceUpdate),\n },\n },\n };\n};\n\n/** Reads every kit value the returned object exposes, so an effect tracks them all. */\nconst readKitState = (kit: CuiKitStateModel) => [\n kit.currentGroup,\n kit.canBack,\n kit.selectedBrand,\n kit.selectedBeverage,\n ...kit.selectedFlavors,\n ...kit.brands,\n ...kit.beverages,\n ...kit.flavors,\n ...kit.brandCompanions,\n ...kit.beverageCompanions,\n ...kit.flavorCompanions,\n];\n","import {\n KosLog,\n LogGroup,\n TimerManager,\n type KosTimer,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\n\nconst log = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"use-ambient-attract-timers\",\n});\ninterface TimerProps {\n defaultAmbientTime?: number;\n defaultAttractTime?: number;\n onAttractTimer?: VoidFunction;\n onAmbientTimer?: VoidFunction;\n onResetAttractTimer?: VoidFunction;\n onResumeAttractTimer?: VoidFunction;\n}\n\nexport const useAmbientAttractTimers = (props: TimerProps) => {\n const { model: nozzle } = useNozzleContext();\n\n const [attractTimer, setAttractTimer] = useState<KosTimer | null>(null);\n const {\n onAmbientTimer,\n onAttractTimer,\n onResetAttractTimer,\n onResumeAttractTimer,\n defaultAttractTime,\n defaultAmbientTime,\n } = props;\n\n const handleAmbientTimer = useCallback(() => {\n if (onAmbientTimer) {\n log.info(\"Ambient timer expired. Calling callback\");\n onAmbientTimer?.();\n }\n }, [onAmbientTimer]);\n\n const handleAttractTimer = useCallback(() => {\n if (onAttractTimer) {\n log.info(\"Attract timer expired. Calling callback\");\n onAttractTimer?.();\n }\n }, [onAttractTimer]);\n\n const handleResetAttractTimer = useCallback(() => {\n if (attractTimer) {\n attractTimer.restart();\n onResetAttractTimer?.();\n }\n }, [attractTimer, onResetAttractTimer]);\n\n const handlePauseAttractTimer = useCallback(() => {\n if (attractTimer) {\n attractTimer.reset();\n onResetAttractTimer?.();\n }\n }, [attractTimer, onResetAttractTimer]);\n\n const handleResume = useCallback(() => {\n if (attractTimer) {\n attractTimer.pause();\n onResumeAttractTimer?.();\n }\n }, [attractTimer, onResumeAttractTimer]);\n\n useEffect(() => {\n if (nozzle && defaultAttractTime) {\n log.info(\"Nozzle is available. Creating timers\");\n const timer = TimerManager.createTimer(\n \"attract-timer-\" + nozzle.path,\n defaultAttractTime\n );\n\n if (defaultAttractTime) {\n timer?.addTimeoutAction({\n name: \"attract-timer\",\n remainingTime: 0,\n action: handleAttractTimer,\n });\n }\n\n if (defaultAmbientTime) {\n timer?.addTimeoutAction({\n name: \"ambient-timer\",\n remainingTime: defaultAmbientTime,\n action: handleAmbientTimer,\n });\n }\n if (defaultAttractTime) {\n timer?.start();\n }\n setAttractTimer(timer ?? null);\n return () => {\n timer?.reset();\n setAttractTimer(null);\n };\n }\n return () => {\n log.info(\"Nozzle is not available. No timers to clear\");\n };\n }, [\n defaultAmbientTime,\n defaultAttractTime,\n handleAmbientTimer,\n handleAttractTimer,\n nozzle,\n ]);\n return {\n attractTimer,\n restart: handleResetAttractTimer,\n pause: handlePauseAttractTimer,\n resume: handleResume,\n };\n};\n","/**\n * Builds the topic subscriptions for dispense lifecycle events.\n */\n\nimport type { AvailabilityModel } from \"../../../models/models/availability\";\n\nexport interface TopicSubscription {\n topic: string;\n callback?: (args: any) => void;\n}\n\nexport interface DispenseCallbacks<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n> {\n onBrandSelected?: (brand: AvailabilityModel<BrandData>) => void;\n onBrandCleared?: () => void;\n onBeverageSelected?: (beverage: AvailabilityModel<BeverageData>) => void;\n onBeverageListUpdated?: (\n beverages: AvailabilityModel<BeverageData>[]\n ) => void;\n onBeverageCleared?: () => void;\n onFlavorSelected?: (flavor: AvailabilityModel<FlavorData>) => void;\n onFlavorCleared?: () => void;\n onReturnToHome?: () => void;\n onPour?: () => void;\n onPourCancel?: () => void;\n onBeforePourRejected?: () => void;\n onAmbientTimer?: () => void;\n onAttractTimer?: () => void;\n onResumeAttractTimer?: () => void;\n onIdleTimeout?: () => void;\n onAreYouThereTimeout?: () => void;\n onInit?: () => void;\n}\n\ninterface DispenseEventConfig {\n path: string;\n callbackKey: keyof DispenseCallbacks;\n}\n\n/**\n * Configuration for all dispense lifecycle events.\n * Each entry defines the topic path segment and corresponding callback property.\n */\nconst DISPENSE_EVENT_CONFIGS: readonly DispenseEventConfig[] = [\n { path: \"brand/selected\", callbackKey: \"onBrandSelected\" },\n { path: \"brand/cleared\", callbackKey: \"onBrandCleared\" },\n { path: \"beverage/list/updated\", callbackKey: \"onBeverageListUpdated\" },\n { path: \"beverage/selected\", callbackKey: \"onBeverageSelected\" },\n { path: \"beverage/cleared\", callbackKey: \"onBeverageCleared\" },\n { path: \"flavor/selected\", callbackKey: \"onFlavorSelected\" },\n { path: \"flavor/cleared\", callbackKey: \"onFlavorCleared\" },\n { path: \"pour\", callbackKey: \"onPour\" },\n { path: \"pour/cancel\", callbackKey: \"onPourCancel\" },\n { path: \"pre/pour/rejected\", callbackKey: \"onBeforePourRejected\" },\n { path: \"ambient/start\", callbackKey: \"onAmbientTimer\" },\n { path: \"attract/start\", callbackKey: \"onAttractTimer\" },\n { path: \"attract/resume\", callbackKey: \"onResumeAttractTimer\" },\n { path: \"idle/timeout\", callbackKey: \"onIdleTimeout\" },\n { path: \"are-you-there/timeout\", callbackKey: \"onAreYouThereTimeout\" },\n { path: \"init\", callbackKey: \"onInit\" },\n { path: \"home\", callbackKey: \"onReturnToHome\" },\n] as const;\n\n/**\n * Builds an array of topic subscriptions for dispense lifecycle events.\n * Only includes topics where a callback is provided.\n *\n * @param nozzlePath - The nozzle path to use in topic construction (e.g., \"assembly:core:nozzle:nozzle\")\n * @param callbacks - Object containing callback functions for various dispense events\n * @returns Array of topic subscription objects with topic strings and callbacks\n *\n * @example\n * ```typescript\n * const topics = buildDispenseTopics('assembly:core:nozzle:nozzle', {\n * onBrandSelected: (brand) => console.log('Brand selected:', brand),\n * onPour: () => console.log('Pour started')\n * });\n * // Returns [\n * // { topic: '/kos/dispense/assembly:core:nozzle:nozzle/brand/selected/', callback: ... },\n * // { topic: '/kos/dispense/assembly:core:nozzle:nozzle/pour/', callback: ... }\n * // ]\n * ```\n */\nexport function buildDispenseTopics(\n nozzlePath: string | undefined,\n callbacks: DispenseCallbacks\n): TopicSubscription[] {\n if (!nozzlePath) {\n return [];\n }\n\n return DISPENSE_EVENT_CONFIGS.filter(\n (config) => callbacks[config.callbackKey] !== undefined\n ).map((config) => {\n return {\n topic: `/kos/dispense/${nozzlePath}/${config.path}/`,\n callback: callbacks[config.callbackKey],\n };\n });\n}\n","import { ApiCallback, EventBus } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect } from \"react\";\nimport type { AvailabilityModel } from \"../../../models\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\nimport { buildDispenseTopics } from \"./dispense-topics\";\n\ninterface Props<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n> {\n onBrandSelected?: (brand: AvailabilityModel<BrandData>) => void;\n onBrandCleared?: () => void;\n onBeverageSelected?: (brand: AvailabilityModel<BeverageData>) => void;\n onBeverageListUpdated?: (\n beverages: AvailabilityModel<BeverageData>[]\n ) => void;\n onBeverageCleared?: () => void;\n onFlavorSelected?: (brand: AvailabilityModel<FlavorData>) => void;\n onFlavorCleared?: () => void;\n onReturnToHome?: () => void;\n onPour?: () => void;\n onPourCancel?: () => void;\n onBeforePourRejected?: () => void;\n onAmbientTimer?: () => void;\n onAttractTimer?: () => void;\n onResumeAttractTimer?: () => void;\n onIdleTimeout?: () => void;\n onAreYouThereTimeout?: () => void;\n onInit?: () => void;\n}\n\nconst subscribe = (topic: string, callback?: (args: any) => void) => {\n if (callback) {\n const callbackWrapper = (args: ApiCallback<any> | undefined) => {\n if (args && args.body) {\n callback(args.body);\n }\n };\n const result = EventBus.subscribe(topic, callbackWrapper);\n return result.unsubscribe;\n }\n return undefined;\n};\nexport const useDispenseLifecycle = ({\n onInit,\n onBrandSelected,\n onBrandCleared,\n onBeverageCleared,\n onBeverageSelected,\n onBeverageListUpdated,\n onFlavorCleared,\n onFlavorSelected,\n onReturnToHome,\n onPour,\n onPourCancel,\n onBeforePourRejected,\n onAmbientTimer,\n onAttractTimer,\n onResumeAttractTimer,\n onIdleTimeout,\n onAreYouThereTimeout,\n}: Props) => {\n const { model: nozzle } = useNozzleContext();\n\n useEffect(() => {\n const topics = buildDispenseTopics(nozzle?.path, {\n onBrandSelected,\n onBrandCleared,\n onBeverageListUpdated,\n onBeverageSelected,\n onBeverageCleared,\n onFlavorSelected,\n onFlavorCleared,\n onPour,\n onPourCancel,\n onBeforePourRejected,\n onAmbientTimer,\n onAttractTimer,\n onResumeAttractTimer,\n onIdleTimeout,\n onAreYouThereTimeout,\n onInit,\n onReturnToHome,\n });\n\n const disposers = topics.map(({ topic, callback }) =>\n subscribe(topic, callback)\n );\n\n return () => {\n disposers.forEach((disposer) => disposer?.());\n };\n }, [\n nozzle?.path,\n onAmbientTimer,\n onAttractTimer,\n onBeverageCleared,\n onBeverageSelected,\n onBeverageListUpdated,\n onBrandCleared,\n onBrandSelected,\n onFlavorCleared,\n onFlavorSelected,\n onPour,\n onPourCancel,\n onBeforePourRejected,\n onResumeAttractTimer,\n onIdleTimeout,\n onAreYouThereTimeout,\n onInit,\n onReturnToHome,\n ]);\n};\n","import {\n KosLog,\n LogGroup,\n TimerManager,\n type KosTimer,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\n\ninterface TimerProps {\n defaultIdleTime?: number;\n defaultAreYouThereTime?: number;\n onIdleTimer?: VoidFunction;\n onAreYouThereTimer?: VoidFunction;\n onResetIdleTimer?: VoidFunction;\n prefix?: string;\n}\n\nconst log = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"useCuiKitTimers\",\n});\nexport const useCuiKitTimers = (props: TimerProps) => {\n const { model: nozzle } = useNozzleContext();\n const [idleTimer, setIdleTimer] = useState<KosTimer | null>(null);\n const {\n onAreYouThereTimer,\n onIdleTimer,\n onResetIdleTimer,\n defaultAreYouThereTime = 10,\n defaultIdleTime = 20,\n } = props;\n\n // Track if we've already fired the \"Are You There\" action for this timer cycle\n const hasAreYouThereFiredRef = useRef(false);\n\n const handleAreYouThereTimer = useCallback(() => {\n // Only fire once per timer cycle\n if (!hasAreYouThereFiredRef.current && onAreYouThereTimer) {\n log.info(\"Are you there timer expired. Calling callback\");\n hasAreYouThereFiredRef.current = true;\n onAreYouThereTimer?.();\n }\n }, [onAreYouThereTimer]);\n\n const handleIdleTimer = useCallback(() => {\n log.debug(\n \"handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:\",\n !!onIdleTimer\n );\n if (onIdleTimer) {\n log.debug(\"Idle timer expired. Calling callback\");\n onIdleTimer?.();\n } else {\n log.debug(\"No onIdleTimer callback provided!\");\n }\n }, [onIdleTimer]);\n\n const handleRestartIdleTimer = useCallback(() => {\n log.debug(`TIMER RESTART called for ${props.prefix ?? \"\"}timer`);\n if (idleTimer) {\n idleTimer.restart();\n hasAreYouThereFiredRef.current = false; // Reset flag when timer restarts\n onResetIdleTimer?.();\n }\n }, [idleTimer, onResetIdleTimer, props.prefix]);\n\n const handlePauseIdleTimer = useCallback(() => {\n log.debug(`TIMER PAUSE/RESET called for ${props.prefix ?? \"\"}timer`);\n if (idleTimer) {\n idleTimer.reset();\n hasAreYouThereFiredRef.current = false; // Reset flag when timer is reset/paused\n onResetIdleTimer?.();\n }\n }, [idleTimer, onResetIdleTimer, props.prefix]);\n useEffect(() => {\n log.debug(\n `useCuiKitTimers effect triggered - nozzle: ${!!nozzle}, path: ${\n nozzle?.path\n }, callbacks: handleIdle=${!!handleIdleTimer}, handleAreYouThere=${!!handleAreYouThereTimer}`\n );\n if (nozzle) {\n log.info(\"Nozzle is available. Creating timers\");\n const timer = TimerManager.createTimer(\n `${props.prefix ?? \"\"}idle-timer-${nozzle.path}`,\n defaultIdleTime\n );\n log.debug(\n `Adding idle timer action for ${props.prefix ?? \"\"}idle-timer-${\n nozzle.path\n } with callback:`,\n !!handleIdleTimer\n );\n timer?.addTimeoutAction({\n name: \"idle-timer\",\n remainingTime: 0,\n action: handleIdleTimer,\n });\n\n timer?.addTimeoutAction({\n name: \"are-you-there-timer\",\n remainingTime: defaultAreYouThereTime,\n action: handleAreYouThereTimer,\n });\n setIdleTimer(timer ?? null);\n return () => {\n timer?.reset();\n setIdleTimer(null);\n };\n }\n return () => {\n log.info(\"Nozzle is not available. No timers to clear\");\n };\n }, [\n defaultAreYouThereTime,\n defaultIdleTime,\n handleAreYouThereTimer,\n handleIdleTimer,\n nozzle,\n props.prefix,\n ]);\n return {\n idleTimer,\n restart: handleRestartIdleTimer,\n pause: handlePauseIdleTimer,\n };\n};\n","import { EventBus, KosLog, LogGroup } from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useEffect, useState } from \"react\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\nimport { useAmbientAttractTimers } from \"./use-ambient-attract-timers\";\nimport type { CuiKitType } from \"./use-cui-kit\";\nimport { useDispenseLifecycle } from \"./use-dispense-lifecycle\";\nimport { useCuiKitTimers } from \"./use-dispense-timers\";\n\nconst log = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"useDefaultCuiKitLifecycle\",\n});\n\ninterface TimerProps {\n /**\n * The idle timeout in seconds. This is the time in seconds that the screen will wait before\n * the current session is considered idle at which point the current selections will be cleared\n * and the screen will return to the home screen.\n */\n idleTimeout?: number;\n\n /**\n * This is the amount of time left in the idle timeout at which point the are you there screen will be shown.\n *\n * For example, if the idle timer was set to 60 seconds and the areYouThereTimeoutOffset was set to 10 seconds,\n * the are you there screen would be shown after 50 seconds of inactivity to provide an opportunity for the user\n * to indicate that they are still present.\n */\n areYouThereTimeoutOffset?: number;\n}\ninterface Props {\n /**\n * The CuiKit instance\n */\n kit?: CuiKitType | null;\n\n /**\n * The timer configuration for the inactivity timer\n */\n inactivity?: TimerProps;\n\n /**\n * An alternate timer configuration that is applied when a pour has been initiated\n * in the current session. This is useful when the idle timeout should be different\n * when a pour has been initiated.\n */\n pour?: TimerProps;\n /**\n * Screen configuration to control the visibility and timing of the attract and ambient screens.\n */\n screens?: {\n /**\n * The amount of time in seconds before the attract screen is shown.\n */\n attractTimeout?: number;\n\n /**\n * The amount of time in seconds measured as an offset from the attract timeout\n * that the ambient screen will be shown. For example, if the attract screen is to be\n * show after 300 seconds and the ambient timeout is set to 120 seconds, the ambient screen will appear\n * after 180 seconds and display for 120 seconds before the attract screen is shown.\n */\n ambientTimeoutOffset?: number;\n };\n\n /**\n * Optional callback function that executes when the areYouThere timer expires.\n * If provided, this function will be called before showing the \"Are You There\" screen.\n * The screen will only be shown if the callback returns true.\n *\n * @returns Promise<boolean> - Return true to show the \"Are You There\" screen, false to prevent it\n */\n onBeforeAreYouThereTimer?: () => Promise<boolean>;\n\n /**\n * Defines what happens to timers when onBeforeAreYouThereTimer returns false.\n * - \"pause\" - Pause the current timer (default)\n * - \"restart\" - Restart the timer from the beginning\n * - \"none\" - Do nothing, let timers continue as-is\n */\n areYouThereRejectionPolicy?: \"pause\" | \"restart\" | \"none\";\n}\n\ninterface LifecycleData {\n /**\n * Flag to indicate if the are you there timoute screen should be shown\n * @type {boolean}\n */\n showAreYouThere: boolean;\n\n /**\n * Callback that when invoked will reset the are you there timer and hide the screen\n * @returns\n */\n clearAreYouThere: () => void;\n\n /**\n * The countdown value for the are you there screen. This value is used to display the countdown.\n * If a pour has been initiated at any point in the current session, the countdown value will be based\n * on the pour idleTimeout and pour areYouThereTimeoutOffset value. Otherwise it will be based on the\n * inactivity idleTimeout and areYouThereTimeoutOffset values.\n * @type {number}\n *\n */\n areYouThereCountdown: number;\n\n /**\n * Flag to indicate if the ambient screen should be shown\n */\n showAmbientScreen: boolean;\n\n /**\n * Flag to indicate if the attract screen should be shown\n */\n showAttractScreen: boolean;\n\n /**\n * Callback to pause and reset the screen timer. This will typically be called when a user\n * interacts with the screen when the ambient or attract screen is show. This will set\n * the `showAmbientScreen` and `showAttractScreen` flags to false and reset the timer.\n */\n pauseScreenTimer: () => void;\n\n /**\n * Callback to restart the ambient screen timer. This will typically be called when a user\n * interacts with the screen when the ambient or attract screen is show. This will set\n * the `showAmbientScreen` and `showAttractScreen` flags to false and restart the timer.\n */\n restartScreenTimer: () => void;\n\n /**\n * Callback to pause the idle timer. This is typically called when the user interacts with the screen\n * and should pause the idle timer.\n */\n pauseIdleTimer: () => void;\n\n /**\n * Callback to restart the idle timer. This is typically called when the user interacts with the screen\n * and should restart the idle timer.\n */\n restartIdleTimer: () => void;\n}\n/**\n * Provides the default CUI Kit lifecycle: the idle and \"Are You There\" timers, the ambient and\n * attract screen timers, and the dispense lifecycle events that reset them.\n *\n * Pass `onBeforeAreYouThereTimer` to decide, when the timer expires, whether the \"Are You There\"\n * screen is shown; `areYouThereRejectionPolicy` controls the timers when it returns false.\n *\n * @example\n * ```typescript\n * const lifecycle = useDefaultCuiKitLifecycle({\n * kit,\n * inactivity: { idleTimeout: 60, areYouThereTimeoutOffset: 10 },\n * onBeforeAreYouThereTimer: async () => !pourInProgress,\n * });\n * ```\n */\nexport const useDefaultCuiKitLifecycle = ({\n kit,\n inactivity,\n pour,\n screens,\n onBeforeAreYouThereTimer,\n areYouThereRejectionPolicy = \"pause\",\n}: Props): LifecycleData => {\n const [showAmbientScreen, setShowAmbientScreen] = useState(false);\n const [showAttractScreen, setShowAttractScreen] = useState(false);\n\n const { model: nozzle } = useNozzleContext();\n\n const [hasPoured, setHasPoured] = useState(false);\n const idleTimeout = inactivity?.idleTimeout ?? 15;\n const areYouThereTimeout = inactivity?.areYouThereTimeoutOffset ?? 10;\n const idlePourTimeout = pour?.idleTimeout ?? inactivity?.idleTimeout ?? 10;\n const areYouTherePourTimeout =\n pour?.areYouThereTimeoutOffset ?? inactivity?.areYouThereTimeoutOffset ?? 5;\n const ambientTimeout = screens?.ambientTimeoutOffset;\n const attractTimeout = screens?.attractTimeout;\n\n const handleIdleTimeout = useCallback(() => {\n log.info(\"handleIdleTimeout called - navigating home and publishing event\");\n setShowAreYouThere(false); // Clear the Are You There modal\n kit?.nav.home();\n\n // Publish idle timeout event\n if (nozzle) {\n const topic = `/kos/dispense/${nozzle.path}/idle/timeout/`;\n EventBus.publish(topic, {});\n }\n }, [kit?.nav?.home, nozzle]);\n\n const handleResetIdleTimer = useCallback(() => {\n log.info(\"handleResetIdleTimer called - resetting idle timer\");\n setShowAreYouThere(false); // Clear the Are You There modal\n }, []);\n\n const handleAmbientTimer = useCallback(() => {\n if (ambientTimeout) {\n setShowAmbientScreen(true);\n setShowAttractScreen(false);\n\n // Publish ambient timer event\n if (nozzle) {\n const topic = `/kos/dispense/${nozzle.path}/ambient/start/`;\n EventBus.publish(topic, {});\n }\n }\n }, [ambientTimeout, nozzle]);\n\n const handleAttractTimer = useCallback(() => {\n if (attractTimeout) {\n setShowAttractScreen(true);\n setShowAmbientScreen(false);\n\n // Publish attract timer event\n if (nozzle) {\n const topic = `/kos/dispense/${nozzle.path}/attract/start/`;\n EventBus.publish(topic, {});\n }\n }\n }, [attractTimeout, nozzle]);\n\n const handleAttractResume = useCallback(() => {\n if (attractTimeout) {\n setShowAttractScreen(false);\n setShowAmbientScreen(false);\n kit?.nav.home();\n\n // Publish attract resume event\n if (nozzle) {\n const topic = `/kos/dispense/${nozzle.path}/attract/resume/`;\n EventBus.publish(topic, {});\n }\n }\n }, [kit?.nav, attractTimeout, nozzle]);\n\n const {\n pause: ambientPause,\n restart: ambientRestart,\n attractTimer,\n } = useAmbientAttractTimers({\n defaultAmbientTime: ambientTimeout,\n defaultAttractTime: attractTimeout,\n onAmbientTimer: handleAmbientTimer,\n onAttractTimer: handleAttractTimer,\n onResumeAttractTimer: handleAttractResume,\n });\n\n kit?.timers?.add(attractTimer);\n\n const [showAreYouThere, setShowAreYouThere] = useState(false);\n\n // Create timer hooks first\n log.info(\n \"Creating idle timer with timeout:\",\n idleTimeout,\n \"seconds and callback:\",\n !!handleIdleTimeout\n );\n const { pause, restart, idleTimer } = useCuiKitTimers({\n defaultAreYouThereTime: areYouThereTimeout,\n defaultIdleTime: idleTimeout,\n onIdleTimer: handleIdleTimeout,\n onResetIdleTimer: handleResetIdleTimer,\n });\n\n log.info(\n `Creating pour timer with timeout: ${idlePourTimeout} seconds and callback: ${!!handleIdleTimeout}`\n );\n const {\n pause: pausePourTimer,\n restart: restartPourTimer,\n idleTimer: pourIdleTimer,\n } = useCuiKitTimers({\n defaultAreYouThereTime: areYouTherePourTimeout,\n defaultIdleTime: idlePourTimeout,\n onIdleTimer: handleIdleTimeout,\n prefix: \"pour-\",\n });\n\n // Define the Are You There handler with access to timer controls\n const handleAreYouThereTimer = useCallback(async () => {\n let shouldShowAreYouThere = true;\n\n // If a before callback is provided, run it first\n if (onBeforeAreYouThereTimer) {\n try {\n shouldShowAreYouThere = await onBeforeAreYouThereTimer();\n } catch (error) {\n log.error(`onBeforeAreYouThereTimer callback failed: ${error}`);\n shouldShowAreYouThere = false;\n }\n }\n\n if (shouldShowAreYouThere) {\n // Publish are you there timeout event\n if (nozzle) {\n const topic = `/kos/dispense/${nozzle.path}/are-you-there/timeout/`;\n EventBus.publish(topic, {});\n }\n setShowAreYouThere(true);\n\n // Pause the appropriate timer to prevent repeated calls\n if (hasPoured) {\n pausePourTimer();\n } else {\n pause();\n }\n } else {\n // Handle timer based on rejection policy\n switch (areYouThereRejectionPolicy) {\n case \"pause\":\n if (hasPoured) {\n pausePourTimer();\n } else {\n pause();\n }\n break;\n case \"restart\":\n if (hasPoured) {\n restartPourTimer();\n } else {\n restart();\n }\n break;\n case \"none\":\n // Do nothing - let timers continue\n break;\n }\n }\n }, [onBeforeAreYouThereTimer, nozzle, areYouThereRejectionPolicy, hasPoured]);\n\n const clearAreYouThere = useCallback(() => {\n setShowAreYouThere(false);\n ambientPause();\n if (hasPoured) {\n restartPourTimer();\n pause();\n } else {\n restart();\n pausePourTimer();\n }\n }, [hasPoured, pause, pausePourTimer, restart, restartPourTimer]);\n\n // Add the Are You There callback to the timers\n useEffect(() => {\n if (idleTimer) {\n idleTimer.addTimeoutAction({\n name: \"are-you-there-timer\",\n remainingTime: areYouThereTimeout,\n action: handleAreYouThereTimer,\n });\n }\n }, [idleTimer, areYouThereTimeout, handleAreYouThereTimer]);\n\n useEffect(() => {\n if (pourIdleTimer) {\n pourIdleTimer.addTimeoutAction({\n name: \"pour-are-you-there-timer\",\n remainingTime: areYouTherePourTimeout,\n action: handleAreYouThereTimer,\n });\n }\n }, [pourIdleTimer, areYouTherePourTimeout, handleAreYouThereTimer]);\n\n // Add timers to the kit\n kit?.timers?.add(idleTimer);\n kit?.timers?.add(pourIdleTimer);\n\n const handlePour = useCallback(() => {\n setHasPoured(false);\n pausePourTimer();\n pause();\n ambientPause();\n }, [pause, pausePourTimer]);\n\n const handlePourCancel = useCallback(() => {\n setHasPoured(true);\n log.info(\"restarting pour timer\");\n restartPourTimer();\n ambientPause();\n pause();\n }, [pause, restartPourTimer]);\n\n const handleBeforePourRejected = useCallback(() => {\n setHasPoured(false);\n log.info(\"restarting pour timer on before pour rejected\");\n pausePourTimer();\n restart();\n }, []);\n\n const handleBrandSelected = useCallback(() => {\n ambientPause();\n setShowAttractScreen(false);\n setShowAmbientScreen(false);\n restart();\n }, [ambientPause, restart]);\n\n const handleBrandCleared = useCallback(() => {\n setShowAttractScreen(false);\n setShowAmbientScreen(false);\n setHasPoured(false);\n pausePourTimer();\n ambientRestart();\n }, [ambientRestart, pausePourTimer]);\n\n const handleBeverageSelected = useCallback(() => {\n setShowAttractScreen(false);\n setShowAmbientScreen(false);\n setHasPoured(false);\n ambientPause();\n restart();\n }, [ambientPause, restart]);\n\n const handleBeverageCleared = useCallback(() => {\n setShowAttractScreen(false);\n setShowAmbientScreen(false);\n setHasPoured(false);\n ambientRestart();\n pause();\n pausePourTimer();\n }, [ambientRestart, pause, pausePourTimer]);\n\n const handleInit = useCallback(() => {\n setShowAttractScreen(false);\n setShowAmbientScreen(false);\n ambientRestart();\n pause();\n }, [ambientRestart, pause]);\n\n useDispenseLifecycle({\n onBrandSelected: handleBrandSelected,\n onBrandCleared: handleBrandCleared,\n onBeverageSelected: handleBeverageSelected,\n onBeverageCleared: handleBeverageCleared,\n onPour: handlePour,\n onPourCancel: handlePourCancel,\n onBeforePourRejected: handleBeforePourRejected,\n onInit: handleInit,\n // The timer handlers are left out because this hook's own timers call them directly;\n // subscribing to their events as well would create an event loop.\n });\n\n const areYouThereCountdown = hasPoured\n ? areYouTherePourTimeout\n : areYouThereTimeout;\n\n useEffect(() => {\n if (nozzle && attractTimer) {\n const topic = `/kos/dispense/${nozzle?.path}/init/`;\n EventBus.publish(topic, {});\n }\n }, [nozzle, attractTimer]);\n\n return {\n showAreYouThere,\n clearAreYouThere,\n pauseIdleTimer: pause,\n restartIdleTimer: restart,\n areYouThereCountdown,\n showAmbientScreen,\n showAttractScreen,\n pauseScreenTimer: ambientPause,\n restartScreenTimer: ambientRestart,\n };\n};\n","import {\n getKosCompanionModel,\n type IKosDataModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport type { AvailabilityModel } from \"../../../models\";\nimport { useNozzleContext } from \"../../contexts/nozzle/nozzle-provider\";\ninterface Props {\n onFlavorSelected?: (\n flavor: AvailabilityModel,\n flavors: AvailabilityModel[]\n ) => void;\n onFlavorCleared?: () => void;\n companionType?: string;\n}\nexport const useFlavors = <\n F extends Record<string, any> = any,\n C extends IKosDataModel = IKosDataModel\n>({\n onFlavorSelected,\n onFlavorCleared,\n companionType,\n}: Props) => {\n const { model: nozzle } = useNozzleContext();\n const flavors = useMemo(\n () =>\n nozzle\n ?.getGroupAvailabilityItems<F>(\"flavors\")\n .filter((f) => f.visible) ?? [],\n [nozzle]\n );\n\n const companions = useMemo(() => {\n if (!companionType) return [];\n return flavors.map((flavor) =>\n getKosCompanionModel<C>(flavor, companionType)\n );\n }, [flavors, companionType]);\n const [selectedFlavors, setSelectedFlavors] = useState<\n AvailabilityModel[] | null\n >([]);\n\n const selectFlavor = useCallback(\n async (\n flavor: AvailabilityModel,\n context?: Record<string, any>,\n forceUpdate?: boolean\n ) => {\n setSelectedFlavors((previous) =>\n previous?.includes(flavor)\n ? [...previous.filter((p) => p !== flavor)]\n : [...(previous ?? []), flavor]\n );\n\n if (nozzle?.selectedPourable) {\n const { beverage } = nozzle.selectedPourable;\n await nozzle.setSelectedPourable(\n {\n beverage,\n additional: selectedFlavors ?? [],\n context,\n },\n forceUpdate\n );\n }\n onFlavorSelected?.(flavor, selectedFlavors ?? []);\n },\n [nozzle, onFlavorSelected, selectedFlavors]\n );\n\n const clear = useCallback(async () => {\n setSelectedFlavors([]);\n if (nozzle?.selectedPourable) {\n const { beverage } = nozzle.selectedPourable;\n nozzle.setSelectedPourable({ beverage });\n onFlavorCleared?.();\n }\n }, [nozzle, onFlavorCleared]);\n return {\n flavors,\n flavorCompanions: companions,\n selectFlavor,\n selectedFlavors,\n clearFlavors: clear,\n };\n};\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { DeviceAssembly, type DeviceAssemblyModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-device-assembly\n * @kosApiLevel 2\n */\nexport const useDeviceAssembly = () => {\n const modelId = DeviceAssembly.type;\n const result = useKosModel<DeviceAssemblyModel>({\n modelId,\n modelType: DeviceAssembly.type,\n options: {},\n });\n\n return result;\n};\n","import type { DeviceAssemblyModel } from \"../../../models\";\nimport { useDeviceAssembly } from \"./use-device-assembly\";\n\ninterface DeviceAssemblyProps {\n deviceAssembly: DeviceAssemblyModel;\n}\n\ntype HoCDeviceAssemblyProps = DeviceAssemblyProps;\n// react HOC to provide a DeviceAssembly to a component\n/**\n * @kosService dispense.use-device-assembly\n * @kosApiLevel 2\n */\nexport function withDeviceAssembly<\n T extends HoCDeviceAssemblyProps = HoCDeviceAssemblyProps\n>(WrappedComponent: React.ComponentType<T>) {\n return (props: Omit<T, keyof DeviceAssemblyProps>) => {\n const { model, status, KosModelLoader } = useDeviceAssembly();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} deviceAssembly={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Holder, type HolderModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport const useHolder = (id: string) => {\n const modelId = id;\n const result = useKosModel<HolderModel>({\n modelId,\n modelType: Holder.type,\n options: {},\n });\n\n return result;\n};\n","import type { HolderModel } from \"../../../models\";\nimport { useHolder } from \"./use-holder\";\n\ninterface HolderProps {\n holder: HolderModel;\n}\n// react HOC to provide a Holder to a component\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport function withHolder<T extends HolderProps = HolderProps>(\n id: string,\n WrappedComponent: React.ComponentType<T>\n) {\n return (props: Omit<T, keyof HolderProps>) => {\n const { model, status, KosModelLoader } = useHolder(id);\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} holder={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { HolderContainer, type HolderContainerModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport const useHolderContainer = () => {\n const modelId = HolderContainer.type;\n const result = useKosModel<HolderContainerModel>({\n modelId,\n modelType: HolderContainer.type,\n options: {},\n });\n\n return result;\n};\n","import type { HolderContainerModel } from \"../../../models\";\nimport { useHolderContainer } from \"./use-holder-container\";\n\ninterface HolderContainerProps {\n holderContainer: HolderContainerModel;\n}\n// react HOC to provide a HolderContainer to a component\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport function withHolderContainer<\n T extends HolderContainerProps = HolderContainerProps\n>(WrappedComponent: React.ComponentType<T>) {\n return (props: Omit<T, keyof HolderContainerProps>) => {\n const { model, status, KosModelLoader } = useHolderContainer();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} holderContainer={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Ingredient, type IngredientModel } from \"../../../models\";\n\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const useIngredient = () => {\n const modelId = Ingredient.type;\n const result = useKosModel<IngredientModel>({\n modelId,\n modelType: Ingredient.type,\n options: {},\n });\n\n return result;\n};\n","import { useCallback } from \"react\";\n\nimport { KosLog, LogGroup, usePressGesture } from \"@kosdev-code/kos-ui-sdk\";\nimport type { ReactDOMAttributes } from \"@use-gesture/react/dist/declarations/src/types\";\nimport type { IntentAware } from \"../../../models\";\nimport { HoldToPourIntentStrategy } from \"../utils/pour-strategy/hold-to-pour-intent-strategy\";\nimport type { PourStrategy } from \"../utils/pour-strategy/pour-strategy\";\n\ninterface IngredientPourProps {\n onPour?: () => void;\n onPourCancel?: () => void;\n intentContainer: IntentAware;\n strategy?: PourStrategy<IntentAware>;\n}\n\n/**\n * @kosService dispense.ingredient\n * @kosApiLevel 2\n */\nexport interface IngredientPourResponse {\n handlers: (...args: any[]) => ReactDOMAttributes;\n cancel: () => void;\n\n status?: {\n canPour: boolean;\n isPouring: boolean;\n };\n}\n\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"useNozzlePour\",\n});\n/**\n * Handles press-to-pour for an intent-aware model, such as a holder or pump. Returns gesture handlers\n * to spread onto a DOM element; touch and mouse input are both detected.\n *\n * @param onPour - callback initiated after pouring starts\n * @param onPourCancel - callback initiated after pouring is cancelled\n * @returns handlers - gesture handlers for pouring\n *\n * @example\n * ```tsx\n * const { handlers } = useIngredientPour({ intentContainer: holder, onPour, onPourCancel });\n * return <button {...handlers()}>Pour</button>;\n * ```\n *\n * @see {@link IntentAware.performIntent}\n * @see {@link usePressGesture}\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const useIngredientPour = ({\n onPour,\n onPourCancel,\n intentContainer,\n strategy = HoldToPourIntentStrategy,\n}: IngredientPourProps): IngredientPourResponse => {\n const handlePour = useCallback(() => {\n logger.debug(\n `[${strategy?.name}] - Pour initiated for model ${intentContainer?.id}.`\n );\n strategy?.initiate(intentContainer);\n onPour?.();\n }, [onPour, intentContainer, strategy]);\n\n const handleCancelPour = useCallback(() => {\n logger.debug(\n `[${strategy?.name}] - Pour initiate ended called for nozzle ${intentContainer?.id}.`\n );\n strategy?.initiateEnded?.(intentContainer);\n onPourCancel?.();\n }, [onPourCancel, intentContainer, strategy]);\n\n const forceCancelPour = useCallback(() => {\n logger.debug(`Force cancelling pour for nozzle ${intentContainer?.id}.`);\n intentContainer?.cancelPour();\n onPourCancel?.();\n }, [onPourCancel, intentContainer]);\n\n const handlers = usePressGesture({\n onPressed: handlePour,\n onRelease: handleCancelPour,\n });\n\n return {\n handlers: handlers.dom,\n cancel: forceCancelPour,\n status: intentContainer,\n };\n};\n","import type { IngredientModel } from \"../../../models\";\nimport { useIngredient } from \"./use-ingredient\";\n\ninterface IngredientProps {\n ingredient: IngredientModel;\n}\n// react HOC to provide a Ingredient to a component\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport function withIngredient<T extends IngredientProps = IngredientProps>(\n WrappedComponent: React.ComponentType<T>\n) {\n return (props: Omit<T, keyof IngredientProps>) => {\n const { model, status, KosModelLoader } = useIngredient();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} ingredient={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n IngredientContainer,\n type IngredientContainerModel,\n} from \"../../../models\";\n\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const useIngredientContainer = () => {\n const modelId = IngredientContainer.type;\n const result = useKosModel<IngredientContainerModel>({\n modelId,\n modelType: IngredientContainer.type,\n options: {},\n });\n\n return result;\n};\n","import type { IngredientContainerModel } from \"../../../models\";\nimport { useIngredientContainer } from \"./use-ingredient-container\";\n\ninterface IngredientContainerProps {\n ingredientContainer: IngredientContainerModel;\n}\n// react HOC to provide a IngredientContainer to a component\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport function withIngredientContainer<\n T extends IngredientContainerProps = IngredientContainerProps\n>(WrappedComponent: React.ComponentType<T>) {\n return (props: Omit<T, keyof IngredientContainerProps>) => {\n const { model, status, KosModelLoader } = useIngredientContainer();\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} ingredientContainer={model} />\n </KosModelLoader>\n );\n };\n}\n","import type { NozzleModel } from \"../../../models\";\nimport { useNozzle } from \"./use-nozzle\";\n\ninterface NozzleProps {\n nozzle: NozzleModel;\n}\n// react HOC to provide a Nozzle to a component\n/**\n * @kosService dispense.use-nozzle\n * @kosApiLevel 2\n */\nexport function withNozzle<T extends NozzleProps = NozzleProps>(\n path: string,\n WrappedComponent: React.ComponentType<T>\n) {\n return (props: Omit<T, keyof NozzleProps>) => {\n const { model, status, KosModelLoader } = useNozzle(path);\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} nozzle={model} />\n </KosModelLoader>\n );\n };\n}\n","import { useCallback, useState } from \"react\";\n\nimport { KosLog, LogGroup, usePressGesture } from \"@kosdev-code/kos-ui-sdk\";\nimport type { ReactDOMAttributes } from \"@use-gesture/react/dist/declarations/src/types\";\nimport type { PourState } from \"../../../models/models/types/pouring\";\nimport { useNozzleContext } from \"../../contexts/nozzle\";\nimport { PourContext } from \"../../utils/pour-context\";\nimport { HoldToPourStrategy } from \"../utils/pour-strategy/hold-to-pour-strategy\";\nimport type { PourStrategy } from \"../utils/pour-strategy/pour-strategy\";\n\ninterface NozzlePourProps {\n onBeforePour?: (context?: PourContext) => Promise<boolean>;\n onBeforePourRejected?: () => void;\n onPour?: () => void;\n onPourCancel?: () => void;\n strategy?: PourStrategy;\n pourContext?: PourContext;\n}\n\n/**\n * @kosService dispense.nozzle\n * @kosApiLevel 2\n */\nexport interface NozzlePourResponse {\n handlers: (...args: any[]) => ReactDOMAttributes;\n cancel: () => void;\n updatePourContext?: (key: string, value: any) => void;\n removeFromPourContext?: (key: string) => void;\n status?: {\n canPour: boolean;\n isPouring: boolean;\n currentState: PourState;\n pourProgress: number;\n };\n}\n\nconst logger = KosLog.createLogger({\n group: LogGroup.ui,\n name: \"useNozzlePour\",\n});\n/**\n * Handles press-to-pour on the nozzle from the nearest nozzle context. Returns gesture handlers to\n * spread onto a DOM element; touch and mouse input are both detected.\n *\n * @param onPour - callback initiated after pouring starts\n * @param onPourCancel - callback initiated after pouring is cancelled\n * @returns handlers - gesture handlers for nozzle pouring\n *\n * @example\n * ```tsx\n * const { handlers } = useNozzlePour({ onPour, onPourCancel });\n * return <button {...handlers()}>Pour</button>;\n * ```\n *\n * @see {@link NozzleModel.pour}\n * @see {@link NozzleModel.cancelPour}\n * @see {@link usePressGesture}\n * @kosService dispense.use-nozzle\n * @kosApiLevel 2\n */\nexport const useNozzlePour = ({\n onPour,\n onPourCancel,\n onBeforePour,\n onBeforePourRejected,\n pourContext,\n strategy = HoldToPourStrategy,\n}: NozzlePourProps): NozzlePourResponse => {\n const { model: nozzle } = useNozzleContext();\n const [context, _setContext] = useState<PourContext>(\n pourContext || new PourContext()\n );\n const handlePour = useCallback(async () => {\n const canPour = onBeforePour ? await onBeforePour?.(context) : true;\n if (canPour) {\n logger.debug(\n `[${strategy?.name}] - Pour initiated for nozzle ${nozzle?.id}.`\n );\n strategy?.initiate(nozzle);\n onPour?.();\n } else {\n logger.debug(\n `[${strategy?.name}] - Did not pass onBeforePour gate for nozzle ${nozzle?.id}. Cancelling pour.`\n );\n onBeforePourRejected?.();\n }\n }, [\n onPour,\n nozzle,\n strategy,\n onBeforePour,\n onPourCancel,\n context,\n onBeforePourRejected,\n ]);\n\n const handleCancelPour = useCallback(() => {\n logger.debug(\n `[${strategy?.name}] - Pour initiate ended called for nozzle ${nozzle?.id}.`\n );\n strategy?.initiateEnded?.(nozzle);\n onPourCancel?.();\n }, [onPourCancel, nozzle, strategy]);\n\n const forceCancelPour = useCallback(() => {\n logger.debug(`Force cancelling pour for nozzle ${nozzle?.id}.`);\n nozzle?.cancelPour();\n onPourCancel?.();\n }, [onPourCancel, nozzle]);\n\n const handleUpdateContext = useCallback(\n (key: string, value: any) => {\n context.set(key, value);\n },\n [context]\n );\n\n const handleRemoveFromContext = useCallback(\n (key: string) => {\n context.remove(key);\n },\n [context]\n );\n const handlers = usePressGesture({\n onPressed: handlePour,\n onRelease: handleCancelPour,\n });\n\n return {\n handlers: handlers.dom,\n cancel: forceCancelPour,\n updatePourContext: handleUpdateContext,\n removeFromPourContext: handleRemoveFromContext,\n status: nozzle,\n };\n};\n","import { useCallback, useState } from \"react\";\n\nimport { KosLog, LogGroup, usePressGesture } from \"@kosdev-code/kos-ui-sdk\";\nimport type { ReactDOMAttributes } from \"@use-gesture/react/dist/declarations/src/types\";\nimport type { PourStrategyAware } from \"../../../models/models/nozzle/types\";\nimport type { PourState } from \"../../../models/models/types/pouring\";\nimport { PourContext } from \"../../utils/pour-context\";\nimport { HoldToPourStrategy } from \"../utils/pour-strategy/hold-to-pour-strategy\";\nimport type { PourStrategy } from \"../utils/pour-strategy/pour-strategy\";\n\ninterface PourProps {\n onBeforePour?: (context?: PourContext) => Promise<boolean>;\n onPour?: () => void;\n onPourCancel?: () => void;\n onPourAbort?: () => void;\n pourTarget: PourStrategyAware;\n strategy?: PourStrategy;\n pourContext?: PourContext;\n}\n\nexport interface PourResponse {\n handlers: (...args: any[]) => ReactDOMAttributes;\n updatePourContext?: (key: string, value: any) => void;\n removeFromPourContext?: (key: string) => void;\n cancel: () => void;\n\n status?: {\n canPour: boolean;\n isPouring: boolean;\n currentState: PourState;\n };\n}\n\nconst logger = KosLog.createLogger({ group: LogGroup.ui, name: \"usePour\" });\n/**\n * Handles press-to-pour on any {@link PourStrategyAware} target. Returns gesture handlers to spread onto a DOM element;\n * touch and mouse input are both detected.\n *\n * @param onPour - callback initiated after pouring starts\n * @param onPourCancel - callback initiated after pouring is cancelled\n * @returns handlers - gesture handlers for pouring\n *\n * @example\n * ```tsx\n * const { handlers } = usePourTarget({ pourTarget: nozzle, onPour, onPourCancel });\n * return <button {...handlers()}>Pour</button>;\n * ```\n *\n * @see {@link usePressGesture}\n **/\nexport const usePourTarget = ({\n onBeforePour,\n onPour,\n onPourCancel,\n onPourAbort,\n pourTarget,\n pourContext,\n strategy = HoldToPourStrategy,\n}: PourProps): PourResponse => {\n const [context, _setContext] = useState<PourContext>(\n pourContext || new PourContext()\n );\n const handlePour = useCallback(async () => {\n logger.debug(\n `[${strategy?.name}] - calling before pour for pour target ${pourTarget?.id}.`\n );\n const canPour = onBeforePour ? await onBeforePour?.(context) : true;\n if (canPour) {\n logger.debug(\n `[${strategy?.name}] - Pour initiated for pour target ${pourTarget?.id}.`\n );\n await strategy?.initiate(pourTarget);\n onPour?.();\n if (!pourTarget?.isPouring) {\n onPourAbort?.();\n }\n } else {\n logger.debug(\n `[${strategy?.name}] - Pour cancelled for pour target ${pourTarget?.id}.`\n );\n onPourCancel?.();\n }\n }, [onPour, onBeforePour, onPourAbort, pourTarget, strategy, context]);\n\n const handleCancelPour = useCallback(async () => {\n logger.debug(\n `[${strategy?.name}] - Pour initiate ended called for pour target ${pourTarget?.id}.`\n );\n const ignore = await strategy?.initiateEnded?.(pourTarget);\n if (!ignore) {\n onPourCancel?.();\n }\n }, [onPourCancel, pourTarget, strategy]);\n\n const forceCancelPour = useCallback(async () => {\n logger.debug(`Force cancelling pour for pour target ${pourTarget?.id}.`);\n await pourTarget?.cancelPour();\n onPourCancel?.();\n }, [onPourCancel, pourTarget]);\n\n const handleUpdateContext = useCallback(\n (key: string, value: any) => {\n context.set(key, value);\n },\n [context]\n );\n\n const handleRemoveFromContext = useCallback(\n (key: string) => {\n context.remove(key);\n },\n [context]\n );\n\n const handlers = usePressGesture({\n onPressed: handlePour,\n onRelease: handleCancelPour,\n });\n\n return {\n handlers: handlers.dom,\n cancel: forceCancelPour,\n updatePourContext: handleUpdateContext,\n removeFromPourContext: handleRemoveFromContext,\n status: pourTarget,\n };\n};\n","import { useKosModel, type KosData } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n GenericPour,\n type GenericPourModel,\n type GenericPourOptions,\n} from \"../../../models/models/generic-pour\";\n\n/**\n * @kosService dispense.use-generic-pour\n * @kosApiLevel 4\n */\nexport const useGenericPour = (\n id: string,\n servicePathFactory: (\n selectedId: string,\n context?: KosData<Record<string, any>>\n ) => string,\n itemId?: string,\n data?: Record<string, any>\n) => {\n const modelId = id;\n const result = useKosModel<GenericPourModel, GenericPourOptions>({\n modelId,\n modelType: GenericPour.type,\n forceUpdate: true,\n options: {\n servicePathFactory,\n selectedId: itemId,\n initialData: data,\n },\n });\n\n return result;\n};\n","import { GenericPourModel } from \"../../../models/models/generic-pour\";\nimport { useGenericPour } from \"./use-generic-pour\";\n\ninterface GenericPourProps {\n genericPour: GenericPourModel;\n}\n\ninterface Identifiable {\n id: string;\n servicePathFactory: (selectedId: string) => string;\n itemId?: string;\n}\n\ntype HoCGenericPourProps = GenericPourProps & Identifiable;\n// react HOC to provide a GenericPour to a component\n/**\n * @kosService dispense.use-generic-pour\n * @kosApiLevel 4\n */\nexport function withGenericPour<\n T extends HoCGenericPourProps = HoCGenericPourProps\n>(WrappedComponent: React.ComponentType<T>) {\n return (props: Omit<T, keyof GenericPourProps>) => {\n const { model, status, KosModelLoader } = useGenericPour(\n props.id,\n props.servicePathFactory,\n props.itemId\n );\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} genericPour={model} />\n </KosModelLoader>\n );\n };\n}\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { AssemblyModel } from \"../../../models/models/assembly\";\nimport { useAssembly } from \"../../hooks\";\n\ninterface AssemblyType<\n AssemblyExt extends object = any,\n HolderExt extends object = any\n> {\n model?: AssemblyModel<AssemblyExt, HolderExt>;\n}\nconst Assembly = createContext<AssemblyType | undefined>(undefined);\n\ninterface AssemblyProviderProps {}\n\n/**\n * @kosService dispense.use-assembly\n * @kosApiLevel 2\n */\nexport const AssemblyProvider: React.FunctionComponent<\n PropsWithChildren<AssemblyProviderProps>\n> = ({ children }) => {\n const { model, ready } = useAssembly();\n const value: AssemblyType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return <Assembly.Provider value={value}>{children}</Assembly.Provider>;\n};\n/**\n * @kosService dispense.use-assembly\n * @kosApiLevel 2\n */\nexport const useAssemblyContext = <\n AssemblyExt extends object = any,\n HolderExt extends object = any\n>() => {\n const context: AssemblyType<AssemblyExt, HolderExt> = useContext(\n Assembly\n ) as AssemblyType<AssemblyExt, HolderExt>;\n if (!context) {\n throw new Error(\n \"useAssemblyContext must be used within a AssemblyProvider\"\n );\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { AvailabilityModel } from \"../../../models\";\nimport { useAvailability } from \"../../hooks/availability/use-availability\";\n\ninterface AvailabilityType {\n model?: AvailabilityModel;\n}\nconst Availability = createContext<AvailabilityType | undefined>(undefined);\n\ninterface AvailabilityProviderProps {\n id?: string;\n}\n\n/**\n * @kosService dispense.use-availability\n * @kosApiLevel 2\n */\nexport const AvailabilityProvider: React.FunctionComponent<\n PropsWithChildren<AvailabilityProviderProps>\n> = ({ children }) => {\n const { model, ready } = useAvailability();\n const value: AvailabilityType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return (\n <Availability.Provider value={value}>{children}</Availability.Provider>\n );\n};\n/**\n * @kosService dispense.use-availability\n * @kosApiLevel 2\n */\nexport const useAvailabilityContext = () => {\n const context = useContext(Availability);\n if (!context) {\n throw new Error(\n \"useAvailabilityContext must be used within a AvailabilityProvider\"\n );\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { BoardModel } from \"../../../models\";\nimport { useBoard } from \"../../hooks/board/use-board\";\n\ninterface BoardType {\n model?: BoardModel;\n}\nconst Board = createContext<BoardType | undefined>(undefined);\n\ninterface BoardProviderProps {\n id: string;\n}\n\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport const BoardProvider: React.FunctionComponent<\n PropsWithChildren<BoardProviderProps>\n> = ({ children, id }) => {\n const { model, ready } = useBoard(id);\n const value: BoardType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return <Board.Provider value={value}>{children}</Board.Provider>;\n};\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport const useBoardContext = () => {\n const context = useContext(Board);\n if (!context) {\n throw new Error(\"useBoardContext must be used within a BoardProvider\");\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { BoardContainerModel } from \"../../../models\";\nimport { useBoardContainer } from \"../../hooks/board-container/use-board-container\";\n\ninterface BoardContainerType {\n model?: BoardContainerModel;\n}\nconst BoardContainer = createContext<BoardContainerType | undefined>(undefined);\n\ninterface BoardContainerProviderProps {}\n\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport const BoardContainerProvider: React.FunctionComponent<\n PropsWithChildren<BoardContainerProviderProps>\n> = ({ children }) => {\n const { model, ready } = useBoardContainer();\n const value: BoardContainerType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return (\n <BoardContainer.Provider value={value}>{children}</BoardContainer.Provider>\n );\n};\n/**\n * @kosService dispense.use-board\n * @kosApiLevel 2\n */\nexport const useBoardContainerContext = () => {\n const context = useContext(BoardContainer);\n if (!context) {\n throw new Error(\n \"useBoardContainerContext must be used within a BoardContainerProvider\"\n );\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport { DeviceAssemblyModel } from \"../../../models\";\nimport { useDeviceAssembly } from \"../../hooks/device-assembly/use-device-assembly\";\n\ninterface DeviceAssemblyType {\n model?: DeviceAssemblyModel;\n nozzlePaths?: string[];\n}\nconst DeviceAssemblyContext = createContext<DeviceAssemblyType | undefined>(\n undefined\n);\n\ntype DeviceAssemblyProviderProps = object;\n\n/**\n * @kosService dispense.use-device-assembly\n * @kosApiLevel 2\n */\nexport const DeviceAssemblyProvider: React.FunctionComponent<\n PropsWithChildren<DeviceAssemblyProviderProps>\n> = ({ children }) => {\n const { model, ready } = useDeviceAssembly();\n const value: DeviceAssemblyType = useMemo(() => {\n if (ready && model) {\n const nozzlePaths = model.nozzlePaths;\n return { model, nozzlePaths };\n }\n return {};\n }, [ready, model]);\n\n const content = ready && model ? children : null;\n return (\n <DeviceAssemblyContext.Provider value={value}>\n {content}\n </DeviceAssemblyContext.Provider>\n );\n};\n/**\n * @kosService dispense.use-device-assembly\n * @kosApiLevel 2\n */\nexport const useDeviceAssemblyContext = () => {\n const context = useContext(DeviceAssemblyContext);\n if (!context) {\n throw new Error(\n \"useDeviceAssemblyContext must be used within a DeviceAssemblyProvider\"\n );\n }\n return context;\n};\n","import { usePressGesture } from \"@kosdev-code/kos-ui-sdk\";\nimport type { ReactDOMAttributes } from \"@use-gesture/react/dist/declarations/src/types\";\nimport React, { useContext, type ReactNode } from \"react\";\nimport type { CuiPourOptions } from \"../../../models\";\nimport {\n useCuiKit,\n type CuiKitType,\n type UseCuiKitProps,\n} from \"../../hooks/cui-kit/use-cui-kit\";\nimport {\n DeviceAssemblyProvider,\n useDeviceAssemblyContext,\n} from \"../device-assembly/device-assembly-provider\";\nimport { NozzleProvider } from \"../nozzle/nozzle-provider\";\n\nfunction createDispenseKitContext<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n>() {\n const CuiKitContext = React.createContext<CuiKitType<\n BrandData,\n BeverageData,\n FlavorData\n > | null>(null);\n\n const useCuiKitContext = () => {\n const ctx = useContext(CuiKitContext);\n if (ctx === undefined) {\n throw new Error(\"useDispenseKitContext must be used within a Provider\");\n }\n return ctx;\n };\n\n /**\n * A pour control for one element, such as a beverage tile that pours when pressed. Each\n * element gets its own gesture; all of them pour through the kit.\n */\n const useCuiPour = (options: CuiPourOptions = {}): CuiPourControl => {\n const kit = useContext(CuiKitContext);\n const gesture = usePressGesture({\n onPressed: () => void kit?.pour.press(options),\n onRelease: () => kit?.pour.release(options),\n });\n return {\n handlers: gesture.dom,\n start: async () => (await kit?.pour.start(options)) ?? false,\n cancel: () => kit?.pour.cancel(),\n };\n };\n\n return [useCuiKitContext, CuiKitContext.Provider, useCuiPour] as const;\n}\n\n/**\n * A pour control returned by the kit's `useCuiPour` hook.\n * @kosService dispense.cui-kit\n * @kosApiLevel 17\n */\nexport interface CuiPourControl {\n /** Gesture handlers to spread onto the element. */\n handlers: (...args: any[]) => ReactDOMAttributes;\n /** Starts the pour without a gesture. */\n start: () => Promise<boolean>;\n /** Cancels the kit's active pour. */\n cancel: () => void;\n}\n\nexport function CuiKitWrapper<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n>({\n children,\n provider: CuiKitProvider,\n props,\n nozzleProps,\n}: DispenseViewProps & { nozzleProps?: CuiKitNozzleProps }) {\n const result = useCuiKit<BrandData, BeverageData, FlavorData>(props);\n\n return (\n <CuiKitProvider value={result}>\n {children(nozzleProps || {})}\n </CuiKitProvider>\n );\n}\n\nexport interface CuiKitNozzleProps {\n nozzleIndex?: number;\n nozzlePath?: string;\n totalNozzles?: number;\n isFirstNozzle?: boolean;\n isLastNozzle?: boolean;\n}\n\ninterface DispenseViewProps<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n> {\n children: (props: CuiKitNozzleProps) => ReactNode;\n provider: React.Provider<CuiKitType<\n BrandData,\n BeverageData,\n FlavorData\n > | null>;\n props: UseCuiKitProps;\n}\nfunction DispenseView<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n>({\n children,\n provider,\n props,\n}: DispenseViewProps<BrandData, BeverageData, FlavorData>) {\n const { nozzlePaths } = useDeviceAssemblyContext();\n const totalNozzles = nozzlePaths?.length || 0;\n\n const nozzles =\n nozzlePaths?.map((path, index) => (\n <NozzleProvider key={path} path={path}>\n <CuiKitWrapper<BrandData, BeverageData, FlavorData>\n provider={provider}\n props={props}\n nozzleProps={{\n nozzleIndex: index,\n nozzlePath: path,\n totalNozzles,\n isFirstNozzle: index === 0,\n isLastNozzle: index === totalNozzles - 1,\n }}\n >\n {children}\n </CuiKitWrapper>\n </NozzleProvider>\n )) || [];\n return nozzles;\n}\n\nexport interface CuiKitProps {\n children: (props: CuiKitNozzleProps) => ReactNode;\n}\n\ninterface CuiKitProviderProps<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n> {\n provider: React.Provider<CuiKitType<\n BrandData,\n BeverageData,\n FlavorData\n > | null>;\n props: UseCuiKitProps;\n}\nexport function CuiKit<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n>({\n provider,\n props,\n}: CuiKitProviderProps<BrandData, BeverageData, FlavorData>) {\n return ({ children }: CuiKitProps) =>\n provider ? (\n <DeviceAssemblyProvider>\n <DispenseView<BrandData, BeverageData, FlavorData>\n provider={provider}\n props={props}\n >\n {children}\n </DispenseView>\n </DeviceAssemblyProvider>\n ) : null;\n}\n\nexport function initializeCuiKit<\n BrandData extends Record<string, any> = any,\n BeverageData extends Record<string, any> = any,\n FlavorData extends Record<string, any> = any\n>(props: UseCuiKitProps) {\n const [useCuiKitContext, DispenseKitProvider, useCuiPour] =\n createDispenseKitContext<BrandData, BeverageData, FlavorData>();\n return [\n useCuiKitContext,\n CuiKit({ provider: DispenseKitProvider, props }),\n useCuiPour,\n ] as const;\n}\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { HolderModel } from \"../../../models\";\nimport { useHolder } from \"../../hooks/holder/use-holder\";\n\ninterface HolderType {\n model?: HolderModel;\n}\nconst Holder = createContext<HolderType | undefined>(undefined);\n\ninterface HolderProviderProps {\n id?: string;\n}\n\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport const HolderProvider: React.FunctionComponent<\n PropsWithChildren<HolderProviderProps>\n> = ({ children, id }) => {\n const { model, ready } = useHolder(id || \"\");\n const value: HolderType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return <Holder.Provider value={value}>{children}</Holder.Provider>;\n};\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport const useHolderContext = () => {\n const context = useContext(Holder);\n if (!context) {\n throw new Error(\"useHolderContext must be used within a HolderProvider\");\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport { type HolderContainerModel } from \"../../../models\";\nimport { useHolderContainer } from \"../../hooks/holder-container/use-holder-container\";\n\ninterface HolderContainerType {\n model?: HolderContainerModel;\n}\nconst HolderContainer = createContext<HolderContainerType | undefined>(\n undefined\n);\n\ninterface HolderContainerProviderProps {\n id?: string;\n}\n\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport const HolderContainerProvider: React.FunctionComponent<\n PropsWithChildren<HolderContainerProviderProps>\n> = ({ children }) => {\n const { model, ready } = useHolderContainer();\n const value: HolderContainerType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return (\n <HolderContainer.Provider value={value}>\n {children}\n </HolderContainer.Provider>\n );\n};\n/**\n * @kosService dispense.use-holder\n * @kosApiLevel 2\n */\nexport const useHolderContainerContext = () => {\n const context = useContext(HolderContainer);\n if (!context) {\n throw new Error(\n \"useHolderContainerContext must be used within a HolderContainerProvider\"\n );\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { IngredientModel } from \"../../../models\";\nimport { useIngredient } from \"../../hooks/ingredient/use-ingredient\";\n\ninterface IngredientType {\n model?: IngredientModel;\n}\nconst Ingredient = createContext<IngredientType | undefined>(undefined);\n\ninterface IngredientProviderProps {\n id?: string;\n}\n\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const IngredientProvider: React.FunctionComponent<\n PropsWithChildren<IngredientProviderProps>\n> = ({ children }) => {\n const { model, ready } = useIngredient();\n const value: IngredientType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return <Ingredient.Provider value={value}>{children}</Ingredient.Provider>;\n};\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const useIngredientContext = () => {\n const context = useContext(Ingredient);\n if (!context) {\n throw new Error(\n \"useIngredientContext must be used within a IngredientProvider\"\n );\n }\n return context;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { IngredientContainerModel } from \"../../../models\";\nimport { useIngredientContainer } from \"../../hooks/ingredient-container/use-ingredient-container\";\n\ninterface IngredientContainerType {\n model?: IngredientContainerModel;\n}\nconst IngredientContainer = createContext<IngredientContainerType | undefined>(\n undefined\n);\n\ninterface IngredientContainerProviderProps {\n id?: string;\n}\n\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const IngredientContainerProvider: React.FunctionComponent<\n PropsWithChildren<IngredientContainerProviderProps>\n> = ({ children }) => {\n const { model, ready } = useIngredientContainer();\n const value: IngredientContainerType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return (\n <IngredientContainer.Provider value={value}>\n {children}\n </IngredientContainer.Provider>\n );\n};\n/**\n * @kosService dispense.use-ingredient\n * @kosApiLevel 2\n */\nexport const useIngredientContainerContext = () => {\n const context = useContext(IngredientContainer);\n if (!context) {\n throw new Error(\n \"useIngredientContainerContext must be used within a IngredientContainerProvider\"\n );\n }\n return context;\n};\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { Pump, type PumpModel } from \"../../../models\";\n\nexport const usePump = () => {\n const modelId = Pump.type;\n const result = useKosModel<PumpModel>({\n modelId,\n modelType: Pump.type,\n options: {},\n });\n\n return result;\n};\n","import { PropsWithChildren, createContext, useContext, useMemo } from \"react\";\nimport type { PumpModel } from \"../../../models\";\nimport { usePump } from \"../../hooks/pump/use-pump\";\n\ninterface PumpType {\n model?: PumpModel;\n}\nconst Pump = createContext<PumpType | undefined>(undefined);\n\ninterface PumpProviderProps {\n id?: string;\n}\n\n/**\n * @kosService dispense.use-pump\n * @kosApiLevel 2\n */\nexport const PumpProvider: React.FunctionComponent<\n PropsWithChildren<PumpProviderProps>\n> = ({ children }) => {\n const { model, ready } = usePump();\n const value: PumpType = useMemo(() => {\n if (ready && model) {\n return { model };\n }\n return {};\n }, [ready, model]);\n return <Pump.Provider value={value}>{children}</Pump.Provider>;\n};\n/**\n * @kosService dispense.use-pump\n * @kosApiLevel 2\n */\nexport const usePumpContext = () => {\n const context = useContext(Pump);\n if (!context) {\n throw new Error(\"usePumpContext must be used within a PumpProvider\");\n }\n return context;\n};\n"],"names":["Assembly","useKosModel","jsx","Availability","Board","BoardContainer","Nozzle","createContext","useMemo","useContext","useState","getKosCompanionModel","useCallback","useEffect","kosAutoEffect","beverages","log","KosLog","LogGroup","logger","useRef","CuiKitState","cuiKitId","whenReady","usePressGesture","TimerManager","EventBus","DeviceAssembly","Holder","HolderContainer","Ingredient","IngredientContainer","PourContext","GenericPour","Pump"],"mappings":";;;;;AAOO,MAAM,cAAc,MAAM;AAC/B,QAAM,UAAUA,4BAAAA,SAAS;AACzB,QAAM,SAASC,SAAAA,YAA2B;AAAA,IACxC;AAAA,IACA,WAAWD,4BAAAA,SAAS;AAAA,IACpB,SAAS,CAAA;AAAA,EAAC,CACX;AAED,SAAO;AACT;ACLO,SAAS,aACd,kBACA;AACA,SAAO,CAAC,UAAwC;AAC9C,UAAM,EAAE,OAAO,QAAQ,eAAA,IAAmB,YAAA;AAE1C,WACEE,2BAAAA,IAAC,gBAAA,EAAgB,GAAG,QAClB,UAAAA,2BAAAA,IAAC,oBAAkB,GAAI,OAAa,UAAU,MAAA,CAAO,EAAA,CACvD;AAAA,EAEJ;AACF;AChBO,MAAM,kBAAkB,MAAM;AACnC,QAAM,UAA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