{"version":3,"sources":["webpack://Navigo/webpack/universalModuleDefinition","webpack://Navigo/./src/constants.ts","webpack://Navigo/./src/utils.ts","webpack://Navigo/./src/Q.ts","webpack://Navigo/./src/middlewares/setLocationPath.ts","webpack://Navigo/./src/middlewares/matchPathToRegisteredRoutes.ts","webpack://Navigo/./src/middlewares/checkForDeprecationMethods.ts","webpack://Navigo/./src/middlewares/checkForForceOp.ts","webpack://Navigo/./src/middlewares/updateBrowserURL.ts","webpack://Navigo/./src/middlewares/checkForLeaveHook.ts","webpack://Navigo/./src/middlewares/updateState.ts","webpack://Navigo/./src/lifecycles.ts","webpack://Navigo/./src/middlewares/checkForAlreadyHook.ts","webpack://Navigo/./src/middlewares/checkForBeforeHook.ts","webpack://Navigo/./src/middlewares/callHandler.ts","webpack://Navigo/./src/middlewares/checkForAfterHook.ts","webpack://Navigo/./src/middlewares/checkForNotFoundHandler.ts","webpack://Navigo/./src/middlewares/errorOut.ts","webpack://Navigo/./src/middlewares/flushCurrent.ts","webpack://Navigo/./src/middlewares/processMatches.ts","webpack://Navigo/./src/middlewares/waitingList.ts","webpack://Navigo/./src/index.ts","webpack://Navigo/webpack/bootstrap","webpack://Navigo/webpack/startup","webpack://Navigo/webpack/runtime/define property getters","webpack://Navigo/webpack/runtime/hasOwnProperty shorthand"],"names":["root","factory","exports","module","define","amd","self","this","PARAMETER_REGEXP","WILDCARD_REGEXP","NOT_SURE_REGEXP","getCurrentEnvURL","fallback","windowAvailable","location","pathname","search","hash","clean","s","replace","isString","extractHashFromURL","url","indexOf","split","pop","extractGETParameters","tmp","slice","join","parseQuery","queryString","query","pairs","i","length","pair","key","decodeURIComponent","Array","isArray","push","matchRoute","context","route","pattern","currentLocationPath","current","GETParams","params","paramNames","path","full","dots","name","hashString","to","data","regexp","RegExp","match","names","reduce","value","index","regExpResultToParams","groups","instance","pushStateAvailable","window","history","pushState","undefinedOrTrue","obj","accumulateHooks","hooks","result","filter","h","forEach","type","Q","funcs","c","done","idx","next","splice","moveForward","setLocationPath","_checkForAHash","matchPathToRegisteredRoutes","routes","matches","resolveOptions","strategy","checkForDeprecationMethods","navigateOptions","console","warn","checkForForceOp","force","_setCurrent","_pathToMatchObject","if","condition","one","two","isWindowAvailable","isPushStateAvailable","updateBrowserURL","isItUsingHash","historyAPIMethod","stateObj","title","__freezeListening","setTimeout","href","checkForLeaveHook","lastResolved","map","oldMatch","_","leaveLoopDone","leave","runHook","newLocationVSOldMatch","matchLocation","find","f","d","shouldStop","__markAsClean","undefined","concat","updateState","foundLifecycle","already","before","handler","updatePageLinks","after","notFoundLifeCycle","notFoundRoute","_notFoundRoute","notFoundHandled","notFoundMatch","noMatchWarning","processMatches","nextMatch","waitingList","DEFAULT_LINK_SELECTOR","Navigo","appRoute","options","genericHooks","DEFAULT_RESOLVE_OPTIONS","linksSelector","destroyed","composePathWithRoot","createRoute","String","resolve","__dirty","__waiting","navigate","call","document","querySelectorAll","link","getAttribute","hasListenerAttached","navigoHandler","e","ctrlKey","metaKey","target","tagName","toLowerCase","URL","u","err","source","str","temp","v","parseNavigateOptions","preventDefault","stopPropagation","addEventListener","removeEventListener","generate","r","includeRoot","pathToMatchObject","addHook","func","getRoute","nameOrHandler","shift","on","Object","keys","p","uses","as","off","what","navigateByName","destroy","__popstateListener","notFound","getLinkPath","currentLocation","annotatePathWithRoot","getCurrentLocation","addBeforeHook","bind","addAfterHook","addAlreadyHook","addLeaveHook","_clean","__webpack_module_cache__","__webpack_require__","moduleId","__webpack_modules__","definition","o","defineProperty","enumerable","get","prop","prototype","hasOwnProperty"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,SAAU,GAAIH,GACK,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,IARnB,CASmB,oBAATK,KAAuBA,KAAOC,MAAM,WAC9C,O,yFCVO,IAAMC,EAAmB,eAEnBC,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B,KAAKnN,KAAM,UACxCA,KAAKoN,aAAevB,EAAQsB,KAAKnN,KAAM,SACvCA,KAAKqN,eAAiBxB,EAAQsB,KAAKnN,KAAM,WACzCA,KAAKsN,aAAezB,EAAQsB,KAAKnN,KAAM,SACvCA,KAAK+L,SAAWA,EAChB/L,KAAKiG,mBAAqB2F,EAC1B5L,KAAKuN,OAAS5M,EACdX,KAAKoF,eAAiBA,EACtBpF,KAAKgG,YAAc,SAACnB,GAAD,OAAQpC,EAAU1C,EAAK0C,QAAUoC,GAvPpD,WACM0B,IACFvG,KAAK4M,mBAAqB,WACnB7M,EAAK8G,mBACR+C,KAGJ7F,OAAOwH,iBAAiB,WAAYvL,KAAK4M,sBAkPtC5C,KAAKhK,MACZsI,EAAgB0B,KAAKhK,SC1cnBwN,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,GAAGF,EAAyBE,GAC3B,OAAOF,EAAyBE,GAAU/N,QAG3C,IAAIC,EAAS4N,EAAyBE,GAAY,CAGjD/N,QAAS,IAOV,OAHAgO,EAAoBD,GAAU9N,EAAQA,EAAOD,QAAS8N,GAG/C7N,EAAOD,QCjBf,OCFA8N,EAAoB7F,EAAI,SAASjI,EAASiO,GACzC,IAAI,IAAI7L,KAAO6L,EACXH,EAAoBI,EAAED,EAAY7L,KAAS0L,EAAoBI,EAAElO,EAASoC,IAC5EoK,OAAO2B,eAAenO,EAASoC,EAAK,CAAEgM,YAAY,EAAMC,IAAKJ,EAAW7L,MCJ3E0L,EAAoBI,EAAI,SAAS1J,EAAK8J,GAAQ,OAAO9B,OAAO+B,UAAUC,eAAenE,KAAK7F,EAAK8J,IFGxFR,EAAoB,K","file":"navigo.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Navigo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Navigo\"] = factory();\n\telse\n\t\troot[\"Navigo\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn ","export const PARAMETER_REGEXP = /([:*])(\\w+)/g;\nexport const REPLACE_VARIABLE_REGEXP = \"([^/]+)\";\nexport const WILDCARD_REGEXP = /\\*/g;\nexport const REPLACE_WILDCARD = \"?(?:.*)\";\nexport const NOT_SURE_REGEXP = /\\/\\?/g;\nexport const REPLACE_NOT_SURE = \"/?([^/]+|)\";\nexport const START_BY_SLASH_REGEXP = \"(?:/^|^)\";\nexport const MATCH_REGEXP_FLAGS = \"\";\n","import {\n RouteHooksStorage,\n Match,\n Route,\n NavigateOptions,\n ResolveOptions,\n QContext,\n ResolveStrategy,\n} from \"../index\";\n\nimport {\n PARAMETER_REGEXP,\n WILDCARD_REGEXP,\n REPLACE_VARIABLE_REGEXP,\n REPLACE_WILDCARD,\n START_BY_SLASH_REGEXP,\n MATCH_REGEXP_FLAGS,\n REPLACE_NOT_SURE,\n NOT_SURE_REGEXP,\n} from \"./constants\";\n\nexport function getCurrentEnvURL(fallback = \"/\"): string {\n if (windowAvailable()) {\n return location.pathname + location.search + location.hash;\n }\n return fallback;\n}\nexport function clean(s: string) {\n return s.replace(/\\/+$/, \"\").replace(/^\\/+/, \"\");\n}\nexport function isString(s: any): boolean {\n return typeof s === \"string\";\n}\nexport function isFunction(s: any): boolean {\n return typeof s === \"function\";\n}\nexport function extractHashFromURL(url: string) {\n if (url && url.indexOf(\"#\") >= 0) {\n return url.split(\"#\").pop() || \"\";\n }\n return \"\";\n}\nexport function regExpResultToParams(match, names: string[]) {\n if (names.length === 0) return null;\n if (!match) return null;\n return match.slice(1, match.length).reduce((params, value, index) => {\n if (params === null) params = {};\n params[names[index]] = decodeURIComponent(value);\n return params;\n }, null);\n}\nexport function extractGETParameters(url: string) {\n const tmp = clean(url).split(/\\?(.*)?$/);\n return [clean(tmp[0]), tmp.slice(1).join(\"\")];\n}\nexport function parseQuery(queryString: string): Object {\n var query = {};\n var pairs = queryString.split(\"&\");\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i].split(\"=\");\n if (pair[0] !== \"\") {\n let key = decodeURIComponent(pair[0]);\n if (!query[key]) {\n query[key] = decodeURIComponent(pair[1] || \"\");\n } else {\n if (!Array.isArray(query[key])) query[key] = [query[key]];\n query[key].push(decodeURIComponent(pair[1] || \"\"));\n }\n }\n }\n return query;\n}\nexport function matchRoute(context: QContext, route: Route): false | Match {\n const [current, GETParams] = extractGETParameters(\n clean(context.currentLocationPath)\n );\n const params = GETParams === \"\" ? null : parseQuery(GETParams);\n const paramNames = [];\n let pattern;\n if (isString(route.path)) {\n pattern =\n START_BY_SLASH_REGEXP +\n clean(route.path as string)\n .replace(PARAMETER_REGEXP, function (full, dots, name) {\n paramNames.push(name);\n return REPLACE_VARIABLE_REGEXP;\n })\n .replace(WILDCARD_REGEXP, REPLACE_WILDCARD)\n .replace(NOT_SURE_REGEXP, REPLACE_NOT_SURE) +\n \"$\";\n if (clean(route.path as string) === \"\") {\n if (clean(current) === \"\") {\n return {\n url: current,\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data: null,\n params,\n };\n }\n }\n } else {\n pattern = route.path;\n }\n const regexp = new RegExp(pattern, MATCH_REGEXP_FLAGS);\n const match = current.match(regexp);\n\n if (match) {\n const data = isString(route.path)\n ? regExpResultToParams(match, paramNames)\n : match.groups\n ? match.groups\n : match.slice(1);\n return {\n url: clean(current.replace(new RegExp(`^${context.instance.root}`), \"\")),\n queryString: GETParams,\n hashString: extractHashFromURL(context.to),\n route: route,\n data,\n params,\n };\n }\n return false;\n}\nexport function pushStateAvailable(): boolean {\n return !!(\n typeof window !== \"undefined\" &&\n window.history &&\n window.history.pushState\n );\n}\nexport function undefinedOrTrue(obj, key: string): boolean {\n return typeof obj[key] === \"undefined\" || obj[key] === true;\n}\nexport function parseNavigateOptions(source?: string): NavigateOptions {\n if (!source) return {};\n const pairs = source.split(\",\");\n const options: NavigateOptions = {};\n let resolveOptions: ResolveOptions;\n\n pairs.forEach((str) => {\n const temp = str.split(\":\").map((v) => v.replace(/(^ +| +$)/g, \"\"));\n switch (temp[0]) {\n case \"historyAPIMethod\":\n options.historyAPIMethod = temp[1];\n break;\n case \"resolveOptionsStrategy\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.strategy = temp[1] as ResolveStrategy;\n break;\n case \"resolveOptionsHash\":\n if (!resolveOptions) resolveOptions = {};\n resolveOptions.hash = temp[1] === \"true\";\n break;\n case \"updateBrowserURL\":\n case \"callHandler\":\n case \"updateState\":\n case \"force\":\n options[temp[0]] = temp[1] === \"true\";\n break;\n }\n });\n if (resolveOptions) {\n options.resolveOptions = resolveOptions;\n }\n return options;\n}\nexport function windowAvailable() {\n return typeof window !== \"undefined\";\n}\nexport function accumulateHooks(\n hooks = [],\n result: RouteHooksStorage = {}\n): RouteHooksStorage {\n hooks\n .filter((h) => h)\n .forEach((h) => {\n [\"before\", \"after\", \"already\", \"leave\"].forEach((type) => {\n if (h[type]) {\n if (!result[type]) result[type] = [];\n result[type].push(h[type]);\n }\n });\n });\n return result as RouteHooksStorage;\n}\n","type QChild = {\n type: \"child\";\n funcs: Array | QChild>;\n};\n\nexport default function Q(\n funcs: Array | QChild>,\n c?: any,\n done?: Function\n) {\n const context = c || {};\n let idx = 0;\n\n (function next() {\n if (!funcs[idx]) {\n if (done) {\n done(context);\n }\n return;\n }\n if (Array.isArray(funcs[idx])) {\n funcs.splice(\n idx,\n 1,\n ...(funcs[idx][0](context) ? funcs[idx][1] : funcs[idx][2])\n );\n next();\n } else {\n // console.log(funcs[idx].name + \" / \" + JSON.stringify(context));\n // console.log(funcs[idx].name);\n (funcs[idx] as Function)(context, (moveForward) => {\n if (typeof moveForward === \"undefined\" || moveForward === true) {\n idx += 1;\n next();\n } else if (done) {\n done(context);\n }\n });\n }\n })();\n}\n\nQ.if = function (condition: Function, one, two) {\n if (!Array.isArray(one)) one = [one];\n if (!Array.isArray(two)) two = [two];\n return [condition, one, two];\n};\n","import { QContext } from \"../../index\";\nimport { getCurrentEnvURL } from \"../utils\";\n\nexport default function setLocationPath(context: QContext, done) {\n if (typeof context.currentLocationPath === \"undefined\") {\n context.currentLocationPath = context.to = getCurrentEnvURL(\n context.instance.root\n );\n }\n context.currentLocationPath = context.instance._checkForAHash(\n context.currentLocationPath\n );\n done();\n}\n","import { matchRoute } from \"../utils\";\nimport { QContext, Match } from \"../../index\";\n\nexport default function matchPathToRegisteredRoutes(context: QContext, done) {\n for (let i = 0; i < context.instance.routes.length; i++) {\n const route = context.instance.routes[i];\n const match: false | Match = matchRoute(context, route);\n if (match) {\n if (!context.matches) context.matches = [];\n context.matches.push(match);\n if (context.resolveOptions.strategy === \"ONE\") {\n done();\n return;\n }\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForDeprecationMethods(context: QContext, done) {\n if (context.navigateOptions) {\n if (typeof context.navigateOptions[\"shouldResolve\"] !== \"undefined\") {\n console.warn(\n `\"shouldResolve\" is deprecated. Please check the documentation.`\n );\n }\n if (typeof context.navigateOptions[\"silent\"] !== \"undefined\") {\n console.warn(`\"silent\" is deprecated. Please check the documentation.`);\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function checkForForceOp(context: QContext, done) {\n if (context.navigateOptions.force === true) {\n context.instance._setCurrent([\n context.instance._pathToMatchObject(context.to),\n ]);\n done(false);\n } else {\n done();\n }\n}\n","import { undefinedOrTrue, pushStateAvailable, windowAvailable } from \"../utils\";\nimport { QContext } from \"../../index\";\n\nconst isWindowAvailable = windowAvailable();\nconst isPushStateAvailable = pushStateAvailable();\n\nexport default function updateBrowserURL(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateBrowserURL\")) {\n const value = `/${context.to}`.replace(/\\/\\//g, \"/\"); // making sure that we don't have two slashes\n const isItUsingHash =\n isWindowAvailable &&\n context.resolveOptions &&\n context.resolveOptions.hash === true;\n if (isPushStateAvailable) {\n history[context.navigateOptions.historyAPIMethod || \"pushState\"](\n context.navigateOptions.stateObj || {},\n context.navigateOptions.title || \"\",\n isItUsingHash ? `#${value}` : value\n );\n // This is to solve a nasty bug where the page doesn't scroll to the anchor.\n // We set a microtask to update the hash only.\n if (location && location.hash) {\n context.instance.__freezeListening = true;\n setTimeout(() => {\n if (!isItUsingHash) {\n let tmp = location.hash;\n location.hash = \"\";\n location.hash = tmp;\n }\n context.instance.__freezeListening = false;\n }, 1);\n }\n } else if (isWindowAvailable) {\n window.location.href = context.to;\n }\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForLeaveHook(context: QContext, done) {\n const instance = context.instance;\n if (!instance.lastResolved()) {\n done();\n return;\n }\n Q(\n instance.lastResolved().map((oldMatch) => {\n return (_, leaveLoopDone) => {\n // no leave hook\n if (!oldMatch.route.hooks || !oldMatch.route.hooks.leave) {\n leaveLoopDone();\n return;\n }\n let runHook = false;\n const newLocationVSOldMatch = context.instance.matchLocation(\n oldMatch.route.path,\n context.currentLocationPath,\n false\n );\n if (oldMatch.route.path !== \"*\") {\n runHook = !newLocationVSOldMatch;\n } else {\n const someOfTheLastOnesMatch = context.matches\n ? context.matches.find((match) => {\n return oldMatch.route.path === match.route.path;\n })\n : false;\n runHook = !someOfTheLastOnesMatch;\n }\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\") && runHook) {\n Q(\n oldMatch.route.hooks.leave\n .map((f) => {\n // just so we match the Q interface\n return (_, d) =>\n f(\n (shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n },\n context.matches && context.matches.length > 0\n ? context.matches.length === 1\n ? context.matches[0]\n : context.matches\n : undefined\n );\n })\n .concat([() => leaveLoopDone()])\n );\n return;\n } else {\n leaveLoopDone();\n }\n };\n }),\n {},\n () => done()\n );\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function updateState(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"updateState\")) {\n context.instance._setCurrent(context.matches);\n }\n done();\n}\n","import { QContext } from \"../index\";\nimport Q from \"./Q\";\nimport checkForLeaveHook from \"./middlewares/checkForLeaveHook\";\nimport checkForBeforeHook from \"./middlewares/checkForBeforeHook\";\nimport callHandler from \"./middlewares/callHandler\";\nimport checkForAfterHook from \"./middlewares/checkForAfterHook\";\nimport checkForAlreadyHook from \"./middlewares/checkForAlreadyHook\";\nimport checkForNotFoundHandler from \"./middlewares/checkForNotFoundHandler\";\nimport errorOut from \"./middlewares/errorOut\";\nimport flushCurrent from \"./middlewares/flushCurrent\";\nimport updateState from \"./middlewares/updateState\";\n\nexport const foundLifecycle = [\n checkForAlreadyHook,\n checkForBeforeHook,\n callHandler,\n checkForAfterHook,\n];\n\nexport const notFoundLifeCycle = [\n checkForLeaveHook,\n checkForNotFoundHandler,\n Q.if(\n ({ notFoundHandled }: QContext) => notFoundHandled,\n foundLifecycle.concat([updateState]),\n [errorOut, flushCurrent]\n ),\n];\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAlreadyHook(context: QContext, done) {\n const current = context.instance.lastResolved();\n if (\n current &&\n current[0] &&\n current[0].route === context.match.route &&\n current[0].url === context.match.url &&\n current[0].queryString === context.match.queryString\n ) {\n current.forEach((c) => {\n if (c.route.hooks && c.route.hooks.already) {\n if (undefinedOrTrue(context.navigateOptions, \"callHooks\")) {\n c.route.hooks.already.forEach((f) => f(context.match));\n }\n }\n });\n done(false);\n return;\n }\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForBeforeHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.before &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n Q(\n context.match.route.hooks.before\n .map((f) => {\n // just so we match the Q interface\n return function beforeHookInternal(_, d) {\n return f((shouldStop) => {\n if (shouldStop === false) {\n context.instance.__markAsClean(context);\n } else {\n d();\n }\n }, context.match);\n };\n })\n .concat([() => done()])\n );\n } else {\n done();\n }\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function callHandler(context: QContext, done) {\n if (undefinedOrTrue(context.navigateOptions, \"callHandler\")) {\n context.match.route.handler(context.match);\n }\n context.instance.updatePageLinks();\n done();\n}\n","import { QContext } from \"../../index\";\nimport { undefinedOrTrue } from \"../utils\";\n\nexport default function checkForAfterHook(context: QContext, done) {\n if (\n context.match.route.hooks &&\n context.match.route.hooks.after &&\n undefinedOrTrue(context.navigateOptions, \"callHooks\")\n ) {\n context.match.route.hooks.after.forEach((f) => f(context.match));\n }\n done();\n}\n","import { QContext, Match } from \"../../index\";\nimport {\n parseQuery,\n extractGETParameters,\n clean,\n extractHashFromURL,\n} from \"../utils\";\n\nexport default function checkForNotFoundHandler(context: QContext, done) {\n const notFoundRoute = context.instance._notFoundRoute;\n if (notFoundRoute) {\n context.notFoundHandled = true;\n const [url, queryString] = extractGETParameters(\n context.currentLocationPath\n );\n const hashString = extractHashFromURL(context.to);\n notFoundRoute.path = clean(url);\n const notFoundMatch: Match = {\n url: notFoundRoute.path,\n queryString,\n hashString,\n data: null,\n route: notFoundRoute,\n params: queryString !== \"\" ? parseQuery(queryString) : null,\n };\n context.matches = [notFoundMatch];\n context.match = notFoundMatch;\n }\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function errorOut(context: QContext, done) {\n if (\n !context.resolveOptions ||\n context.resolveOptions.noMatchWarning === false ||\n typeof context.resolveOptions.noMatchWarning === \"undefined\"\n )\n console.warn(\n `Navigo: \"${context.currentLocationPath}\" didn't match any of the registered routes.`\n );\n done();\n}\n","import { QContext } from \"../../index\";\n\nexport default function flushCurrent(context: QContext, done) {\n context.instance._setCurrent(null);\n done();\n}\n","import { QContext } from \"../../index\";\nimport Q from \"../Q\";\nimport { foundLifecycle } from \"../lifecycles\";\nimport updateState from \"./updateState\";\nimport checkForLeaveHook from \"./checkForLeaveHook\";\n\nexport default function processMatches(context: QContext, done) {\n let idx = 0;\n function nextMatch() {\n if (idx === context.matches.length) {\n updateState(context, done);\n return;\n }\n Q(\n foundLifecycle,\n { ...context, match: context.matches[idx] },\n function end() {\n idx += 1;\n nextMatch();\n }\n );\n }\n checkForLeaveHook(context, nextMatch);\n}\n","import { QContext } from \"../../index\";\n\nexport default function waitingList(context: QContext) {\n context.instance.__markAsClean(context);\n}\n","import {\n Match,\n Route,\n RouteHooks,\n QContext,\n NavigateOptions,\n ResolveOptions,\n GenerateOptions,\n Handler,\n RouterOptions,\n} from \"../index\";\nimport NavigoRouter from \"../index\";\nimport {\n pushStateAvailable,\n matchRoute,\n parseQuery,\n extractGETParameters,\n isFunction,\n isString,\n clean,\n parseNavigateOptions,\n windowAvailable,\n getCurrentEnvURL,\n accumulateHooks,\n extractHashFromURL,\n} from \"./utils\";\nimport Q from \"./Q\";\nimport setLocationPath from \"./middlewares/setLocationPath\";\nimport matchPathToRegisteredRoutes from \"./middlewares/matchPathToRegisteredRoutes\";\nimport checkForDeprecationMethods from \"./middlewares/checkForDeprecationMethods\";\nimport checkForForceOp from \"./middlewares/checkForForceOp\";\nimport updateBrowserURL from \"./middlewares/updateBrowserURL\";\nimport processMatches from \"./middlewares/processMatches\";\nimport waitingList from \"./middlewares/waitingList\";\n\nimport { notFoundLifeCycle } from \"./lifecycles\";\n\nconst DEFAULT_LINK_SELECTOR = \"[data-navigo]\";\n\nexport default function Navigo(appRoute?: string, options?: RouterOptions) {\n let DEFAULT_RESOLVE_OPTIONS: RouterOptions = options || {\n strategy: \"ONE\",\n hash: false,\n noMatchWarning: false,\n linksSelector: DEFAULT_LINK_SELECTOR,\n };\n let self: NavigoRouter = this;\n let root = \"/\";\n let current: Match[] = null;\n let routes: Route[] = [];\n let destroyed = false;\n let genericHooks: RouteHooks;\n\n const isPushStateAvailable = pushStateAvailable();\n const isWindowAvailable = windowAvailable();\n\n if (!appRoute) {\n console.warn(\n 'Navigo requires a root path in its constructor. If not provided will use \"/\" as default.'\n );\n } else {\n root = clean(appRoute);\n }\n\n function _checkForAHash(url: string): string {\n if (url.indexOf(\"#\") >= 0) {\n if (DEFAULT_RESOLVE_OPTIONS.hash === true) {\n url = url.split(\"#\")[1] || \"/\";\n } else {\n url = url.split(\"#\")[0];\n }\n }\n return url;\n }\n function composePathWithRoot(path: string) {\n return clean(`${root}/${clean(path)}`);\n }\n function createRoute(\n path: string | RegExp,\n handler: Handler,\n hooks: RouteHooks[],\n name?: string\n ): Route {\n path = isString(path) ? composePathWithRoot(path as string) : path;\n return {\n name: name || clean(String(path)),\n path,\n handler,\n hooks: accumulateHooks(hooks),\n };\n }\n\n // public APIs\n function on(\n path: string | Function | Object | RegExp,\n handler?: Handler,\n hooks?: RouteHooks\n ) {\n if (typeof path === \"object\" && !(path instanceof RegExp)) {\n Object.keys(path).forEach((p) => {\n if (typeof path[p] === \"function\") {\n this.on(p, path[p]);\n } else {\n const { uses: handler, as: name, hooks } = path[p];\n routes.push(createRoute(p, handler, [genericHooks, hooks], name));\n }\n });\n return this;\n } else if (typeof path === \"function\") {\n hooks = handler as RouteHooks;\n handler = path as Handler;\n path = root;\n }\n routes.push(\n createRoute(path as string | RegExp, handler, [genericHooks, hooks])\n );\n return this;\n }\n function resolve(to?: string, options?: ResolveOptions): false | Match[] {\n if (self.__dirty) {\n self.__waiting.push(() => self.resolve(to, options));\n return;\n } else {\n self.__dirty = true;\n }\n to = to ? `${clean(root)}/${clean(to)}` : undefined;\n // console.log(\"-- resolve --> \" + to, self.__dirty);\n const context: QContext = {\n instance: self,\n to,\n currentLocationPath: to,\n navigateOptions: {},\n resolveOptions: { ...DEFAULT_RESOLVE_OPTIONS, ...options },\n };\n Q(\n [\n setLocationPath,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n ],\n context,\n waitingList\n );\n\n return context.matches ? context.matches : false;\n }\n function navigate(to: string, navigateOptions?: NavigateOptions): void {\n // console.log(\"-- navigate --> \" + to, self.__dirty);\n if (self.__dirty) {\n self.__waiting.push(() => self.navigate(to, navigateOptions));\n return;\n } else {\n self.__dirty = true;\n }\n to = `${clean(root)}/${clean(to)}`;\n const context: QContext = {\n instance: self,\n to,\n navigateOptions: navigateOptions || {},\n resolveOptions:\n navigateOptions && navigateOptions.resolveOptions\n ? navigateOptions.resolveOptions\n : DEFAULT_RESOLVE_OPTIONS,\n currentLocationPath: _checkForAHash(to),\n };\n Q(\n [\n checkForDeprecationMethods,\n checkForForceOp,\n matchPathToRegisteredRoutes,\n Q.if(\n ({ matches }: QContext) => matches && matches.length > 0,\n processMatches,\n notFoundLifeCycle\n ),\n updateBrowserURL,\n waitingList,\n ],\n context,\n waitingList\n );\n }\n function navigateByName(\n name: string,\n data?: Object,\n options?: NavigateOptions\n ): boolean {\n const url = generate(name, data);\n if (url !== null) {\n navigate(url.replace(new RegExp(`^\\/?${root}`), \"\"), options);\n return true;\n }\n return false;\n }\n function off(what: string | RegExp | Function) {\n this.routes = routes = routes.filter((r) => {\n if (isString(what)) {\n return clean(r.path as string) !== clean(what as string);\n } else if (isFunction(what)) {\n return what !== r.handler;\n }\n return String(r.path) !== String(what);\n });\n return this;\n }\n function listen() {\n if (isPushStateAvailable) {\n this.__popstateListener = () => {\n if (!self.__freezeListening) {\n resolve();\n }\n };\n window.addEventListener(\"popstate\", this.__popstateListener);\n }\n }\n function destroy() {\n this.routes = routes = [];\n if (isPushStateAvailable) {\n window.removeEventListener(\"popstate\", this.__popstateListener);\n }\n this.destroyed = destroyed = true;\n }\n function notFound(handler, hooks?: RouteHooks) {\n self._notFoundRoute = createRoute(\n \"*\",\n handler,\n [genericHooks, hooks],\n \"__NOT_FOUND__\"\n );\n return this;\n }\n function updatePageLinks() {\n if (!isWindowAvailable) return;\n findLinks().forEach((link) => {\n if (\n \"false\" === link.getAttribute(\"data-navigo\") ||\n \"_blank\" === link.getAttribute(\"target\")\n ) {\n if (link.hasListenerAttached) {\n link.removeEventListener(\"click\", link.navigoHandler);\n }\n return;\n }\n if (!link.hasListenerAttached) {\n link.hasListenerAttached = true;\n link.navigoHandler = function (e) {\n if (\n (e.ctrlKey || e.metaKey) &&\n e.target.tagName.toLowerCase() === \"a\"\n ) {\n return false;\n }\n let location = link.getAttribute(\"href\");\n if (typeof location === \"undefined\" || location === null) {\n return false;\n }\n // handling absolute paths\n if (location.match(/^(http|https)/) && typeof URL !== \"undefined\") {\n try {\n const u = new URL(location);\n location = u.pathname + u.search;\n } catch (err) {}\n }\n const options = parseNavigateOptions(\n link.getAttribute(\"data-navigo-options\")\n );\n\n if (!destroyed) {\n e.preventDefault();\n e.stopPropagation();\n self.navigate(clean(location), options);\n }\n };\n link.addEventListener(\"click\", link.navigoHandler);\n }\n });\n return self;\n }\n function findLinks() {\n if (isWindowAvailable) {\n return [].slice.call(\n document.querySelectorAll(\n DEFAULT_RESOLVE_OPTIONS.linksSelector || DEFAULT_LINK_SELECTOR\n )\n );\n }\n return [];\n }\n function link(path: string) {\n return `/${root}/${clean(path)}`;\n }\n function setGenericHooks(hooks: RouteHooks) {\n genericHooks = hooks;\n return this;\n }\n function lastResolved(): Match[] | null {\n return current;\n }\n function generate(\n name: string,\n data?: Object,\n options?: GenerateOptions\n ): string {\n const route = routes.find((r) => r.name === name);\n let result = null;\n if (route) {\n result = route.path as string;\n if (data) {\n for (let key in data) {\n result = result.replace(\":\" + key, data[key]);\n }\n }\n result = !result.match(/^\\//) ? `/${result}` : result;\n }\n if (result && options && !options.includeRoot) {\n result = result.replace(new RegExp(`^/${root}`), \"\");\n }\n return result;\n }\n function getLinkPath(link) {\n return link.getAttribute(\"href\");\n }\n function pathToMatchObject(path: string): Match {\n const [url, queryString] = extractGETParameters(clean(path));\n const params = queryString === \"\" ? null : parseQuery(queryString);\n const hashString = extractHashFromURL(path);\n const route = createRoute(url, () => {}, [genericHooks], url);\n return {\n url,\n queryString,\n hashString,\n route,\n data: null,\n params: params,\n };\n }\n function getCurrentLocation(): Match {\n return pathToMatchObject(\n clean(getCurrentEnvURL(root)).replace(new RegExp(`^${root}`), \"\")\n );\n }\n function directMatchWithRegisteredRoutes(path: string): false | Match[] {\n const context: QContext = {\n instance: self,\n currentLocationPath: path,\n to: path,\n navigateOptions: {},\n resolveOptions: DEFAULT_RESOLVE_OPTIONS,\n };\n matchPathToRegisteredRoutes(context, () => {});\n return context.matches ? context.matches : false;\n }\n function directMatchWithLocation(\n path: string | RegExp,\n currentLocation?: string,\n annotatePathWithRoot?: boolean\n ): false | Match {\n if (\n typeof currentLocation !== \"undefined\" &&\n (typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot)\n ) {\n currentLocation = composePathWithRoot(currentLocation);\n }\n const context: QContext = {\n instance: self,\n to: currentLocation,\n currentLocationPath: currentLocation,\n };\n setLocationPath(context, () => {});\n if (typeof path === \"string\") {\n path =\n typeof annotatePathWithRoot === \"undefined\" || annotatePathWithRoot\n ? composePathWithRoot(path)\n : path;\n }\n const match = matchRoute(context, {\n name: String(path),\n path,\n handler: () => {},\n hooks: {},\n });\n return match ? match : false;\n }\n function addHook(\n type: string,\n route: Route | string,\n func: Function\n ): Function {\n if (typeof route === \"string\") {\n route = getRoute(route);\n }\n if (route) {\n if (!route.hooks[type]) route.hooks[type] = [];\n route.hooks[type].push(func);\n return () => {\n (route as Route).hooks[type] = (route as Route).hooks[type].filter(\n (f) => f !== func\n );\n };\n } else {\n console.warn(`Route doesn't exists: ${route}`);\n }\n return () => {};\n }\n function getRoute(nameOrHandler: string | Function): Route | undefined {\n if (typeof nameOrHandler === \"string\") {\n return routes.find((r) => r.name === composePathWithRoot(nameOrHandler));\n }\n return routes.find((r) => r.handler === nameOrHandler);\n }\n function __markAsClean(context: QContext) {\n context.instance.__dirty = false;\n if (context.instance.__waiting.length > 0) {\n context.instance.__waiting.shift()();\n }\n }\n\n this.root = root;\n this.routes = routes;\n this.destroyed = destroyed;\n this.current = current;\n this.__freezeListening = false;\n this.__waiting = [];\n this.__dirty = false;\n this.__markAsClean = __markAsClean;\n\n this.on = on;\n this.off = off;\n this.resolve = resolve;\n this.navigate = navigate;\n this.navigateByName = navigateByName;\n this.destroy = destroy;\n this.notFound = notFound;\n this.updatePageLinks = updatePageLinks;\n this.link = link;\n this.hooks = setGenericHooks;\n this.extractGETParameters = (url) =>\n extractGETParameters(_checkForAHash(url));\n this.lastResolved = lastResolved;\n this.generate = generate;\n this.getLinkPath = getLinkPath;\n this.match = directMatchWithRegisteredRoutes;\n this.matchLocation = directMatchWithLocation;\n this.getCurrentLocation = getCurrentLocation;\n this.addBeforeHook = addHook.bind(this, \"before\");\n this.addAfterHook = addHook.bind(this, \"after\");\n this.addAlreadyHook = addHook.bind(this, \"already\");\n this.addLeaveHook = addHook.bind(this, \"leave\");\n this.getRoute = getRoute;\n this._pathToMatchObject = pathToMatchObject;\n this._clean = clean;\n this._checkForAHash = _checkForAHash;\n this._setCurrent = (c) => (current = self.current = c);\n\n listen.call(this);\n updatePageLinks.call(this);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// module exports must be returned from runtime so entry inlining is disabled\n// startup\n// Load entry module and return exports\nreturn __webpack_require__(407);\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }"],"sourceRoot":""}