{"version":3,"sources":["webpack:///./node_modules/resolve-pathname/index.js"],"names":["isAbsolute","pathname","charAt","spliceOne","list","index","i","k","n","length","pop","resolvePathname","to","from","arguments","undefined","toParts","split","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","hasTrailingSlash","last","up","part","unshift","result","join","substr"],"mappings":"6FAAA,SAASA,WAAWC,GAClB,MAA8B,MAAvBA,EAASC,OAAO,GAIzB,SAASC,UAAUC,EAAMC,GACvB,IAAK,IAAIC,EAAID,EAAOE,EAAID,EAAI,EAAGE,EAAIJ,EAAKK,OAAQF,EAAIC,EAAGF,GAAK,EAAGC,GAAK,EAClEH,EAAKE,GAAKF,EAAKG,GAGjBH,EAAKM,MAVP,OAqEe,UAvDf,SAASC,gBAAgBC,GACvB,IAAIC,EAAOC,UAAUL,OAAS,QAAsBM,IAAjBD,UAAU,GAAmBA,UAAU,GAAK,GAE3EE,EAAUJ,GAAMA,EAAGK,MAAM,MAAQ,GACjCC,EAAYL,GAAQA,EAAKI,MAAM,MAAQ,GAEvCE,EAAUP,GAAMZ,WAAWY,GAC3BQ,EAAYP,GAAQb,WAAWa,GAC/BQ,EAAaF,GAAWC,EAW5B,GATIR,GAAMZ,WAAWY,GAEnBM,EAAYF,EACHA,EAAQP,SAEjBS,EAAUR,MACVQ,EAAYA,EAAUI,OAAON,KAG1BE,EAAUT,OAAQ,MAAO,IAE9B,IAAIc,OAAmB,EACvB,GAAIL,EAAUT,OAAQ,CACpB,IAAIe,EAAON,EAAUA,EAAUT,OAAS,GACxCc,EAA4B,MAATC,GAAyB,OAATA,GAA0B,KAATA,OAEpDD,GAAmB,EAIrB,IADA,IAAIE,EAAK,EACAnB,EAAIY,EAAUT,OAAQH,GAAK,EAAGA,IAAK,CAC1C,IAAIoB,EAAOR,EAAUZ,GAER,MAAToB,EACFvB,UAAUe,EAAWZ,GACH,OAAToB,GACTvB,UAAUe,EAAWZ,GACrBmB,KACSA,IACTtB,UAAUe,EAAWZ,GACrBmB,KAIJ,IAAKJ,EAAY,KAAOI,IAAMA,EAC5BP,EAAUS,QAAQ,OACfN,GAA+B,KAAjBH,EAAU,IAAeA,EAAU,IAAOlB,WAAWkB,EAAU,KAAMA,EAAUS,QAAQ,IAE1G,IAAIC,EAASV,EAAUW,KAAK,KAI5B,OAFIN,GAA0C,MAAtBK,EAAOE,QAAQ,KAAYF,GAAU,KAEtDA","file":"npm.resolve-pathname-39dab8e3966d0ded8352.js","sourcesContent":["function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n var toParts = to && to.split('/') || [];\n var fromParts = from && from.split('/') || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash = void 0;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) {\n fromParts.unshift('..');\n }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;"],"sourceRoot":""}