"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=require("../../hooks/use-on-unmount.js"),r=require("./menu-machine.js");const t=e.createContext(null);function o(t){let{id:o,__demoMode:u=!1}=t,s=e.useMemo((()=>r.MenuMachine.new({id:o,__demoMode:u})),[]);return n.useOnUnmount((()=>s.dispose())),s}exports.MenuContext=t,exports.useMenuMachine=o,exports.useMenuMachineContext=function(n){let r=e.useContext(t);if(null===r){let e=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,o),e}return r};
//# sourceMappingURL=menu-machine-glue.js.map
