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A,EAAYxS,EAAOyT,sBAAsBD,GAAM,CAAjN,GAAqN,GAA4B,iBAAiB1U,EAAO7F,QAAQ6F,EAAO7F,QAAQsI,OAA6E,KAAhC,aAAkB,OAAOA,CAAO,+BAAqB,GAAEyS,KAAKzY,KAAKyE,OAAO8F,S,GCL3pFmO,EAA2B,CAAC,GAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBzZ,IAAjB0Z,EACH,OAAOA,EAAanb,QAGrB,IAAI6F,EAASmV,EAAyBE,GAAY,CAGjDlb,QAAS,CAAC,GAOX,OAHAob,EAAoBF,GAAUH,KAAKlV,EAAO7F,QAAS6F,EAAQA,EAAO7F,QAASib,GAGpEpV,EAAO7F,OACf,ECnB0Bib,CAAoB","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.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 DEBUG_URL = \"https://git.new/pathToRegexpError\";\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 * Tokenize input string.\n */\nfunction* lexer(str) {\n    const chars = [...str];\n    let i = 0;\n    function name() {\n        let value = \"\";\n        if (ID_START.test(chars[++i])) {\n            value += chars[i];\n            while (ID_CONTINUE.test(chars[++i])) {\n                value += chars[i];\n            }\n        }\n        else if (chars[i] === '\"') {\n            let pos = i;\n            while (i < chars.length) {\n                if (chars[++i] === '\"') {\n                    i++;\n                    pos = 0;\n                    break;\n                }\n                if (chars[i] === \"\\\\\") {\n                    value += chars[++i];\n                }\n                else {\n                    value += chars[i];\n                }\n            }\n            if (pos) {\n                throw new TypeError(`Unterminated quote at ${pos}: ${DEBUG_URL}`);\n            }\n        }\n        if (!value) {\n            throw new TypeError(`Missing parameter name at ${i}: ${DEBUG_URL}`);\n        }\n        return value;\n    }\n    while (i < chars.length) {\n        const value = chars[i];\n        const type = SIMPLE_TOKENS[value];\n        if (type) {\n            yield { type, index: i++, value };\n        }\n        else if (value === \"\\\\\") {\n            yield { type: \"ESCAPED\", index: i++, value: chars[i++] };\n        }\n        else if (value === \":\") {\n            const value = name();\n            yield { type: \"PARAM\", index: i, value };\n        }\n        else if (value === \"*\") {\n            const value = name();\n            yield { type: \"WILDCARD\", index: i, value };\n        }\n        else {\n            yield { type: \"CHAR\", index: i, value: chars[i++] };\n        }\n    }\n    return { type: \"END\", index: i, value: \"\" };\n}\nclass Iter {\n    constructor(tokens) {\n        this.tokens = tokens;\n    }\n    peek() {\n        if (!this._peek) {\n            const next = this.tokens.next();\n            this._peek = next.value;\n        }\n        return this._peek;\n    }\n    tryConsume(type) {\n        const token = this.peek();\n        if (token.type !== type)\n            return;\n        this._peek = undefined; // Reset after consumed.\n        return token.value;\n    }\n    consume(type) {\n        const value = this.tryConsume(type);\n        if (value !== undefined)\n            return value;\n        const { type: nextType, index } = this.peek();\n        throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}: ${DEBUG_URL}`);\n    }\n    text() {\n        let result = \"\";\n        let value;\n        while ((value = this.tryConsume(\"CHAR\") || this.tryConsume(\"ESCAPED\"))) {\n            result += value;\n        }\n        return result;\n    }\n}\n/**\n * Tokenized path instance.\n */\nclass TokenData {\n    constructor(tokens) {\n        this.tokens = tokens;\n    }\n}\nexports.TokenData = TokenData;\n/**\n * Parse a string for the raw tokens.\n */\nfunction parse(str, options = {}) {\n    const { encodePath = NOOP_VALUE } = options;\n    const it = new Iter(lexer(str));\n    function consume(endType) {\n        const tokens = [];\n        while (true) {\n            const path = it.text();\n            if (path)\n                tokens.push({ type: \"text\", value: encodePath(path) });\n            const param = it.tryConsume(\"PARAM\");\n            if (param) {\n                tokens.push({\n                    type: \"param\",\n                    name: param,\n                });\n                continue;\n            }\n            const wildcard = it.tryConsume(\"WILDCARD\");\n            if (wildcard) {\n                tokens.push({\n                    type: \"wildcard\",\n                    name: wildcard,\n                });\n                continue;\n            }\n            const open = it.tryConsume(\"{\");\n            if (open) {\n                tokens.push({\n                    type: \"group\",\n                    tokens: consume(\"}\"),\n                });\n                continue;\n            }\n            it.consume(endType);\n            return tokens;\n        }\n    }\n    const tokens = consume(\"END\");\n    return new TokenData(tokens);\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 = path instanceof TokenData ? path : parse(path, options);\n    const fn = tokensToFunction(data.tokens, delimiter, encode);\n    return function path(data = {}) {\n        const [path, ...missing] = fn(data);\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 sources = [];\n    const flags = sensitive ? \"\" : \"i\";\n    const paths = Array.isArray(path) ? path : [path];\n    const items = paths.map((path) => path instanceof TokenData ? path : parse(path, options));\n    for (const { tokens } of items) {\n        for (const seq of flatten(tokens, 0, [])) {\n            const regexp = sequenceToRegExp(seq, delimiter, keys);\n            sources.push(regexp);\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 * 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        const fork = init.slice();\n        for (const seq of flatten(token.tokens, 0, fork)) {\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 sequenceToRegExp(tokens, delimiter, keys) {\n    let result = \"\";\n    let backtrack = \"\";\n    let isSafeSegmentParam = true;\n    for (let i = 0; i < tokens.length; i++) {\n        const token = tokens[i];\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 TypeError(`Missing text after \"${token.name}\": ${DEBUG_URL}`);\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}\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 token data into a path string.\n */\nfunction stringify(data) {\n    return data.tokens\n        .map(function stringifyToken(token, index, tokens) {\n        if (token.type === \"text\")\n            return escapeText(token.value);\n        if (token.type === \"group\") {\n            return `{${token.tokens.map(stringifyToken).join(\"\")}}`;\n        }\n        const isSafe = isNameSafe(token.name) && isNextNameSafe(tokens[index + 1]);\n        const key = isSafe ? token.name : JSON.stringify(token.name);\n        if (token.type === \"param\")\n            return `:${key}`;\n        if (token.type === \"wildcard\")\n            return `*${key}`;\n        throw new TypeError(`Unexpected token: ${token}`);\n    })\n        .join(\"\");\n}\nfunction isNameSafe(name) {\n    const [first, ...rest] = name;\n    if (!ID_START.test(first))\n        return false;\n    return rest.every((char) => ID_CONTINUE.test(char));\n}\nfunction isNextNameSafe(token) {\n    if ((token === null || token === void 0 ? void 0 : token.type) !== \"text\")\n        return true;\n    return !ID_CONTINUE.test(token.value[0]);\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.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 (method, middleware, route, callback) {\n    let callbackWithMiddlewareExecutingFirst = middleware\n    if (callback) callbackWithMiddlewareExecutingFirst = (req, res) => middleware(req, res, () => callback(req, res))\n    registerRoute(method, route, callbackWithMiddlewareExecutingFirst)\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 (!callback) return app.appVars[name]\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    // if the function receives one argument, then route is the callback, and the actual route needs to be defined from `this`\n    if (typeof route !== 'string' && typeof route === 'function') {\n      callback = route\n      route = this.route\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 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.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) 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","DEBUG_URL","SIMPLE_TOKENS","escape","str","replace","Iter","constructor","tokens","this","peek","_peek","next","tryConsume","token","consume","nextType","index","TypeError","text","result","TokenData","parse","encodePath","it","chars","test","pos","lexer","endType","push","param","wildcard","tokensToFunction","encode","encoders","fn","data","missing","encodeValue","Array","isArray","join","tokenToFunction","encoder","extras","end","sensitive","trailing","sources","flags","items","seq","flatten","sequenceToRegExp","pattern","RegExp","init","fork","slice","backtrack","isSafeSegmentParam","negate","includes","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","alwaysScrollTop","urls","httpVerbs","routeHandler","method","middleware","route","callback","callbackWithMiddlewareExecutingFirst","req","res","forEach","toLowerCase","endsWith","matcher","error","registerRoute","env","locals","mountpath","mount","all","delete","disable","disabled","enable","enabled","engine","get","listen","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","thisUpdateDelay","thisAfterRender","afterRender","startsWith","renderMethod","err","markup","msg","message","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_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}