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jb,EAAQoa,SAAS,SAASc,IAAOjB,EAAgB7S,EAAO+T,sBAAsBD,GAAMvS,EAAOsS,SAAS,IAAI,IAAItB,KAAKyB,IAAI,EAAEzB,KAAK0B,KAAKxB,GAAiB,GAAG,CAApI,IAAyI,EAAEoB,SAAS,SAASK,GAAI,YAAY,IAAIA,IAAK,iBAAiBA,IAAKA,GAAI,GAAGA,EAAGC,QAAQ,MAAM,GAAGD,EAAGC,QAAQ,KAAK1B,EAAgB,GAAG2B,WAAWF,IAAKzB,EAAgB,EAAEyB,EAAG,EAAEA,EAAG3C,KAAWkB,CAAe,EAAErJ,KAAK,WAAWiL,aAAatB,GAAcA,EAAa,KAAKH,IAAUA,GAAQ,EAAG,MAAMC,IAAkB7S,EAAOsT,qBAAqBT,GAAiBA,EAAgB,MAAM,SAASiB,IAAO,OAAO,GAAGvS,EAAOsS,SAAS,SAASrC,EAAO1B,MAAM8D,SAAS,IAAIpC,EAAO1B,MAAM8D,SAAS,MAAMpC,EAAO1B,MAAM2D,QAAQ,YAAYX,EAAY,YAAYA,EAAY9S,EAAO+T,sBAAsBD,GAAM,CAAjN,GAAqN,GAA4B,iBAAiBhV,EAAOpG,QAAQoG,EAAOpG,QAAQ6I,OAA6E,KAAhC,aAAkB,OAAOA,CAAO,+BAAqB,GAAE+S,KAAKrZ,KAAK+E,OAAOmG,S,GCL3pFoO,EAA2B,CAAC,ECEhC,IAAIC,EDCJ,SAASC,EAAoBC,GAE5B,IAAIC,EAAeJ,EAAyBG,GAC5C,QAAqBva,IAAjBwa,EACH,OAAOA,EAAajc,QAGrB,IAAIoG,EAASyV,EAAyBG,GAAY,CAGjDhc,QAAS,CAAC,GAOX,OAHAkc,EAAoBF,GAAUJ,KAAKxV,EAAOpG,QAASoG,EAAQA,EAAOpG,QAAS+b,GAGpE3V,EAAOpG,OACf,CCnB0B+b,CAAoB,Y","sources":["webpack://single-page-express/./node_modules/path-to-regexp/dist/index.js","webpack://single-page-express/./node_modules/path-to-regexp-express4/index.js","webpack://single-page-express/./single-page-express.js","webpack://single-page-express/./node_modules/topbar/topbar.min.js","webpack://single-page-express/webpack/bootstrap","webpack://single-page-express/webpack/startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PathError = exports.TokenData = void 0;\nexports.parse = parse;\nexports.compile = compile;\nexports.match = match;\nexports.pathToRegexp = pathToRegexp;\nexports.stringify = stringify;\nconst DEFAULT_DELIMITER = \"/\";\nconst NOOP_VALUE = (value) => value;\nconst ID_START = /^[$_\\p{ID_Start}]$/u;\nconst ID_CONTINUE = /^[$\\u200c\\u200d\\p{ID_Continue}]$/u;\nconst SIMPLE_TOKENS = {\n    // Groups.\n    \"{\": \"{\",\n    \"}\": \"}\",\n    // Reserved.\n    \"(\": \"(\",\n    \")\": \")\",\n    \"[\": \"[\",\n    \"]\": \"]\",\n    \"+\": \"+\",\n    \"?\": \"?\",\n    \"!\": \"!\",\n};\n/**\n * Escape text for stringify to path.\n */\nfunction escapeText(str) {\n    return str.replace(/[{}()\\[\\]+?!:*\\\\]/g, \"\\\\$&\");\n}\n/**\n * Escape a regular expression string.\n */\nfunction escape(str) {\n    return str.replace(/[.+*?^${}()[\\]|/\\\\]/g, \"\\\\$&\");\n}\n/**\n * Tokenized path instance.\n */\nclass TokenData {\n    constructor(tokens, originalPath) {\n        this.tokens = tokens;\n        this.originalPath = originalPath;\n    }\n}\nexports.TokenData = TokenData;\n/**\n * ParseError is thrown when there is an error processing the path.\n */\nclass PathError extends TypeError {\n    constructor(message, originalPath) {\n        let text = message;\n        if (originalPath)\n            text += `: ${originalPath}`;\n        text += `; visit https://git.new/pathToRegexpError for info`;\n        super(text);\n        this.originalPath = originalPath;\n    }\n}\nexports.PathError = PathError;\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options = {}) {\n    const { encodePath = NOOP_VALUE } = options;\n    const chars = [...str];\n    const tokens = [];\n    let index = 0;\n    let pos = 0;\n    function name() {\n        let value = \"\";\n        if (ID_START.test(chars[index])) {\n            do {\n                value += chars[index++];\n            } while (ID_CONTINUE.test(chars[index]));\n        }\n        else if (chars[index] === '\"') {\n            let quoteStart = index;\n            while (index++ < chars.length) {\n                if (chars[index] === '\"') {\n                    index++;\n                    quoteStart = 0;\n                    break;\n                }\n                // Increment over escape characters.\n                if (chars[index] === \"\\\\\")\n                    index++;\n                value += chars[index];\n            }\n            if (quoteStart) {\n                throw new PathError(`Unterminated quote at index ${quoteStart}`, str);\n            }\n        }\n        if (!value) {\n            throw new PathError(`Missing parameter name at index ${index}`, str);\n        }\n        return value;\n    }\n    while (index < chars.length) {\n        const value = chars[index];\n        const type = SIMPLE_TOKENS[value];\n        if (type) {\n            tokens.push({ type, index: index++, value });\n        }\n        else if (value === \"\\\\\") {\n            tokens.push({ type: \"escape\", index: index++, value: chars[index++] });\n        }\n        else if (value === \":\") {\n            tokens.push({ type: \"param\", index: index++, value: name() });\n        }\n        else if (value === \"*\") {\n            tokens.push({ type: \"wildcard\", index: index++, value: name() });\n        }\n        else {\n            tokens.push({ type: \"char\", index: index++, value });\n        }\n    }\n    tokens.push({ type: \"end\", index, value: \"\" });\n    function consumeUntil(endType) {\n        const output = [];\n        while (true) {\n            const token = tokens[pos++];\n            if (token.type === endType)\n                break;\n            if (token.type === \"char\" || token.type === \"escape\") {\n                let path = token.value;\n                let cur = tokens[pos];\n                while (cur.type === \"char\" || cur.type === \"escape\") {\n                    path += cur.value;\n                    cur = tokens[++pos];\n                }\n                output.push({\n                    type: \"text\",\n                    value: encodePath(path),\n                });\n                continue;\n            }\n            if (token.type === \"param\" || token.type === \"wildcard\") {\n                output.push({\n                    type: token.type,\n                    name: token.value,\n                });\n                continue;\n            }\n            if (token.type === \"{\") {\n                output.push({\n                    type: \"group\",\n                    tokens: consumeUntil(\"}\"),\n                });\n                continue;\n            }\n            throw new PathError(`Unexpected ${token.type} at index ${token.index}, expected ${endType}`, str);\n        }\n        return output;\n    }\n    return new TokenData(consumeUntil(\"end\"), str);\n}\n/**\n * Compile a string to a template function for the path.\n */\nfunction compile(path, options = {}) {\n    const { encode = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n    const data = typeof path === \"object\" ? path : parse(path, options);\n    const fn = tokensToFunction(data.tokens, delimiter, encode);\n    return function path(params = {}) {\n        const [path, ...missing] = fn(params);\n        if (missing.length) {\n            throw new TypeError(`Missing parameters: ${missing.join(\", \")}`);\n        }\n        return path;\n    };\n}\nfunction tokensToFunction(tokens, delimiter, encode) {\n    const encoders = tokens.map((token) => tokenToFunction(token, delimiter, encode));\n    return (data) => {\n        const result = [\"\"];\n        for (const encoder of encoders) {\n            const [value, ...extras] = encoder(data);\n            result[0] += value;\n            result.push(...extras);\n        }\n        return result;\n    };\n}\n/**\n * Convert a single token into a path building function.\n */\nfunction tokenToFunction(token, delimiter, encode) {\n    if (token.type === \"text\")\n        return () => [token.value];\n    if (token.type === \"group\") {\n        const fn = tokensToFunction(token.tokens, delimiter, encode);\n        return (data) => {\n            const [value, ...missing] = fn(data);\n            if (!missing.length)\n                return [value];\n            return [\"\"];\n        };\n    }\n    const encodeValue = encode || NOOP_VALUE;\n    if (token.type === \"wildcard\" && encode !== false) {\n        return (data) => {\n            const value = data[token.name];\n            if (value == null)\n                return [\"\", token.name];\n            if (!Array.isArray(value) || value.length === 0) {\n                throw new TypeError(`Expected \"${token.name}\" to be a non-empty array`);\n            }\n            return [\n                value\n                    .map((value, index) => {\n                    if (typeof value !== \"string\") {\n                        throw new TypeError(`Expected \"${token.name}/${index}\" to be a string`);\n                    }\n                    return encodeValue(value);\n                })\n                    .join(delimiter),\n            ];\n        };\n    }\n    return (data) => {\n        const value = data[token.name];\n        if (value == null)\n            return [\"\", token.name];\n        if (typeof value !== \"string\") {\n            throw new TypeError(`Expected \"${token.name}\" to be a string`);\n        }\n        return [encodeValue(value)];\n    };\n}\n/**\n * Transform a path into a match function.\n */\nfunction match(path, options = {}) {\n    const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;\n    const { regexp, keys } = pathToRegexp(path, options);\n    const decoders = keys.map((key) => {\n        if (decode === false)\n            return NOOP_VALUE;\n        if (key.type === \"param\")\n            return decode;\n        return (value) => value.split(delimiter).map(decode);\n    });\n    return function match(input) {\n        const m = regexp.exec(input);\n        if (!m)\n            return false;\n        const path = m[0];\n        const params = Object.create(null);\n        for (let i = 1; i < m.length; i++) {\n            if (m[i] === undefined)\n                continue;\n            const key = keys[i - 1];\n            const decoder = decoders[i - 1];\n            params[key.name] = decoder(m[i]);\n        }\n        return { path, params };\n    };\n}\nfunction pathToRegexp(path, options = {}) {\n    const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true, } = options;\n    const keys = [];\n    const flags = sensitive ? \"\" : \"i\";\n    const sources = [];\n    for (const input of pathsToArray(path, [])) {\n        const data = typeof input === \"object\" ? input : parse(input, options);\n        for (const tokens of flatten(data.tokens, 0, [])) {\n            sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));\n        }\n    }\n    let pattern = `^(?:${sources.join(\"|\")})`;\n    if (trailing)\n        pattern += `(?:${escape(delimiter)}$)?`;\n    pattern += end ? \"$\" : `(?=${escape(delimiter)}|$)`;\n    const regexp = new RegExp(pattern, flags);\n    return { regexp, keys };\n}\n/**\n * Convert a path or array of paths into a flat array.\n */\nfunction pathsToArray(paths, init) {\n    if (Array.isArray(paths)) {\n        for (const p of paths)\n            pathsToArray(p, init);\n    }\n    else {\n        init.push(paths);\n    }\n    return init;\n}\n/**\n * Generate a flat list of sequence tokens from the given tokens.\n */\nfunction* flatten(tokens, index, init) {\n    if (index === tokens.length) {\n        return yield init;\n    }\n    const token = tokens[index];\n    if (token.type === \"group\") {\n        for (const seq of flatten(token.tokens, 0, init.slice())) {\n            yield* flatten(tokens, index + 1, seq);\n        }\n    }\n    else {\n        init.push(token);\n    }\n    yield* flatten(tokens, index + 1, init);\n}\n/**\n * Transform a flat sequence of tokens into a regular expression.\n */\nfunction toRegExpSource(tokens, delimiter, keys, originalPath) {\n    let result = \"\";\n    let backtrack = \"\";\n    let isSafeSegmentParam = true;\n    for (const token of tokens) {\n        if (token.type === \"text\") {\n            result += escape(token.value);\n            backtrack += token.value;\n            isSafeSegmentParam || (isSafeSegmentParam = token.value.includes(delimiter));\n            continue;\n        }\n        if (token.type === \"param\" || token.type === \"wildcard\") {\n            if (!isSafeSegmentParam && !backtrack) {\n                throw new PathError(`Missing text before \"${token.name}\" ${token.type}`, originalPath);\n            }\n            if (token.type === \"param\") {\n                result += `(${negate(delimiter, isSafeSegmentParam ? \"\" : backtrack)}+)`;\n            }\n            else {\n                result += `([\\\\s\\\\S]+)`;\n            }\n            keys.push(token);\n            backtrack = \"\";\n            isSafeSegmentParam = false;\n            continue;\n        }\n    }\n    return result;\n}\n/**\n * Block backtracking on previous text and ignore delimiter string.\n */\nfunction negate(delimiter, backtrack) {\n    if (backtrack.length < 2) {\n        if (delimiter.length < 2)\n            return `[^${escape(delimiter + backtrack)}]`;\n        return `(?:(?!${escape(delimiter)})[^${escape(backtrack)}])`;\n    }\n    if (delimiter.length < 2) {\n        return `(?:(?!${escape(backtrack)})[^${escape(delimiter)}])`;\n    }\n    return `(?:(?!${escape(backtrack)}|${escape(delimiter)})[\\\\s\\\\S])`;\n}\n/**\n * Stringify an array of tokens into a path string.\n */\nfunction stringifyTokens(tokens) {\n    let value = \"\";\n    let i = 0;\n    function name(value) {\n        const isSafe = isNameSafe(value) && isNextNameSafe(tokens[i]);\n        return isSafe ? value : JSON.stringify(value);\n    }\n    while (i < tokens.length) {\n        const token = tokens[i++];\n        if (token.type === \"text\") {\n            value += escapeText(token.value);\n            continue;\n        }\n        if (token.type === \"group\") {\n            value += `{${stringifyTokens(token.tokens)}}`;\n            continue;\n        }\n        if (token.type === \"param\") {\n            value += `:${name(token.name)}`;\n            continue;\n        }\n        if (token.type === \"wildcard\") {\n            value += `*${name(token.name)}`;\n            continue;\n        }\n        throw new TypeError(`Unknown token type: ${token.type}`);\n    }\n    return value;\n}\n/**\n * Stringify token data into a path string.\n */\nfunction stringify(data) {\n    return stringifyTokens(data.tokens);\n}\n/**\n * Validate the parameter name contains valid ID characters.\n */\nfunction isNameSafe(name) {\n    const [first, ...rest] = name;\n    return ID_START.test(first) && rest.every((char) => ID_CONTINUE.test(char));\n}\n/**\n * Validate the next token does not interfere with the current param name.\n */\nfunction isNextNameSafe(token) {\n    if (token && token.type === \"text\")\n        return !ID_CONTINUE.test(token.value[0]);\n    return true;\n}\n//# sourceMappingURL=index.js.map","/**\n * Expose `pathToRegexp`.\n */\n\nmodule.exports = pathToRegexp;\n\n/**\n * Match matching groups in a regular expression.\n */\nvar MATCHING_GROUP_REGEXP = /\\\\.|\\((?:\\?<(.*?)>)?(?!\\?)/g;\n\n/**\n * Normalize the given path string,\n * returning a regular expression.\n *\n * An empty array should be passed,\n * which will contain the placeholder\n * key names. For example \"/user/:id\" will\n * then contain [\"id\"].\n *\n * @param  {String|RegExp|Array} path\n * @param  {Array} keys\n * @param  {Object} options\n * @return {RegExp}\n * @api private\n */\n\nfunction pathToRegexp(path, keys, options) {\n  options = options || {};\n  keys = keys || [];\n  var strict = options.strict;\n  var end = options.end !== false;\n  var flags = options.sensitive ? '' : 'i';\n  var lookahead = options.lookahead !== false;\n  var extraOffset = 0;\n  var keysOffset = keys.length;\n  var i = 0;\n  var name = 0;\n  var pos = 0;\n  var backtrack = '';\n  var m;\n\n  if (path instanceof RegExp) {\n    while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {\n      if (m[0][0] === '\\\\') continue;\n\n      keys.push({\n        name: m[1] || name++,\n        optional: false,\n        offset: m.index\n      });\n    }\n\n    return path;\n  }\n\n  if (Array.isArray(path)) {\n    // Map array parts into regexps and return their source. We also pass\n    // the same keys and options instance into every generation to get\n    // consistent matching groups before we join the sources together.\n    path = path.map(function (value) {\n      return pathToRegexp(value, keys, options).source;\n    });\n\n    return new RegExp(path.join('|'), flags);\n  }\n\n  if (typeof path !== 'string') {\n    throw new TypeError('path must be a string, array of strings, or regular expression');\n  }\n\n  path = path.replace(\n    /\\\\.|(\\/)?(\\.)?:(\\w+)(\\(.*?\\))?(\\*)?(\\?)?|[.*]|\\/\\(/g,\n    function (match, slash, format, key, capture, star, optional, offset) {\n      if (match[0] === '\\\\') {\n        backtrack += match;\n        pos += 2;\n        return match;\n      }\n\n      if (match === '.') {\n        backtrack += '\\\\.';\n        extraOffset += 1;\n        pos += 1;\n        return '\\\\.';\n      }\n\n      if (slash || format) {\n        backtrack = '';\n      } else {\n        backtrack += path.slice(pos, offset);\n      }\n\n      pos = offset + match.length;\n\n      if (match === '*') {\n        extraOffset += 3;\n        return '(.*)';\n      }\n\n      if (match === '/(') {\n        backtrack += '/';\n        extraOffset += 2;\n        return '/(?:';\n      }\n\n      slash = slash || '';\n      format = format ? '\\\\.' : '';\n      optional = optional || '';\n      capture = capture ?\n        capture.replace(/\\\\.|\\*/, function (m) { return m === '*' ? '(.*)' : m; }) :\n        (backtrack ? '((?:(?!/|' + backtrack + ').)+?)' : '([^/' + format + ']+?)');\n\n      keys.push({\n        name: key,\n        optional: !!optional,\n        offset: offset + extraOffset\n      });\n\n      var result = '(?:'\n        + format + slash + capture\n        + (star ? '((?:[/' + format + '].+?)?)' : '')\n        + ')'\n        + optional;\n\n      extraOffset += result.length - match.length;\n\n      return result;\n    });\n\n  // This is a workaround for handling unnamed matching groups.\n  while (m = MATCHING_GROUP_REGEXP.exec(path)) {\n    if (m[0][0] === '\\\\') continue;\n\n    if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {\n      keys.splice(keysOffset + i, 0, {\n        name: name++, // Unnamed matching groups must be consistently linear.\n        optional: false,\n        offset: m.index\n      });\n    }\n\n    i++;\n  }\n\n  path += strict ? '' : path[path.length - 1] === '/' ? '?' : '/?';\n\n  // If the path is non-ending, match until the end or a slash.\n  if (end) {\n    path += '$';\n  } else if (path[path.length - 1] !== '/') {\n    path += lookahead ? '(?=/|$)' : '(?:/|$)';\n  }\n\n  return new RegExp('^' + path, flags);\n};\n","const pathToRegexpMatch = require('path-to-regexp').match // route parser for express 5+\nconst pathToRegexpMatchExpress4 = require('path-to-regexp-express4') // route parser for express 4; express 3 and below are not supported\nconst parser = new window.DOMParser() // used by the default render method\n\nfunction singlePageExpress (options) {\n  // #region constructor params and top-level variable declarations\n  const app = {} // instance of the router app\n  app.expressVersion = options.expressVersion // which version of the express api to target\n  if (app.expressVersion !== 5 && (parseInt(app.expressVersion) <= 4)) app.expressVersion = 4 // permit express 4 and 5+\n  if (!app.expressVersion) app.expressVersion = 5 // default to express 5\n  app.appVars = {} // for app.set() / app.get()\n  app.templatingEngine = options.templatingEngine // which templating engine to use\n  app.templates = options.templates // templates to render\n  if (!app.templates) console.warn('single-page-express: no templates are loaded; as such the default render method will just print the template name and model to the console.')\n  app.routes = {} // list of functions to execute when trying to see if this route matches one of the known patterns indexed by original route method#string\n  app.routeCallbacks = {} // list of functions to execute when the route is invoked\n  app.defaultTarget = options.defaultTarget // which element to replace by default\n  app.defaultTargets = app.defaultTarget ? [app.defaultTarget].concat(options.defaultTargets || []) : options.defaultTargets || [] // which elements to replace by default\n  if (!app.defaultTargets.length) app.defaultTargets = ['body'] // body tag is the default target if none is set\n  app.beforeEveryRender = options.beforeEveryRender // function to execute before every DOM update if using the default render method\n  app.updateDelay = options.updateDelay // how long to delay after executing app.beforeEveryRender or this.beforeRender before performing the DOM update\n  app.afterEveryRender = options.afterEveryRender // function to execute after every DOM update if using the default render method\n  app.postRenderCallbacks = options.postRenderCallbacks || {} // list of callback functions to execute after a render event occurs\n  app.topbarEnabled = !options.disableTopbar // whether to use topbar https://buunguyen.github.io/topbar/\n  app.topBarRoutes = options.topBarRoutes // which routes to use the topbar on; defaults to all if this option is not supplied\n  if (app.topbarEnabled || app.topBarRoutes) {\n    app.topbar = require('topbar')\n    app.topbar.config(options.topbarConfig || {\n      // default options\n      barColors: {\n        0: 'rgba(0,  0, 0, .7)',\n        '1.0': 'rgba(0, 0,  0,  .7)'\n      }\n    })\n  }\n  app.alwaysSkipViewTransition = options.alwaysSkipViewTransition // never wrap dom updates in document.startViewTransition() calls\n  app.alwaysScrollTop = options.alwaysScrollTop // always scroll to the top of the page after every render\n  app.urls = {} // list of URLs that have been visited and metadata about them\n  let currentViewTransition // a global reference to the current view transition so we can know when it has ended\n\n  // taken from https://expressjs.com/en/api.html#routing-methods\n  const httpVerbs = [\n    'checkout',\n    'copy',\n    'delete',\n    'get',\n    'head',\n    'lock',\n    'merge',\n    'mkactivity',\n    'mkcol',\n    'move',\n    'm-search',\n    'notify',\n    'options',\n    'patch',\n    'post',\n    'purge',\n    'put',\n    'report',\n    'search',\n    'subscribe',\n    'trace',\n    'unlock',\n    'unsubscribe'\n  ]\n\n  // #endregion\n\n  // #region express app\n\n  // express app object settings\n  app.appVars['case sensitive routing'] = false\n  app.appVars.env = 'production'\n  app.appVars['query parser'] = true\n  app.appVars['strict routing'] = false\n  app.appVars['subdomain offset'] = 2\n  // the other settings are not supported\n\n  // express app object properties\n  app.locals = {} // stubbed out\n  app.mountpath = '' // stubbed out\n\n  // express app object events\n  app.mount = () => {} // stubbed out\n\n  // registers a route and handles middleware\n  function routeHandler (arg1, arg2, arg3, arg4) {\n    const method = arg1\n    const middleware = arg2\n    let route\n    let callback\n    if (arg4) {\n      route = arg3\n      callback = (req, res) => middleware(req, res, () => arg4(req, res))\n    } else {\n      if (typeof arg2 !== 'string' && typeof arg2 === 'function') {\n        route = arg3\n        callback = arg2\n      } else {\n        route = arg2\n        callback = arg3\n      }\n    }\n    registerRoute(method, route, callback)\n  }\n\n  // express app object methods\n  app.all = (middleware, route, callback) => { routeHandler('all', middleware, route, callback) }\n  app.delete = (middleware, route, callback) => { routeHandler('delete', middleware, route, callback) }\n  app.disable = (name) => { app.appVars[name] = false }\n  app.disabled = (name) => { return !app.appVars[name] }\n  app.enable = (name) => { app.appVars[name] = true }\n  app.enabled = (name) => { return !!app.appVars[name] }\n  app.engine = () => {} // stubbed out\n  app.get = (middleware, name, callback) => { // in the express docs, this method is overloaded and can be used for more than one thing based on the number of arguments\n    if (!name && !callback) return app.appVars[middleware]\n    else return routeHandler('get', middleware, name, callback)\n  }\n  app.listen = () => {} // stubbed out\n  httpVerbs.forEach(method => { // app.METHOD\n    // some method names are overloaded and can be used for more than one thing based on the number of arguments\n    if (!app[method]) app[method] = (middleware, route, callback) => routeHandler(method, middleware, route, callback)\n  })\n  app.param = () => {} // stubbed out\n  app.path = () => {} // stubbed out\n  app.post = (middleware, route, callback) => { routeHandler('post', middleware, route, callback) }\n  app.put = (middleware, route, callback) => { routeHandler('put', middleware, route, callback) }\n  // app.render will be defined below\n  app.route = (route) => {\n    const ret = { route }\n    httpVerbs.forEach(method => { ret[method] = (middleware, callback) => { routeHandler(method, middleware, route, callback) } })\n    return ret\n  }\n  app.set = (name, val) => { app.appVars[name] = val }\n  app.use = () => {} // stubbed out\n  app.triggerRoute = handleRoute // single-page-express-exclusive method\n\n  // #endregion\n\n  // #region request object\n\n  const defaultReq = {} // this is later extended during a \"request\" cycle\n\n  // request object properties\n  defaultReq.app = app\n  defaultReq.baseUrl = '' // stubbed out\n  // req.body is defined at runtime below\n  // req.cookies is defined at runtime below\n  defaultReq.fresh = true // stubbed out\n  defaultReq.hostname = window.location.hostname\n  defaultReq.ip = '127.0.0.1' // stubbed out\n  defaultReq.ips = [] // stubbed out\n  // req.method is defined at runtime below\n  // req.originalUrl is defined at runtime below\n  // req.params is defined at runtime below\n  // req.path is defined at runtime below\n  // req.protocol is defined at runtime below\n  // req.query is defined at runtime below\n  // req.res is defined below because res is not initialized yet\n  // req.route is defined at runtime below\n  // req.secure is defined at runtime below\n  defaultReq.signedCookies = {} // stubbed out\n  defaultReq.stale = false // stubbed out\n  // req.subdomains is defined at runtime below\n  defaultReq.xhr = true // stubbed out\n\n  // request object methods\n  defaultReq.accepts = () => {} // stubbed out\n  defaultReq.acceptsCharsets = () => {} // stubbed out\n  defaultReq.acceptsEncodings = () => {} // stubbed out\n  defaultReq.acceptsLanguages = () => {} // stubbed out\n  defaultReq.get = () => {} // stubbed out\n  defaultReq.is = () => {} // stubbed out\n  defaultReq.param = () => {} // stubbed out\n  defaultReq.range = () => {} // stubbed out\n\n  // new properties\n  defaultReq.singlePageExpress = true\n\n  // #endregion\n\n  // #region response object\n\n  const res = {}\n\n  // response object properties\n  res.app = app\n  res.headersSent = false // stubbed out\n  res.locals = {} // stubbed out\n  // res.req defined at runtime below\n\n  // response object methods\n  res.append = () => { return res } // stubbed out\n  res.attachment = () => { return res } // stubbed out\n  res.cookie = (name, value, options = {}) => {\n    const {\n      domain,\n      encode = encodeURIComponent,\n      expires,\n      httpOnly,\n      maxAge,\n      path = '/',\n      partitioned,\n      priority,\n      secure,\n      signed,\n      sameSite\n    } = options\n    let cookieString = `${encode(name)}=${encode(value)}`\n    if (expires instanceof Date) cookieString += `; expires=${expires.toUTCString()}`\n    if (maxAge) cookieString += `; max-age=${maxAge}`\n    if (domain) cookieString += `; domain=${domain}`\n    if (path) cookieString += `; path=${path}`\n    if (secure) cookieString += '; secure'\n    if (httpOnly) cookieString += '; HttpOnly'\n    if (sameSite) cookieString += `; SameSite=${sameSite}`\n    if (partitioned) cookieString += '; Partitioned'\n    if (priority) cookieString += `; Priority=${priority}`\n    if (signed) {\n      if (app.appVars.env === 'development') console.warn('Signed cookies are not supported in the browser context.')\n    }\n    document.cookie = cookieString\n  }\n  res.clearCookie = (name, options = {}) => {\n    const {\n      domain,\n      encode = encodeURIComponent,\n      httpOnly,\n      path = '/',\n      partitioned,\n      priority,\n      secure,\n      signed,\n      sameSite\n    } = options\n    const pastDate = new Date(0).toUTCString() // set the cookie's expiration date to a past date\n    let cookieString = `${encode(name)}=; expires=${pastDate}`\n    if (domain) cookieString += `; domain=${domain}`\n    if (path) cookieString += `; path=${path}`\n    if (secure) cookieString += '; secure'\n    if (httpOnly) cookieString += '; HttpOnly'\n    if (sameSite) cookieString += `; SameSite=${sameSite}`\n    if (partitioned) cookieString += '; Partitioned'\n    if (priority) cookieString += `; Priority=${priority}`\n    if (signed) console.warn('Signed cookies are not supported in the frontend.')\n    document.cookie = cookieString\n  }\n  res.download = () => { return res } // stubbed out\n  res.end = () => { return res } // stubbed out\n  res.format = () => { return res } // stubbed out\n  res.get = () => { return res } // stubbed out\n  res.json = (json) => {\n    console.log(json)\n    return res\n  }\n  res.jsonp = () => { return res } // stubbed out\n  res.links = () => { return res } // stubbed out\n  res.location = () => { return res } // stubbed out\n  res.redirect = (status, route) => {\n    if (!route) route = status\n    handleRoute({ route })\n    return res\n  }\n  // res.render is defined below\n  res.send = () => { return res } // stubbed out\n  res.sendFile = () => { return res } // stubbed out\n  res.sendStatus = () => { return res } // stubbed out\n  res.set = () => { return res } // stubbed out\n  res.status = () => { return res } // stubbed out\n  res.type = () => { return res } // stubbed out\n  res.vary = () => { return res } // stubbed out\n  defaultReq.res = res // apply the response object to the default request object\n\n  // #endregion\n\n  // #region single-page-express methods\n\n  // add a route to the route list\n  function registerRoute (method, route, callback) {\n    // if the method is 'all' then we need to call this function for every method\n    if (method === 'all') {\n      httpVerbs.forEach((middleware, method) => { routeHandler(method, middleware, route, callback) })\n      return\n    }\n\n    // flatten if case insensitivity is enabled\n    if (app.appVars['case sensitive routing']) route = route.toLowerCase()\n\n    // remove trailing `/` if it exists if strict routing is disabled\n    if (!app.appVars['strict routing'] && route.endsWith('/') && route !== '/') route = route.slice(0, -1)\n\n    // check if route is already registered\n    if (!(route in app.routes)) {\n      // determine which route matching method to use\n      let matcher\n      if (app.expressVersion === 5) {\n        try {\n          matcher = pathToRegexpMatch(route) // the newer version of path-to-regexp returns a matching function\n        } catch (error) {\n          console.error(`single-page-express: failed to register the route '${route}' because it could not be parsed.`)\n          if (route.includes('*')) console.error('single-page-express: routes with \\'*\\' in them should be written like \\'*all\\' instead in Express 5+ syntax.')\n          console.error(error)\n        }\n      } else matcher = pathToRegexpMatchExpress4(route) // the older version of path-to-regexp returns a matching regular expression\n\n      // register the route\n      app.routes[`${method}#${route}`] = {\n        method,\n        route,\n        matcher\n      }\n      app.routeCallbacks[`${method}#${route}`] = callback\n    }\n  }\n\n  // if it's a registered route, fire its event; if it's not, let the browser handle it natively\n  async function handleRoute (params) {\n    let route = params.route\n    const method = params.method ? ('' + params.method).toLowerCase() : 'get' // http method from the request\n\n    // check if it's a registered route\n    let match\n    let routeWithoutQuery = route.split('?')[0] // TODO: handle links without href attributes\n\n    // flatten if case insensitivity is enabled\n    if (app.appVars['case sensitive routing']) routeWithoutQuery = routeWithoutQuery.toLowerCase()\n\n    // remove trailing `/` if it exists and if strict routing is disabled\n    if (!app.appVars['strict routing'] && routeWithoutQuery.length > 1 && routeWithoutQuery.endsWith('/')) routeWithoutQuery = routeWithoutQuery.slice(0, -1)\n\n    // loop through route matcher functions to see if any of them match this url pattern\n    for (const registeredRoute in app.routes) {\n      const potentialMatch = app.routes[registeredRoute]\n      if (potentialMatch.method !== method) continue // the registered route's declared method must match the request method\n      if (app.expressVersion === 5) potentialMatch.data = potentialMatch.matcher(routeWithoutQuery) // the newer version of path-to-regexp returns a matching function\n      else potentialMatch.data = potentialMatch.matcher.exec(routeWithoutQuery) // the older version of path-to-regexp returns a matching regular expression\n      if (potentialMatch.data) {\n        match = potentialMatch\n        break\n      }\n    }\n\n    if (match) {\n      // it's a registered route, so hijack the event\n      params.event?.preventDefault()\n\n      // show top bar\n      if ((app.topbarEnabled && !app.topBarRoutes) || app.topBarRoutes?.includes?.(match.route)) app.topbar.show()\n\n      // save scroll position of current page before moving to the next page\n      app.urls[window.location.pathname] = {\n        scrollX: window.scrollX,\n        scrollY: window.scrollY,\n        scrollingChildContainers: {}\n      }\n\n      // save scroll position of child containers that scroll too, so long as they have ids\n      for (const scrollingChildContainer of document.querySelectorAll('[id]')) {\n        if (scrollingChildContainer.scrollHeight > scrollingChildContainer.clientHeight || scrollingChildContainer.scrollWidth > scrollingChildContainer.clientWidth) {\n          app.urls[window.location.pathname].scrollingChildContainers[scrollingChildContainer.id] = {\n            scrollX: scrollingChildContainer.scrollLeft,\n            scrollY: scrollingChildContainer.scrollTop\n          }\n        }\n      }\n\n      // alter browser history state\n      if (method === 'get' && !params.skipHistory) {\n        const state = { index: historyStack.length }\n        historyStack.push(state)\n        currentIndex = historyStack.length - 1\n        window.history.pushState(state, '', route)\n      }\n\n      // build request object\n      const req = { ...defaultReq }\n\n      // req.body\n      if (params.parseBody || params.body) {\n        if (params.event?.target) { // it's possible to submit the form using app.triggerRoute, in which case there won't be form data\n          req.body = Object.fromEntries(new FormData(params.event.target).entries()) // convert the form entries into key/value pairs\n          if (params.event.submitter) req.body[params.event.submitter.name] = params.event.submitter.value // add which button was clicked to req.body\n        } else if (params.body) req.body = params.body // use manually submitted request body if it is provided instead\n        else req.body = {} // otherwise set req.body to an empty object\n        if (app.expressVersion > 4 && req.body && Object.keys(req.body).length === 0) req.body = undefined // if req.body is an empty object and the express version is 5+ then set req.body to undefined to match the express api\n      }\n\n      // req.cookies\n      const cookies = document.cookie.split('; ')\n      req.cookies = {}\n      cookies.forEach(cookie => {\n        const [name, value] = cookie.split('=')\n        req.cookies[decodeURIComponent(name)] = decodeURIComponent(value)\n      })\n\n      req.method = method\n      req.originalUrl = route\n\n      // req.params\n      if (app.expressVersion === 5) req.params = match.data.params // the newer version of path-to-regexp just gives us the params\n      else {\n        // the older version of path-to-regexp does not map the params to key/value pairs, so we have to do it ourselves\n        req.params = {}\n        const keys = match.route.match(/:([^/]+)/g)?.map(key => key.substring(1)) // extract the keys from the route pattern, if any exist\n        if (keys) {\n          const vals = match.matcher.exec(match.data[0]) // use the matcher to extract values from the data\n          if (vals) for (const [index, key] of keys.entries()) req.params[key] = vals[index + 1] // make an object with key/value pairs, if any params exist\n        }\n      }\n\n      // req.path and req.protocol\n      const parsedUrl = new URL(window.location.href)\n      req.path = parsedUrl.pathname\n      req.protocol = parsedUrl.protocol\n\n      // req.query\n      if (app.appVars['query parser']) {\n        const parts = route.split('?') // split the route by question marks\n        route = parts[0] // the first part is the route\n        const queryString = parts.slice(1).join(', ') // all the remaining parts are the query params\n        req.query = Object.fromEntries(new URLSearchParams(queryString).entries()) // convert the query string into key/value pairs\n      }\n\n      req.route = match.data\n      req.secure = req.protocol === 'https' || req.protocol === 'https:'\n\n      // req.subdomains\n      const parts = req.hostname.split('.')\n      const subdomains = parts.slice(0, -parseInt(app.appVars['subdomain offset']))\n      req.subdomains = subdomains.reverse()\n\n      // attach req object to res\n      res.req = req\n\n      // pass along whether the back button or forward button was pressed\n      req.backButtonPressed = params.backButtonPressed\n      req.forwardButtonPressed = params.forwardButtonPressed\n\n      // add back/forward button classes to the html element\n      const htmlEl = document.querySelector('html')\n      if (params.backButtonPressed) {\n        htmlEl.classList.add('backButtonPressed')\n        htmlEl.classList.remove('forwardButtonPressed')\n      } else if (params.forwardButtonPressed) {\n        htmlEl.classList.remove('backButtonPressed')\n        htmlEl.classList.add('forwardButtonPressed')\n      } else {\n        htmlEl.classList.remove('backButtonPressed')\n        htmlEl.classList.remove('forwardButtonPressed')\n      }\n\n      // fire the event\n      await app.routeCallbacks[`${method}#${match.route}`](req, res)\n\n      // scroll the page appropriately\n      const scrollPage = () => {\n        // if this page has never been visited before or res.resetScroll or app.alwaysScrollTop is present\n        if (!app.urls[route] || res.resetScroll || app.alwaysScrollTop) {\n          window.scrollTo(0, 0) // scroll to the top\n          if (res.resetScroll) {\n            delete app.urls[route].scrollX\n            delete app.urls[route].scrollY\n            delete app.urls[route].scrollingChildContainers\n          }\n        } else if (app.urls[route]) { // if this page has been visited before\n          window.scrollTo(app.urls[route].scrollX || 0, app.urls[route].scrollY || 0) // restore the previous scroll position\n          // restore the position of scrollable containers\n          for (const scrollingChildContainer in app.urls[route].scrollingChildContainers) {\n            if (document.getElementById(scrollingChildContainer)) {\n              document.getElementById(scrollingChildContainer).scrollTo(app.urls[route].scrollingChildContainers[scrollingChildContainer].scrollX || 0, app.urls[route].scrollingChildContainers[scrollingChildContainer].scrollY || 0)\n            }\n          }\n        }\n        res.resetScroll = null // clear this var so it does not persist on the next request; allow routes to opt-in\n\n        // hide top bar (loading completed)\n        if ((app.topbarEnabled && !app.topBarRoutes) || app.topBarRoutes?.includes?.(match.route)) app.topbar.hide()\n      }\n      if (currentViewTransition) document.addEventListener('animationend', scrollPage) // scroll the page after view transitions or css animations are done\n      else window.setTimeout(scrollPage, parseInt(res.updateDelay) || parseInt(app.updateDelay) || 0) // scroll page after user-defined animation finishes; delay the scroll until after the render by using the same delay mechanism as the default render method\n    }\n  }\n\n  // app.render implements the express api on the surface, then prescribes some default behavior specific to this module, provides a default method for dom manipulation, and allows for a user to override the default dom manipulation behaviors\n  app.render = function (template, model, callback) {\n    model = model || {}\n\n    // clear all `this` variables so they do not persist but store local copies for this method invocation's use\n    const thisTitle = this.title\n    const thisBeforeRender = this.beforeRender\n    const thisTarget = this.target\n    const thisAppendTargets = this.appendTargets\n    const thisFocus = this.focus\n    const thisRemoveMetaTags = this.removeMetaTags\n    const thisRemoveStyleTags = this.removeStyleTags\n    const thisRemoveLinkTags = this.removeLinkTags\n    const thisRemoveScriptTags = this.removeScriptTags\n    const thisRemoveBaseTags = this.removeBaseTags\n    const thisRemoveTemplateTags = this.removeTemplateTags\n    const thisRemoveHeadTags = this.removeHeadTags\n    const thisSkipViewTransition = this.skipViewTransition\n    const thisUpdateDelay = this.updateDelay\n    const thisAfterRender = this.afterRender\n    this.title = null\n    this.beforeRender = null\n    this.target = null\n    this.focus = null\n    this.removeMetaTags = null\n    this.removeStyleTags = null\n    this.removeLinkTags = null\n    this.removeScriptTags = null\n    this.removeBaseTags = null\n    this.removeTemplateTags = null\n    this.removeHeadTags = null\n    this.skipViewTransition = null\n    this.updateDelay = null\n    this.afterRender = null\n\n    const postRenderCallbacks = () => {\n      // fire post-render callback for this template if it exists\n      if (app.postRenderCallbacks[template]) {\n        if (typeof app.postRenderCallbacks[template] === 'function') {\n          app.postRenderCallbacks[template](model)\n        } else console.error(`single-page-express: post-render callback for ${template} is not a function.`)\n      }\n\n      // fire a post-render callback registered for all templates if it exists\n      for (const key in app.postRenderCallbacks) {\n        if (key.startsWith('*')) { // this allows both * and *all syntax for both express 4 and 5 compatibility\n          if (typeof app.postRenderCallbacks[key] === 'function') app.postRenderCallbacks[key](model)\n          else console.error(`single-page-express: post-render callback for ${key} is not a function.`)\n          break\n        }\n      }\n    }\n\n    if (options.renderMethod) {\n      // execute user-supplied render method if it is provided\n      options.renderMethod(template, model, callback)\n      postRenderCallbacks()\n    } else {\n      // execute default render method if the user does not supply one\n      let err\n\n      // if no templates exist at all, log the render method arguments to the console and display a warning that no templates are loaded\n      if (!err && !app.templates) {\n        err = 'single-page-express: no templates are loaded.'\n        console.log('template:', template)\n        console.log('model:', model)\n      }\n\n      if (!err && (!app?.templatingEngine.render || typeof app?.templatingEngine?.render !== 'function')) {\n        err = 'single-page-express: no template engine is loaded or the engine supplied does not have a `render` method; please use a templating engine that is compatible with Express'\n        console.error(err)\n      }\n\n      if (!err && !app.templates[template]) {\n        err = `single-page-express: attempted to render template which does not exist: ${template}`\n        console.error(err)\n      }\n\n      let markup = ''\n      if (!err) {\n        // render the template with the chosen templating system\n        try {\n          markup = app.templatingEngine.render(template, model)\n          // TODO: leverage https://html-validate.org/ — will need to be a peer dep\n          // add html-validate to devDependencies\n          // const htmlValidate = require('./node_modules/html-validate/dist/cjs/browser.js')\n          // console.log(htmlValidate)\n          // this seems to crash webpack for some reason\n        } catch (error) {\n          const msg = `single-page-express: error parsing post-rendered template: ${template}`\n          console.error(msg)\n          console.error(error.message)\n          err = msg + '\\n' + error.message\n        }\n\n        if (!err) {\n          // build a dom from the rendered markup\n          let doc\n          try {\n            doc = parser.parseFromString(markup, 'text/html')\n          } catch (error) {\n            const msg = `single-page-express: error parsing post-rendered template: ${template}`\n            console.error(msg)\n            console.error(error.message)\n            err = msg + '\\n' + error.message\n          }\n\n          if (!err) {\n            // replace title tag with the new one\n            if (thisTitle) { // check if res.title is set\n              if (document.querySelector('title')) { // check if the title element exists\n                document.querySelector('title').innerHTML = thisTitle // replace the page title with the new title from res.title\n              }\n            } else if (doc.querySelector('title') && document.querySelector('title')) { // otherwise check if a <title> tag exists in the template\n              document.querySelector('title').innerHTML = doc.querySelector('title').innerHTML // if so, replace the page title with the new title from the <title> tag\n            }\n\n            // determine the targets\n            let targets\n            if (thisTarget) {\n              if (Array.isArray(thisTarget)) targets = thisAppendTargets ? app.defaultTargets.concat(thisTarget) : thisTarget\n              else targets = thisAppendTargets ? app.defaultTargets.concat([thisTarget]) : [thisTarget]\n            } else targets = app.defaultTargets\n\n            // call beforeRender methods if they exist\n            const beforeAfterRenderArg = {\n              model,\n              markup,\n              doc,\n              targets\n            }\n            if (app.beforeEveryRender && typeof app.beforeEveryRender === 'function') app.beforeEveryRender(beforeAfterRenderArg) // call app.beforeEveryRender function if it exists\n            if (thisBeforeRender && typeof thisBeforeRender === 'function') thisBeforeRender(beforeAfterRenderArg) // call res.beforeRender function if it exists\n\n            // remove tags from the head tag if any res.remove* properties are set\n            if (thisRemoveMetaTags) for (const tag of document.querySelectorAll('head meta')) tag.remove() // res.removeMetaTags\n            if (thisRemoveStyleTags) for (const tag of document.querySelectorAll('head style')) tag.remove() // res.removeStyleTags\n            if (thisRemoveLinkTags) for (const tag of document.querySelectorAll('head link')) tag.remove() // res.removeLinkTags\n            if (thisRemoveScriptTags) for (const tag of document.querySelectorAll('head script')) tag.remove() // res.removeScriptTags\n            if (thisRemoveBaseTags) for (const tag of document.querySelectorAll('head base')) tag.remove() // res.removeBaseTags\n            if (thisRemoveTemplateTags) for (const tag of document.querySelectorAll('head template')) tag.remove() // res.removeTemplateTags\n            if (thisRemoveHeadTags) for (const tag of document.querySelectorAll('head > :not(title)')) tag.remove() // res.removeHeadTags\n\n            // update the attributes of the html tag and head tag; preexisting attributes will not be removed; only new ones added or old ones updated\n            for (const attrib of doc.documentElement.attributes) document.documentElement.setAttribute(attrib.name, attrib.value)\n            for (const attrib of doc.head.attributes) document.head.setAttribute(attrib.name, attrib.value)\n\n            // add any new tags to the head tag from the new page that aren't present in the previous page\n            const oldHeadElements = Array.from(document.head.children)\n            const newHeadElements = Array.from(doc.head.children)\n            const oldHeadElementsStrings = oldHeadElements.map(el => el.outerHTML) // for comparison\n            const diffElements = newHeadElements.filter(el => !oldHeadElementsStrings.includes(el.outerHTML)) // figure out which head elements are new\n\n            // wait until link tags finish loading before updating the DOM to prevent a FOUC https://en.wikipedia.org/wiki/Flash_of_unstyled_content\n            const linkTagsInDiff = diffElements.filter(el => el.tagName.toLowerCase() === 'link')\n            const loadPromises = []\n            for (const linkTag of linkTagsInDiff) loadPromises.push(new Promise((resolve) => { linkTag.addEventListener('load', () => resolve()) }))\n\n            // wait until script tags finish loading before updating the DOM to prevent a FOUC https://en.wikipedia.org/wiki/Flash_of_unstyled_content\n            for (const tag of diffElements) {\n              // if the script tag is for a new script, don't update the DOM until it finishes loading\n              if (tag.nodeName === 'SCRIPT' && !document.querySelector(`script[src=\"${tag.src}\"]`) && !document.querySelector(`script[src=\"${tag.src.replace(window.location.origin, '')}\"]`)) {\n                const script = document.createElement('script')\n                script.src = tag.src\n                script.type = 'text/javascript'\n                script.async = true\n                loadPromises.push(new Promise((resolve) => { script.onload = () => resolve() }))\n                document.head.appendChild(script)\n              } else document.head.appendChild(tag) // if it's a script we've already seen before, we don't need to wait for it\n            }\n\n            // update DOM after all link tags and script tags have finished loading\n            Promise.all(loadPromises).then(() => {\n              window.setTimeout(() => {\n                const domUpdate = () => {\n                  for (const target of targets) {\n                    let targetEl\n                    if (document.querySelector(target)) { // check if the target is a valid DOM element\n                      targetEl = document.querySelector(target)\n                      const propertyToUpdate = targetEl.nodeName === 'BODY' ? 'innerHTML' : 'outerHTML' // if targetEl is a body tag, update innerHTML, otherwise outerHTML; this prevents duplicate head tags from being inserted into the DOM\n                      if (doc.querySelector(target)) { // if the new template has an element with the same id as the target container, then that's the container we're writing to\n                        targetEl[propertyToUpdate] = doc.querySelector(target).outerHTML // replace the target with the contents of the template's target id\n                      } else if (doc.body) {\n                        targetEl[propertyToUpdate] = doc.body.innerHTML // replace the target with the contents of body from the template\n                      } else {\n                        targetEl[propertyToUpdate] = doc.innerHTML // replace the target with the contents of the entire template\n                      }\n\n                      // announce the page change to screen readers\n                      const announcementContentElement = document.querySelector('[data-page-title]') || document.querySelector('h1[aria-label]') || document.querySelector('h1') || document.querySelector('title')\n                      if (!document.getElementById('singlePageExpressDefaultRenderMethodAriaLiveRegion')) {\n                        const liveRegion = document.createElement('p')\n                        liveRegion.id = 'singlePageExpressDefaultRenderMethodAriaLiveRegion'\n                        liveRegion.setAttribute('aria-live', 'assertive')\n                        liveRegion.setAttribute('aria-atomic', 'true')\n                        liveRegion.style.position = 'absolute'\n                        liveRegion.style.top = '-9999px'\n                        liveRegion.style.left = '-9999px'\n                        liveRegion.style.width = '1px'\n                        liveRegion.style.height = '1px'\n                        liveRegion.style.overflow = 'hidden'\n                        liveRegion.style.border = '0'\n                        liveRegion.style.margin = '-1px'\n                        liveRegion.style.padding = '0'\n                        liveRegion.style.clipPath = 'inset(50%)'\n                        liveRegion.style.whiteSpace = 'nowrap'\n                        document.body.appendChild(liveRegion)\n                      }\n                      document.getElementById('singlePageExpressDefaultRenderMethodAriaLiveRegion').textContent = '' // clear before announcing\n                      document.getElementById('singlePageExpressDefaultRenderMethodAriaLiveRegion').textContent = announcementContentElement.textContent\n\n                      // set browser focus\n                      const validElementsForOutline = ['A', 'INPUT', 'TEXTAREA', 'SELECT', 'BUTTON', 'FIELDSET'] // list of outlines that are okay to have a visible outline (mostly a problem in just safari; other browsers' default styles don't apply outlines to literally everything that is `focus()`ed)\n                      let focusEl = document.querySelector(thisFocus) || document.body.querySelector('[autofocus]') // see if there's a declared focus element\n                      if (focusEl && !focusEl.closest('[inert], [aria-disabled], [aria-hidden=\"true\"]')) focusEl = null // don't focus elements that have been declared inert\n                      if (focusEl && focusEl !== document.activeElement) {\n                        focusEl.focus() // only focus if not already focused\n                        if (!validElementsForOutline.includes(focusEl.tagName)) focusEl.style.outline = 'none'\n                      } else { // focus the target element instead (defined as the first element that appears in the targets array)\n                        // apply a tabindex attribute to allow focusing non-focusable elements\n                        const targetEl = document.querySelector(targets[0])\n                        const originalTabindex = targetEl.getAttribute('tabindex')\n                        targetEl.setAttribute('tabindex', '-1')\n                        targetEl.focus({ preventScroll: true })\n                        if (!validElementsForOutline.includes(targetEl.tagName)) targetEl.style.outline = 'none'\n                        if (originalTabindex !== null) targetEl.setAttribute('tabindex', originalTabindex)\n                      }\n\n                      // call afterRender methods if they exist\n                      if (app.afterEveryRender && typeof app.afterEveryRender === 'function') app.afterEveryRender(beforeAfterRenderArg) // call app.afterEveryRender function if it exists\n                      if (thisAfterRender && typeof thisAfterRender === 'function') thisAfterRender(beforeAfterRenderArg) // call res.afterRender function if it exists\n                    } else {\n                      const msg = `single-page-express: invalid target supplied: ${target}`\n                      console.error(msg)\n                      err = msg\n                    }\n                  }\n\n                  // call user-defined callback supplied to the render method if it exists\n                  if (callback && typeof callback === 'function') callback(err, markup)\n\n                  postRenderCallbacks()\n                }\n                if (document.startViewTransition && !thisSkipViewTransition && !app.alwaysSkipViewTransition) currentViewTransition = document.startViewTransition(domUpdate)\n                else domUpdate()\n              }, parseInt(thisUpdateDelay) || parseInt(app.updateDelay) || 0)\n            })\n          }\n        }\n      }\n    }\n  }\n  res.render = app.render // they are slightly different methods in express but there is no reason to differentiate between them here\n\n  // #endregion\n\n  // #region start the router\n\n  if (!document.singlePageExpressEventListenerAdded) {\n    // listen for link navigation events\n    document.addEventListener('click', (event) => {\n      if (event.target.tagName === 'A' && event.target.href) handleRoute({ route: event.target.getAttribute('href'), event })\n    })\n\n    // listen for form submits\n    document.addEventListener('submit', (event) => {\n      if (event.target.getAttribute('action')) handleRoute({ route: event.target.getAttribute('action'), event, parseBody: true, method: event.target.getAttribute('method') })\n    })\n  }\n  document.singlePageExpressEventListenerAdded = true // prevent attaching the event to the DOM twice\n\n  // listen for back/forward button properly\n  const historyStack = []\n  let currentIndex = -1\n  if (!window.singlePageExpressGlobalsInitialized) {\n    window.singlePageExpressGlobalsInitialized = true // this check prevents the event listener from being loaded multiple times if this constructor gets executed more than once\n    window.addEventListener('popstate', (event) => {\n      const state = event.state\n      if (!state) return\n      let backButtonPressed = false\n      let forwardButtonPressed = false\n      const newIndex = state.index\n      if (newIndex < currentIndex) backButtonPressed = true\n      else if (newIndex > currentIndex) forwardButtonPressed = true\n      currentIndex = newIndex\n      handleRoute({\n        route: window.location.pathname,\n        method: 'get',\n        skipHistory: true, // skipHistory prevents adding a new entry to history when responding to a back/forward button request\n        backButtonPressed,\n        forwardButtonPressed\n      })\n    })\n  }\n\n  // #endregion\n\n  return app\n}\n\nmodule.exports = singlePageExpress\n","/**\n * @license MIT\n * topbar 3.0.0\n * http://buunguyen.github.io/topbar\n * Copyright (c) 2024 Buu Nguyen\n */\n(function(window,document){\"use strict\";function repaint(){canvas.width=window.innerWidth,canvas.height=5*options.barThickness;var ctx=canvas.getContext(\"2d\");ctx.shadowBlur=options.shadowBlur,ctx.shadowColor=options.shadowColor;var stop,lineGradient=ctx.createLinearGradient(0,0,canvas.width,0);for(stop in options.barColors)lineGradient.addColorStop(stop,options.barColors[stop]);ctx.lineWidth=options.barThickness,ctx.beginPath(),ctx.moveTo(0,options.barThickness/2),ctx.lineTo(Math.ceil(currentProgress*canvas.width),options.barThickness/2),ctx.strokeStyle=lineGradient,ctx.stroke()}var canvas,currentProgress,showing,progressTimerId=null,fadeTimerId=null,delayTimerId=null,options={autoRun:!0,barThickness:3,barColors:{0:\"rgba(26,  188, 156, .9)\",\".25\":\"rgba(52,  152, 219, .9)\",\".50\":\"rgba(241, 196, 15,  .9)\",\".75\":\"rgba(230, 126, 34,  .9)\",\"1.0\":\"rgba(211, 84,  0,   .9)\"},shadowBlur:10,shadowColor:\"rgba(0,   0,   0,   .6)\",className:null},topbar={config:function(opts){for(var key in opts)options.hasOwnProperty(key)&&(options[key]=opts[key])},show:function(handler){var type,elem;showing||(handler?delayTimerId=delayTimerId||setTimeout(()=>topbar.show(),handler):(showing=!0,null!==fadeTimerId&&window.cancelAnimationFrame(fadeTimerId),canvas||((elem=(canvas=document.createElement(\"canvas\")).style).position=\"fixed\",elem.top=elem.left=elem.right=elem.margin=elem.padding=0,elem.zIndex=100001,elem.display=\"none\",options.className&&canvas.classList.add(options.className),type=\"resize\",handler=repaint,(elem=window).addEventListener?elem.addEventListener(type,handler,!1):elem.attachEvent?elem.attachEvent(\"on\"+type,handler):elem[\"on\"+type]=handler),canvas.parentElement||document.body.appendChild(canvas),canvas.style.opacity=1,canvas.style.display=\"block\",topbar.progress(0),options.autoRun&&function loop(){progressTimerId=window.requestAnimationFrame(loop),topbar.progress(\"+\"+.05*Math.pow(1-Math.sqrt(currentProgress),2))}()))},progress:function(to){return void 0===to||(\"string\"==typeof to&&(to=(0<=to.indexOf(\"+\")||0<=to.indexOf(\"-\")?currentProgress:0)+parseFloat(to)),currentProgress=1<to?1:to,repaint()),currentProgress},hide:function(){clearTimeout(delayTimerId),delayTimerId=null,showing&&(showing=!1,null!=progressTimerId&&(window.cancelAnimationFrame(progressTimerId),progressTimerId=null),function loop(){return 1<=topbar.progress(\"+.1\")&&(canvas.style.opacity-=.05,canvas.style.opacity<=.05)?(canvas.style.display=\"none\",void(fadeTimerId=null)):void(fadeTimerId=window.requestAnimationFrame(loop))}())}};\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=topbar:\"function\"==typeof define&&define.amd?define(function(){return topbar}):this.topbar=topbar}).call(this,window,document);","// 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\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(524);\n"],"names":["exports","path","options","decode","decodeURIComponent","delimiter","DEFAULT_DELIMITER","regexp","keys","pathToRegexp","decoders","map","key","NOOP_VALUE","type","value","split","input","m","exec","params","Object","create","i","length","undefined","decoder","name","ID_START","ID_CONTINUE","SIMPLE_TOKENS","escapeText","str","replace","escape","TokenData","constructor","tokens","originalPath","this","PathError","TypeError","message","text","super","parse","encodePath","chars","index","pos","test","quoteStart","push","consumeUntil","endType","output","token","cur","tokensToFunction","encode","encoders","fn","data","missing","encodeValue","Array","isArray","join","tokenToFunction","result","encoder","extras","end","sensitive","trailing","flags","sources","pathsToArray","flatten","toRegExpSource","pattern","RegExp","paths","init","p","seq","slice","backtrack","isSafeSegmentParam","negate","includes","stringifyTokens","isSafe","first","rest","every","char","isNameSafe","JSON","stringify","module","strict","lookahead","extraOffset","keysOffset","MATCHING_GROUP_REGEXP","source","optional","offset","match","slash","format","capture","star","splice","pathToRegexpMatch","pathToRegexpMatchExpress4","parser","window","DOMParser","app","currentViewTransition","expressVersion","parseInt","appVars","templatingEngine","templates","console","warn","routes","routeCallbacks","defaultTarget","defaultTargets","concat","beforeEveryRender","updateDelay","afterEveryRender","postRenderCallbacks","topbarEnabled","disableTopbar","topBarRoutes","topbar","config","topbarConfig","barColors","alwaysSkipViewTransition","alwaysScrollTop","urls","httpVerbs","routeHandler","arg1","arg2","arg3","arg4","middleware","route","callback","req","res","method","forEach","toLowerCase","endsWith","matcher","error","registerRoute","env","locals","mountpath","mount","all","delete","disable","disabled","enable","enabled","engine","get","listen","param","post","put","ret","set","val","use","triggerRoute","handleRoute","defaultReq","baseUrl","fresh","hostname","location","ip","ips","signedCookies","stale","xhr","accepts","acceptsCharsets","acceptsEncodings","acceptsLanguages","is","range","singlePageExpress","async","routeWithoutQuery","registeredRoute","potentialMatch","event","preventDefault","show","pathname","scrollX","scrollY","scrollingChildContainers","scrollingChildContainer","document","querySelectorAll","scrollHeight","clientHeight","scrollWidth","clientWidth","id","scrollLeft","scrollTop","skipHistory","state","historyStack","currentIndex","history","pushState","parseBody","body","target","fromEntries","FormData","entries","submitter","cookies","cookie","originalUrl","substring","vals","parsedUrl","URL","href","protocol","parts","queryString","query","URLSearchParams","secure","subdomains","reverse","backButtonPressed","forwardButtonPressed","htmlEl","querySelector","classList","add","remove","scrollPage","resetScroll","scrollTo","getElementById","hide","addEventListener","setTimeout","headersSent","append","attachment","domain","encodeURIComponent","expires","httpOnly","maxAge","partitioned","priority","signed","sameSite","cookieString","Date","toUTCString","clearCookie","pastDate","download","json","log","jsonp","links","redirect","status","send","sendFile","sendStatus","vary","render","template","model","thisTitle","title","thisBeforeRender","beforeRender","thisTarget","thisAppendTargets","appendTargets","thisFocus","focus","thisRemoveMetaTags","removeMetaTags","thisRemoveStyleTags","removeStyleTags","thisRemoveLinkTags","removeLinkTags","thisRemoveScriptTags","removeScriptTags","thisRemoveBaseTags","removeBaseTags","thisRemoveTemplateTags","removeTemplateTags","thisRemoveHeadTags","removeHeadTags","thisSkipViewTransition","skipViewTransition","thisUpdateDelay","thisAfterRender","afterRender","startsWith","renderMethod","err","markup","msg","doc","parseFromString","targets","innerHTML","beforeAfterRenderArg","tag","attrib","documentElement","attributes","setAttribute","head","oldHeadElements","from","children","newHeadElements","oldHeadElementsStrings","el","outerHTML","diffElements","filter","linkTagsInDiff","tagName","loadPromises","linkTag","Promise","resolve","nodeName","src","origin","appendChild","script","createElement","onload","then","domUpdate","targetEl","propertyToUpdate","announcementContentElement","liveRegion","style","position","top","left","width","height","overflow","border","margin","padding","clipPath","whiteSpace","textContent","validElementsForOutline","focusEl","closest","activeElement","outline","originalTabindex","getAttribute","preventScroll","startViewTransition","singlePageExpressEventListenerAdded","singlePageExpressGlobalsInitialized","newIndex","repaint","canvas","innerWidth","barThickness","ctx","getContext","shadowBlur","shadowColor","stop","lineGradient","createLinearGradient","addColorStop","lineWidth","beginPath","moveTo","lineTo","Math","ceil","currentProgress","strokeStyle","stroke","showing","progressTimerId","fadeTimerId","delayTimerId","autoRun","className","opts","hasOwnProperty","handler","elem","cancelAnimationFrame","right","zIndex","display","attachEvent","parentElement","opacity","progress","loop","requestAnimationFrame","pow","sqrt","to","indexOf","parseFloat","clearTimeout","call","__webpack_module_cache__","__webpack_exports__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"ignoreList":[],"sourceRoot":""}