{"version":3,"file":"use-navigator.cjs","names":["useContext","NavigatorContext"],"sources":["../../src/navigator/use-navigator.ts"],"sourcesContent":["import { useContext } from '@wordpress/element';\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance. This hook provides advanced functionality,\n * such as imperatively navigating to a new location (with options like\n * navigating back or skipping focus restoration) and accessing the current\n * location and path parameters.\n */\nexport function useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAUA,SAAgB,eAA0B;CACzC,MAAM,EAAE,UAAU,QAAQ,MAAM,QAAQ,gBAAA,GACvCA,mBAAAA,WAAAA,CAAYC,aAAAA,gBAAiB;CAE9B,OAAO;EACN;EACA;EACA;EACA;EACA;CACD;AACD"}