From 4a41f2a8a33b8e1f77e226cbb29923f96583dfc7 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 4 Jul 2023 17:39:58 +0200 Subject: [PATCH 001/101] add bundled v --- .eslintrc.json | 1 + .vscode/settings.json | 28 +++- packages/next/src/build/utils.ts | 2 +- packages/next/src/export/worker.ts | 2 +- packages/next/src/server/config-shared.ts | 14 +- packages/next/src/server/config.ts | 25 +--- .../src/server/dev/static-paths-worker.ts | 2 +- packages/next/src/server/load-components.ts | 19 ++- packages/next/src/server/load-manifest.ts | 19 +++ packages/next/src/server/next-server.ts | 35 +++-- packages/next/src/server/node-environment.ts | 6 +- .../next/src/server/node-polyfill-form.ts | 20 ++- packages/next/src/server/require-hook.ts | 92 +++++------- packages/next/src/server/require.ts | 25 ++-- packages/next/src/server/router.ts | 1 + .../next/src/server/setup-http-agent-env.ts | 25 ++++ packages/next/taskfile.js | 138 ++++++++++++++++++ scripts/minimal-server.js | 107 ++++++++++++++ 18 files changed, 432 insertions(+), 129 deletions(-) create mode 100644 packages/next/src/server/load-manifest.ts create mode 100644 packages/next/src/server/setup-http-agent-env.ts create mode 100644 scripts/minimal-server.js diff --git a/.eslintrc.json b/.eslintrc.json index b0e16775944ce..8e61fafc5441b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -147,6 +147,7 @@ }, { "files": ["packages/**"], + "excludedFiles": ["packages/next/taskfile.js"], "rules": { "no-shadow": ["warn", { "builtinGlobals": false }], "import/no-extraneous-dependencies": [ diff --git a/.vscode/settings.json b/.vscode/settings.json index 2de2ef61939c7..7432a52188f68 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,8 +23,6 @@ "debug.javascript.unmapMissingSources": true, "files.exclude": { - "**/node_modules": false, - "node_modules": true, "*[!test]**/node_modules": true }, @@ -82,5 +80,29 @@ "language": "markdown", "scheme": "file" } - ] + ], + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#3399ff", + "activityBar.background": "#3399ff", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#bf0060", + "activityBarBadge.foreground": "#e7e7e7", + "commandCenter.border": "#e7e7e799", + "editorGroup.border": "#3399ff", + "panel.border": "#3399ff", + "sash.hoverBorder": "#3399ff", + "sideBar.border": "#3399ff", + "statusBar.background": "#007fff", + "statusBar.foreground": "#e7e7e7", + "statusBarItem.hoverBackground": "#3399ff", + "statusBarItem.remoteBackground": "#007fff", + "statusBarItem.remoteForeground": "#e7e7e7", + "tab.activeBorder": "#3399ff", + "titleBar.activeBackground": "#007fff", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveBackground": "#007fff99", + "titleBar.inactiveForeground": "#e7e7e799" + }, + "peacock.color": "#007fff" } diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index d46332ac27398..e8056673f7d0e 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -52,7 +52,7 @@ import { LoadComponentsReturnType, } from '../server/load-components' import { trace } from '../trace' -import { setHttpClientAndAgentOptions } from '../server/config' +import { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env' import { recursiveDelete } from '../lib/recursive-delete' import { Sema } from 'next/dist/compiled/async-sema' import { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path' diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index 760f9cf1ca534..484aa9303ad3f 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -30,7 +30,7 @@ import { requireFontManifest } from '../server/require' import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path' import { trace } from '../trace' import { isInAmpMode } from '../shared/lib/amp-mode' -import { setHttpClientAndAgentOptions } from '../server/config' +import { setHttpClientAndAgentOptions } from '../server/setup-http-agent-env' import RenderResult from '../server/render-result' import isError from '../lib/is-error' import { addRequestMeta } from '../server/request-meta' diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index bb9d5a4f42199..45f0e419e5101 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -755,9 +755,15 @@ export async function normalizeConfig(phase: string, config: any) { export function validateConfig(userConfig: NextConfig): { errors?: Array | null } { - const configValidator = require('next/dist/next-config-validate.js') - configValidator(userConfig) - return { - errors: configValidator.errors, + if (process.env.NEXT_MINIMAL) { + return { + errors: [], + } + } else { + const configValidator = require('next/dist/next-config-validate.js') + configValidator(userConfig) + return { + errors: configValidator.errors, + } } } diff --git a/packages/next/src/server/config.ts b/packages/next/src/server/config.ts index 9a8f25ea4d734..78458fc6a8b92 100644 --- a/packages/next/src/server/config.ts +++ b/packages/next/src/server/config.ts @@ -1,8 +1,6 @@ import { existsSync } from 'fs' import { basename, extname, join, relative, isAbsolute, resolve } from 'path' import { pathToFileURL } from 'url' -import { Agent as HttpAgent } from 'http' -import { Agent as HttpsAgent } from 'https' import findUp from 'next/dist/compiled/find-up' import chalk from '../lib/chalk' import * as Log from '../build/output/log' @@ -21,6 +19,7 @@ import { ImageConfig, imageConfigDefault } from '../shared/lib/image-config' import { loadEnvConfig, updateInitialEnv } from '@next/env' import { flushAndExit } from '../telemetry/flush-and-exit' import { findRootDir } from '../lib/find-root' +import { setHttpClientAndAgentOptions } from './setup-http-agent-env' export { DomainLocale, NextConfig, normalizeConfig } from './config-shared' @@ -43,28 +42,6 @@ const experimentalWarning = execOnce( } ) -export function setHttpClientAndAgentOptions(config: { - httpAgentOptions?: NextConfig['httpAgentOptions'] -}) { - if ((globalThis as any).__NEXT_HTTP_AGENT) { - // We only need to assign once because we want - // to reuse the same agent for all requests. - return - } - - if (!config) { - throw new Error('Expected config.httpAgentOptions to be an object') - } - - ;(globalThis as any).__NEXT_HTTP_AGENT_OPTIONS = config.httpAgentOptions - ;(globalThis as any).__NEXT_HTTP_AGENT = new HttpAgent( - config.httpAgentOptions - ) - ;(globalThis as any).__NEXT_HTTPS_AGENT = new HttpsAgent( - config.httpAgentOptions - ) -} - export function warnOptionHasBeenMovedOutOfExperimental( config: NextConfig, oldKey: string, diff --git a/packages/next/src/server/dev/static-paths-worker.ts b/packages/next/src/server/dev/static-paths-worker.ts index cf6a168faf0a3..673511f159443 100644 --- a/packages/next/src/server/dev/static-paths-worker.ts +++ b/packages/next/src/server/dev/static-paths-worker.ts @@ -11,7 +11,7 @@ import { GenerateParams, } from '../../build/utils' import { loadComponents } from '../load-components' -import { setHttpClientAndAgentOptions } from '../config' +import { setHttpClientAndAgentOptions } from '../setup-http-agent-env' import { IncrementalCache } from '../lib/incremental-cache' import * as serverHooks from '../../client/components/hooks-server-context' import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage' diff --git a/packages/next/src/server/load-components.ts b/packages/next/src/server/load-components.ts index 75ef5415fccb4..0afde3172fc51 100644 --- a/packages/next/src/server/load-components.ts +++ b/packages/next/src/server/load-components.ts @@ -24,7 +24,7 @@ import { BuildManifest } from './get-page-files' import { interopDefault } from '../lib/interop-default' import { getTracer } from './lib/trace/tracer' import { LoadComponentsSpan } from './lib/trace/constants' - +import { loadManifest } from './load-manifest' export type ManifestItem = { id: number | string files: string[] @@ -80,10 +80,13 @@ async function loadDefaultErrorComponentsImpl( /** * Load manifest file with retries, defaults to 3 attempts. */ -async function loadManifest(manifestPath: string, attempts = 3): Promise { +async function loadManifestWithRetries( + manifestPath: string, + attempts = 3 +): Promise { while (true) { try { - return require(manifestPath) + return loadManifest(manifestPath) } catch (err) { attempts-- if (attempts <= 0) throw err @@ -121,15 +124,17 @@ async function loadComponentsImpl({ clientReferenceManifest, serverActionsManifest, ] = await Promise.all([ - loadManifest(join(distDir, BUILD_MANIFEST)), - loadManifest(join(distDir, REACT_LOADABLE_MANIFEST)), + loadManifestWithRetries(join(distDir, BUILD_MANIFEST)), + loadManifestWithRetries( + join(distDir, REACT_LOADABLE_MANIFEST) + ), hasServerComponents - ? loadManifest( + ? loadManifestWithRetries( join(distDir, 'server', CLIENT_REFERENCE_MANIFEST + '.json') ) : undefined, hasServerComponents - ? loadManifest( + ? loadManifestWithRetries( join(distDir, 'server', SERVER_REFERENCE_MANIFEST + '.json') ).catch(() => null) : null, diff --git a/packages/next/src/server/load-manifest.ts b/packages/next/src/server/load-manifest.ts new file mode 100644 index 0000000000000..d241eb527ab6e --- /dev/null +++ b/packages/next/src/server/load-manifest.ts @@ -0,0 +1,19 @@ +import { readFileSync } from 'fs' + +const cache = new Map() + +export function loadManifest(path: string, shouldCache: boolean = true) { + const cached = shouldCache && cache.get(path) + + if (cached) { + return cached + } + + const manifest = JSON.parse(readFileSync(path, 'utf8')) + + if (shouldCache) { + cache.set(path, manifest) + } + + return manifest +} diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 60ac1e02ff27e..653e40a83d1b9 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -92,7 +92,7 @@ import ResponseCache from './response-cache' import { IncrementalCache } from './lib/incremental-cache' import { normalizeAppPath } from '../shared/lib/router/utils/app-paths' -import { setHttpClientAndAgentOptions } from './config' +import { setHttpClientAndAgentOptions } from './setup-http-agent-env' import { RouteKind } from './future/route-kind' import { PagesAPIRouteMatch } from './future/route-matches/pages-api-route-match' @@ -111,6 +111,7 @@ import { createRequestResponseMocks } from './lib/mock-request' import chalk from 'next/dist/compiled/chalk' import { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers' import { signalFromNodeRequest } from './web/spec-extension/adapters/next-request' +import { loadManifest } from './load-manifest' export * from './base-server' @@ -269,7 +270,7 @@ export default class NextNodeServer extends BaseServer { }).catch(() => {}) } - if (this.isRouterWorker) { + if (this.isRouterWorker && !process.env.NEXT_MINIMAL) { this.renderWorkers = {} this.renderWorkerOpts = { port: this.port || 0, @@ -435,14 +436,13 @@ export default class NextNodeServer extends BaseServer { } protected getPagesManifest(): PagesManifest | undefined { - return require(join(this.serverDistDir, PAGES_MANIFEST)) + return loadManifest(join(this.serverDistDir, PAGES_MANIFEST)) } protected getAppPathsManifest(): PagesManifest | undefined { if (!this.hasAppDir) return undefined - const appPathsManifestPath = join(this.serverDistDir, APP_PATHS_MANIFEST) - return require(appPathsManifestPath) + return loadManifest(join(this.serverDistDir, APP_PATHS_MANIFEST)) } protected async hasPage(pathname: string): Promise { @@ -1165,15 +1165,20 @@ export default class NextNodeServer extends BaseServer { protected getServerComponentManifest() { if (!this.hasAppDir) return undefined - return require(join( - this.distDir, - 'server', - CLIENT_REFERENCE_MANIFEST + '.json' - )) + + try { + return loadManifest( + join(this.distDir, 'server', CLIENT_REFERENCE_MANIFEST + '.json') + ) + } catch (e) { + return undefined + } } protected getNextFontManifest() { - return require(join(this.distDir, 'server', `${NEXT_FONT_MANIFEST}.json`)) + return loadManifest( + join(this.distDir, 'server', NEXT_FONT_MANIFEST + '.json') + ) } protected async getFallback(page: string): Promise { @@ -2751,13 +2756,15 @@ export default class NextNodeServer extends BaseServer { } return this._cachedPreviewManifest } - const manifest = require(join(this.distDir, PRERENDER_MANIFEST)) - return (this._cachedPreviewManifest = manifest) + + const manifest = loadManifest(join(this.distDir, PRERENDER_MANIFEST)) + + return (this._cachedPreviewManifest = JSON.parse(manifest)) } protected getRoutesManifest() { return getTracer().trace(NextNodeServerSpan.getRoutesManifest, () => - require(join(this.distDir, ROUTES_MANIFEST)) + loadManifest(join(this.distDir, ROUTES_MANIFEST)) ) } diff --git a/packages/next/src/server/node-environment.ts b/packages/next/src/server/node-environment.ts index 5e177e33c822d..fdd0d585dc9ce 100644 --- a/packages/next/src/server/node-environment.ts +++ b/packages/next/src/server/node-environment.ts @@ -8,5 +8,9 @@ if (typeof (globalThis as any).AsyncLocalStorage !== 'function') { } if (typeof (globalThis as any).WebSocket !== 'function') { - ;(globalThis as any).WebSocket = require('next/dist/compiled/ws').WebSocket + Object.defineProperty(globalThis, 'WebSocket', { + get() { + return require('next/dist/compiled/ws').WebSocket + }, + }) } diff --git a/packages/next/src/server/node-polyfill-form.ts b/packages/next/src/server/node-polyfill-form.ts index 7c7ec8570b3a9..e5b5abc5ae4bd 100644 --- a/packages/next/src/server/node-polyfill-form.ts +++ b/packages/next/src/server/node-polyfill-form.ts @@ -3,13 +3,21 @@ */ if (!(global as any).FormData) { - const { FormData } = - require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill') - ;(global as any).FormData = FormData + Object.defineProperty(global, 'FormData', { + get() { + const { FormData } = + require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill') + return FormData + }, + }) } if (!(global as any).Blob) { - const { Blob } = - require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill') - ;(global as any).Blob = Blob + Object.defineProperty(global, 'Blob', { + get() { + const { Blob } = + require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill') + return Blob + }, + }) } diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 40bc3b4be7438..360de5c64369d 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -17,12 +17,17 @@ export function addHookAliases(aliases: [string, string][] = []) { } } +// We need to use `eval` here to avoid webpack from rewriting the `require.resolve` calls +// as this code could be bundled +// eslint-disable-next-line no-eval +const resolve = eval('require').resolve + // Add default aliases addHookAliases([ // Use `require.resolve` explicitly to make them statically analyzable // styled-jsx needs to be resolved as the external dependency. - ['styled-jsx', dirname(require.resolve('styled-jsx/package.json'))], - ['styled-jsx/style', require.resolve('styled-jsx/style')], + ['styled-jsx', dirname(resolve('styled-jsx/package.json'))], + ['styled-jsx/style', resolve('styled-jsx/style')], ]) // Override built-in React packages if necessary @@ -35,145 +40,122 @@ function overrideReact() { // aliasing them it's tricky to track them in build time. if (process.env.__NEXT_PRIVATE_PREBUNDLED_REACT === 'experimental') { addHookAliases([ - ['react', require.resolve(`next/dist/compiled/react-experimental`)], + ['react', resolve(`next/dist/compiled/react-experimental`)], [ 'react/jsx-runtime', - require.resolve(`next/dist/compiled/react-experimental/jsx-runtime`), + resolve(`next/dist/compiled/react-experimental/jsx-runtime`), ], [ 'react/jsx-dev-runtime', - require.resolve( - `next/dist/compiled/react-experimental/jsx-dev-runtime` - ), + resolve(`next/dist/compiled/react-experimental/jsx-dev-runtime`), ], [ 'react-dom', - require.resolve( + resolve( `next/dist/compiled/react-dom-experimental/server-rendering-stub` ), ], [ 'react/package.json', - require.resolve(`next/dist/compiled/react-experimental/package.json`), + resolve(`next/dist/compiled/react-experimental/package.json`), ], [ 'react-dom/package.json', - require.resolve( - `next/dist/compiled/react-dom-experimental/package.json` - ), + resolve(`next/dist/compiled/react-dom-experimental/package.json`), ], [ 'react-dom/client', - require.resolve(`next/dist/compiled/react-dom-experimental/client`), + resolve(`next/dist/compiled/react-dom-experimental/client`), ], [ 'react-dom/server', - require.resolve(`next/dist/compiled/react-dom-experimental/server`), + resolve(`next/dist/compiled/react-dom-experimental/server`), ], [ 'react-dom/server.browser', - require.resolve( - `next/dist/compiled/react-dom-experimental/server.browser` - ), + resolve(`next/dist/compiled/react-dom-experimental/server.browser`), ], [ 'react-dom/server.edge', - require.resolve( - `next/dist/compiled/react-dom-experimental/server.edge` - ), + resolve(`next/dist/compiled/react-dom-experimental/server.edge`), ], [ 'react-server-dom-webpack/client', - require.resolve( + resolve( `next/dist/compiled/react-server-dom-webpack-experimental/client` ), ], [ 'react-server-dom-webpack/client.edge', - require.resolve( + resolve( `next/dist/compiled/react-server-dom-webpack-experimental/client.edge` ), ], [ 'react-server-dom-webpack/server.edge', - require.resolve( + resolve( `next/dist/compiled/react-server-dom-webpack-experimental/server.edge` ), ], [ 'react-server-dom-webpack/server.node', - require.resolve( + resolve( `next/dist/compiled/react-server-dom-webpack-experimental/server.node` ), ], ]) } else { addHookAliases([ - ['react', require.resolve(`next/dist/compiled/react`)], + ['react', resolve(`next/dist/compiled/react`)], [ 'react/package.json', - require.resolve(`next/dist/compiled/react/package.json`), - ], - [ - 'react/jsx-runtime', - require.resolve(`next/dist/compiled/react/jsx-runtime`), + resolve(`next/dist/compiled/react/package.json`), ], + ['react/jsx-runtime', resolve(`next/dist/compiled/react/jsx-runtime`)], [ 'react/jsx-dev-runtime', - require.resolve(`next/dist/compiled/react/jsx-dev-runtime`), + resolve(`next/dist/compiled/react/jsx-dev-runtime`), ], [ 'react-dom', - require.resolve(`next/dist/compiled/react-dom/server-rendering-stub`), + resolve(`next/dist/compiled/react-dom/server-rendering-stub`), ], [ 'react-dom/package.json', - require.resolve(`next/dist/compiled/react-dom/package.json`), - ], - [ - 'react-dom/client', - require.resolve(`next/dist/compiled/react-dom/client`), - ], - [ - 'react-dom/server', - require.resolve(`next/dist/compiled/react-dom/server`), + resolve(`next/dist/compiled/react-dom/package.json`), ], + ['react-dom/client', resolve(`next/dist/compiled/react-dom/client`)], + ['react-dom/server', resolve(`next/dist/compiled/react-dom/server`)], [ 'react-dom/server.browser', - require.resolve(`next/dist/compiled/react-dom/server.browser`), + resolve(`next/dist/compiled/react-dom/server.browser`), ], [ 'react-dom/server.edge', - require.resolve(`next/dist/compiled/react-dom/server.edge`), + resolve(`next/dist/compiled/react-dom/server.edge`), ], [ 'react-server-dom-webpack/client', - require.resolve(`next/dist/compiled/react-server-dom-webpack/client`), + resolve(`next/dist/compiled/react-server-dom-webpack/client`), ], [ 'react-server-dom-webpack/client.edge', - require.resolve( - `next/dist/compiled/react-server-dom-webpack/client.edge` - ), + resolve(`next/dist/compiled/react-server-dom-webpack/client.edge`), ], [ 'react-server-dom-webpack/server.edge', - require.resolve( - `next/dist/compiled/react-server-dom-webpack/server.edge` - ), + resolve(`next/dist/compiled/react-server-dom-webpack/server.edge`), ], [ 'react-server-dom-webpack/server.node', - require.resolve( - `next/dist/compiled/react-server-dom-webpack/server.node` - ), + resolve(`next/dist/compiled/react-server-dom-webpack/server.node`), ], ]) } } else { addHookAliases([ - ['react/jsx-runtime', require.resolve(`react/jsx-runtime`)], - ['react/jsx-dev-runtime', require.resolve(`react/jsx-dev-runtime`)], + ['react/jsx-runtime', resolve(`react/jsx-runtime`)], + ['react/jsx-dev-runtime', resolve(`react/jsx-dev-runtime`)], ]) } } diff --git a/packages/next/src/server/require.ts b/packages/next/src/server/require.ts index 62bb3ff6b1c02..6c5a9121fabc7 100644 --- a/packages/next/src/server/require.ts +++ b/packages/next/src/server/require.ts @@ -1,4 +1,3 @@ -import fs, { promises } from 'fs' import { join } from 'path' import { FONT_MANIFEST, @@ -12,6 +11,8 @@ import { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-pa import type { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin' import { PageNotFoundError, MissingStaticPage } from '../shared/lib/utils' import LRUCache from 'next/dist/compiled/lru-cache' +import { loadManifest } from './load-manifest' +import { promises } from 'fs' const isDev = process.env.NODE_ENV === 'development' const pagePathCache = isDev @@ -26,13 +27,6 @@ const pagePathCache = isDev max: 1000, }) -const loadManifest = (manifestPath: string) => { - if (isDev) { - return JSON.parse(fs.readFileSync(manifestPath, 'utf8')) - } - return require(manifestPath) -} - export function getMaybePagePath( page: string, distDir: string, @@ -49,10 +43,14 @@ export function getMaybePagePath( let appPathsManifest: undefined | PagesManifest if (isAppPath) { - appPathsManifest = loadManifest(join(serverBuildPath, APP_PATHS_MANIFEST)) + appPathsManifest = loadManifest( + join(serverBuildPath, APP_PATHS_MANIFEST), + !isDev + ) } const pagesManifest = loadManifest( - join(serverBuildPath, PAGES_MANIFEST) + join(serverBuildPath, PAGES_MANIFEST), + !isDev ) as PagesManifest try { @@ -123,11 +121,14 @@ export function requirePage( throw new MissingStaticPage(page, err.message) }) } - return require(pagePath) + + // this code could be bundled so we need to use `eval` to avoid using the bundler's require + // eslint-disable-next-line no-eval + return eval('require')(pagePath) } export function requireFontManifest(distDir: string) { const serverBuildPath = join(distDir, SERVER_DIRECTORY) - const fontManifest = require(join(serverBuildPath, FONT_MANIFEST)) + const fontManifest = loadManifest(join(serverBuildPath, FONT_MANIFEST)) return fontManifest } diff --git a/packages/next/src/server/router.ts b/packages/next/src/server/router.ts index b30e1dcf86f7b..5d07184a6ccd8 100644 --- a/packages/next/src/server/router.ts +++ b/packages/next/src/server/router.ts @@ -554,6 +554,7 @@ let _makeResolver: any = () => {} if ( // ensure this isn't bundled for edge runtime process.env.NEXT_RUNTIME !== 'edge' && + !process.env.NEXT_MINIMAL && // only load if we are inside of the turbopack handler process.argv.some((arg) => arg.endsWith('router.js')) ) { diff --git a/packages/next/src/server/setup-http-agent-env.ts b/packages/next/src/server/setup-http-agent-env.ts new file mode 100644 index 0000000000000..9079abb01a5e9 --- /dev/null +++ b/packages/next/src/server/setup-http-agent-env.ts @@ -0,0 +1,25 @@ +import { Agent as HttpAgent } from 'http' +import { Agent as HttpsAgent } from 'https' +import { NextConfig } from '../../types' + +export function setHttpClientAndAgentOptions(config: { + httpAgentOptions?: NextConfig['httpAgentOptions'] +}) { + if ((globalThis as any).__NEXT_HTTP_AGENT) { + // We only need to assign once because we want + // to reuse the same agent for all requests. + return + } + + if (!config) { + throw new Error('Expected config.httpAgentOptions to be an object') + } + + ;(globalThis as any).__NEXT_HTTP_AGENT_OPTIONS = config.httpAgentOptions + ;(globalThis as any).__NEXT_HTTP_AGENT = new HttpAgent( + config.httpAgentOptions + ) + ;(globalThis as any).__NEXT_HTTPS_AGENT = new HttpsAgent( + config.httpAgentOptions + ) +} diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 290c951b8c601..da246c37428c1 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -2359,6 +2359,7 @@ export async function compile(task, opts) { 'ncc_next__react_dev_overlay', 'ncc_next_font', 'capsize_metrics', + 'minimal_next_server', ]) } @@ -2615,3 +2616,140 @@ export async function server_wasm(task, opts) { export async function release(task) { await task.clear('dist').start('build') } + +export async function minimal_next_server(task) { + const outputName = 'next-server.js' + const cachedOutputName = `${outputName}.cache` + + const minimalExternals = [ + 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', + 'react', + 'react/package.json', + 'react/jsx-runtime', + 'react/jsx-dev-runtime', + 'react-dom', + 'react-dom/package.json', + 'react-dom/client', + 'react-dom/server', + 'react-dom/server.browser', + 'react-dom/server.edge', + 'react-server-dom-webpack/client', + 'react-server-dom-webpack/client.edge', + 'react-server-dom-webpack/server.edge', + 'react-server-dom-webpack/server.node', + 'styled-jsx', + 'styled-jsx/style', + '@opentelemetry/api', + 'next/dist/compiled/@ampproject/toolbox-optimizer', + 'next/dist/compiled/edge-runtime', + 'next/dist/compiled/@edge-runtime/ponyfill', + 'next/dist/compiled/undici', + 'next/dist/compiled/raw-body', + 'next/dist/server/capsize-font-metrics.json', + 'critters', + 'next/dist/compiled/node-html-parser', + 'next/dist/compiled/compression', + 'next/dist/compiled/jsonwebtoken', + ].reduce((acc, pkg) => { + acc[pkg] = pkg + return acc + }, {}) + + Object.assign(minimalExternals, { + '/(.*)config$/': 'next/dist/server/config', + './web/sandbox': 'next/dist/server/web/sandbox', + }) + + const webpack = require('webpack') + + /** @type {webpack.Configuration} */ + const config = { + entry: join(__dirname, 'dist/server/next-server.js'), + target: 'node', + mode: 'production', + output: { + path: join(__dirname, 'dist/compiled/minimal-next-server'), + filename: outputName, + libraryTarget: 'commonjs2', + }, + // left in for debugging + optimization: { + // moduleIds: 'named', + // minimize: false, + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production'), + 'process.env.NEXT_MINIMAL': JSON.stringify('true'), + 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), + }), + ], + externals: [minimalExternals], + } + + await new Promise((resolve, reject) => { + webpack(config, (err, stats) => { + if (err) return reject(err) + if (stats.hasErrors()) { + return reject(new Error(stats.toString('errors-only'))) + } + resolve() + }) + }) + + const wrappedTemplate = ` +const filename = ${JSON.stringify(outputName)} +const { readFileSync } = require('fs'), + { Script } = require('vm'), + { wrap } = require('module'), + { join } = require('path'); +const basename = join(__dirname, filename) + +const source = readFileSync(basename, 'utf-8') + +const cachedData = + !process.pkg && + require('process').platform !== 'win32' && + readFileSync(join(__dirname, '${cachedOutputName}')) + +const scriptOpts = { filename: basename, columnOffset: 0 } + +const script = new Script( + wrap(source), + cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts +) + +script.runInThisContext()(exports, require, module, __filename, __dirname) +` + + await fs.writeFile( + join(__dirname, `dist/compiled/minimal-next-server/next-server-cached.js`), + wrappedTemplate + ) + + const Module = require('module') + const vm = require('vm') + const filename = resolve( + __dirname, + 'dist/compiled/minimal-next-server', + outputName + ) + + const content = require('fs').readFileSync(filename, 'utf8') + + const wrapper = Module.wrap(content) + var script = new vm.Script(wrapper, { + filename: filename, + lineOffset: 0, + displayErrors: true, + }) + + script.runInThisContext()(exports, require, module, __filename, __dirname) + + const buffer = script.createCachedData() + + await fs.writeFile( + join(__dirname, `dist/compiled/minimal-next-server/${cachedOutputName}`), + buffer + ) +} diff --git a/scripts/minimal-server.js b/scripts/minimal-server.js new file mode 100644 index 0000000000000..88e6d5c1a7ebe --- /dev/null +++ b/scripts/minimal-server.js @@ -0,0 +1,107 @@ +// Usage: node scripts/minimal-server.js +// This script is used to run a minimal Next.js server in production mode. + +process.env.NODE_ENV = 'production' + +// Change this to 'experimental' for server actions +process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = 'next' + +if (process.env.LOG_REQUIRE) { + const originalRequire = require('module').prototype.require + + require('module').prototype.require = function (path) { + const start = performance.now() + const result = originalRequire.apply(this, arguments) + const end = performance.now() + console.log(`${path}, ${end - start}`) + + return result + } +} + +if (process.env.LOG_COMPILE) { + const originalCompile = require('module').prototype._compile + + require('module').prototype._compile = function (content, filename) { + console.time(`Module '${filename}' compiled`) + const result = originalCompile.apply(this, arguments) + console.timeEnd(`Module '${filename}' compiled`) + return result + } +} + +const appDir = process.argv[2] +const absoluteAppDir = require('path').resolve(appDir) +process.chdir(absoluteAppDir) + +let readFileCount = 0 +let readFileSyncCount = 0 + +if (process.env.LOG_READFILE) { + const originalReadFile = require('fs').readFile + const originalReadFileSync = require('fs').readFileSync + + require('fs').readFile = function (path, options, callback) { + readFileCount++ + return originalReadFile.apply(this, arguments) + } + + require('fs').readFileSync = function (path, options) { + readFileSyncCount++ + return originalReadFileSync.apply(this, arguments) + } +} + +console.time('next-cold-start') + +const NextServer = process.env.USE_BUNDLED_NEXT + ? require('next/dist/compiled/minimal-next-server/next-server-cached').default + : require('next/dist/server/next-server').default + +console.timeEnd('next-cold-start') +if (process.env.LOG_READFILE) { + console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) +} + +const path = require('path') + +const distDir = '.next' + +const compiledConfig = require(path.join( + absoluteAppDir, + distDir, + 'required-server-files.json' +)).config + +const nextServer = new NextServer({ + conf: compiledConfig, + dir: '.', + distDir: distDir, + minimalMode: true, + customServer: false, +}) + +const requestHandler = nextServer.getRequestHandler() + +require('http') + .createServer((req, res) => { + console.time('next-request') + readFileCount = 0 + readFileSyncCount = 0 + + return requestHandler(req, res) + .catch((err) => { + console.error(err) + res.statusCode = 500 + res.end('Internal Server Error') + }) + .finally(() => { + console.timeEnd('next-request') + if (process.env.LOG_READFILE) { + console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) + } + }) + }) + .listen(3000, () => { + console.timeEnd('next-cold-start') + }) From afb3a5feb4ebb6ff706d7aede134754bb7c4eef4 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 4 Jul 2023 18:22:32 +0200 Subject: [PATCH 002/101] fix erroneous manifest manipulation --- packages/next/src/server/next-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 653e40a83d1b9..2c5792d1c5c69 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -2759,7 +2759,7 @@ export default class NextNodeServer extends BaseServer { const manifest = loadManifest(join(this.distDir, PRERENDER_MANIFEST)) - return (this._cachedPreviewManifest = JSON.parse(manifest)) + return (this._cachedPreviewManifest = manifest) } protected getRoutesManifest() { From 0e178ae6568a59a73992f88c6289fb72cf2919a3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 5 Jul 2023 00:35:56 +0200 Subject: [PATCH 003/101] revert lazy polyfill --- .../next/src/server/node-polyfill-form.ts | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/next/src/server/node-polyfill-form.ts b/packages/next/src/server/node-polyfill-form.ts index e5b5abc5ae4bd..9a174305abf41 100644 --- a/packages/next/src/server/node-polyfill-form.ts +++ b/packages/next/src/server/node-polyfill-form.ts @@ -2,22 +2,12 @@ * Polyfills `FormData` and `Blob` in the Node.js runtime. */ -if (!(global as any).FormData) { - Object.defineProperty(global, 'FormData', { - get() { - const { FormData } = - require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill') - return FormData - }, - }) +if (!global.FormData) { + const { FormData } = require('next/dist/compiled/@edge-runtime/ponyfill') + global.FormData = FormData } -if (!(global as any).Blob) { - Object.defineProperty(global, 'Blob', { - get() { - const { Blob } = - require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill') - return Blob - }, - }) +if (!global.Blob) { + const { Blob } = require('next/dist/compiled/@edge-runtime/ponyfill') + global.Blob = Blob } From 38a5a23e505c41a8e11351fd646d7940339b2afd Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 5 Jul 2023 00:48:58 +0200 Subject: [PATCH 004/101] clean up require cache --- .../webpack/plugins/nextjs-require-cache-hot-reloader.ts | 5 +++++ packages/next/src/server/load-manifest.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/packages/next/src/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts b/packages/next/src/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts index 301adda25ecb0..e59ab16f5039c 100644 --- a/packages/next/src/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts +++ b/packages/next/src/build/webpack/plugins/nextjs-require-cache-hot-reloader.ts @@ -3,6 +3,7 @@ import { clearModuleContext } from '../../../server/web/sandbox' import { realpathSync } from '../../../lib/realpath' import path from 'path' import isError from '../../../lib/is-error' +import { clearManifestCache } from '../../../server/load-manifest' type Compiler = webpack.Compiler type WebpackPluginInstance = webpack.WebpackPluginInstance @@ -43,6 +44,10 @@ export function deleteCache(filePath: string) { if ((global as any)._nextDeleteCache) { ;(global as any)._nextDeleteCache(filePath) } + + // try to clear it from the fs cache + clearManifestCache(filePath) + try { filePath = realpathSync(filePath) } catch (e) { diff --git a/packages/next/src/server/load-manifest.ts b/packages/next/src/server/load-manifest.ts index d241eb527ab6e..af732453a8168 100644 --- a/packages/next/src/server/load-manifest.ts +++ b/packages/next/src/server/load-manifest.ts @@ -17,3 +17,7 @@ export function loadManifest(path: string, shouldCache: boolean = true) { return manifest } + +export function clearManifestCache(path: string): boolean { + return cache.delete(path) +} From 623fd8d9be24bd38ddb272fc85ae9373e903c620 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 5 Jul 2023 01:04:39 +0200 Subject: [PATCH 005/101] fix ci --- packages/next/taskfile.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index da246c37428c1..efec70d8d1e5c 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -2661,6 +2661,7 @@ export async function minimal_next_server(task) { }) const webpack = require('webpack') + const TerserPlugin = require('terser-webpack-plugin') /** @type {webpack.Configuration} */ const config = { @@ -2676,6 +2677,20 @@ export async function minimal_next_server(task) { optimization: { // moduleIds: 'named', // minimize: false, + minimize: true, + minimizer: [ + new TerserPlugin({ + extractComments: false, + terserOptions: { + format: { + comments: false, + }, + compress: { + passes: 2, + }, + }, + }), + ], }, plugins: [ new webpack.DefinePlugin({ From d06c4f8a96afcba999d07109ad5f3d88de96f141 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 12:34:11 +0200 Subject: [PATCH 006/101] misc --- packages/next/src/build/index.ts | 6 ++++++ .../compiled/node-html-parser/index.js.cache | Bin 0 -> 13504 bytes .../compiled/node-html-parser/index.js.cache.js | 2 ++ packages/next/src/server/require-hook.ts | 8 ++++---- packages/next/src/server/require.ts | 7 ++++--- packages/next/taskfile.js | 15 +++++++++++---- scripts/minimal-server.js | 8 +++++--- 7 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 packages/next/src/compiled/node-html-parser/index.js.cache create mode 100644 packages/next/src/compiled/node-html-parser/index.js.cache.js diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index addcbb4df54e7..7a2b430360104 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -1961,6 +1961,12 @@ export default async function build( 'next/dist/server/lib/render-server-standalone' ) : null, + require.resolve( + 'next/dist/compiled/minimal-next-server/next-server-cached.js' + ), + require.resolve( + 'next/dist/compiled/minimal-next-server/next-server.js' + ), ].filter(nonNullable) // ensure we trace any dependencies needed for custom diff --git a/packages/next/src/compiled/node-html-parser/index.js.cache b/packages/next/src/compiled/node-html-parser/index.js.cache new file mode 100644 index 0000000000000000000000000000000000000000..246a152327487dda6b28167400575ec302cd3aed GIT binary patch literal 13504 zcmZ`=30zdy)qn5aCvzX5;=ZPXMvR)&urG;e$7sLCCTY#q^w;KVa3NLW5=~9oFKq_I zg-u{sTmexL5L7?~1(5+n1x0055KvGciYpNV8kg^!`(~a)2JX+{{qH^Jp7X!wu5WRS zbfwT~^wx8lABj*lGvjZN%a*V*}_k>e~)7kG00Aekv#t%g?x`9 zn}MBC`=|NQfB z{pNo)Z^4(Juku^Ddhsg1&p+o{+)35*-|~#*b&f9{ie^Dw|vF&e=l3H`s?2a z+#)w;`ZL=X0fC=_q9ilIa3O37AD%yorhtufuG-WS08sT zLGX2i%m(;@M(g~605Hw@3)Eh{PDDSLFlhGE1qW~@DD?y(T5_Hz3ZlSJ!9n5VKU;AY z+1r(yn>V_O1;tz7LY!+@@&~|J^C-DQYy@4pO|r&T(4E#?lm`=CyL{IkF3;_E3?3}% zG6t`AfJ>~yhG9?`Gc0T*T(*u37z3B^F*nBzraD1L^9N&)#NmboLlh`vv&}NtPLXTz zA~^0dm7~s36TWSG!w!Vc?e5rfodaea2g7_j6FxmCVK5h_DFq_PaEM~MK6sr2mnHHn z_iwhHF(h^<$o33fKdiTH3;!9z<3@mR--ytW{p#e6GK>b{&e8s3xQ>Yi_cdB^D>RH* zKNf_i$EJ;gOWwE}c!4Hk&)s%cdQRyE=(#8u29$?i=O79Lz=ZwyzI)Ew)7uAn?h*9b zTO%R5uNfBM3=rXWbbQNr@R9zj2frF5=(cNbYT>fmF@1uKs4Jeh*J+TbD{wkIbr8|D zP2Kh?Rg$Va7cObFHqsIf=m1H^I^Jku&i5j+ZU&ze8*ga?eAHbyGXi?8BYj`*C{a!K% zlJ5{DNJ^8fg7gNMv1h-G5{_2C=^k#-!-DTJh*0&b5G9Klx#iQ`Pq902b-{$)v4{!w z7(t~P_e5Y3MHQR@e}b#x2N&z!YZnYZXYkYlUY@?LSWA2{GC?E=(&(spmgYWyvOd>A zFa^7vuN~BChG`{!X800yaVm0ZO{moES~4sii!S#{-Wh*z&MYL3C_ubaNcim*5H zgd=C}5@n1kT_*@Jz1PkULD7ErFUP2|!FsxTxg`S@N8}L5fu+S0IkwxR``>;Rj z3csoO1};h89{m0J*xR$g7_5W;!_5kU@xLkG+rr}g{b4;^&gifBi?CjF`-_LyAShoW zhOI@Av{pQ{P6U;*b>gA*2+pq;6M{sX=9rLR*HRNf?v4|*oGB|oEu?RP?(VL*h|dLb z)7}MR-iAfEAm9mPW3YH81l>f2i8sPTm@nHlipk-~=~B3OF+vOv#M3kC#@1~GM$ zI7)(Ug-wSioD=4~{cM={LzswxRb~as%%>n@gjgHFWsU?ZTFQfS{ z!9;)!kEfqEi+i@ByGvWe-SOP7km|4WNX&aChrGI#!!R(=&neE^+0z3Y9t3A&Vcg?c z0DA<-vwwnEvqOZvscDC}K2e0-DI-w~*@-=Ja+lb&3l5UH_}ya0ZUg~I;^rg-(DzUm z6GqlvfkN^QF?$CWD|-wMBk6mEv_ip(bOcmg*LRd$-Cc1zodSe&7J(yY!{XneL-@s~ zifhv_ICW`aV>*tf`{`oTJ}lX_Pt50_a-X6gTcC* zBi=Z|+x}{E;)qW^`NXu#@}W}aqy#}}l2s5kgZqtr2f^Fb3r}$+5CH8zc@UPssNpG~ zN-U_xwqLv`rd|@^j8l6_+F{G8-Fvh3@N~f;_G=*N@huPqWBH#d#uO1ZX1RhK0%NA}`b%S8 z9&UKoF$)aE1uDi$Rx8F7k(IF=FxKbB?e6J<8+RI*`4R@3__1N-I?%;c;o1h07EGw9 zYYislAq3_?Z3uZ5LSPQ$hmz-^1fmoaM&iQ|oC+gXHsbwGb_985Ah2X+M3d|o6g9?> zr<)LjY$5yN5R}A`rZ`l-A4l%QV@W^)$xOhKQwgMl13|cv2E!0|ST1VMHjt2D)Pr(N zmeVUQgp`F4oPD-BE`u14en$z5(oCxkI|6zUeUB_3Hy>Pt{tZDH7^OHGgjOLX?;>rx zI0?%0yfdQ|M@luT_?LlVKZ}p6yBE&map0sQ0US*-_)P(A?17s}cwtb{~AGRQV zKZ!qp+C>LQR0e{h8KgP`MNcwFWEL;UB83OhXWKzy$VO3aHo1_4;BgL#Jc2sMj*!Dg z5i}ho4>;JHOWJd>R&*Y@m50iPVwY*-+AD~L>ef|~tCa+9 zA0Ahd<|+iws>tpd1Q%*Zdp*$%&~3a-9$dzfs0MPcnU}PX{Di^6wE?mEcy+HZ5(JKd^>2j5jP8 z4p;2`^93Zikk}DjP9e!ECU}F%59PQYq7J5=Mv`sBC>xC=v=9L=?lmu}i^$C)>>Jb3 z&~iR?6%+pwDf!W7s!@`$LIOGC3egSDezd)iZuv%gT$*kboj-X@7 zHL;RZSE`cUvh7u*vZ^21v1+ouhKB|%LOn;r7jVDB)0$e6TZ^)_7fJC&^ndUYd3FiG zy*jd?9zje!Nv${8w&as}nOwhY=@Sl0lTCIHHIU9moUoZqq@)S0R5p>8Ce$vwLh_mk zf!=fkE-(WkM=3Kv8O~NSpao3Y$Mn5OxxwKIX24k({UeIOnzLaEoMCvXxK9ptqQAOM za=9A^+MRAv|CEDg7r9Sz)oo{BcmDfD`u=5JAvcCz9Zz}?TO3y|AEuSGhocy@a4zg6eBQ51TuDT;P-a4?#ljK-4S7`h_{L2C^CnS-KOS|5ugoG#e5 zIPxWg)BWLG_F_+p`J1URoSIc*UIlJJeK*F-#TmQ10~#{E3LMQfEL#K(8Gw!1Oz&-> zaEBbQm3C}J;J=LqZ%43eJ3SIdVI3)tqdfpbU06IVO27e7n?M71V1u)E(6B@d!SO_z zyc0*l^_}$OE-VS(P4DkUfVXe_Fm7Ia9&V;vw_wkeZJ~EL5FCL@FP#Hh>4~kVQ@xem z z+>*HYxWNwP`#T^dv?#>hRO||CbLswEjM(iw8hQ+!<{zUw^O456d>UVXq7w!5p%KB( zLfTP;0Pc`O{J8~Oeipr@5L4V(5&K*J#JpX7@T4#ZNHw$pF<2+xHxnzNc_rwpy@dLo zM38opUORMt7g#wa(B(XA!{cP>H6hw+ZOhis%9$ zy1wr*=jrL?4n%JP$*>Mi^dB(e1w3b_mea~|^pty^wq2lbCh56A!z++hQUy(^rj+Ok zs%dB~iUeUw2-Lx3xf~T=psg1;TN{5av$(Y`s-kzRQ1-NnCRcMMafzwE9V$brucjfj zT;#~}*emZWQhG(9Zq?YO(AW)qH`d418`tJ-(9m~o15qF|f|~_LwRFuzbaeG1O|Rn~ z1$2oHC4=Hnscz-)8*tdqQQOnm4cE^DcW;Np4Sl&px zoA@qyg>JlxqNJ-dxf$b~+f4IXa7Arvp{3Upb}&?7v+A`Too}YOEoi~~1O~|K{%(pE zr(#9^-@v7xEfkuIlj{p0zNiZvS!|*8*J)TQ63c3(9UR2A(b6_75rjk~YQl@C@l)h4 z9`~&S#{qqJlZOxAb-n?oKM;8HH`}m$F}4(bb$2wKci{Dwu;H$z?k<8`cQwcFA!xj( zDf|(^r5`mx4>UG{u;YQ|FbCxiH1{|N?9y!dSp#pWc0AFXTElEbAtI0!2QnM54HL&< z8r%U+OG}LePfEfeGTMY6KGa12gm#7D6a7tPc)=m!{h1PFg?g_j;|slDu;1TJg@=ca zCxrPSwDddJxGiT-`Fhs2p20vcc|%WMnQ!8GHSWoB6;A+9{Y2H>#S8odgOB|h@B@!p z{%o>ax`B0WKtEN%>}D{7lg056Ruh6?S18L3MeuVdiwZ-~9LBmiDA~vwHeyM7I4cfE z5FNqNA`svM9k7jjlRh>@hP&?-8GK)m2z>jStv(*Oh8_d5Ck6uHcMM;BXCnMKg6)n( z!aqf_R0D!y1M4y{7=LS{*uf|)ITgiPICv1nqN1^6S2R1!!I^0GQw){_#j@5|7zVnY zSeCj8OY%0cj!kIi@g}x$3xfD9EPpEkm~c}Z6FCEH*p}_4Re{sAYFHXH%<84u0I2OZ z-Ngqdgl`2jYR6D$n4@wwB~Ta~$3hYr+(sTrWX*|4sAMNwyN78cogl1%h+5pPCC9O6 z@eCG)@B|i|$ojlpdlbhu#v}R7@$5PW-~^K8C`;eLigxf`b5vv&w-tAGva($a_V7Eq z*tXrM)UccV$bm75-B04x;9P_O=^@ISA*Fd%0m+4c^z(q)&D9-ydOrl?Uw?;yd}dg_ z9H?mE*S?4SuonZeF^$!xGq|sQmd=jtM@sGcS;PSh(e+H0kcHsJAy$%&I`^~L)NW z-%4Tad;1RX#bnlzi~;USW`!xrFaa~Y0vxoLCG52fu*F03y=g2v9l2vANR}OAJj_C~ zxlH<)%XEfiey9V#pd8kfgOuWru%e@=)OM65cCg6w=& z$wBOKcHlTtdVHL1EmclHn*4#Ad_bip{`=LZ-Tq zrI)ag@WQQx?Kz3gDo(PbQ?Rt^Do?Rvr*W1&Kg~{;qJf%H)>Dc)*UMPw87z5xhHX2G zAh4XBD`#-Gns<)XpTm;&b8OprRQA8Xc3i-chzb^6!zj@;*RbM?SQ2!JRbRqd&6n8Y zI#fPW&x#r_3bz|r$yG*(E~J?yHKX#6&8+1b>ZDv}we5^jUD^-q_)V;S=O)YSKv7c% zOT2}k<`&Di%S-OE@Ja&{Uvr8-SspN=3QT|S&HgB4-q6mf(MkLEw&!&|9fIRVz@ z%3a4~LUe-C0$gPZU6o~5Su?CwnNu(v?N^F@Z-HL!{9v&j)|m2nu+G5O4EEp^=TpaV zIq!r_ZFF#!gREfr%;xcN`G^q-*Ba%=g)$72+#jKTx zuN9h#ODmclq>pzr9tgUB2_!8Z&qkHV(WNphhJ~f_%~JH%P$m~w%NkjC zw^}}QQSl!XWVwiCl*k)S$*_oRJ|#z$%6;w_; zoW@1mn&s(fE?Db(=y-d2xIwSDfSr42%i@vC<$C#cJ!fqiI^f4${jLG4S+V}GUq5c{ zKJMV>Dfqaxthb+*%W_=yPu3oRk55;EAB!`{(MGwY z5xcCaN#5Qp!$awUX8FW5nV&%%m8ro`^w6%1E3)wl>egM6Z*s8ps=W6qmR!9m_izx< zEN^SZ5`iRIt|n0}a&`;Gt*S+C;h>{M4!njXnb+iE4g|X!yx;bzcjEY^omD&k4DIaa zY~khNf@cdqXk_fy(9lVSf8hMWl+r5awxYY>HaWfxL35k@kb~fMIjfzwt6dKGfs+>! zc_sLR1Ic@ZX?}C_R)iJ+p?)3^!aGMG;JX{hyawMYSS~`fH{^u7GQ25(NTD;!Tdtm4 za?x$%SaVyhxr5-=9Xb9k0^zN>3aOeGuQhoa;g-vCbT0-{Yn0*r%cY7^$VI$`=5G}7;JzG;@fUo*H09#$fe(w~z|7hX#gzR^iYY~8Woku#rd(b4 zhYL|)Cgq-DN;g3*f}7E%@ICIjfU?%-x7WC5Ht#Y(j@bXSP62|moHlg7s2-(_+s_H@S6jj zVvZx;8vYaPAe-}9_ivyHlfIzYFNzND&d0iT@DsNLzfSB2e`ec*yOkg;VDJZjN*X1d z(1VieV^J8C%8SG)AM(n@D`%RO)ax8ygfG6cbpl?PzK3fJd}X@@h7DMQpHdEua-N3@ z3=4oXj9rM$$^pJuXbV68+5gL1H69Cwz~{iAAnp}4N%OH_5&p4AfzYB^zF6=kL{veY z6U-=coEiNEBB)5m5;MA?>cxyTm;H8(8NH>}eGgbDb)ANpQ2@LGP|Ci6kC+tnsiPU) zgJ(fX*-Cg@q#&E2W|T3>j8fIQt*~P&daKlStW&MDjWkOOR94@@;{&Be%S1E!>tHil z;%G)g)wa!4{laS-Q(c`}Hb^aNRQ*m>QTt?bjRL`pGU3FdFzA5JQqT%j%2a#j)Ho-r zZTnJXdR}eOYBd@!tI?eWcW#R1xiCZ(G)wITa3)AIq`A^sDNZ^p)krs_9?3_PJ`g28 zQ3@8Ncu~q0rE{XxB1)a2BogT*BDoOheIgl%w1-H!M5-jxBO(o?(gZ4bP-za87E|fJ zREnk2UMdw)sg_DNsq_>SBx$iE1xV5!Ny?U_GD&KZq(_o8aDe1AK=K$M{ceEt$pFc3 zfavhS{C1jg4;loYt}k4?YWX~VyM=slhUU$jwoC;4Iu<~}vZ$`%P6Y70`MijiUD;@F z1KlhvTd{EUQn+73y;VE^YlFA5e*gMv#j1aP&1d)0cmIu*O5rC?p~A>XBSt&bP;KOw z+S0eRUGHjRKG9a#X;UX?!~Uc_I#FBUtWEUN-WaE?8>hX0Skxx{O?6G>5GUz7Sapkp zfq`~LJrzm8n4a#18nK%S1K%8I)JudEn6jM{jQRmo&1Q}>>TM)7`xnWm*9=gzV~J7E zY}D)xs4HvKY|L1r-j=D^-;Ocr?PN9k7Ff2oRkQC6G3p1}sadCCM*SdrH5;Hc>IV;0 zv){-@y~7|i`>CT*KV-0)y*I+BAL^iHSH5J_4;!LpZH5~4!-uNbj7diQh+%3r6)cY& zu4Y>Y81^g8XW|W$38)?*!9j#^ypn>DYsM&9AjQa6o)ojZ|qyD9F zYWA;#jrw1WSF=l?McS9t>`;iLA$ZvYO4bH|nRpqGmhB8}-wsn6d*`81=7CRb>pk zzBWzGo`aF`>sQrmGQ@HEYijmOX#DHHR}u!|m)F(o%P-r#mU~?SU^T9S3Y4I!Y><;3X9f^Y-qhu01|B zkQW9{9Z@*1r<7Hp`C&Fr=wGBce6_>#gQWof8JJOBUy literal 0 HcmV?d00001 diff --git a/packages/next/src/compiled/node-html-parser/index.js.cache.js b/packages/next/src/compiled/node-html-parser/index.js.cache.js new file mode 100644 index 0000000000000..6f6fc8aa90a63 --- /dev/null +++ b/packages/next/src/compiled/node-html-parser/index.js.cache.js @@ -0,0 +1,2 @@ +(function(){var e={2947:function(e){e.exports={trueFunc:function trueFunc(){return true},falseFunc:function falseFunc(){return false}}},3387:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeRules=void 0;var a=t(2947);var n=/[-[\]{}()*+?.,\\^$|#\s]/g;function escapeRegex(e){return e.replace(n,"\\$&")}var i=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function shouldIgnoreCase(e,r){return typeof e.ignoreCase==="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!r.quirksMode:!r.xmlMode&&i.has(e.name)}r.attributeRules={equals:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return t!=null&&t.length===i.length&&t.toLowerCase()===i&&e(r)}}return function(r){return a.getAttributeValue(r,n)===i&&e(r)}},hyphen:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;var o=i.length;if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function hyphenIC(r){var t=a.getAttributeValue(r,n);return t!=null&&(t.length===o||t.charAt(o)==="-")&&t.substr(0,o).toLowerCase()===i&&e(r)}}return function hyphen(r){var t=a.getAttributeValue(r,n);return t!=null&&(t.length===o||t.charAt(o)==="-")&&t.substr(0,o)===i&&e(r)}},element:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(/\s/.test(o)){return a.falseFunc}var s=new RegExp("(?:^|\\s)".concat(escapeRegex(o),"(?:$|\\s)"),shouldIgnoreCase(r,t)?"i":"");return function element(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}},exists:function(e,r,t){var a=r.name;var n=t.adapter;return function(r){return n.hasAttrib(r,a)&&e(r)}},start:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=s&&t.substr(0,s).toLowerCase()===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.startsWith(o))&&e(r)}},end:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=-o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t;return((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.substr(s).toLowerCase())===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.endsWith(o))&&e(r)}},any:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(o===""){return a.falseFunc}if(shouldIgnoreCase(r,t)){var s=new RegExp(escapeRegex(o),"i");return function anyIC(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.includes(o))&&e(r)}},not:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(i===""){return function(r){return!!a.getAttributeValue(r,n)&&e(r)}}else if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return(t==null||t.length!==i.length||t.toLowerCase()!==i)&&e(r)}}return function(r){return a.getAttributeValue(r,n)!==i&&e(r)}}}},8689:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.compileToken=r.compileUnsafe=r.compile=void 0;var n=t(8065);var i=t(2947);var o=a(t(4901));var s=t(538);var u=t(7088);var l=t(4428);function compile(e,r,t){var a=compileUnsafe(e,r,t);return(0,l.ensureIsTag)(a,r.adapter)}r.compile=compile;function compileUnsafe(e,r,t){var a=typeof e==="string"?(0,n.parse)(e):e;return compileToken(a,r,t)}r.compileUnsafe=compileUnsafe;function includesScopePseudo(e){return e.type==="pseudo"&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some((function(e){return e.some(includesScopePseudo)})))}var c={type:n.SelectorType.Descendant};var p={type:"_flexibleDescendant"};var d={type:n.SelectorType.Pseudo,name:"scope",data:null};function absolutize(e,r,t){var a=r.adapter;var n=!!(t===null||t===void 0?void 0:t.every((function(e){var r=a.isTag(e)&&a.getParent(e);return e===l.PLACEHOLDER_ELEMENT||r&&a.isTag(r)})));for(var i=0,o=e;i0&&(0,s.isTraversal)(u[0])&&u[0].type!=="descendant"){}else if(n&&!u.some(includesScopePseudo)){u.unshift(c)}else{continue}u.unshift(d)}}function compileToken(e,r,t){var a;e=e.filter((function(e){return e.length>0}));e.forEach(o.default);t=(a=r.context)!==null&&a!==void 0?a:t;var n=Array.isArray(t);var s=t&&(Array.isArray(t)?t:[t]);absolutize(e,r,s);var u=false;var l=e.map((function(e){if(e.length>=2){var t=e[0],a=e[1];if(t.type!=="pseudo"||t.name!=="scope"){}else if(n&&a.type==="descendant"){e[1]=p}else if(a.type==="adjacent"||a.type==="sibling"){u=true}}return compileRules(e,r,s)})).reduce(reduceRules,i.falseFunc);l.shouldTestNextSiblings=u;return l}r.compileToken=compileToken;function compileRules(e,r,t){var a;return e.reduce((function(e,a){return e===i.falseFunc?i.falseFunc:(0,u.compileGeneralSelector)(e,a,r,t,compileToken)}),(a=r.rootFunc)!==null&&a!==void 0?a:i.trueFunc)}function reduceRules(e,r){if(r===i.falseFunc||e===i.trueFunc){return e}if(e===i.falseFunc||r===i.trueFunc){return r}return function combine(t){return e(t)||r(t)}}},7088:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compileGeneralSelector=void 0;var a=t(3387);var n=t(6463);var i=t(8065);function compileGeneralSelector(e,r,t,o,s){var u=t.adapter,l=t.equals;switch(r.type){case i.SelectorType.PseudoElement:{throw new Error("Pseudo-elements are not supported by css-select")}case i.SelectorType.ColumnCombinator:{throw new Error("Column combinators are not yet supported by css-select")}case i.SelectorType.Attribute:{if(r.namespace!=null){throw new Error("Namespaced attributes are not yet supported by css-select")}if(!t.xmlMode||t.lowerCaseAttributeNames){r.name=r.name.toLowerCase()}return a.attributeRules[r.action](e,r,t)}case i.SelectorType.Pseudo:{return(0,n.compilePseudoSelector)(e,r,t,o,s)}case i.SelectorType.Tag:{if(r.namespace!=null){throw new Error("Namespaced tag names are not yet supported by css-select")}var c=r.name;if(!t.xmlMode||t.lowerCaseTags){c=c.toLowerCase()}return function tag(r){return u.getName(r)===c&&e(r)}}case i.SelectorType.Descendant:{if(t.cacheResults===false||typeof WeakSet==="undefined"){return function descendant(r){var t=r;while(t=u.getParent(t)){if(u.isTag(t)&&e(t)){return true}}return false}}var p=new WeakSet;return function cachedDescendant(r){var t=r;while(t=u.getParent(t)){if(!p.has(t)){if(u.isTag(t)&&e(t)){return true}p.add(t)}}return false}}case"_flexibleDescendant":{return function flexibleDescendant(r){var t=r;do{if(u.isTag(t)&&e(t))return true}while(t=u.getParent(t));return false}}case i.SelectorType.Parent:{return function parent(r){return u.getChildren(r).some((function(r){return u.isTag(r)&&e(r)}))}}case i.SelectorType.Child:{return function child(r){var t=u.getParent(r);return t!=null&&u.isTag(t)&&e(t)}}case i.SelectorType.Sibling:{return function sibling(r){var t=u.getSiblings(r);for(var a=0;a option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}},6804:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.filters=void 0;var n=a(t(7118));var i=t(2947);function getChildFunc(e,r){return function(t){var a=r.getParent(t);return a!=null&&r.isTag(a)&&e(t)}}r.filters={contains:function(e,r,t){var a=t.adapter;return function contains(t){return e(t)&&a.getText(t).includes(r)}},icontains:function(e,r,t){var a=t.adapter;var n=r.toLowerCase();return function icontains(r){return e(r)&&a.getText(r).toLowerCase().includes(n)}},"nth-child":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthChild(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){if(o(r,t[i]))break;if(a.isTag(t[i])){n++}}return s(n)&&e(r)}},"nth-of-type":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthOfType(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){var u=t[i];if(o(r,u))break;if(a.isTag(u)&&a.getName(u)===a.getName(r)){n++}}return s(n)&&e(r)}},root:function(e,r,t){var a=t.adapter;return function(r){var t=a.getParent(r);return(t==null||!a.isTag(t))&&e(r)}},scope:function(e,t,a,n){var i=a.equals;if(!n||n.length===0){return r.filters.root(e,t,a)}if(n.length===1){return function(r){return i(n[0],r)&&e(r)}}return function(r){return n.includes(r)&&e(r)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(e){return function dynamicPseudo(r,t,a){var n=a.adapter;var o=n[e];if(typeof o!=="function"){return i.falseFunc}return function active(e){return o(e)&&r(e)}}}},6463:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compilePseudoSelector=r.aliases=r.pseudos=r.filters=void 0;var a=t(2947);var n=t(8065);var i=t(6804);Object.defineProperty(r,"filters",{enumerable:true,get:function(){return i.filters}});var o=t(6973);Object.defineProperty(r,"pseudos",{enumerable:true,get:function(){return o.pseudos}});var s=t(8680);Object.defineProperty(r,"aliases",{enumerable:true,get:function(){return s.aliases}});var u=t(4428);function compilePseudoSelector(e,r,t,l,c){var p=r.name,d=r.data;if(Array.isArray(d)){return u.subselects[p](e,d,t,l,c)}if(p in s.aliases){if(d!=null){throw new Error("Pseudo ".concat(p," doesn't have any arguments"))}var f=(0,n.parse)(s.aliases[p]);return u.subselects.is(e,f,t,l,c)}if(p in i.filters){return i.filters[p](e,d,t,l)}if(p in o.pseudos){var g=o.pseudos[p];(0,o.verifyPseudoArgs)(g,p,d);return g===a.falseFunc?a.falseFunc:e===a.trueFunc?function(e){return g(e,t,d)}:function(r){return g(r,t,d)&&e(r)}}throw new Error("unmatched pseudo-class :".concat(p))}r.compilePseudoSelector=compilePseudoSelector},6973:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.verifyPseudoArgs=r.pseudos=void 0;r.pseudos={empty:function(e,r){var t=r.adapter;return!t.getChildren(e).some((function(e){return t.isTag(e)||t.getText(e)!==""}))},"first-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e).find((function(e){return t.isTag(e)}));return n!=null&&a(e,n)},"last-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);for(var i=n.length-1;i>=0;i--){if(a(e,n[i]))return true;if(t.isTag(n[i]))break}return false},"first-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);var i=t.getName(e);for(var o=0;o=0;o--){var s=n[o];if(a(e,s))return true;if(t.isTag(s)&&t.getName(s)===i){break}}return false},"only-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getName(e);return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)||t.getName(r)!==n}))},"only-child":function(e,r){var t=r.adapter,a=r.equals;return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)}))}};function verifyPseudoArgs(e,r,t){if(t===null){if(e.length>2){throw new Error("pseudo-selector :".concat(r," requires an argument"))}}else if(e.length===2){throw new Error("pseudo-selector :".concat(r," doesn't have any arguments"))}}r.verifyPseudoArgs=verifyPseudoArgs},4428:function(e,r,t){"use strict";var a=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,i;a=0&&a>=1}}else if(e.type===a.SelectorType.Pseudo){if(!e.data){r=3}else if(e.name==="has"||e.name==="contains"){r=0}else if(Array.isArray(e.data)){r=0;for(var t=0;tr)r=o}if(e.data.length>1&&r>0)r-=1}else{r=1}}return r}},8065:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.stringify=r.parse=r.isTraversal=void 0;n(t(5615),r);var i=t(2422);Object.defineProperty(r,"isTraversal",{enumerable:true,get:function(){return i.isTraversal}});Object.defineProperty(r,"parse",{enumerable:true,get:function(){return i.parse}});var o=t(8279);Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return o.stringify}})},2422:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=r.isTraversal=void 0;var a=t(5615);var n=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;var i=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;var o=new Map([[126,a.AttributeAction.Element],[94,a.AttributeAction.Start],[36,a.AttributeAction.End],[42,a.AttributeAction.Any],[33,a.AttributeAction.Not],[124,a.AttributeAction.Hyphen]]);var s=new Set(["has","not","matches","is","where","host","host-context"]);function isTraversal(e){switch(e.type){case a.SelectorType.Adjacent:case a.SelectorType.Child:case a.SelectorType.Descendant:case a.SelectorType.Parent:case a.SelectorType.Sibling:case a.SelectorType.ColumnCombinator:return true;default:return false}}r.isTraversal=isTraversal;var u=new Set(["contains","icontains"]);function funescape(e,r,t){var a=parseInt(r,16)-65536;return a!==a||t?r:a<0?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,a&1023|56320)}function unescapeCSS(e){return e.replace(i,funescape)}function isQuote(e){return e===39||e===34}function isWhitespace(e){return e===32||e===9||e===10||e===12||e===13}function parse(e){var r=[];var t=parseSelector(r,"".concat(e),0);if(t0&&t0&&isTraversal(i[i.length-1])){throw new Error("Did not expect successive traversals.")}}function addTraversal(e){if(i.length>0&&i[i.length-1].type===a.SelectorType.Descendant){i[i.length-1].type=e;return}ensureNotTraversal();i.push({type:e})}function addSpecialAttribute(e,r){i.push({type:a.SelectorType.Attribute,name:e,action:r,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(i.length&&i[i.length-1].type===a.SelectorType.Descendant){i.pop()}if(i.length===0){throw new Error("Empty sub-selector")}e.push(i)}stripWhitespace(0);if(r.length===t){return t}e:while(t ":" > ";case n.SelectorType.Parent:return r===0?"< ":" < ";case n.SelectorType.Sibling:return r===0?"~ ":" ~ ";case n.SelectorType.Adjacent:return r===0?"+ ":" + ";case n.SelectorType.Descendant:return" ";case n.SelectorType.ColumnCombinator:return r===0?"|| ":" || ";case n.SelectorType.Universal:return e.namespace==="*"&&r+10?a+e.slice(t):e}},5615:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AttributeAction=r.IgnoreCaseMode=r.SelectorType=void 0;var t;(function(e){e["Attribute"]="attribute";e["Pseudo"]="pseudo";e["PseudoElement"]="pseudo-element";e["Tag"]="tag";e["Universal"]="universal";e["Adjacent"]="adjacent";e["Child"]="child";e["Descendant"]="descendant";e["Parent"]="parent";e["Sibling"]="sibling";e["ColumnCombinator"]="column-combinator"})(t=r.SelectorType||(r.SelectorType={}));r.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:true,CaseSensitive:false};var a;(function(e){e["Any"]="any";e["Element"]="element";e["End"]="end";e["Equals"]="equals";e["Exists"]="exists";e["Hyphen"]="hyphen";e["Not"]="not";e["Start"]="start"})(a=r.AttributeAction||(r.AttributeAction={}))},7537:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeNames=r.elementNames=void 0;r.elementNames=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);r.attributeNames=new Map([["definitionurl","definitionURL"],["attributename","attributeName"],["attributetype","attributeType"],["basefrequency","baseFrequency"],["baseprofile","baseProfile"],["calcmode","calcMode"],["clippathunits","clipPathUnits"],["diffuseconstant","diffuseConstant"],["edgemode","edgeMode"],["filterunits","filterUnits"],["glyphref","glyphRef"],["gradienttransform","gradientTransform"],["gradientunits","gradientUnits"],["kernelmatrix","kernelMatrix"],["kernelunitlength","kernelUnitLength"],["keypoints","keyPoints"],["keysplines","keySplines"],["keytimes","keyTimes"],["lengthadjust","lengthAdjust"],["limitingconeangle","limitingConeAngle"],["markerheight","markerHeight"],["markerunits","markerUnits"],["markerwidth","markerWidth"],["maskcontentunits","maskContentUnits"],["maskunits","maskUnits"],["numoctaves","numOctaves"],["pathlength","pathLength"],["patterncontentunits","patternContentUnits"],["patterntransform","patternTransform"],["patternunits","patternUnits"],["pointsatx","pointsAtX"],["pointsaty","pointsAtY"],["pointsatz","pointsAtZ"],["preservealpha","preserveAlpha"],["preserveaspectratio","preserveAspectRatio"],["primitiveunits","primitiveUnits"],["refx","refX"],["refy","refY"],["repeatcount","repeatCount"],["repeatdur","repeatDur"],["requiredextensions","requiredExtensions"],["requiredfeatures","requiredFeatures"],["specularconstant","specularConstant"],["specularexponent","specularExponent"],["spreadmethod","spreadMethod"],["startoffset","startOffset"],["stddeviation","stdDeviation"],["stitchtiles","stitchTiles"],["surfacescale","surfaceScale"],["systemlanguage","systemLanguage"],["tablevalues","tableValues"],["targetx","targetX"],["targety","targetY"],["textlength","textLength"],["viewbox","viewBox"],["viewtarget","viewTarget"],["xchannelselector","xChannelSelector"],["ychannelselector","yChannelSelector"],["zoomandpan","zoomAndPan"]])},4614:function(e,r,t){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0){n+=render(e.children,r)}if(r.xmlMode||!p.has(e.name)){n+=""}}return n}function renderDirective(e){return"<"+e.data+">"}function renderText(e,r){var t=e.data||"";if(r.decodeEntities!==false&&!(!r.xmlMode&&e.parent&&c.has(e.parent.name))){t=u.encodeXML(t)}return t}function renderCdata(e){return""}function renderComment(e){return"\x3c!--"+e.data+"--\x3e"}},9391:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Doctype=r.CDATA=r.Tag=r.Style=r.Script=r.Comment=r.Directive=r.Text=r.Root=r.isTag=r.ElementType=void 0;var t;(function(e){e["Root"]="root";e["Text"]="text";e["Directive"]="directive";e["Comment"]="comment";e["Script"]="script";e["Style"]="style";e["Tag"]="tag";e["CDATA"]="cdata";e["Doctype"]="doctype"})(t=r.ElementType||(r.ElementType={}));function isTag(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}r.isTag=isTag;r.Root=t.Root;r.Text=t.Text;r.Directive=t.Directive;r.Comment=t.Comment;r.Script=t.Script;r.Style=t.Style;r.Tag=t.Tag;r.CDATA=t.CDATA;r.Doctype=t.Doctype},2472:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.DomHandler=void 0;var i=t(9391);var o=t(1508);n(t(1508),r);var s=/\s+/g;var u={normalizeWhitespace:false,withStartIndices:false,withEndIndices:false,xmlMode:false};var l=function(){function DomHandler(e,r,t){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof r==="function"){t=r;r=u}if(typeof e==="object"){r=e;e=undefined}this.callback=e!==null&&e!==void 0?e:null;this.options=r!==null&&r!==void 0?r:u;this.elementCB=t!==null&&t!==void 0?t:null}DomHandler.prototype.onparserinit=function(e){this.parser=e};DomHandler.prototype.onreset=function(){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null};DomHandler.prototype.onend=function(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)};DomHandler.prototype.onerror=function(e){this.handleCallback(e)};DomHandler.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(e)};DomHandler.prototype.onopentag=function(e,r){var t=this.options.xmlMode?i.ElementType.Tag:undefined;var a=new o.Element(e,r,undefined,t);this.addNode(a);this.tagStack.push(a)};DomHandler.prototype.ontext=function(e){var r=this.options.normalizeWhitespace;var t=this.lastNode;if(t&&t.type===i.ElementType.Text){if(r){t.data=(t.data+e).replace(s," ")}else{t.data+=e}if(this.options.withEndIndices){t.endIndex=this.parser.endIndex}}else{if(r){e=e.replace(s," ")}var a=new o.Text(e);this.addNode(a);this.lastNode=a}};DomHandler.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=e;return}var r=new o.Comment(e);this.addNode(r);this.lastNode=r};DomHandler.prototype.oncommentend=function(){this.lastNode=null};DomHandler.prototype.oncdatastart=function(){var e=new o.Text("");var r=new o.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(r);e.parent=r;this.lastNode=e};DomHandler.prototype.oncdataend=function(){this.lastNode=null};DomHandler.prototype.onprocessinginstruction=function(e,r){var t=new o.ProcessingInstruction(e,r);this.addNode(t)};DomHandler.prototype.handleCallback=function(e){if(typeof this.callback==="function"){this.callback(e,this.dom)}else if(e){throw e}};DomHandler.prototype.addNode=function(e){var r=this.tagStack[this.tagStack.length-1];var t=r.children[r.children.length-1];if(this.options.withStartIndices){e.startIndex=this.parser.startIndex}if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}r.children.push(e);if(t){e.prev=t;t.next=e}e.parent=r;this.lastNode=null};return DomHandler}();r.DomHandler=l;r["default"]=l},1508:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0?this.children[this.children.length-1]:null},enumerable:false,configurable:true});Object.defineProperty(NodeWithChildren.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:false,configurable:true});return NodeWithChildren}(s);r.NodeWithChildren=d;var f=function(e){a(Document,e);function Document(r){return e.call(this,i.ElementType.Root,r)||this}return Document}(d);r.Document=f;var g=function(e){a(Element,e);function Element(r,t,a,n){if(a===void 0){a=[]}if(n===void 0){n=r==="script"?i.ElementType.Script:r==="style"?i.ElementType.Style:i.ElementType.Tag}var o=e.call(this,n,a)||this;o.name=r;o.attribs=t;return o}Object.defineProperty(Element.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:false,configurable:true});Object.defineProperty(Element.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(r){var t,a;return{name:r,value:e.attribs[r],namespace:(t=e["x-attribsNamespace"])===null||t===void 0?void 0:t[r],prefix:(a=e["x-attribsPrefix"])===null||a===void 0?void 0:a[r]}}))},enumerable:false,configurable:true});return Element}(d);r.Element=g;function isTag(e){return(0,i.isTag)(e)}r.isTag=isTag;function isCDATA(e){return e.type===i.ElementType.CDATA}r.isCDATA=isCDATA;function isText(e){return e.type===i.ElementType.Text}r.isText=isText;function isComment(e){return e.type===i.ElementType.Comment}r.isComment=isComment;function isDirective(e){return e.type===i.ElementType.Directive}r.isDirective=isDirective;function isDocument(e){return e.type===i.ElementType.Root}r.isDocument=isDocument;function hasChildren(e){return Object.prototype.hasOwnProperty.call(e,"children")}r.hasChildren=hasChildren;function cloneNode(e,r){if(r===void 0){r=false}var t;if(isText(e)){t=new l(e.data)}else if(isComment(e)){t=new c(e.data)}else if(isTag(e)){var a=r?cloneChildren(e.children):[];var o=new g(e.name,n({},e.attribs),a);a.forEach((function(e){return e.parent=o}));if(e.namespace!=null){o.namespace=e.namespace}if(e["x-attribsNamespace"]){o["x-attribsNamespace"]=n({},e["x-attribsNamespace"])}if(e["x-attribsPrefix"]){o["x-attribsPrefix"]=n({},e["x-attribsPrefix"])}t=o}else if(isCDATA(e)){var a=r?cloneChildren(e.children):[];var s=new d(i.ElementType.CDATA,a);a.forEach((function(e){return e.parent=s}));t=s}else if(isDocument(e)){var a=r?cloneChildren(e.children):[];var u=new f(a);a.forEach((function(e){return e.parent=u}));if(e["x-mode"]){u["x-mode"]=e["x-mode"]}t=u}else if(isDirective(e)){var h=new p(e.name,e.data);if(e["x-name"]!=null){h["x-name"]=e["x-name"];h["x-publicId"]=e["x-publicId"];h["x-systemId"]=e["x-systemId"]}t=h}else{throw new Error("Not implemented yet: ".concat(e.type))}t.startIndex=e.startIndex;t.endIndex=e.endIndex;if(e.sourceCodeLocation!=null){t.sourceCodeLocation=e.sourceCodeLocation}return t}r.cloneNode=cloneNode;function cloneChildren(e){var r=e.map((function(e){return cloneNode(e,true)}));for(var t=1;t=0){var t=e[r];if(r>0&&e.lastIndexOf(t,r-1)>=0){e.splice(r,1);continue}for(var a=t.parent;a;a=a.parent){if(e.includes(a)){e.splice(r,1);break}}}return e}r.removeSubsets=removeSubsets;function compareDocumentPosition(e,r){var t=[];var n=[];if(e===r){return 0}var i=(0,a.hasChildren)(e)?e:e.parent;while(i){t.unshift(i);i=i.parent}i=(0,a.hasChildren)(r)?r:r.parent;while(i){n.unshift(i);i=i.parent}var o=Math.min(t.length,n.length);var s=0;while(sl.indexOf(p)){if(u===r){return 4|16}return 4}if(u===e){return 2|8}return 2}r.compareDocumentPosition=compareDocumentPosition;function uniqueSort(e){e=e.filter((function(e,r,t){return!t.includes(e,r+1)}));e.sort((function(e,r){var t=compareDocumentPosition(e,r);if(t&2){return-1}else if(t&4){return 1}return 0}));return e}r.uniqueSort=uniqueSort},5861:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;Object.defineProperty(e,a,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.hasChildren=r.isDocument=r.isComment=r.isText=r.isCDATA=r.isTag=void 0;n(t(3930),r);n(t(8298),r);n(t(1655),r);n(t(8929),r);n(t(7102),r);n(t(5509),r);n(t(3442),r);var i=t(2472);Object.defineProperty(r,"isTag",{enumerable:true,get:function(){return i.isTag}});Object.defineProperty(r,"isCDATA",{enumerable:true,get:function(){return i.isCDATA}});Object.defineProperty(r,"isText",{enumerable:true,get:function(){return i.isText}});Object.defineProperty(r,"isComment",{enumerable:true,get:function(){return i.isComment}});Object.defineProperty(r,"isDocument",{enumerable:true,get:function(){return i.isDocument}});Object.defineProperty(r,"hasChildren",{enumerable:true,get:function(){return i.hasChildren}})},7102:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getElementsByTagType=r.getElementsByTagName=r.getElementById=r.getElements=r.testElement=void 0;var a=t(2472);var n=t(8929);var i={tag_name:function(e){if(typeof e==="function"){return function(r){return(0,a.isTag)(r)&&e(r.name)}}else if(e==="*"){return a.isTag}return function(r){return(0,a.isTag)(r)&&r.name===e}},tag_type:function(e){if(typeof e==="function"){return function(r){return e(r.type)}}return function(r){return r.type===e}},tag_contains:function(e){if(typeof e==="function"){return function(r){return(0,a.isText)(r)&&e(r.data)}}return function(r){return(0,a.isText)(r)&&r.data===e}}};function getAttribCheck(e,r){if(typeof r==="function"){return function(t){return(0,a.isTag)(t)&&r(t.attribs[e])}}return function(t){return(0,a.isTag)(t)&&t.attribs[e]===r}}function combineFuncs(e,r){return function(t){return e(t)||r(t)}}function compileTest(e){var r=Object.keys(e).map((function(r){var t=e[r];return Object.prototype.hasOwnProperty.call(i,r)?i[r](t):getAttribCheck(r,t)}));return r.length===0?null:r.reduce(combineFuncs)}function testElement(e,r){var t=compileTest(e);return t?t(r):true}r.testElement=testElement;function getElements(e,r,t,a){if(a===void 0){a=Infinity}var i=compileTest(e);return i?(0,n.filter)(i,r,t,a):[]}r.getElements=getElements;function getElementById(e,r,t){if(t===void 0){t=true}if(!Array.isArray(r))r=[r];return(0,n.findOne)(getAttribCheck("id",e),r,t)}r.getElementById=getElementById;function getElementsByTagName(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_name(e),r,t,a)}r.getElementsByTagName=getElementsByTagName;function getElementsByTagType(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_type(e),r,t,a)}r.getElementsByTagType=getElementsByTagType},1655:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prepend=r.prependChild=r.append=r.appendChild=r.replaceElement=r.removeElement=void 0;function removeElement(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){var r=e.parent.children;r.splice(r.lastIndexOf(e),1)}}r.removeElement=removeElement;function replaceElement(e,r){var t=r.prev=e.prev;if(t){t.next=r}var a=r.next=e.next;if(a){a.prev=r}var n=r.parent=e.parent;if(n){var i=n.children;i[i.lastIndexOf(e)]=r}}r.replaceElement=replaceElement;function appendChild(e,r){removeElement(r);r.next=null;r.parent=e;if(e.children.push(r)>1){var t=e.children[e.children.length-2];t.next=r;r.prev=t}else{r.prev=null}}r.appendChild=appendChild;function append(e,r){removeElement(r);var t=e.parent;var a=e.next;r.next=a;r.prev=e;e.next=r;r.parent=t;if(a){a.prev=r;if(t){var n=t.children;n.splice(n.lastIndexOf(a),0,r)}}else if(t){t.children.push(r)}}r.append=append;function prependChild(e,r){removeElement(r);r.parent=e;r.prev=null;if(e.children.unshift(r)!==1){var t=e.children[1];t.prev=r;r.next=t}else{r.next=null}}r.prependChild=prependChild;function prepend(e,r){removeElement(r);var t=e.parent;if(t){var a=t.children;a.splice(a.indexOf(e),0,r)}if(e.prev){e.prev.next=r}r.parent=t;r.prev=e.prev;r.next=e;e.prev=r}r.prepend=prepend},8929:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.findAll=r.existsOne=r.findOne=r.findOneChild=r.find=r.filter=void 0;var a=t(2472);function filter(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}if(!Array.isArray(r))r=[r];return find(e,r,t,a)}r.filter=filter;function find(e,r,t,n){var i=[];for(var o=0,s=r;o0){var l=find(e,u.children,t,n);i.push.apply(i,l);n-=l.length;if(n<=0)break}}return i}r.find=find;function findOneChild(e,r){return r.find(e)}r.findOneChild=findOneChild;function findOne(e,r,t){if(t===void 0){t=true}var n=null;for(var i=0;i0){n=findOne(e,o.children)}}return n}r.findOne=findOne;function existsOne(e,r){return r.some((function(r){return(0,a.isTag)(r)&&(e(r)||r.children.length>0&&existsOne(e,r.children))}))}r.existsOne=existsOne;function findAll(e,r){var t;var n=[];var i=r.filter(a.isTag);var o;while(o=i.shift()){var s=(t=o.children)===null||t===void 0?void 0:t.filter(a.isTag);if(s&&s.length>0){i.unshift.apply(i,s)}if(e(o))n.push(o)}return n}r.findAll=findAll},3930:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.innerText=r.textContent=r.getText=r.getInnerHTML=r.getOuterHTML=void 0;var n=t(2472);var i=a(t(4614));var o=t(9391);function getOuterHTML(e,r){return(0,i.default)(e,r)}r.getOuterHTML=getOuterHTML;function getInnerHTML(e,r){return(0,n.hasChildren)(e)?e.children.map((function(e){return getOuterHTML(e,r)})).join(""):""}r.getInnerHTML=getInnerHTML;function getText(e){if(Array.isArray(e))return e.map(getText).join("");if((0,n.isTag)(e))return e.name==="br"?"\n":getText(e.children);if((0,n.isCDATA)(e))return getText(e.children);if((0,n.isText)(e))return e.data;return""}r.getText=getText;function textContent(e){if(Array.isArray(e))return e.map(textContent).join("");if((0,n.hasChildren)(e)&&!(0,n.isComment)(e)){return textContent(e.children)}if((0,n.isText)(e))return e.data;return""}r.textContent=textContent;function innerText(e){if(Array.isArray(e))return e.map(innerText).join("");if((0,n.hasChildren)(e)&&(e.type===o.ElementType.Tag||(0,n.isCDATA)(e))){return innerText(e.children)}if((0,n.isText)(e))return e.data;return""}r.innerText=innerText},8298:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prevElementSibling=r.nextElementSibling=r.getName=r.hasAttrib=r.getAttributeValue=r.getSiblings=r.getParent=r.getChildren=void 0;var a=t(2472);var n=[];function getChildren(e){var r;return(r=e.children)!==null&&r!==void 0?r:n}r.getChildren=getChildren;function getParent(e){return e.parent||null}r.getParent=getParent;function getSiblings(e){var r,t;var a=getParent(e);if(a!=null)return getChildren(a);var n=[e];var i=e.prev,o=e.next;while(i!=null){n.unshift(i);r=i,i=r.prev}while(o!=null){n.push(o);t=o,o=t.next}return n}r.getSiblings=getSiblings;function getAttributeValue(e,r){var t;return(t=e.attribs)===null||t===void 0?void 0:t[r]}r.getAttributeValue=getAttributeValue;function hasAttrib(e,r){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,r)&&e.attribs[r]!=null}r.hasAttrib=hasAttrib;function getName(e){return e.name}r.getName=getName;function nextElementSibling(e){var r;var t=e.next;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.next;return t}r.nextElementSibling=nextElementSibling;function prevElementSibling(e){var r;var t=e.prev;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.prev;return t}r.prevElementSibling=prevElementSibling},6674:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(1859));var i=a(t(2128));var o=a(t(4931));var s=a(t(9281));r.decodeXML=getStrictDecoder(o.default);r.decodeHTMLStrict=getStrictDecoder(n.default);function getStrictDecoder(e){var r=Object.keys(e).join("|");var t=getReplacer(e);r+="|#[xX][\\da-fA-F]+|#\\d+";var a=new RegExp("&(?:"+r+");","g");return function(e){return String(e).replace(a,t)}}var sorter=function(e,r){return e=55296&&e<=57343||e>1114111){return"�"}if(e in n.default){e=n.default[e]}var r="";if(e>65535){e-=65536;r+=String.fromCharCode(e>>>10&1023|55296);e=56320|e&1023}r+=String.fromCharCode(e);return r}r["default"]=decodeCodePoint},6032:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(4931));var i=getInverseObj(n.default);var o=getInverseReplacer(i);r.encodeXML=getInverse(i,o);var s=a(t(1859));var u=getInverseObj(s.default);var l=getInverseReplacer(u);r.encodeHTML=getInverse(u,l);function getInverseObj(e){return Object.keys(e).sort().reduce((function(r,t){r[e[t]]="&"+t+";";return r}),{})}function getInverseReplacer(e){var r=[];var t=[];Object.keys(e).forEach((function(e){return e.length===1?r.push("\\"+e):t.push(e)}));t.unshift("["+r.join("")+"]");return new RegExp(t.join("|"),"g")}var c=/[^\0-\x7F]/g;var p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function singleCharReplacer(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(e,r){var t=e.charCodeAt(0);var a=e.charCodeAt(1);var n=(t-55296)*1024+a-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}function getInverse(e,r){return function(t){return t.replace(r,(function(r){return e[r]})).replace(p,astralReplacer).replace(c,singleCharReplacer)}}var d=getInverseReplacer(i);function escape(e){return e.replace(d,singleCharReplacer).replace(p,astralReplacer).replace(c,singleCharReplacer)}r.escape=escape},9280:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(6674);var n=t(6032);function decode(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTML)(e)}r.decode=decode;function decodeStrict(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTMLStrict)(e)}r.decodeStrict=decodeStrict;function encode(e,r){return(!r||r<=0?n.encodeXML:n.encodeHTML)(e)}r.encode=encode;var i=t(6032);r.encodeXML=i.encodeXML;r.encodeHTML=i.encodeHTML;r.escape=i.escape;r.encodeHTML4=i.encodeHTML;r.encodeHTML5=i.encodeHTML;var o=t(6674);r.decodeXML=o.decodeXML;r.decodeHTML=o.decodeHTML;r.decodeHTMLStrict=o.decodeHTMLStrict;r.decodeHTML4=o.decodeHTML;r.decodeHTML5=o.decodeHTML;r.decodeHTML4Strict=o.decodeHTMLStrict;r.decodeHTML5Strict=o.decodeHTMLStrict;r.decodeXMLStrict=o.decodeXML},5902:function(e,r,t){e=t.nmd(e); +/*! https://mths.be/he v1.2.0 by @mathias | MIT license */(function(t){var a=true&&r;var n=true&&e&&e.exports==a&&e;var i=typeof global=="object"&&global;if(i.global===i||i.window===i){t=i}var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var s=/[\x01-\x7F]/g;var u=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;var l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;var c={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"};var p=/["&'<>`]/g;var d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"};var f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;var g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var h=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;var m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"};var v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"};var b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var y=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var w=String.fromCharCode;var T={};var E=T.hasOwnProperty;var has=function(e,r){return E.call(e,r)};var contains=function(e,r){var t=-1;var a=e.length;while(++t=55296&&e<=57343||e>1114111){if(r){parseError("character reference outside the permissible Unicode range")}return"�"}if(has(b,e)){if(r){parseError("disallowed character reference")}return b[e]}if(r&&contains(y,e)){parseError("disallowed character reference")}if(e>65535){e-=65536;t+=w(e>>>10&1023|55296);e=56320|e&1023}t+=w(e);return t};var hexEscape=function(e){return"&#x"+e.toString(16).toUpperCase()+";"};var decEscape=function(e){return"&#"+e+";"};var parseError=function(e){throw Error("Parse error: "+e)};var encode=function(e,r){r=merge(r,encode.options);var t=r.strict;if(t&&g.test(e)){parseError("forbidden code point")}var a=r.encodeEverything;var n=r.useNamedReferences;var i=r.allowUnsafeSymbols;var d=r.decimal?decEscape:hexEscape;var escapeBmpSymbol=function(e){return d(e.charCodeAt(0))};if(a){e=e.replace(s,(function(e){if(n&&has(c,e)){return"&"+c[e]+";"}return escapeBmpSymbol(e)}));if(n){e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")}if(n){e=e.replace(l,(function(e){return"&"+c[e]+";"}))}}else if(n){if(!i){e=e.replace(p,(function(e){return"&"+c[e]+";"}))}e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒");e=e.replace(l,(function(e){return"&"+c[e]+";"}))}else if(!i){e=e.replace(p,escapeBmpSymbol)}return e.replace(o,(function(e){var r=e.charCodeAt(0);var t=e.charCodeAt(1);var a=(r-55296)*1024+t-56320+65536;return d(a)})).replace(u,escapeBmpSymbol)};encode.options={allowUnsafeSymbols:false,encodeEverything:false,strict:false,useNamedReferences:false,decimal:false};var decode=function(e,r){r=merge(r,decode.options);var t=r.strict;if(t&&f.test(e)){parseError("malformed character reference")}return e.replace(h,(function(e,a,n,i,o,s,u,l,c){var p;var d;var f;var g;var h;var b;if(a){h=a;return m[h]}if(n){h=n;b=i;if(b&&r.isAttributeValue){if(t&&b=="="){parseError("`&` did not start a character reference")}return e}else{if(t){parseError("named character reference was not terminated by a semicolon")}return v[h]+(b||"")}}if(o){f=o;d=s;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(f,10);return codePointToSymbol(p,t)}if(u){g=u;d=l;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(g,16);return codePointToSymbol(p,t)}if(t){parseError("named character reference was not terminated by a semicolon")}return e}))};decode.options={isAttributeValue:false,strict:false};var escape=function(e){return e.replace(p,(function(e){return d[e]}))};var A={version:"1.2.0",encode:encode,decode:decode,escape:escape,unescape:decode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define((function(){return A}))}else if(a&&!a.nodeType){if(n){n.exports=A}else{for(var q in A){has(A,q)&&(a[q]=A[q])}}}else{t.he=A}})(this)},5596:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});function arr_back(e){return e[e.length-1]}r["default"]=arr_back},5417:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.NodeType=r.TextNode=r.Node=r.valid=r["default"]=r.parse=r.HTMLElement=r.CommentNode=void 0;var n=t(190);Object.defineProperty(r,"CommentNode",{enumerable:true,get:function(){return a(n).default}});var i=t(3248);Object.defineProperty(r,"HTMLElement",{enumerable:true,get:function(){return a(i).default}});var o=t(8653);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a(o).default}});Object.defineProperty(r,"default",{enumerable:true,get:function(){return a(o).default}});var s=t(3494);Object.defineProperty(r,"valid",{enumerable:true,get:function(){return a(s).default}});var u=t(7402);Object.defineProperty(r,"Node",{enumerable:true,get:function(){return a(u).default}});var l=t(111);Object.defineProperty(r,"TextNode",{enumerable:true,get:function(){return a(l).default}});var c=t(5896);Object.defineProperty(r,"NodeType",{enumerable:true,get:function(){return a(c).default}})},9958:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(5896));function isTag(e){return e&&e.nodeType===n.default.ELEMENT_NODE}function getAttributeValue(e,r){return isTag(e)?e.getAttribute(r):undefined}function getName(e){return(e&&e.rawTagName||"").toLowerCase()}function getChildren(e){return e&&e.childNodes}function getParent(e){return e?e.parentNode:null}function getText(e){return e.text}function removeSubsets(e){var r=e.length;var t;var a;var n;while(--r>-1){t=a=e[r];e[r]=null;n=true;while(a){if(e.indexOf(a)>-1){n=false;e.splice(r,1);break}a=getParent(a)}if(n){e[r]=t}}return e}function existsOne(e,r){return r.some((function(r){return isTag(r)?e(r)||existsOne(e,getChildren(r)):false}))}function getSiblings(e){var r=getParent(e);return r&&getChildren(r)}function hasAttrib(e,r){return getAttributeValue(e,r)!==undefined}function findOne(e,r){var t=null;for(var a=0,n=r.length;a0){t=findOne(e,o)}}}return t}function findAll(e,r){var t=[];for(var a=0,n=r.length;a0){r.push(e=[])}t.childNodes.forEach(dfs);if(e.length>0){r.push(e=[])}}else{t.childNodes.forEach(dfs)}}else if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){e.prependWhitespace=true}else{var a=t.trimmedText;if(e.prependWhitespace){a=" ".concat(a);e.prependWhitespace=false}e.push(a)}}}dfs(this);return r.map((function(e){return e.join("").replace(/\s{2,}/g," ")})).join("\n").replace(/\s+$/,"")},enumerable:false,configurable:true});HTMLElement.prototype.toString=function(){var e=this.rawTagName;if(e){var r=this.rawAttrs?" ".concat(this.rawAttrs):"";return this.isVoidElement?"<".concat(e).concat(r,">"):"<".concat(e).concat(r,">").concat(this.innerHTML,"")}return this.innerHTML};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return this.childNodes.map((function(e){return e.toString()})).join("")},set:function(e){var r=parse(e);var t=r.childNodes.length?r.childNodes:[new f.default(e,this)];resetParent(t,this);resetParent(this.childNodes,null);this.childNodes=t},enumerable:false,configurable:true});HTMLElement.prototype.set_content=function(e,r){if(r===void 0){r={}}if(e instanceof d.default){e=[e]}else if(typeof e=="string"){var t=parse(e,r);e=t.childNodes.length?t.childNodes:[new f.default(e,this)]}resetParent(this.childNodes,null);resetParent(e,this);this.childNodes=e;return this};HTMLElement.prototype.replaceWith=function(){var e=this;var r=[];for(var t=0;t-1){t.rawText=t.rawText.substr(0,a);this.childNodes.length=r+1}}}return this};Object.defineProperty(HTMLElement.prototype,"structure",{get:function(){var e=[];var r=0;function write(t){e.push(" ".repeat(r)+t)}function dfs(e){var t=e.id?"#".concat(e.id):"";var a=e.classList.length?".".concat(e.classList.value.join(".")):"";write("".concat(e.rawTagName).concat(t).concat(a));r++;e.childNodes.forEach((function(e){if(e.nodeType===g.default.ELEMENT_NODE){dfs(e)}else if(e.nodeType===g.default.TEXT_NODE){if(!e.isWhitespace){write("#text")}}}));r--}dfs(this);return e.join("\n")},enumerable:false,configurable:true});HTMLElement.prototype.removeWhitespace=function(){var e=this;var r=0;this.childNodes.forEach((function(t){if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){return}t.rawText=t.trimmedRawText}else if(t.nodeType===g.default.ELEMENT_NODE){t.removeWhitespace()}e.childNodes[r++]=t}));this.childNodes.length=r;return this};HTMLElement.prototype.querySelectorAll=function(e){return(0,s.selectAll)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.querySelector=function(e){return(0,s.selectOne)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.getElementsByTagName=function(e){var r=e.toUpperCase();var t=[];var a=[];var n=this;var i=0;while(i!==undefined){var o=void 0;do{o=n.childNodes[i++]}while(i0){a.push(i);n=o;i=0}}}return t};HTMLElement.prototype.getElementById=function(e){var r=[];var t=this;var a=0;while(a!==undefined){var n=void 0;do{n=t.childNodes[a++]}while(a0){r.push(a);t=n;a=0}}}return null};HTMLElement.prototype.closest=function(e){var r=new Map;var t=this;var a=null;function findOne(e,t){var a=null;for(var n=0,i=t.length;n0){var t=e[--r];if(this===t)return e[r-1]||null}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"previousElementSibling",{get:function(){if(this.parentNode){var e=this.parentNode.childNodes;var r=e.length;var t=false;while(r>0){var a=e[--r];if(t){if(a instanceof HTMLElement){return a||null}}else if(this===a){t=true}}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"classNames",{get:function(){return this.classList.toString()},enumerable:false,configurable:true});HTMLElement.prototype.clone=function(){return parse(this.toString()).firstChild};return HTMLElement}(d.default);r["default"]=A;var q=/|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g;var x=/(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;var D={area:true,AREA:true,base:true,BASE:true,br:true,BR:true,col:true,COL:true,hr:true,HR:true,img:true,IMG:true,input:true,INPUT:true,link:true,LINK:true,meta:true,META:true,source:true,SOURCE:true,embed:true,EMBED:true,param:true,PARAM:true,track:true,TRACK:true,wbr:true,WBR:true};var C={li:{li:true,LI:true},LI:{li:true,LI:true},p:{p:true,div:true,P:true,DIV:true},P:{p:true,div:true,P:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},td:{td:true,th:true,TD:true,TH:true},TD:{td:true,th:true,TD:true,TH:true},th:{td:true,th:true,TD:true,TH:true},TH:{td:true,th:true,TD:true,TH:true},h1:{h1:true,H1:true},H1:{h1:true,H1:true},h2:{h2:true,H2:true},H2:{h2:true,H2:true},h3:{h3:true,H3:true},H3:{h3:true,H3:true},h4:{h4:true,H4:true},H4:{h4:true,H4:true},h5:{h5:true,H5:true},H5:{h5:true,H5:true},h6:{h6:true,H6:true},H6:{h6:true,H6:true}};var N={li:{ul:true,ol:true,UL:true,OL:true},LI:{ul:true,ol:true,UL:true,OL:true},a:{div:true,DIV:true},A:{div:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},i:{div:true,DIV:true},I:{div:true,DIV:true},p:{div:true,DIV:true},P:{div:true,DIV:true},td:{tr:true,table:true,TR:true,TABLE:true},TD:{tr:true,table:true,TR:true,TABLE:true},th:{tr:true,table:true,TR:true,TABLE:true},TH:{tr:true,table:true,TR:true,TABLE:true}};var S="documentfragmentcontainer";function base_parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=r.blockTextElements||{script:true,noscript:true,style:true,pre:true};var a=Object.keys(t);var n=a.map((function(e){return new RegExp("^".concat(e,"$"),"i")}));var i=a.filter((function(e){return t[e]})).map((function(e){return new RegExp("^".concat(e,"$"),"i")}));function element_should_be_ignore(e){return i.some((function(r){return r.test(e)}))}function is_block_text_element(e){return n.some((function(r){return r.test(e)}))}var createRange=function(e,r){return[e-v,r-v]};var o=new A(null,{},"",null,[0,e.length]);var s=o;var u=[o];var c=-1;var d=undefined;var g;e="<".concat(S,">").concat(e,"");var h=r.lowerCaseTagName;var m=e.length-(S.length+2);var v=S.length+2;while(g=q.exec(e)){var b=g[0],y=g[1],w=g[2],T=g[3],E=g[4];var L=b.length;var k=q.lastIndex-L;var O=q.lastIndex;if(c>-1){if(c+L");var I=h?e.toLocaleLowerCase().indexOf(U,q.lastIndex):e.indexOf(U,q.lastIndex);var G=I===-1?m:I;if(element_should_be_ignore(w)){var _=e.substring(F,G);if(_.length>0&&/\S/.test(_)){s.appendChild(new f.default(_,s,createRange(F,G)))}}if(I===-1){c=q.lastIndex=e.length+1}else{c=q.lastIndex=I+U.length;y="/"}}}if(y||E||D[w]){while(true){if(w==="a"||w==="A")d=undefined;if(s.rawTagName===w){s.range[1]=createRange(-1,Math.max(c,O))[1];u.pop();s=(0,l.default)(u);break}else{var H=s.tagName;if(N[H]){if(N[H][w]){u.pop();s=(0,l.default)(u);continue}}break}}}}return u}r.base_parse=base_parse;function parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=base_parse(e,r);var a=t[0];var _loop_1=function(){var e=t.pop();var a=(0,l.default)(t);if(e.parentNode&&e.parentNode.parentNode){if(e.parentNode===a&&e.tagName===a.tagName){if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.parentNode.appendChild(e)}));t.pop()}}else{if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.appendChild(e)}))}}}else{}};while(t.length>1){_loop_1()}return a}r.parse=parse;function resetParent(e,r){return e.map((function(e){e.parentNode=r;return e}))}},7402:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(5902);var n=function(){function Node(e,r){if(e===void 0){e=null}this.parentNode=e;this.childNodes=[];Object.defineProperty(this,"range",{enumerable:false,writable:true,configurable:true,value:r!==null&&r!==void 0?r:[-1,-1]})}Node.prototype.remove=function(){var e=this;if(this.parentNode){var r=this.parentNode.childNodes;this.parentNode.childNodes=r.filter((function(r){return e!==r}));this.parentNode=null}return this};Object.defineProperty(Node.prototype,"innerText",{get:function(){return this.rawText},enumerable:false,configurable:true});Object.defineProperty(Node.prototype,"textContent",{get:function(){return(0,a.decode)(this.rawText)},set:function(e){this.rawText=(0,a.encode)(e)},enumerable:false,configurable:true});return Node}();r["default"]=n},111:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var i=t(5902);var o=n(t(7402));var s=n(t(5896));var u=function(e){a(TextNode,e);function TextNode(r,t,a){var n=e.call(this,t,a)||this;n.nodeType=s.default.TEXT_NODE;n._rawText=r;return n}TextNode.prototype.clone=function(){return new TextNode(this._rawText,null)};Object.defineProperty(TextNode.prototype,"rawText",{get:function(){return this._rawText},set:function(e){this._rawText=e;this._trimmedRawText=void 0;this._trimmedText=void 0},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedRawText",{get:function(){if(this._trimmedRawText!==undefined)return this._trimmedRawText;this._trimmedRawText=trimText(this.rawText);return this._trimmedRawText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedText",{get:function(){if(this._trimmedText!==undefined)return this._trimmedText;this._trimmedText=trimText(this.text);return this._trimmedText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"text",{get:function(){return(0,i.decode)(this.rawText)},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"isWhitespace",{get:function(){return/^(\s| )*$/.test(this.rawText)},enumerable:false,configurable:true});TextNode.prototype.toString=function(){return this.rawText};return TextNode}(o.default);r["default"]=u;function trimText(e){var r=0;var t;var a;while(r>=0&&r0&&/[^\S\r\n]/.test(e[t-1]);var i=a=t};var a=Math.abs(r);var i=(t%a+a)%a;return r>1?function(e){return e>=t&&e%a===i}:function(e){return e<=t&&e%a===i}}r.compile=compile;function generate(e){var r=e[0];var t=e[1]-1;var a=0;if(r<0){var n=-r;var i=(t%n+n)%n;return function(){var e=i+n*a++;return e>t?null:e}}if(r===0)return t<0?function(){return null}:function(){return a++===0?t:null};if(t<0){t+=r*Math.ceil(-t/r)}return function(){return r*a+++t}}r.generate=generate},7118:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.sequence=r.generate=r.compile=r.parse=void 0;var a=t(2421);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a.parse}});var n=t(3947);Object.defineProperty(r,"compile",{enumerable:true,get:function(){return n.compile}});Object.defineProperty(r,"generate",{enumerable:true,get:function(){return n.generate}});function nthCheck(e){return(0,n.compile)((0,a.parse)(e))}r["default"]=nthCheck;function sequence(e){return(0,n.generate)((0,a.parse)(e))}r.sequence=sequence},2421:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=void 0;var t=new Set([9,10,12,13,32]);var a="0".charCodeAt(0);var n="9".charCodeAt(0);function parse(e){e=e.trim().toLowerCase();if(e==="even"){return[2,0]}else if(e==="odd"){return[2,1]}var r=0;var i=0;var o=readSign();var s=readNumber();if(r=a&&e.charCodeAt(r)<=n){i=i*10+(e.charCodeAt(r)-a);r++}return r===t?null:i}function skipWhitespace(){while(r","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},2128:function(e){"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},4931:function(e){"use strict";e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')}};var r={};function __webpack_require__(t){var a=r[t];if(a!==undefined){return a.exports}var n=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(n.exports,n,n.exports,__webpack_require__);i=false}finally{if(i)delete r[t]}n.loaded=true;return n.exports}!function(){__webpack_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var t=__webpack_require__(5417);module.exports=t})(); \ No newline at end of file diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 360de5c64369d..783a830a41188 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -17,10 +17,10 @@ export function addHookAliases(aliases: [string, string][] = []) { } } -// We need to use `eval` here to avoid webpack from rewriting the `require.resolve` calls -// as this code could be bundled -// eslint-disable-next-line no-eval -const resolve = eval('require').resolve +const resolve = process.env.NEXT_MINIMAL + ? // @ts-ignore + __non_webpack_require__.resolve + : require.resolve // Add default aliases addHookAliases([ diff --git a/packages/next/src/server/require.ts b/packages/next/src/server/require.ts index 6c5a9121fabc7..393fc5bfef621 100644 --- a/packages/next/src/server/require.ts +++ b/packages/next/src/server/require.ts @@ -122,9 +122,10 @@ export function requirePage( }) } - // this code could be bundled so we need to use `eval` to avoid using the bundler's require - // eslint-disable-next-line no-eval - return eval('require')(pagePath) + return process.env.NEXT_MINIMAL + ? // @ts-ignore + __non_webpack_require__(pagePath) + : require(pagePath) } export function requireFontManifest(distDir: string) { diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index efec70d8d1e5c..63ee106d51843 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -83,7 +83,12 @@ externals['node-html-parser'] = 'next/dist/compiled/node-html-parser' export async function ncc_node_html_parser(task, opts) { await task .source(relative(__dirname, require.resolve('node-html-parser'))) - .ncc({ packageName: 'node-html-parser', externals, target: 'es5' }) + .ncc({ + packageName: 'node-html-parser', + externals, + target: 'es5', + v8cache: true, + }) .target('src/compiled/node-html-parser') } @@ -2622,7 +2627,6 @@ export async function minimal_next_server(task) { const cachedOutputName = `${outputName}.cache` const minimalExternals = [ - 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', 'react', 'react/package.json', 'react/jsx-runtime', @@ -2640,6 +2644,7 @@ export async function minimal_next_server(task) { 'styled-jsx', 'styled-jsx/style', '@opentelemetry/api', + 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', 'next/dist/compiled/@ampproject/toolbox-optimizer', 'next/dist/compiled/edge-runtime', 'next/dist/compiled/@edge-runtime/ponyfill', @@ -2662,7 +2667,8 @@ export async function minimal_next_server(task) { const webpack = require('webpack') const TerserPlugin = require('terser-webpack-plugin') - + // const BundleAnalyzerPlugin = + // require('webpack-bundle-analyzer').BundleAnalyzerPlugin /** @type {webpack.Configuration} */ const config = { entry: join(__dirname, 'dist/server/next-server.js'), @@ -2675,7 +2681,7 @@ export async function minimal_next_server(task) { }, // left in for debugging optimization: { - // moduleIds: 'named', + moduleIds: 'named', // minimize: false, minimize: true, minimizer: [ @@ -2698,6 +2704,7 @@ export async function minimal_next_server(task) { 'process.env.NEXT_MINIMAL': JSON.stringify('true'), 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), }), + // new BundleAnalyzerPlugin({}), ], externals: [minimalExternals], } diff --git a/scripts/minimal-server.js b/scripts/minimal-server.js index 88e6d5c1a7ebe..f4f30ac97ce25 100644 --- a/scripts/minimal-server.js +++ b/scripts/minimal-server.js @@ -21,11 +21,12 @@ if (process.env.LOG_REQUIRE) { if (process.env.LOG_COMPILE) { const originalCompile = require('module').prototype._compile - + const currentDir = process.cwd() require('module').prototype._compile = function (content, filename) { - console.time(`Module '${filename}' compiled`) + const strippedFilename = filename.replace(currentDir, '') + console.time(`Module '${strippedFilename}' compiled`) const result = originalCompile.apply(this, arguments) - console.timeEnd(`Module '${filename}' compiled`) + console.timeEnd(`Module '${strippedFilename}' compiled`) return result } } @@ -100,6 +101,7 @@ require('http') if (process.env.LOG_READFILE) { console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) } + require('process').exit(0) }) }) .listen(3000, () => { From 1ebf057ce0b8320fdf6aafb831d72c2f1b79fc19 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 13:19:45 +0200 Subject: [PATCH 007/101] fix nft missing --- packages/next/src/build/index.ts | 15 +- packages/next/src/server/require-hook.ts | 183 ++++++++--------------- 2 files changed, 76 insertions(+), 122 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 7a2b430360104..5f94271162e61 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -141,6 +141,11 @@ import { createClientRouterFilter } from '../lib/create-client-router-filter' import { createValidFileMatcher } from '../server/lib/find-page-file' import { startTypeChecking } from './type-check' import { generateInterceptionRoutesRewrites } from '../lib/generate-interception-routes-rewrites' +import { + baseOverrides, + experimentalOverrides, + vanillaOverrides, +} from '../server/require-hook' export type SsgRoute = { initialRevalidateSeconds: number | false @@ -1967,8 +1972,16 @@ export default async function build( require.resolve( 'next/dist/compiled/minimal-next-server/next-server.js' ), + ...Object.values(vanillaOverrides).map((override) => + require.resolve(override) + ), + ...Object.values(baseOverrides).map((override) => + require.resolve(override) + ), + ...Object.values(experimentalOverrides).map((override) => + require.resolve(override) + ), ].filter(nonNullable) - // ensure we trace any dependencies needed for custom // incremental cache handler if (incrementalCacheHandlerPath) { diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 783a830a41188..7a3d179a7cc14 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -11,17 +11,72 @@ const hookPropertyMap = new Map() let aliasedPrebundledReact = false +const resolve = process.env.NEXT_MINIMAL + ? // @ts-ignore + __non_webpack_require__.resolve + : require.resolve + +const toResolveMap = (map: Record): [string, string][] => + Object.entries(map).map(([key, value]) => [key, resolve(value)]) + +export const vanillaOverrides = { + 'styled-jsx': 'styled-jsx/package.json', + 'styled-jsx/style': 'styled-jsx/style', +} + +export const baseOverrides = { + react: 'next/dist/compiled/react', + 'react/package.json': 'next/dist/compiled/react/package.json', + 'react/jsx-runtime': 'next/dist/compiled/react/jsx-runtime', + 'react/jsx-dev-runtime': 'next/dist/compiled/react/jsx-dev-runtime', + 'react-dom': 'next/dist/compiled/react-dom/server-rendering-stub', + 'react-dom/package.json': 'next/dist/compiled/react-dom/package.json', + 'react-dom/client': 'next/dist/compiled/react-dom/client', + 'react-dom/server': 'next/dist/compiled/react-dom/server', + 'react-dom/server.browser': 'next/dist/compiled/react-dom/server.browser', + 'react-dom/server.edge': 'next/dist/compiled/react-dom/server.edge', + 'react-server-dom-webpack/client': + 'next/dist/compiled/react-server-dom-webpack/client', + 'react-server-dom-webpack/client.edge': + 'next/dist/compiled/react-server-dom-webpack/client.edge', + 'react-server-dom-webpack/server.edge': + 'next/dist/compiled/react-server-dom-webpack/server.edge', + 'react-server-dom-webpack/server.node': + 'next/dist/compiled/react-server-dom-webpack/server.node', +} + +export const experimentalOverrides = { + react: 'next/dist/compiled/react-experimental', + 'react/jsx-runtime': 'next/dist/compiled/react-experimental/jsx-runtime', + 'react/jsx-dev-runtime': + 'next/dist/compiled/react-experimental/jsx-dev-runtime', + 'react-dom': + 'next/dist/compiled/react-dom-experimental/server-rendering-stub', + 'react/package.json': 'next/dist/compiled/react-experimental/package.json', + 'react-dom/package.json': + 'next/dist/compiled/react-dom-experimental/package.json', + 'react-dom/client': 'next/dist/compiled/react-dom-experimental/client', + 'react-dom/server': 'next/dist/compiled/react-dom-experimental/server', + 'react-dom/server.browser': + 'next/dist/compiled/react-dom-experimental/server.browser', + 'react-dom/server.edge': + 'next/dist/compiled/react-dom-experimental/server.edge', + 'react-server-dom-webpack/client': + 'next/dist/compiled/react-server-dom-webpack-experimental/client', + 'react-server-dom-webpack/client.edge': + 'next/dist/compiled/react-server-dom-webpack-experimental/client.edge', + 'react-server-dom-webpack/server.edge': + 'next/dist/compiled/react-server-dom-webpack-experimental/server.edge', + 'react-server-dom-webpack/server.node': + 'next/dist/compiled/react-server-dom-webpack-experimental/server.node', +} + export function addHookAliases(aliases: [string, string][] = []) { for (const [key, value] of aliases) { hookPropertyMap.set(key, value) } } -const resolve = process.env.NEXT_MINIMAL - ? // @ts-ignore - __non_webpack_require__.resolve - : require.resolve - // Add default aliases addHookAliases([ // Use `require.resolve` explicitly to make them statically analyzable @@ -39,124 +94,10 @@ function overrideReact() { // NFT when building the app in standalone mode, as we are now conditionally // aliasing them it's tricky to track them in build time. if (process.env.__NEXT_PRIVATE_PREBUNDLED_REACT === 'experimental') { - addHookAliases([ - ['react', resolve(`next/dist/compiled/react-experimental`)], - [ - 'react/jsx-runtime', - resolve(`next/dist/compiled/react-experimental/jsx-runtime`), - ], - [ - 'react/jsx-dev-runtime', - resolve(`next/dist/compiled/react-experimental/jsx-dev-runtime`), - ], - [ - 'react-dom', - resolve( - `next/dist/compiled/react-dom-experimental/server-rendering-stub` - ), - ], - [ - 'react/package.json', - resolve(`next/dist/compiled/react-experimental/package.json`), - ], - [ - 'react-dom/package.json', - resolve(`next/dist/compiled/react-dom-experimental/package.json`), - ], - [ - 'react-dom/client', - resolve(`next/dist/compiled/react-dom-experimental/client`), - ], - [ - 'react-dom/server', - resolve(`next/dist/compiled/react-dom-experimental/server`), - ], - [ - 'react-dom/server.browser', - resolve(`next/dist/compiled/react-dom-experimental/server.browser`), - ], - [ - 'react-dom/server.edge', - resolve(`next/dist/compiled/react-dom-experimental/server.edge`), - ], - [ - 'react-server-dom-webpack/client', - resolve( - `next/dist/compiled/react-server-dom-webpack-experimental/client` - ), - ], - [ - 'react-server-dom-webpack/client.edge', - resolve( - `next/dist/compiled/react-server-dom-webpack-experimental/client.edge` - ), - ], - [ - 'react-server-dom-webpack/server.edge', - resolve( - `next/dist/compiled/react-server-dom-webpack-experimental/server.edge` - ), - ], - [ - 'react-server-dom-webpack/server.node', - resolve( - `next/dist/compiled/react-server-dom-webpack-experimental/server.node` - ), - ], - ]) + addHookAliases(toResolveMap(experimentalOverrides)) } else { - addHookAliases([ - ['react', resolve(`next/dist/compiled/react`)], - [ - 'react/package.json', - resolve(`next/dist/compiled/react/package.json`), - ], - ['react/jsx-runtime', resolve(`next/dist/compiled/react/jsx-runtime`)], - [ - 'react/jsx-dev-runtime', - resolve(`next/dist/compiled/react/jsx-dev-runtime`), - ], - [ - 'react-dom', - resolve(`next/dist/compiled/react-dom/server-rendering-stub`), - ], - [ - 'react-dom/package.json', - resolve(`next/dist/compiled/react-dom/package.json`), - ], - ['react-dom/client', resolve(`next/dist/compiled/react-dom/client`)], - ['react-dom/server', resolve(`next/dist/compiled/react-dom/server`)], - [ - 'react-dom/server.browser', - resolve(`next/dist/compiled/react-dom/server.browser`), - ], - [ - 'react-dom/server.edge', - resolve(`next/dist/compiled/react-dom/server.edge`), - ], - [ - 'react-server-dom-webpack/client', - resolve(`next/dist/compiled/react-server-dom-webpack/client`), - ], - [ - 'react-server-dom-webpack/client.edge', - resolve(`next/dist/compiled/react-server-dom-webpack/client.edge`), - ], - [ - 'react-server-dom-webpack/server.edge', - resolve(`next/dist/compiled/react-server-dom-webpack/server.edge`), - ], - [ - 'react-server-dom-webpack/server.node', - resolve(`next/dist/compiled/react-server-dom-webpack/server.node`), - ], - ]) + addHookAliases(toResolveMap(baseOverrides)) } - } else { - addHookAliases([ - ['react/jsx-runtime', resolve(`react/jsx-runtime`)], - ['react/jsx-dev-runtime', resolve(`react/jsx-dev-runtime`)], - ]) } } overrideReact() From 81f6e1c001a4994dbaf0beb1fd0ef8273b82160a Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 13:57:07 +0200 Subject: [PATCH 008/101] fix precompiled --- .../src/compiled/node-html-parser/index.js | 10 ++++++++-- .../compiled/node-html-parser/index.js.cache | Bin 13504 -> 13544 bytes 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/next/src/compiled/node-html-parser/index.js b/packages/next/src/compiled/node-html-parser/index.js index 2039eaeda2107..a4e592278008a 100644 --- a/packages/next/src/compiled/node-html-parser/index.js +++ b/packages/next/src/compiled/node-html-parser/index.js @@ -1,2 +1,8 @@ -(function(){var e={2947:function(e){e.exports={trueFunc:function trueFunc(){return true},falseFunc:function falseFunc(){return false}}},3387:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeRules=void 0;var a=t(2947);var n=/[-[\]{}()*+?.,\\^$|#\s]/g;function escapeRegex(e){return e.replace(n,"\\$&")}var i=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function shouldIgnoreCase(e,r){return typeof e.ignoreCase==="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!r.quirksMode:!r.xmlMode&&i.has(e.name)}r.attributeRules={equals:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return t!=null&&t.length===i.length&&t.toLowerCase()===i&&e(r)}}return function(r){return a.getAttributeValue(r,n)===i&&e(r)}},hyphen:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;var o=i.length;if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function hyphenIC(r){var t=a.getAttributeValue(r,n);return t!=null&&(t.length===o||t.charAt(o)==="-")&&t.substr(0,o).toLowerCase()===i&&e(r)}}return function hyphen(r){var t=a.getAttributeValue(r,n);return t!=null&&(t.length===o||t.charAt(o)==="-")&&t.substr(0,o)===i&&e(r)}},element:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(/\s/.test(o)){return a.falseFunc}var s=new RegExp("(?:^|\\s)".concat(escapeRegex(o),"(?:$|\\s)"),shouldIgnoreCase(r,t)?"i":"");return function element(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}},exists:function(e,r,t){var a=r.name;var n=t.adapter;return function(r){return n.hasAttrib(r,a)&&e(r)}},start:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=s&&t.substr(0,s).toLowerCase()===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.startsWith(o))&&e(r)}},end:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=-o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t;return((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.substr(s).toLowerCase())===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.endsWith(o))&&e(r)}},any:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(o===""){return a.falseFunc}if(shouldIgnoreCase(r,t)){var s=new RegExp(escapeRegex(o),"i");return function anyIC(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.includes(o))&&e(r)}},not:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(i===""){return function(r){return!!a.getAttributeValue(r,n)&&e(r)}}else if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return(t==null||t.length!==i.length||t.toLowerCase()!==i)&&e(r)}}return function(r){return a.getAttributeValue(r,n)!==i&&e(r)}}}},8689:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.compileToken=r.compileUnsafe=r.compile=void 0;var n=t(8065);var i=t(2947);var o=a(t(4901));var s=t(538);var u=t(7088);var l=t(4428);function compile(e,r,t){var a=compileUnsafe(e,r,t);return(0,l.ensureIsTag)(a,r.adapter)}r.compile=compile;function compileUnsafe(e,r,t){var a=typeof e==="string"?(0,n.parse)(e):e;return compileToken(a,r,t)}r.compileUnsafe=compileUnsafe;function includesScopePseudo(e){return e.type==="pseudo"&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some((function(e){return e.some(includesScopePseudo)})))}var c={type:n.SelectorType.Descendant};var p={type:"_flexibleDescendant"};var d={type:n.SelectorType.Pseudo,name:"scope",data:null};function absolutize(e,r,t){var a=r.adapter;var n=!!(t===null||t===void 0?void 0:t.every((function(e){var r=a.isTag(e)&&a.getParent(e);return e===l.PLACEHOLDER_ELEMENT||r&&a.isTag(r)})));for(var i=0,o=e;i0&&(0,s.isTraversal)(u[0])&&u[0].type!=="descendant"){}else if(n&&!u.some(includesScopePseudo)){u.unshift(c)}else{continue}u.unshift(d)}}function compileToken(e,r,t){var a;e=e.filter((function(e){return e.length>0}));e.forEach(o.default);t=(a=r.context)!==null&&a!==void 0?a:t;var n=Array.isArray(t);var s=t&&(Array.isArray(t)?t:[t]);absolutize(e,r,s);var u=false;var l=e.map((function(e){if(e.length>=2){var t=e[0],a=e[1];if(t.type!=="pseudo"||t.name!=="scope"){}else if(n&&a.type==="descendant"){e[1]=p}else if(a.type==="adjacent"||a.type==="sibling"){u=true}}return compileRules(e,r,s)})).reduce(reduceRules,i.falseFunc);l.shouldTestNextSiblings=u;return l}r.compileToken=compileToken;function compileRules(e,r,t){var a;return e.reduce((function(e,a){return e===i.falseFunc?i.falseFunc:(0,u.compileGeneralSelector)(e,a,r,t,compileToken)}),(a=r.rootFunc)!==null&&a!==void 0?a:i.trueFunc)}function reduceRules(e,r){if(r===i.falseFunc||e===i.trueFunc){return e}if(e===i.falseFunc||r===i.trueFunc){return r}return function combine(t){return e(t)||r(t)}}},7088:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compileGeneralSelector=void 0;var a=t(3387);var n=t(6463);var i=t(8065);function compileGeneralSelector(e,r,t,o,s){var u=t.adapter,l=t.equals;switch(r.type){case i.SelectorType.PseudoElement:{throw new Error("Pseudo-elements are not supported by css-select")}case i.SelectorType.ColumnCombinator:{throw new Error("Column combinators are not yet supported by css-select")}case i.SelectorType.Attribute:{if(r.namespace!=null){throw new Error("Namespaced attributes are not yet supported by css-select")}if(!t.xmlMode||t.lowerCaseAttributeNames){r.name=r.name.toLowerCase()}return a.attributeRules[r.action](e,r,t)}case i.SelectorType.Pseudo:{return(0,n.compilePseudoSelector)(e,r,t,o,s)}case i.SelectorType.Tag:{if(r.namespace!=null){throw new Error("Namespaced tag names are not yet supported by css-select")}var c=r.name;if(!t.xmlMode||t.lowerCaseTags){c=c.toLowerCase()}return function tag(r){return u.getName(r)===c&&e(r)}}case i.SelectorType.Descendant:{if(t.cacheResults===false||typeof WeakSet==="undefined"){return function descendant(r){var t=r;while(t=u.getParent(t)){if(u.isTag(t)&&e(t)){return true}}return false}}var p=new WeakSet;return function cachedDescendant(r){var t=r;while(t=u.getParent(t)){if(!p.has(t)){if(u.isTag(t)&&e(t)){return true}p.add(t)}}return false}}case"_flexibleDescendant":{return function flexibleDescendant(r){var t=r;do{if(u.isTag(t)&&e(t))return true}while(t=u.getParent(t));return false}}case i.SelectorType.Parent:{return function parent(r){return u.getChildren(r).some((function(r){return u.isTag(r)&&e(r)}))}}case i.SelectorType.Child:{return function child(r){var t=u.getParent(r);return t!=null&&u.isTag(t)&&e(t)}}case i.SelectorType.Sibling:{return function sibling(r){var t=u.getSiblings(r);for(var a=0;a option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}},6804:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.filters=void 0;var n=a(t(7118));var i=t(2947);function getChildFunc(e,r){return function(t){var a=r.getParent(t);return a!=null&&r.isTag(a)&&e(t)}}r.filters={contains:function(e,r,t){var a=t.adapter;return function contains(t){return e(t)&&a.getText(t).includes(r)}},icontains:function(e,r,t){var a=t.adapter;var n=r.toLowerCase();return function icontains(r){return e(r)&&a.getText(r).toLowerCase().includes(n)}},"nth-child":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthChild(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){if(o(r,t[i]))break;if(a.isTag(t[i])){n++}}return s(n)&&e(r)}},"nth-of-type":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthOfType(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){var u=t[i];if(o(r,u))break;if(a.isTag(u)&&a.getName(u)===a.getName(r)){n++}}return s(n)&&e(r)}},root:function(e,r,t){var a=t.adapter;return function(r){var t=a.getParent(r);return(t==null||!a.isTag(t))&&e(r)}},scope:function(e,t,a,n){var i=a.equals;if(!n||n.length===0){return r.filters.root(e,t,a)}if(n.length===1){return function(r){return i(n[0],r)&&e(r)}}return function(r){return n.includes(r)&&e(r)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(e){return function dynamicPseudo(r,t,a){var n=a.adapter;var o=n[e];if(typeof o!=="function"){return i.falseFunc}return function active(e){return o(e)&&r(e)}}}},6463:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compilePseudoSelector=r.aliases=r.pseudos=r.filters=void 0;var a=t(2947);var n=t(8065);var i=t(6804);Object.defineProperty(r,"filters",{enumerable:true,get:function(){return i.filters}});var o=t(6973);Object.defineProperty(r,"pseudos",{enumerable:true,get:function(){return o.pseudos}});var s=t(8680);Object.defineProperty(r,"aliases",{enumerable:true,get:function(){return s.aliases}});var u=t(4428);function compilePseudoSelector(e,r,t,l,c){var p=r.name,d=r.data;if(Array.isArray(d)){return u.subselects[p](e,d,t,l,c)}if(p in s.aliases){if(d!=null){throw new Error("Pseudo ".concat(p," doesn't have any arguments"))}var f=(0,n.parse)(s.aliases[p]);return u.subselects.is(e,f,t,l,c)}if(p in i.filters){return i.filters[p](e,d,t,l)}if(p in o.pseudos){var g=o.pseudos[p];(0,o.verifyPseudoArgs)(g,p,d);return g===a.falseFunc?a.falseFunc:e===a.trueFunc?function(e){return g(e,t,d)}:function(r){return g(r,t,d)&&e(r)}}throw new Error("unmatched pseudo-class :".concat(p))}r.compilePseudoSelector=compilePseudoSelector},6973:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.verifyPseudoArgs=r.pseudos=void 0;r.pseudos={empty:function(e,r){var t=r.adapter;return!t.getChildren(e).some((function(e){return t.isTag(e)||t.getText(e)!==""}))},"first-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e).find((function(e){return t.isTag(e)}));return n!=null&&a(e,n)},"last-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);for(var i=n.length-1;i>=0;i--){if(a(e,n[i]))return true;if(t.isTag(n[i]))break}return false},"first-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);var i=t.getName(e);for(var o=0;o=0;o--){var s=n[o];if(a(e,s))return true;if(t.isTag(s)&&t.getName(s)===i){break}}return false},"only-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getName(e);return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)||t.getName(r)!==n}))},"only-child":function(e,r){var t=r.adapter,a=r.equals;return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)}))}};function verifyPseudoArgs(e,r,t){if(t===null){if(e.length>2){throw new Error("pseudo-selector :".concat(r," requires an argument"))}}else if(e.length===2){throw new Error("pseudo-selector :".concat(r," doesn't have any arguments"))}}r.verifyPseudoArgs=verifyPseudoArgs},4428:function(e,r,t){"use strict";var a=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,i;a=0&&a>=1}}else if(e.type===a.SelectorType.Pseudo){if(!e.data){r=3}else if(e.name==="has"||e.name==="contains"){r=0}else if(Array.isArray(e.data)){r=0;for(var t=0;tr)r=o}if(e.data.length>1&&r>0)r-=1}else{r=1}}return r}},8065:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.stringify=r.parse=r.isTraversal=void 0;n(t(5615),r);var i=t(2422);Object.defineProperty(r,"isTraversal",{enumerable:true,get:function(){return i.isTraversal}});Object.defineProperty(r,"parse",{enumerable:true,get:function(){return i.parse}});var o=t(8279);Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return o.stringify}})},2422:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=r.isTraversal=void 0;var a=t(5615);var n=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;var i=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;var o=new Map([[126,a.AttributeAction.Element],[94,a.AttributeAction.Start],[36,a.AttributeAction.End],[42,a.AttributeAction.Any],[33,a.AttributeAction.Not],[124,a.AttributeAction.Hyphen]]);var s=new Set(["has","not","matches","is","where","host","host-context"]);function isTraversal(e){switch(e.type){case a.SelectorType.Adjacent:case a.SelectorType.Child:case a.SelectorType.Descendant:case a.SelectorType.Parent:case a.SelectorType.Sibling:case a.SelectorType.ColumnCombinator:return true;default:return false}}r.isTraversal=isTraversal;var u=new Set(["contains","icontains"]);function funescape(e,r,t){var a=parseInt(r,16)-65536;return a!==a||t?r:a<0?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,a&1023|56320)}function unescapeCSS(e){return e.replace(i,funescape)}function isQuote(e){return e===39||e===34}function isWhitespace(e){return e===32||e===9||e===10||e===12||e===13}function parse(e){var r=[];var t=parseSelector(r,"".concat(e),0);if(t0&&t0&&isTraversal(i[i.length-1])){throw new Error("Did not expect successive traversals.")}}function addTraversal(e){if(i.length>0&&i[i.length-1].type===a.SelectorType.Descendant){i[i.length-1].type=e;return}ensureNotTraversal();i.push({type:e})}function addSpecialAttribute(e,r){i.push({type:a.SelectorType.Attribute,name:e,action:r,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(i.length&&i[i.length-1].type===a.SelectorType.Descendant){i.pop()}if(i.length===0){throw new Error("Empty sub-selector")}e.push(i)}stripWhitespace(0);if(r.length===t){return t}e:while(t ":" > ";case n.SelectorType.Parent:return r===0?"< ":" < ";case n.SelectorType.Sibling:return r===0?"~ ":" ~ ";case n.SelectorType.Adjacent:return r===0?"+ ":" + ";case n.SelectorType.Descendant:return" ";case n.SelectorType.ColumnCombinator:return r===0?"|| ":" || ";case n.SelectorType.Universal:return e.namespace==="*"&&r+10?a+e.slice(t):e}},5615:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AttributeAction=r.IgnoreCaseMode=r.SelectorType=void 0;var t;(function(e){e["Attribute"]="attribute";e["Pseudo"]="pseudo";e["PseudoElement"]="pseudo-element";e["Tag"]="tag";e["Universal"]="universal";e["Adjacent"]="adjacent";e["Child"]="child";e["Descendant"]="descendant";e["Parent"]="parent";e["Sibling"]="sibling";e["ColumnCombinator"]="column-combinator"})(t=r.SelectorType||(r.SelectorType={}));r.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:true,CaseSensitive:false};var a;(function(e){e["Any"]="any";e["Element"]="element";e["End"]="end";e["Equals"]="equals";e["Exists"]="exists";e["Hyphen"]="hyphen";e["Not"]="not";e["Start"]="start"})(a=r.AttributeAction||(r.AttributeAction={}))},7537:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeNames=r.elementNames=void 0;r.elementNames=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);r.attributeNames=new Map([["definitionurl","definitionURL"],["attributename","attributeName"],["attributetype","attributeType"],["basefrequency","baseFrequency"],["baseprofile","baseProfile"],["calcmode","calcMode"],["clippathunits","clipPathUnits"],["diffuseconstant","diffuseConstant"],["edgemode","edgeMode"],["filterunits","filterUnits"],["glyphref","glyphRef"],["gradienttransform","gradientTransform"],["gradientunits","gradientUnits"],["kernelmatrix","kernelMatrix"],["kernelunitlength","kernelUnitLength"],["keypoints","keyPoints"],["keysplines","keySplines"],["keytimes","keyTimes"],["lengthadjust","lengthAdjust"],["limitingconeangle","limitingConeAngle"],["markerheight","markerHeight"],["markerunits","markerUnits"],["markerwidth","markerWidth"],["maskcontentunits","maskContentUnits"],["maskunits","maskUnits"],["numoctaves","numOctaves"],["pathlength","pathLength"],["patterncontentunits","patternContentUnits"],["patterntransform","patternTransform"],["patternunits","patternUnits"],["pointsatx","pointsAtX"],["pointsaty","pointsAtY"],["pointsatz","pointsAtZ"],["preservealpha","preserveAlpha"],["preserveaspectratio","preserveAspectRatio"],["primitiveunits","primitiveUnits"],["refx","refX"],["refy","refY"],["repeatcount","repeatCount"],["repeatdur","repeatDur"],["requiredextensions","requiredExtensions"],["requiredfeatures","requiredFeatures"],["specularconstant","specularConstant"],["specularexponent","specularExponent"],["spreadmethod","spreadMethod"],["startoffset","startOffset"],["stddeviation","stdDeviation"],["stitchtiles","stitchTiles"],["surfacescale","surfaceScale"],["systemlanguage","systemLanguage"],["tablevalues","tableValues"],["targetx","targetX"],["targety","targetY"],["textlength","textLength"],["viewbox","viewBox"],["viewtarget","viewTarget"],["xchannelselector","xChannelSelector"],["ychannelselector","yChannelSelector"],["zoomandpan","zoomAndPan"]])},4614:function(e,r,t){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0){n+=render(e.children,r)}if(r.xmlMode||!p.has(e.name)){n+=""}}return n}function renderDirective(e){return"<"+e.data+">"}function renderText(e,r){var t=e.data||"";if(r.decodeEntities!==false&&!(!r.xmlMode&&e.parent&&c.has(e.parent.name))){t=u.encodeXML(t)}return t}function renderCdata(e){return""}function renderComment(e){return"\x3c!--"+e.data+"--\x3e"}},9391:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Doctype=r.CDATA=r.Tag=r.Style=r.Script=r.Comment=r.Directive=r.Text=r.Root=r.isTag=r.ElementType=void 0;var t;(function(e){e["Root"]="root";e["Text"]="text";e["Directive"]="directive";e["Comment"]="comment";e["Script"]="script";e["Style"]="style";e["Tag"]="tag";e["CDATA"]="cdata";e["Doctype"]="doctype"})(t=r.ElementType||(r.ElementType={}));function isTag(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}r.isTag=isTag;r.Root=t.Root;r.Text=t.Text;r.Directive=t.Directive;r.Comment=t.Comment;r.Script=t.Script;r.Style=t.Style;r.Tag=t.Tag;r.CDATA=t.CDATA;r.Doctype=t.Doctype},2472:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.DomHandler=void 0;var i=t(9391);var o=t(1508);n(t(1508),r);var s=/\s+/g;var u={normalizeWhitespace:false,withStartIndices:false,withEndIndices:false,xmlMode:false};var l=function(){function DomHandler(e,r,t){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof r==="function"){t=r;r=u}if(typeof e==="object"){r=e;e=undefined}this.callback=e!==null&&e!==void 0?e:null;this.options=r!==null&&r!==void 0?r:u;this.elementCB=t!==null&&t!==void 0?t:null}DomHandler.prototype.onparserinit=function(e){this.parser=e};DomHandler.prototype.onreset=function(){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null};DomHandler.prototype.onend=function(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)};DomHandler.prototype.onerror=function(e){this.handleCallback(e)};DomHandler.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(e)};DomHandler.prototype.onopentag=function(e,r){var t=this.options.xmlMode?i.ElementType.Tag:undefined;var a=new o.Element(e,r,undefined,t);this.addNode(a);this.tagStack.push(a)};DomHandler.prototype.ontext=function(e){var r=this.options.normalizeWhitespace;var t=this.lastNode;if(t&&t.type===i.ElementType.Text){if(r){t.data=(t.data+e).replace(s," ")}else{t.data+=e}if(this.options.withEndIndices){t.endIndex=this.parser.endIndex}}else{if(r){e=e.replace(s," ")}var a=new o.Text(e);this.addNode(a);this.lastNode=a}};DomHandler.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=e;return}var r=new o.Comment(e);this.addNode(r);this.lastNode=r};DomHandler.prototype.oncommentend=function(){this.lastNode=null};DomHandler.prototype.oncdatastart=function(){var e=new o.Text("");var r=new o.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(r);e.parent=r;this.lastNode=e};DomHandler.prototype.oncdataend=function(){this.lastNode=null};DomHandler.prototype.onprocessinginstruction=function(e,r){var t=new o.ProcessingInstruction(e,r);this.addNode(t)};DomHandler.prototype.handleCallback=function(e){if(typeof this.callback==="function"){this.callback(e,this.dom)}else if(e){throw e}};DomHandler.prototype.addNode=function(e){var r=this.tagStack[this.tagStack.length-1];var t=r.children[r.children.length-1];if(this.options.withStartIndices){e.startIndex=this.parser.startIndex}if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}r.children.push(e);if(t){e.prev=t;t.next=e}e.parent=r;this.lastNode=null};return DomHandler}();r.DomHandler=l;r["default"]=l},1508:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0?this.children[this.children.length-1]:null},enumerable:false,configurable:true});Object.defineProperty(NodeWithChildren.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:false,configurable:true});return NodeWithChildren}(s);r.NodeWithChildren=d;var f=function(e){a(Document,e);function Document(r){return e.call(this,i.ElementType.Root,r)||this}return Document}(d);r.Document=f;var g=function(e){a(Element,e);function Element(r,t,a,n){if(a===void 0){a=[]}if(n===void 0){n=r==="script"?i.ElementType.Script:r==="style"?i.ElementType.Style:i.ElementType.Tag}var o=e.call(this,n,a)||this;o.name=r;o.attribs=t;return o}Object.defineProperty(Element.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:false,configurable:true});Object.defineProperty(Element.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(r){var t,a;return{name:r,value:e.attribs[r],namespace:(t=e["x-attribsNamespace"])===null||t===void 0?void 0:t[r],prefix:(a=e["x-attribsPrefix"])===null||a===void 0?void 0:a[r]}}))},enumerable:false,configurable:true});return Element}(d);r.Element=g;function isTag(e){return(0,i.isTag)(e)}r.isTag=isTag;function isCDATA(e){return e.type===i.ElementType.CDATA}r.isCDATA=isCDATA;function isText(e){return e.type===i.ElementType.Text}r.isText=isText;function isComment(e){return e.type===i.ElementType.Comment}r.isComment=isComment;function isDirective(e){return e.type===i.ElementType.Directive}r.isDirective=isDirective;function isDocument(e){return e.type===i.ElementType.Root}r.isDocument=isDocument;function hasChildren(e){return Object.prototype.hasOwnProperty.call(e,"children")}r.hasChildren=hasChildren;function cloneNode(e,r){if(r===void 0){r=false}var t;if(isText(e)){t=new l(e.data)}else if(isComment(e)){t=new c(e.data)}else if(isTag(e)){var a=r?cloneChildren(e.children):[];var o=new g(e.name,n({},e.attribs),a);a.forEach((function(e){return e.parent=o}));if(e.namespace!=null){o.namespace=e.namespace}if(e["x-attribsNamespace"]){o["x-attribsNamespace"]=n({},e["x-attribsNamespace"])}if(e["x-attribsPrefix"]){o["x-attribsPrefix"]=n({},e["x-attribsPrefix"])}t=o}else if(isCDATA(e)){var a=r?cloneChildren(e.children):[];var s=new d(i.ElementType.CDATA,a);a.forEach((function(e){return e.parent=s}));t=s}else if(isDocument(e)){var a=r?cloneChildren(e.children):[];var u=new f(a);a.forEach((function(e){return e.parent=u}));if(e["x-mode"]){u["x-mode"]=e["x-mode"]}t=u}else if(isDirective(e)){var h=new p(e.name,e.data);if(e["x-name"]!=null){h["x-name"]=e["x-name"];h["x-publicId"]=e["x-publicId"];h["x-systemId"]=e["x-systemId"]}t=h}else{throw new Error("Not implemented yet: ".concat(e.type))}t.startIndex=e.startIndex;t.endIndex=e.endIndex;if(e.sourceCodeLocation!=null){t.sourceCodeLocation=e.sourceCodeLocation}return t}r.cloneNode=cloneNode;function cloneChildren(e){var r=e.map((function(e){return cloneNode(e,true)}));for(var t=1;t=0){var t=e[r];if(r>0&&e.lastIndexOf(t,r-1)>=0){e.splice(r,1);continue}for(var a=t.parent;a;a=a.parent){if(e.includes(a)){e.splice(r,1);break}}}return e}r.removeSubsets=removeSubsets;function compareDocumentPosition(e,r){var t=[];var n=[];if(e===r){return 0}var i=(0,a.hasChildren)(e)?e:e.parent;while(i){t.unshift(i);i=i.parent}i=(0,a.hasChildren)(r)?r:r.parent;while(i){n.unshift(i);i=i.parent}var o=Math.min(t.length,n.length);var s=0;while(sl.indexOf(p)){if(u===r){return 4|16}return 4}if(u===e){return 2|8}return 2}r.compareDocumentPosition=compareDocumentPosition;function uniqueSort(e){e=e.filter((function(e,r,t){return!t.includes(e,r+1)}));e.sort((function(e,r){var t=compareDocumentPosition(e,r);if(t&2){return-1}else if(t&4){return 1}return 0}));return e}r.uniqueSort=uniqueSort},5861:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;Object.defineProperty(e,a,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.hasChildren=r.isDocument=r.isComment=r.isText=r.isCDATA=r.isTag=void 0;n(t(3930),r);n(t(8298),r);n(t(1655),r);n(t(8929),r);n(t(7102),r);n(t(5509),r);n(t(3442),r);var i=t(2472);Object.defineProperty(r,"isTag",{enumerable:true,get:function(){return i.isTag}});Object.defineProperty(r,"isCDATA",{enumerable:true,get:function(){return i.isCDATA}});Object.defineProperty(r,"isText",{enumerable:true,get:function(){return i.isText}});Object.defineProperty(r,"isComment",{enumerable:true,get:function(){return i.isComment}});Object.defineProperty(r,"isDocument",{enumerable:true,get:function(){return i.isDocument}});Object.defineProperty(r,"hasChildren",{enumerable:true,get:function(){return i.hasChildren}})},7102:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getElementsByTagType=r.getElementsByTagName=r.getElementById=r.getElements=r.testElement=void 0;var a=t(2472);var n=t(8929);var i={tag_name:function(e){if(typeof e==="function"){return function(r){return(0,a.isTag)(r)&&e(r.name)}}else if(e==="*"){return a.isTag}return function(r){return(0,a.isTag)(r)&&r.name===e}},tag_type:function(e){if(typeof e==="function"){return function(r){return e(r.type)}}return function(r){return r.type===e}},tag_contains:function(e){if(typeof e==="function"){return function(r){return(0,a.isText)(r)&&e(r.data)}}return function(r){return(0,a.isText)(r)&&r.data===e}}};function getAttribCheck(e,r){if(typeof r==="function"){return function(t){return(0,a.isTag)(t)&&r(t.attribs[e])}}return function(t){return(0,a.isTag)(t)&&t.attribs[e]===r}}function combineFuncs(e,r){return function(t){return e(t)||r(t)}}function compileTest(e){var r=Object.keys(e).map((function(r){var t=e[r];return Object.prototype.hasOwnProperty.call(i,r)?i[r](t):getAttribCheck(r,t)}));return r.length===0?null:r.reduce(combineFuncs)}function testElement(e,r){var t=compileTest(e);return t?t(r):true}r.testElement=testElement;function getElements(e,r,t,a){if(a===void 0){a=Infinity}var i=compileTest(e);return i?(0,n.filter)(i,r,t,a):[]}r.getElements=getElements;function getElementById(e,r,t){if(t===void 0){t=true}if(!Array.isArray(r))r=[r];return(0,n.findOne)(getAttribCheck("id",e),r,t)}r.getElementById=getElementById;function getElementsByTagName(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_name(e),r,t,a)}r.getElementsByTagName=getElementsByTagName;function getElementsByTagType(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_type(e),r,t,a)}r.getElementsByTagType=getElementsByTagType},1655:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prepend=r.prependChild=r.append=r.appendChild=r.replaceElement=r.removeElement=void 0;function removeElement(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){var r=e.parent.children;r.splice(r.lastIndexOf(e),1)}}r.removeElement=removeElement;function replaceElement(e,r){var t=r.prev=e.prev;if(t){t.next=r}var a=r.next=e.next;if(a){a.prev=r}var n=r.parent=e.parent;if(n){var i=n.children;i[i.lastIndexOf(e)]=r}}r.replaceElement=replaceElement;function appendChild(e,r){removeElement(r);r.next=null;r.parent=e;if(e.children.push(r)>1){var t=e.children[e.children.length-2];t.next=r;r.prev=t}else{r.prev=null}}r.appendChild=appendChild;function append(e,r){removeElement(r);var t=e.parent;var a=e.next;r.next=a;r.prev=e;e.next=r;r.parent=t;if(a){a.prev=r;if(t){var n=t.children;n.splice(n.lastIndexOf(a),0,r)}}else if(t){t.children.push(r)}}r.append=append;function prependChild(e,r){removeElement(r);r.parent=e;r.prev=null;if(e.children.unshift(r)!==1){var t=e.children[1];t.prev=r;r.next=t}else{r.next=null}}r.prependChild=prependChild;function prepend(e,r){removeElement(r);var t=e.parent;if(t){var a=t.children;a.splice(a.indexOf(e),0,r)}if(e.prev){e.prev.next=r}r.parent=t;r.prev=e.prev;r.next=e;e.prev=r}r.prepend=prepend},8929:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.findAll=r.existsOne=r.findOne=r.findOneChild=r.find=r.filter=void 0;var a=t(2472);function filter(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}if(!Array.isArray(r))r=[r];return find(e,r,t,a)}r.filter=filter;function find(e,r,t,n){var i=[];for(var o=0,s=r;o0){var l=find(e,u.children,t,n);i.push.apply(i,l);n-=l.length;if(n<=0)break}}return i}r.find=find;function findOneChild(e,r){return r.find(e)}r.findOneChild=findOneChild;function findOne(e,r,t){if(t===void 0){t=true}var n=null;for(var i=0;i0){n=findOne(e,o.children)}}return n}r.findOne=findOne;function existsOne(e,r){return r.some((function(r){return(0,a.isTag)(r)&&(e(r)||r.children.length>0&&existsOne(e,r.children))}))}r.existsOne=existsOne;function findAll(e,r){var t;var n=[];var i=r.filter(a.isTag);var o;while(o=i.shift()){var s=(t=o.children)===null||t===void 0?void 0:t.filter(a.isTag);if(s&&s.length>0){i.unshift.apply(i,s)}if(e(o))n.push(o)}return n}r.findAll=findAll},3930:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.innerText=r.textContent=r.getText=r.getInnerHTML=r.getOuterHTML=void 0;var n=t(2472);var i=a(t(4614));var o=t(9391);function getOuterHTML(e,r){return(0,i.default)(e,r)}r.getOuterHTML=getOuterHTML;function getInnerHTML(e,r){return(0,n.hasChildren)(e)?e.children.map((function(e){return getOuterHTML(e,r)})).join(""):""}r.getInnerHTML=getInnerHTML;function getText(e){if(Array.isArray(e))return e.map(getText).join("");if((0,n.isTag)(e))return e.name==="br"?"\n":getText(e.children);if((0,n.isCDATA)(e))return getText(e.children);if((0,n.isText)(e))return e.data;return""}r.getText=getText;function textContent(e){if(Array.isArray(e))return e.map(textContent).join("");if((0,n.hasChildren)(e)&&!(0,n.isComment)(e)){return textContent(e.children)}if((0,n.isText)(e))return e.data;return""}r.textContent=textContent;function innerText(e){if(Array.isArray(e))return e.map(innerText).join("");if((0,n.hasChildren)(e)&&(e.type===o.ElementType.Tag||(0,n.isCDATA)(e))){return innerText(e.children)}if((0,n.isText)(e))return e.data;return""}r.innerText=innerText},8298:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prevElementSibling=r.nextElementSibling=r.getName=r.hasAttrib=r.getAttributeValue=r.getSiblings=r.getParent=r.getChildren=void 0;var a=t(2472);var n=[];function getChildren(e){var r;return(r=e.children)!==null&&r!==void 0?r:n}r.getChildren=getChildren;function getParent(e){return e.parent||null}r.getParent=getParent;function getSiblings(e){var r,t;var a=getParent(e);if(a!=null)return getChildren(a);var n=[e];var i=e.prev,o=e.next;while(i!=null){n.unshift(i);r=i,i=r.prev}while(o!=null){n.push(o);t=o,o=t.next}return n}r.getSiblings=getSiblings;function getAttributeValue(e,r){var t;return(t=e.attribs)===null||t===void 0?void 0:t[r]}r.getAttributeValue=getAttributeValue;function hasAttrib(e,r){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,r)&&e.attribs[r]!=null}r.hasAttrib=hasAttrib;function getName(e){return e.name}r.getName=getName;function nextElementSibling(e){var r;var t=e.next;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.next;return t}r.nextElementSibling=nextElementSibling;function prevElementSibling(e){var r;var t=e.prev;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.prev;return t}r.prevElementSibling=prevElementSibling},6674:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(1859));var i=a(t(2128));var o=a(t(4931));var s=a(t(9281));r.decodeXML=getStrictDecoder(o.default);r.decodeHTMLStrict=getStrictDecoder(n.default);function getStrictDecoder(e){var r=Object.keys(e).join("|");var t=getReplacer(e);r+="|#[xX][\\da-fA-F]+|#\\d+";var a=new RegExp("&(?:"+r+");","g");return function(e){return String(e).replace(a,t)}}var sorter=function(e,r){return e=55296&&e<=57343||e>1114111){return"�"}if(e in n.default){e=n.default[e]}var r="";if(e>65535){e-=65536;r+=String.fromCharCode(e>>>10&1023|55296);e=56320|e&1023}r+=String.fromCharCode(e);return r}r["default"]=decodeCodePoint},6032:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(4931));var i=getInverseObj(n.default);var o=getInverseReplacer(i);r.encodeXML=getInverse(i,o);var s=a(t(1859));var u=getInverseObj(s.default);var l=getInverseReplacer(u);r.encodeHTML=getInverse(u,l);function getInverseObj(e){return Object.keys(e).sort().reduce((function(r,t){r[e[t]]="&"+t+";";return r}),{})}function getInverseReplacer(e){var r=[];var t=[];Object.keys(e).forEach((function(e){return e.length===1?r.push("\\"+e):t.push(e)}));t.unshift("["+r.join("")+"]");return new RegExp(t.join("|"),"g")}var c=/[^\0-\x7F]/g;var p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function singleCharReplacer(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(e,r){var t=e.charCodeAt(0);var a=e.charCodeAt(1);var n=(t-55296)*1024+a-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}function getInverse(e,r){return function(t){return t.replace(r,(function(r){return e[r]})).replace(p,astralReplacer).replace(c,singleCharReplacer)}}var d=getInverseReplacer(i);function escape(e){return e.replace(d,singleCharReplacer).replace(p,astralReplacer).replace(c,singleCharReplacer)}r.escape=escape},9280:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(6674);var n=t(6032);function decode(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTML)(e)}r.decode=decode;function decodeStrict(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTMLStrict)(e)}r.decodeStrict=decodeStrict;function encode(e,r){return(!r||r<=0?n.encodeXML:n.encodeHTML)(e)}r.encode=encode;var i=t(6032);r.encodeXML=i.encodeXML;r.encodeHTML=i.encodeHTML;r.escape=i.escape;r.encodeHTML4=i.encodeHTML;r.encodeHTML5=i.encodeHTML;var o=t(6674);r.decodeXML=o.decodeXML;r.decodeHTML=o.decodeHTML;r.decodeHTMLStrict=o.decodeHTMLStrict;r.decodeHTML4=o.decodeHTML;r.decodeHTML5=o.decodeHTML;r.decodeHTML4Strict=o.decodeHTMLStrict;r.decodeHTML5Strict=o.decodeHTMLStrict;r.decodeXMLStrict=o.decodeXML},5902:function(e,r,t){e=t.nmd(e); -/*! https://mths.be/he v1.2.0 by @mathias | MIT license */(function(t){var a=true&&r;var n=true&&e&&e.exports==a&&e;var i=typeof global=="object"&&global;if(i.global===i||i.window===i){t=i}var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var s=/[\x01-\x7F]/g;var u=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;var l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;var c={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"};var p=/["&'<>`]/g;var d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"};var f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;var g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var h=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;var m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"};var v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"};var b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var y=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var w=String.fromCharCode;var T={};var E=T.hasOwnProperty;var has=function(e,r){return E.call(e,r)};var contains=function(e,r){var t=-1;var a=e.length;while(++t=55296&&e<=57343||e>1114111){if(r){parseError("character reference outside the permissible Unicode range")}return"�"}if(has(b,e)){if(r){parseError("disallowed character reference")}return b[e]}if(r&&contains(y,e)){parseError("disallowed character reference")}if(e>65535){e-=65536;t+=w(e>>>10&1023|55296);e=56320|e&1023}t+=w(e);return t};var hexEscape=function(e){return"&#x"+e.toString(16).toUpperCase()+";"};var decEscape=function(e){return"&#"+e+";"};var parseError=function(e){throw Error("Parse error: "+e)};var encode=function(e,r){r=merge(r,encode.options);var t=r.strict;if(t&&g.test(e)){parseError("forbidden code point")}var a=r.encodeEverything;var n=r.useNamedReferences;var i=r.allowUnsafeSymbols;var d=r.decimal?decEscape:hexEscape;var escapeBmpSymbol=function(e){return d(e.charCodeAt(0))};if(a){e=e.replace(s,(function(e){if(n&&has(c,e)){return"&"+c[e]+";"}return escapeBmpSymbol(e)}));if(n){e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")}if(n){e=e.replace(l,(function(e){return"&"+c[e]+";"}))}}else if(n){if(!i){e=e.replace(p,(function(e){return"&"+c[e]+";"}))}e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒");e=e.replace(l,(function(e){return"&"+c[e]+";"}))}else if(!i){e=e.replace(p,escapeBmpSymbol)}return e.replace(o,(function(e){var r=e.charCodeAt(0);var t=e.charCodeAt(1);var a=(r-55296)*1024+t-56320+65536;return d(a)})).replace(u,escapeBmpSymbol)};encode.options={allowUnsafeSymbols:false,encodeEverything:false,strict:false,useNamedReferences:false,decimal:false};var decode=function(e,r){r=merge(r,decode.options);var t=r.strict;if(t&&f.test(e)){parseError("malformed character reference")}return e.replace(h,(function(e,a,n,i,o,s,u,l,c){var p;var d;var f;var g;var h;var b;if(a){h=a;return m[h]}if(n){h=n;b=i;if(b&&r.isAttributeValue){if(t&&b=="="){parseError("`&` did not start a character reference")}return e}else{if(t){parseError("named character reference was not terminated by a semicolon")}return v[h]+(b||"")}}if(o){f=o;d=s;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(f,10);return codePointToSymbol(p,t)}if(u){g=u;d=l;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(g,16);return codePointToSymbol(p,t)}if(t){parseError("named character reference was not terminated by a semicolon")}return e}))};decode.options={isAttributeValue:false,strict:false};var escape=function(e){return e.replace(p,(function(e){return d[e]}))};var A={version:"1.2.0",encode:encode,decode:decode,escape:escape,unescape:decode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define((function(){return A}))}else if(a&&!a.nodeType){if(n){n.exports=A}else{for(var q in A){has(A,q)&&(a[q]=A[q])}}}else{t.he=A}})(this)},5596:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});function arr_back(e){return e[e.length-1]}r["default"]=arr_back},5417:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.NodeType=r.TextNode=r.Node=r.valid=r["default"]=r.parse=r.HTMLElement=r.CommentNode=void 0;var n=t(190);Object.defineProperty(r,"CommentNode",{enumerable:true,get:function(){return a(n).default}});var i=t(3248);Object.defineProperty(r,"HTMLElement",{enumerable:true,get:function(){return a(i).default}});var o=t(8653);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a(o).default}});Object.defineProperty(r,"default",{enumerable:true,get:function(){return a(o).default}});var s=t(3494);Object.defineProperty(r,"valid",{enumerable:true,get:function(){return a(s).default}});var u=t(7402);Object.defineProperty(r,"Node",{enumerable:true,get:function(){return a(u).default}});var l=t(111);Object.defineProperty(r,"TextNode",{enumerable:true,get:function(){return a(l).default}});var c=t(5896);Object.defineProperty(r,"NodeType",{enumerable:true,get:function(){return a(c).default}})},9958:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(5896));function isTag(e){return e&&e.nodeType===n.default.ELEMENT_NODE}function getAttributeValue(e,r){return isTag(e)?e.getAttribute(r):undefined}function getName(e){return(e&&e.rawTagName||"").toLowerCase()}function getChildren(e){return e&&e.childNodes}function getParent(e){return e?e.parentNode:null}function getText(e){return e.text}function removeSubsets(e){var r=e.length;var t;var a;var n;while(--r>-1){t=a=e[r];e[r]=null;n=true;while(a){if(e.indexOf(a)>-1){n=false;e.splice(r,1);break}a=getParent(a)}if(n){e[r]=t}}return e}function existsOne(e,r){return r.some((function(r){return isTag(r)?e(r)||existsOne(e,getChildren(r)):false}))}function getSiblings(e){var r=getParent(e);return r&&getChildren(r)}function hasAttrib(e,r){return getAttributeValue(e,r)!==undefined}function findOne(e,r){var t=null;for(var a=0,n=r.length;a0){t=findOne(e,o)}}}return t}function findAll(e,r){var t=[];for(var a=0,n=r.length;a0){r.push(e=[])}t.childNodes.forEach(dfs);if(e.length>0){r.push(e=[])}}else{t.childNodes.forEach(dfs)}}else if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){e.prependWhitespace=true}else{var a=t.trimmedText;if(e.prependWhitespace){a=" ".concat(a);e.prependWhitespace=false}e.push(a)}}}dfs(this);return r.map((function(e){return e.join("").replace(/\s{2,}/g," ")})).join("\n").replace(/\s+$/,"")},enumerable:false,configurable:true});HTMLElement.prototype.toString=function(){var e=this.rawTagName;if(e){var r=this.rawAttrs?" ".concat(this.rawAttrs):"";return this.isVoidElement?"<".concat(e).concat(r,">"):"<".concat(e).concat(r,">").concat(this.innerHTML,"")}return this.innerHTML};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return this.childNodes.map((function(e){return e.toString()})).join("")},set:function(e){var r=parse(e);var t=r.childNodes.length?r.childNodes:[new f.default(e,this)];resetParent(t,this);resetParent(this.childNodes,null);this.childNodes=t},enumerable:false,configurable:true});HTMLElement.prototype.set_content=function(e,r){if(r===void 0){r={}}if(e instanceof d.default){e=[e]}else if(typeof e=="string"){var t=parse(e,r);e=t.childNodes.length?t.childNodes:[new f.default(e,this)]}resetParent(this.childNodes,null);resetParent(e,this);this.childNodes=e;return this};HTMLElement.prototype.replaceWith=function(){var e=this;var r=[];for(var t=0;t-1){t.rawText=t.rawText.substr(0,a);this.childNodes.length=r+1}}}return this};Object.defineProperty(HTMLElement.prototype,"structure",{get:function(){var e=[];var r=0;function write(t){e.push(" ".repeat(r)+t)}function dfs(e){var t=e.id?"#".concat(e.id):"";var a=e.classList.length?".".concat(e.classList.value.join(".")):"";write("".concat(e.rawTagName).concat(t).concat(a));r++;e.childNodes.forEach((function(e){if(e.nodeType===g.default.ELEMENT_NODE){dfs(e)}else if(e.nodeType===g.default.TEXT_NODE){if(!e.isWhitespace){write("#text")}}}));r--}dfs(this);return e.join("\n")},enumerable:false,configurable:true});HTMLElement.prototype.removeWhitespace=function(){var e=this;var r=0;this.childNodes.forEach((function(t){if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){return}t.rawText=t.trimmedRawText}else if(t.nodeType===g.default.ELEMENT_NODE){t.removeWhitespace()}e.childNodes[r++]=t}));this.childNodes.length=r;return this};HTMLElement.prototype.querySelectorAll=function(e){return(0,s.selectAll)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.querySelector=function(e){return(0,s.selectOne)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.getElementsByTagName=function(e){var r=e.toUpperCase();var t=[];var a=[];var n=this;var i=0;while(i!==undefined){var o=void 0;do{o=n.childNodes[i++]}while(i0){a.push(i);n=o;i=0}}}return t};HTMLElement.prototype.getElementById=function(e){var r=[];var t=this;var a=0;while(a!==undefined){var n=void 0;do{n=t.childNodes[a++]}while(a0){r.push(a);t=n;a=0}}}return null};HTMLElement.prototype.closest=function(e){var r=new Map;var t=this;var a=null;function findOne(e,t){var a=null;for(var n=0,i=t.length;n0){var t=e[--r];if(this===t)return e[r-1]||null}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"previousElementSibling",{get:function(){if(this.parentNode){var e=this.parentNode.childNodes;var r=e.length;var t=false;while(r>0){var a=e[--r];if(t){if(a instanceof HTMLElement){return a||null}}else if(this===a){t=true}}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"classNames",{get:function(){return this.classList.toString()},enumerable:false,configurable:true});HTMLElement.prototype.clone=function(){return parse(this.toString()).firstChild};return HTMLElement}(d.default);r["default"]=A;var q=/|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g;var x=/(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;var D={area:true,AREA:true,base:true,BASE:true,br:true,BR:true,col:true,COL:true,hr:true,HR:true,img:true,IMG:true,input:true,INPUT:true,link:true,LINK:true,meta:true,META:true,source:true,SOURCE:true,embed:true,EMBED:true,param:true,PARAM:true,track:true,TRACK:true,wbr:true,WBR:true};var C={li:{li:true,LI:true},LI:{li:true,LI:true},p:{p:true,div:true,P:true,DIV:true},P:{p:true,div:true,P:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},td:{td:true,th:true,TD:true,TH:true},TD:{td:true,th:true,TD:true,TH:true},th:{td:true,th:true,TD:true,TH:true},TH:{td:true,th:true,TD:true,TH:true},h1:{h1:true,H1:true},H1:{h1:true,H1:true},h2:{h2:true,H2:true},H2:{h2:true,H2:true},h3:{h3:true,H3:true},H3:{h3:true,H3:true},h4:{h4:true,H4:true},H4:{h4:true,H4:true},h5:{h5:true,H5:true},H5:{h5:true,H5:true},h6:{h6:true,H6:true},H6:{h6:true,H6:true}};var N={li:{ul:true,ol:true,UL:true,OL:true},LI:{ul:true,ol:true,UL:true,OL:true},a:{div:true,DIV:true},A:{div:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},i:{div:true,DIV:true},I:{div:true,DIV:true},p:{div:true,DIV:true},P:{div:true,DIV:true},td:{tr:true,table:true,TR:true,TABLE:true},TD:{tr:true,table:true,TR:true,TABLE:true},th:{tr:true,table:true,TR:true,TABLE:true},TH:{tr:true,table:true,TR:true,TABLE:true}};var S="documentfragmentcontainer";function base_parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=r.blockTextElements||{script:true,noscript:true,style:true,pre:true};var a=Object.keys(t);var n=a.map((function(e){return new RegExp("^".concat(e,"$"),"i")}));var i=a.filter((function(e){return t[e]})).map((function(e){return new RegExp("^".concat(e,"$"),"i")}));function element_should_be_ignore(e){return i.some((function(r){return r.test(e)}))}function is_block_text_element(e){return n.some((function(r){return r.test(e)}))}var createRange=function(e,r){return[e-v,r-v]};var o=new A(null,{},"",null,[0,e.length]);var s=o;var u=[o];var c=-1;var d=undefined;var g;e="<".concat(S,">").concat(e,"");var h=r.lowerCaseTagName;var m=e.length-(S.length+2);var v=S.length+2;while(g=q.exec(e)){var b=g[0],y=g[1],w=g[2],T=g[3],E=g[4];var L=b.length;var k=q.lastIndex-L;var O=q.lastIndex;if(c>-1){if(c+L");var I=h?e.toLocaleLowerCase().indexOf(U,q.lastIndex):e.indexOf(U,q.lastIndex);var G=I===-1?m:I;if(element_should_be_ignore(w)){var _=e.substring(F,G);if(_.length>0&&/\S/.test(_)){s.appendChild(new f.default(_,s,createRange(F,G)))}}if(I===-1){c=q.lastIndex=e.length+1}else{c=q.lastIndex=I+U.length;y="/"}}}if(y||E||D[w]){while(true){if(w==="a"||w==="A")d=undefined;if(s.rawTagName===w){s.range[1]=createRange(-1,Math.max(c,O))[1];u.pop();s=(0,l.default)(u);break}else{var H=s.tagName;if(N[H]){if(N[H][w]){u.pop();s=(0,l.default)(u);continue}}break}}}}return u}r.base_parse=base_parse;function parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=base_parse(e,r);var a=t[0];var _loop_1=function(){var e=t.pop();var a=(0,l.default)(t);if(e.parentNode&&e.parentNode.parentNode){if(e.parentNode===a&&e.tagName===a.tagName){if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.parentNode.appendChild(e)}));t.pop()}}else{if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.appendChild(e)}))}}}else{}};while(t.length>1){_loop_1()}return a}r.parse=parse;function resetParent(e,r){return e.map((function(e){e.parentNode=r;return e}))}},7402:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(5902);var n=function(){function Node(e,r){if(e===void 0){e=null}this.parentNode=e;this.childNodes=[];Object.defineProperty(this,"range",{enumerable:false,writable:true,configurable:true,value:r!==null&&r!==void 0?r:[-1,-1]})}Node.prototype.remove=function(){var e=this;if(this.parentNode){var r=this.parentNode.childNodes;this.parentNode.childNodes=r.filter((function(r){return e!==r}));this.parentNode=null}return this};Object.defineProperty(Node.prototype,"innerText",{get:function(){return this.rawText},enumerable:false,configurable:true});Object.defineProperty(Node.prototype,"textContent",{get:function(){return(0,a.decode)(this.rawText)},set:function(e){this.rawText=(0,a.encode)(e)},enumerable:false,configurable:true});return Node}();r["default"]=n},111:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var i=t(5902);var o=n(t(7402));var s=n(t(5896));var u=function(e){a(TextNode,e);function TextNode(r,t,a){var n=e.call(this,t,a)||this;n.nodeType=s.default.TEXT_NODE;n._rawText=r;return n}TextNode.prototype.clone=function(){return new TextNode(this._rawText,null)};Object.defineProperty(TextNode.prototype,"rawText",{get:function(){return this._rawText},set:function(e){this._rawText=e;this._trimmedRawText=void 0;this._trimmedText=void 0},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedRawText",{get:function(){if(this._trimmedRawText!==undefined)return this._trimmedRawText;this._trimmedRawText=trimText(this.rawText);return this._trimmedRawText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedText",{get:function(){if(this._trimmedText!==undefined)return this._trimmedText;this._trimmedText=trimText(this.text);return this._trimmedText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"text",{get:function(){return(0,i.decode)(this.rawText)},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"isWhitespace",{get:function(){return/^(\s| )*$/.test(this.rawText)},enumerable:false,configurable:true});TextNode.prototype.toString=function(){return this.rawText};return TextNode}(o.default);r["default"]=u;function trimText(e){var r=0;var t;var a;while(r>=0&&r0&&/[^\S\r\n]/.test(e[t-1]);var i=a=t};var a=Math.abs(r);var i=(t%a+a)%a;return r>1?function(e){return e>=t&&e%a===i}:function(e){return e<=t&&e%a===i}}r.compile=compile;function generate(e){var r=e[0];var t=e[1]-1;var a=0;if(r<0){var n=-r;var i=(t%n+n)%n;return function(){var e=i+n*a++;return e>t?null:e}}if(r===0)return t<0?function(){return null}:function(){return a++===0?t:null};if(t<0){t+=r*Math.ceil(-t/r)}return function(){return r*a+++t}}r.generate=generate},7118:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.sequence=r.generate=r.compile=r.parse=void 0;var a=t(2421);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a.parse}});var n=t(3947);Object.defineProperty(r,"compile",{enumerable:true,get:function(){return n.compile}});Object.defineProperty(r,"generate",{enumerable:true,get:function(){return n.generate}});function nthCheck(e){return(0,n.compile)((0,a.parse)(e))}r["default"]=nthCheck;function sequence(e){return(0,n.generate)((0,a.parse)(e))}r.sequence=sequence},2421:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=void 0;var t=new Set([9,10,12,13,32]);var a="0".charCodeAt(0);var n="9".charCodeAt(0);function parse(e){e=e.trim().toLowerCase();if(e==="even"){return[2,0]}else if(e==="odd"){return[2,1]}var r=0;var i=0;var o=readSign();var s=readNumber();if(r=a&&e.charCodeAt(r)<=n){i=i*10+(e.charCodeAt(r)-a);r++}return r===t?null:i}function skipWhitespace(){while(r","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},2128:function(e){"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},4931:function(e){"use strict";e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')}};var r={};function __nccwpck_require__(t){var a=r[t];if(a!==undefined){return a.exports}var n=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(n.exports,n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}n.loaded=true;return n.exports}!function(){__nccwpck_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(5417);module.exports=t})(); \ No newline at end of file +const { readFileSync, writeFileSync } = require('fs'), { Script } = require('vm'), { wrap } = require('module'); +const basename = __dirname + '/index.js'; +const source = readFileSync(basename + '.cache.js', 'utf-8'); +const cachedData = !process.pkg && require('process').platform !== 'win32' && readFileSync(basename + '.cache'); +const scriptOpts = { filename: basename + '.cache.js', columnOffset: -62 } +const script = new Script(wrap(source), cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts); +(script.runInThisContext())(exports, require, module, __filename, __dirname); +if (cachedData) process.on('exit', () => { try { writeFileSync(basename + '.cache', script.createCachedData()); } catch(e) {} }); diff --git a/packages/next/src/compiled/node-html-parser/index.js.cache b/packages/next/src/compiled/node-html-parser/index.js.cache index 246a152327487dda6b28167400575ec302cd3aed..8298cd5c8ab4ecc8be9b8225fd5aaa576f60334d 100644 GIT binary patch delta 5325 zcmbtYdt6i39Y6Qpgj|wb2#-L>36KDR5CTLXV0=t#?KU4>ePOMS3L;J@z8_sb>bUBB zGbJ3_`l*&hXBFwXcGEgL`{}&Sb=rsX*=eh7{nT}Soa^l7KGLr1XTRUQ0Yb#Tc0Syj ze9!Ov9_RNuCme6M*^oI$|MBs4;f8?WpFAl|{zK>43PR|Z&u4Rv$y{D2lNv)@YYl<% z86O%|;#+C!Xy*Xc;}i_eJh66EH7&=vrRogKrB1AybcLH8+WmNTgKD*n-2cWHZ;d#SYTwUI45_T z?dHmpcp@T?g%DUq^Cn1&H$XHRIQ1L#o~}-h%wE8r-QZ(D9IXb#Y-lh-R37E#2rw51PdzCigGnVk zen5oOTn9J(w-iEQHZ0+4!<&dj2h%-Ebhfryp7e>H2sAB>-^4WxDGjlSny{h56JW%dRcM%c%2$s z`}hc3&_8GZwicM{X%)XUP3CiCmS}eHd^;;P+ihBx4wV7)*8wZzF1(6b?_5e&_dB-PI#d`k` zkkI_8300{vfjI&stepaGBRie2Nk0Uv?PAr50iJJVEs6JS?l-W0N5sxEiEckR4il>9 z-)z&&3zi3aTo|1Jr(s!-3#%*^ohLM}kd3nx=j8OIVpJ~d*w1(Dhg64rZ)a_m!|5@* zeGkN`y#~AYlB82{CF{DnI>T&4a-LDmC+y-@wjenG)${Y@EnF5WPRX4mqOnnG!sqx4 z=Xf>QfzqG0>pXw%`~zsmF7O*K@I;}Y z)mH+17}VBu&1-`K{(b>5t~6o zQej%MA1tf6^$sD9^B`nOXki0enbu_N>ptv8niB$~PtS#SVS4UJ)tzeWP%n&gyM+Jj z5+Fj`b_+*#;}-%=vcE~!cMJC-B-WCi5t}QOV3A~wIPq-yq;j>ds6rqDS2H3Js0;*f zE~Y@n19MMfYp|toL)jYJ2tLQd-m=+ai+D1u?Wue|V{(~sZx|)2fu27+60TsmddS6u zYep37u8exWc6GoE>Fh20;6NEt2aFpddmC*ZD;S|Sh3pQV3$s`4xehX2)_m1-l3lqV zY`vtqQDk4(Gn!-UXaaGYv~$|h%30d`ozX#328Xa(-K6G)TZDZ7HVB78OH;Q=$dyaN zx(`tJCm#qeUskoK1;Ux1t<{Az2lNQh6kB>P2rEHzPlMP?pL7`aqUWM&>CC6X8`p(6 z4vzt zi^IyUI98Yw2+tQ?#4Tab1n!OMpAKih6zOnk=bGvC6+`)<%5I*R@d7s} zsJS&J9B+V1?Zi)Ir=4;|iMOkhfTv{Oj#9sVzxdGsRR6aF;^zlr)vs}3`#$7yr}o?c zes@^h_PU5&fU~mOuGLwpv0%orBjP(pL~KiVl?ElBhLX zU%H@*NRZj^yj-Ix4D(=Ay@xgC`9%H+!a+MPW*tD&ZzYe6fa$;Q^*PgtZ9-oKx)SS8qss<014i&}yNoyW%J z6}h>Itfk27eNN}^U4pG*IV{2OOgc~IVR0>7Fc;p07_P8SihPNLr0Y(~u%zs3jwBpp zcHhtu&%uwRozPEU79RY>!DVLF&(bDD1U>_XUH0~K>It35s5lC8|)z(Ze3bgepdTJECJC3$j)3YYp z>7p%<(W5!^te=Lf=uJv5Q+nqxNB7O3mu+-+9ewjjy4gza&ZFMwxa{=9#PjBbblWuxPqQ^b-xQ%}EFAF`Zqo-W-qMzQ)r#C*vj?*D95NVoDkqvqT@kFxoiY&$fyIoX0B8=6|CBBvw)XujtnQe3hkrzRsQ zmq@SXDY7*MftyI3ATBKxK>?9&=oLBLilC54OTi1aGz3LN+5oaM(h(FB=`U%DY_}mO zCDL242bzIk5RsmaQ)Gu7K{=7G=O}U}ZAKIz()2_{&T=5AB2pvRot=pwNTg)&k24Fw zP$E49#<{W)3@1`+x+3Q|5sV<2YIFM`QL zdLN=%T!f&SNc+J%B|Zd?6X_|~TWK+ZCx~pOK YJ>T05bwI|^s)|;dqjujUW|KDl2Lc^Z^#A|> delta 5202 zcmZ`-3vg7`89w)s-Mfz@n`C#h$!<7zv)N>`*(95Hf-)pZXH=My#GqD+h9n^Gr;jpP z??we9pk#B>LWMFbrJC+&g(^tIa)VaIsuX-wMR39tZH6)>v^a@Yo&M+Eo10}5&t!M+ zcmBuu&;L5-W@P!$^1K}Wiy^=3H}4z&!=iVZ`bP(<5!!wI-|868t&AAWbDQ5}dfO3< zd0g~{vXJ5Jcgq<-OXw5~#@e#jj4yvq=Qb!aFlTS+jF-p3;3V;(jvU2cT zQ>7R}Eny)jl!ba>KK#y6B4{<96BuhV_y{2be3q2e*Vcy-YCm6s(D&u4w%Ft9zEl!I zyz5$ZEg-1+#b#VC2|<9$Nc3uV$I%YOs|mD;{q}VJsZ*gvCgmn*Pjc2J%TVcv-*K+9x!Nz-{T_VXe`Pq1kG@0C7J}Z*D zO}Wk_xfLMym?ri+(*u;87}oVb-l~utU>4A<7sxg_}=Ftu58%r@)K`FMOF zLjGmFLns-JITkEf&`jp0x|8kP2|`b5i$+ry@*;EsGMb8$`JMwlTDKV`cG8gMOZNIp zK&G}+@|HB8Jt-)MflQ0TK|V;!WHys8(;iP5iGzV;eR@sU+z4c4hpwA657kyomol#a z+YW7q7t{SLhe(Fam2As9z(s9=9%ZkruB(JXcK0E4aWAY<5M2@=_t;9=tueCK=47F} z9Jaljo#e^)K!eg&x--riUNy(#`y!+>v%m~J0dzpKwUcOO4RoWoGoN7cNK2M)kw_^C z85TRuet4QyYKRJ5L)-lUd-{VPp&k8@-SQD@hRhUIIWfAloSe?8@rl>yIBEfgDYi-fY#C6*Xa{{UvSjJZQJ}gO}*(w9DSb?~BJ#pTn6P_Z&DvY20bU zZ*;8gyhaZRCB&opV7}b%d2Zz}Wi~_rg=0(&ZZ| zrgrx))HK)EPFEx)pt(oWyv1qbo1?3jk*A%jXw$G|ix88FY#)3t$o5I1qLYS;KEOD= zoBQ8x4uZ064|jMEeNgK^F>vSiaAOH1#isFzGp!;F*)(OhwP2Igs-7jbUi~B?y%`4b zeRd1WBGT+qDlf57%>yag$GTlb%uMnJ*KD>YMlQOh^t)SukCrtJRC!KoWpHbR+MpP= zY?kV*s)i~hHIO&`p=XW(bCZY;wD4mMS~o zqpB{Iaf)m22VGh%lfS#~@&suPC5G$dFgJLfGcfe3((K7ePTx%+uca@wg&yiluOPJS zDrj*w6c5CKkKWjZ@jUhsh`%T%wy`_J8jA=E!jeh@*(HWb1M2$Yta^Q_Xi&V7T;hYE zm!7j%#D3F}cs#~}FA#ak>rGTY=%roqve$2)D0%s1VcQ{rRvzC*0{IWkm^hM;9v1$3 zSfIT?tyX3@ntp2MORwkumSF;K^rmp#mY3`R5vqJsTE3P^>p3vE!d28J)?zTwZD*wkbZw#ayHelYAFt5M^**x zPVJvTD63bp+QCv-SjzVFkVS_u!6Lun2c?Fp^{Z)372R-BrnIVJw14CT{IIjx0T)%B*aO-odAb92 z5VOI+^+q;ElcI=x7YLPFMwF$V*BegtbV+#|s8KIpcCx(qmZ}&vhYs4=>({C=sH>=$ zE(V<-J8@=wTb!k241@)JJYw4WZb?lj`#I+i+j^0}mrPk?E>q>kyT#3Z>l*k91BwpfYW|31R!QuoCTKe|_ z2i^I}gQFw#GlV zRlA>RUEDD__r;S|1AXsVy|(MVRqzT;`8GWBOM?;Smi%Jf+70(^1d|zN)!a=~=mdP2 z0Ee6f4wwHU4)?CaCvL!3=i>ea_>=_?c=7i6_((pMPK9x-4v)C;r*1s@GK2Ro#GktG zo=*JQUAV`AuP(*!y~W_+R(v)e5BYFpCcaRNdy4S>LVT$Z|HY5t9y%1jLoWQ?e{J{_ zk572Z2A};u!W=&iGiDks0Gq>UF8I#Ix)%4PNoeQVOTT z18!L|@H)JMmnCD04s%&q5)2biN*w`VlW_v4_UFoyS8U!r-y}=6G#%b9%2GzUq~psDS<1BOaDAREWo78lkSR;{OdY;h zAWM!c9S(qMr(K5^Qe-LHp~DT}EtgY=n_;1xYz;~%^-HHL<+^n8G1#IzM~4p>WXY4O z!}IyFl;_sro$0bP!=u9$uqT|S!%Xm{I75d`V6+$Ous2(l@+DEnjX?H!b(jX^f_xpG z1*`o&9To#DEYRUsg|bxS*WocFOMyZi98)6n4f*f&q=k_?D6(-CYu*ic4lVt$Gvs@P*#2Y7*{#oU;vC#iycFY$H#;> zyfe+mE#Fp-UuUJgiw^iVn$5VYgC4r{^^`>JL9DI4^~ahR?M!`)ZLZRYXcJ?27Fl|G w%LVPO&;gw;p=_a5qSxEML2nF@$Exc~`t>GB|I Date: Thu, 6 Jul 2023 14:01:55 +0200 Subject: [PATCH 009/101] fix --- packages/next/src/build/index.ts | 9 +-------- packages/next/src/server/require-hook.ts | 5 ----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 5f94271162e61..3c9dafeff68e9 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -141,11 +141,7 @@ import { createClientRouterFilter } from '../lib/create-client-router-filter' import { createValidFileMatcher } from '../server/lib/find-page-file' import { startTypeChecking } from './type-check' import { generateInterceptionRoutesRewrites } from '../lib/generate-interception-routes-rewrites' -import { - baseOverrides, - experimentalOverrides, - vanillaOverrides, -} from '../server/require-hook' +import { baseOverrides, experimentalOverrides } from '../server/require-hook' export type SsgRoute = { initialRevalidateSeconds: number | false @@ -1972,9 +1968,6 @@ export default async function build( require.resolve( 'next/dist/compiled/minimal-next-server/next-server.js' ), - ...Object.values(vanillaOverrides).map((override) => - require.resolve(override) - ), ...Object.values(baseOverrides).map((override) => require.resolve(override) ), diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 7a3d179a7cc14..daa8160ac35f0 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -19,11 +19,6 @@ const resolve = process.env.NEXT_MINIMAL const toResolveMap = (map: Record): [string, string][] => Object.entries(map).map(([key, value]) => [key, resolve(value)]) -export const vanillaOverrides = { - 'styled-jsx': 'styled-jsx/package.json', - 'styled-jsx/style': 'styled-jsx/style', -} - export const baseOverrides = { react: 'next/dist/compiled/react', 'react/package.json': 'next/dist/compiled/react/package.json', From 8374a833788067af6157fcb78eeb3352ecb2a70a Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 14:54:14 +0200 Subject: [PATCH 010/101] fix precompiled --- .../compiled/node-html-parser/index.js.cache | Bin 13544 -> 13544 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/next/src/compiled/node-html-parser/index.js.cache b/packages/next/src/compiled/node-html-parser/index.js.cache index 8298cd5c8ab4ecc8be9b8225fd5aaa576f60334d..b5f82c44b62522ebaf77b364e96ffbdb57ab685e 100644 GIT binary patch delta 167 zcmaEn`66?I2#cfVi^&ruB6O_E?Kg|*v@o-9*`~alJWpT3L2tP^2S~d qqgPh!OhA5O5=0PWjhO$PC2T-$ZhlH>4$yv(n3J}5&*pFXpI87Dfhper delta 167 zcmaEn`66?I2#d7mv-pV;5jtfO^QJH|FfgP7F$gg71SUF#N*ja3ioha3F_FOJpqq^G z6Xz7MEGm@fn=Hg=%Q$ay0OKJomY_=vX`97#T9{eFek90Fo~JM2pw_+I3#45irX6Uc qS1W5Y6Of;n1Q7&TBlqF-LN*{bH$SB`2WUS?Y#End`Q~r>pI88X0x4Yp From 35bcbd885b5ae9531aca34433fbc0a399799222e Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 15:58:55 +0200 Subject: [PATCH 011/101] update --- .../compiled/node-html-parser/index.js.cache | Bin 13544 -> 13544 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/next/src/compiled/node-html-parser/index.js.cache b/packages/next/src/compiled/node-html-parser/index.js.cache index b5f82c44b62522ebaf77b364e96ffbdb57ab685e..075a07483840a5172f62e803ba0b418d894e279d 100644 GIT binary patch delta 166 zcmaEn`66?I2+In;S8)?1B6JR2{xzAAfq@|vh(UmnCor*Ut0pT*tOzUu6cY(d=8LS& zm^i11Ws&i;&dEZIwv10V2QVJeVkw&Qa_wd@omOV%$x96;&(oK1F#3B{1EgCYrW-29Z%9H8|ev83bczi?Kg|*v@$c>ro5ayPhY}8Z@D=KNVh&rH_$|* pS61vyKz?EpL=a?)nE#z6Y(Q>qeoAQ$(0Y)VleTxy=5P9+SOEF^Db)Y~ From 9b901a5439c328ac7ba8418b4b68ff4d2c236db7 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 16:03:28 +0200 Subject: [PATCH 012/101] reverse node cache --- .../next/src/compiled/node-html-parser/index.js | 10 ++-------- .../compiled/node-html-parser/index.js.cache | Bin 13544 -> 0 bytes .../compiled/node-html-parser/index.js.cache.js | 2 -- packages/next/taskfile.js | 1 - 4 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 packages/next/src/compiled/node-html-parser/index.js.cache delete mode 100644 packages/next/src/compiled/node-html-parser/index.js.cache.js diff --git a/packages/next/src/compiled/node-html-parser/index.js b/packages/next/src/compiled/node-html-parser/index.js index a4e592278008a..2039eaeda2107 100644 --- a/packages/next/src/compiled/node-html-parser/index.js +++ b/packages/next/src/compiled/node-html-parser/index.js @@ -1,8 +1,2 @@ -const { readFileSync, writeFileSync } = require('fs'), { Script } = require('vm'), { wrap } = require('module'); -const basename = __dirname + '/index.js'; -const source = readFileSync(basename + '.cache.js', 'utf-8'); -const cachedData = !process.pkg && require('process').platform !== 'win32' && readFileSync(basename + '.cache'); -const scriptOpts = { filename: basename + '.cache.js', columnOffset: -62 } -const script = new Script(wrap(source), cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts); -(script.runInThisContext())(exports, require, module, __filename, __dirname); -if (cachedData) process.on('exit', () => { try { writeFileSync(basename + '.cache', script.createCachedData()); } catch(e) {} }); +(function(){var e={2947:function(e){e.exports={trueFunc:function trueFunc(){return true},falseFunc:function falseFunc(){return false}}},3387:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeRules=void 0;var a=t(2947);var n=/[-[\]{}()*+?.,\\^$|#\s]/g;function escapeRegex(e){return e.replace(n,"\\$&")}var i=new Set(["accept","accept-charset","align","alink","axis","bgcolor","charset","checked","clear","codetype","color","compact","declare","defer","dir","direction","disabled","enctype","face","frame","hreflang","http-equiv","lang","language","link","media","method","multiple","nohref","noresize","noshade","nowrap","readonly","rel","rev","rules","scope","scrolling","selected","shape","target","text","type","valign","valuetype","vlink"]);function shouldIgnoreCase(e,r){return typeof e.ignoreCase==="boolean"?e.ignoreCase:e.ignoreCase==="quirks"?!!r.quirksMode:!r.xmlMode&&i.has(e.name)}r.attributeRules={equals:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return t!=null&&t.length===i.length&&t.toLowerCase()===i&&e(r)}}return function(r){return a.getAttributeValue(r,n)===i&&e(r)}},hyphen:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;var o=i.length;if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function hyphenIC(r){var t=a.getAttributeValue(r,n);return t!=null&&(t.length===o||t.charAt(o)==="-")&&t.substr(0,o).toLowerCase()===i&&e(r)}}return function hyphen(r){var t=a.getAttributeValue(r,n);return t!=null&&(t.length===o||t.charAt(o)==="-")&&t.substr(0,o)===i&&e(r)}},element:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(/\s/.test(o)){return a.falseFunc}var s=new RegExp("(?:^|\\s)".concat(escapeRegex(o),"(?:$|\\s)"),shouldIgnoreCase(r,t)?"i":"");return function element(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}},exists:function(e,r,t){var a=r.name;var n=t.adapter;return function(r){return n.hasAttrib(r,a)&&e(r)}},start:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=s&&t.substr(0,s).toLowerCase()===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.startsWith(o))&&e(r)}},end:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=-o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t;return((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.substr(s).toLowerCase())===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.endsWith(o))&&e(r)}},any:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(o===""){return a.falseFunc}if(shouldIgnoreCase(r,t)){var s=new RegExp(escapeRegex(o),"i");return function anyIC(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.includes(o))&&e(r)}},not:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(i===""){return function(r){return!!a.getAttributeValue(r,n)&&e(r)}}else if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return(t==null||t.length!==i.length||t.toLowerCase()!==i)&&e(r)}}return function(r){return a.getAttributeValue(r,n)!==i&&e(r)}}}},8689:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.compileToken=r.compileUnsafe=r.compile=void 0;var n=t(8065);var i=t(2947);var o=a(t(4901));var s=t(538);var u=t(7088);var l=t(4428);function compile(e,r,t){var a=compileUnsafe(e,r,t);return(0,l.ensureIsTag)(a,r.adapter)}r.compile=compile;function compileUnsafe(e,r,t){var a=typeof e==="string"?(0,n.parse)(e):e;return compileToken(a,r,t)}r.compileUnsafe=compileUnsafe;function includesScopePseudo(e){return e.type==="pseudo"&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some((function(e){return e.some(includesScopePseudo)})))}var c={type:n.SelectorType.Descendant};var p={type:"_flexibleDescendant"};var d={type:n.SelectorType.Pseudo,name:"scope",data:null};function absolutize(e,r,t){var a=r.adapter;var n=!!(t===null||t===void 0?void 0:t.every((function(e){var r=a.isTag(e)&&a.getParent(e);return e===l.PLACEHOLDER_ELEMENT||r&&a.isTag(r)})));for(var i=0,o=e;i0&&(0,s.isTraversal)(u[0])&&u[0].type!=="descendant"){}else if(n&&!u.some(includesScopePseudo)){u.unshift(c)}else{continue}u.unshift(d)}}function compileToken(e,r,t){var a;e=e.filter((function(e){return e.length>0}));e.forEach(o.default);t=(a=r.context)!==null&&a!==void 0?a:t;var n=Array.isArray(t);var s=t&&(Array.isArray(t)?t:[t]);absolutize(e,r,s);var u=false;var l=e.map((function(e){if(e.length>=2){var t=e[0],a=e[1];if(t.type!=="pseudo"||t.name!=="scope"){}else if(n&&a.type==="descendant"){e[1]=p}else if(a.type==="adjacent"||a.type==="sibling"){u=true}}return compileRules(e,r,s)})).reduce(reduceRules,i.falseFunc);l.shouldTestNextSiblings=u;return l}r.compileToken=compileToken;function compileRules(e,r,t){var a;return e.reduce((function(e,a){return e===i.falseFunc?i.falseFunc:(0,u.compileGeneralSelector)(e,a,r,t,compileToken)}),(a=r.rootFunc)!==null&&a!==void 0?a:i.trueFunc)}function reduceRules(e,r){if(r===i.falseFunc||e===i.trueFunc){return e}if(e===i.falseFunc||r===i.trueFunc){return r}return function combine(t){return e(t)||r(t)}}},7088:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compileGeneralSelector=void 0;var a=t(3387);var n=t(6463);var i=t(8065);function compileGeneralSelector(e,r,t,o,s){var u=t.adapter,l=t.equals;switch(r.type){case i.SelectorType.PseudoElement:{throw new Error("Pseudo-elements are not supported by css-select")}case i.SelectorType.ColumnCombinator:{throw new Error("Column combinators are not yet supported by css-select")}case i.SelectorType.Attribute:{if(r.namespace!=null){throw new Error("Namespaced attributes are not yet supported by css-select")}if(!t.xmlMode||t.lowerCaseAttributeNames){r.name=r.name.toLowerCase()}return a.attributeRules[r.action](e,r,t)}case i.SelectorType.Pseudo:{return(0,n.compilePseudoSelector)(e,r,t,o,s)}case i.SelectorType.Tag:{if(r.namespace!=null){throw new Error("Namespaced tag names are not yet supported by css-select")}var c=r.name;if(!t.xmlMode||t.lowerCaseTags){c=c.toLowerCase()}return function tag(r){return u.getName(r)===c&&e(r)}}case i.SelectorType.Descendant:{if(t.cacheResults===false||typeof WeakSet==="undefined"){return function descendant(r){var t=r;while(t=u.getParent(t)){if(u.isTag(t)&&e(t)){return true}}return false}}var p=new WeakSet;return function cachedDescendant(r){var t=r;while(t=u.getParent(t)){if(!p.has(t)){if(u.isTag(t)&&e(t)){return true}p.add(t)}}return false}}case"_flexibleDescendant":{return function flexibleDescendant(r){var t=r;do{if(u.isTag(t)&&e(t))return true}while(t=u.getParent(t));return false}}case i.SelectorType.Parent:{return function parent(r){return u.getChildren(r).some((function(r){return u.isTag(r)&&e(r)}))}}case i.SelectorType.Child:{return function child(r){var t=u.getParent(r);return t!=null&&u.isTag(t)&&e(t)}}case i.SelectorType.Sibling:{return function sibling(r){var t=u.getSiblings(r);for(var a=0;a option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}},6804:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.filters=void 0;var n=a(t(7118));var i=t(2947);function getChildFunc(e,r){return function(t){var a=r.getParent(t);return a!=null&&r.isTag(a)&&e(t)}}r.filters={contains:function(e,r,t){var a=t.adapter;return function contains(t){return e(t)&&a.getText(t).includes(r)}},icontains:function(e,r,t){var a=t.adapter;var n=r.toLowerCase();return function icontains(r){return e(r)&&a.getText(r).toLowerCase().includes(n)}},"nth-child":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthChild(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){if(o(r,t[i]))break;if(a.isTag(t[i])){n++}}return s(n)&&e(r)}},"nth-of-type":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthOfType(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){var u=t[i];if(o(r,u))break;if(a.isTag(u)&&a.getName(u)===a.getName(r)){n++}}return s(n)&&e(r)}},root:function(e,r,t){var a=t.adapter;return function(r){var t=a.getParent(r);return(t==null||!a.isTag(t))&&e(r)}},scope:function(e,t,a,n){var i=a.equals;if(!n||n.length===0){return r.filters.root(e,t,a)}if(n.length===1){return function(r){return i(n[0],r)&&e(r)}}return function(r){return n.includes(r)&&e(r)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(e){return function dynamicPseudo(r,t,a){var n=a.adapter;var o=n[e];if(typeof o!=="function"){return i.falseFunc}return function active(e){return o(e)&&r(e)}}}},6463:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compilePseudoSelector=r.aliases=r.pseudos=r.filters=void 0;var a=t(2947);var n=t(8065);var i=t(6804);Object.defineProperty(r,"filters",{enumerable:true,get:function(){return i.filters}});var o=t(6973);Object.defineProperty(r,"pseudos",{enumerable:true,get:function(){return o.pseudos}});var s=t(8680);Object.defineProperty(r,"aliases",{enumerable:true,get:function(){return s.aliases}});var u=t(4428);function compilePseudoSelector(e,r,t,l,c){var p=r.name,d=r.data;if(Array.isArray(d)){return u.subselects[p](e,d,t,l,c)}if(p in s.aliases){if(d!=null){throw new Error("Pseudo ".concat(p," doesn't have any arguments"))}var f=(0,n.parse)(s.aliases[p]);return u.subselects.is(e,f,t,l,c)}if(p in i.filters){return i.filters[p](e,d,t,l)}if(p in o.pseudos){var g=o.pseudos[p];(0,o.verifyPseudoArgs)(g,p,d);return g===a.falseFunc?a.falseFunc:e===a.trueFunc?function(e){return g(e,t,d)}:function(r){return g(r,t,d)&&e(r)}}throw new Error("unmatched pseudo-class :".concat(p))}r.compilePseudoSelector=compilePseudoSelector},6973:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.verifyPseudoArgs=r.pseudos=void 0;r.pseudos={empty:function(e,r){var t=r.adapter;return!t.getChildren(e).some((function(e){return t.isTag(e)||t.getText(e)!==""}))},"first-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e).find((function(e){return t.isTag(e)}));return n!=null&&a(e,n)},"last-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);for(var i=n.length-1;i>=0;i--){if(a(e,n[i]))return true;if(t.isTag(n[i]))break}return false},"first-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);var i=t.getName(e);for(var o=0;o=0;o--){var s=n[o];if(a(e,s))return true;if(t.isTag(s)&&t.getName(s)===i){break}}return false},"only-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getName(e);return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)||t.getName(r)!==n}))},"only-child":function(e,r){var t=r.adapter,a=r.equals;return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)}))}};function verifyPseudoArgs(e,r,t){if(t===null){if(e.length>2){throw new Error("pseudo-selector :".concat(r," requires an argument"))}}else if(e.length===2){throw new Error("pseudo-selector :".concat(r," doesn't have any arguments"))}}r.verifyPseudoArgs=verifyPseudoArgs},4428:function(e,r,t){"use strict";var a=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,i;a=0&&a>=1}}else if(e.type===a.SelectorType.Pseudo){if(!e.data){r=3}else if(e.name==="has"||e.name==="contains"){r=0}else if(Array.isArray(e.data)){r=0;for(var t=0;tr)r=o}if(e.data.length>1&&r>0)r-=1}else{r=1}}return r}},8065:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.stringify=r.parse=r.isTraversal=void 0;n(t(5615),r);var i=t(2422);Object.defineProperty(r,"isTraversal",{enumerable:true,get:function(){return i.isTraversal}});Object.defineProperty(r,"parse",{enumerable:true,get:function(){return i.parse}});var o=t(8279);Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return o.stringify}})},2422:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=r.isTraversal=void 0;var a=t(5615);var n=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;var i=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;var o=new Map([[126,a.AttributeAction.Element],[94,a.AttributeAction.Start],[36,a.AttributeAction.End],[42,a.AttributeAction.Any],[33,a.AttributeAction.Not],[124,a.AttributeAction.Hyphen]]);var s=new Set(["has","not","matches","is","where","host","host-context"]);function isTraversal(e){switch(e.type){case a.SelectorType.Adjacent:case a.SelectorType.Child:case a.SelectorType.Descendant:case a.SelectorType.Parent:case a.SelectorType.Sibling:case a.SelectorType.ColumnCombinator:return true;default:return false}}r.isTraversal=isTraversal;var u=new Set(["contains","icontains"]);function funescape(e,r,t){var a=parseInt(r,16)-65536;return a!==a||t?r:a<0?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,a&1023|56320)}function unescapeCSS(e){return e.replace(i,funescape)}function isQuote(e){return e===39||e===34}function isWhitespace(e){return e===32||e===9||e===10||e===12||e===13}function parse(e){var r=[];var t=parseSelector(r,"".concat(e),0);if(t0&&t0&&isTraversal(i[i.length-1])){throw new Error("Did not expect successive traversals.")}}function addTraversal(e){if(i.length>0&&i[i.length-1].type===a.SelectorType.Descendant){i[i.length-1].type=e;return}ensureNotTraversal();i.push({type:e})}function addSpecialAttribute(e,r){i.push({type:a.SelectorType.Attribute,name:e,action:r,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(i.length&&i[i.length-1].type===a.SelectorType.Descendant){i.pop()}if(i.length===0){throw new Error("Empty sub-selector")}e.push(i)}stripWhitespace(0);if(r.length===t){return t}e:while(t ":" > ";case n.SelectorType.Parent:return r===0?"< ":" < ";case n.SelectorType.Sibling:return r===0?"~ ":" ~ ";case n.SelectorType.Adjacent:return r===0?"+ ":" + ";case n.SelectorType.Descendant:return" ";case n.SelectorType.ColumnCombinator:return r===0?"|| ":" || ";case n.SelectorType.Universal:return e.namespace==="*"&&r+10?a+e.slice(t):e}},5615:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AttributeAction=r.IgnoreCaseMode=r.SelectorType=void 0;var t;(function(e){e["Attribute"]="attribute";e["Pseudo"]="pseudo";e["PseudoElement"]="pseudo-element";e["Tag"]="tag";e["Universal"]="universal";e["Adjacent"]="adjacent";e["Child"]="child";e["Descendant"]="descendant";e["Parent"]="parent";e["Sibling"]="sibling";e["ColumnCombinator"]="column-combinator"})(t=r.SelectorType||(r.SelectorType={}));r.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:true,CaseSensitive:false};var a;(function(e){e["Any"]="any";e["Element"]="element";e["End"]="end";e["Equals"]="equals";e["Exists"]="exists";e["Hyphen"]="hyphen";e["Not"]="not";e["Start"]="start"})(a=r.AttributeAction||(r.AttributeAction={}))},7537:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeNames=r.elementNames=void 0;r.elementNames=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);r.attributeNames=new Map([["definitionurl","definitionURL"],["attributename","attributeName"],["attributetype","attributeType"],["basefrequency","baseFrequency"],["baseprofile","baseProfile"],["calcmode","calcMode"],["clippathunits","clipPathUnits"],["diffuseconstant","diffuseConstant"],["edgemode","edgeMode"],["filterunits","filterUnits"],["glyphref","glyphRef"],["gradienttransform","gradientTransform"],["gradientunits","gradientUnits"],["kernelmatrix","kernelMatrix"],["kernelunitlength","kernelUnitLength"],["keypoints","keyPoints"],["keysplines","keySplines"],["keytimes","keyTimes"],["lengthadjust","lengthAdjust"],["limitingconeangle","limitingConeAngle"],["markerheight","markerHeight"],["markerunits","markerUnits"],["markerwidth","markerWidth"],["maskcontentunits","maskContentUnits"],["maskunits","maskUnits"],["numoctaves","numOctaves"],["pathlength","pathLength"],["patterncontentunits","patternContentUnits"],["patterntransform","patternTransform"],["patternunits","patternUnits"],["pointsatx","pointsAtX"],["pointsaty","pointsAtY"],["pointsatz","pointsAtZ"],["preservealpha","preserveAlpha"],["preserveaspectratio","preserveAspectRatio"],["primitiveunits","primitiveUnits"],["refx","refX"],["refy","refY"],["repeatcount","repeatCount"],["repeatdur","repeatDur"],["requiredextensions","requiredExtensions"],["requiredfeatures","requiredFeatures"],["specularconstant","specularConstant"],["specularexponent","specularExponent"],["spreadmethod","spreadMethod"],["startoffset","startOffset"],["stddeviation","stdDeviation"],["stitchtiles","stitchTiles"],["surfacescale","surfaceScale"],["systemlanguage","systemLanguage"],["tablevalues","tableValues"],["targetx","targetX"],["targety","targetY"],["textlength","textLength"],["viewbox","viewBox"],["viewtarget","viewTarget"],["xchannelselector","xChannelSelector"],["ychannelselector","yChannelSelector"],["zoomandpan","zoomAndPan"]])},4614:function(e,r,t){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0){n+=render(e.children,r)}if(r.xmlMode||!p.has(e.name)){n+=""}}return n}function renderDirective(e){return"<"+e.data+">"}function renderText(e,r){var t=e.data||"";if(r.decodeEntities!==false&&!(!r.xmlMode&&e.parent&&c.has(e.parent.name))){t=u.encodeXML(t)}return t}function renderCdata(e){return""}function renderComment(e){return"\x3c!--"+e.data+"--\x3e"}},9391:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Doctype=r.CDATA=r.Tag=r.Style=r.Script=r.Comment=r.Directive=r.Text=r.Root=r.isTag=r.ElementType=void 0;var t;(function(e){e["Root"]="root";e["Text"]="text";e["Directive"]="directive";e["Comment"]="comment";e["Script"]="script";e["Style"]="style";e["Tag"]="tag";e["CDATA"]="cdata";e["Doctype"]="doctype"})(t=r.ElementType||(r.ElementType={}));function isTag(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}r.isTag=isTag;r.Root=t.Root;r.Text=t.Text;r.Directive=t.Directive;r.Comment=t.Comment;r.Script=t.Script;r.Style=t.Style;r.Tag=t.Tag;r.CDATA=t.CDATA;r.Doctype=t.Doctype},2472:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.DomHandler=void 0;var i=t(9391);var o=t(1508);n(t(1508),r);var s=/\s+/g;var u={normalizeWhitespace:false,withStartIndices:false,withEndIndices:false,xmlMode:false};var l=function(){function DomHandler(e,r,t){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof r==="function"){t=r;r=u}if(typeof e==="object"){r=e;e=undefined}this.callback=e!==null&&e!==void 0?e:null;this.options=r!==null&&r!==void 0?r:u;this.elementCB=t!==null&&t!==void 0?t:null}DomHandler.prototype.onparserinit=function(e){this.parser=e};DomHandler.prototype.onreset=function(){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null};DomHandler.prototype.onend=function(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)};DomHandler.prototype.onerror=function(e){this.handleCallback(e)};DomHandler.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(e)};DomHandler.prototype.onopentag=function(e,r){var t=this.options.xmlMode?i.ElementType.Tag:undefined;var a=new o.Element(e,r,undefined,t);this.addNode(a);this.tagStack.push(a)};DomHandler.prototype.ontext=function(e){var r=this.options.normalizeWhitespace;var t=this.lastNode;if(t&&t.type===i.ElementType.Text){if(r){t.data=(t.data+e).replace(s," ")}else{t.data+=e}if(this.options.withEndIndices){t.endIndex=this.parser.endIndex}}else{if(r){e=e.replace(s," ")}var a=new o.Text(e);this.addNode(a);this.lastNode=a}};DomHandler.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=e;return}var r=new o.Comment(e);this.addNode(r);this.lastNode=r};DomHandler.prototype.oncommentend=function(){this.lastNode=null};DomHandler.prototype.oncdatastart=function(){var e=new o.Text("");var r=new o.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(r);e.parent=r;this.lastNode=e};DomHandler.prototype.oncdataend=function(){this.lastNode=null};DomHandler.prototype.onprocessinginstruction=function(e,r){var t=new o.ProcessingInstruction(e,r);this.addNode(t)};DomHandler.prototype.handleCallback=function(e){if(typeof this.callback==="function"){this.callback(e,this.dom)}else if(e){throw e}};DomHandler.prototype.addNode=function(e){var r=this.tagStack[this.tagStack.length-1];var t=r.children[r.children.length-1];if(this.options.withStartIndices){e.startIndex=this.parser.startIndex}if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}r.children.push(e);if(t){e.prev=t;t.next=e}e.parent=r;this.lastNode=null};return DomHandler}();r.DomHandler=l;r["default"]=l},1508:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0?this.children[this.children.length-1]:null},enumerable:false,configurable:true});Object.defineProperty(NodeWithChildren.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:false,configurable:true});return NodeWithChildren}(s);r.NodeWithChildren=d;var f=function(e){a(Document,e);function Document(r){return e.call(this,i.ElementType.Root,r)||this}return Document}(d);r.Document=f;var g=function(e){a(Element,e);function Element(r,t,a,n){if(a===void 0){a=[]}if(n===void 0){n=r==="script"?i.ElementType.Script:r==="style"?i.ElementType.Style:i.ElementType.Tag}var o=e.call(this,n,a)||this;o.name=r;o.attribs=t;return o}Object.defineProperty(Element.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:false,configurable:true});Object.defineProperty(Element.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(r){var t,a;return{name:r,value:e.attribs[r],namespace:(t=e["x-attribsNamespace"])===null||t===void 0?void 0:t[r],prefix:(a=e["x-attribsPrefix"])===null||a===void 0?void 0:a[r]}}))},enumerable:false,configurable:true});return Element}(d);r.Element=g;function isTag(e){return(0,i.isTag)(e)}r.isTag=isTag;function isCDATA(e){return e.type===i.ElementType.CDATA}r.isCDATA=isCDATA;function isText(e){return e.type===i.ElementType.Text}r.isText=isText;function isComment(e){return e.type===i.ElementType.Comment}r.isComment=isComment;function isDirective(e){return e.type===i.ElementType.Directive}r.isDirective=isDirective;function isDocument(e){return e.type===i.ElementType.Root}r.isDocument=isDocument;function hasChildren(e){return Object.prototype.hasOwnProperty.call(e,"children")}r.hasChildren=hasChildren;function cloneNode(e,r){if(r===void 0){r=false}var t;if(isText(e)){t=new l(e.data)}else if(isComment(e)){t=new c(e.data)}else if(isTag(e)){var a=r?cloneChildren(e.children):[];var o=new g(e.name,n({},e.attribs),a);a.forEach((function(e){return e.parent=o}));if(e.namespace!=null){o.namespace=e.namespace}if(e["x-attribsNamespace"]){o["x-attribsNamespace"]=n({},e["x-attribsNamespace"])}if(e["x-attribsPrefix"]){o["x-attribsPrefix"]=n({},e["x-attribsPrefix"])}t=o}else if(isCDATA(e)){var a=r?cloneChildren(e.children):[];var s=new d(i.ElementType.CDATA,a);a.forEach((function(e){return e.parent=s}));t=s}else if(isDocument(e)){var a=r?cloneChildren(e.children):[];var u=new f(a);a.forEach((function(e){return e.parent=u}));if(e["x-mode"]){u["x-mode"]=e["x-mode"]}t=u}else if(isDirective(e)){var h=new p(e.name,e.data);if(e["x-name"]!=null){h["x-name"]=e["x-name"];h["x-publicId"]=e["x-publicId"];h["x-systemId"]=e["x-systemId"]}t=h}else{throw new Error("Not implemented yet: ".concat(e.type))}t.startIndex=e.startIndex;t.endIndex=e.endIndex;if(e.sourceCodeLocation!=null){t.sourceCodeLocation=e.sourceCodeLocation}return t}r.cloneNode=cloneNode;function cloneChildren(e){var r=e.map((function(e){return cloneNode(e,true)}));for(var t=1;t=0){var t=e[r];if(r>0&&e.lastIndexOf(t,r-1)>=0){e.splice(r,1);continue}for(var a=t.parent;a;a=a.parent){if(e.includes(a)){e.splice(r,1);break}}}return e}r.removeSubsets=removeSubsets;function compareDocumentPosition(e,r){var t=[];var n=[];if(e===r){return 0}var i=(0,a.hasChildren)(e)?e:e.parent;while(i){t.unshift(i);i=i.parent}i=(0,a.hasChildren)(r)?r:r.parent;while(i){n.unshift(i);i=i.parent}var o=Math.min(t.length,n.length);var s=0;while(sl.indexOf(p)){if(u===r){return 4|16}return 4}if(u===e){return 2|8}return 2}r.compareDocumentPosition=compareDocumentPosition;function uniqueSort(e){e=e.filter((function(e,r,t){return!t.includes(e,r+1)}));e.sort((function(e,r){var t=compareDocumentPosition(e,r);if(t&2){return-1}else if(t&4){return 1}return 0}));return e}r.uniqueSort=uniqueSort},5861:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;Object.defineProperty(e,a,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.hasChildren=r.isDocument=r.isComment=r.isText=r.isCDATA=r.isTag=void 0;n(t(3930),r);n(t(8298),r);n(t(1655),r);n(t(8929),r);n(t(7102),r);n(t(5509),r);n(t(3442),r);var i=t(2472);Object.defineProperty(r,"isTag",{enumerable:true,get:function(){return i.isTag}});Object.defineProperty(r,"isCDATA",{enumerable:true,get:function(){return i.isCDATA}});Object.defineProperty(r,"isText",{enumerable:true,get:function(){return i.isText}});Object.defineProperty(r,"isComment",{enumerable:true,get:function(){return i.isComment}});Object.defineProperty(r,"isDocument",{enumerable:true,get:function(){return i.isDocument}});Object.defineProperty(r,"hasChildren",{enumerable:true,get:function(){return i.hasChildren}})},7102:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getElementsByTagType=r.getElementsByTagName=r.getElementById=r.getElements=r.testElement=void 0;var a=t(2472);var n=t(8929);var i={tag_name:function(e){if(typeof e==="function"){return function(r){return(0,a.isTag)(r)&&e(r.name)}}else if(e==="*"){return a.isTag}return function(r){return(0,a.isTag)(r)&&r.name===e}},tag_type:function(e){if(typeof e==="function"){return function(r){return e(r.type)}}return function(r){return r.type===e}},tag_contains:function(e){if(typeof e==="function"){return function(r){return(0,a.isText)(r)&&e(r.data)}}return function(r){return(0,a.isText)(r)&&r.data===e}}};function getAttribCheck(e,r){if(typeof r==="function"){return function(t){return(0,a.isTag)(t)&&r(t.attribs[e])}}return function(t){return(0,a.isTag)(t)&&t.attribs[e]===r}}function combineFuncs(e,r){return function(t){return e(t)||r(t)}}function compileTest(e){var r=Object.keys(e).map((function(r){var t=e[r];return Object.prototype.hasOwnProperty.call(i,r)?i[r](t):getAttribCheck(r,t)}));return r.length===0?null:r.reduce(combineFuncs)}function testElement(e,r){var t=compileTest(e);return t?t(r):true}r.testElement=testElement;function getElements(e,r,t,a){if(a===void 0){a=Infinity}var i=compileTest(e);return i?(0,n.filter)(i,r,t,a):[]}r.getElements=getElements;function getElementById(e,r,t){if(t===void 0){t=true}if(!Array.isArray(r))r=[r];return(0,n.findOne)(getAttribCheck("id",e),r,t)}r.getElementById=getElementById;function getElementsByTagName(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_name(e),r,t,a)}r.getElementsByTagName=getElementsByTagName;function getElementsByTagType(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_type(e),r,t,a)}r.getElementsByTagType=getElementsByTagType},1655:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prepend=r.prependChild=r.append=r.appendChild=r.replaceElement=r.removeElement=void 0;function removeElement(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){var r=e.parent.children;r.splice(r.lastIndexOf(e),1)}}r.removeElement=removeElement;function replaceElement(e,r){var t=r.prev=e.prev;if(t){t.next=r}var a=r.next=e.next;if(a){a.prev=r}var n=r.parent=e.parent;if(n){var i=n.children;i[i.lastIndexOf(e)]=r}}r.replaceElement=replaceElement;function appendChild(e,r){removeElement(r);r.next=null;r.parent=e;if(e.children.push(r)>1){var t=e.children[e.children.length-2];t.next=r;r.prev=t}else{r.prev=null}}r.appendChild=appendChild;function append(e,r){removeElement(r);var t=e.parent;var a=e.next;r.next=a;r.prev=e;e.next=r;r.parent=t;if(a){a.prev=r;if(t){var n=t.children;n.splice(n.lastIndexOf(a),0,r)}}else if(t){t.children.push(r)}}r.append=append;function prependChild(e,r){removeElement(r);r.parent=e;r.prev=null;if(e.children.unshift(r)!==1){var t=e.children[1];t.prev=r;r.next=t}else{r.next=null}}r.prependChild=prependChild;function prepend(e,r){removeElement(r);var t=e.parent;if(t){var a=t.children;a.splice(a.indexOf(e),0,r)}if(e.prev){e.prev.next=r}r.parent=t;r.prev=e.prev;r.next=e;e.prev=r}r.prepend=prepend},8929:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.findAll=r.existsOne=r.findOne=r.findOneChild=r.find=r.filter=void 0;var a=t(2472);function filter(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}if(!Array.isArray(r))r=[r];return find(e,r,t,a)}r.filter=filter;function find(e,r,t,n){var i=[];for(var o=0,s=r;o0){var l=find(e,u.children,t,n);i.push.apply(i,l);n-=l.length;if(n<=0)break}}return i}r.find=find;function findOneChild(e,r){return r.find(e)}r.findOneChild=findOneChild;function findOne(e,r,t){if(t===void 0){t=true}var n=null;for(var i=0;i0){n=findOne(e,o.children)}}return n}r.findOne=findOne;function existsOne(e,r){return r.some((function(r){return(0,a.isTag)(r)&&(e(r)||r.children.length>0&&existsOne(e,r.children))}))}r.existsOne=existsOne;function findAll(e,r){var t;var n=[];var i=r.filter(a.isTag);var o;while(o=i.shift()){var s=(t=o.children)===null||t===void 0?void 0:t.filter(a.isTag);if(s&&s.length>0){i.unshift.apply(i,s)}if(e(o))n.push(o)}return n}r.findAll=findAll},3930:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.innerText=r.textContent=r.getText=r.getInnerHTML=r.getOuterHTML=void 0;var n=t(2472);var i=a(t(4614));var o=t(9391);function getOuterHTML(e,r){return(0,i.default)(e,r)}r.getOuterHTML=getOuterHTML;function getInnerHTML(e,r){return(0,n.hasChildren)(e)?e.children.map((function(e){return getOuterHTML(e,r)})).join(""):""}r.getInnerHTML=getInnerHTML;function getText(e){if(Array.isArray(e))return e.map(getText).join("");if((0,n.isTag)(e))return e.name==="br"?"\n":getText(e.children);if((0,n.isCDATA)(e))return getText(e.children);if((0,n.isText)(e))return e.data;return""}r.getText=getText;function textContent(e){if(Array.isArray(e))return e.map(textContent).join("");if((0,n.hasChildren)(e)&&!(0,n.isComment)(e)){return textContent(e.children)}if((0,n.isText)(e))return e.data;return""}r.textContent=textContent;function innerText(e){if(Array.isArray(e))return e.map(innerText).join("");if((0,n.hasChildren)(e)&&(e.type===o.ElementType.Tag||(0,n.isCDATA)(e))){return innerText(e.children)}if((0,n.isText)(e))return e.data;return""}r.innerText=innerText},8298:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prevElementSibling=r.nextElementSibling=r.getName=r.hasAttrib=r.getAttributeValue=r.getSiblings=r.getParent=r.getChildren=void 0;var a=t(2472);var n=[];function getChildren(e){var r;return(r=e.children)!==null&&r!==void 0?r:n}r.getChildren=getChildren;function getParent(e){return e.parent||null}r.getParent=getParent;function getSiblings(e){var r,t;var a=getParent(e);if(a!=null)return getChildren(a);var n=[e];var i=e.prev,o=e.next;while(i!=null){n.unshift(i);r=i,i=r.prev}while(o!=null){n.push(o);t=o,o=t.next}return n}r.getSiblings=getSiblings;function getAttributeValue(e,r){var t;return(t=e.attribs)===null||t===void 0?void 0:t[r]}r.getAttributeValue=getAttributeValue;function hasAttrib(e,r){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,r)&&e.attribs[r]!=null}r.hasAttrib=hasAttrib;function getName(e){return e.name}r.getName=getName;function nextElementSibling(e){var r;var t=e.next;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.next;return t}r.nextElementSibling=nextElementSibling;function prevElementSibling(e){var r;var t=e.prev;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.prev;return t}r.prevElementSibling=prevElementSibling},6674:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(1859));var i=a(t(2128));var o=a(t(4931));var s=a(t(9281));r.decodeXML=getStrictDecoder(o.default);r.decodeHTMLStrict=getStrictDecoder(n.default);function getStrictDecoder(e){var r=Object.keys(e).join("|");var t=getReplacer(e);r+="|#[xX][\\da-fA-F]+|#\\d+";var a=new RegExp("&(?:"+r+");","g");return function(e){return String(e).replace(a,t)}}var sorter=function(e,r){return e=55296&&e<=57343||e>1114111){return"�"}if(e in n.default){e=n.default[e]}var r="";if(e>65535){e-=65536;r+=String.fromCharCode(e>>>10&1023|55296);e=56320|e&1023}r+=String.fromCharCode(e);return r}r["default"]=decodeCodePoint},6032:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(4931));var i=getInverseObj(n.default);var o=getInverseReplacer(i);r.encodeXML=getInverse(i,o);var s=a(t(1859));var u=getInverseObj(s.default);var l=getInverseReplacer(u);r.encodeHTML=getInverse(u,l);function getInverseObj(e){return Object.keys(e).sort().reduce((function(r,t){r[e[t]]="&"+t+";";return r}),{})}function getInverseReplacer(e){var r=[];var t=[];Object.keys(e).forEach((function(e){return e.length===1?r.push("\\"+e):t.push(e)}));t.unshift("["+r.join("")+"]");return new RegExp(t.join("|"),"g")}var c=/[^\0-\x7F]/g;var p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function singleCharReplacer(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(e,r){var t=e.charCodeAt(0);var a=e.charCodeAt(1);var n=(t-55296)*1024+a-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}function getInverse(e,r){return function(t){return t.replace(r,(function(r){return e[r]})).replace(p,astralReplacer).replace(c,singleCharReplacer)}}var d=getInverseReplacer(i);function escape(e){return e.replace(d,singleCharReplacer).replace(p,astralReplacer).replace(c,singleCharReplacer)}r.escape=escape},9280:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(6674);var n=t(6032);function decode(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTML)(e)}r.decode=decode;function decodeStrict(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTMLStrict)(e)}r.decodeStrict=decodeStrict;function encode(e,r){return(!r||r<=0?n.encodeXML:n.encodeHTML)(e)}r.encode=encode;var i=t(6032);r.encodeXML=i.encodeXML;r.encodeHTML=i.encodeHTML;r.escape=i.escape;r.encodeHTML4=i.encodeHTML;r.encodeHTML5=i.encodeHTML;var o=t(6674);r.decodeXML=o.decodeXML;r.decodeHTML=o.decodeHTML;r.decodeHTMLStrict=o.decodeHTMLStrict;r.decodeHTML4=o.decodeHTML;r.decodeHTML5=o.decodeHTML;r.decodeHTML4Strict=o.decodeHTMLStrict;r.decodeHTML5Strict=o.decodeHTMLStrict;r.decodeXMLStrict=o.decodeXML},5902:function(e,r,t){e=t.nmd(e); +/*! https://mths.be/he v1.2.0 by @mathias | MIT license */(function(t){var a=true&&r;var n=true&&e&&e.exports==a&&e;var i=typeof global=="object"&&global;if(i.global===i||i.window===i){t=i}var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var s=/[\x01-\x7F]/g;var u=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;var l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;var c={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"};var p=/["&'<>`]/g;var d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"};var f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;var g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var h=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;var m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"};var v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"};var b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var y=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var w=String.fromCharCode;var T={};var E=T.hasOwnProperty;var has=function(e,r){return E.call(e,r)};var contains=function(e,r){var t=-1;var a=e.length;while(++t=55296&&e<=57343||e>1114111){if(r){parseError("character reference outside the permissible Unicode range")}return"�"}if(has(b,e)){if(r){parseError("disallowed character reference")}return b[e]}if(r&&contains(y,e)){parseError("disallowed character reference")}if(e>65535){e-=65536;t+=w(e>>>10&1023|55296);e=56320|e&1023}t+=w(e);return t};var hexEscape=function(e){return"&#x"+e.toString(16).toUpperCase()+";"};var decEscape=function(e){return"&#"+e+";"};var parseError=function(e){throw Error("Parse error: "+e)};var encode=function(e,r){r=merge(r,encode.options);var t=r.strict;if(t&&g.test(e)){parseError("forbidden code point")}var a=r.encodeEverything;var n=r.useNamedReferences;var i=r.allowUnsafeSymbols;var d=r.decimal?decEscape:hexEscape;var escapeBmpSymbol=function(e){return d(e.charCodeAt(0))};if(a){e=e.replace(s,(function(e){if(n&&has(c,e)){return"&"+c[e]+";"}return escapeBmpSymbol(e)}));if(n){e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")}if(n){e=e.replace(l,(function(e){return"&"+c[e]+";"}))}}else if(n){if(!i){e=e.replace(p,(function(e){return"&"+c[e]+";"}))}e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒");e=e.replace(l,(function(e){return"&"+c[e]+";"}))}else if(!i){e=e.replace(p,escapeBmpSymbol)}return e.replace(o,(function(e){var r=e.charCodeAt(0);var t=e.charCodeAt(1);var a=(r-55296)*1024+t-56320+65536;return d(a)})).replace(u,escapeBmpSymbol)};encode.options={allowUnsafeSymbols:false,encodeEverything:false,strict:false,useNamedReferences:false,decimal:false};var decode=function(e,r){r=merge(r,decode.options);var t=r.strict;if(t&&f.test(e)){parseError("malformed character reference")}return e.replace(h,(function(e,a,n,i,o,s,u,l,c){var p;var d;var f;var g;var h;var b;if(a){h=a;return m[h]}if(n){h=n;b=i;if(b&&r.isAttributeValue){if(t&&b=="="){parseError("`&` did not start a character reference")}return e}else{if(t){parseError("named character reference was not terminated by a semicolon")}return v[h]+(b||"")}}if(o){f=o;d=s;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(f,10);return codePointToSymbol(p,t)}if(u){g=u;d=l;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(g,16);return codePointToSymbol(p,t)}if(t){parseError("named character reference was not terminated by a semicolon")}return e}))};decode.options={isAttributeValue:false,strict:false};var escape=function(e){return e.replace(p,(function(e){return d[e]}))};var A={version:"1.2.0",encode:encode,decode:decode,escape:escape,unescape:decode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define((function(){return A}))}else if(a&&!a.nodeType){if(n){n.exports=A}else{for(var q in A){has(A,q)&&(a[q]=A[q])}}}else{t.he=A}})(this)},5596:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});function arr_back(e){return e[e.length-1]}r["default"]=arr_back},5417:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.NodeType=r.TextNode=r.Node=r.valid=r["default"]=r.parse=r.HTMLElement=r.CommentNode=void 0;var n=t(190);Object.defineProperty(r,"CommentNode",{enumerable:true,get:function(){return a(n).default}});var i=t(3248);Object.defineProperty(r,"HTMLElement",{enumerable:true,get:function(){return a(i).default}});var o=t(8653);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a(o).default}});Object.defineProperty(r,"default",{enumerable:true,get:function(){return a(o).default}});var s=t(3494);Object.defineProperty(r,"valid",{enumerable:true,get:function(){return a(s).default}});var u=t(7402);Object.defineProperty(r,"Node",{enumerable:true,get:function(){return a(u).default}});var l=t(111);Object.defineProperty(r,"TextNode",{enumerable:true,get:function(){return a(l).default}});var c=t(5896);Object.defineProperty(r,"NodeType",{enumerable:true,get:function(){return a(c).default}})},9958:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(5896));function isTag(e){return e&&e.nodeType===n.default.ELEMENT_NODE}function getAttributeValue(e,r){return isTag(e)?e.getAttribute(r):undefined}function getName(e){return(e&&e.rawTagName||"").toLowerCase()}function getChildren(e){return e&&e.childNodes}function getParent(e){return e?e.parentNode:null}function getText(e){return e.text}function removeSubsets(e){var r=e.length;var t;var a;var n;while(--r>-1){t=a=e[r];e[r]=null;n=true;while(a){if(e.indexOf(a)>-1){n=false;e.splice(r,1);break}a=getParent(a)}if(n){e[r]=t}}return e}function existsOne(e,r){return r.some((function(r){return isTag(r)?e(r)||existsOne(e,getChildren(r)):false}))}function getSiblings(e){var r=getParent(e);return r&&getChildren(r)}function hasAttrib(e,r){return getAttributeValue(e,r)!==undefined}function findOne(e,r){var t=null;for(var a=0,n=r.length;a0){t=findOne(e,o)}}}return t}function findAll(e,r){var t=[];for(var a=0,n=r.length;a0){r.push(e=[])}t.childNodes.forEach(dfs);if(e.length>0){r.push(e=[])}}else{t.childNodes.forEach(dfs)}}else if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){e.prependWhitespace=true}else{var a=t.trimmedText;if(e.prependWhitespace){a=" ".concat(a);e.prependWhitespace=false}e.push(a)}}}dfs(this);return r.map((function(e){return e.join("").replace(/\s{2,}/g," ")})).join("\n").replace(/\s+$/,"")},enumerable:false,configurable:true});HTMLElement.prototype.toString=function(){var e=this.rawTagName;if(e){var r=this.rawAttrs?" ".concat(this.rawAttrs):"";return this.isVoidElement?"<".concat(e).concat(r,">"):"<".concat(e).concat(r,">").concat(this.innerHTML,"")}return this.innerHTML};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return this.childNodes.map((function(e){return e.toString()})).join("")},set:function(e){var r=parse(e);var t=r.childNodes.length?r.childNodes:[new f.default(e,this)];resetParent(t,this);resetParent(this.childNodes,null);this.childNodes=t},enumerable:false,configurable:true});HTMLElement.prototype.set_content=function(e,r){if(r===void 0){r={}}if(e instanceof d.default){e=[e]}else if(typeof e=="string"){var t=parse(e,r);e=t.childNodes.length?t.childNodes:[new f.default(e,this)]}resetParent(this.childNodes,null);resetParent(e,this);this.childNodes=e;return this};HTMLElement.prototype.replaceWith=function(){var e=this;var r=[];for(var t=0;t-1){t.rawText=t.rawText.substr(0,a);this.childNodes.length=r+1}}}return this};Object.defineProperty(HTMLElement.prototype,"structure",{get:function(){var e=[];var r=0;function write(t){e.push(" ".repeat(r)+t)}function dfs(e){var t=e.id?"#".concat(e.id):"";var a=e.classList.length?".".concat(e.classList.value.join(".")):"";write("".concat(e.rawTagName).concat(t).concat(a));r++;e.childNodes.forEach((function(e){if(e.nodeType===g.default.ELEMENT_NODE){dfs(e)}else if(e.nodeType===g.default.TEXT_NODE){if(!e.isWhitespace){write("#text")}}}));r--}dfs(this);return e.join("\n")},enumerable:false,configurable:true});HTMLElement.prototype.removeWhitespace=function(){var e=this;var r=0;this.childNodes.forEach((function(t){if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){return}t.rawText=t.trimmedRawText}else if(t.nodeType===g.default.ELEMENT_NODE){t.removeWhitespace()}e.childNodes[r++]=t}));this.childNodes.length=r;return this};HTMLElement.prototype.querySelectorAll=function(e){return(0,s.selectAll)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.querySelector=function(e){return(0,s.selectOne)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.getElementsByTagName=function(e){var r=e.toUpperCase();var t=[];var a=[];var n=this;var i=0;while(i!==undefined){var o=void 0;do{o=n.childNodes[i++]}while(i0){a.push(i);n=o;i=0}}}return t};HTMLElement.prototype.getElementById=function(e){var r=[];var t=this;var a=0;while(a!==undefined){var n=void 0;do{n=t.childNodes[a++]}while(a0){r.push(a);t=n;a=0}}}return null};HTMLElement.prototype.closest=function(e){var r=new Map;var t=this;var a=null;function findOne(e,t){var a=null;for(var n=0,i=t.length;n0){var t=e[--r];if(this===t)return e[r-1]||null}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"previousElementSibling",{get:function(){if(this.parentNode){var e=this.parentNode.childNodes;var r=e.length;var t=false;while(r>0){var a=e[--r];if(t){if(a instanceof HTMLElement){return a||null}}else if(this===a){t=true}}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"classNames",{get:function(){return this.classList.toString()},enumerable:false,configurable:true});HTMLElement.prototype.clone=function(){return parse(this.toString()).firstChild};return HTMLElement}(d.default);r["default"]=A;var q=/|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g;var x=/(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;var D={area:true,AREA:true,base:true,BASE:true,br:true,BR:true,col:true,COL:true,hr:true,HR:true,img:true,IMG:true,input:true,INPUT:true,link:true,LINK:true,meta:true,META:true,source:true,SOURCE:true,embed:true,EMBED:true,param:true,PARAM:true,track:true,TRACK:true,wbr:true,WBR:true};var C={li:{li:true,LI:true},LI:{li:true,LI:true},p:{p:true,div:true,P:true,DIV:true},P:{p:true,div:true,P:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},td:{td:true,th:true,TD:true,TH:true},TD:{td:true,th:true,TD:true,TH:true},th:{td:true,th:true,TD:true,TH:true},TH:{td:true,th:true,TD:true,TH:true},h1:{h1:true,H1:true},H1:{h1:true,H1:true},h2:{h2:true,H2:true},H2:{h2:true,H2:true},h3:{h3:true,H3:true},H3:{h3:true,H3:true},h4:{h4:true,H4:true},H4:{h4:true,H4:true},h5:{h5:true,H5:true},H5:{h5:true,H5:true},h6:{h6:true,H6:true},H6:{h6:true,H6:true}};var N={li:{ul:true,ol:true,UL:true,OL:true},LI:{ul:true,ol:true,UL:true,OL:true},a:{div:true,DIV:true},A:{div:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},i:{div:true,DIV:true},I:{div:true,DIV:true},p:{div:true,DIV:true},P:{div:true,DIV:true},td:{tr:true,table:true,TR:true,TABLE:true},TD:{tr:true,table:true,TR:true,TABLE:true},th:{tr:true,table:true,TR:true,TABLE:true},TH:{tr:true,table:true,TR:true,TABLE:true}};var S="documentfragmentcontainer";function base_parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=r.blockTextElements||{script:true,noscript:true,style:true,pre:true};var a=Object.keys(t);var n=a.map((function(e){return new RegExp("^".concat(e,"$"),"i")}));var i=a.filter((function(e){return t[e]})).map((function(e){return new RegExp("^".concat(e,"$"),"i")}));function element_should_be_ignore(e){return i.some((function(r){return r.test(e)}))}function is_block_text_element(e){return n.some((function(r){return r.test(e)}))}var createRange=function(e,r){return[e-v,r-v]};var o=new A(null,{},"",null,[0,e.length]);var s=o;var u=[o];var c=-1;var d=undefined;var g;e="<".concat(S,">").concat(e,"");var h=r.lowerCaseTagName;var m=e.length-(S.length+2);var v=S.length+2;while(g=q.exec(e)){var b=g[0],y=g[1],w=g[2],T=g[3],E=g[4];var L=b.length;var k=q.lastIndex-L;var O=q.lastIndex;if(c>-1){if(c+L");var I=h?e.toLocaleLowerCase().indexOf(U,q.lastIndex):e.indexOf(U,q.lastIndex);var G=I===-1?m:I;if(element_should_be_ignore(w)){var _=e.substring(F,G);if(_.length>0&&/\S/.test(_)){s.appendChild(new f.default(_,s,createRange(F,G)))}}if(I===-1){c=q.lastIndex=e.length+1}else{c=q.lastIndex=I+U.length;y="/"}}}if(y||E||D[w]){while(true){if(w==="a"||w==="A")d=undefined;if(s.rawTagName===w){s.range[1]=createRange(-1,Math.max(c,O))[1];u.pop();s=(0,l.default)(u);break}else{var H=s.tagName;if(N[H]){if(N[H][w]){u.pop();s=(0,l.default)(u);continue}}break}}}}return u}r.base_parse=base_parse;function parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=base_parse(e,r);var a=t[0];var _loop_1=function(){var e=t.pop();var a=(0,l.default)(t);if(e.parentNode&&e.parentNode.parentNode){if(e.parentNode===a&&e.tagName===a.tagName){if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.parentNode.appendChild(e)}));t.pop()}}else{if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.appendChild(e)}))}}}else{}};while(t.length>1){_loop_1()}return a}r.parse=parse;function resetParent(e,r){return e.map((function(e){e.parentNode=r;return e}))}},7402:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(5902);var n=function(){function Node(e,r){if(e===void 0){e=null}this.parentNode=e;this.childNodes=[];Object.defineProperty(this,"range",{enumerable:false,writable:true,configurable:true,value:r!==null&&r!==void 0?r:[-1,-1]})}Node.prototype.remove=function(){var e=this;if(this.parentNode){var r=this.parentNode.childNodes;this.parentNode.childNodes=r.filter((function(r){return e!==r}));this.parentNode=null}return this};Object.defineProperty(Node.prototype,"innerText",{get:function(){return this.rawText},enumerable:false,configurable:true});Object.defineProperty(Node.prototype,"textContent",{get:function(){return(0,a.decode)(this.rawText)},set:function(e){this.rawText=(0,a.encode)(e)},enumerable:false,configurable:true});return Node}();r["default"]=n},111:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var i=t(5902);var o=n(t(7402));var s=n(t(5896));var u=function(e){a(TextNode,e);function TextNode(r,t,a){var n=e.call(this,t,a)||this;n.nodeType=s.default.TEXT_NODE;n._rawText=r;return n}TextNode.prototype.clone=function(){return new TextNode(this._rawText,null)};Object.defineProperty(TextNode.prototype,"rawText",{get:function(){return this._rawText},set:function(e){this._rawText=e;this._trimmedRawText=void 0;this._trimmedText=void 0},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedRawText",{get:function(){if(this._trimmedRawText!==undefined)return this._trimmedRawText;this._trimmedRawText=trimText(this.rawText);return this._trimmedRawText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedText",{get:function(){if(this._trimmedText!==undefined)return this._trimmedText;this._trimmedText=trimText(this.text);return this._trimmedText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"text",{get:function(){return(0,i.decode)(this.rawText)},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"isWhitespace",{get:function(){return/^(\s| )*$/.test(this.rawText)},enumerable:false,configurable:true});TextNode.prototype.toString=function(){return this.rawText};return TextNode}(o.default);r["default"]=u;function trimText(e){var r=0;var t;var a;while(r>=0&&r0&&/[^\S\r\n]/.test(e[t-1]);var i=a=t};var a=Math.abs(r);var i=(t%a+a)%a;return r>1?function(e){return e>=t&&e%a===i}:function(e){return e<=t&&e%a===i}}r.compile=compile;function generate(e){var r=e[0];var t=e[1]-1;var a=0;if(r<0){var n=-r;var i=(t%n+n)%n;return function(){var e=i+n*a++;return e>t?null:e}}if(r===0)return t<0?function(){return null}:function(){return a++===0?t:null};if(t<0){t+=r*Math.ceil(-t/r)}return function(){return r*a+++t}}r.generate=generate},7118:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.sequence=r.generate=r.compile=r.parse=void 0;var a=t(2421);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a.parse}});var n=t(3947);Object.defineProperty(r,"compile",{enumerable:true,get:function(){return n.compile}});Object.defineProperty(r,"generate",{enumerable:true,get:function(){return n.generate}});function nthCheck(e){return(0,n.compile)((0,a.parse)(e))}r["default"]=nthCheck;function sequence(e){return(0,n.generate)((0,a.parse)(e))}r.sequence=sequence},2421:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=void 0;var t=new Set([9,10,12,13,32]);var a="0".charCodeAt(0);var n="9".charCodeAt(0);function parse(e){e=e.trim().toLowerCase();if(e==="even"){return[2,0]}else if(e==="odd"){return[2,1]}var r=0;var i=0;var o=readSign();var s=readNumber();if(r=a&&e.charCodeAt(r)<=n){i=i*10+(e.charCodeAt(r)-a);r++}return r===t?null:i}function skipWhitespace(){while(r","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},2128:function(e){"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},4931:function(e){"use strict";e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')}};var r={};function __nccwpck_require__(t){var a=r[t];if(a!==undefined){return a.exports}var n=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(n.exports,n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete r[t]}n.loaded=true;return n.exports}!function(){__nccwpck_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(5417);module.exports=t})(); \ No newline at end of file diff --git a/packages/next/src/compiled/node-html-parser/index.js.cache b/packages/next/src/compiled/node-html-parser/index.js.cache deleted file mode 100644 index 075a07483840a5172f62e803ba0b418d894e279d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13544 zcmbt*d0bRSwtwBK3tbmzMU88l1dS$Y5@lZ!^U{gtO&pV%Y))p$n}AA2jY~9RGV?OY zYru^~pxHzPL`6Vczy%dVr4bbrl~qMhL4hc)M2tvWe&^Kf#>R%fe)X}bQ*}gF~PPe;Q7@RuWOY;jQ6Z#*?EcYZN^AD|mmxg~TjnZWL6G#s5lbk*fw1hP9j8e2H zU!hR$PtHk3jTq_po0k9 zNi*AFivPqrlnig9L>?s%ktS>W95|7{>IRR5(7_-a_+7xyzK&7L1PeqzA<1@r$s zZ^7bk|BDEXLY?`~WPc>U2SlZs?JN}5OBWQ4pX86^Vvrdk!#}4Xh{9Pj&p~qfC;;7J z55K_i?tY#=g!sEaVLALj;>L6>5SXU?8Cox1Dxn=r=rpJC#90PfZAVC~>>3~e5{?4S zDkj5Z)mU_QQyw0^Xeu5AuY(EcBjcRk1C1^B(X-T^=(pIXYaEFFnC6Vqm+D)TTTYNY zaaz~6ucXiJyUZD~c<1E(`by1q5!3b!YdB?+?69{g(~suG32;M(~EGI)dtOzzD{`bdbd`=$$13Gl^)2_dJ5W-oAb? zf)8Ny-Wmj6e$6-wSAqn;eZw1vgRLzu+kFW#0^ocQgP{>ail8699`^QN2f#263Xq^fvnQz}iSpdx2_QCkb$DUFyyJZ! ztMbY4h3vfVMnC9RwO`~LP&)iZ@tcsvO*}CXvZjd*Z$U;l-KXjV@P+eL@G2A=@Z&)+ zv}f>cZf@=Xz65~#14vji3%&zsT)zqW)^`R-`n&HWz1trky_-A(C zg#0eycTlSP-H|C!s-3d^_ZmrWn!4me$ku+C@CO*8ia#{`5k#s!&i({S$)E1{loI{j zPnUlNS?OmNFe7A4R^}K3m=wu+qzc|S@eWGRxTicz`>9S+yKLj6H$a7!KkFr&t%2jcJYa;0|2*(e6)bOSgo&T$eU8IHK>!oZrCFRf zp$FAw!V(3SVj#j5@JGm1I~cSfB7P`MM{yA_$#~*Ryy52xHDI$5>^+)*dNm8BfK6f}MRbo3J1!(`1{F=OWp!E+I;ZoHKI@qk;)_T4L$` zS$VU2N_;=ENS*PbEpyH&4C+Uev1K>GP0$cX^(-N^tFV&i|SddZ<5Gk$V_ zfd13&|AXxK|6Mdl5JT=8q}{OOQxgBJEl#fk^36Y1c9&PA!vCR!F$?F`*mV z=b8Zua{{3CidhI^VLb!%^mNC-{tI8Z)orsWrj*!r?>P*9VY&jtv zijr!g1dkH~$XfIE8KqN3Yu<2U;7C*msWDbE#v$*QIH@HbiC^QTj09Dhj&u=1@CO~_ z`kv|_wYxSW_!EeQ_u?QwS2u8wFE}Ud51wS>(uECh$kZoql(IJ>5tJsaN<)H>kp^fC2|a5Wk@R&^?mEF%_Z{?-{F4e=g{&p$1Lh8%)FfX&RTu_&%8qR?vb=#$z*(kO&M=H)iqB%z@-HF|) z+bJdP!kS&Xq_w-TCTF*ln~OCSxzgc1=&Vb7q^o;H-yJ%}*iD-@?K4yg37v3mwCV)4 zOEyke1!60Ec7m_F51#Cb!2vJ+Q#fG`%o>q`Dy4%}*!MGMq|CDtoO^1{O4}}DP4Q(Z ztr_7RY?i`WkXY9uH437=MM}AffC=GvzI&Pw=odle(Gq5DfM$TS`9S0p+x-&Z~#R?^}X8bg3ncDDoZG{jv%{0nR&iGtIWsC18*dgKv7bNs;qdis!V0sDBAIEh|JLg70}^ky>F1f|fN z6s$R#LR$qv$Qv*VvjB(n2K;zA4GTp%sK;czyz;|nX&A-TN23J~25iXts$0}<+6>rU zkc;YhX8C#eVG#N^I7J(y8tQ{uA*FAi%^Oq@g;>U!Q4pgVQk&WMzZArJ2|n(gKDdr` zV5Bt#l#MZdH5R0C1g@pg1L^4aqv`Z^IyycvgWkk`TdywedL!KP}_dX;p?4x%Du{n>nKBUJ`sw#R6Ds0|$N=H-eTY6p1l0F0;e|r6gScvf>?Q(?!JsQXD(C26(q8*&@+MvX`)$8g4IOh znvp1MrqQ>k1Jf7Wq6N1pL?<{?1!rYtrUGi{!*Jt_=OD*faOxmUFQkrCzo(GyD57}z z6gvv;ivv*@()vR*_Yivd&>+WmuC^Mz@z?P25SEc@k@KPtqeNu_oda zEj)#U#Rfb8c)?7Eou&s)BkU)qX>2(*OD(54TQUS;2N4&gS;hYXwez8zw<18d=`n@=jifUB;smmX02JbHJ+UF z^vZc_n{Z%yMOYwYR~>Du$Az17ffiptEfp7N;{}v1y-4#LD234kIJg3$2dgVUoz6BZ zpb=DR<9ZHO9&pHl6>tJ(|G*;9=4zY+XBm;o@6erXXzyGbJ%1l3+Rgj4_K_eS(|th< zYEA{QCBY1O9}~>(1v3Z?ks+)+gbjilc?gSJ!o;AB$;vXQNK3p_q^emPq(k8h(#vxJ zFE3ZzuU`U?bB}^Dm;(3+1k=f-EMz%aGA(Bp!w}8Ja8@0`?5Q4NoND;FKdFXQH8zGv zgW-^#J>=!;tF6g$3#wn3(TcqGU-J9b6X6}rD zX49Eh0o#h6JLBW#io@Ls9T{E;hCVaSpA8+shYBUD*zH6HH|C(#taUXKhBYj7EfO2n zvb{+R;z(H%>i|O1M-3QmBU6c(}$JG^5Zi%3Nm97tv9>v1MrSo7)r16W>Kjr8 zG6Xj3Eftt*#s=8mdI#p~?uRFaJ^-q&8Gu2&{7|R`9~ZOyVzkv#%nV16$U4FxNeUq{fIj}qJ%&V$$t%W`28DT&u1WY!18=z2J=7cx<_;2x z3gJZ|+#YnpWlVN}3u0JS)+p?wNH|r7nCW}>G_k*;USh{n&2^aJg7p1D^|lJVo44_0 zU?}MC?XuzJ<>w7^LYS?grEe^ke9=r;vX1I0V5t|cdb;_5 zolvl`O#^n|QOuvrdP|n`w&iH2GL&Bn<#6IS5XP&+kk}B;^TLt%Eu6nSeF<3A{A{^>ilim5E3sC-Q>TNWj7iGe6(Qfk<3yjt&B* zO~U11@IVFEOFvv%{^iiAb^W1ZF6x<;LS<+Y4@>26z1*A18&VNa@p`^w6W7Rk zLR<{pu5sx}{Bbge;1HR@LsNN=*SH5sd}T6%UzN2V6(kfJANquMkB10lxhJLh3xgR~wXWtSvw|Hb561i-(r-)I3#w&D+dyg$X%s$CL+!G!Yzq=8Ta?{f6wpHK z!pM8?!lV0Xcyl%<>j}3cPifz;P^u@)fNYF1h3;zDRbz%tlsO91QM*v;c?x^oD@NwRUnwHI;zB!C_U~L!AF#Y zBiPZ@BgzdynDtnlHFqCVjvo_q%e-5_IpQ<3y~m}>x#J3i<_E`>v=b=Qd_s97h_EuH zstoZJo>WepLRRi+Wk)#@aTUtG3M4jGD&>_(tf^9VR3Tw?o-L5fyNhs-jYHo8hic6y zpJ(50c=?JG*1O=%m*#>;VR&3D=QY6++N@7eAAz=>r;x9=7rqR313kA% zls$J*xh9C!mz2$yu;$Vwr9%)w4a%AZtbwbhbySIIRB{{9ZX(8>63p`)XW|4^@mgk&@+c}-|8v{^}R zMxvovxhIIw7G+0^=vRvp^s@@y5)B0)-v#D%F4WrqngM`%d4LG-CINu|Mga2~eA|G* z2seHVMm1NJlv@hCNdQklvD;J4j_Zo)24bwfp;X^Q;`&V``4$qSFDyiy-PKQDe~LcB z#npOt&jwJz>hykgsrdN$AgDJ0P~^V=6ex@MkGY3}C3oSs)zsVo~+3wl%K?j}BPhygVjw^dd85vnScWuxkw-c)(|d0+=~LCrw; z1{FK#^r5OsW!b2L2?L*vjuCyde32^#%J~C-92{W7CJ7(5#=;j;A4~pt7#a*ed6eaa ztqi5{^XJWkjQGFbM#+!xo09O%2c!Q4MF?k6(zR`U3<3hejzebOLqi z`-MXX&J;psU>L@qB@LE~4It*;DUm*#p;8+2iD+E3@EwatS3bob$)_Ldjs{?ueu6v! zzT`@Tc>@~Yr`E$KVgXp@ScZEo%w6!!LOXwu5V6`Y`F}JD6(7P5$GU#-RWZm&njn^l6emR=f#LRjIZS7Ai+)q5cd`RJp^bg}T}$7dOmO_x4Z=^;TEg4*-SQ zcJu%X6$Eby)Vl8!3-!5+g}M#rZI!$5c?)IV-$G@NvQU{_ZJS{8R$DCU>c`S9EzN^0 z+=E@HzK16XYKz8^7V58kE!3PYEd9Is_D+{wc(Y?}tM97o(^XgBWp`{B)$+2X#X(}B za^UczB4~xdQmF-9T;8ScWS5`QyZZKZ7t&K*JzCu5jhDK-I|(jvs^*VilB(3Cu2BGE zM4l*rBrlPZ_zhf#LWxw;u>{-R5L~b zdIDBJ!n!j*Wo@TG2TT`LqHbJ@eJ2bvnYUo(;<<2jL%He4vhU-~Ht=8HELilq_3$wNKT>P1BV->M}>@BL1k`H&R#bs!R2OZ<=-I zbhGx??XloUv{#{xqQQa|UTh9C85}qk`V#HiLrn%p1q=O% z_ASun4Jr~iB=DsmquXW9ir_6oKYjOFo|gE0o&-8u<#zyj)lU@qp(;r7OgSRIw3h4O9 zVA;hkvHxJXXoSxk(*R$;`?K9U{N_Sg^m=;7{rSZs-uR}-vD3Zd%|&9rg@`spa@8cx z`6o<&FZk^avLBZE|M@e(#z~$1#WoD*1_%>fdoaeKc*_X^9>oz!ro=HidIHD0Eu=o.length&&s.test(t)&&e(r)}},exists:function(e,r,t){var a=r.name;var n=t.adapter;return function(r){return n.hasAttrib(r,a)&&e(r)}},start:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=s&&t.substr(0,s).toLowerCase()===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.startsWith(o))&&e(r)}},end:function(e,r,t){var n=t.adapter;var i=r.name;var o=r.value;var s=-o.length;if(s===0){return a.falseFunc}if(shouldIgnoreCase(r,t)){o=o.toLowerCase();return function(r){var t;return((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.substr(s).toLowerCase())===o&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.endsWith(o))&&e(r)}},any:function(e,r,t){var n=t.adapter;var i=r.name,o=r.value;if(o===""){return a.falseFunc}if(shouldIgnoreCase(r,t)){var s=new RegExp(escapeRegex(o),"i");return function anyIC(r){var t=n.getAttributeValue(r,i);return t!=null&&t.length>=o.length&&s.test(t)&&e(r)}}return function(r){var t;return!!((t=n.getAttributeValue(r,i))===null||t===void 0?void 0:t.includes(o))&&e(r)}},not:function(e,r,t){var a=t.adapter;var n=r.name;var i=r.value;if(i===""){return function(r){return!!a.getAttributeValue(r,n)&&e(r)}}else if(shouldIgnoreCase(r,t)){i=i.toLowerCase();return function(r){var t=a.getAttributeValue(r,n);return(t==null||t.length!==i.length||t.toLowerCase()!==i)&&e(r)}}return function(r){return a.getAttributeValue(r,n)!==i&&e(r)}}}},8689:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.compileToken=r.compileUnsafe=r.compile=void 0;var n=t(8065);var i=t(2947);var o=a(t(4901));var s=t(538);var u=t(7088);var l=t(4428);function compile(e,r,t){var a=compileUnsafe(e,r,t);return(0,l.ensureIsTag)(a,r.adapter)}r.compile=compile;function compileUnsafe(e,r,t){var a=typeof e==="string"?(0,n.parse)(e):e;return compileToken(a,r,t)}r.compileUnsafe=compileUnsafe;function includesScopePseudo(e){return e.type==="pseudo"&&(e.name==="scope"||Array.isArray(e.data)&&e.data.some((function(e){return e.some(includesScopePseudo)})))}var c={type:n.SelectorType.Descendant};var p={type:"_flexibleDescendant"};var d={type:n.SelectorType.Pseudo,name:"scope",data:null};function absolutize(e,r,t){var a=r.adapter;var n=!!(t===null||t===void 0?void 0:t.every((function(e){var r=a.isTag(e)&&a.getParent(e);return e===l.PLACEHOLDER_ELEMENT||r&&a.isTag(r)})));for(var i=0,o=e;i0&&(0,s.isTraversal)(u[0])&&u[0].type!=="descendant"){}else if(n&&!u.some(includesScopePseudo)){u.unshift(c)}else{continue}u.unshift(d)}}function compileToken(e,r,t){var a;e=e.filter((function(e){return e.length>0}));e.forEach(o.default);t=(a=r.context)!==null&&a!==void 0?a:t;var n=Array.isArray(t);var s=t&&(Array.isArray(t)?t:[t]);absolutize(e,r,s);var u=false;var l=e.map((function(e){if(e.length>=2){var t=e[0],a=e[1];if(t.type!=="pseudo"||t.name!=="scope"){}else if(n&&a.type==="descendant"){e[1]=p}else if(a.type==="adjacent"||a.type==="sibling"){u=true}}return compileRules(e,r,s)})).reduce(reduceRules,i.falseFunc);l.shouldTestNextSiblings=u;return l}r.compileToken=compileToken;function compileRules(e,r,t){var a;return e.reduce((function(e,a){return e===i.falseFunc?i.falseFunc:(0,u.compileGeneralSelector)(e,a,r,t,compileToken)}),(a=r.rootFunc)!==null&&a!==void 0?a:i.trueFunc)}function reduceRules(e,r){if(r===i.falseFunc||e===i.trueFunc){return e}if(e===i.falseFunc||r===i.trueFunc){return r}return function combine(t){return e(t)||r(t)}}},7088:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compileGeneralSelector=void 0;var a=t(3387);var n=t(6463);var i=t(8065);function compileGeneralSelector(e,r,t,o,s){var u=t.adapter,l=t.equals;switch(r.type){case i.SelectorType.PseudoElement:{throw new Error("Pseudo-elements are not supported by css-select")}case i.SelectorType.ColumnCombinator:{throw new Error("Column combinators are not yet supported by css-select")}case i.SelectorType.Attribute:{if(r.namespace!=null){throw new Error("Namespaced attributes are not yet supported by css-select")}if(!t.xmlMode||t.lowerCaseAttributeNames){r.name=r.name.toLowerCase()}return a.attributeRules[r.action](e,r,t)}case i.SelectorType.Pseudo:{return(0,n.compilePseudoSelector)(e,r,t,o,s)}case i.SelectorType.Tag:{if(r.namespace!=null){throw new Error("Namespaced tag names are not yet supported by css-select")}var c=r.name;if(!t.xmlMode||t.lowerCaseTags){c=c.toLowerCase()}return function tag(r){return u.getName(r)===c&&e(r)}}case i.SelectorType.Descendant:{if(t.cacheResults===false||typeof WeakSet==="undefined"){return function descendant(r){var t=r;while(t=u.getParent(t)){if(u.isTag(t)&&e(t)){return true}}return false}}var p=new WeakSet;return function cachedDescendant(r){var t=r;while(t=u.getParent(t)){if(!p.has(t)){if(u.isTag(t)&&e(t)){return true}p.add(t)}}return false}}case"_flexibleDescendant":{return function flexibleDescendant(r){var t=r;do{if(u.isTag(t)&&e(t))return true}while(t=u.getParent(t));return false}}case i.SelectorType.Parent:{return function parent(r){return u.getChildren(r).some((function(r){return u.isTag(r)&&e(r)}))}}case i.SelectorType.Child:{return function child(r){var t=u.getParent(r);return t!=null&&u.isTag(t)&&e(t)}}case i.SelectorType.Sibling:{return function sibling(r){var t=u.getSiblings(r);for(var a=0;a option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"}},6804:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.filters=void 0;var n=a(t(7118));var i=t(2947);function getChildFunc(e,r){return function(t){var a=r.getParent(t);return a!=null&&r.isTag(a)&&e(t)}}r.filters={contains:function(e,r,t){var a=t.adapter;return function contains(t){return e(t)&&a.getText(t).includes(r)}},icontains:function(e,r,t){var a=t.adapter;var n=r.toLowerCase();return function icontains(r){return e(r)&&a.getText(r).toLowerCase().includes(n)}},"nth-child":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthChild(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){if(o(r,t[i]))break;if(a.isTag(t[i])){n++}}return s(n)&&e(r)}},"nth-of-type":function(e,r,t){var a=t.adapter,o=t.equals;var s=(0,n.default)(r);if(s===i.falseFunc)return i.falseFunc;if(s===i.trueFunc)return getChildFunc(e,a);return function nthOfType(r){var t=a.getSiblings(r);var n=0;for(var i=0;i=0;i--){var u=t[i];if(o(r,u))break;if(a.isTag(u)&&a.getName(u)===a.getName(r)){n++}}return s(n)&&e(r)}},root:function(e,r,t){var a=t.adapter;return function(r){var t=a.getParent(r);return(t==null||!a.isTag(t))&&e(r)}},scope:function(e,t,a,n){var i=a.equals;if(!n||n.length===0){return r.filters.root(e,t,a)}if(n.length===1){return function(r){return i(n[0],r)&&e(r)}}return function(r){return n.includes(r)&&e(r)}},hover:dynamicStatePseudo("isHovered"),visited:dynamicStatePseudo("isVisited"),active:dynamicStatePseudo("isActive")};function dynamicStatePseudo(e){return function dynamicPseudo(r,t,a){var n=a.adapter;var o=n[e];if(typeof o!=="function"){return i.falseFunc}return function active(e){return o(e)&&r(e)}}}},6463:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.compilePseudoSelector=r.aliases=r.pseudos=r.filters=void 0;var a=t(2947);var n=t(8065);var i=t(6804);Object.defineProperty(r,"filters",{enumerable:true,get:function(){return i.filters}});var o=t(6973);Object.defineProperty(r,"pseudos",{enumerable:true,get:function(){return o.pseudos}});var s=t(8680);Object.defineProperty(r,"aliases",{enumerable:true,get:function(){return s.aliases}});var u=t(4428);function compilePseudoSelector(e,r,t,l,c){var p=r.name,d=r.data;if(Array.isArray(d)){return u.subselects[p](e,d,t,l,c)}if(p in s.aliases){if(d!=null){throw new Error("Pseudo ".concat(p," doesn't have any arguments"))}var f=(0,n.parse)(s.aliases[p]);return u.subselects.is(e,f,t,l,c)}if(p in i.filters){return i.filters[p](e,d,t,l)}if(p in o.pseudos){var g=o.pseudos[p];(0,o.verifyPseudoArgs)(g,p,d);return g===a.falseFunc?a.falseFunc:e===a.trueFunc?function(e){return g(e,t,d)}:function(r){return g(r,t,d)&&e(r)}}throw new Error("unmatched pseudo-class :".concat(p))}r.compilePseudoSelector=compilePseudoSelector},6973:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.verifyPseudoArgs=r.pseudos=void 0;r.pseudos={empty:function(e,r){var t=r.adapter;return!t.getChildren(e).some((function(e){return t.isTag(e)||t.getText(e)!==""}))},"first-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e).find((function(e){return t.isTag(e)}));return n!=null&&a(e,n)},"last-child":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);for(var i=n.length-1;i>=0;i--){if(a(e,n[i]))return true;if(t.isTag(n[i]))break}return false},"first-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getSiblings(e);var i=t.getName(e);for(var o=0;o=0;o--){var s=n[o];if(a(e,s))return true;if(t.isTag(s)&&t.getName(s)===i){break}}return false},"only-of-type":function(e,r){var t=r.adapter,a=r.equals;var n=t.getName(e);return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)||t.getName(r)!==n}))},"only-child":function(e,r){var t=r.adapter,a=r.equals;return t.getSiblings(e).every((function(r){return a(e,r)||!t.isTag(r)}))}};function verifyPseudoArgs(e,r,t){if(t===null){if(e.length>2){throw new Error("pseudo-selector :".concat(r," requires an argument"))}}else if(e.length===2){throw new Error("pseudo-selector :".concat(r," doesn't have any arguments"))}}r.verifyPseudoArgs=verifyPseudoArgs},4428:function(e,r,t){"use strict";var a=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,i;a=0&&a>=1}}else if(e.type===a.SelectorType.Pseudo){if(!e.data){r=3}else if(e.name==="has"||e.name==="contains"){r=0}else if(Array.isArray(e.data)){r=0;for(var t=0;tr)r=o}if(e.data.length>1&&r>0)r-=1}else{r=1}}return r}},8065:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.stringify=r.parse=r.isTraversal=void 0;n(t(5615),r);var i=t(2422);Object.defineProperty(r,"isTraversal",{enumerable:true,get:function(){return i.isTraversal}});Object.defineProperty(r,"parse",{enumerable:true,get:function(){return i.parse}});var o=t(8279);Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return o.stringify}})},2422:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=r.isTraversal=void 0;var a=t(5615);var n=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;var i=/\\([\da-f]{1,6}\s?|(\s)|.)/gi;var o=new Map([[126,a.AttributeAction.Element],[94,a.AttributeAction.Start],[36,a.AttributeAction.End],[42,a.AttributeAction.Any],[33,a.AttributeAction.Not],[124,a.AttributeAction.Hyphen]]);var s=new Set(["has","not","matches","is","where","host","host-context"]);function isTraversal(e){switch(e.type){case a.SelectorType.Adjacent:case a.SelectorType.Child:case a.SelectorType.Descendant:case a.SelectorType.Parent:case a.SelectorType.Sibling:case a.SelectorType.ColumnCombinator:return true;default:return false}}r.isTraversal=isTraversal;var u=new Set(["contains","icontains"]);function funescape(e,r,t){var a=parseInt(r,16)-65536;return a!==a||t?r:a<0?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,a&1023|56320)}function unescapeCSS(e){return e.replace(i,funescape)}function isQuote(e){return e===39||e===34}function isWhitespace(e){return e===32||e===9||e===10||e===12||e===13}function parse(e){var r=[];var t=parseSelector(r,"".concat(e),0);if(t0&&t0&&isTraversal(i[i.length-1])){throw new Error("Did not expect successive traversals.")}}function addTraversal(e){if(i.length>0&&i[i.length-1].type===a.SelectorType.Descendant){i[i.length-1].type=e;return}ensureNotTraversal();i.push({type:e})}function addSpecialAttribute(e,r){i.push({type:a.SelectorType.Attribute,name:e,action:r,value:getName(1),namespace:null,ignoreCase:"quirks"})}function finalizeSubselector(){if(i.length&&i[i.length-1].type===a.SelectorType.Descendant){i.pop()}if(i.length===0){throw new Error("Empty sub-selector")}e.push(i)}stripWhitespace(0);if(r.length===t){return t}e:while(t ":" > ";case n.SelectorType.Parent:return r===0?"< ":" < ";case n.SelectorType.Sibling:return r===0?"~ ":" ~ ";case n.SelectorType.Adjacent:return r===0?"+ ":" + ";case n.SelectorType.Descendant:return" ";case n.SelectorType.ColumnCombinator:return r===0?"|| ":" || ";case n.SelectorType.Universal:return e.namespace==="*"&&r+10?a+e.slice(t):e}},5615:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AttributeAction=r.IgnoreCaseMode=r.SelectorType=void 0;var t;(function(e){e["Attribute"]="attribute";e["Pseudo"]="pseudo";e["PseudoElement"]="pseudo-element";e["Tag"]="tag";e["Universal"]="universal";e["Adjacent"]="adjacent";e["Child"]="child";e["Descendant"]="descendant";e["Parent"]="parent";e["Sibling"]="sibling";e["ColumnCombinator"]="column-combinator"})(t=r.SelectorType||(r.SelectorType={}));r.IgnoreCaseMode={Unknown:null,QuirksMode:"quirks",IgnoreCase:true,CaseSensitive:false};var a;(function(e){e["Any"]="any";e["Element"]="element";e["End"]="end";e["Equals"]="equals";e["Exists"]="exists";e["Hyphen"]="hyphen";e["Not"]="not";e["Start"]="start"})(a=r.AttributeAction||(r.AttributeAction={}))},7537:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.attributeNames=r.elementNames=void 0;r.elementNames=new Map([["altglyph","altGlyph"],["altglyphdef","altGlyphDef"],["altglyphitem","altGlyphItem"],["animatecolor","animateColor"],["animatemotion","animateMotion"],["animatetransform","animateTransform"],["clippath","clipPath"],["feblend","feBlend"],["fecolormatrix","feColorMatrix"],["fecomponenttransfer","feComponentTransfer"],["fecomposite","feComposite"],["feconvolvematrix","feConvolveMatrix"],["fediffuselighting","feDiffuseLighting"],["fedisplacementmap","feDisplacementMap"],["fedistantlight","feDistantLight"],["fedropshadow","feDropShadow"],["feflood","feFlood"],["fefunca","feFuncA"],["fefuncb","feFuncB"],["fefuncg","feFuncG"],["fefuncr","feFuncR"],["fegaussianblur","feGaussianBlur"],["feimage","feImage"],["femerge","feMerge"],["femergenode","feMergeNode"],["femorphology","feMorphology"],["feoffset","feOffset"],["fepointlight","fePointLight"],["fespecularlighting","feSpecularLighting"],["fespotlight","feSpotLight"],["fetile","feTile"],["feturbulence","feTurbulence"],["foreignobject","foreignObject"],["glyphref","glyphRef"],["lineargradient","linearGradient"],["radialgradient","radialGradient"],["textpath","textPath"]]);r.attributeNames=new Map([["definitionurl","definitionURL"],["attributename","attributeName"],["attributetype","attributeType"],["basefrequency","baseFrequency"],["baseprofile","baseProfile"],["calcmode","calcMode"],["clippathunits","clipPathUnits"],["diffuseconstant","diffuseConstant"],["edgemode","edgeMode"],["filterunits","filterUnits"],["glyphref","glyphRef"],["gradienttransform","gradientTransform"],["gradientunits","gradientUnits"],["kernelmatrix","kernelMatrix"],["kernelunitlength","kernelUnitLength"],["keypoints","keyPoints"],["keysplines","keySplines"],["keytimes","keyTimes"],["lengthadjust","lengthAdjust"],["limitingconeangle","limitingConeAngle"],["markerheight","markerHeight"],["markerunits","markerUnits"],["markerwidth","markerWidth"],["maskcontentunits","maskContentUnits"],["maskunits","maskUnits"],["numoctaves","numOctaves"],["pathlength","pathLength"],["patterncontentunits","patternContentUnits"],["patterntransform","patternTransform"],["patternunits","patternUnits"],["pointsatx","pointsAtX"],["pointsaty","pointsAtY"],["pointsatz","pointsAtZ"],["preservealpha","preserveAlpha"],["preserveaspectratio","preserveAspectRatio"],["primitiveunits","primitiveUnits"],["refx","refX"],["refy","refY"],["repeatcount","repeatCount"],["repeatdur","repeatDur"],["requiredextensions","requiredExtensions"],["requiredfeatures","requiredFeatures"],["specularconstant","specularConstant"],["specularexponent","specularExponent"],["spreadmethod","spreadMethod"],["startoffset","startOffset"],["stddeviation","stdDeviation"],["stitchtiles","stitchTiles"],["surfacescale","surfaceScale"],["systemlanguage","systemLanguage"],["tablevalues","tableValues"],["targetx","targetX"],["targety","targetY"],["textlength","textLength"],["viewbox","viewBox"],["viewtarget","viewTarget"],["xchannelselector","xChannelSelector"],["ychannelselector","yChannelSelector"],["zoomandpan","zoomAndPan"]])},4614:function(e,r,t){"use strict";var a=this&&this.__assign||function(){a=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0){n+=render(e.children,r)}if(r.xmlMode||!p.has(e.name)){n+=""}}return n}function renderDirective(e){return"<"+e.data+">"}function renderText(e,r){var t=e.data||"";if(r.decodeEntities!==false&&!(!r.xmlMode&&e.parent&&c.has(e.parent.name))){t=u.encodeXML(t)}return t}function renderCdata(e){return""}function renderComment(e){return"\x3c!--"+e.data+"--\x3e"}},9391:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Doctype=r.CDATA=r.Tag=r.Style=r.Script=r.Comment=r.Directive=r.Text=r.Root=r.isTag=r.ElementType=void 0;var t;(function(e){e["Root"]="root";e["Text"]="text";e["Directive"]="directive";e["Comment"]="comment";e["Script"]="script";e["Style"]="style";e["Tag"]="tag";e["CDATA"]="cdata";e["Doctype"]="doctype"})(t=r.ElementType||(r.ElementType={}));function isTag(e){return e.type===t.Tag||e.type===t.Script||e.type===t.Style}r.isTag=isTag;r.Root=t.Root;r.Text=t.Text;r.Directive=t.Directive;r.Comment=t.Comment;r.Script=t.Script;r.Style=t.Style;r.Tag=t.Tag;r.CDATA=t.CDATA;r.Doctype=t.Doctype},2472:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;var n=Object.getOwnPropertyDescriptor(r,t);if(!n||("get"in n?!r.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return r[t]}}}Object.defineProperty(e,a,n)}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.DomHandler=void 0;var i=t(9391);var o=t(1508);n(t(1508),r);var s=/\s+/g;var u={normalizeWhitespace:false,withStartIndices:false,withEndIndices:false,xmlMode:false};var l=function(){function DomHandler(e,r,t){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null;if(typeof r==="function"){t=r;r=u}if(typeof e==="object"){r=e;e=undefined}this.callback=e!==null&&e!==void 0?e:null;this.options=r!==null&&r!==void 0?r:u;this.elementCB=t!==null&&t!==void 0?t:null}DomHandler.prototype.onparserinit=function(e){this.parser=e};DomHandler.prototype.onreset=function(){this.dom=[];this.root=new o.Document(this.dom);this.done=false;this.tagStack=[this.root];this.lastNode=null;this.parser=null};DomHandler.prototype.onend=function(){if(this.done)return;this.done=true;this.parser=null;this.handleCallback(null)};DomHandler.prototype.onerror=function(e){this.handleCallback(e)};DomHandler.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}if(this.elementCB)this.elementCB(e)};DomHandler.prototype.onopentag=function(e,r){var t=this.options.xmlMode?i.ElementType.Tag:undefined;var a=new o.Element(e,r,undefined,t);this.addNode(a);this.tagStack.push(a)};DomHandler.prototype.ontext=function(e){var r=this.options.normalizeWhitespace;var t=this.lastNode;if(t&&t.type===i.ElementType.Text){if(r){t.data=(t.data+e).replace(s," ")}else{t.data+=e}if(this.options.withEndIndices){t.endIndex=this.parser.endIndex}}else{if(r){e=e.replace(s," ")}var a=new o.Text(e);this.addNode(a);this.lastNode=a}};DomHandler.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment){this.lastNode.data+=e;return}var r=new o.Comment(e);this.addNode(r);this.lastNode=r};DomHandler.prototype.oncommentend=function(){this.lastNode=null};DomHandler.prototype.oncdatastart=function(){var e=new o.Text("");var r=new o.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(r);e.parent=r;this.lastNode=e};DomHandler.prototype.oncdataend=function(){this.lastNode=null};DomHandler.prototype.onprocessinginstruction=function(e,r){var t=new o.ProcessingInstruction(e,r);this.addNode(t)};DomHandler.prototype.handleCallback=function(e){if(typeof this.callback==="function"){this.callback(e,this.dom)}else if(e){throw e}};DomHandler.prototype.addNode=function(e){var r=this.tagStack[this.tagStack.length-1];var t=r.children[r.children.length-1];if(this.options.withStartIndices){e.startIndex=this.parser.startIndex}if(this.options.withEndIndices){e.endIndex=this.parser.endIndex}r.children.push(e);if(t){e.prev=t;t.next=e}e.parent=r;this.lastNode=null};return DomHandler}();r.DomHandler=l;r["default"]=l},1508:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__assign||function(){n=Object.assign||function(e){for(var r,t=1,a=arguments.length;t0?this.children[this.children.length-1]:null},enumerable:false,configurable:true});Object.defineProperty(NodeWithChildren.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:false,configurable:true});return NodeWithChildren}(s);r.NodeWithChildren=d;var f=function(e){a(Document,e);function Document(r){return e.call(this,i.ElementType.Root,r)||this}return Document}(d);r.Document=f;var g=function(e){a(Element,e);function Element(r,t,a,n){if(a===void 0){a=[]}if(n===void 0){n=r==="script"?i.ElementType.Script:r==="style"?i.ElementType.Style:i.ElementType.Tag}var o=e.call(this,n,a)||this;o.name=r;o.attribs=t;return o}Object.defineProperty(Element.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:false,configurable:true});Object.defineProperty(Element.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map((function(r){var t,a;return{name:r,value:e.attribs[r],namespace:(t=e["x-attribsNamespace"])===null||t===void 0?void 0:t[r],prefix:(a=e["x-attribsPrefix"])===null||a===void 0?void 0:a[r]}}))},enumerable:false,configurable:true});return Element}(d);r.Element=g;function isTag(e){return(0,i.isTag)(e)}r.isTag=isTag;function isCDATA(e){return e.type===i.ElementType.CDATA}r.isCDATA=isCDATA;function isText(e){return e.type===i.ElementType.Text}r.isText=isText;function isComment(e){return e.type===i.ElementType.Comment}r.isComment=isComment;function isDirective(e){return e.type===i.ElementType.Directive}r.isDirective=isDirective;function isDocument(e){return e.type===i.ElementType.Root}r.isDocument=isDocument;function hasChildren(e){return Object.prototype.hasOwnProperty.call(e,"children")}r.hasChildren=hasChildren;function cloneNode(e,r){if(r===void 0){r=false}var t;if(isText(e)){t=new l(e.data)}else if(isComment(e)){t=new c(e.data)}else if(isTag(e)){var a=r?cloneChildren(e.children):[];var o=new g(e.name,n({},e.attribs),a);a.forEach((function(e){return e.parent=o}));if(e.namespace!=null){o.namespace=e.namespace}if(e["x-attribsNamespace"]){o["x-attribsNamespace"]=n({},e["x-attribsNamespace"])}if(e["x-attribsPrefix"]){o["x-attribsPrefix"]=n({},e["x-attribsPrefix"])}t=o}else if(isCDATA(e)){var a=r?cloneChildren(e.children):[];var s=new d(i.ElementType.CDATA,a);a.forEach((function(e){return e.parent=s}));t=s}else if(isDocument(e)){var a=r?cloneChildren(e.children):[];var u=new f(a);a.forEach((function(e){return e.parent=u}));if(e["x-mode"]){u["x-mode"]=e["x-mode"]}t=u}else if(isDirective(e)){var h=new p(e.name,e.data);if(e["x-name"]!=null){h["x-name"]=e["x-name"];h["x-publicId"]=e["x-publicId"];h["x-systemId"]=e["x-systemId"]}t=h}else{throw new Error("Not implemented yet: ".concat(e.type))}t.startIndex=e.startIndex;t.endIndex=e.endIndex;if(e.sourceCodeLocation!=null){t.sourceCodeLocation=e.sourceCodeLocation}return t}r.cloneNode=cloneNode;function cloneChildren(e){var r=e.map((function(e){return cloneNode(e,true)}));for(var t=1;t=0){var t=e[r];if(r>0&&e.lastIndexOf(t,r-1)>=0){e.splice(r,1);continue}for(var a=t.parent;a;a=a.parent){if(e.includes(a)){e.splice(r,1);break}}}return e}r.removeSubsets=removeSubsets;function compareDocumentPosition(e,r){var t=[];var n=[];if(e===r){return 0}var i=(0,a.hasChildren)(e)?e:e.parent;while(i){t.unshift(i);i=i.parent}i=(0,a.hasChildren)(r)?r:r.parent;while(i){n.unshift(i);i=i.parent}var o=Math.min(t.length,n.length);var s=0;while(sl.indexOf(p)){if(u===r){return 4|16}return 4}if(u===e){return 2|8}return 2}r.compareDocumentPosition=compareDocumentPosition;function uniqueSort(e){e=e.filter((function(e,r,t){return!t.includes(e,r+1)}));e.sort((function(e,r){var t=compareDocumentPosition(e,r);if(t&2){return-1}else if(t&4){return 1}return 0}));return e}r.uniqueSort=uniqueSort},5861:function(e,r,t){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,r,t,a){if(a===undefined)a=t;Object.defineProperty(e,a,{enumerable:true,get:function(){return r[t]}})}:function(e,r,t,a){if(a===undefined)a=t;e[a]=r[t]});var n=this&&this.__exportStar||function(e,r){for(var t in e)if(t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t))a(r,e,t)};Object.defineProperty(r,"__esModule",{value:true});r.hasChildren=r.isDocument=r.isComment=r.isText=r.isCDATA=r.isTag=void 0;n(t(3930),r);n(t(8298),r);n(t(1655),r);n(t(8929),r);n(t(7102),r);n(t(5509),r);n(t(3442),r);var i=t(2472);Object.defineProperty(r,"isTag",{enumerable:true,get:function(){return i.isTag}});Object.defineProperty(r,"isCDATA",{enumerable:true,get:function(){return i.isCDATA}});Object.defineProperty(r,"isText",{enumerable:true,get:function(){return i.isText}});Object.defineProperty(r,"isComment",{enumerable:true,get:function(){return i.isComment}});Object.defineProperty(r,"isDocument",{enumerable:true,get:function(){return i.isDocument}});Object.defineProperty(r,"hasChildren",{enumerable:true,get:function(){return i.hasChildren}})},7102:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.getElementsByTagType=r.getElementsByTagName=r.getElementById=r.getElements=r.testElement=void 0;var a=t(2472);var n=t(8929);var i={tag_name:function(e){if(typeof e==="function"){return function(r){return(0,a.isTag)(r)&&e(r.name)}}else if(e==="*"){return a.isTag}return function(r){return(0,a.isTag)(r)&&r.name===e}},tag_type:function(e){if(typeof e==="function"){return function(r){return e(r.type)}}return function(r){return r.type===e}},tag_contains:function(e){if(typeof e==="function"){return function(r){return(0,a.isText)(r)&&e(r.data)}}return function(r){return(0,a.isText)(r)&&r.data===e}}};function getAttribCheck(e,r){if(typeof r==="function"){return function(t){return(0,a.isTag)(t)&&r(t.attribs[e])}}return function(t){return(0,a.isTag)(t)&&t.attribs[e]===r}}function combineFuncs(e,r){return function(t){return e(t)||r(t)}}function compileTest(e){var r=Object.keys(e).map((function(r){var t=e[r];return Object.prototype.hasOwnProperty.call(i,r)?i[r](t):getAttribCheck(r,t)}));return r.length===0?null:r.reduce(combineFuncs)}function testElement(e,r){var t=compileTest(e);return t?t(r):true}r.testElement=testElement;function getElements(e,r,t,a){if(a===void 0){a=Infinity}var i=compileTest(e);return i?(0,n.filter)(i,r,t,a):[]}r.getElements=getElements;function getElementById(e,r,t){if(t===void 0){t=true}if(!Array.isArray(r))r=[r];return(0,n.findOne)(getAttribCheck("id",e),r,t)}r.getElementById=getElementById;function getElementsByTagName(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_name(e),r,t,a)}r.getElementsByTagName=getElementsByTagName;function getElementsByTagType(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}return(0,n.filter)(i.tag_type(e),r,t,a)}r.getElementsByTagType=getElementsByTagType},1655:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prepend=r.prependChild=r.append=r.appendChild=r.replaceElement=r.removeElement=void 0;function removeElement(e){if(e.prev)e.prev.next=e.next;if(e.next)e.next.prev=e.prev;if(e.parent){var r=e.parent.children;r.splice(r.lastIndexOf(e),1)}}r.removeElement=removeElement;function replaceElement(e,r){var t=r.prev=e.prev;if(t){t.next=r}var a=r.next=e.next;if(a){a.prev=r}var n=r.parent=e.parent;if(n){var i=n.children;i[i.lastIndexOf(e)]=r}}r.replaceElement=replaceElement;function appendChild(e,r){removeElement(r);r.next=null;r.parent=e;if(e.children.push(r)>1){var t=e.children[e.children.length-2];t.next=r;r.prev=t}else{r.prev=null}}r.appendChild=appendChild;function append(e,r){removeElement(r);var t=e.parent;var a=e.next;r.next=a;r.prev=e;e.next=r;r.parent=t;if(a){a.prev=r;if(t){var n=t.children;n.splice(n.lastIndexOf(a),0,r)}}else if(t){t.children.push(r)}}r.append=append;function prependChild(e,r){removeElement(r);r.parent=e;r.prev=null;if(e.children.unshift(r)!==1){var t=e.children[1];t.prev=r;r.next=t}else{r.next=null}}r.prependChild=prependChild;function prepend(e,r){removeElement(r);var t=e.parent;if(t){var a=t.children;a.splice(a.indexOf(e),0,r)}if(e.prev){e.prev.next=r}r.parent=t;r.prev=e.prev;r.next=e;e.prev=r}r.prepend=prepend},8929:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.findAll=r.existsOne=r.findOne=r.findOneChild=r.find=r.filter=void 0;var a=t(2472);function filter(e,r,t,a){if(t===void 0){t=true}if(a===void 0){a=Infinity}if(!Array.isArray(r))r=[r];return find(e,r,t,a)}r.filter=filter;function find(e,r,t,n){var i=[];for(var o=0,s=r;o0){var l=find(e,u.children,t,n);i.push.apply(i,l);n-=l.length;if(n<=0)break}}return i}r.find=find;function findOneChild(e,r){return r.find(e)}r.findOneChild=findOneChild;function findOne(e,r,t){if(t===void 0){t=true}var n=null;for(var i=0;i0){n=findOne(e,o.children)}}return n}r.findOne=findOne;function existsOne(e,r){return r.some((function(r){return(0,a.isTag)(r)&&(e(r)||r.children.length>0&&existsOne(e,r.children))}))}r.existsOne=existsOne;function findAll(e,r){var t;var n=[];var i=r.filter(a.isTag);var o;while(o=i.shift()){var s=(t=o.children)===null||t===void 0?void 0:t.filter(a.isTag);if(s&&s.length>0){i.unshift.apply(i,s)}if(e(o))n.push(o)}return n}r.findAll=findAll},3930:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.innerText=r.textContent=r.getText=r.getInnerHTML=r.getOuterHTML=void 0;var n=t(2472);var i=a(t(4614));var o=t(9391);function getOuterHTML(e,r){return(0,i.default)(e,r)}r.getOuterHTML=getOuterHTML;function getInnerHTML(e,r){return(0,n.hasChildren)(e)?e.children.map((function(e){return getOuterHTML(e,r)})).join(""):""}r.getInnerHTML=getInnerHTML;function getText(e){if(Array.isArray(e))return e.map(getText).join("");if((0,n.isTag)(e))return e.name==="br"?"\n":getText(e.children);if((0,n.isCDATA)(e))return getText(e.children);if((0,n.isText)(e))return e.data;return""}r.getText=getText;function textContent(e){if(Array.isArray(e))return e.map(textContent).join("");if((0,n.hasChildren)(e)&&!(0,n.isComment)(e)){return textContent(e.children)}if((0,n.isText)(e))return e.data;return""}r.textContent=textContent;function innerText(e){if(Array.isArray(e))return e.map(innerText).join("");if((0,n.hasChildren)(e)&&(e.type===o.ElementType.Tag||(0,n.isCDATA)(e))){return innerText(e.children)}if((0,n.isText)(e))return e.data;return""}r.innerText=innerText},8298:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.prevElementSibling=r.nextElementSibling=r.getName=r.hasAttrib=r.getAttributeValue=r.getSiblings=r.getParent=r.getChildren=void 0;var a=t(2472);var n=[];function getChildren(e){var r;return(r=e.children)!==null&&r!==void 0?r:n}r.getChildren=getChildren;function getParent(e){return e.parent||null}r.getParent=getParent;function getSiblings(e){var r,t;var a=getParent(e);if(a!=null)return getChildren(a);var n=[e];var i=e.prev,o=e.next;while(i!=null){n.unshift(i);r=i,i=r.prev}while(o!=null){n.push(o);t=o,o=t.next}return n}r.getSiblings=getSiblings;function getAttributeValue(e,r){var t;return(t=e.attribs)===null||t===void 0?void 0:t[r]}r.getAttributeValue=getAttributeValue;function hasAttrib(e,r){return e.attribs!=null&&Object.prototype.hasOwnProperty.call(e.attribs,r)&&e.attribs[r]!=null}r.hasAttrib=hasAttrib;function getName(e){return e.name}r.getName=getName;function nextElementSibling(e){var r;var t=e.next;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.next;return t}r.nextElementSibling=nextElementSibling;function prevElementSibling(e){var r;var t=e.prev;while(t!==null&&!(0,a.isTag)(t))r=t,t=r.prev;return t}r.prevElementSibling=prevElementSibling},6674:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(1859));var i=a(t(2128));var o=a(t(4931));var s=a(t(9281));r.decodeXML=getStrictDecoder(o.default);r.decodeHTMLStrict=getStrictDecoder(n.default);function getStrictDecoder(e){var r=Object.keys(e).join("|");var t=getReplacer(e);r+="|#[xX][\\da-fA-F]+|#\\d+";var a=new RegExp("&(?:"+r+");","g");return function(e){return String(e).replace(a,t)}}var sorter=function(e,r){return e=55296&&e<=57343||e>1114111){return"�"}if(e in n.default){e=n.default[e]}var r="";if(e>65535){e-=65536;r+=String.fromCharCode(e>>>10&1023|55296);e=56320|e&1023}r+=String.fromCharCode(e);return r}r["default"]=decodeCodePoint},6032:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(4931));var i=getInverseObj(n.default);var o=getInverseReplacer(i);r.encodeXML=getInverse(i,o);var s=a(t(1859));var u=getInverseObj(s.default);var l=getInverseReplacer(u);r.encodeHTML=getInverse(u,l);function getInverseObj(e){return Object.keys(e).sort().reduce((function(r,t){r[e[t]]="&"+t+";";return r}),{})}function getInverseReplacer(e){var r=[];var t=[];Object.keys(e).forEach((function(e){return e.length===1?r.push("\\"+e):t.push(e)}));t.unshift("["+r.join("")+"]");return new RegExp(t.join("|"),"g")}var c=/[^\0-\x7F]/g;var p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function singleCharReplacer(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function astralReplacer(e,r){var t=e.charCodeAt(0);var a=e.charCodeAt(1);var n=(t-55296)*1024+a-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}function getInverse(e,r){return function(t){return t.replace(r,(function(r){return e[r]})).replace(p,astralReplacer).replace(c,singleCharReplacer)}}var d=getInverseReplacer(i);function escape(e){return e.replace(d,singleCharReplacer).replace(p,astralReplacer).replace(c,singleCharReplacer)}r.escape=escape},9280:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(6674);var n=t(6032);function decode(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTML)(e)}r.decode=decode;function decodeStrict(e,r){return(!r||r<=0?a.decodeXML:a.decodeHTMLStrict)(e)}r.decodeStrict=decodeStrict;function encode(e,r){return(!r||r<=0?n.encodeXML:n.encodeHTML)(e)}r.encode=encode;var i=t(6032);r.encodeXML=i.encodeXML;r.encodeHTML=i.encodeHTML;r.escape=i.escape;r.encodeHTML4=i.encodeHTML;r.encodeHTML5=i.encodeHTML;var o=t(6674);r.decodeXML=o.decodeXML;r.decodeHTML=o.decodeHTML;r.decodeHTMLStrict=o.decodeHTMLStrict;r.decodeHTML4=o.decodeHTML;r.decodeHTML5=o.decodeHTML;r.decodeHTML4Strict=o.decodeHTMLStrict;r.decodeHTML5Strict=o.decodeHTMLStrict;r.decodeXMLStrict=o.decodeXML},5902:function(e,r,t){e=t.nmd(e); -/*! https://mths.be/he v1.2.0 by @mathias | MIT license */(function(t){var a=true&&r;var n=true&&e&&e.exports==a&&e;var i=typeof global=="object"&&global;if(i.global===i||i.window===i){t=i}var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var s=/[\x01-\x7F]/g;var u=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;var l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;var c={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot","\t":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr","ª":"ordf","á":"aacute","Á":"Aacute","à":"agrave","À":"Agrave","ă":"abreve","Ă":"Abreve","â":"acirc","Â":"Acirc","å":"aring","Å":"angst","ä":"auml","Ä":"Auml","ã":"atilde","Ã":"Atilde","ą":"aogon","Ą":"Aogon","ā":"amacr","Ā":"Amacr","æ":"aelig","Æ":"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf","ℬ":"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf","ℭ":"Cfr","𝒞":"Cscr","ℂ":"Copf","ć":"cacute","Ć":"Cacute","ĉ":"ccirc","Ĉ":"Ccirc","č":"ccaron","Č":"Ccaron","ċ":"cdot","Ċ":"Cdot","ç":"ccedil","Ç":"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf","ď":"dcaron","Ď":"Dcaron","đ":"dstrok","Đ":"Dstrok","ð":"eth","Ð":"ETH","ⅇ":"ee","ℯ":"escr","𝔢":"efr","𝕖":"eopf","ℰ":"Escr","𝔈":"Efr","𝔼":"Eopf","é":"eacute","É":"Eacute","è":"egrave","È":"Egrave","ê":"ecirc","Ê":"Ecirc","ě":"ecaron","Ě":"Ecaron","ë":"euml","Ë":"Euml","ė":"edot","Ė":"Edot","ę":"eogon","Ę":"Eogon","ē":"emacr","Ē":"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf","ℱ":"Fscr","ff":"fflig","ffi":"ffilig","ffl":"ffllig","fi":"filig",fj:"fjlig","fl":"fllig","ƒ":"fnof","ℊ":"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr","ǵ":"gacute","ğ":"gbreve","Ğ":"Gbreve","ĝ":"gcirc","Ĝ":"Gcirc","ġ":"gdot","Ġ":"Gdot","Ģ":"Gcedil","𝔥":"hfr","ℎ":"planckh","𝒽":"hscr","𝕙":"hopf","ℋ":"Hscr","ℌ":"Hfr","ℍ":"Hopf","ĥ":"hcirc","Ĥ":"Hcirc","ℏ":"hbar","ħ":"hstrok","Ħ":"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf","ℐ":"Iscr","ℑ":"Im","í":"iacute","Í":"Iacute","ì":"igrave","Ì":"Igrave","î":"icirc","Î":"Icirc","ï":"iuml","Ï":"Iuml","ĩ":"itilde","Ĩ":"Itilde","İ":"Idot","į":"iogon","Į":"Iogon","ī":"imacr","Ī":"Imacr","ij":"ijlig","IJ":"IJlig","ı":"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf","ĵ":"jcirc","Ĵ":"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr","ķ":"kcedil","Ķ":"Kcedil","𝔩":"lfr","𝓁":"lscr","ℓ":"ell","𝕝":"lopf","ℒ":"Lscr","𝔏":"Lfr","𝕃":"Lopf","ĺ":"lacute","Ĺ":"Lacute","ľ":"lcaron","Ľ":"Lcaron","ļ":"lcedil","Ļ":"Lcedil","ł":"lstrok","Ł":"Lstrok","ŀ":"lmidot","Ŀ":"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf","ℳ":"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr","ℕ":"Nopf","𝒩":"Nscr","𝔑":"Nfr","ń":"nacute","Ń":"Nacute","ň":"ncaron","Ň":"Ncaron","ñ":"ntilde","Ñ":"Ntilde","ņ":"ncedil","Ņ":"Ncedil","№":"numero","ŋ":"eng","Ŋ":"ENG","𝕠":"oopf","𝔬":"ofr","ℴ":"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf","º":"ordm","ó":"oacute","Ó":"Oacute","ò":"ograve","Ò":"Ograve","ô":"ocirc","Ô":"Ocirc","ö":"ouml","Ö":"Ouml","ő":"odblac","Ő":"Odblac","õ":"otilde","Õ":"Otilde","ø":"oslash","Ø":"Oslash","ō":"omacr","Ō":"Omacr","œ":"oelig","Œ":"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf","ℙ":"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr","ℚ":"Qopf","ĸ":"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr","ℛ":"Rscr","ℜ":"Re","ℝ":"Ropf","ŕ":"racute","Ŕ":"Racute","ř":"rcaron","Ř":"Rcaron","ŗ":"rcedil","Ŗ":"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS","ś":"sacute","Ś":"Sacute","ŝ":"scirc","Ŝ":"Scirc","š":"scaron","Š":"Scaron","ş":"scedil","Ş":"Scedil","ß":"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf","ť":"tcaron","Ť":"Tcaron","ţ":"tcedil","Ţ":"Tcedil","™":"trade","ŧ":"tstrok","Ŧ":"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr","ú":"uacute","Ú":"Uacute","ù":"ugrave","Ù":"Ugrave","ŭ":"ubreve","Ŭ":"Ubreve","û":"ucirc","Û":"Ucirc","ů":"uring","Ů":"Uring","ü":"uuml","Ü":"Uuml","ű":"udblac","Ű":"Udblac","ũ":"utilde","Ũ":"Utilde","ų":"uogon","Ų":"Uogon","ū":"umacr","Ū":"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr","ŵ":"wcirc","Ŵ":"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf","ý":"yacute","Ý":"Yacute","ŷ":"ycirc","Ŷ":"Ycirc","ÿ":"yuml","Ÿ":"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf","ℨ":"Zfr","ℤ":"Zopf","𝒵":"Zscr","ź":"zacute","Ź":"Zacute","ž":"zcaron","Ž":"Zcaron","ż":"zdot","Ż":"Zdot","Ƶ":"imped","þ":"thorn","Þ":"THORN","ʼn":"napos","α":"alpha","Α":"Alpha","β":"beta","Β":"Beta","γ":"gamma","Γ":"Gamma","δ":"delta","Δ":"Delta","ε":"epsi","ϵ":"epsiv","Ε":"Epsilon","ϝ":"gammad","Ϝ":"Gammad","ζ":"zeta","Ζ":"Zeta","η":"eta","Η":"Eta","θ":"theta","ϑ":"thetav","Θ":"Theta","ι":"iota","Ι":"Iota","κ":"kappa","ϰ":"kappav","Κ":"Kappa","λ":"lambda","Λ":"Lambda","μ":"mu","µ":"micro","Μ":"Mu","ν":"nu","Ν":"Nu","ξ":"xi","Ξ":"Xi","ο":"omicron","Ο":"Omicron","π":"pi","ϖ":"piv","Π":"Pi","ρ":"rho","ϱ":"rhov","Ρ":"Rho","σ":"sigma","Σ":"Sigma","ς":"sigmaf","τ":"tau","Τ":"Tau","υ":"upsi","Υ":"Upsilon","ϒ":"Upsi","φ":"phi","ϕ":"phiv","Φ":"Phi","χ":"chi","Χ":"Chi","ψ":"psi","Ψ":"Psi","ω":"omega","Ω":"ohm","а":"acy","А":"Acy","б":"bcy","Б":"Bcy","в":"vcy","В":"Vcy","г":"gcy","Г":"Gcy","ѓ":"gjcy","Ѓ":"GJcy","д":"dcy","Д":"Dcy","ђ":"djcy","Ђ":"DJcy","е":"iecy","Е":"IEcy","ё":"iocy","Ё":"IOcy","є":"jukcy","Є":"Jukcy","ж":"zhcy","Ж":"ZHcy","з":"zcy","З":"Zcy","ѕ":"dscy","Ѕ":"DScy","и":"icy","И":"Icy","і":"iukcy","І":"Iukcy","ї":"yicy","Ї":"YIcy","й":"jcy","Й":"Jcy","ј":"jsercy","Ј":"Jsercy","к":"kcy","К":"Kcy","ќ":"kjcy","Ќ":"KJcy","л":"lcy","Л":"Lcy","љ":"ljcy","Љ":"LJcy","м":"mcy","М":"Mcy","н":"ncy","Н":"Ncy","њ":"njcy","Њ":"NJcy","о":"ocy","О":"Ocy","п":"pcy","П":"Pcy","р":"rcy","Р":"Rcy","с":"scy","С":"Scy","т":"tcy","Т":"Tcy","ћ":"tshcy","Ћ":"TSHcy","у":"ucy","У":"Ucy","ў":"ubrcy","Ў":"Ubrcy","ф":"fcy","Ф":"Fcy","х":"khcy","Х":"KHcy","ц":"tscy","Ц":"TScy","ч":"chcy","Ч":"CHcy","џ":"dzcy","Џ":"DZcy","ш":"shcy","Ш":"SHcy","щ":"shchcy","Щ":"SHCHcy","ъ":"hardcy","Ъ":"HARDcy","ы":"ycy","Ы":"Ycy","ь":"softcy","Ь":"SOFTcy","э":"ecy","Э":"Ecy","ю":"yucy","Ю":"YUcy","я":"yacy","Я":"YAcy","ℵ":"aleph","ℶ":"beth","ℷ":"gimel","ℸ":"daleth"};var p=/["&'<>`]/g;var d={'"':""","&":"&","'":"'","<":"<",">":">","`":"`"};var f=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;var g=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var h=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;var m={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"};var v={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"};var b={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var y=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var w=String.fromCharCode;var T={};var E=T.hasOwnProperty;var has=function(e,r){return E.call(e,r)};var contains=function(e,r){var t=-1;var a=e.length;while(++t=55296&&e<=57343||e>1114111){if(r){parseError("character reference outside the permissible Unicode range")}return"�"}if(has(b,e)){if(r){parseError("disallowed character reference")}return b[e]}if(r&&contains(y,e)){parseError("disallowed character reference")}if(e>65535){e-=65536;t+=w(e>>>10&1023|55296);e=56320|e&1023}t+=w(e);return t};var hexEscape=function(e){return"&#x"+e.toString(16).toUpperCase()+";"};var decEscape=function(e){return"&#"+e+";"};var parseError=function(e){throw Error("Parse error: "+e)};var encode=function(e,r){r=merge(r,encode.options);var t=r.strict;if(t&&g.test(e)){parseError("forbidden code point")}var a=r.encodeEverything;var n=r.useNamedReferences;var i=r.allowUnsafeSymbols;var d=r.decimal?decEscape:hexEscape;var escapeBmpSymbol=function(e){return d(e.charCodeAt(0))};if(a){e=e.replace(s,(function(e){if(n&&has(c,e)){return"&"+c[e]+";"}return escapeBmpSymbol(e)}));if(n){e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒").replace(/fj/g,"fj")}if(n){e=e.replace(l,(function(e){return"&"+c[e]+";"}))}}else if(n){if(!i){e=e.replace(p,(function(e){return"&"+c[e]+";"}))}e=e.replace(/>\u20D2/g,">⃒").replace(/<\u20D2/g,"<⃒");e=e.replace(l,(function(e){return"&"+c[e]+";"}))}else if(!i){e=e.replace(p,escapeBmpSymbol)}return e.replace(o,(function(e){var r=e.charCodeAt(0);var t=e.charCodeAt(1);var a=(r-55296)*1024+t-56320+65536;return d(a)})).replace(u,escapeBmpSymbol)};encode.options={allowUnsafeSymbols:false,encodeEverything:false,strict:false,useNamedReferences:false,decimal:false};var decode=function(e,r){r=merge(r,decode.options);var t=r.strict;if(t&&f.test(e)){parseError("malformed character reference")}return e.replace(h,(function(e,a,n,i,o,s,u,l,c){var p;var d;var f;var g;var h;var b;if(a){h=a;return m[h]}if(n){h=n;b=i;if(b&&r.isAttributeValue){if(t&&b=="="){parseError("`&` did not start a character reference")}return e}else{if(t){parseError("named character reference was not terminated by a semicolon")}return v[h]+(b||"")}}if(o){f=o;d=s;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(f,10);return codePointToSymbol(p,t)}if(u){g=u;d=l;if(t&&!d){parseError("character reference was not terminated by a semicolon")}p=parseInt(g,16);return codePointToSymbol(p,t)}if(t){parseError("named character reference was not terminated by a semicolon")}return e}))};decode.options={isAttributeValue:false,strict:false};var escape=function(e){return e.replace(p,(function(e){return d[e]}))};var A={version:"1.2.0",encode:encode,decode:decode,escape:escape,unescape:decode};if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define((function(){return A}))}else if(a&&!a.nodeType){if(n){n.exports=A}else{for(var q in A){has(A,q)&&(a[q]=A[q])}}}else{t.he=A}})(this)},5596:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});function arr_back(e){return e[e.length-1]}r["default"]=arr_back},5417:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.NodeType=r.TextNode=r.Node=r.valid=r["default"]=r.parse=r.HTMLElement=r.CommentNode=void 0;var n=t(190);Object.defineProperty(r,"CommentNode",{enumerable:true,get:function(){return a(n).default}});var i=t(3248);Object.defineProperty(r,"HTMLElement",{enumerable:true,get:function(){return a(i).default}});var o=t(8653);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a(o).default}});Object.defineProperty(r,"default",{enumerable:true,get:function(){return a(o).default}});var s=t(3494);Object.defineProperty(r,"valid",{enumerable:true,get:function(){return a(s).default}});var u=t(7402);Object.defineProperty(r,"Node",{enumerable:true,get:function(){return a(u).default}});var l=t(111);Object.defineProperty(r,"TextNode",{enumerable:true,get:function(){return a(l).default}});var c=t(5896);Object.defineProperty(r,"NodeType",{enumerable:true,get:function(){return a(c).default}})},9958:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var n=a(t(5896));function isTag(e){return e&&e.nodeType===n.default.ELEMENT_NODE}function getAttributeValue(e,r){return isTag(e)?e.getAttribute(r):undefined}function getName(e){return(e&&e.rawTagName||"").toLowerCase()}function getChildren(e){return e&&e.childNodes}function getParent(e){return e?e.parentNode:null}function getText(e){return e.text}function removeSubsets(e){var r=e.length;var t;var a;var n;while(--r>-1){t=a=e[r];e[r]=null;n=true;while(a){if(e.indexOf(a)>-1){n=false;e.splice(r,1);break}a=getParent(a)}if(n){e[r]=t}}return e}function existsOne(e,r){return r.some((function(r){return isTag(r)?e(r)||existsOne(e,getChildren(r)):false}))}function getSiblings(e){var r=getParent(e);return r&&getChildren(r)}function hasAttrib(e,r){return getAttributeValue(e,r)!==undefined}function findOne(e,r){var t=null;for(var a=0,n=r.length;a0){t=findOne(e,o)}}}return t}function findAll(e,r){var t=[];for(var a=0,n=r.length;a0){r.push(e=[])}t.childNodes.forEach(dfs);if(e.length>0){r.push(e=[])}}else{t.childNodes.forEach(dfs)}}else if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){e.prependWhitespace=true}else{var a=t.trimmedText;if(e.prependWhitespace){a=" ".concat(a);e.prependWhitespace=false}e.push(a)}}}dfs(this);return r.map((function(e){return e.join("").replace(/\s{2,}/g," ")})).join("\n").replace(/\s+$/,"")},enumerable:false,configurable:true});HTMLElement.prototype.toString=function(){var e=this.rawTagName;if(e){var r=this.rawAttrs?" ".concat(this.rawAttrs):"";return this.isVoidElement?"<".concat(e).concat(r,">"):"<".concat(e).concat(r,">").concat(this.innerHTML,"")}return this.innerHTML};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return this.childNodes.map((function(e){return e.toString()})).join("")},set:function(e){var r=parse(e);var t=r.childNodes.length?r.childNodes:[new f.default(e,this)];resetParent(t,this);resetParent(this.childNodes,null);this.childNodes=t},enumerable:false,configurable:true});HTMLElement.prototype.set_content=function(e,r){if(r===void 0){r={}}if(e instanceof d.default){e=[e]}else if(typeof e=="string"){var t=parse(e,r);e=t.childNodes.length?t.childNodes:[new f.default(e,this)]}resetParent(this.childNodes,null);resetParent(e,this);this.childNodes=e;return this};HTMLElement.prototype.replaceWith=function(){var e=this;var r=[];for(var t=0;t-1){t.rawText=t.rawText.substr(0,a);this.childNodes.length=r+1}}}return this};Object.defineProperty(HTMLElement.prototype,"structure",{get:function(){var e=[];var r=0;function write(t){e.push(" ".repeat(r)+t)}function dfs(e){var t=e.id?"#".concat(e.id):"";var a=e.classList.length?".".concat(e.classList.value.join(".")):"";write("".concat(e.rawTagName).concat(t).concat(a));r++;e.childNodes.forEach((function(e){if(e.nodeType===g.default.ELEMENT_NODE){dfs(e)}else if(e.nodeType===g.default.TEXT_NODE){if(!e.isWhitespace){write("#text")}}}));r--}dfs(this);return e.join("\n")},enumerable:false,configurable:true});HTMLElement.prototype.removeWhitespace=function(){var e=this;var r=0;this.childNodes.forEach((function(t){if(t.nodeType===g.default.TEXT_NODE){if(t.isWhitespace){return}t.rawText=t.trimmedRawText}else if(t.nodeType===g.default.ELEMENT_NODE){t.removeWhitespace()}e.childNodes[r++]=t}));this.childNodes.length=r;return this};HTMLElement.prototype.querySelectorAll=function(e){return(0,s.selectAll)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.querySelector=function(e){return(0,s.selectOne)(e,this,{xmlMode:true,adapter:c.default})};HTMLElement.prototype.getElementsByTagName=function(e){var r=e.toUpperCase();var t=[];var a=[];var n=this;var i=0;while(i!==undefined){var o=void 0;do{o=n.childNodes[i++]}while(i0){a.push(i);n=o;i=0}}}return t};HTMLElement.prototype.getElementById=function(e){var r=[];var t=this;var a=0;while(a!==undefined){var n=void 0;do{n=t.childNodes[a++]}while(a0){r.push(a);t=n;a=0}}}return null};HTMLElement.prototype.closest=function(e){var r=new Map;var t=this;var a=null;function findOne(e,t){var a=null;for(var n=0,i=t.length;n0){var t=e[--r];if(this===t)return e[r-1]||null}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"previousElementSibling",{get:function(){if(this.parentNode){var e=this.parentNode.childNodes;var r=e.length;var t=false;while(r>0){var a=e[--r];if(t){if(a instanceof HTMLElement){return a||null}}else if(this===a){t=true}}return null}},enumerable:false,configurable:true});Object.defineProperty(HTMLElement.prototype,"classNames",{get:function(){return this.classList.toString()},enumerable:false,configurable:true});HTMLElement.prototype.clone=function(){return parse(this.toString()).firstChild};return HTMLElement}(d.default);r["default"]=A;var q=/|<(\/?)([a-zA-Z][-.:0-9_a-zA-Z]*)((?:\s+[^>]*?(?:(?:'[^']*')|(?:"[^"]*"))?)*)\s*(\/?)>/g;var x=/(?:^|\s)(id|class)\s*=\s*((?:'[^']*')|(?:"[^"]*")|\S+)/gi;var D={area:true,AREA:true,base:true,BASE:true,br:true,BR:true,col:true,COL:true,hr:true,HR:true,img:true,IMG:true,input:true,INPUT:true,link:true,LINK:true,meta:true,META:true,source:true,SOURCE:true,embed:true,EMBED:true,param:true,PARAM:true,track:true,TRACK:true,wbr:true,WBR:true};var C={li:{li:true,LI:true},LI:{li:true,LI:true},p:{p:true,div:true,P:true,DIV:true},P:{p:true,div:true,P:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},td:{td:true,th:true,TD:true,TH:true},TD:{td:true,th:true,TD:true,TH:true},th:{td:true,th:true,TD:true,TH:true},TH:{td:true,th:true,TD:true,TH:true},h1:{h1:true,H1:true},H1:{h1:true,H1:true},h2:{h2:true,H2:true},H2:{h2:true,H2:true},h3:{h3:true,H3:true},H3:{h3:true,H3:true},h4:{h4:true,H4:true},H4:{h4:true,H4:true},h5:{h5:true,H5:true},H5:{h5:true,H5:true},h6:{h6:true,H6:true},H6:{h6:true,H6:true}};var N={li:{ul:true,ol:true,UL:true,OL:true},LI:{ul:true,ol:true,UL:true,OL:true},a:{div:true,DIV:true},A:{div:true,DIV:true},b:{div:true,DIV:true},B:{div:true,DIV:true},i:{div:true,DIV:true},I:{div:true,DIV:true},p:{div:true,DIV:true},P:{div:true,DIV:true},td:{tr:true,table:true,TR:true,TABLE:true},TD:{tr:true,table:true,TR:true,TABLE:true},th:{tr:true,table:true,TR:true,TABLE:true},TH:{tr:true,table:true,TR:true,TABLE:true}};var S="documentfragmentcontainer";function base_parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=r.blockTextElements||{script:true,noscript:true,style:true,pre:true};var a=Object.keys(t);var n=a.map((function(e){return new RegExp("^".concat(e,"$"),"i")}));var i=a.filter((function(e){return t[e]})).map((function(e){return new RegExp("^".concat(e,"$"),"i")}));function element_should_be_ignore(e){return i.some((function(r){return r.test(e)}))}function is_block_text_element(e){return n.some((function(r){return r.test(e)}))}var createRange=function(e,r){return[e-v,r-v]};var o=new A(null,{},"",null,[0,e.length]);var s=o;var u=[o];var c=-1;var d=undefined;var g;e="<".concat(S,">").concat(e,"");var h=r.lowerCaseTagName;var m=e.length-(S.length+2);var v=S.length+2;while(g=q.exec(e)){var b=g[0],y=g[1],w=g[2],T=g[3],E=g[4];var L=b.length;var k=q.lastIndex-L;var O=q.lastIndex;if(c>-1){if(c+L");var I=h?e.toLocaleLowerCase().indexOf(U,q.lastIndex):e.indexOf(U,q.lastIndex);var G=I===-1?m:I;if(element_should_be_ignore(w)){var _=e.substring(F,G);if(_.length>0&&/\S/.test(_)){s.appendChild(new f.default(_,s,createRange(F,G)))}}if(I===-1){c=q.lastIndex=e.length+1}else{c=q.lastIndex=I+U.length;y="/"}}}if(y||E||D[w]){while(true){if(w==="a"||w==="A")d=undefined;if(s.rawTagName===w){s.range[1]=createRange(-1,Math.max(c,O))[1];u.pop();s=(0,l.default)(u);break}else{var H=s.tagName;if(N[H]){if(N[H][w]){u.pop();s=(0,l.default)(u);continue}}break}}}}return u}r.base_parse=base_parse;function parse(e,r){if(r===void 0){r={lowerCaseTagName:false,comment:false}}var t=base_parse(e,r);var a=t[0];var _loop_1=function(){var e=t.pop();var a=(0,l.default)(t);if(e.parentNode&&e.parentNode.parentNode){if(e.parentNode===a&&e.tagName===a.tagName){if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.parentNode.appendChild(e)}));t.pop()}}else{if(r.parseNoneClosedTags!==true){a.removeChild(e);e.childNodes.forEach((function(e){a.appendChild(e)}))}}}else{}};while(t.length>1){_loop_1()}return a}r.parse=parse;function resetParent(e,r){return e.map((function(e){e.parentNode=r;return e}))}},7402:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});var a=t(5902);var n=function(){function Node(e,r){if(e===void 0){e=null}this.parentNode=e;this.childNodes=[];Object.defineProperty(this,"range",{enumerable:false,writable:true,configurable:true,value:r!==null&&r!==void 0?r:[-1,-1]})}Node.prototype.remove=function(){var e=this;if(this.parentNode){var r=this.parentNode.childNodes;this.parentNode.childNodes=r.filter((function(r){return e!==r}));this.parentNode=null}return this};Object.defineProperty(Node.prototype,"innerText",{get:function(){return this.rawText},enumerable:false,configurable:true});Object.defineProperty(Node.prototype,"textContent",{get:function(){return(0,a.decode)(this.rawText)},set:function(e){this.rawText=(0,a.encode)(e)},enumerable:false,configurable:true});return Node}();r["default"]=n},111:function(e,r,t){"use strict";var a=this&&this.__extends||function(){var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function __(){this.constructor=e}e.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)}}();var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});var i=t(5902);var o=n(t(7402));var s=n(t(5896));var u=function(e){a(TextNode,e);function TextNode(r,t,a){var n=e.call(this,t,a)||this;n.nodeType=s.default.TEXT_NODE;n._rawText=r;return n}TextNode.prototype.clone=function(){return new TextNode(this._rawText,null)};Object.defineProperty(TextNode.prototype,"rawText",{get:function(){return this._rawText},set:function(e){this._rawText=e;this._trimmedRawText=void 0;this._trimmedText=void 0},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedRawText",{get:function(){if(this._trimmedRawText!==undefined)return this._trimmedRawText;this._trimmedRawText=trimText(this.rawText);return this._trimmedRawText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"trimmedText",{get:function(){if(this._trimmedText!==undefined)return this._trimmedText;this._trimmedText=trimText(this.text);return this._trimmedText},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"text",{get:function(){return(0,i.decode)(this.rawText)},enumerable:false,configurable:true});Object.defineProperty(TextNode.prototype,"isWhitespace",{get:function(){return/^(\s| )*$/.test(this.rawText)},enumerable:false,configurable:true});TextNode.prototype.toString=function(){return this.rawText};return TextNode}(o.default);r["default"]=u;function trimText(e){var r=0;var t;var a;while(r>=0&&r0&&/[^\S\r\n]/.test(e[t-1]);var i=a=t};var a=Math.abs(r);var i=(t%a+a)%a;return r>1?function(e){return e>=t&&e%a===i}:function(e){return e<=t&&e%a===i}}r.compile=compile;function generate(e){var r=e[0];var t=e[1]-1;var a=0;if(r<0){var n=-r;var i=(t%n+n)%n;return function(){var e=i+n*a++;return e>t?null:e}}if(r===0)return t<0?function(){return null}:function(){return a++===0?t:null};if(t<0){t+=r*Math.ceil(-t/r)}return function(){return r*a+++t}}r.generate=generate},7118:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.sequence=r.generate=r.compile=r.parse=void 0;var a=t(2421);Object.defineProperty(r,"parse",{enumerable:true,get:function(){return a.parse}});var n=t(3947);Object.defineProperty(r,"compile",{enumerable:true,get:function(){return n.compile}});Object.defineProperty(r,"generate",{enumerable:true,get:function(){return n.generate}});function nthCheck(e){return(0,n.compile)((0,a.parse)(e))}r["default"]=nthCheck;function sequence(e){return(0,n.generate)((0,a.parse)(e))}r.sequence=sequence},2421:function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:true});r.parse=void 0;var t=new Set([9,10,12,13,32]);var a="0".charCodeAt(0);var n="9".charCodeAt(0);function parse(e){e=e.trim().toLowerCase();if(e==="even"){return[2,0]}else if(e==="odd"){return[2,1]}var r=0;var i=0;var o=readSign();var s=readNumber();if(r=a&&e.charCodeAt(r)<=n){i=i*10+(e.charCodeAt(r)-a);r++}return r===t?null:i}function skipWhitespace(){while(r","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},2128:function(e){"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},4931:function(e){"use strict";e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')}};var r={};function __webpack_require__(t){var a=r[t];if(a!==undefined){return a.exports}var n=r[t]={id:t,loaded:false,exports:{}};var i=true;try{e[t].call(n.exports,n,n.exports,__webpack_require__);i=false}finally{if(i)delete r[t]}n.loaded=true;return n.exports}!function(){__webpack_require__.nmd=function(e){e.paths=[];if(!e.children)e.children=[];return e}}();if(typeof __webpack_require__!=="undefined")__webpack_require__.ab=__dirname+"/";var t=__webpack_require__(5417);module.exports=t})(); \ No newline at end of file diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 63ee106d51843..6077882eb0016 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -87,7 +87,6 @@ export async function ncc_node_html_parser(task, opts) { packageName: 'node-html-parser', externals, target: 'es5', - v8cache: true, }) .target('src/compiled/node-html-parser') } From 26e4e9d0833c1666df7e359405cfa8407e57ab6b Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 6 Jul 2023 18:50:27 +0200 Subject: [PATCH 013/101] revert vscode changes --- .vscode/settings.json | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7432a52188f68..2de2ef61939c7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,6 +23,8 @@ "debug.javascript.unmapMissingSources": true, "files.exclude": { + "**/node_modules": false, + "node_modules": true, "*[!test]**/node_modules": true }, @@ -80,29 +82,5 @@ "language": "markdown", "scheme": "file" } - ], - "workbench.colorCustomizations": { - "activityBar.activeBackground": "#3399ff", - "activityBar.background": "#3399ff", - "activityBar.foreground": "#15202b", - "activityBar.inactiveForeground": "#15202b99", - "activityBarBadge.background": "#bf0060", - "activityBarBadge.foreground": "#e7e7e7", - "commandCenter.border": "#e7e7e799", - "editorGroup.border": "#3399ff", - "panel.border": "#3399ff", - "sash.hoverBorder": "#3399ff", - "sideBar.border": "#3399ff", - "statusBar.background": "#007fff", - "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#3399ff", - "statusBarItem.remoteBackground": "#007fff", - "statusBarItem.remoteForeground": "#e7e7e7", - "tab.activeBorder": "#3399ff", - "titleBar.activeBackground": "#007fff", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveBackground": "#007fff99", - "titleBar.inactiveForeground": "#e7e7e799" - }, - "peacock.color": "#007fff" + ] } From 282fd7b817cb2b1fca96ba5b69af04a482cbf4f3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 10 Jul 2023 13:26:53 +0200 Subject: [PATCH 014/101] add separate file --- packages/next/src/build/index.ts | 166 +++++++++++++------- packages/next/src/server/load-components.ts | 5 +- 2 files changed, 116 insertions(+), 55 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 96dacd8abd6cb..101145e57957a 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -1,3 +1,4 @@ +import type { NodeFileTraceResult } from '@vercel/nft' import type { RemotePattern } from '../shared/lib/image-config' import type { AppBuildManifest } from './webpack/plugins/app-build-manifest-plugin' import type { PagesManifest } from './webpack/plugins/pages-manifest-plugin' @@ -1746,6 +1747,10 @@ export default async function build( distDir, 'next-server.js.nft.json' ) + const nextMinimalTraceOutput = path.join( + distDir, + 'next-minimal-server.js.nft.json' + ) if (!isGenerate && config.outputFileTracing) { let nodeFileTrace: any @@ -1938,30 +1943,20 @@ export default async function build( const nextServerEntry = require.resolve( 'next/dist/server/next-server' ) - const toTrace = [ - nextServerEntry, - isStandalone - ? require.resolve( - 'next/dist/server/lib/render-server-standalone' - ) - : null, - require.resolve( - 'next/dist/compiled/minimal-next-server/next-server-cached.js' - ), - require.resolve( - 'next/dist/compiled/minimal-next-server/next-server.js' - ), + + const sharedEntriesSet = [ ...Object.values(baseOverrides).map((override) => require.resolve(override) ), ...Object.values(experimentalOverrides).map((override) => require.resolve(override) ), - ].filter(nonNullable) + ] + // ensure we trace any dependencies needed for custom // incremental cache handler if (incrementalCacheHandlerPath) { - toTrace.push( + sharedEntriesSet.push( require.resolve( path.isAbsolute(incrementalCacheHandlerPath) ? incrementalCacheHandlerPath @@ -1970,7 +1965,25 @@ export default async function build( ) } - let serverResult: import('next/dist/compiled/@vercel/nft').NodeFileTraceResult + const vanillaServerEntries = [ + ...sharedEntriesSet, + isStandalone + ? require.resolve( + 'next/dist/server/lib/render-server-standalone' + ) + : null, + require.resolve('next/dist/server/next-server'), + ].filter(Boolean) as string[] + + const minimalServerEntries = [ + ...sharedEntriesSet, + require.resolve( + 'next/dist/compiled/minimal-next-server/next-server-cached.js' + ), + require.resolve( + 'next/dist/compiled/minimal-next-server/next-server.js' + ), + ].filter(Boolean) const additionalIgnores = new Set() @@ -2016,9 +2029,14 @@ export default async function build( } const traceContext = path.join(nextServerEntry, '..', '..') const tracedFiles = new Set() + const minimalTracedFiles = new Set() - function addToTracedFiles(base: string, file: string) { - tracedFiles.add( + function addToTracedFiles( + base: string, + file: string, + dest: Set + ) { + dest.add( path .relative(distDir, path.join(base, file)) .replace(/\\/g, '/') @@ -2028,54 +2046,94 @@ export default async function build( if (isStandalone) { addToTracedFiles( '', - require.resolve('next/dist/compiled/jest-worker/processChild') + require.resolve('next/dist/compiled/jest-worker/processChild'), + tracedFiles ) addToTracedFiles( '', - require.resolve('next/dist/compiled/jest-worker/threadChild') + require.resolve('next/dist/compiled/jest-worker/threadChild'), + tracedFiles ) } if (config.experimental.turbotrace) { - const files: string[] = await nodeFileTrace( - { - action: 'print', - input: toTrace, - contextDirectory: traceContext, - logLevel: config.experimental.turbotrace.logLevel, - processCwd: config.experimental.turbotrace.processCwd, - logDetail: config.experimental.turbotrace.logDetail, - showAll: config.experimental.turbotrace.logAll, - }, - turboTasksForTrace - ) - for (const file of files) { - if (!ignoreFn(path.join(traceContext, file))) { - addToTracedFiles(traceContext, file) + const makeTrace = async (entries: string[]) => + nodeFileTrace( + { + action: 'print', + input: entries, + contextDirectory: traceContext, + logLevel: config.experimental.turbotrace?.logLevel, + processCwd: config.experimental.turbotrace?.processCwd, + logDetail: config.experimental.turbotrace?.logDetail, + showAll: config.experimental.turbotrace?.logAll, + }, + turboTasksForTrace + ) + const [vanillaFiles, minimalFiles]: string[][] = + await Promise.all([ + makeTrace(vanillaServerEntries), + makeTrace(minimalServerEntries), + ]) + + for (const [set, files] of [ + [tracedFiles, vanillaFiles], + [minimalTracedFiles, minimalFiles], + ] as [Set, string[]][]) { + for (const file of files) { + if (!ignoreFn(path.join(traceContext, file))) { + addToTracedFiles(traceContext, file, set) + } } } } else { - serverResult = await nodeFileTrace(toTrace, { - base: root, - processCwd: dir, - ignore: ignoreFn, - }) + const makeTrace = async (entries: string[]) => + nodeFileTrace(entries, { + base: root, + processCwd: dir, + ignore: ignoreFn, + }) - serverResult.fileList.forEach((file) => { - addToTracedFiles(root, file) - }) + const [vanillaFiles, minimalFiles]: NodeFileTraceResult[] = + await Promise.all([ + makeTrace(vanillaServerEntries), + makeTrace(minimalServerEntries), + ]) + + for (const [set, traceResult] of [ + [tracedFiles, vanillaFiles], + [minimalTracedFiles, minimalFiles], + ] as [Set, NodeFileTraceResult][]) { + for (const file of traceResult.fileList) { + addToTracedFiles(traceContext, file, set) + } + } } - await fs.writeFile( - nextServerTraceOutput, - JSON.stringify({ - version: 1, - cacheKey, - files: Array.from(tracedFiles), - } as { - version: number - files: string[] - }) - ) + await Promise.all([ + fs.writeFile( + nextServerTraceOutput, + JSON.stringify({ + version: 1, + cacheKey, + files: Array.from(tracedFiles), + } as { + version: number + files: string[] + }) + ), + fs.writeFile( + nextMinimalTraceOutput, + JSON.stringify({ + version: 1, + cacheKey, + files: Array.from(minimalTracedFiles), + } as { + version: number + files: string[] + }) + ), + ]) + await fs.unlink(cachedTracePath).catch(() => {}) await fs .copyFile(nextServerTraceOutput, cachedTracePath) diff --git a/packages/next/src/server/load-components.ts b/packages/next/src/server/load-components.ts index 3fda4197c77ac..26ac8b843e7fd 100644 --- a/packages/next/src/server/load-components.ts +++ b/packages/next/src/server/load-components.ts @@ -100,7 +100,10 @@ async function loadJSManifest( name: string, entryname: string ): Promise { - await loadManifest(manifestPath) + process.env.NEXT_MINIMAL + ? // @ts-ignore + __non_webpack_require__(manifestPath) + : require(manifestPath) try { return JSON.parse((globalThis as any)[name][entryname]) as T } catch (err) { From a4c5484798480eb1e4ce9ed92f003f0e5da62161 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 10 Jul 2023 15:23:08 +0200 Subject: [PATCH 015/101] fix wrong path --- packages/next/src/build/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 101145e57957a..2849791efc5ff 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -2105,7 +2105,7 @@ export default async function build( [minimalTracedFiles, minimalFiles], ] as [Set, NodeFileTraceResult][]) { for (const file of traceResult.fileList) { - addToTracedFiles(traceContext, file, set) + addToTracedFiles(root, file, set) } } } From b4a2e71a8b126b1df7155994dd884b21452cd8b3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 10 Jul 2023 16:13:03 +0200 Subject: [PATCH 016/101] fix turbotrace tests --- packages/next/src/build/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 2849791efc5ff..05c2ec795af54 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -2070,11 +2070,10 @@ export default async function build( }, turboTasksForTrace ) - const [vanillaFiles, minimalFiles]: string[][] = - await Promise.all([ - makeTrace(vanillaServerEntries), - makeTrace(minimalServerEntries), - ]) + + // turbotrace does not handle concurrent tracing + const vanillaFiles = await makeTrace(vanillaServerEntries) + const minimalFiles = await makeTrace(minimalServerEntries) for (const [set, files] of [ [tracedFiles, vanillaFiles], From 3646bbb6d976adeff56e9c003b28d46a2c5dda79 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 11 Jul 2023 11:21:45 +0200 Subject: [PATCH 017/101] foo --- packages/next/src/build/index.ts | 20 +++++ .../build/utils/trace-module/trace-module.ts | 82 +++++++++++++++++++ .../src/build/utils/trace-module/worker.ts | 54 ++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 packages/next/src/build/utils/trace-module/trace-module.ts create mode 100644 packages/next/src/build/utils/trace-module/worker.ts diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 05c2ec795af54..22ce9349f2070 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -142,6 +142,7 @@ import { createValidFileMatcher } from '../server/lib/find-page-file' import { startTypeChecking } from './type-check' import { generateInterceptionRoutesRewrites } from '../lib/generate-interception-routes-rewrites' import { baseOverrides, experimentalOverrides } from '../server/require-hook' +import { traceModule } from './utils/trace-module/trace-module' export type SsgRoute = { initialRevalidateSeconds: number | false @@ -1669,6 +1670,25 @@ export default async function build( } } + if ( + !isEdgeRuntime(pageRuntime) && + !isStatic && + !isSsg && + !isReservedPage(page) && + pageInfos.get(page) === undefined + ) { + const pagePathNormal = path.join( + path.dirname(pagePath), + path.parse(pagePath).name + ) + await traceModule( + path.resolve( + path.join(distDir, 'server', pageType, pagePathNormal) + ), + distDir + ) + } + pageInfos.set(page, { size: selfSize, totalSize: allSize, diff --git a/packages/next/src/build/utils/trace-module/trace-module.ts b/packages/next/src/build/utils/trace-module/trace-module.ts new file mode 100644 index 0000000000000..f761ed4337113 --- /dev/null +++ b/packages/next/src/build/utils/trace-module/trace-module.ts @@ -0,0 +1,82 @@ +import { Worker } from 'worker_threads' +import path from 'path' +import chalk from 'next/dist/compiled/chalk' + +const worker = new Worker(path.join(__dirname, 'worker.js'), {}) + +function prettyPrint( + node: any, + distDir: string, + prefix = '', + isLast = false, + isRoot = true +) { + let duration = `${node.selfDuration.toFixed( + 2 + )}ms / ${node.totalDuration.toFixed(2)}ms` + + let output = `${prefix}${isLast || isRoot ? '└─ ' : '├─ '}${chalk.green( + path.relative(distDir, node.id) + )} ${chalk.yellow(duration)}\n` + + const childPrefix = `${prefix}${isRoot ? ' ' : isLast ? ' ' : '│ '}` + + node.children.forEach((child: any, i: number) => { + output += prettyPrint( + child, + node.id, + childPrefix, + i === node.children.length - 1, + false + ) + }) + + return output +} + +const queue = [] as any[] +let pendingPromise = Promise.resolve() + +function runQueue() { + pendingPromise = pendingPromise.then(async () => { + while (queue.length > 0) { + const { modulePath, distDir, resolve } = queue.shift() + const node = await traceModuleImpl(modulePath, distDir) + resolve(node) + } + }) +} + +export function traceModule(modulePath: string, distDir: string) { + return new Promise((resolve) => { + queue.push({ modulePath, distDir, resolve }) + runQueue() + }) +} + +export async function traceModuleImpl(modulePath: string, distDir: string) { + return new Promise((resolve) => { + const onResolve = ({ modulePath: mod, node }: any) => { + if (mod !== modulePath) { + return + } else { + worker.off('message', onResolve) + } + if (node?.error) { + console.log('failed for module', modulePath) + resolve(node) + } + require('fs').writeFileSync( + path.join(modulePath, '..', 'trace.json'), + node + ) + + console.log(prettyPrint(JSON.parse(node), distDir)) + resolve(node) + } + + worker.on('message', onResolve) + + worker.postMessage(modulePath) + }) +} diff --git a/packages/next/src/build/utils/trace-module/worker.ts b/packages/next/src/build/utils/trace-module/worker.ts new file mode 100644 index 0000000000000..1dca929826c15 --- /dev/null +++ b/packages/next/src/build/utils/trace-module/worker.ts @@ -0,0 +1,54 @@ +import { parentPort } from 'worker_threads' + +// we import it to get all the relevant polyfills in place +require('next/dist/compiled/minimal-next-server/next-server-cached') + +const originalCompile = require('module').prototype._compile + +let currentNode: any = null + +require('module').prototype._compile = function ( + _content: string, + filename: string +) { + let parent = currentNode + + currentNode = { + id: filename, + selfDuration: 0, + totalDuration: 0, + children: [], + } + + const start = performance.now() + const result = originalCompile.apply(this, arguments) + const end = performance.now() + + currentNode.totalDuration = end - start + currentNode.selfDuration = currentNode.children.reduce( + (acc: number, child: any) => acc - child.selfDuration, + currentNode.totalDuration + ) + + parent?.children.push(currentNode) + currentNode = parent || currentNode + return result +} + +parentPort?.on('message', (modulePath: string) => { + for (let moduleId in require.cache) { + delete require.cache[moduleId] + } + + try { + require(modulePath) + } catch (e) { + console.log(e) + parentPort?.postMessage({ + error: JSON.stringify(e), + }) + } + + parentPort?.postMessage({ modulePath, node: JSON.stringify(currentNode) }) + currentNode = null +}) From f6efc18b24930b4c13dc49ac46936f9e45f5c285 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 13 Jul 2023 23:01:37 +0200 Subject: [PATCH 018/101] add stuff --- .eslintrc.json | 2 +- packages/next/package.json | 1 + packages/next/src/build/index.ts | 12 +- .../build/utils/trace-module/trace-module.ts | 1 + .../src/build/utils/trace-module/worker.ts | 2 +- packages/next/src/build/webpack-config.ts | 8 + .../build/webpack/loaders/next-app-loader.ts | 2 +- packages/next/taskfile-next-build.js | 188 ++++++++++++++++++ packages/next/taskfile.js | 157 +-------------- pnpm-lock.yaml | 26 +-- 10 files changed, 221 insertions(+), 178 deletions(-) create mode 100644 packages/next/taskfile-next-build.js diff --git a/.eslintrc.json b/.eslintrc.json index 8e61fafc5441b..438dd62baa216 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -147,7 +147,7 @@ }, { "files": ["packages/**"], - "excludedFiles": ["packages/next/taskfile.js"], + "excludedFiles": ["packages/next/taskfile*.js"], "rules": { "no-shadow": ["warn", { "builtinGlobals": false }], "import/no-extraneous-dependencies": [ diff --git a/packages/next/package.json b/packages/next/package.json index 4b024befbfeed..d54ccbdae2783 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -295,6 +295,7 @@ "tar": "6.1.15", "taskr": "1.1.0", "terser": "5.14.1", + "terser-webpack-plugin": "5.3.9", "text-table": "0.2.0", "timers-browserify": "2.0.12", "tty-browserify": "0.0.1", diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index cd0ba4fcb6919..1fc35b18f22c7 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -2008,12 +2008,12 @@ export default async function build( const minimalServerEntries = [ ...sharedEntriesSet, - require.resolve( - 'next/dist/compiled/minimal-next-server/next-server-cached.js' - ), - require.resolve( - 'next/dist/compiled/minimal-next-server/next-server.js' - ), + // require.resolve( + // 'next/dist/compiled/minimal-next-server/next-server-cached.js' + // ), + // require.resolve( + // 'next/dist/compiled/minimal-next-server/next-server.js' + // ), ].filter(Boolean) const additionalIgnores = new Set() diff --git a/packages/next/src/build/utils/trace-module/trace-module.ts b/packages/next/src/build/utils/trace-module/trace-module.ts index f761ed4337113..2a2b3cb46aa5f 100644 --- a/packages/next/src/build/utils/trace-module/trace-module.ts +++ b/packages/next/src/build/utils/trace-module/trace-module.ts @@ -48,6 +48,7 @@ function runQueue() { } export function traceModule(modulePath: string, distDir: string) { + return Promise.resolve() return new Promise((resolve) => { queue.push({ modulePath, distDir, resolve }) runQueue() diff --git a/packages/next/src/build/utils/trace-module/worker.ts b/packages/next/src/build/utils/trace-module/worker.ts index 1dca929826c15..a5c7b980d84b6 100644 --- a/packages/next/src/build/utils/trace-module/worker.ts +++ b/packages/next/src/build/utils/trace-module/worker.ts @@ -1,7 +1,7 @@ import { parentPort } from 'worker_threads' // we import it to get all the relevant polyfills in place -require('next/dist/compiled/minimal-next-server/next-server-cached') +// require('next/dist/compiled/minimal-next-server/server.runtime.js') const originalCompile = require('module').prototype._compile diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 971e286374226..d66d1ce82144d 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1302,6 +1302,14 @@ export default async function getBaseWebpackConfig( resolveRequest: string ) => Promise<[string | null, boolean]> ) { + if ( + request.includes( + 'dist/compiled/minimal-next-server/app-page-render.runtime.js' + ) + ) { + return `next/dist/compiled/minimal-next-server/app-page-render.runtime.js` + } + // We need to externalize internal requests for files intended to // not be bundled. const isLocal: boolean = diff --git a/packages/next/src/build/webpack/loaders/next-app-loader.ts b/packages/next/src/build/webpack/loaders/next-app-loader.ts index 906fe745507b2..2463ca2157b20 100644 --- a/packages/next/src/build/webpack/loaders/next-app-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-app-loader.ts @@ -680,7 +680,7 @@ const nextAppLoader: AppLoader = async function nextAppLoader() { // Prefer to modify next/src/server/app-render/entry-base.ts since this is shared with Turbopack. // Any changes to this code should be reflected in Turbopack's app_source.rs and/or app-renderer.tsx as well. const result = ` - import RouteModule from 'next/dist/server/future/route-modules/app-page/module' + import RouteModule from 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' export ${treeCodeResult.treeCode} export ${treeCodeResult.pages} diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js new file mode 100644 index 0000000000000..f51dfc3b805cc --- /dev/null +++ b/packages/next/taskfile-next-build.js @@ -0,0 +1,188 @@ +const fs = require('fs').promises +const webpack = require('webpack') +const path = require('path') +const Module = require('module') +const vm = require('vm') +const TerserPlugin = require('terser-webpack-plugin') +const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') + +async function buildNextServer(task) { + const outputName = 'next-server.js' + const cachedOutputName = `${outputName}.cache` + + const minimalExternals = [ + 'react', + 'react/package.json', + 'react/jsx-runtime', + 'react/jsx-dev-runtime', + 'react-dom', + 'react-dom/package.json', + 'react-dom/client', + 'react-dom/server', + 'react-dom/server.browser', + 'react-dom/server.edge', + 'react-server-dom-webpack/client', + 'react-server-dom-webpack/client.edge', + 'react-server-dom-webpack/server.edge', + 'react-server-dom-webpack/server.node', + 'styled-jsx', + 'styled-jsx/style', + '@opentelemetry/api', + 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', + 'next/dist/compiled/@ampproject/toolbox-optimizer', + 'next/dist/compiled/edge-runtime', + 'next/dist/compiled/@edge-runtime/ponyfill', + 'next/dist/compiled/undici', + 'next/dist/compiled/raw-body', + 'next/dist/server/capsize-font-metrics.json', + 'critters', + 'next/dist/compiled/node-html-parser', + 'next/dist/compiled/compression', + 'next/dist/compiled/jsonwebtoken', + ].reduce((acc, pkg) => { + acc[pkg] = pkg + return acc + }, {}) + + Object.assign(minimalExternals, { + '/(.*)config$/': 'next/dist/server/config', + './web/sandbox': 'next/dist/server/web/sandbox', + }) + + // const BundleAnalyzerPlugin = + // require('webpack-bundle-analyzer').BundleAnalyzerPlugin + /** @type {webpack.Configuration} */ + const config = { + entry: { + server: path.join(__dirname, 'dist/server/next-server.js'), + 'app-page-render': path.join( + __dirname, + 'dist/server/future/route-modules/app-page/module.js' + ), + 'pages-render': path.join( + __dirname, + 'dist/server/future/route-modules/pages/module.js' + ), + }, + target: 'node', + mode: 'production', + output: { + path: path.join(__dirname, 'dist/compiled/minimal-next-server'), + filename: '[name].runtime.js', + libraryTarget: 'commonjs2', + }, + // left in for debugging + optimization: { + moduleIds: 'named', + minimize: false, + // minimize: true, + splitChunks: { + chunks: 'all', + }, + minimizer: [ + new TerserPlugin({ + extractComments: false, + terserOptions: { + format: { + comments: false, + }, + compress: { + passes: 2, + }, + }, + }), + ], + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production'), + 'process.env.NEXT_MINIMAL': JSON.stringify('true'), + 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), + }), + // new BundleAnalyzerPlugin({}), + ], + externals: [minimalExternals], + } + + await new Promise((resolve, reject) => { + webpack(config, (err, stats) => { + if (err) return reject(err) + if (stats.hasErrors()) { + return reject(new Error(stats.toString('errors-only'))) + } + resolve() + }) + }) + + return + + const wrappedTemplate = ` + const filename = ${JSON.stringify(outputName)} + const { readFileSync } = require('fs'), + { Script } = require('vm'), + { wrap } = require('module'), + { join } = require('path'); + const basename = join(__dirname, filename) + + const source = readFileSync(basename, 'utf-8') + + const cachedData = + !process.pkg && + require('process').platform !== 'win32' && + readFileSync(join(__dirname, '${cachedOutputName}')) + + const scriptOpts = { filename: basename, columnOffset: 0 } + + const script = new Script( + wrap(source), + cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts + ) + + script.runInThisContext()(exports, require, module, __filename, __dirname) + ` + + await fs.writeFile( + path.join( + __dirname, + `dist/compiled/minimal-next-server/next-server-cached.js` + ), + wrappedTemplate + ) + + const filename = path.resolve( + __dirname, + 'dist/compiled/minimal-next-server', + outputName + ) + + const content = require('fs').readFileSync(filename, 'utf8') + + const wrapper = Module.wrap(content) + var script = new vm.Script(wrapper, { + filename: filename, + lineOffset: 0, + displayErrors: true, + }) + + script.runInThisContext()(exports, require, module, __filename, __dirname) + + const buffer = script.createCachedData() + + await fs.writeFile( + path.join( + __dirname, + `dist/compiled/minimal-next-server/${cachedOutputName}` + ), + buffer + ) +} + +module.exports = { + buildNextServer, +} + +if (require.main === module) { + buildNextServer().then(() => { + console.log('done') + }) +} diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 6d131c422e7cd..fcf54d3b00652 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -5,6 +5,7 @@ const glob = require('glob') const fs = require('fs-extra') // eslint-disable-next-line import/no-extraneous-dependencies const resolveFrom = require('resolve-from') +const { buildNextServer } = require('./taskfile-next-build') export async function next__polyfill_nomodule(task, opts) { await task @@ -2632,155 +2633,11 @@ export async function release(task) { } export async function minimal_next_server(task) { - const outputName = 'next-server.js' - const cachedOutputName = `${outputName}.cache` - - const minimalExternals = [ - 'react', - 'react/package.json', - 'react/jsx-runtime', - 'react/jsx-dev-runtime', - 'react-dom', - 'react-dom/package.json', - 'react-dom/client', - 'react-dom/server', - 'react-dom/server.browser', - 'react-dom/server.edge', - 'react-server-dom-webpack/client', - 'react-server-dom-webpack/client.edge', - 'react-server-dom-webpack/server.edge', - 'react-server-dom-webpack/server.node', - 'styled-jsx', - 'styled-jsx/style', - '@opentelemetry/api', - 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', - 'next/dist/compiled/@ampproject/toolbox-optimizer', - 'next/dist/compiled/edge-runtime', - 'next/dist/compiled/@edge-runtime/ponyfill', - 'next/dist/compiled/undici', - 'next/dist/compiled/raw-body', - 'next/dist/server/capsize-font-metrics.json', - 'critters', - 'next/dist/compiled/node-html-parser', - 'next/dist/compiled/compression', - 'next/dist/compiled/jsonwebtoken', - ].reduce((acc, pkg) => { - acc[pkg] = pkg - return acc - }, {}) - - Object.assign(minimalExternals, { - '/(.*)config$/': 'next/dist/server/config', - './web/sandbox': 'next/dist/server/web/sandbox', - }) - - const webpack = require('webpack') - const TerserPlugin = require('terser-webpack-plugin') - // const BundleAnalyzerPlugin = - // require('webpack-bundle-analyzer').BundleAnalyzerPlugin - /** @type {webpack.Configuration} */ - const config = { - entry: join(__dirname, 'dist/server/next-server.js'), - target: 'node', - mode: 'production', - output: { - path: join(__dirname, 'dist/compiled/minimal-next-server'), - filename: outputName, - libraryTarget: 'commonjs2', - }, - // left in for debugging - optimization: { - moduleIds: 'named', - // minimize: false, - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: false, - terserOptions: { - format: { - comments: false, - }, - compress: { - passes: 2, - }, - }, - }), - ], - }, - plugins: [ - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('production'), - 'process.env.NEXT_MINIMAL': JSON.stringify('true'), - 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), - }), - // new BundleAnalyzerPlugin({}), - ], - externals: [minimalExternals], - } - - await new Promise((resolve, reject) => { - webpack(config, (err, stats) => { - if (err) return reject(err) - if (stats.hasErrors()) { - return reject(new Error(stats.toString('errors-only'))) - } - resolve() - }) - }) - - const wrappedTemplate = ` -const filename = ${JSON.stringify(outputName)} -const { readFileSync } = require('fs'), - { Script } = require('vm'), - { wrap } = require('module'), - { join } = require('path'); -const basename = join(__dirname, filename) - -const source = readFileSync(basename, 'utf-8') - -const cachedData = - !process.pkg && - require('process').platform !== 'win32' && - readFileSync(join(__dirname, '${cachedOutputName}')) - -const scriptOpts = { filename: basename, columnOffset: 0 } - -const script = new Script( - wrap(source), - cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts -) - -script.runInThisContext()(exports, require, module, __filename, __dirname) -` - - await fs.writeFile( - join(__dirname, `dist/compiled/minimal-next-server/next-server-cached.js`), - wrappedTemplate - ) - - const Module = require('module') - const vm = require('vm') - const filename = resolve( - __dirname, - 'dist/compiled/minimal-next-server', - outputName - ) - - const content = require('fs').readFileSync(filename, 'utf8') - - const wrapper = Module.wrap(content) - var script = new vm.Script(wrapper, { - filename: filename, - lineOffset: 0, - displayErrors: true, - }) - - script.runInThisContext()(exports, require, module, __filename, __dirname) - - const buffer = script.createCachedData() + await task + .watch('src/', 'minimal_next_server_build') + .target('dist/compiled/minimal-next-server') +} - await fs.writeFile( - join(__dirname, `dist/compiled/minimal-next-server/${cachedOutputName}`), - buffer - ) +export async function minimal_next_server_build(task) { + // await buildNextServer() } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a41ed08b08a6d..f27eea1e9bb8e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -675,6 +675,7 @@ importers: tar: 6.1.15 taskr: 1.1.0 terser: 5.14.1 + terser-webpack-plugin: 5.3.9 text-table: 0.2.0 timers-browserify: 2.0.12 tty-browserify: 0.0.1 @@ -871,7 +872,7 @@ importers: react-is: 18.2.0 react-refresh: 0.12.0 regenerator-runtime: 0.13.4 - sass-loader: 12.4.0_tk3fk7f5cr6yvym2qzwo3hwezi + sass-loader: 12.4.0_webpack@5.86.0 schema-utils2: /schema-utils/2.7.1 schema-utils3: /schema-utils/3.0.0 semver: 7.3.2 @@ -889,6 +890,7 @@ importers: tar: 6.1.15 taskr: 1.1.0 terser: 5.14.1 + terser-webpack-plugin: 5.3.9_webpack@5.86.0 text-table: 0.2.0 timers-browserify: 2.0.12 tty-browserify: 0.0.1 @@ -6136,7 +6138,7 @@ packages: dependencies: '@mdx-js/mdx': 2.2.1 source-map: 0.7.3 - webpack: 5.86.0 + webpack: 5.86.0_@swc+core@1.3.55 transitivePeerDependencies: - supports-color @@ -6810,7 +6812,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-darwin-x64/1.3.55: @@ -6819,7 +6820,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm-gnueabihf/1.3.55: @@ -6828,7 +6828,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-gnu/1.3.55: @@ -6837,7 +6836,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-arm64-musl/1.3.55: @@ -6846,7 +6844,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-gnu/1.3.55: @@ -6855,7 +6852,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-linux-x64-musl/1.3.55: @@ -6864,7 +6860,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@swc/core-win32-arm64-msvc/1.3.55: @@ -6873,7 +6868,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-ia32-msvc/1.3.55: @@ -6882,7 +6876,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core-win32-x64-msvc/1.3.55: @@ -6891,7 +6884,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@swc/core/1.3.55_@swc+helpers@0.5.1: @@ -6916,7 +6908,6 @@ packages: '@swc/core-win32-arm64-msvc': 1.3.55 '@swc/core-win32-ia32-msvc': 1.3.55 '@swc/core-win32-x64-msvc': 1.3.55 - dev: true /@swc/helpers/0.4.14: resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} @@ -12803,6 +12794,7 @@ packages: requiresBuild: true dependencies: detect-libc: 1.0.3 + dev: false /figgy-pudding/3.5.1: resolution: {integrity: sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==} @@ -21720,7 +21712,7 @@ packages: resolution: {integrity: sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==} dependencies: rc: 1.2.8 - safe-buffer: 5.2.0 + safe-buffer: 5.2.1 dev: true /registry-auth-token/4.2.1: @@ -22345,7 +22337,7 @@ packages: /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - /sass-loader/12.4.0_tk3fk7f5cr6yvym2qzwo3hwezi: + /sass-loader/12.4.0_webpack@5.86.0: resolution: {integrity: sha512-7xN+8khDIzym1oL9XyS6zP6Ges+Bo2B2xbPrjdMHEYyV3AQYhd/wXeru++3ODHF0zMjYmVadblSKrPrjEkL8mg==} engines: {node: '>= 12.13.0'} peerDependencies: @@ -22361,10 +22353,8 @@ packages: sass: optional: true dependencies: - fibers: 5.0.3 klona: 2.0.4 neo-async: 2.6.2 - sass: 1.54.0 webpack: 5.86.0 dev: true @@ -23749,7 +23739,6 @@ packages: serialize-javascript: 6.0.1 terser: 5.17.7 webpack: 5.86.0_@swc+core@1.3.55 - dev: true /terser/5.10.0: resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} @@ -25102,7 +25091,6 @@ packages: - '@swc/core' - esbuild - uglify-js - dev: true /websocket-driver/0.7.3: resolution: {integrity: sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==} From e591156f16994cca22165bbd0ff824a8f939901d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 19 Jul 2023 13:45:08 +0200 Subject: [PATCH 019/101] tmp --- bench/basic-app/app/api/app/route.js | 5 + bench/basic-app/app/layout.js | 12 + bench/basic-app/app/page.js | 7 + bench/basic-app/next.config.js | 5 + bench/basic-app/pages/api/index.js | 3 + packages/next/src/build/index.ts | 24 +- packages/next/src/build/webpack-config.ts | 8 + .../loaders/next-route-loader/index.ts | 3 +- .../next/src/server/dev/next-dev-server.ts | 2 +- packages/next/src/server/lib/trace/tracer.ts | 10 +- packages/next/src/server/load-components.ts | 31 --- .../server/load-default-error-components.ts | 76 ++++++ packages/next/src/server/load-manifest.ts | 1 + packages/next/src/server/next-server.ts | 51 ++-- .../next/src/server/node-polyfill-form.ts | 32 ++- packages/next/taskfile-next-build.js | 242 +++++++++++++----- packages/next/taskfile.js | 12 +- scripts/minimal-server.js | 12 +- test/e2e/app-dir/app-edge/next.config.js | 10 + 19 files changed, 397 insertions(+), 149 deletions(-) create mode 100644 bench/basic-app/app/api/app/route.js create mode 100644 bench/basic-app/app/layout.js create mode 100644 bench/basic-app/app/page.js create mode 100644 bench/basic-app/next.config.js create mode 100644 bench/basic-app/pages/api/index.js create mode 100644 packages/next/src/server/load-default-error-components.ts create mode 100644 test/e2e/app-dir/app-edge/next.config.js diff --git a/bench/basic-app/app/api/app/route.js b/bench/basic-app/app/api/app/route.js new file mode 100644 index 0000000000000..944ba5a8e827f --- /dev/null +++ b/bench/basic-app/app/api/app/route.js @@ -0,0 +1,5 @@ +export function GET() { + return { name: 'John Doe' } +} + +export const dynamic = 'force-dynamic' diff --git a/bench/basic-app/app/layout.js b/bench/basic-app/app/layout.js new file mode 100644 index 0000000000000..8ebf54889577d --- /dev/null +++ b/bench/basic-app/app/layout.js @@ -0,0 +1,12 @@ +import React from 'react' + +export default function Layout({ children }) { + return ( + + + My App + + {children} + + ) +} diff --git a/bench/basic-app/app/page.js b/bench/basic-app/app/page.js new file mode 100644 index 0000000000000..83dc3aa56c9a0 --- /dev/null +++ b/bench/basic-app/app/page.js @@ -0,0 +1,7 @@ +import React from 'react' + +export default function Page() { + return

My Page

+} + +export const dynamic = 'force-dynamic' diff --git a/bench/basic-app/next.config.js b/bench/basic-app/next.config.js new file mode 100644 index 0000000000000..0957c472383fa --- /dev/null +++ b/bench/basic-app/next.config.js @@ -0,0 +1,5 @@ +module.exports = { + experimental: { + serverMinification: true, + }, +} diff --git a/bench/basic-app/pages/api/index.js b/bench/basic-app/pages/api/index.js new file mode 100644 index 0000000000000..5ac499ab8a0fc --- /dev/null +++ b/bench/basic-app/pages/api/index.js @@ -0,0 +1,3 @@ +export function handler(req, res) { + res.status(200).json({ name: 'John Doe' }) +} diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index d64a0fc103809..2385be2db69a8 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -1982,6 +1982,15 @@ export default async function build( ...Object.values(experimentalOverrides).map((override) => require.resolve(override) ), + require.resolve( + 'next/dist/compiled/minimal-next-server/server.runtime.js' + ), + require.resolve( + 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' + ), + require.resolve( + 'next/dist/compiled/minimal-next-server/pages-render.runtime.js' + ), ] // ensure we trace any dependencies needed for custom @@ -2008,12 +2017,15 @@ export default async function build( const minimalServerEntries = [ ...sharedEntriesSet, - // require.resolve( - // 'next/dist/compiled/minimal-next-server/next-server-cached.js' - // ), - // require.resolve( - // 'next/dist/compiled/minimal-next-server/next-server.js' - // ), + require.resolve( + 'next/dist/compiled/minimal-next-server/server.runtime.js' + ), + require.resolve( + 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' + ), + require.resolve( + 'next/dist/compiled/minimal-next-server/pages-render.runtime.js' + ), ].filter(Boolean) const additionalIgnores = new Set() diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index d66d1ce82144d..db687bd74ba1b 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1310,6 +1310,14 @@ export default async function getBaseWebpackConfig( return `next/dist/compiled/minimal-next-server/app-page-render.runtime.js` } + if ( + request.includes( + 'dist/compiled/minimal-next-server/pages-render.runtime.js' + ) + ) { + return `next/dist/compiled/minimal-next-server/pages-render.runtime.js` + } + // We need to externalize internal requests for files intended to // not be bundled. const isLocal: boolean = diff --git a/packages/next/src/build/webpack/loaders/next-route-loader/index.ts b/packages/next/src/build/webpack/loaders/next-route-loader/index.ts index 71e880c39403d..6759abab813e8 100644 --- a/packages/next/src/build/webpack/loaders/next-route-loader/index.ts +++ b/packages/next/src/build/webpack/loaders/next-route-loader/index.ts @@ -107,7 +107,8 @@ const loader: webpack.LoaderDefinitionFunction = return ` // Next.js Route Loader - import RouteModule from "next/dist/server/future/route-modules/pages/module" + // import RouteModule from "next/dist/server/future/route-modules/pages/module" + import RouteModule from "next/dist/compiled/minimal-next-server/pages-render.runtime.js" import { hoist } from "next/dist/build/webpack/loaders/next-route-loader/helpers" // Import the app and document modules. diff --git a/packages/next/src/server/dev/next-dev-server.ts b/packages/next/src/server/dev/next-dev-server.ts index 5f7e86dda5438..475390b679e4e 100644 --- a/packages/next/src/server/dev/next-dev-server.ts +++ b/packages/next/src/server/dev/next-dev-server.ts @@ -56,7 +56,7 @@ import { UnwrapPromise, withCoalescedInvoke, } from '../../lib/coalesced-function' -import { loadDefaultErrorComponents } from '../load-components' +import { loadDefaultErrorComponents } from '../load-default-error-components' import { DecodeError, MiddlewareNotFoundError } from '../../shared/lib/utils' import { createOriginalStackFrame, diff --git a/packages/next/src/server/lib/trace/tracer.ts b/packages/next/src/server/lib/trace/tracer.ts index 7d2184cb48e33..4129d2c76b7cc 100644 --- a/packages/next/src/server/lib/trace/tracer.ts +++ b/packages/next/src/server/lib/trace/tracer.ts @@ -20,11 +20,11 @@ let api: typeof import('next/dist/compiled/@opentelemetry/api') if (process.env.NEXT_RUNTIME === 'edge') { api = require('@opentelemetry/api') } else { - try { - api = require('@opentelemetry/api') - } catch (err) { - api = require('next/dist/compiled/@opentelemetry/api') - } + // try { + // api = require('@opentelemetry/api') + // } catch (err) { + api = require('next/dist/compiled/@opentelemetry/api') + // } } const { context, trace, SpanStatusCode, SpanKind } = api diff --git a/packages/next/src/server/load-components.ts b/packages/next/src/server/load-components.ts index 26ac8b843e7fd..f3d5b1e13dac9 100644 --- a/packages/next/src/server/load-components.ts +++ b/packages/next/src/server/load-components.ts @@ -51,32 +51,6 @@ export type LoadComponentsReturnType = { pathname: string } -async function loadDefaultErrorComponentsImpl( - distDir: string -): Promise { - const Document = interopDefault(require('next/dist/pages/_document')) - const AppMod = require('next/dist/pages/_app') - const App = interopDefault(AppMod) - - // Load the compiled route module for this builtin error. - // TODO: (wyattjoh) replace this with just exporting the route module when the transition is complete - const ComponentMod = - require('./future/route-modules/pages/builtin/_error') as typeof import('./future/route-modules/pages/builtin/_error') - const Component = ComponentMod.routeModule.userland.default - - return { - App, - Document, - Component, - pageConfig: {}, - buildManifest: require(join(distDir, `fallback-${BUILD_MANIFEST}`)), - reactLoadableManifest: {}, - ComponentMod, - pathname: '/_error', - routeModule: ComponentMod.routeModule, - } -} - /** * Load manifest file with retries, defaults to 3 attempts. */ @@ -200,8 +174,3 @@ export const loadComponents = getTracer().wrap( LoadComponentsSpan.loadComponents, loadComponentsImpl ) - -export const loadDefaultErrorComponents = getTracer().wrap( - LoadComponentsSpan.loadDefaultErrorComponents, - loadDefaultErrorComponentsImpl -) diff --git a/packages/next/src/server/load-default-error-components.ts b/packages/next/src/server/load-default-error-components.ts new file mode 100644 index 0000000000000..d06a68506b8da --- /dev/null +++ b/packages/next/src/server/load-default-error-components.ts @@ -0,0 +1,76 @@ +import type { + AppType, + DocumentType, + NextComponentType, +} from '../shared/lib/utils' +import type { ClientReferenceManifest } from '../build/webpack/plugins/flight-manifest-plugin' +import type { + PageConfig, + GetStaticPaths, + GetServerSideProps, + GetStaticProps, +} from 'next/types' +import type { RouteModule } from './future/route-modules/route-module' + +import { BUILD_MANIFEST } from '../shared/lib/constants' +import { join } from 'path' +import { BuildManifest } from './get-page-files' +import { interopDefault } from '../lib/interop-default' +import { getTracer } from './lib/trace/tracer' +import { LoadComponentsSpan } from './lib/trace/constants' +export type ManifestItem = { + id: number | string + files: string[] +} + +export type ReactLoadableManifest = { [moduleId: string]: ManifestItem } + +export type LoadComponentsReturnType = { + Component: NextComponentType + pageConfig: PageConfig + buildManifest: BuildManifest + subresourceIntegrityManifest?: Record + reactLoadableManifest: ReactLoadableManifest + clientReferenceManifest?: ClientReferenceManifest + serverActionsManifest?: any + Document: DocumentType + App: AppType + getStaticProps?: GetStaticProps + getStaticPaths?: GetStaticPaths + getServerSideProps?: GetServerSideProps + ComponentMod: any + routeModule?: RouteModule + isAppPath?: boolean + pathname: string +} + +async function loadDefaultErrorComponentsImpl( + distDir: string +): Promise { + const Document = interopDefault(require('next/dist/pages/_document')) + const AppMod = require('next/dist/pages/_app') + const App = interopDefault(AppMod) + + // Load the compiled route module for this builtin error. + // TODO: (wyattjoh) replace this with just exporting the route module when the transition is complete + const ComponentMod = + require('./future/route-modules/pages/builtin/_error') as typeof import('./future/route-modules/pages/builtin/_error') + const Component = ComponentMod.routeModule.userland.default + + return { + App, + Document, + Component, + pageConfig: {}, + buildManifest: require(join(distDir, `fallback-${BUILD_MANIFEST}`)), + reactLoadableManifest: {}, + ComponentMod, + pathname: '/_error', + routeModule: ComponentMod.routeModule, + } +} + +export const loadDefaultErrorComponents = getTracer().wrap( + LoadComponentsSpan.loadDefaultErrorComponents, + loadDefaultErrorComponentsImpl +) diff --git a/packages/next/src/server/load-manifest.ts b/packages/next/src/server/load-manifest.ts index af732453a8168..d32706ec127f6 100644 --- a/packages/next/src/server/load-manifest.ts +++ b/packages/next/src/server/load-manifest.ts @@ -3,6 +3,7 @@ import { readFileSync } from 'fs' const cache = new Map() export function loadManifest(path: string, shouldCache: boolean = true) { + console.log('loadManifest', path) const cached = shouldCache && cache.get(path) if (cached) { diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 64e8d643b5ead..b40f433856f28 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -28,7 +28,6 @@ import { } from '../shared/lib/router/utils/route-matcher' import type { MiddlewareRouteMatch } from '../shared/lib/router/utils/middleware-route-matcher' import type { RouteMatch } from './future/route-matches/route-match' -import { renderToHTML, type RenderOpts } from './render' import fs from 'fs' import { join, relative, resolve, sep, isAbsolute } from 'path' @@ -951,7 +950,7 @@ export default class NextNodeServer extends BaseServer { res: NodeNextResponse, pathname: string, query: NextParsedUrlQuery, - renderOpts: RenderOpts + renderOpts: import('./render').RenderOpts ): Promise { return getTracer().trace(NextNodeServerSpan.renderHTML, async () => this.renderHTMLImpl(req, res, pathname, query, renderOpts) @@ -963,17 +962,34 @@ export default class NextNodeServer extends BaseServer { res: NodeNextResponse, pathname: string, query: NextParsedUrlQuery, - renderOpts: RenderOpts + renderOpts: import('./render').RenderOpts ): Promise { - // Due to the way we pass data by mutating `renderOpts`, we can't extend the - // object here but only updating its `nextFontManifest` field. - // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952 - renderOpts.nextFontManifest = this.nextFontManifest - - if (this.hasAppDir && renderOpts.isAppPath) { - const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = - require('./app-render/app-render') as typeof import('./app-render/app-render') - return appRenderToHTMLOrFlight( + if (process.env.NEXT_MINIMAL) { + throw new Error( + 'invariant: renderHTML should not be called in minimal mode' + ) + } else { + // Due to the way we pass data by mutating `renderOpts`, we can't extend the + // object here but only updating its `nextFontManifest` field. + // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952 + renderOpts.nextFontManifest = this.nextFontManifest + + if (this.hasAppDir && renderOpts.isAppPath) { + const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = + require('./app-render/app-render') as typeof import('./app-render/app-render') + return appRenderToHTMLOrFlight( + req.originalRequest, + res.originalResponse, + pathname, + query, + renderOpts + ) + } + + // TODO: re-enable this once we've refactored to use implicit matches + // throw new Error('Invariant: render should have used routeModule') + + return require('./render').renderToHTML( req.originalRequest, res.originalResponse, pathname, @@ -981,17 +997,6 @@ export default class NextNodeServer extends BaseServer { renderOpts ) } - - // TODO: re-enable this once we've refactored to use implicit matches - // throw new Error('Invariant: render should have used routeModule') - - return renderToHTML( - req.originalRequest, - res.originalResponse, - pathname, - query, - renderOpts - ) } private streamResponseChunk(res: ServerResponse, chunk: any) { diff --git a/packages/next/src/server/node-polyfill-form.ts b/packages/next/src/server/node-polyfill-form.ts index 9a174305abf41..1e953b8b74ba7 100644 --- a/packages/next/src/server/node-polyfill-form.ts +++ b/packages/next/src/server/node-polyfill-form.ts @@ -2,12 +2,30 @@ * Polyfills `FormData` and `Blob` in the Node.js runtime. */ -if (!global.FormData) { - const { FormData } = require('next/dist/compiled/@edge-runtime/ponyfill') - global.FormData = FormData -} +if (!global.FormData || !global.Blob) { + let installedFormData: any + let installedBlob: any + Object.defineProperty(global, 'FormData', { + get() { + if (!installedFormData) { + const polyfills = require('next/dist/compiled/@edge-runtime/ponyfill') + installedFormData = polyfills.FormData + installedBlob = polyfills.Blob + return installedFormData + } + return installedFormData + }, + }) -if (!global.Blob) { - const { Blob } = require('next/dist/compiled/@edge-runtime/ponyfill') - global.Blob = Blob + Object.defineProperty(global, 'Blob', { + get() { + if (installedBlob) { + return installedBlob + } + const polyfills = require('next/dist/compiled/@edge-runtime/ponyfill') + installedFormData = polyfills.FormData + installedBlob = polyfills.Blob + return installedBlob + }, + }) } diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index f51dfc3b805cc..996fe2aed22d1 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -1,12 +1,153 @@ const fs = require('fs').promises const webpack = require('webpack') const path = require('path') -const Module = require('module') -const vm = require('vm') const TerserPlugin = require('terser-webpack-plugin') const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') +const { outputFile } = require('fs-extra') + +const generateCachedScript = (filename) => ` +const filename = ${JSON.stringify(filename + '.cache')} +const { readFileSync } = require('fs'), + { Script } = require('vm'), + { wrap } = require('module'), + { join } = require('path'); +const basename = join(__dirname, filename) + +// const source = readFileSync(basename, 'utf-8') + +const cachedData = + !process.pkg && + require('process').platform !== 'win32' && + readFileSync(join(__dirname, ${JSON.stringify(filename + '.cache')})) + + // Retrieve the length of the string buffer from the first 4 bytes of the file + const stringBufferLength = cachedData.readInt32BE(0); + + // Split the combinedBuffer back into the original string and buffer + const text = cachedData.slice(4, stringBufferLength + 4).toString('utf-8'); + + const buffer = cachedData.slice(stringBufferLength + 4); + +const scriptOpts = { filename: ${JSON.stringify( + filename +)}, columnOffset: 0, cachedData: buffer } + +const script = new Script( + // wrap(source), + text, + scriptOpts +) +console.log(script.cachedDataRejected) + +script.runInThisContext()(exports, require, module, __filename, __dirname) +` + +const generateCachingScript = (filename) => ` +// require('./server.runtime.js') +const filename = ${JSON.stringify(filename)} +const { readFileSync } = require('fs'), + { Script } = require('vm'), + { wrap } = require('module'), + { join } = require('path'); +const basename = join(__dirname, filename) + +const source = wrap(readFileSync(basename, 'utf-8')) + +const scriptOpts = { filename, columnOffset: 0 } + +const script = new Script( + source, + scriptOpts +) +const newfilename = __filename.replace('.caching.js', '') +console.log(__filename.replace('.caching.js', ''), __dirname) +script.runInThisContext()(exports, require, module, newfilename, __dirname) + +const buffer = script.createCachedData() + +// Convert text to buffer +const stringBuffer = Buffer.from(source); + +// Get the length of the string buffer and create a buffer from it +const lengthBuffer = Buffer.alloc(4); +lengthBuffer.writeInt32BE(stringBuffer.length, 0); + +// Combine the buffers +const combinedBuffer = Buffer.concat([lengthBuffer, stringBuffer, buffer]); + + +require('fs').writeFileSync( + join(__dirname, ${JSON.stringify(filename + '.cache')}), + combinedBuffer +) +` + +async function createCache(file) { + // const fullpath = path.join( + // __dirname, + // 'dist/compiled/minimal-next-server', + // file + // ) + // const content = await fs.readFile(fullpath, 'utf8') + + // copy to .raw + // await fs.writeFile( + // path.join(__dirname, 'dist/compiled/minimal-next-server', file + '.raw'), + // content + // ) + + // await fs.writeFile( + // path.join(__dirname, 'dist/compiled/minimal-next-server', file), + // generateScript(file) + // ) + + await fs.writeFile( + path.join( + __dirname, + 'dist/compiled/minimal-next-server', + file + '.caching.js' + ), + generateCachingScript(file) + ) + + // require(path.join( + // __dirname, + // 'dist/compiled/minimal-next-server', + // file + '.caching.js' + // )) + + // run the node script + require('child_process').execSync( + `node ${path.join( + __dirname, + 'dist/compiled/minimal-next-server', + file + '.caching.js' + )}`, + { + stdio: 'inherit', + } + ) + + fs.rm( + path.join( + __dirname, + 'dist/compiled/minimal-next-server', + file + '.caching.js' + ), + { + recursive: true, + force: true, + } + ) +} async function buildNextServer(task) { + // cleanup old files + await fs.rm(path.join(__dirname, 'dist/compiled/minimal-next-server'), { + recursive: true, + force: true, + }) + const outputName = 'next-server.js' const cachedOutputName = `${outputName}.cache` @@ -74,11 +215,11 @@ async function buildNextServer(task) { // left in for debugging optimization: { moduleIds: 'named', - minimize: false, - // minimize: true, - splitChunks: { - chunks: 'all', - }, + // minimize: false, + minimize: true, + // splitChunks: { + // chunks: 'all', + // }, minimizer: [ new TerserPlugin({ extractComments: false, @@ -104,77 +245,40 @@ async function buildNextServer(task) { externals: [minimalExternals], } - await new Promise((resolve, reject) => { + const outputFiles = await new Promise((resolve, reject) => { webpack(config, (err, stats) => { if (err) return reject(err) + + const outputFiles = stats.toJson().assets.map((asset) => asset.name) + if (stats.hasErrors()) { return reject(new Error(stats.toString('errors-only'))) + } else { + fs.writeFile( + path.join( + __dirname, + 'dist/compiled/minimal-next-server', + 'stats.json' + ), + JSON.stringify(stats.toJson()), + 'utf8' + ) } - resolve() + resolve(outputFiles) }) }) - return - - const wrappedTemplate = ` - const filename = ${JSON.stringify(outputName)} - const { readFileSync } = require('fs'), - { Script } = require('vm'), - { wrap } = require('module'), - { join } = require('path'); - const basename = join(__dirname, filename) - - const source = readFileSync(basename, 'utf-8') - - const cachedData = - !process.pkg && - require('process').platform !== 'win32' && - readFileSync(join(__dirname, '${cachedOutputName}')) - - const scriptOpts = { filename: basename, columnOffset: 0 } - - const script = new Script( - wrap(source), - cachedData ? Object.assign({ cachedData }, scriptOpts) : scriptOpts - ) - - script.runInThisContext()(exports, require, module, __filename, __dirname) - ` - - await fs.writeFile( - path.join( - __dirname, - `dist/compiled/minimal-next-server/next-server-cached.js` - ), - wrappedTemplate - ) - - const filename = path.resolve( - __dirname, - 'dist/compiled/minimal-next-server', - outputName - ) - - const content = require('fs').readFileSync(filename, 'utf8') - - const wrapper = Module.wrap(content) - var script = new vm.Script(wrapper, { - filename: filename, - lineOffset: 0, - displayErrors: true, - }) - - script.runInThisContext()(exports, require, module, __filename, __dirname) - - const buffer = script.createCachedData() + // await Promise.all(outputFiles.map((file) => createCache(file))) + // await Promise.all( + // outputFiles.map((file) => + // fs.writeFile( + // path.join(__dirname, 'dist/compiled/minimal-next-server', file), + // generateCachedScript(file) + // ) + // ) + // ) - await fs.writeFile( - path.join( - __dirname, - `dist/compiled/minimal-next-server/${cachedOutputName}` - ), - buffer - ) + return } module.exports = { diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index fcf54d3b00652..cf5d461c841b8 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -2339,7 +2339,7 @@ export async function ncc(task, opts) { ) } -export async function compile(task, opts) { +export async function next_compile(task, opts) { await task.parallel( [ 'cli', @@ -2369,12 +2369,16 @@ export async function compile(task, opts) { ], opts ) +} + +export async function compile(task, opts) { + await task.serial(['next_compile', 'next_minimal_compile']) + await task.serial([ 'ncc_react_refresh_utils', 'ncc_next__react_dev_overlay', 'ncc_next_font', 'capsize_metrics', - 'minimal_next_server', ]) } @@ -2638,6 +2642,6 @@ export async function minimal_next_server(task) { .target('dist/compiled/minimal-next-server') } -export async function minimal_next_server_build(task) { - // await buildNextServer() +export async function next_minimal_compile(task) { + await buildNextServer() } diff --git a/scripts/minimal-server.js b/scripts/minimal-server.js index f4f30ac97ce25..f16082ce7ebea 100644 --- a/scripts/minimal-server.js +++ b/scripts/minimal-server.js @@ -1,3 +1,4 @@ +console.time('next-wall-time') // Usage: node scripts/minimal-server.js // This script is used to run a minimal Next.js server in production mode. @@ -44,11 +45,13 @@ if (process.env.LOG_READFILE) { require('fs').readFile = function (path, options, callback) { readFileCount++ + console.log(`readFile: ${path}`) return originalReadFile.apply(this, arguments) } require('fs').readFileSync = function (path, options) { readFileSyncCount++ + console.log(`readFileSync: ${path}`) return originalReadFileSync.apply(this, arguments) } } @@ -56,10 +59,13 @@ if (process.env.LOG_READFILE) { console.time('next-cold-start') const NextServer = process.env.USE_BUNDLED_NEXT - ? require('next/dist/compiled/minimal-next-server/next-server-cached').default + ? require('next/dist/compiled/minimal-next-server/server.runtime').default : require('next/dist/server/next-server').default -console.timeEnd('next-cold-start') +// if (process.env.USE_BUNDLED_NEXT) { +// require('next/dist/compiled/minimal-next-server/app-page-render.runtime') +// } + if (process.env.LOG_READFILE) { console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) } @@ -101,9 +107,11 @@ require('http') if (process.env.LOG_READFILE) { console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) } + console.timeEnd('next-wall-time') require('process').exit(0) }) }) .listen(3000, () => { console.timeEnd('next-cold-start') + fetch('http://localhost:3000') }) diff --git a/test/e2e/app-dir/app-edge/next.config.js b/test/e2e/app-dir/app-edge/next.config.js new file mode 100644 index 0000000000000..f44f1b9459e21 --- /dev/null +++ b/test/e2e/app-dir/app-edge/next.config.js @@ -0,0 +1,10 @@ +module.exports = { + webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { + config.plugins.push((c) => + c.hooks.done.tap('test', (stats) => + console.log(stats.toString({ errorDetails: true })) + ) + ) + return config + }, +} From 841521b7e440d2fabc2f160fc2d496c227f9a56f Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 20 Jul 2023 14:47:25 +0200 Subject: [PATCH 020/101] stuff --- packages/next/src/server/load-manifest.ts | 1 - packages/next/taskfile-next-build.js | 10 +++++++--- scripts/minimal-server.js | 22 +++++++++++++++++++--- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/packages/next/src/server/load-manifest.ts b/packages/next/src/server/load-manifest.ts index d32706ec127f6..af732453a8168 100644 --- a/packages/next/src/server/load-manifest.ts +++ b/packages/next/src/server/load-manifest.ts @@ -3,7 +3,6 @@ import { readFileSync } from 'fs' const cache = new Map() export function loadManifest(path: string, shouldCache: boolean = true) { - console.log('loadManifest', path) const cached = shouldCache && cache.get(path) if (cached) { diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index 996fe2aed22d1..b6dd782540b0a 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -195,14 +195,14 @@ async function buildNextServer(task) { /** @type {webpack.Configuration} */ const config = { entry: { - server: path.join(__dirname, 'dist/server/next-server.js'), + server: path.join(__dirname, 'dist/esm/server/next-server.js'), 'app-page-render': path.join( __dirname, - 'dist/server/future/route-modules/app-page/module.js' + 'dist/esm/server/future/route-modules/app-page/module.js' ), 'pages-render': path.join( __dirname, - 'dist/server/future/route-modules/pages/module.js' + 'dist/esm/server/future/route-modules/pages/module.js' ), }, target: 'node', @@ -242,6 +242,10 @@ async function buildNextServer(task) { }), // new BundleAnalyzerPlugin({}), ], + stats: { + // Display bailout reasons + optimizationBailout: true, + }, externals: [minimalExternals], } diff --git a/scripts/minimal-server.js b/scripts/minimal-server.js index f16082ce7ebea..452494a2cb1f2 100644 --- a/scripts/minimal-server.js +++ b/scripts/minimal-server.js @@ -62,9 +62,25 @@ const NextServer = process.env.USE_BUNDLED_NEXT ? require('next/dist/compiled/minimal-next-server/server.runtime').default : require('next/dist/server/next-server').default -// if (process.env.USE_BUNDLED_NEXT) { -// require('next/dist/compiled/minimal-next-server/app-page-render.runtime') -// } +require('react') +require('react/jsx-runtime') +require('react-dom') +require('react-dom/server.edge') +require('react-server-dom-webpack/client.edge') +;[ + 'next/dist/server/app-render/get-segment-param', + 'next/dist/shared/lib/app-router-context', + 'next/dist/shared/lib/constants', + 'next/dist/shared/lib/hooks-client-context', + 'next/dist/shared/lib/router/utils/add-path-prefix', + 'next/dist/shared/lib/router/utils/handle-smooth-scroll', + 'next/dist/shared/lib/server-inserted-html', + 'next/dist/shared/lib/router/utils/is-bot', +].forEach((mod) => require(mod)) + +if (process.env.USE_BUNDLED_NEXT) { + require('next/dist/compiled/minimal-next-server/app-page-render.runtime') +} if (process.env.LOG_READFILE) { console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) From b50917f38b9a8aa2273325e10a381e33c2c862b2 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 21 Jul 2023 13:22:20 +0200 Subject: [PATCH 021/101] tweaks --- packages/next/src/lib/chalk.ts | 2 +- packages/next/src/server/base-server.ts | 6 +- .../src/server/lib/incremental-cache/index.ts | 5 +- packages/next/src/server/next-server.ts | 26 ++- .../next/src/server/response-cache/index.ts | 5 +- .../next/src/server/response-cache/web.ts | 5 +- packages/next/taskfile-next-build.js | 168 +----------------- 7 files changed, 49 insertions(+), 168 deletions(-) diff --git a/packages/next/src/lib/chalk.ts b/packages/next/src/lib/chalk.ts index 8e40472953f8f..d0939d9148b97 100644 --- a/packages/next/src/lib/chalk.ts +++ b/packages/next/src/lib/chalk.ts @@ -1,6 +1,6 @@ let chalk: typeof import('next/dist/compiled/chalk') -if (process.env.NEXT_RUNTIME === 'edge') { +if (process.env.NEXT_RUNTIME === 'edge' || process.env.NEXT_MINIMAL) { chalk = require('./web/chalk').default } else { chalk = require('next/dist/compiled/chalk') diff --git a/packages/next/src/server/base-server.ts b/packages/next/src/server/base-server.ts index f33cf72d9b876..d3d8c28cad5bc 100644 --- a/packages/next/src/server/base-server.ts +++ b/packages/next/src/server/base-server.ts @@ -398,7 +398,11 @@ export default abstract class Server { } = this.nextConfig this.buildId = this.getBuildId() - this.minimalMode = minimalMode || !!process.env.NEXT_PRIVATE_MINIMAL_MODE + // this is a hack to avoid Webpack knowing this is equal to this.minimalMode + // because we replace this.minimalMode to true in production bundles. + const minimalModeKey = 'minimalMode' + this[minimalModeKey] = + minimalMode || !!process.env.NEXT_PRIVATE_MINIMAL_MODE this.hasAppDir = !!this.nextConfig.experimental.appDir && this.getHasAppDir(dev) diff --git a/packages/next/src/server/lib/incremental-cache/index.ts b/packages/next/src/server/lib/incremental-cache/index.ts index 569d8b0a89242..4595aab2a270f 100644 --- a/packages/next/src/server/lib/incremental-cache/index.ts +++ b/packages/next/src/server/lib/incremental-cache/index.ts @@ -133,7 +133,10 @@ export class IncrementalCache { maxMemoryCacheSize = parseInt(process.env.__NEXT_TEST_MAX_ISR_CACHE, 10) } this.dev = dev - this.minimalMode = minimalMode + // this is a hack to avoid Webpack knowing this is equal to this.minimalMode + // because we replace this.minimalMode to true in production bundles. + const minimalModeKey = 'minimalMode' + this[minimalModeKey] = minimalMode this.requestHeaders = requestHeaders this.requestProtocol = requestProtocol this.allowedRevalidateHeaderKeys = allowedRevalidateHeaderKeys diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index e0242599b3d80..4a55d028615eb 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -93,7 +93,6 @@ import { getRouteRegex } from '../shared/lib/router/utils/route-regex' import { invokeRequest, pipeReadable } from './lib/server-ipc/invoke-request' import { filterReqHeaders } from './lib/server-ipc/utils' import { createRequestResponseMocks } from './lib/mock-request' -import chalk from 'next/dist/compiled/chalk' import { NEXT_RSC_UNION_QUERY } from '../client/components/app-router-headers' import { signalFromNodeRequest } from './web/spec-extension/adapters/next-request' import { RouteModuleLoader } from './future/helpers/module-loader/route-module-loader' @@ -503,6 +502,11 @@ export default class NextNodeServer extends BaseServer { res: NodeNextResponse, paramsResult: import('./image-optimizer').ImageParamsResult ): Promise<{ buffer: Buffer; contentType: string; maxAge: number }> { + if (process.env.NEXT_MINIMAL) { + throw new Error( + 'Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.' + ) + } const { imageOptimizer } = require('./image-optimizer') as typeof import('./image-optimizer') @@ -801,7 +805,11 @@ export default class NextNodeServer extends BaseServer { res: BaseNextResponse, parsedUrl: NextUrlWithParsedQuery ) { - if (this.minimalMode || this.nextConfig.output === 'export') { + if ( + this.minimalMode || + this.nextConfig.output === 'export' || + process.env.NEXT_MINIMAL + ) { res.statusCode = 400 res.body('Bad Request').send() return { @@ -1058,6 +1066,7 @@ export default class NextNodeServer extends BaseServer { const normalizedRes = this.normalizeRes(res) if (this.renderOpts.dev) { + const chalk = require('next/dist/compiled/chalk') const _req = req as NodeNextRequest | IncomingMessage const _res = res as NodeNextResponse | ServerResponse const origReq = 'originalRequest' in _req ? _req.originalRequest : _req @@ -1455,6 +1464,12 @@ export default class NextNodeServer extends BaseServer { parsed: UrlWithParsedQuery onWarning?: (warning: Error) => void }) { + if (process.env.NEXT_MINIMAL) { + throw new Error( + 'Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.' + ) + } + // Middleware is skipped for on-demand revalidate requests if ( checkIsOnDemandRevalidate(params.request, this.renderOpts.previewProps) @@ -1700,7 +1715,7 @@ export default class NextNodeServer extends BaseServer { protected getRoutesManifest() { return getTracer().trace(NextNodeServerSpan.getRoutesManifest, () => { - const manifest = require(join(this.distDir, ROUTES_MANIFEST)) + const manifest = loadManifest(join(this.distDir, ROUTES_MANIFEST)) if (Array.isArray(manifest.rewrites)) { manifest.rewrites = { @@ -1751,6 +1766,11 @@ export default class NextNodeServer extends BaseServer { match?: RouteMatch onWarning?: (warning: Error) => void }): Promise { + if (process.env.NEXT_MINIMAL) { + throw new Error( + 'Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.' + ) + } let edgeInfo: ReturnType | undefined const { query, page, match } = params diff --git a/packages/next/src/server/response-cache/index.ts b/packages/next/src/server/response-cache/index.ts index 39bb478d8bdcc..3abd3f3283b0b 100644 --- a/packages/next/src/server/response-cache/index.ts +++ b/packages/next/src/server/response-cache/index.ts @@ -20,7 +20,10 @@ export default class ResponseCache { constructor(minimalMode: boolean) { this.pendingResponses = new Map() - this.minimalMode = minimalMode + // this is a hack to avoid Webpack knowing this is equal to this.minimalMode + // because we replace this.minimalMode to true in production bundles. + const minimalModeKey = 'minimalMode' + this[minimalModeKey] = minimalMode } public get( diff --git a/packages/next/src/server/response-cache/web.ts b/packages/next/src/server/response-cache/web.ts index e37ccca314812..7fc2761b63dc5 100644 --- a/packages/next/src/server/response-cache/web.ts +++ b/packages/next/src/server/response-cache/web.ts @@ -15,7 +15,10 @@ export default class WebResponseCache { constructor(minimalMode: boolean) { this.pendingResponses = new Map() - this.minimalMode = minimalMode + // this is a hack to avoid Webpack knowing this is equal to this.minimalMode + // because we replace this.minimalMode to true in production bundles. + const minimalModeKey = 'minimalMode' + this[minimalModeKey] = minimalMode } public get( diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index b6dd782540b0a..5f2df13c5a36f 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -3,143 +3,6 @@ const webpack = require('webpack') const path = require('path') const TerserPlugin = require('terser-webpack-plugin') const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') -const { outputFile } = require('fs-extra') - -const generateCachedScript = (filename) => ` -const filename = ${JSON.stringify(filename + '.cache')} -const { readFileSync } = require('fs'), - { Script } = require('vm'), - { wrap } = require('module'), - { join } = require('path'); -const basename = join(__dirname, filename) - -// const source = readFileSync(basename, 'utf-8') - -const cachedData = - !process.pkg && - require('process').platform !== 'win32' && - readFileSync(join(__dirname, ${JSON.stringify(filename + '.cache')})) - - // Retrieve the length of the string buffer from the first 4 bytes of the file - const stringBufferLength = cachedData.readInt32BE(0); - - // Split the combinedBuffer back into the original string and buffer - const text = cachedData.slice(4, stringBufferLength + 4).toString('utf-8'); - - const buffer = cachedData.slice(stringBufferLength + 4); - -const scriptOpts = { filename: ${JSON.stringify( - filename -)}, columnOffset: 0, cachedData: buffer } - -const script = new Script( - // wrap(source), - text, - scriptOpts -) -console.log(script.cachedDataRejected) - -script.runInThisContext()(exports, require, module, __filename, __dirname) -` - -const generateCachingScript = (filename) => ` -// require('./server.runtime.js') -const filename = ${JSON.stringify(filename)} -const { readFileSync } = require('fs'), - { Script } = require('vm'), - { wrap } = require('module'), - { join } = require('path'); -const basename = join(__dirname, filename) - -const source = wrap(readFileSync(basename, 'utf-8')) - -const scriptOpts = { filename, columnOffset: 0 } - -const script = new Script( - source, - scriptOpts -) -const newfilename = __filename.replace('.caching.js', '') -console.log(__filename.replace('.caching.js', ''), __dirname) -script.runInThisContext()(exports, require, module, newfilename, __dirname) - -const buffer = script.createCachedData() - -// Convert text to buffer -const stringBuffer = Buffer.from(source); - -// Get the length of the string buffer and create a buffer from it -const lengthBuffer = Buffer.alloc(4); -lengthBuffer.writeInt32BE(stringBuffer.length, 0); - -// Combine the buffers -const combinedBuffer = Buffer.concat([lengthBuffer, stringBuffer, buffer]); - - -require('fs').writeFileSync( - join(__dirname, ${JSON.stringify(filename + '.cache')}), - combinedBuffer -) -` - -async function createCache(file) { - // const fullpath = path.join( - // __dirname, - // 'dist/compiled/minimal-next-server', - // file - // ) - // const content = await fs.readFile(fullpath, 'utf8') - - // copy to .raw - // await fs.writeFile( - // path.join(__dirname, 'dist/compiled/minimal-next-server', file + '.raw'), - // content - // ) - - // await fs.writeFile( - // path.join(__dirname, 'dist/compiled/minimal-next-server', file), - // generateScript(file) - // ) - - await fs.writeFile( - path.join( - __dirname, - 'dist/compiled/minimal-next-server', - file + '.caching.js' - ), - generateCachingScript(file) - ) - - // require(path.join( - // __dirname, - // 'dist/compiled/minimal-next-server', - // file + '.caching.js' - // )) - - // run the node script - require('child_process').execSync( - `node ${path.join( - __dirname, - 'dist/compiled/minimal-next-server', - file + '.caching.js' - )}`, - { - stdio: 'inherit', - } - ) - - fs.rm( - path.join( - __dirname, - 'dist/compiled/minimal-next-server', - file + '.caching.js' - ), - { - recursive: true, - force: true, - } - ) -} async function buildNextServer(task) { // cleanup old files @@ -148,9 +11,6 @@ async function buildNextServer(task) { force: true, }) - const outputName = 'next-server.js' - const cachedOutputName = `${outputName}.cache` - const minimalExternals = [ 'react', 'react/package.json', @@ -180,6 +40,7 @@ async function buildNextServer(task) { 'next/dist/compiled/node-html-parser', 'next/dist/compiled/compression', 'next/dist/compiled/jsonwebtoken', + 'next/dist/compiled/@opentelemetry/api', ].reduce((acc, pkg) => { acc[pkg] = pkg return acc @@ -190,8 +51,6 @@ async function buildNextServer(task) { './web/sandbox': 'next/dist/server/web/sandbox', }) - // const BundleAnalyzerPlugin = - // require('webpack-bundle-analyzer').BundleAnalyzerPlugin /** @type {webpack.Configuration} */ const config = { entry: { @@ -214,12 +73,13 @@ async function buildNextServer(task) { }, // left in for debugging optimization: { - moduleIds: 'named', + // moduleIds: 'named', // minimize: false, minimize: true, // splitChunks: { // chunks: 'all', // }, + concatenateModules: false, minimizer: [ new TerserPlugin({ extractComments: false, @@ -236,11 +96,13 @@ async function buildNextServer(task) { }, plugins: [ new webpack.DefinePlugin({ + 'this.minimalMode': JSON.stringify(true), + 'this.renderOpts.dev': JSON.stringify(false), 'process.env.NODE_ENV': JSON.stringify('production'), 'process.env.NEXT_MINIMAL': JSON.stringify('true'), 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), }), - // new BundleAnalyzerPlugin({}), + !!process.env.ANALYZE && new BundleAnalyzerPlugin({}), ], stats: { // Display bailout reasons @@ -249,12 +111,9 @@ async function buildNextServer(task) { externals: [minimalExternals], } - const outputFiles = await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { webpack(config, (err, stats) => { if (err) return reject(err) - - const outputFiles = stats.toJson().assets.map((asset) => asset.name) - if (stats.hasErrors()) { return reject(new Error(stats.toString('errors-only'))) } else { @@ -268,20 +127,9 @@ async function buildNextServer(task) { 'utf8' ) } - resolve(outputFiles) }) }) - // await Promise.all(outputFiles.map((file) => createCache(file))) - // await Promise.all( - // outputFiles.map((file) => - // fs.writeFile( - // path.join(__dirname, 'dist/compiled/minimal-next-server', file), - // generateCachedScript(file) - // ) - // ) - // ) - return } @@ -291,6 +139,6 @@ module.exports = { if (require.main === module) { buildNextServer().then(() => { - console.log('done') + console.log('Success!') }) } From dcdd0866b9cf0c709cf0e3b87ec8e1ad8a660051 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 21 Jul 2023 13:24:07 +0200 Subject: [PATCH 022/101] revert form pol --- .../next/src/server/node-polyfill-form.ts | 32 ++++--------------- packages/next/taskfile-next-build.js | 2 +- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/packages/next/src/server/node-polyfill-form.ts b/packages/next/src/server/node-polyfill-form.ts index 1e953b8b74ba7..9a174305abf41 100644 --- a/packages/next/src/server/node-polyfill-form.ts +++ b/packages/next/src/server/node-polyfill-form.ts @@ -2,30 +2,12 @@ * Polyfills `FormData` and `Blob` in the Node.js runtime. */ -if (!global.FormData || !global.Blob) { - let installedFormData: any - let installedBlob: any - Object.defineProperty(global, 'FormData', { - get() { - if (!installedFormData) { - const polyfills = require('next/dist/compiled/@edge-runtime/ponyfill') - installedFormData = polyfills.FormData - installedBlob = polyfills.Blob - return installedFormData - } - return installedFormData - }, - }) +if (!global.FormData) { + const { FormData } = require('next/dist/compiled/@edge-runtime/ponyfill') + global.FormData = FormData +} - Object.defineProperty(global, 'Blob', { - get() { - if (installedBlob) { - return installedBlob - } - const polyfills = require('next/dist/compiled/@edge-runtime/ponyfill') - installedFormData = polyfills.FormData - installedBlob = polyfills.Blob - return installedBlob - }, - }) +if (!global.Blob) { + const { Blob } = require('next/dist/compiled/@edge-runtime/ponyfill') + global.Blob = Blob } diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index 5f2df13c5a36f..1c2d013db0daf 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -103,7 +103,7 @@ async function buildNextServer(task) { 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), }), !!process.env.ANALYZE && new BundleAnalyzerPlugin({}), - ], + ].filter(Boolean), stats: { // Display bailout reasons optimizationBailout: true, From 380e4c936285a3ae89a099b4dcf1bd15e3d1e22d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 21 Jul 2023 13:33:26 +0200 Subject: [PATCH 023/101] switch messages --- packages/next/src/server/next-server.ts | 44 ++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 4a55d028615eb..341ffa7c2ed79 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -457,28 +457,17 @@ export default class NextNodeServer extends BaseServer { throw new Error( 'invariant: renderHTML should not be called in minimal mode' ) - } else { - // Due to the way we pass data by mutating `renderOpts`, we can't extend the - // object here but only updating its `nextFontManifest` field. - // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952 - renderOpts.nextFontManifest = this.nextFontManifest - - if (this.hasAppDir && renderOpts.isAppPath) { - const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = - require('./app-render/app-render') as typeof import('./app-render/app-render') - return appRenderToHTMLOrFlight( - req.originalRequest, - res.originalResponse, - pathname, - query, - renderOpts - ) - } + } - // TODO: re-enable this once we've refactored to use implicit matches - // throw new Error('Invariant: render should have used routeModule') + // Due to the way we pass data by mutating `renderOpts`, we can't extend the + // object here but only updating its `nextFontManifest` field. + // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952 + renderOpts.nextFontManifest = this.nextFontManifest - return require('./render').renderToHTML( + if (this.hasAppDir && renderOpts.isAppPath) { + const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = + require('./app-render/app-render') as typeof import('./app-render/app-render') + return appRenderToHTMLOrFlight( req.originalRequest, res.originalResponse, pathname, @@ -486,6 +475,17 @@ export default class NextNodeServer extends BaseServer { renderOpts ) } + + // TODO: re-enable this once we've refactored to use implicit matches + // throw new Error('Invariant: render should have used routeModule') + + return require('./render').renderToHTML( + req.originalRequest, + res.originalResponse, + pathname, + query, + renderOpts + ) } private streamResponseChunk(res: ServerResponse, chunk: any) { @@ -504,7 +504,7 @@ export default class NextNodeServer extends BaseServer { ): Promise<{ buffer: Buffer; contentType: string; maxAge: number }> { if (process.env.NEXT_MINIMAL) { throw new Error( - 'Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.' + 'invariant: imageOptimizer should not be called in minimal mode' ) } const { imageOptimizer } = @@ -1466,7 +1466,7 @@ export default class NextNodeServer extends BaseServer { }) { if (process.env.NEXT_MINIMAL) { throw new Error( - 'Middleware is not supported in minimal mode. Please remove the `NEXT_MINIMAL` environment variable.' + 'invariant: runMiddleware should not be called in minimal mode' ) } From 97f6ab1a07e55ae2b7539e9c9a7a14cdbf212229 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 21 Jul 2023 13:34:07 +0200 Subject: [PATCH 024/101] revert changes to tracer --- packages/next/src/server/lib/trace/tracer.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/next/src/server/lib/trace/tracer.ts b/packages/next/src/server/lib/trace/tracer.ts index 4129d2c76b7cc..7d2184cb48e33 100644 --- a/packages/next/src/server/lib/trace/tracer.ts +++ b/packages/next/src/server/lib/trace/tracer.ts @@ -20,11 +20,11 @@ let api: typeof import('next/dist/compiled/@opentelemetry/api') if (process.env.NEXT_RUNTIME === 'edge') { api = require('@opentelemetry/api') } else { - // try { - // api = require('@opentelemetry/api') - // } catch (err) { - api = require('next/dist/compiled/@opentelemetry/api') - // } + try { + api = require('@opentelemetry/api') + } catch (err) { + api = require('next/dist/compiled/@opentelemetry/api') + } } const { context, trace, SpanStatusCode, SpanKind } = api From ec9cdddbd1acbcbd062d5acc8cb918341a507961 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 15:58:10 +0200 Subject: [PATCH 025/101] stuff --- bench/basic-app/pages/api/index.js | 2 +- bench/basic-app/pages/pages/index.js | 7 ++ packages/next/src/build/index.ts | 1 + .../build/utils/trace-module/trace-module.ts | 48 ++++++------ .../src/build/utils/trace-module/worker.ts | 2 +- packages/next/src/build/webpack-config.ts | 74 ++++++++++++++----- .../loaders/next-route-loader/index.ts | 6 +- packages/next/src/export/worker.ts | 6 +- packages/next/src/pages/_document.tsx | 7 +- .../module-loader/node-module-loader.ts | 5 +- .../future/route-modules/pages-api/module.ts | 10 +++ .../future/route-modules/pages/externals.ts | 3 + .../future/route-modules/pages/module.ts | 8 +- .../future/route-modules/route-module.ts | 5 ++ packages/next/src/server/render.tsx | 4 +- ...ml-context.ts => html-context.external.ts} | 0 packages/next/src/shared/lib/utils.ts | 2 +- packages/next/taskfile-next-build.js | 9 ++- scripts/minimal-server.js | 35 +++------ 19 files changed, 156 insertions(+), 78 deletions(-) create mode 100644 bench/basic-app/pages/pages/index.js create mode 100644 packages/next/src/server/future/route-modules/pages/externals.ts rename packages/next/src/shared/lib/{html-context.ts => html-context.external.ts} (100%) diff --git a/bench/basic-app/pages/api/index.js b/bench/basic-app/pages/api/index.js index 5ac499ab8a0fc..8f603094bd288 100644 --- a/bench/basic-app/pages/api/index.js +++ b/bench/basic-app/pages/api/index.js @@ -1,3 +1,3 @@ -export function handler(req, res) { +export default function handler(req, res) { res.status(200).json({ name: 'John Doe' }) } diff --git a/bench/basic-app/pages/pages/index.js b/bench/basic-app/pages/pages/index.js new file mode 100644 index 0000000000000..e06229eee0637 --- /dev/null +++ b/bench/basic-app/pages/pages/index.js @@ -0,0 +1,7 @@ +export default () => 'Hello World' + +export function getServerSideProps() { + return { + props: {}, + } +} diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index ec75e72a81ae2..e0b6922d1243a 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -1696,6 +1696,7 @@ export default async function build( } if ( + process.env.NEXT_TRACE_MODULES && !isEdgeRuntime(pageRuntime) && !isStatic && !isSsg && diff --git a/packages/next/src/build/utils/trace-module/trace-module.ts b/packages/next/src/build/utils/trace-module/trace-module.ts index 2a2b3cb46aa5f..c5b60b6671064 100644 --- a/packages/next/src/build/utils/trace-module/trace-module.ts +++ b/packages/next/src/build/utils/trace-module/trace-module.ts @@ -2,7 +2,7 @@ import { Worker } from 'worker_threads' import path from 'path' import chalk from 'next/dist/compiled/chalk' -const worker = new Worker(path.join(__dirname, 'worker.js'), {}) +let worker: any function prettyPrint( node: any, @@ -34,28 +34,7 @@ function prettyPrint( return output } -const queue = [] as any[] -let pendingPromise = Promise.resolve() - -function runQueue() { - pendingPromise = pendingPromise.then(async () => { - while (queue.length > 0) { - const { modulePath, distDir, resolve } = queue.shift() - const node = await traceModuleImpl(modulePath, distDir) - resolve(node) - } - }) -} - -export function traceModule(modulePath: string, distDir: string) { - return Promise.resolve() - return new Promise((resolve) => { - queue.push({ modulePath, distDir, resolve }) - runQueue() - }) -} - -export async function traceModuleImpl(modulePath: string, distDir: string) { +async function traceModuleImpl(modulePath: string, distDir: string) { return new Promise((resolve) => { const onResolve = ({ modulePath: mod, node }: any) => { if (mod !== modulePath) { @@ -81,3 +60,26 @@ export async function traceModuleImpl(modulePath: string, distDir: string) { worker.postMessage(modulePath) }) } + +const queue = [] as any[] +let pendingPromise = Promise.resolve() + +function runQueue() { + pendingPromise = pendingPromise.then(async () => { + while (queue.length > 0) { + const { modulePath, distDir, resolve } = queue.shift() + const node = await traceModuleImpl(modulePath, distDir) + resolve(node) + } + }) +} + +export function traceModule(modulePath: string, distDir: string) { + if (!worker) { + worker = new Worker(path.join(__dirname, 'worker.js'), {}) + } + return new Promise((resolve) => { + queue.push({ modulePath, distDir, resolve }) + runQueue() + }) +} diff --git a/packages/next/src/build/utils/trace-module/worker.ts b/packages/next/src/build/utils/trace-module/worker.ts index a5c7b980d84b6..977f9385ee102 100644 --- a/packages/next/src/build/utils/trace-module/worker.ts +++ b/packages/next/src/build/utils/trace-module/worker.ts @@ -1,7 +1,7 @@ import { parentPort } from 'worker_threads' // we import it to get all the relevant polyfills in place -// require('next/dist/compiled/minimal-next-server/server.runtime.js') +require('next/dist/compiled/minimal-next-server/server.runtime.js') const originalCompile = require('module').prototype._compile diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index dcc0a4c8d3507..af5c38b0f203f 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1319,6 +1319,12 @@ export default async function getBaseWebpackConfig( return `next/dist/compiled/minimal-next-server/pages-render.runtime.js` } + if ( + request.includes('dist/compiled/minimal-next-server/pages-api.runtime.js') + ) { + return `next/dist/compiled/minimal-next-server/pages-api.runtime.js` + } + // We need to externalize internal requests for files intended to // not be bundled. const isLocal: boolean = @@ -1424,26 +1430,60 @@ export default async function getBaseWebpackConfig( return } - const isNextExternal = - /next[/\\]dist[/\\](esm[\\/])?(shared|server)[/\\](?!lib[/\\](router[/\\]router|dynamic|app-dynamic|image-external|lazy-dynamic|head[^-]))/.test( - localRes - ) + // const isNextExternal = + // /next[/\\]dist[/\\](esm[\\/])?(shared|server)[/\\](?!lib[/\\](router[/\\]router|dynamic|app-dynamic|image-external|lazy-dynamic|head[^-]))/.test( + // localRes + // ) + + const pathSeparators = '[/\\\\]' + const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})` + const externalFileEnd = '(\\.external(\\.js)?)$' + + const nextDist = `next${pathSeparators}dist` + + const regexPattern = new RegExp( + `${nextDist}${optionalEsmPart}.*${externalFileEnd}` + ) + + const isNextExternal = regexPattern.test(localRes) if (isNextExternal) { - // Generate Next.js external import - const externalRequest = path.posix.join( - 'next', - 'dist', - path - .relative( - // Root of Next.js package: - path.join(__dirname, '..'), - localRes - ) - // Windows path normalization - .replace(/\\/g, '/') + const name = path.parse(localRes).name.replace('.external', '') + const camelCaseName = name.replace(/-([a-z])/g, (_, w) => + w.toUpperCase() ) - return `commonjs ${externalRequest}` + // // Generate Next.js external import + // const externalRequest = path.posix.join( + // 'next', + // 'dist', + // path + // .relative( + // // Root of Next.js package: + // path.join(__dirname, '..'), + // localRes + // ) + // // Windows path normalization + // .replace(/\\/g, '/') + // ) + // return `commonjs ${externalRequest}` + + if (isAppLayer) { + // todo + } else { + return [ + 'commonjs ' + + path.posix.join( + 'next', + 'dist', + 'compiled', + 'minimal-next-server', + 'pages-render.runtime.js' + ), + 'default', + 'externals', + camelCaseName, + ] + } } } diff --git a/packages/next/src/build/webpack/loaders/next-route-loader/index.ts b/packages/next/src/build/webpack/loaders/next-route-loader/index.ts index 85fc7f4b5627d..b7cd193eae8f7 100644 --- a/packages/next/src/build/webpack/loaders/next-route-loader/index.ts +++ b/packages/next/src/build/webpack/loaders/next-route-loader/index.ts @@ -170,7 +170,8 @@ const loadPages = ( return ` // Next.js Route Loader - import RouteModule from "next/dist/server/future/route-modules/pages/module" + // import RouteModule from "next/dist/server/future/route-modules/pages/module" + import RouteModule from "next/dist/compiled/minimal-next-server/pages-render.runtime.js" import { hoist } from "next/dist/build/webpack/loaders/next-route-loader/helpers" // Import the app and document modules. @@ -252,7 +253,8 @@ const loadPagesAPI = ( return ` // Next.js Route Loader - import RouteModule from "next/dist/server/future/route-modules/pages-api/module" + // import RouteModule from "next/dist/server/future/route-modules/pages-api/module.js" + import RouteModule from "next/dist/compiled/minimal-next-server/pages-api.runtime.js" import { hoist } from "next/dist/build/webpack/loaders/next-route-loader/helpers" // Import the userland code. diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index eaa61b851d9ab..c4cf5f5c2a73c 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -295,8 +295,10 @@ export default async function exportPage({ await promises.mkdir(baseDir, { recursive: true }) let renderResult: RenderResult | undefined let curRenderOpts: RenderOpts = {} - const { renderToHTML } = - require('../server/render') as typeof import('../server/render') + const renderToHTML = + require('next/dist/compiled/minimal-next-server/pages-render.runtime') + .renderToHTML as typeof import('../server/render').renderToHTML + let renderMethod = renderToHTML let inAmpMode = false, hybridAmp = false diff --git a/packages/next/src/pages/_document.tsx b/packages/next/src/pages/_document.tsx index a8526011c5d33..8a60fffb38c26 100644 --- a/packages/next/src/pages/_document.tsx +++ b/packages/next/src/pages/_document.tsx @@ -17,8 +17,11 @@ import { BuildManifest, getPageFiles } from '../server/get-page-files' import { htmlEscapeJsonString } from '../server/htmlescape' import isError from '../lib/is-error' -import { HtmlContext, useHtmlContext } from '../shared/lib/html-context' -import type { HtmlProps } from '../shared/lib/html-context' +import { + HtmlContext, + useHtmlContext, +} from '../shared/lib/html-context.external' +import type { HtmlProps } from '../shared/lib/html-context.external' export { DocumentContext, DocumentInitialProps, DocumentProps } diff --git a/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts b/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts index 3283eb00a53f5..0e64e60375b69 100644 --- a/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts +++ b/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts @@ -7,7 +7,10 @@ export class NodeModuleLoader implements ModuleLoader { public async load(id: string): Promise { if (process.env.NEXT_RUNTIME !== 'edge') { // Need to `await` to cover the case that route is marked ESM modules by ESM escalation. - return await require(id) + return (await process.env.NEXT_MINIMAL) + ? // @ts-ignore + __non_webpack_require__(id) + : require(id) } throw new Error('NodeModuleLoader is not supported in edge runtime.') diff --git a/packages/next/src/server/future/route-modules/pages-api/module.ts b/packages/next/src/server/future/route-modules/pages-api/module.ts index 6147dd4dbdfb6..71719378b9f9e 100644 --- a/packages/next/src/server/future/route-modules/pages-api/module.ts +++ b/packages/next/src/server/future/route-modules/pages-api/module.ts @@ -104,6 +104,16 @@ export class PagesAPIRouteModule extends RouteModule< throw new Error('Method not implemented.') } + constructor(options: PagesAPIRouteModuleOptions) { + super(options) + + if (typeof options.userland.default !== 'function') { + throw new Error( + `Page ${options.definition.page} does not export a default function.` + ) + } + } + /** * * @param req the incoming server request diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts new file mode 100644 index 0000000000000..ad07e45432f44 --- /dev/null +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -0,0 +1,3 @@ +import * as htmlContext from '../../../../shared/lib/html-context.external' + +export { htmlContext } diff --git a/packages/next/src/server/future/route-modules/pages/module.ts b/packages/next/src/server/future/route-modules/pages/module.ts index e94e10bc9346a..82dae5438cf0a 100644 --- a/packages/next/src/server/future/route-modules/pages/module.ts +++ b/packages/next/src/server/future/route-modules/pages/module.ts @@ -17,7 +17,8 @@ import { type RouteModuleHandleContext, type RouteModuleOptions, } from '../route-module' -import { renderToHTMLImpl } from '../../../render' +import { renderToHTMLImpl, renderToHTML } from '../../../render' +import * as externals from './externals' /** * The userland module for a page. This is the module that is exported from the @@ -104,6 +105,8 @@ export class PagesRouteModule extends RouteModule< > { private readonly components: PagesComponents + static readonly externals = externals + constructor(options: PagesRouteModuleOptions) { super(options) @@ -133,4 +136,7 @@ export class PagesRouteModule extends RouteModule< } } +// needed for the static build +export { renderToHTML } + export default PagesRouteModule diff --git a/packages/next/src/server/future/route-modules/route-module.ts b/packages/next/src/server/future/route-modules/route-module.ts index e9521edda1fff..2521c5676d83c 100644 --- a/packages/next/src/server/future/route-modules/route-module.ts +++ b/packages/next/src/server/future/route-modules/route-module.ts @@ -53,6 +53,11 @@ export abstract class RouteModule< context: RouteModuleHandleContext ): Promise + /** + * The externals that are required for the route module. + */ + public static readonly externals: any + constructor({ userland, definition }: RouteModuleOptions) { this.userland = userland this.definition = definition diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index 1e1ca4da11397..0e3036f70ed4d 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -1,7 +1,7 @@ import type { IncomingMessage, ServerResponse } from 'http' import type { ParsedUrlQuery } from 'querystring' import type { NextRouter } from '../shared/lib/router/router' -import type { HtmlProps } from '../shared/lib/html-context' +import type { HtmlProps } from '../shared/lib/html-context.external' import type { DomainLocale } from './config' import type { AppType, @@ -65,7 +65,7 @@ import { isResSent, loadGetInitialProps, } from '../shared/lib/utils' -import { HtmlContext } from '../shared/lib/html-context' +import { HtmlContext } from '../shared/lib/html-context.external' import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path' import { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path' import { getRequestMeta, NextParsedUrlQuery } from './request-meta' diff --git a/packages/next/src/shared/lib/html-context.ts b/packages/next/src/shared/lib/html-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/html-context.ts rename to packages/next/src/shared/lib/html-context.external.ts diff --git a/packages/next/src/shared/lib/utils.ts b/packages/next/src/shared/lib/utils.ts index f967be459022b..a3759881f7e6e 100644 --- a/packages/next/src/shared/lib/utils.ts +++ b/packages/next/src/shared/lib/utils.ts @@ -1,4 +1,4 @@ -import type { HtmlProps } from './html-context' +import type { HtmlProps } from './html-context.external' import type { ComponentType } from 'react' import type { DomainLocale } from '../../server/config' import type { Env } from '@next/env' diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index 1c2d013db0daf..619dcaafa286f 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -63,6 +63,10 @@ async function buildNextServer(task) { __dirname, 'dist/esm/server/future/route-modules/pages/module.js' ), + 'pages-api': path.join( + __dirname, + 'dist/esm/server/future/route-modules/pages-api/module.js' + ), }, target: 'node', mode: 'production', @@ -74,8 +78,8 @@ async function buildNextServer(task) { // left in for debugging optimization: { // moduleIds: 'named', - // minimize: false, - minimize: true, + minimize: false, + // minimize: true, // splitChunks: { // chunks: 'all', // }, @@ -126,6 +130,7 @@ async function buildNextServer(task) { JSON.stringify(stats.toJson()), 'utf8' ) + return resolve() } }) }) diff --git a/scripts/minimal-server.js b/scripts/minimal-server.js index 452494a2cb1f2..0c229edf63422 100644 --- a/scripts/minimal-server.js +++ b/scripts/minimal-server.js @@ -62,26 +62,6 @@ const NextServer = process.env.USE_BUNDLED_NEXT ? require('next/dist/compiled/minimal-next-server/server.runtime').default : require('next/dist/server/next-server').default -require('react') -require('react/jsx-runtime') -require('react-dom') -require('react-dom/server.edge') -require('react-server-dom-webpack/client.edge') -;[ - 'next/dist/server/app-render/get-segment-param', - 'next/dist/shared/lib/app-router-context', - 'next/dist/shared/lib/constants', - 'next/dist/shared/lib/hooks-client-context', - 'next/dist/shared/lib/router/utils/add-path-prefix', - 'next/dist/shared/lib/router/utils/handle-smooth-scroll', - 'next/dist/shared/lib/server-inserted-html', - 'next/dist/shared/lib/router/utils/is-bot', -].forEach((mod) => require(mod)) - -if (process.env.USE_BUNDLED_NEXT) { - require('next/dist/compiled/minimal-next-server/app-page-render.runtime') -} - if (process.env.LOG_READFILE) { console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) } @@ -123,11 +103,20 @@ require('http') if (process.env.LOG_READFILE) { console.log(`readFileCount: ${readFileCount + readFileSyncCount}`) } - console.timeEnd('next-wall-time') - require('process').exit(0) }) }) .listen(3000, () => { console.timeEnd('next-cold-start') - fetch('http://localhost:3000') + fetch('http://localhost:3000/') + .then((res) => res.text()) + .then((text) => { + console.log(text) + }) + .catch((err) => { + console.error(err) + }) + .finally(() => { + console.timeEnd('next-wall-time') + require('process').exit(0) + }) }) From bd6a3d3fe0b0bbc4c02ba8a44b9ff707d8e12ec0 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 16:53:47 +0200 Subject: [PATCH 026/101] fix edge for app --- packages/next/src/build/entries.ts | 1 + .../next/src/build/webpack/loaders/next-app-loader.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/next/src/build/entries.ts b/packages/next/src/build/entries.ts index e090732a2a948..69da677cb78f6 100644 --- a/packages/next/src/build/entries.ts +++ b/packages/next/src/build/entries.ts @@ -647,6 +647,7 @@ export async function createEntrypoints( middlewareConfig: Buffer.from( JSON.stringify(staticInfo.middleware || {}) ).toString('base64'), + isEdge: true, }).import } const normalizedServerBundlePath = diff --git a/packages/next/src/build/webpack/loaders/next-app-loader.ts b/packages/next/src/build/webpack/loaders/next-app-loader.ts index 2463ca2157b20..0db438f9c0d28 100644 --- a/packages/next/src/build/webpack/loaders/next-app-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-app-loader.ts @@ -40,6 +40,7 @@ export type AppLoaderOptions = { basePath: string nextConfigOutput?: NextConfig['output'] middlewareConfig: string + isEdge?: boolean } type AppLoader = webpack.LoaderDefinitionFunction @@ -455,6 +456,7 @@ const nextAppLoader: AppLoader = async function nextAppLoader() { preferredRegion, basePath, middlewareConfig: middlewareConfigBase64, + isEdge, } = loaderOptions const buildInfo = getModuleBuildInfo((this as any)._module) @@ -677,10 +679,14 @@ const nextAppLoader: AppLoader = async function nextAppLoader() { }, } + const routeModulePath = isEdge + ? 'next/dist/server/future/route-modules/app-page/module' + : 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' + // Prefer to modify next/src/server/app-render/entry-base.ts since this is shared with Turbopack. // Any changes to this code should be reflected in Turbopack's app_source.rs and/or app-renderer.tsx as well. const result = ` - import RouteModule from 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' + import RouteModule from ${JSON.stringify(routeModulePath)} export ${treeCodeResult.treeCode} export ${treeCodeResult.pages} From 72dd5d9101665cd66989b1dbbdecffeb0760f715 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 16:58:10 +0200 Subject: [PATCH 027/101] fix router context --- packages/next/src/client/compat/router.ts | 2 +- packages/next/src/client/image-component.tsx | 2 +- packages/next/src/client/index.tsx | 2 +- packages/next/src/client/link.tsx | 2 +- packages/next/src/client/router.ts | 2 +- .../next/src/server/future/route-modules/pages/externals.ts | 5 ++--- packages/next/src/server/render.tsx | 2 +- .../lib/{router-context.ts => router-context.external.ts} | 0 8 files changed, 8 insertions(+), 9 deletions(-) rename packages/next/src/shared/lib/{router-context.ts => router-context.external.ts} (100%) diff --git a/packages/next/src/client/compat/router.ts b/packages/next/src/client/compat/router.ts index 58b1b9f02ed05..72711cb18b1a8 100644 --- a/packages/next/src/client/compat/router.ts +++ b/packages/next/src/client/compat/router.ts @@ -1,5 +1,5 @@ import { useContext } from 'react' -import { RouterContext } from '../../shared/lib/router-context' +import { RouterContext } from '../../shared/lib/router-context.external' import { NextRouter } from '../router' /** diff --git a/packages/next/src/client/image-component.tsx b/packages/next/src/client/image-component.tsx index b113c0bb0c209..ee4a8e5b142ba 100644 --- a/packages/next/src/client/image-component.tsx +++ b/packages/next/src/client/image-component.tsx @@ -27,7 +27,7 @@ import type { import { imageConfigDefault } from '../shared/lib/image-config' import { ImageConfigContext } from '../shared/lib/image-config-context' import { warnOnce } from '../shared/lib/utils/warn-once' -import { RouterContext } from '../shared/lib/router-context' +import { RouterContext } from '../shared/lib/router-context.external' // @ts-ignore - This is replaced by webpack alias import defaultLoader from 'next/dist/shared/lib/image-loader' diff --git a/packages/next/src/client/index.tsx b/packages/next/src/client/index.tsx index d1b1140616976..94e1bf20d46a1 100644 --- a/packages/next/src/client/index.tsx +++ b/packages/next/src/client/index.tsx @@ -12,7 +12,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { HeadManagerContext } from '../shared/lib/head-manager-context' import mitt, { MittEmitter } from '../shared/lib/mitt' -import { RouterContext } from '../shared/lib/router-context' +import { RouterContext } from '../shared/lib/router-context.external' import { handleSmoothScroll } from '../shared/lib/router/utils/handle-smooth-scroll' import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic' import { diff --git a/packages/next/src/client/link.tsx b/packages/next/src/client/link.tsx index 39fd9ecbd0719..64a13c7bbe46e 100644 --- a/packages/next/src/client/link.tsx +++ b/packages/next/src/client/link.tsx @@ -12,7 +12,7 @@ import { isLocalURL } from '../shared/lib/router/utils/is-local-url' import { formatUrl } from '../shared/lib/router/utils/format-url' import { isAbsoluteUrl } from '../shared/lib/utils' import { addLocale } from './add-locale' -import { RouterContext } from '../shared/lib/router-context' +import { RouterContext } from '../shared/lib/router-context.external' import { AppRouterContext, AppRouterInstance, diff --git a/packages/next/src/client/router.ts b/packages/next/src/client/router.ts index 1172177c00718..32a14c65f12f1 100644 --- a/packages/next/src/client/router.ts +++ b/packages/next/src/client/router.ts @@ -2,7 +2,7 @@ import React from 'react' import Router from '../shared/lib/router/router' import type { NextRouter } from '../shared/lib/router/router' -import { RouterContext } from '../shared/lib/router-context' +import { RouterContext } from '../shared/lib/router-context.external' import isError from '../lib/is-error' type SingletonRouterBase = { diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts index ad07e45432f44..eb08824a49443 100644 --- a/packages/next/src/server/future/route-modules/pages/externals.ts +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -1,3 +1,2 @@ -import * as htmlContext from '../../../../shared/lib/html-context.external' - -export { htmlContext } +export * as htmlContext from '../../../../shared/lib/html-context.external' +export * as routerContext from '../../../../shared/lib/router-context.external' diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index a2c745c1bee2b..baf2bf7b0ff10 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -57,7 +57,7 @@ import { defaultHead } from '../shared/lib/head' import { HeadManagerContext } from '../shared/lib/head-manager-context' import Loadable from '../shared/lib/loadable' import { LoadableContext } from '../shared/lib/loadable-context' -import { RouterContext } from '../shared/lib/router-context' +import { RouterContext } from '../shared/lib/router-context.external' import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic' import { ComponentsEnhancer, diff --git a/packages/next/src/shared/lib/router-context.ts b/packages/next/src/shared/lib/router-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/router-context.ts rename to packages/next/src/shared/lib/router-context.external.ts From 32b023f8b3a81a1b8fa86988e43f8fff2f3595e0 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 17:07:38 +0200 Subject: [PATCH 028/101] add remaining context for pages --- packages/next/src/client/app-index.tsx | 4 ++-- packages/next/src/client/components/app-router.tsx | 6 +++--- .../next/src/client/components/layout-router.tsx | 4 ++-- packages/next/src/client/components/navigation.ts | 6 +++--- .../internal/helpers/use-websocket.ts | 2 +- .../src/client/components/redirect-boundary.tsx | 2 +- .../components/render-from-template-context.tsx | 2 +- .../components/router-reducer/apply-flight-data.ts | 5 ++++- .../create-initial-router-state.test.tsx | 5 ++++- .../router-reducer/create-initial-router-state.ts | 4 ++-- .../fill-cache-with-data-property.test.tsx | 5 ++++- .../fill-cache-with-data-property.ts | 5 ++++- .../fill-cache-with-new-subtree-data.test.tsx | 5 ++++- .../fill-cache-with-new-subtree-data.ts | 5 ++++- .../fill-lazy-items-till-leaf-with-head.test.tsx | 5 ++++- .../fill-lazy-items-till-leaf-with-head.ts | 5 ++++- ...alidate-cache-below-flight-segmentpath.test.tsx | 5 ++++- .../invalidate-cache-below-flight-segmentpath.ts | 2 +- .../invalidate-cache-by-router-state.test.tsx | 5 ++++- .../invalidate-cache-by-router-state.ts | 2 +- .../reducers/find-head-in-cache.test.tsx | 2 +- .../router-reducer/reducers/find-head-in-cache.ts | 2 +- .../reducers/navigate-reducer.test.tsx | 2 +- .../router-reducer/reducers/navigate-reducer.ts | 2 +- .../reducers/prefetch-reducer.test.tsx | 2 +- .../reducers/refresh-reducer.test.tsx | 2 +- .../router-reducer/reducers/refresh-reducer.ts | 2 +- .../reducers/restore-reducer.test.tsx | 2 +- .../reducers/server-patch-reducer.test.tsx | 2 +- .../router-reducer/router-reducer-types.ts | 2 +- packages/next/src/client/image-component.tsx | 2 +- packages/next/src/client/index.tsx | 10 +++++----- packages/next/src/client/legacy/image.tsx | 2 +- packages/next/src/client/link.tsx | 2 +- packages/next/src/client/script.tsx | 2 +- packages/next/src/server/app-render/app-render.tsx | 2 +- .../server/future/route-modules/pages/externals.ts | 8 ++++++++ packages/next/src/server/render.tsx | 14 +++++++------- .../{amp-context.ts => amp-context.external.ts} | 0 packages/next/src/shared/lib/amp.ts | 2 +- ...r-context.ts => app-router-context.external.ts} | 0 ...context.ts => head-manager-context.external.ts} | 0 packages/next/src/shared/lib/head.tsx | 4 ++-- ...context.ts => hooks-client-context.external.ts} | 0 ...context.ts => image-config-context.external.ts} | 0 ...ble-context.ts => loadable-context.external.ts} | 0 packages/next/src/shared/lib/loadable.tsx | 2 +- .../router/{adapters.tsx => adapters.external.tsx} | 7 +++++-- .../next/src/shared/lib/router/adapters.test.tsx | 2 +- 49 files changed, 102 insertions(+), 61 deletions(-) rename packages/next/src/shared/lib/{amp-context.ts => amp-context.external.ts} (100%) rename packages/next/src/shared/lib/{app-router-context.ts => app-router-context.external.ts} (100%) rename packages/next/src/shared/lib/{head-manager-context.ts => head-manager-context.external.ts} (100%) rename packages/next/src/shared/lib/{hooks-client-context.ts => hooks-client-context.external.ts} (100%) rename packages/next/src/shared/lib/{image-config-context.ts => image-config-context.external.ts} (100%) rename packages/next/src/shared/lib/{loadable-context.ts => loadable-context.external.ts} (100%) rename packages/next/src/shared/lib/router/{adapters.tsx => adapters.external.tsx} (96%) diff --git a/packages/next/src/client/app-index.tsx b/packages/next/src/client/app-index.tsx index 134a780eec80c..d2448adfe0eb4 100644 --- a/packages/next/src/client/app-index.tsx +++ b/packages/next/src/client/app-index.tsx @@ -7,8 +7,8 @@ import React, { use } from 'react' // eslint-disable-next-line import/no-extraneous-dependencies import { createFromReadableStream } from 'react-server-dom-webpack/client' -import { HeadManagerContext } from '../shared/lib/head-manager-context' -import { GlobalLayoutRouterContext } from '../shared/lib/app-router-context' +import { HeadManagerContext } from '../shared/lib/head-manager-context.external' +import { GlobalLayoutRouterContext } from '../shared/lib/app-router-context.external' import onRecoverableError from './on-recoverable-error' import { callServer } from './app-call-server' import { isNextRouterError } from './components/is-next-router-error' diff --git a/packages/next/src/client/components/app-router.tsx b/packages/next/src/client/components/app-router.tsx index b00f6ff57c34c..62a4930a8572d 100644 --- a/packages/next/src/client/components/app-router.tsx +++ b/packages/next/src/client/components/app-router.tsx @@ -14,11 +14,11 @@ import { LayoutRouterContext, GlobalLayoutRouterContext, CacheStates, -} from '../../shared/lib/app-router-context' +} from '../../shared/lib/app-router-context.external' import type { CacheNode, AppRouterInstance, -} from '../../shared/lib/app-router-context' +} from '../../shared/lib/app-router-context.external' import type { FlightRouterState, FlightData, @@ -43,7 +43,7 @@ import { createHrefFromUrl } from './router-reducer/create-href-from-url' import { SearchParamsContext, PathnameContext, -} from '../../shared/lib/hooks-client-context' +} from '../../shared/lib/hooks-client-context.external' import { useReducerWithReduxDevtools } from './use-reducer-with-devtools' import { ErrorBoundary } from './error-boundary' import { diff --git a/packages/next/src/client/components/layout-router.tsx b/packages/next/src/client/components/layout-router.tsx index 2cd8ce9309ca2..f4957c353dc3a 100644 --- a/packages/next/src/client/components/layout-router.tsx +++ b/packages/next/src/client/components/layout-router.tsx @@ -1,6 +1,6 @@ 'use client' -import type { ChildSegmentMap } from '../../shared/lib/app-router-context' +import type { ChildSegmentMap } from '../../shared/lib/app-router-context.external' import type { FlightRouterState, FlightSegmentPath, @@ -17,7 +17,7 @@ import { LayoutRouterContext, GlobalLayoutRouterContext, TemplateContext, -} from '../../shared/lib/app-router-context' +} from '../../shared/lib/app-router-context.external' import { fetchServerResponse } from './router-reducer/fetch-server-response' import { createInfinitePromise } from './infinite-promise' import { ErrorBoundary } from './error-boundary' diff --git a/packages/next/src/client/components/navigation.ts b/packages/next/src/client/components/navigation.ts index 349927f905a9c..4196c1439ac57 100644 --- a/packages/next/src/client/components/navigation.ts +++ b/packages/next/src/client/components/navigation.ts @@ -6,11 +6,11 @@ import { AppRouterContext, GlobalLayoutRouterContext, LayoutRouterContext, -} from '../../shared/lib/app-router-context' +} from '../../shared/lib/app-router-context.external' import { SearchParamsContext, PathnameContext, -} from '../../shared/lib/hooks-client-context' +} from '../../shared/lib/hooks-client-context.external' import { clientHookInServerComponentError } from './client-hook-in-server-component-error' import { getSegmentValue } from './router-reducer/reducers/get-segment-value' @@ -116,7 +116,7 @@ export { /** * Get the router methods. For example router.push('/dashboard') */ -export function useRouter(): import('../../shared/lib/app-router-context').AppRouterInstance { +export function useRouter(): import('../../shared/lib/app-router-context.external').AppRouterInstance { clientHookInServerComponentError('useRouter') const router = useContext(AppRouterContext) if (router === null) { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts index 88428d845a60e..84435d44bc1cf 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts @@ -1,5 +1,5 @@ import { useCallback, useContext, useEffect, useRef } from 'react' -import { GlobalLayoutRouterContext } from '../../../../../shared/lib/app-router-context' +import { GlobalLayoutRouterContext } from '../../../../../shared/lib/app-router-context.external' import { getSocketProtocol } from './get-socket-protocol' export function useWebsocket( diff --git a/packages/next/src/client/components/redirect-boundary.tsx b/packages/next/src/client/components/redirect-boundary.tsx index 6d0cbbba70401..1fd5345c76ff1 100644 --- a/packages/next/src/client/components/redirect-boundary.tsx +++ b/packages/next/src/client/components/redirect-boundary.tsx @@ -1,6 +1,6 @@ 'use client' import React, { useEffect } from 'react' -import { AppRouterInstance } from '../../shared/lib/app-router-context' +import { AppRouterInstance } from '../../shared/lib/app-router-context.external' import { useRouter } from './navigation' import { RedirectType, diff --git a/packages/next/src/client/components/render-from-template-context.tsx b/packages/next/src/client/components/render-from-template-context.tsx index be486842c4f33..006c158244357 100644 --- a/packages/next/src/client/components/render-from-template-context.tsx +++ b/packages/next/src/client/components/render-from-template-context.tsx @@ -1,7 +1,7 @@ 'use client' import React, { useContext } from 'react' -import { TemplateContext } from '../../shared/lib/app-router-context' +import { TemplateContext } from '../../shared/lib/app-router-context.external' export default function RenderFromTemplateContext(): JSX.Element { const children = useContext(TemplateContext) diff --git a/packages/next/src/client/components/router-reducer/apply-flight-data.ts b/packages/next/src/client/components/router-reducer/apply-flight-data.ts index e7a2f11a84f48..36da87fdc399d 100644 --- a/packages/next/src/client/components/router-reducer/apply-flight-data.ts +++ b/packages/next/src/client/components/router-reducer/apply-flight-data.ts @@ -1,4 +1,7 @@ -import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' +import { + CacheNode, + CacheStates, +} from '../../../shared/lib/app-router-context.external' import { FlightDataPath } from '../../../server/app-render/types' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx index 1826358d49892..76401173d21a2 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx @@ -1,6 +1,9 @@ import React from 'react' import type { FlightRouterState } from '../../../server/app-render/types' -import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' +import { + CacheNode, + CacheStates, +} from '../../../shared/lib/app-router-context.external' import { createInitialRouterState } from './create-initial-router-state' const buildId = 'development' diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts index 2ddbbb16a0f5f..6950d4200f7e2 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts @@ -1,8 +1,8 @@ import type { ReactNode } from 'react' -import type { CacheNode } from '../../../shared/lib/app-router-context' +import type { CacheNode } from '../../../shared/lib/app-router-context.external' import type { FlightRouterState } from '../../../server/app-render/types' -import { CacheStates } from '../../../shared/lib/app-router-context' +import { CacheStates } from '../../../shared/lib/app-router-context.external' import { createHrefFromUrl } from './create-href-from-url' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import { extractPathFromFlightRouterState } from './compute-changed-path' diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx index 197845f83500f..28da66a77c099 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx @@ -1,7 +1,10 @@ import React from 'react' import { fetchServerResponse } from './fetch-server-response' import { fillCacheWithDataProperty } from './fill-cache-with-data-property' -import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' +import { + CacheStates, + CacheNode, +} from '../../../shared/lib/app-router-context.external' describe('fillCacheWithDataProperty', () => { it('should add data property', () => { const fetchServerResponseMock: jest.Mock< diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts index 81df295dba302..5b45b590a3c6c 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts @@ -1,5 +1,8 @@ import { FlightSegmentPath } from '../../../server/app-render/types' -import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' +import { + CacheNode, + CacheStates, +} from '../../../shared/lib/app-router-context.external' import { createRouterCacheKey } from './create-router-cache-key' import { fetchServerResponse } from './fetch-server-response' diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx index 187f86a478751..b07fe96295d65 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx @@ -1,6 +1,9 @@ import React from 'react' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' -import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' +import { + CacheStates, + CacheNode, +} from '../../../shared/lib/app-router-context.external' import type { FlightData } from '../../../server/app-render/types' const getFlightData = (): FlightData => { diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts index 5d48eaee9ef9f..8f9f4656481ee 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts @@ -1,4 +1,7 @@ -import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' +import { + CacheNode, + CacheStates, +} from '../../../shared/lib/app-router-context.external' import type { FlightDataPath } from '../../../server/app-render/types' import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' diff --git a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx index 606440a96f9c9..34e60f882cd9c 100644 --- a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx @@ -1,6 +1,9 @@ import React from 'react' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' -import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' +import { + CacheStates, + CacheNode, +} from '../../../shared/lib/app-router-context.external' import type { FlightData } from '../../../server/app-render/types' const getFlightData = (): FlightData => { diff --git a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts index c5ddedd52351e..9ae8f208e1778 100644 --- a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts +++ b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts @@ -1,4 +1,7 @@ -import { CacheNode, CacheStates } from '../../../shared/lib/app-router-context' +import { + CacheNode, + CacheStates, +} from '../../../shared/lib/app-router-context.external' import type { FlightRouterState } from '../../../server/app-render/types' import { createRouterCacheKey } from './create-router-cache-key' diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx index 915f09cae0cae..78fabee27df73 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx @@ -1,7 +1,10 @@ import React from 'react' import type { FlightData } from '../../../server/app-render/types' import { invalidateCacheBelowFlightSegmentPath } from './invalidate-cache-below-flight-segmentpath' -import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' +import { + CacheStates, + CacheNode, +} from '../../../shared/lib/app-router-context.external' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' const getFlightData = (): FlightData => { diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts index ac343f8d79679..94a126916426a 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts @@ -1,4 +1,4 @@ -import type { CacheNode } from '../../../shared/lib/app-router-context' +import type { CacheNode } from '../../../shared/lib/app-router-context.external' import type { FlightSegmentPath } from '../../../server/app-render/types' import { createRouterCacheKey } from './create-router-cache-key' diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx index 65ce9e42c05ee..12d3582c3fec0 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx @@ -1,6 +1,9 @@ import React from 'react' import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state' -import { CacheStates, CacheNode } from '../../../shared/lib/app-router-context' +import { + CacheStates, + CacheNode, +} from '../../../shared/lib/app-router-context.external' import type { FlightRouterState } from '../../../server/app-render/types' describe('invalidateCacheByRouterState', () => { diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts index 820e5909bf031..62f2c76edf8f8 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts @@ -1,4 +1,4 @@ -import type { CacheNode } from '../../../shared/lib/app-router-context' +import type { CacheNode } from '../../../shared/lib/app-router-context.external' import type { FlightRouterState } from '../../../server/app-render/types' import { createRouterCacheKey } from './create-router-cache-key' diff --git a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx index 807374c855577..0a909d6632ddc 100644 --- a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx @@ -3,7 +3,7 @@ import type { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import { findHeadInCache } from './find-head-in-cache' describe('findHeadInCache', () => { diff --git a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts index f4d5e768b9808..724d7ec821e8c 100644 --- a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts +++ b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts @@ -1,5 +1,5 @@ import type { FlightRouterState } from '../../../../server/app-render/types' -import type { CacheNode } from '../../../../shared/lib/app-router-context' +import type { CacheNode } from '../../../../shared/lib/app-router-context.external' import { createRouterCacheKey } from '../create-router-cache-key' export function findHeadInCache( diff --git a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx index a5f9580c327c0..52dee666d6d74 100644 --- a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx @@ -79,7 +79,7 @@ import { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import { createInitialRouterState } from '../create-initial-router-state' import { NavigateAction, diff --git a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts index 35f99de505ef8..cecb811be82f8 100644 --- a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts @@ -1,7 +1,7 @@ import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import type { FlightRouterState, FlightSegmentPath, diff --git a/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx index d25cbb90abb8c..ecf1b7734a65a 100644 --- a/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx @@ -36,7 +36,7 @@ import { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import { createInitialRouterState } from '../create-initial-router-state' import { PrefetchAction, diff --git a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx index 5f3ec5bd710d4..1357bb0fb3549 100644 --- a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx @@ -46,7 +46,7 @@ import { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import { createInitialRouterState } from '../create-initial-router-state' import { RefreshAction, ACTION_REFRESH } from '../router-reducer-types' import { refreshReducer } from './refresh-reducer' diff --git a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts index cd87ef3802b00..66265ccc986e8 100644 --- a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts @@ -11,7 +11,7 @@ import { } from '../router-reducer-types' import { handleExternalUrl } from './navigate-reducer' import { handleMutable } from '../handle-mutable' -import { CacheStates } from '../../../../shared/lib/app-router-context' +import { CacheStates } from '../../../../shared/lib/app-router-context.external' import { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head' export function refreshReducer( diff --git a/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx index bc418c7c771de..b405aec8a8259 100644 --- a/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx @@ -3,7 +3,7 @@ import type { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import { createInitialRouterState } from '../create-initial-router-state' import { RestoreAction, ACTION_RESTORE } from '../router-reducer-types' import { restoreReducer } from './restore-reducer' diff --git a/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx index 913b1dd8afcc7..2e61caa6701c0 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx @@ -41,7 +41,7 @@ jest.mock('../fetch-server-response', () => { import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context' +} from '../../../../shared/lib/app-router-context.external' import { createInitialRouterState } from '../create-initial-router-state' import { ServerPatchAction, diff --git a/packages/next/src/client/components/router-reducer/router-reducer-types.ts b/packages/next/src/client/components/router-reducer/router-reducer-types.ts index c7dfe69472ee7..8d736aa9ca5a7 100644 --- a/packages/next/src/client/components/router-reducer/router-reducer-types.ts +++ b/packages/next/src/client/components/router-reducer/router-reducer-types.ts @@ -1,4 +1,4 @@ -import type { CacheNode } from '../../../shared/lib/app-router-context' +import type { CacheNode } from '../../../shared/lib/app-router-context.external' import type { FlightRouterState, FlightData, diff --git a/packages/next/src/client/image-component.tsx b/packages/next/src/client/image-component.tsx index ee4a8e5b142ba..eb50fbf664f9d 100644 --- a/packages/next/src/client/image-component.tsx +++ b/packages/next/src/client/image-component.tsx @@ -25,7 +25,7 @@ import type { ImageLoaderProps, } from '../shared/lib/image-config' import { imageConfigDefault } from '../shared/lib/image-config' -import { ImageConfigContext } from '../shared/lib/image-config-context' +import { ImageConfigContext } from '../shared/lib/image-config-context.external' import { warnOnce } from '../shared/lib/utils/warn-once' import { RouterContext } from '../shared/lib/router-context.external' diff --git a/packages/next/src/client/index.tsx b/packages/next/src/client/index.tsx index 94e1bf20d46a1..bd6e34bf98d39 100644 --- a/packages/next/src/client/index.tsx +++ b/packages/next/src/client/index.tsx @@ -10,7 +10,7 @@ import type { import React from 'react' import ReactDOM from 'react-dom/client' -import { HeadManagerContext } from '../shared/lib/head-manager-context' +import { HeadManagerContext } from '../shared/lib/head-manager-context.external' import mitt, { MittEmitter } from '../shared/lib/mitt' import { RouterContext } from '../shared/lib/router-context.external' import { handleSmoothScroll } from '../shared/lib/router/utils/handle-smooth-scroll' @@ -34,17 +34,17 @@ import measureWebVitals from './performance-relayer' import { RouteAnnouncer } from './route-announcer' import { createRouter, makePublicRouterInstance } from './router' import { getProperError } from '../lib/is-error' -import { ImageConfigContext } from '../shared/lib/image-config-context' +import { ImageConfigContext } from '../shared/lib/image-config-context.external' import { ImageConfigComplete } from '../shared/lib/image-config' import { removeBasePath } from './remove-base-path' import { hasBasePath } from './has-base-path' -import { AppRouterContext } from '../shared/lib/app-router-context' +import { AppRouterContext } from '../shared/lib/app-router-context.external' import { adaptForAppRouterInstance, adaptForSearchParams, PathnameContextProviderAdapter, -} from '../shared/lib/router/adapters' -import { SearchParamsContext } from '../shared/lib/hooks-client-context' +} from '../shared/lib/router/adapters.external' +import { SearchParamsContext } from '../shared/lib/hooks-client-context.external' import onRecoverableError from './on-recoverable-error' /// diff --git a/packages/next/src/client/legacy/image.tsx b/packages/next/src/client/legacy/image.tsx index 2511a0c2a2759..7cd06d8f51a66 100644 --- a/packages/next/src/client/legacy/image.tsx +++ b/packages/next/src/client/legacy/image.tsx @@ -16,7 +16,7 @@ import { VALID_LOADERS, } from '../../shared/lib/image-config' import { useIntersection } from '../use-intersection' -import { ImageConfigContext } from '../../shared/lib/image-config-context' +import { ImageConfigContext } from '../../shared/lib/image-config-context.external' import { warnOnce } from '../../shared/lib/utils/warn-once' import { normalizePathTrailingSlash } from '../normalize-trailing-slash' diff --git a/packages/next/src/client/link.tsx b/packages/next/src/client/link.tsx index 64a13c7bbe46e..beb70280a17dd 100644 --- a/packages/next/src/client/link.tsx +++ b/packages/next/src/client/link.tsx @@ -17,7 +17,7 @@ import { AppRouterContext, AppRouterInstance, PrefetchOptions as AppRouterPrefetchOptions, -} from '../shared/lib/app-router-context' +} from '../shared/lib/app-router-context.external' import { useIntersection } from './use-intersection' import { getDomainLocale } from './get-domain-locale' import { addBasePath } from './add-base-path' diff --git a/packages/next/src/client/script.tsx b/packages/next/src/client/script.tsx index a4b2c6dcd3184..3820c75f7941b 100644 --- a/packages/next/src/client/script.tsx +++ b/packages/next/src/client/script.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom' import React, { useEffect, useContext, useRef } from 'react' import { ScriptHTMLAttributes } from 'react' -import { HeadManagerContext } from '../shared/lib/head-manager-context' +import { HeadManagerContext } from '../shared/lib/head-manager-context.external' import { DOMAttributeNames } from './head-manager' import { requestIdleCallback } from './request-idle-callback' diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 2ab1d7f9c8fb3..b73017cdf15ee 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -1447,7 +1447,7 @@ export async function renderToHTMLOrFlight( ) const { HeadManagerContext } = - require('../../shared/lib/head-manager-context') as typeof import('../../shared/lib/head-manager-context') + require('../../shared/lib/head-manager-context') as typeof import('../../shared/lib/head-manager-context.external') // On each render, create a new `ServerInsertedHTML` context to capture // injected nodes from user code (`useServerInsertedHTML`). diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts index eb08824a49443..82ddc97130786 100644 --- a/packages/next/src/server/future/route-modules/pages/externals.ts +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -1,2 +1,10 @@ +// the name of the export has to be the camelCase version of the file name (without the extension) export * as htmlContext from '../../../../shared/lib/html-context.external' export * as routerContext from '../../../../shared/lib/router-context.external' +export * as ampContext from '../../../../shared/lib/amp-context.external' +export * as headManagerContext from '../../../../shared/lib/head-manager-context.external' +export * as adapters from '../../../../shared/lib/router/adapters.external' +export * as loadableContext from '../../../../shared/lib/loadable-context.external' +export * as appRouterContext from '../../../../shared/lib/app-router-context.external' +export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' +export * as ImageConfigContext from '../../../../shared/lib/image-config-context.external' diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index baf2bf7b0ff10..70b0fa811eec0 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -52,11 +52,11 @@ import { } from '../shared/lib/constants' import { isSerializableProps } from '../lib/is-serializable-props' import { isInAmpMode } from '../shared/lib/amp-mode' -import { AmpStateContext } from '../shared/lib/amp-context' +import { AmpStateContext } from '../shared/lib/amp-context.external' import { defaultHead } from '../shared/lib/head' -import { HeadManagerContext } from '../shared/lib/head-manager-context' +import { HeadManagerContext } from '../shared/lib/head-manager-context.external' import Loadable from '../shared/lib/loadable' -import { LoadableContext } from '../shared/lib/loadable-context' +import { LoadableContext } from '../shared/lib/loadable-context.external' import { RouterContext } from '../shared/lib/router-context.external' import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic' import { @@ -79,16 +79,16 @@ import { renderToInitialStream, continueFromInitialStream, } from './stream-utils/node-web-streams-helper' -import { ImageConfigContext } from '../shared/lib/image-config-context' +import { ImageConfigContext } from '../shared/lib/image-config-context.external' import stripAnsi from 'next/dist/compiled/strip-ansi' import { stripInternalQueries } from './internal-utils' import { adaptForAppRouterInstance, adaptForSearchParams, PathnameContextProviderAdapter, -} from '../shared/lib/router/adapters' -import { AppRouterContext } from '../shared/lib/app-router-context' -import { SearchParamsContext } from '../shared/lib/hooks-client-context' +} from '../shared/lib/router/adapters.external' +import { AppRouterContext } from '../shared/lib/app-router-context.external' +import { SearchParamsContext } from '../shared/lib/hooks-client-context.external' import { getTracer } from './lib/trace/tracer' import { RenderSpan } from './lib/trace/constants' import { PageNotFoundError } from '../shared/lib/utils' diff --git a/packages/next/src/shared/lib/amp-context.ts b/packages/next/src/shared/lib/amp-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/amp-context.ts rename to packages/next/src/shared/lib/amp-context.external.ts diff --git a/packages/next/src/shared/lib/amp.ts b/packages/next/src/shared/lib/amp.ts index 04518b2389357..f26dc0e2ce48b 100644 --- a/packages/next/src/shared/lib/amp.ts +++ b/packages/next/src/shared/lib/amp.ts @@ -1,5 +1,5 @@ import React from 'react' -import { AmpStateContext } from './amp-context' +import { AmpStateContext } from './amp-context.external' import { isInAmpMode } from './amp-mode' export function useAmp(): boolean { diff --git a/packages/next/src/shared/lib/app-router-context.ts b/packages/next/src/shared/lib/app-router-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/app-router-context.ts rename to packages/next/src/shared/lib/app-router-context.external.ts diff --git a/packages/next/src/shared/lib/head-manager-context.ts b/packages/next/src/shared/lib/head-manager-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/head-manager-context.ts rename to packages/next/src/shared/lib/head-manager-context.external.ts diff --git a/packages/next/src/shared/lib/head.tsx b/packages/next/src/shared/lib/head.tsx index 3156e259f656f..d411ff4644d22 100644 --- a/packages/next/src/shared/lib/head.tsx +++ b/packages/next/src/shared/lib/head.tsx @@ -2,8 +2,8 @@ import React, { useContext } from 'react' import Effect from './side-effect' -import { AmpStateContext } from './amp-context' -import { HeadManagerContext } from './head-manager-context' +import { AmpStateContext } from './amp-context.external' +import { HeadManagerContext } from './head-manager-context.external' import { isInAmpMode } from './amp-mode' import { warnOnce } from './utils/warn-once' diff --git a/packages/next/src/shared/lib/hooks-client-context.ts b/packages/next/src/shared/lib/hooks-client-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/hooks-client-context.ts rename to packages/next/src/shared/lib/hooks-client-context.external.ts diff --git a/packages/next/src/shared/lib/image-config-context.ts b/packages/next/src/shared/lib/image-config-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/image-config-context.ts rename to packages/next/src/shared/lib/image-config-context.external.ts diff --git a/packages/next/src/shared/lib/loadable-context.ts b/packages/next/src/shared/lib/loadable-context.external.ts similarity index 100% rename from packages/next/src/shared/lib/loadable-context.ts rename to packages/next/src/shared/lib/loadable-context.external.ts diff --git a/packages/next/src/shared/lib/loadable.tsx b/packages/next/src/shared/lib/loadable.tsx index 1592d98551093..d1884a18ae5d9 100644 --- a/packages/next/src/shared/lib/loadable.tsx +++ b/packages/next/src/shared/lib/loadable.tsx @@ -23,7 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE // Modified to be compatible with webpack 4 / Next.js import React from 'react' -import { LoadableContext } from './loadable-context' +import { LoadableContext } from './loadable-context.external' function resolve(obj: any) { return obj && obj.default ? obj.default : obj diff --git a/packages/next/src/shared/lib/router/adapters.tsx b/packages/next/src/shared/lib/router/adapters.external.tsx similarity index 96% rename from packages/next/src/shared/lib/router/adapters.tsx rename to packages/next/src/shared/lib/router/adapters.external.tsx index ce68a8bec1e8b..84c3b10d93092 100644 --- a/packages/next/src/shared/lib/router/adapters.tsx +++ b/packages/next/src/shared/lib/router/adapters.external.tsx @@ -1,7 +1,10 @@ import type { ParsedUrlQuery } from 'node:querystring' import React, { useMemo, useRef } from 'react' -import type { AppRouterInstance, NavigateOptions } from '../app-router-context' -import { PathnameContext } from '../hooks-client-context' +import type { + AppRouterInstance, + NavigateOptions, +} from '../app-router-context.external' +import { PathnameContext } from '../hooks-client-context.external' import type { NextRouter } from './router' import { isDynamicRoute } from './utils' diff --git a/packages/next/src/shared/lib/router/adapters.test.tsx b/packages/next/src/shared/lib/router/adapters.test.tsx index fa8e48f2fc088..0e0c97a881a93 100644 --- a/packages/next/src/shared/lib/router/adapters.test.tsx +++ b/packages/next/src/shared/lib/router/adapters.test.tsx @@ -1,4 +1,4 @@ -import { adaptForAppRouterInstance } from './adapters' +import { adaptForAppRouterInstance } from './adapters.external' import { NextRouter } from './router' describe('adaptForAppRouterInstance', () => { From 61709d69e729bb4184d744a0b4c3970e6379b8ac Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 18:18:54 +0200 Subject: [PATCH 029/101] fix runtime-config --- packages/next/config.d.ts | 4 +- packages/next/config.js | 2 +- packages/next/src/build/utils.ts | 8 +- packages/next/src/client/index.tsx | 2 +- packages/next/src/export/worker.ts | 2 +- .../next/src/server/app-render/app-render.tsx | 2 +- packages/next/src/server/base-server.ts | 2 +- .../src/server/dev/static-paths-worker.ts | 2 +- .../future/route-modules/pages/externals.ts | 1 + ...e-config.ts => runtime-config.external.ts} | 0 packages/next/taskfile-next-build.js | 86 ++++++++++--------- 11 files changed, 59 insertions(+), 52 deletions(-) rename packages/next/src/shared/lib/{runtime-config.ts => runtime-config.external.ts} (100%) diff --git a/packages/next/config.d.ts b/packages/next/config.d.ts index 78fe148a8dc9b..20c292fb467ef 100644 --- a/packages/next/config.d.ts +++ b/packages/next/config.d.ts @@ -1,3 +1,3 @@ -import getConfig from './dist/shared/lib/runtime-config' -export * from './dist/shared/lib/runtime-config' +import getConfig from './dist/shared/lib/runtime-config.external' +export * from './dist/shared/lib/runtime-config.external' export default getConfig diff --git a/packages/next/config.js b/packages/next/config.js index 2da980d8b0065..668ee7c54f0e0 100644 --- a/packages/next/config.js +++ b/packages/next/config.js @@ -1 +1 @@ -module.exports = require('./dist/shared/lib/runtime-config') +module.exports = require('./dist/shared/lib/runtime-config.external') diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index 146c5d732a0b6..9ce0cbc9d07d7 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -1378,7 +1378,9 @@ export async function isPageStatic({ const isPageStaticSpan = trace('is-page-static-utils', parentId) return isPageStaticSpan .traceAsyncFn(async () => { - require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig) + require('../shared/lib/runtime-config.external').setConfig( + runtimeEnvConfig + ) setHttpClientAndAgentOptions({ httpAgentOptions, }) @@ -1662,7 +1664,7 @@ export async function hasCustomGetInitialProps( runtimeEnvConfig: any, checkingApp: boolean ): Promise { - require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig) + require('../shared/lib/runtime-config.external').setConfig(runtimeEnvConfig) const components = await loadComponents({ distDir, @@ -1685,7 +1687,7 @@ export async function getDefinedNamedExports( distDir: string, runtimeEnvConfig: any ): Promise> { - require('../shared/lib/runtime-config').setConfig(runtimeEnvConfig) + require('../shared/lib/runtime-config.external').setConfig(runtimeEnvConfig) const components = await loadComponents({ distDir, pathname: page, diff --git a/packages/next/src/client/index.tsx b/packages/next/src/client/index.tsx index bd6e34bf98d39..9016fdeb0a10c 100644 --- a/packages/next/src/client/index.tsx +++ b/packages/next/src/client/index.tsx @@ -19,7 +19,7 @@ import { urlQueryToSearchParams, assign, } from '../shared/lib/router/utils/querystring' -import { setConfig } from '../shared/lib/runtime-config' +import { setConfig } from '../shared/lib/runtime-config.external' import { getURL, loadGetInitialProps, diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index c4cf5f5c2a73c..80c5af5467fbf 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -48,7 +48,7 @@ import { RouteModuleLoader } from '../server/future/helpers/module-loader/route- import { NextRequestAdapter } from '../server/web/spec-extension/adapters/next-request' import * as ciEnvironment from '../telemetry/ci-info' -const envConfig = require('../shared/lib/runtime-config') +const envConfig = require('../shared/lib/runtime-config.external') ;(globalThis as any).__NEXT_DATA__ = { nextExport: true, diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index b73017cdf15ee..3a80f627a4308 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -1447,7 +1447,7 @@ export async function renderToHTMLOrFlight( ) const { HeadManagerContext } = - require('../../shared/lib/head-manager-context') as typeof import('../../shared/lib/head-manager-context.external') + require('../../shared/lib/head-manager-context.external') as typeof import('../../shared/lib/head-manager-context.external') // On each render, create a new `ServerInsertedHTML` context to capture // injected nodes from user code (`useServerInsertedHTML`). diff --git a/packages/next/src/server/base-server.ts b/packages/next/src/server/base-server.ts index d3d8c28cad5bc..c1615ad1fbb65 100644 --- a/packages/next/src/server/base-server.ts +++ b/packages/next/src/server/base-server.ts @@ -49,7 +49,7 @@ import { getCookieParser, checkIsOnDemandRevalidate, } from './api-utils' -import { setConfig } from '../shared/lib/runtime-config' +import { setConfig } from '../shared/lib/runtime-config.external' import { setRevalidateHeaders } from './send-payload/revalidate-headers' import { execOnce } from '../shared/lib/utils' diff --git a/packages/next/src/server/dev/static-paths-worker.ts b/packages/next/src/server/dev/static-paths-worker.ts index 68932df7a36b0..82aa53172e0ed 100644 --- a/packages/next/src/server/dev/static-paths-worker.ts +++ b/packages/next/src/server/dev/static-paths-worker.ts @@ -56,7 +56,7 @@ export async function loadStaticPaths({ fallback?: boolean | 'blocking' }> { // update work memory runtime-config - require('../../shared/lib/runtime-config').setConfig(config) + require('../../shared/lib/runtime-config.external').setConfig(config) setHttpClientAndAgentOptions({ httpAgentOptions, }) diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts index 82ddc97130786..ff8bc51afe233 100644 --- a/packages/next/src/server/future/route-modules/pages/externals.ts +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -8,3 +8,4 @@ export * as loadableContext from '../../../../shared/lib/loadable-context.extern export * as appRouterContext from '../../../../shared/lib/app-router-context.external' export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' export * as ImageConfigContext from '../../../../shared/lib/image-config-context.external' +export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' diff --git a/packages/next/src/shared/lib/runtime-config.ts b/packages/next/src/shared/lib/runtime-config.external.ts similarity index 100% rename from packages/next/src/shared/lib/runtime-config.ts rename to packages/next/src/shared/lib/runtime-config.external.ts diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index 619dcaafa286f..65acec9c328d4 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -4,6 +4,50 @@ const path = require('path') const TerserPlugin = require('terser-webpack-plugin') const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') +const minimalExternals = [ + 'react', + 'react/package.json', + 'react/jsx-runtime', + 'react/jsx-dev-runtime', + 'react-dom', + 'react-dom/package.json', + 'react-dom/client', + 'react-dom/server', + 'react-dom/server.browser', + 'react-dom/server.edge', + 'react-server-dom-webpack/client', + 'react-server-dom-webpack/client.edge', + 'react-server-dom-webpack/server.edge', + 'react-server-dom-webpack/server.node', + 'styled-jsx', + 'styled-jsx/style', + '@opentelemetry/api', + 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', + 'next/dist/compiled/@ampproject/toolbox-optimizer', + 'next/dist/compiled/edge-runtime', + 'next/dist/compiled/@edge-runtime/ponyfill', + 'next/dist/compiled/undici', + 'next/dist/compiled/raw-body', + 'next/dist/server/capsize-font-metrics.json', + 'critters', + 'next/dist/compiled/node-html-parser', + 'next/dist/compiled/compression', + 'next/dist/compiled/jsonwebtoken', + 'next/dist/compiled/@opentelemetry/api', +] + +const externalsMap = { + '/(.*)config$/': 'next/dist/server/config', + './web/sandbox': 'next/dist/server/web/sandbox', +} + +const externalHandler = ({ context, request }, callback) => { + if (/(.*)shared\/lib\/runtime-config.external/.test(request)) { + return callback(null, 'next/dist/shared/lib/runtime-config.external') + } + callback() +} + async function buildNextServer(task) { // cleanup old files await fs.rm(path.join(__dirname, 'dist/compiled/minimal-next-server'), { @@ -11,46 +55,6 @@ async function buildNextServer(task) { force: true, }) - const minimalExternals = [ - 'react', - 'react/package.json', - 'react/jsx-runtime', - 'react/jsx-dev-runtime', - 'react-dom', - 'react-dom/package.json', - 'react-dom/client', - 'react-dom/server', - 'react-dom/server.browser', - 'react-dom/server.edge', - 'react-server-dom-webpack/client', - 'react-server-dom-webpack/client.edge', - 'react-server-dom-webpack/server.edge', - 'react-server-dom-webpack/server.node', - 'styled-jsx', - 'styled-jsx/style', - '@opentelemetry/api', - 'next/dist/compiled/@next/react-dev-overlay/dist/middleware', - 'next/dist/compiled/@ampproject/toolbox-optimizer', - 'next/dist/compiled/edge-runtime', - 'next/dist/compiled/@edge-runtime/ponyfill', - 'next/dist/compiled/undici', - 'next/dist/compiled/raw-body', - 'next/dist/server/capsize-font-metrics.json', - 'critters', - 'next/dist/compiled/node-html-parser', - 'next/dist/compiled/compression', - 'next/dist/compiled/jsonwebtoken', - 'next/dist/compiled/@opentelemetry/api', - ].reduce((acc, pkg) => { - acc[pkg] = pkg - return acc - }, {}) - - Object.assign(minimalExternals, { - '/(.*)config$/': 'next/dist/server/config', - './web/sandbox': 'next/dist/server/web/sandbox', - }) - /** @type {webpack.Configuration} */ const config = { entry: { @@ -112,7 +116,7 @@ async function buildNextServer(task) { // Display bailout reasons optimizationBailout: true, }, - externals: [minimalExternals], + externals: [...minimalExternals, externalsMap, externalHandler], } await new Promise((resolve, reject) => { From defc3cfc251b1ce7c1fb776692599dfa941cf8b0 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 18:23:35 +0200 Subject: [PATCH 030/101] fix turbo --- packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx b/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx index d713ab7e31570..70d83e2c982ba 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx @@ -6,7 +6,7 @@ import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-we import { callServer } from 'next/dist/client/app-call-server' import { linkGc } from 'next/dist/client/app-link-gc' -import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context' +import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context.external' import { initializeHMR } from '@vercel/turbopack-next/dev/client' From 38e709f39bcbd58bf71b6f35b24cd3a314d27a03 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 18:43:48 +0200 Subject: [PATCH 031/101] fix edge dev --- packages/next/src/server/dev/hot-reloader.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next/src/server/dev/hot-reloader.ts b/packages/next/src/server/dev/hot-reloader.ts index 43e7007166222..52fa416eedc65 100644 --- a/packages/next/src/server/dev/hot-reloader.ts +++ b/packages/next/src/server/dev/hot-reloader.ts @@ -819,6 +819,7 @@ export default class HotReloader { middlewareConfig: Buffer.from( JSON.stringify(staticInfo.middleware || {}) ).toString('base64'), + isEdge: true, }).import : undefined From e2b7b5f1fb4074628dc449ed1c2c59535523ceb2 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 18:46:14 +0200 Subject: [PATCH 032/101] fix image loader --- .../next/src/server/future/route-modules/pages/externals.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts index ff8bc51afe233..5bd56a4647813 100644 --- a/packages/next/src/server/future/route-modules/pages/externals.ts +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -7,5 +7,5 @@ export * as adapters from '../../../../shared/lib/router/adapters.external' export * as loadableContext from '../../../../shared/lib/loadable-context.external' export * as appRouterContext from '../../../../shared/lib/app-router-context.external' export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' -export * as ImageConfigContext from '../../../../shared/lib/image-config-context.external' +export * as imageConfigContext from '../../../../shared/lib/image-config-context.external' export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' From f158277e85ee33a395e774737e2d9ffe951e6cb9 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 19:17:27 +0200 Subject: [PATCH 033/101] fix requiring from next/router --- packages/next/src/build/webpack-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index af5c38b0f203f..25f0901a0227d 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1403,7 +1403,7 @@ export default async function getBaseWebpackConfig( } const notExternalModules = - /^(?:private-next-pages\/|next\/(?:dist\/pages\/|(?:app|document|link|image|legacy\/image|constants|dynamic|script|navigation|headers)$)|string-hash|private-next-rsc-action-validate|private-next-rsc-action-client-wrapper|private-next-rsc-action-proxy$)/ + /^(?:private-next-pages\/|next\/(?:dist\/pages\/|(?:app|document|link|image|legacy\/image|constants|dynamic|script|navigation|headers|router)$)|string-hash|private-next-rsc-action-validate|private-next-rsc-action-client-wrapper|private-next-rsc-action-proxy$)/ if (notExternalModules.test(request)) { return } From c8b5e4162865c76e3ad7404f514ccc673150d11d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 19:18:42 +0200 Subject: [PATCH 034/101] fix app contexts --- packages/next/src/build/webpack-config.ts | 36 ++++++++++--------- .../next/src/client/components/navigation.ts | 2 +- .../app-render/server-inserted-html.tsx | 2 +- .../route-modules/app-page/externals.ts | 2 ++ .../future/route-modules/app-page/module.ts | 3 ++ ....tsx => server-inserted-html.external.tsx} | 0 6 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 packages/next/src/server/future/route-modules/app-page/externals.ts rename packages/next/src/shared/lib/{server-inserted-html.tsx => server-inserted-html.external.tsx} (100%) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 25f0901a0227d..0d1a47c253de6 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1467,23 +1467,25 @@ export default async function getBaseWebpackConfig( // ) // return `commonjs ${externalRequest}` - if (isAppLayer) { - // todo - } else { - return [ - 'commonjs ' + - path.posix.join( - 'next', - 'dist', - 'compiled', - 'minimal-next-server', - 'pages-render.runtime.js' - ), - 'default', - 'externals', - camelCaseName, - ] - } + // if (isAppLayer) { + // // todo + // } else { + return [ + 'commonjs ' + + path.posix.join( + 'next', + 'dist', + 'compiled', + 'minimal-next-server', + isAppLayer + ? 'app-page-render.runtime.js' + : 'pages-render.runtime.js' + ), + 'default', + 'externals', + camelCaseName, + ] + // } } } diff --git a/packages/next/src/client/components/navigation.ts b/packages/next/src/client/components/navigation.ts index 4196c1439ac57..0c21d2d8c5258 100644 --- a/packages/next/src/client/components/navigation.ts +++ b/packages/next/src/client/components/navigation.ts @@ -111,7 +111,7 @@ export function usePathname(): string { export { ServerInsertedHTMLContext, useServerInsertedHTML, -} from '../../shared/lib/server-inserted-html' +} from '../../shared/lib/server-inserted-html.external' /** * Get the router methods. For example router.push('/dashboard') diff --git a/packages/next/src/server/app-render/server-inserted-html.tsx b/packages/next/src/server/app-render/server-inserted-html.tsx index f044c24feaba3..adbbb34d2e73c 100644 --- a/packages/next/src/server/app-render/server-inserted-html.tsx +++ b/packages/next/src/server/app-render/server-inserted-html.tsx @@ -2,7 +2,7 @@ // elements into the HTML stream. import React from 'react' -import { ServerInsertedHTMLContext } from '../../shared/lib/server-inserted-html' +import { ServerInsertedHTMLContext } from '../../shared/lib/server-inserted-html.external' export function createServerInsertedHTML() { const serverInsertedHTMLCallbacks: (() => React.ReactNode)[] = [] diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts new file mode 100644 index 0000000000000..ce26d1af2da4e --- /dev/null +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -0,0 +1,2 @@ +export * as headManagerContext from '../../../../shared/lib/head-manager-context.external' +export * as serverInsertedHtml from '../../../../shared/lib/server-inserted-html.external' diff --git a/packages/next/src/server/future/route-modules/app-page/module.ts b/packages/next/src/server/future/route-modules/app-page/module.ts index 870465551d915..d4aba114ef312 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.ts @@ -11,6 +11,7 @@ import { type RouteModuleOptions, type RouteModuleHandleContext, } from '../route-module' +import * as externals from './externals' type AppPageUserlandModule = { /** @@ -34,6 +35,8 @@ export class AppPageRouteModule extends RouteModule< AppPageRouteDefinition, AppPageUserlandModule > { + static readonly externals = externals + public handle(): Promise { throw new Error('Method not implemented.') } diff --git a/packages/next/src/shared/lib/server-inserted-html.tsx b/packages/next/src/shared/lib/server-inserted-html.external.tsx similarity index 100% rename from packages/next/src/shared/lib/server-inserted-html.tsx rename to packages/next/src/shared/lib/server-inserted-html.external.tsx From a6eaeaad4e1198807825110ef232578fb2102776 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 19:35:53 +0200 Subject: [PATCH 035/101] fix precompiled --- packages/next/src/compiled/sass-loader/cjs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/compiled/sass-loader/cjs.js b/packages/next/src/compiled/sass-loader/cjs.js index 73546243d846d..47d6459ca0b6f 100644 --- a/packages/next/src/compiled/sass-loader/cjs.js +++ b/packages/next/src/compiled/sass-loader/cjs.js @@ -1 +1 @@ -(function(){var __webpack_modules__={12:function(e,t){function set(e,t,s){if(typeof s.value==="object")s.value=klona(s.value);if(!s.enumerable||s.get||s.set||!s.configurable||!s.writable||t==="__proto__"){Object.defineProperty(e,t,s)}else e[t]=s.value}function klona(e){if(typeof e!=="object")return e;var t=0,s,r,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){n=Object.create(e.__proto__||null)}else if(o==="[object Array]"){n=Array(e.length)}else if(o==="[object Set]"){n=new Set;e.forEach((function(e){n.add(klona(e))}))}else if(o==="[object Map]"){n=new Map;e.forEach((function(e,t){n.set(klona(t),klona(e))}))}else if(o==="[object Date]"){n=new Date(+e)}else if(o==="[object RegExp]"){n=new RegExp(e.source,e.flags)}else if(o==="[object DataView]"){n=new e.constructor(klona(e.buffer))}else if(o==="[object ArrayBuffer]"){n=e.slice(0)}else if(o.slice(-6)==="Array]"){n=new e.constructor(e)}if(n){for(r=Object.getOwnPropertySymbols(e);t{if(e){if(e.file){this.addDependency(r.default.normalize(e.file))}s(new a.default(e));return}let n=t.map?JSON.parse(t.map):null;if(n&&c){n=(0,o.normalizeSourceMap)(n,this.rootContext)}t.stats.includedFiles.forEach((e=>{const t=r.default.normalize(e);if(r.default.isAbsolute(t)){this.addDependency(t)}}));s(null,t.css.toString(),n)}))}var i=loader;t["default"]=i},60:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getRenderFunctionFromSassImplementation=getRenderFunctionFromSassImplementation;exports.getSassImplementation=getSassImplementation;exports.getSassOptions=getSassOptions;exports.getWebpackImporter=getWebpackImporter;exports.getWebpackResolver=getWebpackResolver;exports.isSupportedFibers=isSupportedFibers;exports.normalizeSourceMap=normalizeSourceMap;var _url=_interopRequireDefault(__nccwpck_require__(310));var _path=_interopRequireDefault(__nccwpck_require__(17));var _full=__nccwpck_require__(12);var _neoAsync=_interopRequireDefault(__nccwpck_require__(175));var _SassWarning=_interopRequireDefault(__nccwpck_require__(386));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getDefaultSassImplementation(){let sassImplPkg="sass";try{eval("require").resolve("sass")}catch(error){try{eval("require").resolve("node-sass");sassImplPkg="node-sass"}catch(e){sassImplPkg="sass"}}return __nccwpck_require__(438)}function getSassImplementation(e,t){let s=t;if(!s){try{s=getDefaultSassImplementation()}catch(t){e.emitError(t);return}}if(typeof s==="string"){try{s=require(s)}catch(t){e.emitError(t);return}}const{info:r}=s;if(!r){e.emitError(new Error("Unknown Sass implementation."));return}const n=r.split("\t");if(n.length<2){e.emitError(new Error(`Unknown Sass implementation "${r}".`));return}const[o]=n;if(o==="dart-sass"){return s}else if(o==="node-sass"){return s}e.emitError(new Error(`Unknown Sass implementation "${o}".`))}function isProductionLikeMode(e){return e.mode==="production"||!e.mode}function proxyCustomImporters(e,t){return[].concat(e).map((e=>function proxyImporter(...s){const r={...this,webpackLoaderContext:t};return e.apply(r,s)}))}function isSupportedFibers(){const[e]=process.versions.node.split(".");return Number(e)<16}async function getSassOptions(e,t,s,r,n){const o=(0,_full.klona)(t.sassOptions?typeof t.sassOptions==="function"?t.sassOptions(e)||{}:t.sassOptions:{});const a=r.info.includes("dart-sass");if(a&&isSupportedFibers()){const e=!o.fiber&&o.fiber!==false;if(e){let e;try{e=__nccwpck_require__.ab+"fibers.js"}catch(e){}if(__nccwpck_require__.ab+"fibers.js"){o.fiber=__nccwpck_require__(410)(e)}}else if(o.fiber===false){delete o.fiber}}else{delete o.fiber}o.file=e.resourcePath;o.data=t.additionalData?typeof t.additionalData==="function"?await t.additionalData(s,e):`${t.additionalData}\n${s}`:s;if(!o.outputStyle&&isProductionLikeMode(e)){o.outputStyle="compressed"}if(n){o.sourceMap=true;o.outFile=_path.default.join(e.rootContext,"style.css.map");o.sourceMapContents=true;o.omitSourceMapUrl=true;o.sourceMapEmbed=false}const{resourcePath:i}=e;const c=_path.default.extname(i);if(c&&c.toLowerCase()===".sass"&&typeof o.indentedSyntax==="undefined"){o.indentedSyntax=true}else{o.indentedSyntax=Boolean(o.indentedSyntax)}o.importer=o.importer?proxyCustomImporters(Array.isArray(o.importer)?o.importer:[o.importer],e):[];o.includePaths=[].concat(process.cwd()).concat((o.includePaths||[]).map((e=>_path.default.isAbsolute(e)?e:_path.default.join(process.cwd(),e)))).concat(process.env.SASS_PATH?process.env.SASS_PATH.split(process.platform==="win32"?";":":"):[]);if(typeof o.charset==="undefined"){o.charset=true}if(!o.logger){const s=t.warnRuleAsWarning===true;const r=e.getLogger("sass-loader");const formatSpan=e=>`${e.url||"-"}:${e.start.line}:${e.start.column}: `;o.logger={debug(e,t){let s="";if(t.span){s=formatSpan(t.span)}s+=e;r.debug(s)},warn(t,n){let o="";if(n.deprecation){o+="Deprecation "}if(n.span&&!n.stack){o=formatSpan(n.span)}o+=t;if(n.stack){o+=`\n\n${n.stack}`}if(s){e.emitWarning(new _SassWarning.default(o,n))}else{r.warn(o)}}}}return o}const MODULE_REQUEST_REGEX=/^[^?]*~/;const IS_MODULE_IMPORT=/^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;function getPossibleRequests(e,t=false,s=false){let r=e;if(t){if(MODULE_REQUEST_REGEX.test(e)){r=r.replace(MODULE_REQUEST_REGEX,"")}if(IS_MODULE_IMPORT.test(e)){r=r[r.length-1]==="/"?r:`${r}/`;return[...new Set([r,e])]}}const n=_path.default.extname(r).toLowerCase();if(n===".css"){return[]}const o=_path.default.dirname(r);const a=o==="."?"":`${o}/`;const i=_path.default.basename(r);const c=_path.default.basename(r,n);return[...new Set([].concat(s?[`${a}_${c}.import${n}`,`${a}${c}.import${n}`]:[]).concat([`${a}_${i}`,`${a}${i}`]).concat(t?[e]:[]))]}function promiseResolve(e){return(t,s)=>new Promise(((r,n)=>{e(t,s,((e,t)=>{if(e){n(e)}else{r(t)}}))}))}const IS_SPECIAL_MODULE_IMPORT=/^~[^/]+$/;const IS_NATIVE_WIN32_PATH=/^[a-z]:[/\\]|^\\\\/i;function getWebpackResolver(e,t,s=[]){async function startResolving(e){if(e.length===0){return Promise.reject()}const[{possibleRequests:t}]=e;if(t.length===0){return Promise.reject()}const[{resolve:s,context:r}]=e;try{return await s(r,t[0])}catch(s){const[,...r]=t;if(r.length===0){const[,...t]=e;return startResolving(t)}e[0].possibleRequests=r;return startResolving(e)}}const r=t.info.includes("dart-sass");const n=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const o=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index.import","_index","index.import","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const a=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style"],mainFields:["sass","style","main","..."],mainFiles:["_index","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const i=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style"],mainFields:["sass","style","main","..."],mainFiles:["_index.import","_index","index.import","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));return(e,t,c)=>{if(!r&&!_path.default.isAbsolute(e)){return Promise.reject()}const l=t;const u=l.slice(0,5).toLowerCase()==="file:";if(u){try{t=_url.default.fileURLToPath(l)}catch(e){t=t.slice(7)}}let p=[];const f=!IS_SPECIAL_MODULE_IMPORT.test(t)&&!u&&!l.startsWith("/")&&!IS_NATIVE_WIN32_PATH.test(l);if(s.length>0&&f){const a=getPossibleRequests(t,false,c);if(!r){p=p.concat({resolve:c?o:n,context:_path.default.dirname(e),possibleRequests:a})}p=p.concat(s.map((e=>({resolve:c?o:n,context:e,possibleRequests:a}))))}const _=getPossibleRequests(t,true,c);p=p.concat({resolve:c?i:a,context:_path.default.dirname(e),possibleRequests:_});return startResolving(p)}}const MATCH_CSS=/\.css$/i;function getWebpackImporter(e,t,s){const r=getWebpackResolver(e.getResolve,t,s);return function importer(t,s,n){const{fromImport:o}=this;r(s,t,o).then((t=>{e.addDependency(_path.default.normalize(t));n({file:t.replace(MATCH_CSS,"")})})).catch((()=>{n({file:t})}))}}let nodeSassJobQueue=null;function getRenderFunctionFromSassImplementation(e){const t=e.info.includes("dart-sass");if(t){return e.render.bind(e)}if(nodeSassJobQueue===null){const t=Number(process.env.UV_THREADPOOL_SIZE||4);nodeSassJobQueue=_neoAsync.default.queue(e.render.bind(e),t-1)}return nodeSassJobQueue.push.bind(nodeSassJobQueue)}const ABSOLUTE_SCHEME=/^[A-Za-z0-9+\-.]+:/;function getURLType(e){if(e[0]==="/"){if(e[1]==="/"){return"scheme-relative"}return"path-absolute"}if(IS_NATIVE_WIN32_PATH.test(e)){return"path-absolute"}return ABSOLUTE_SCHEME.test(e)?"absolute":"path-relative"}function normalizeSourceMap(e,t){const s=e;delete s.file;s.sourceRoot="";s.sources=s.sources.map((e=>{const s=getURLType(e);if(s==="path-relative"){return _path.default.resolve(t,_path.default.normalize(e))}return e}));return s}},410:function(e){function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=function(){return[]};webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=410;e.exports=webpackEmptyContext},175:function(e){"use strict";e.exports=require("next/dist/compiled/neo-async")},17:function(e){"use strict";e.exports=require("path")},438:function(e){"use strict";e.exports=require("sass")},310:function(e){"use strict";e.exports=require("url")},11:function(e){"use strict";e.exports=JSON.parse('{"title":"Sass Loader options","type":"object","properties":{"implementation":{"description":"The implementation of the sass to be used.","link":"https://github.com/webpack-contrib/sass-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"sassOptions":{"description":"Options for `node-sass` or `sass` (`Dart Sass`) implementation.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Sass`/`SCSS` code before the actual entry file.","link":"https://github.com/webpack-contrib/sass-loader#additionaldata","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/sass-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/sass-loader#webpackimporter","type":"boolean"},"warnRuleAsWarning":{"description":"Treats the \'@warn\' rule as a webpack warning.","link":"https://github.com/webpack-contrib/sass-loader#warnruleaswarning","type":"boolean"}},"additionalProperties":false}')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var s=__webpack_module_cache__[e]={exports:{}};var r=true;try{__webpack_modules__[e](s,s.exports,__nccwpck_require__);r=false}finally{if(r)delete __webpack_module_cache__[e]}return s.exports}!function(){__nccwpck_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(847);module.exports=__webpack_exports__})(); \ No newline at end of file +(function(){var __webpack_modules__={12:function(e,t){function set(e,t,s){if(typeof s.value==="object")s.value=klona(s.value);if(!s.enumerable||s.get||s.set||!s.configurable||!s.writable||t==="__proto__"){Object.defineProperty(e,t,s)}else e[t]=s.value}function klona(e){if(typeof e!=="object")return e;var t=0,s,r,n,o=Object.prototype.toString.call(e);if(o==="[object Object]"){n=Object.create(e.__proto__||null)}else if(o==="[object Array]"){n=Array(e.length)}else if(o==="[object Set]"){n=new Set;e.forEach((function(e){n.add(klona(e))}))}else if(o==="[object Map]"){n=new Map;e.forEach((function(e,t){n.set(klona(t),klona(e))}))}else if(o==="[object Date]"){n=new Date(+e)}else if(o==="[object RegExp]"){n=new RegExp(e.source,e.flags)}else if(o==="[object DataView]"){n=new e.constructor(klona(e.buffer))}else if(o==="[object ArrayBuffer]"){n=e.slice(0)}else if(o.slice(-6)==="Array]"){n=new e.constructor(e)}if(n){for(r=Object.getOwnPropertySymbols(e);t{if(e){if(e.file){this.addDependency(r.default.normalize(e.file))}s(new a.default(e));return}let n=t.map?JSON.parse(t.map):null;if(n&&c){n=(0,o.normalizeSourceMap)(n,this.rootContext)}t.stats.includedFiles.forEach((e=>{const t=r.default.normalize(e);if(r.default.isAbsolute(t)){this.addDependency(t)}}));s(null,t.css.toString(),n)}))}var i=loader;t["default"]=i},125:function(__unused_webpack_module,exports,__nccwpck_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getRenderFunctionFromSassImplementation=getRenderFunctionFromSassImplementation;exports.getSassImplementation=getSassImplementation;exports.getSassOptions=getSassOptions;exports.getWebpackImporter=getWebpackImporter;exports.getWebpackResolver=getWebpackResolver;exports.isSupportedFibers=isSupportedFibers;exports.normalizeSourceMap=normalizeSourceMap;var _url=_interopRequireDefault(__nccwpck_require__(310));var _path=_interopRequireDefault(__nccwpck_require__(17));var _full=__nccwpck_require__(12);var _neoAsync=_interopRequireDefault(__nccwpck_require__(175));var _SassWarning=_interopRequireDefault(__nccwpck_require__(186));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getDefaultSassImplementation(){let sassImplPkg="sass";try{eval("require").resolve("sass")}catch(error){try{eval("require").resolve("node-sass");sassImplPkg="node-sass"}catch(e){sassImplPkg="sass"}}return __nccwpck_require__(438)}function getSassImplementation(e,t){let s=t;if(!s){try{s=getDefaultSassImplementation()}catch(t){e.emitError(t);return}}if(typeof s==="string"){try{s=require(s)}catch(t){e.emitError(t);return}}const{info:r}=s;if(!r){e.emitError(new Error("Unknown Sass implementation."));return}const n=r.split("\t");if(n.length<2){e.emitError(new Error(`Unknown Sass implementation "${r}".`));return}const[o]=n;if(o==="dart-sass"){return s}else if(o==="node-sass"){return s}e.emitError(new Error(`Unknown Sass implementation "${o}".`))}function isProductionLikeMode(e){return e.mode==="production"||!e.mode}function proxyCustomImporters(e,t){return[].concat(e).map((e=>function proxyImporter(...s){const r={...this,webpackLoaderContext:t};return e.apply(r,s)}))}function isSupportedFibers(){const[e]=process.versions.node.split(".");return Number(e)<16}async function getSassOptions(e,t,s,r,n){const o=(0,_full.klona)(t.sassOptions?typeof t.sassOptions==="function"?t.sassOptions(e)||{}:t.sassOptions:{});const a=r.info.includes("dart-sass");if(a&&isSupportedFibers()){const e=!o.fiber&&o.fiber!==false;if(e){let e;try{e=__nccwpck_require__.ab+"fibers.js"}catch(e){}if(__nccwpck_require__.ab+"fibers.js"){o.fiber=__nccwpck_require__(684)(e)}}else if(o.fiber===false){delete o.fiber}}else{delete o.fiber}o.file=e.resourcePath;o.data=t.additionalData?typeof t.additionalData==="function"?await t.additionalData(s,e):`${t.additionalData}\n${s}`:s;if(!o.outputStyle&&isProductionLikeMode(e)){o.outputStyle="compressed"}if(n){o.sourceMap=true;o.outFile=_path.default.join(e.rootContext,"style.css.map");o.sourceMapContents=true;o.omitSourceMapUrl=true;o.sourceMapEmbed=false}const{resourcePath:i}=e;const c=_path.default.extname(i);if(c&&c.toLowerCase()===".sass"&&typeof o.indentedSyntax==="undefined"){o.indentedSyntax=true}else{o.indentedSyntax=Boolean(o.indentedSyntax)}o.importer=o.importer?proxyCustomImporters(Array.isArray(o.importer)?o.importer:[o.importer],e):[];o.includePaths=[].concat(process.cwd()).concat((o.includePaths||[]).map((e=>_path.default.isAbsolute(e)?e:_path.default.join(process.cwd(),e)))).concat(process.env.SASS_PATH?process.env.SASS_PATH.split(process.platform==="win32"?";":":"):[]);if(typeof o.charset==="undefined"){o.charset=true}if(!o.logger){const s=t.warnRuleAsWarning===true;const r=e.getLogger("sass-loader");const formatSpan=e=>`${e.url||"-"}:${e.start.line}:${e.start.column}: `;o.logger={debug(e,t){let s="";if(t.span){s=formatSpan(t.span)}s+=e;r.debug(s)},warn(t,n){let o="";if(n.deprecation){o+="Deprecation "}if(n.span&&!n.stack){o=formatSpan(n.span)}o+=t;if(n.stack){o+=`\n\n${n.stack}`}if(s){e.emitWarning(new _SassWarning.default(o,n))}else{r.warn(o)}}}}return o}const MODULE_REQUEST_REGEX=/^[^?]*~/;const IS_MODULE_IMPORT=/^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/;function getPossibleRequests(e,t=false,s=false){let r=e;if(t){if(MODULE_REQUEST_REGEX.test(e)){r=r.replace(MODULE_REQUEST_REGEX,"")}if(IS_MODULE_IMPORT.test(e)){r=r[r.length-1]==="/"?r:`${r}/`;return[...new Set([r,e])]}}const n=_path.default.extname(r).toLowerCase();if(n===".css"){return[]}const o=_path.default.dirname(r);const a=o==="."?"":`${o}/`;const i=_path.default.basename(r);const c=_path.default.basename(r,n);return[...new Set([].concat(s?[`${a}_${c}.import${n}`,`${a}${c}.import${n}`]:[]).concat([`${a}_${i}`,`${a}${i}`]).concat(t?[e]:[]))]}function promiseResolve(e){return(t,s)=>new Promise(((r,n)=>{e(t,s,((e,t)=>{if(e){n(e)}else{r(t)}}))}))}const IS_SPECIAL_MODULE_IMPORT=/^~[^/]+$/;const IS_NATIVE_WIN32_PATH=/^[a-z]:[/\\]|^\\\\/i;function getWebpackResolver(e,t,s=[]){async function startResolving(e){if(e.length===0){return Promise.reject()}const[{possibleRequests:t}]=e;if(t.length===0){return Promise.reject()}const[{resolve:s,context:r}]=e;try{return await s(r,t[0])}catch(s){const[,...r]=t;if(r.length===0){const[,...t]=e;return startResolving(t)}e[0].possibleRequests=r;return startResolving(e)}}const r=t.info.includes("dart-sass");const n=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const o=promiseResolve(e({alias:[],aliasFields:[],conditionNames:[],descriptionFiles:[],extensions:[".sass",".scss",".css"],exportsFields:[],mainFields:[],mainFiles:["_index.import","_index","index.import","index"],modules:[],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const a=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style"],mainFields:["sass","style","main","..."],mainFiles:["_index","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));const i=promiseResolve(e({dependencyType:"sass",conditionNames:["sass","style"],mainFields:["sass","style","main","..."],mainFiles:["_index.import","_index","index.import","index","..."],extensions:[".sass",".scss",".css"],restrictions:[/\.((sa|sc|c)ss)$/i],preferRelative:true}));return(e,t,c)=>{if(!r&&!_path.default.isAbsolute(e)){return Promise.reject()}const l=t;const u=l.slice(0,5).toLowerCase()==="file:";if(u){try{t=_url.default.fileURLToPath(l)}catch(e){t=t.slice(7)}}let p=[];const f=!IS_SPECIAL_MODULE_IMPORT.test(t)&&!u&&!l.startsWith("/")&&!IS_NATIVE_WIN32_PATH.test(l);if(s.length>0&&f){const a=getPossibleRequests(t,false,c);if(!r){p=p.concat({resolve:c?o:n,context:_path.default.dirname(e),possibleRequests:a})}p=p.concat(s.map((e=>({resolve:c?o:n,context:e,possibleRequests:a}))))}const _=getPossibleRequests(t,true,c);p=p.concat({resolve:c?i:a,context:_path.default.dirname(e),possibleRequests:_});return startResolving(p)}}const MATCH_CSS=/\.css$/i;function getWebpackImporter(e,t,s){const r=getWebpackResolver(e.getResolve,t,s);return function importer(t,s,n){const{fromImport:o}=this;r(s,t,o).then((t=>{e.addDependency(_path.default.normalize(t));n({file:t.replace(MATCH_CSS,"")})})).catch((()=>{n({file:t})}))}}let nodeSassJobQueue=null;function getRenderFunctionFromSassImplementation(e){const t=e.info.includes("dart-sass");if(t){return e.render.bind(e)}if(nodeSassJobQueue===null){const t=Number(process.env.UV_THREADPOOL_SIZE||4);nodeSassJobQueue=_neoAsync.default.queue(e.render.bind(e),t-1)}return nodeSassJobQueue.push.bind(nodeSassJobQueue)}const ABSOLUTE_SCHEME=/^[A-Za-z0-9+\-.]+:/;function getURLType(e){if(e[0]==="/"){if(e[1]==="/"){return"scheme-relative"}return"path-absolute"}if(IS_NATIVE_WIN32_PATH.test(e)){return"path-absolute"}return ABSOLUTE_SCHEME.test(e)?"absolute":"path-relative"}function normalizeSourceMap(e,t){const s=e;delete s.file;s.sourceRoot="";s.sources=s.sources.map((e=>{const s=getURLType(e);if(s==="path-relative"){return _path.default.resolve(t,_path.default.normalize(e))}return e}));return s}},684:function(e){function webpackEmptyContext(e){var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}webpackEmptyContext.keys=function(){return[]};webpackEmptyContext.resolve=webpackEmptyContext;webpackEmptyContext.id=684;e.exports=webpackEmptyContext},175:function(e){"use strict";e.exports=require("next/dist/compiled/neo-async")},17:function(e){"use strict";e.exports=require("path")},438:function(e){"use strict";e.exports=require("sass")},310:function(e){"use strict";e.exports=require("url")},596:function(e){"use strict";e.exports=JSON.parse('{"title":"Sass Loader options","type":"object","properties":{"implementation":{"description":"The implementation of the sass to be used.","link":"https://github.com/webpack-contrib/sass-loader#implementation","anyOf":[{"type":"string"},{"type":"object"}]},"sassOptions":{"description":"Options for `node-sass` or `sass` (`Dart Sass`) implementation.","link":"https://github.com/webpack-contrib/sass-loader#sassoptions","anyOf":[{"type":"object","additionalProperties":true},{"instanceof":"Function"}]},"additionalData":{"description":"Prepends/Appends `Sass`/`SCSS` code before the actual entry file.","link":"https://github.com/webpack-contrib/sass-loader#additionaldata","anyOf":[{"type":"string"},{"instanceof":"Function"}]},"sourceMap":{"description":"Enables/Disables generation of source maps.","link":"https://github.com/webpack-contrib/sass-loader#sourcemap","type":"boolean"},"webpackImporter":{"description":"Enables/Disables default `webpack` importer.","link":"https://github.com/webpack-contrib/sass-loader#webpackimporter","type":"boolean"},"warnRuleAsWarning":{"description":"Treats the \'@warn\' rule as a webpack warning.","link":"https://github.com/webpack-contrib/sass-loader#warnruleaswarning","type":"boolean"}},"additionalProperties":false}')}};var __webpack_module_cache__={};function __nccwpck_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var s=__webpack_module_cache__[e]={exports:{}};var r=true;try{__webpack_modules__[e](s,s.exports,__nccwpck_require__);r=false}finally{if(r)delete __webpack_module_cache__[e]}return s.exports}!function(){__nccwpck_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(917);module.exports=__webpack_exports__})(); \ No newline at end of file From b03853513cf8f32944d67361e413104e8a4c6fd3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 19:55:38 +0200 Subject: [PATCH 036/101] fix router externals --- .../next/src/server/future/route-modules/app-page/externals.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts index ce26d1af2da4e..af90b60b3ad1f 100644 --- a/packages/next/src/server/future/route-modules/app-page/externals.ts +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -1,2 +1,4 @@ export * as headManagerContext from '../../../../shared/lib/head-manager-context.external' export * as serverInsertedHtml from '../../../../shared/lib/server-inserted-html.external' +export * as appRouterContext from '../../../../shared/lib/app-router-context.external' +export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' From 212ff0eb9cfa67880423ea1389e3fb68e468fd67 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 20:42:45 +0200 Subject: [PATCH 037/101] add other ctx --- .../src/server/future/route-modules/app-page/externals.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts index af90b60b3ad1f..730d139796eb7 100644 --- a/packages/next/src/server/future/route-modules/app-page/externals.ts +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -1,4 +1,12 @@ +// the name of the export has to be the camelCase version of the file name (without the extension) export * as headManagerContext from '../../../../shared/lib/head-manager-context.external' export * as serverInsertedHtml from '../../../../shared/lib/server-inserted-html.external' export * as appRouterContext from '../../../../shared/lib/app-router-context.external' export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' +export * as routerContext from '../../../../shared/lib/router-context.external' +export * as htmlContext from '../../../../shared/lib/html-context.external' +export * as ampContext from '../../../../shared/lib/amp-context.external' +export * as adapters from '../../../../shared/lib/router/adapters.external' +export * as loadableContext from '../../../../shared/lib/loadable-context.external' +export * as imageConfigContext from '../../../../shared/lib/image-config-context.external' +export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' From 4c3c7b6712c14cec8e78d627495d843a413dadb4 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 24 Jul 2023 20:51:47 +0200 Subject: [PATCH 038/101] support turbo --- .../next-swc/crates/next-core/js/src/entry/app-renderer.tsx | 5 ++++- .../crates/next-core/js/src/internal/page-server-handler.tsx | 5 ++++- packages/next/src/export/worker.ts | 5 +++-- .../next/src/server/future/route-modules/app-page/module.ts | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index 8ff083e4089ca..39041d083adbb 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -9,7 +9,6 @@ import type { IncomingMessage } from 'node:http' import type { RenderData } from 'types/turbopack' import type { RenderOpts } from 'next/dist/server/app-render/types' -import { renderToHTMLOrFlight } from 'next/dist/server/app-render/app-render' import { RSC_VARY_HEADER } from 'next/dist/client/components/app-router-headers' import { headersFromEntries, initProxiedHeaders } from '../internal/headers' import { parse, ParsedUrlQuery } from 'node:querystring' @@ -23,6 +22,10 @@ import { join } from 'node:path' import { nodeFs } from 'next/dist/server/lib/node-fs-methods' import { IncrementalCache } from 'next/dist/server/lib/incremental-cache' +const { + renderToHTMLOrFlight, +} = require('next/dist/compiled/minimal-next-server/app-page-render.runtime') + installRequireAndChunkLoad() process.env.__NEXT_NEW_LINK_BEHAVIOR = 'true' diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index 6182b2d7d4539..8dc4ddbd81c8a 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -7,7 +7,7 @@ import './shims' import type { IncomingMessage, ServerResponse } from 'node:http' -import { renderToHTML, RenderOpts } from 'next/dist/server/render' +import { RenderOpts } from 'next/dist/server/render' import { getRedirectStatus } from 'next/dist/lib/redirect-status' import { PERMANENT_REDIRECT_STATUS } from 'next/dist/shared/lib/constants' import { buildStaticPaths } from 'next/dist/build/utils' @@ -21,6 +21,9 @@ import type { RenderData } from 'types/turbopack' import type { ChunkGroup } from 'types/next' import type { NextComponentType } from 'next/types' import { parse } from 'node:querystring' +const { + renderToHTML, +} = require('next/dist/compiled/minimal-next-server/pages-render.runtime') const ipc = IPC as Ipc diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index 80c5af5467fbf..85856686b1737 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -486,8 +486,9 @@ export default async function exportPage({ results.fromBuildExportRevalidate = 0 } } else { - const { renderToHTMLOrFlight } = - require('../server/app-render/app-render') as typeof import('../server/app-render/app-render') + const renderToHTMLOrFlight = + require('next/dist/compiled/minimal-next-server/app-page-render.runtime') + .renderToHTMLOrFlight as typeof import('../server/app-render/app-render').renderToHTMLOrFlight try { curRenderOpts.params ||= {} diff --git a/packages/next/src/server/future/route-modules/app-page/module.ts b/packages/next/src/server/future/route-modules/app-page/module.ts index d4aba114ef312..cbad484f8ba3f 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.ts @@ -56,4 +56,6 @@ export class AppPageRouteModule extends RouteModule< } } +export { renderToHTMLOrFlight } + export default AppPageRouteModule From 2c41c43792e5e81d7aebf016d4a509de3251bd50 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 25 Jul 2023 11:57:38 +0200 Subject: [PATCH 039/101] yet another monkey patch --- .../next/src/server/lib/server-ipc/index.ts | 1 + packages/next/src/server/require-hook.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/next/src/server/lib/server-ipc/index.ts b/packages/next/src/server/lib/server-ipc/index.ts index ff61000bb6ab0..72960a4605853 100644 --- a/packages/next/src/server/lib/server-ipc/index.ts +++ b/packages/next/src/server/lib/server-ipc/index.ts @@ -112,6 +112,7 @@ export const createWorker = async ( __NEXT_PRIVATE_STANDALONE_CONFIG: process.env.__NEXT_PRIVATE_STANDALONE_CONFIG, NODE_ENV: process.env.NODE_ENV, + __NEXT_PRIVATE_RENDER_RUNTIME: type, ...(type === 'app' ? { __NEXT_PRIVATE_PREBUNDLED_REACT: useServerActions diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 146cbd89c87d4..f94740d6d5c3b 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -2,11 +2,14 @@ // This is needed for userland plugins to attach to the same webpack instance as Next.js'. // Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*. +import path from 'path' + // This module will only be loaded once per process. const { dirname } = require('path') const mod = require('module') const resolveFilename = mod._resolveFilename +const originalRequire = mod.prototype.require const hookPropertyMap = new Map() let aliasedPrebundledReact = false @@ -24,6 +27,11 @@ export const defaultOverrides = { 'styled-jsx/style': resolve('styled-jsx/style'), } +const currentRuntime = + process.env.__NEXT_PRIVATE_RENDER_RUNTIME === 'pages' + ? 'next/dist/compiled/minimal-next-server/pages-render.runtime' + : 'next/dist/compiled/minimal-next-server/app-page-render.runtime' + export const baseOverrides = { react: 'next/dist/compiled/react', 'react/package.json': 'next/dist/compiled/react/package.json', @@ -116,3 +124,16 @@ mod._resolveFilename = function ( // We use `bind` here to avoid referencing outside variables to create potential memory leaks. }.bind(null, resolveFilename, hookPropertyMap) + +mod.prototype.require = function (request: string) { + if (process.env.__NEXT_PRIVATE_RENDER_RUNTIME) { + if (request.endsWith('.external') && request.startsWith('.')) { + const base = path.basename(request, '.external') + const camelized = base.replace(/-([a-z])/g, (g) => g[1].toUpperCase()) + const instance = originalRequire.call(this, currentRuntime) + return instance.default.externals[camelized] + } + } + + return originalRequire.call(this, request) +} From a02418aeeeaca69718768572b02802988ba09a1e Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 25 Jul 2023 13:18:14 +0200 Subject: [PATCH 040/101] fix dynamic --- .../next/src/server/future/route-modules/app-page/externals.ts | 1 + .../next/src/server/future/route-modules/pages/externals.ts | 1 + packages/next/src/server/render.tsx | 2 +- packages/next/src/shared/lib/dynamic.tsx | 2 +- .../next/src/shared/lib/{loadable.tsx => loadable.external.tsx} | 0 5 files changed, 4 insertions(+), 2 deletions(-) rename packages/next/src/shared/lib/{loadable.tsx => loadable.external.tsx} (100%) diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts index 730d139796eb7..2a1a68349f5d2 100644 --- a/packages/next/src/server/future/route-modules/app-page/externals.ts +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -10,3 +10,4 @@ export * as adapters from '../../../../shared/lib/router/adapters.external' export * as loadableContext from '../../../../shared/lib/loadable-context.external' export * as imageConfigContext from '../../../../shared/lib/image-config-context.external' export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' +export * as loadable from '../../../../shared/lib/loadable.external' diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts index 5bd56a4647813..c77e147898bce 100644 --- a/packages/next/src/server/future/route-modules/pages/externals.ts +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -9,3 +9,4 @@ export * as appRouterContext from '../../../../shared/lib/app-router-context.ext export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' export * as imageConfigContext from '../../../../shared/lib/image-config-context.external' export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' +export * as loadable from '../../../../shared/lib/loadable.external' diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index 70b0fa811eec0..fab3eb5280c45 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -55,7 +55,7 @@ import { isInAmpMode } from '../shared/lib/amp-mode' import { AmpStateContext } from '../shared/lib/amp-context.external' import { defaultHead } from '../shared/lib/head' import { HeadManagerContext } from '../shared/lib/head-manager-context.external' -import Loadable from '../shared/lib/loadable' +import Loadable from '../shared/lib/loadable.external' import { LoadableContext } from '../shared/lib/loadable-context.external' import { RouterContext } from '../shared/lib/router-context.external' import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic' diff --git a/packages/next/src/shared/lib/dynamic.tsx b/packages/next/src/shared/lib/dynamic.tsx index cb497fc587d4f..178080f10a7b8 100644 --- a/packages/next/src/shared/lib/dynamic.tsx +++ b/packages/next/src/shared/lib/dynamic.tsx @@ -1,5 +1,5 @@ import React from 'react' -import Loadable from './loadable' +import Loadable from './loadable.external' const isServerSide = typeof window === 'undefined' diff --git a/packages/next/src/shared/lib/loadable.tsx b/packages/next/src/shared/lib/loadable.external.tsx similarity index 100% rename from packages/next/src/shared/lib/loadable.tsx rename to packages/next/src/shared/lib/loadable.external.tsx From 96a34e7616e1b4f1b1249541afaefbdc2e33e914 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 25 Jul 2023 13:19:44 +0200 Subject: [PATCH 041/101] add type --- packages/next/src/build/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index e0b6922d1243a..2e0e4cc6fc14d 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -1219,6 +1219,7 @@ export default async function build( forkOptions: { env: { ...process.env, + __NEXT_PRIVATE_RENDER_RUNTIME: type, __NEXT_PRIVATE_PREBUNDLED_REACT: type === 'app' ? config.experimental.serverActions From 770f66c45972a6d2f74b2c2d3a8ba2d04280f25e Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 25 Jul 2023 14:30:03 +0200 Subject: [PATCH 042/101] fix access --- packages/next/src/server/require-hook.ts | 2 +- packages/next/taskfile-next-build.js | 3 --- test/e2e/getserversideprops/app/pages/index.js | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index f94740d6d5c3b..28e55a6a9fdc1 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -127,7 +127,7 @@ mod._resolveFilename = function ( mod.prototype.require = function (request: string) { if (process.env.__NEXT_PRIVATE_RENDER_RUNTIME) { - if (request.endsWith('.external') && request.startsWith('.')) { + if (request.endsWith('.external')) { const base = path.basename(request, '.external') const camelized = base.replace(/-([a-z])/g, (g) => g[1].toUpperCase()) const instance = originalRequire.call(this, currentRuntime) diff --git a/packages/next/taskfile-next-build.js b/packages/next/taskfile-next-build.js index 65acec9c328d4..5da649b4a878c 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/taskfile-next-build.js @@ -42,9 +42,6 @@ const externalsMap = { } const externalHandler = ({ context, request }, callback) => { - if (/(.*)shared\/lib\/runtime-config.external/.test(request)) { - return callback(null, 'next/dist/shared/lib/runtime-config.external') - } callback() } diff --git a/test/e2e/getserversideprops/app/pages/index.js b/test/e2e/getserversideprops/app/pages/index.js index 4433c9c2ee84e..80dea3fa51dde 100644 --- a/test/e2e/getserversideprops/app/pages/index.js +++ b/test/e2e/getserversideprops/app/pages/index.js @@ -1,6 +1,6 @@ import Link from 'next/link' import ReactDOM from 'react-dom/server' -import { RouterContext } from 'next/dist/shared/lib/router-context' +import { RouterContext } from 'next/dist/shared/lib/router-context.external' import { useRouter } from 'next/router' function RouterComp(props) { From d2d0541aeac2bfd6db605df10b354862cd18d4e7 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 28 Jul 2023 11:03:15 +0200 Subject: [PATCH 043/101] revert shu's changes --- packages/next/src/build/webpack-config.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 971b6f20b743a..818427d652256 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1445,13 +1445,7 @@ export default async function getBaseWebpackConfig( `${nextDist}${optionalEsmPart}.*${externalFileEnd}` ) - const isNextExternal = - regexPattern.test(localRes) || - // There's no need to bundle the dev overlay - (process.env.NODE_ENV === 'development' && - /next[/\\]dist[/\\](esm[/\\])?client[/\\]components[/\\]react-dev-overlay[/\\]/.test( - localRes - )) + const isNextExternal = regexPattern.test(localRes) if (isNextExternal) { const name = path.parse(localRes).name.replace('.external', '') From ff574344849342b222ac4d03f4f3cf7b0b356e0d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 28 Jul 2023 20:00:25 +0200 Subject: [PATCH 044/101] add require hook to turbo --- packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx | 1 + .../crates/next-core/js/src/internal/page-server-handler.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index 39041d083adbb..53437d9a30eda 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -2,6 +2,7 @@ // the other imports import startOperationStreamHandler from '../internal/operation-stream' +import 'next/dist/server/require-hook.js' import '../polyfill/app-polyfills.ts' import type { IncomingMessage } from 'node:http' diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index 8dc4ddbd81c8a..98282b227c277 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -2,6 +2,7 @@ // the other imports import { IPC } from '@vercel/turbopack-node/ipc/index' +import 'next/dist/server/require-hook.js' import 'next/dist/server/node-polyfill-fetch.js' import './shims' From 5e980bc4c8ccf7c74825d57b59b18c78fa9dd78d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 11:24:00 +0200 Subject: [PATCH 045/101] change strategy --- .../next-core/js/src/entry/app-renderer.tsx | 2 +- .../js/src/internal/page-server-handler.tsx | 2 +- packages/next/package.json | 1 + packages/next/src/build/index.ts | 18 +++-- .../src/build/utils/trace-module/worker.ts | 2 +- packages/next/src/build/webpack-config.ts | 48 ++++++------ .../build/webpack/loaders/next-app-loader.ts | 4 - .../next-route-loader/templates/app-page.ts | 2 +- .../next-route-loader/templates/app-route.ts | 2 +- .../next-route-loader/templates/pages-api.ts | 2 +- .../next-route-loader/templates/pages.ts | 2 +- .../reducers/server-action-reducer.ts | 2 +- packages/next/src/export/worker.ts | 4 +- .../route-modules/app-page/module.compiled.ts | 5 ++ .../app-route/module.compiled.ts | 5 ++ .../pages-api/module.compiled.ts | 5 ++ .../route-modules/pages/module.compiled.ts | 5 ++ packages/next/src/server/require-hook.ts | 7 +- packages/next/taskfile-webpack.js | 29 +++++++ packages/next/taskfile.js | 29 +++++-- ...skfile-next-build.js => webpack.config.js} | 78 ++++++------------- scripts/minimal-server.js | 2 +- 22 files changed, 146 insertions(+), 110 deletions(-) create mode 100644 packages/next/src/server/future/route-modules/app-page/module.compiled.ts create mode 100644 packages/next/src/server/future/route-modules/app-route/module.compiled.ts create mode 100644 packages/next/src/server/future/route-modules/pages-api/module.compiled.ts create mode 100644 packages/next/src/server/future/route-modules/pages/module.compiled.ts create mode 100644 packages/next/taskfile-webpack.js rename packages/next/{taskfile-next-build.js => webpack.config.js} (65%) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index 53437d9a30eda..73a97a1a65001 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -25,7 +25,7 @@ import { IncrementalCache } from 'next/dist/server/lib/incremental-cache' const { renderToHTMLOrFlight, -} = require('next/dist/compiled/minimal-next-server/app-page-render.runtime') +} = require('next/dist/compiled/next-server/app-page.runtime.dev') installRequireAndChunkLoad() diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index 98282b227c277..945e77369be08 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -24,7 +24,7 @@ import type { NextComponentType } from 'next/types' import { parse } from 'node:querystring' const { renderToHTML, -} = require('next/dist/compiled/minimal-next-server/pages-render.runtime') +} = require('next/dist/compiled/next-server/pages.runtime.dev') const ipc = IPC as Ipc diff --git a/packages/next/package.json b/packages/next/package.json index d1cabce51957b..5dd4d40853a06 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -77,6 +77,7 @@ }, "taskr": { "requires": [ + "./taskfile-webpack.js", "./taskfile-ncc.js", "./taskfile-swc.js", "./taskfile-watch.js" diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index c52ca51450de9..fa3bcd92cb87e 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -2051,13 +2051,13 @@ export default async function build( require.resolve(override) ), require.resolve( - 'next/dist/compiled/minimal-next-server/server.runtime.js' + 'next/dist/compiled/next-server/server.runtime.prod' ), require.resolve( - 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' + 'next/dist/compiled/next-server/app-page.runtime.prod' ), require.resolve( - 'next/dist/compiled/minimal-next-server/pages-render.runtime.js' + 'next/dist/compiled/next-server/pages.runtime.prod' ), ...(config.experimental.turbotrace ? [] @@ -2089,13 +2089,19 @@ export default async function build( const minimalServerEntries = [ ...sharedEntriesSet, require.resolve( - 'next/dist/compiled/minimal-next-server/server.runtime.js' + 'next/dist/compiled/next-server/server.runtime.prod' ), require.resolve( - 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' + 'next/dist/compiled/next-server/app-page.runtime.prod' ), require.resolve( - 'next/dist/compiled/minimal-next-server/pages-render.runtime.js' + 'next/dist/compiled/next-server/pages.runtime.prod' + ), + require.resolve( + 'next/dist/compiled/next-server/pages-api.runtime.prod' + ), + require.resolve( + 'next/dist/compiled/next-server/app-route.runtime.prod' ), ].filter(Boolean) diff --git a/packages/next/src/build/utils/trace-module/worker.ts b/packages/next/src/build/utils/trace-module/worker.ts index 977f9385ee102..4acd16652b4a8 100644 --- a/packages/next/src/build/utils/trace-module/worker.ts +++ b/packages/next/src/build/utils/trace-module/worker.ts @@ -1,7 +1,7 @@ import { parentPort } from 'worker_threads' // we import it to get all the relevant polyfills in place -require('next/dist/compiled/minimal-next-server/server.runtime.js') +require('next/dist/compiled/next-server/server.runtime.js') const originalCompile = require('module').prototype._compile diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 8fb83195cbd63..e023579c3a7f7 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1305,27 +1305,19 @@ export default async function getBaseWebpackConfig( resolveRequest: string ) => Promise<[string | null, boolean]> ) { - if ( - request.includes( - 'dist/compiled/minimal-next-server/app-page-render.runtime.js' - ) - ) { - return `next/dist/compiled/minimal-next-server/app-page-render.runtime.js` - } + // if ( + // request.includes('dist/compiled/next-server/app-page-render.runtime.js') + // ) { + // return `next/dist/compiled/next-server/app-page-render.runtime.js` + // } - if ( - request.includes( - 'dist/compiled/minimal-next-server/pages-render.runtime.js' - ) - ) { - return `next/dist/compiled/minimal-next-server/pages-render.runtime.js` - } + // if (request.includes('dist/compiled/next-server/pages-render.runtime.js')) { + // return `next/dist/compiled/next-server/pages-render.runtime.js` + // } - if ( - request.includes('dist/compiled/minimal-next-server/pages-api.runtime.js') - ) { - return `next/dist/compiled/minimal-next-server/pages-api.runtime.js` - } + // if (request.includes('dist/compiled/next-server/pages-api.runtime.js')) { + // return `next/dist/compiled/next-server/pages-api.runtime.js` + // } // We need to externalize internal requests for files intended to // not be bundled. @@ -1450,6 +1442,10 @@ export default async function getBaseWebpackConfig( const isNextExternal = regexPattern.test(localRes) if (isNextExternal) { + if (dev) { + return `commonjs ${localRes}` + } + const name = path.parse(localRes).name.replace('.external', '') const camelCaseName = name.replace(/-([a-z])/g, (_, w) => w.toUpperCase() @@ -1472,16 +1468,18 @@ export default async function getBaseWebpackConfig( // if (isAppLayer) { // // todo // } else { + return [ 'commonjs ' + path.posix.join( 'next', 'dist', 'compiled', - 'minimal-next-server', - isAppLayer - ? 'app-page-render.runtime.js' - : 'pages-render.runtime.js' + 'next-server', + // TODO: check if externals can happen for app routes or API routes + `${isAppLayer ? 'app-page' : 'pages'}.runtime.${ + dev ? 'dev' : 'prod' + }` ), 'default', 'externals', @@ -1508,6 +1506,10 @@ export default async function getBaseWebpackConfig( return } + if (/^next\/dist\/compiled\/next-server/.test(request)) { + return `commonjs ${request}` + } + if ( /^next\/dist\/shared\/(?!lib\/router\/router)/.test(request) || /^next\/dist\/compiled\/.*\.c?js$/.test(request) diff --git a/packages/next/src/build/webpack/loaders/next-app-loader.ts b/packages/next/src/build/webpack/loaders/next-app-loader.ts index 31b2e184f9a12..9fb2ed44702cd 100644 --- a/packages/next/src/build/webpack/loaders/next-app-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-app-loader.ts @@ -625,10 +625,6 @@ const nextAppLoader: AppLoader = async function nextAppLoader() { const pathname = new AppPathnameNormalizer().normalize(page) - const routeModulePath = isEdge - ? 'next/dist/server/future/route-modules/app-page/module' - : 'next/dist/compiled/minimal-next-server/app-page-render.runtime.js' - // Prefer to modify next/src/server/app-render/entry-base.ts since this is shared with Turbopack. // Any changes to this code should be reflected in Turbopack's app_source.rs and/or app-renderer.tsx as well. return await loadEntrypoint( diff --git a/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-page.ts b/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-page.ts index a2fce12623e8e..b2a3e867b7632 100644 --- a/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-page.ts +++ b/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-page.ts @@ -1,7 +1,7 @@ import type { LoaderTree } from '../../../../../server/lib/app-dir-module' // @ts-ignore this need to be imported from next/dist to be external -import * as module from 'next/dist/server/future/route-modules/app-page/module' +import * as module from 'next/dist/server/future/route-modules/app-page/module.compiled' import { RouteKind } from '../../../../../server/future/route-kind' const AppPageRouteModule = diff --git a/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-route.ts b/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-route.ts index 7ad4211899fd0..6e353076d0209 100644 --- a/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-route.ts +++ b/packages/next/src/build/webpack/loaders/next-route-loader/templates/app-route.ts @@ -1,7 +1,7 @@ import '../../../../../server/node-polyfill-headers' // @ts-ignore this need to be imported from next/dist to be external -import * as module from 'next/dist/server/future/route-modules/app-route/module' +import * as module from 'next/dist/server/future/route-modules/app-route/module.compiled' import type { AppRouteRouteModuleOptions } from '../../../../../server/future/route-modules/app-route/module' import { RouteKind } from '../../../../../server/future/route-kind' diff --git a/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages-api.ts b/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages-api.ts index d566f35fe99d7..de81b8c569323 100644 --- a/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages-api.ts +++ b/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages-api.ts @@ -1,5 +1,5 @@ // @ts-ignore this need to be imported from next/dist to be external -import * as module from 'next/dist/server/future/route-modules/pages-api/module' +import * as module from 'next/dist/server/future/route-modules/pages-api/module.compiled' import { RouteKind } from '../../../../../server/future/route-kind' import { hoist } from '../helpers' diff --git a/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages.ts b/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages.ts index 6b9dd0ee0f0cc..40df5fcae4dc6 100644 --- a/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages.ts +++ b/packages/next/src/build/webpack/loaders/next-route-loader/templates/pages.ts @@ -1,5 +1,5 @@ // @ts-ignore this need to be imported from next/dist to be external -import * as module from 'next/dist/server/future/route-modules/pages/module' +import * as module from 'next/dist/server/future/route-modules/pages/module.compiled' import { RouteKind } from '../../../../../server/future/route-kind' import { hoist } from '../helpers' diff --git a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts index dc130b1c70f14..3f33189b77e28 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts @@ -26,7 +26,7 @@ import { createHrefFromUrl } from '../create-href-from-url' import { handleExternalUrl } from './navigate-reducer' import { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree' import { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout' -import { CacheStates } from '../../../../shared/lib/app-router-context' +import { CacheStates } from '../../../../shared/lib/app-router-context.external' import { handleMutable } from '../handle-mutable' import { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head' diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index 83cc9d60e4a25..40237ae171d3b 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -299,7 +299,7 @@ export default async function exportPage({ let renderResult: RenderResult | undefined let curRenderOpts: RenderOpts = {} const renderToHTML = - require('next/dist/compiled/minimal-next-server/pages-render.runtime') + require('../server/future/route-modules/pages/module.compiled') .renderToHTML as typeof import('../server/render').renderToHTML let renderMethod = renderToHTML @@ -491,7 +491,7 @@ export default async function exportPage({ } } else { const renderToHTMLOrFlight = - require('next/dist/compiled/minimal-next-server/app-page-render.runtime') + require('../server/future/route-modules/app-page/module.compiled') .renderToHTMLOrFlight as typeof import('../server/app-render/app-render').renderToHTMLOrFlight try { diff --git a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts new file mode 100644 index 0000000000000..c762584b621ad --- /dev/null +++ b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts @@ -0,0 +1,5 @@ +if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') +} else { + module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') +} diff --git a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts new file mode 100644 index 0000000000000..bd87dbc4ff5c1 --- /dev/null +++ b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts @@ -0,0 +1,5 @@ +if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') +} else { + module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') +} diff --git a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts new file mode 100644 index 0000000000000..18588d60feee3 --- /dev/null +++ b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts @@ -0,0 +1,5 @@ +if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') +} else { + module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') +} diff --git a/packages/next/src/server/future/route-modules/pages/module.compiled.ts b/packages/next/src/server/future/route-modules/pages/module.compiled.ts new file mode 100644 index 0000000000000..2263623164c1b --- /dev/null +++ b/packages/next/src/server/future/route-modules/pages/module.compiled.ts @@ -0,0 +1,5 @@ +if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') +} else { + module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') +} diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 28e55a6a9fdc1..04a9905666405 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -27,10 +27,11 @@ export const defaultOverrides = { 'styled-jsx/style': resolve('styled-jsx/style'), } -const currentRuntime = +const currentRuntime = `${ process.env.__NEXT_PRIVATE_RENDER_RUNTIME === 'pages' - ? 'next/dist/compiled/minimal-next-server/pages-render.runtime' - : 'next/dist/compiled/minimal-next-server/app-page-render.runtime' + ? 'next/dist/compiled/next-server/pages.runtime' + : 'next/dist/compiled/next-server/app-page.runtime' +}.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}` export const baseOverrides = { react: 'next/dist/compiled/react', diff --git a/packages/next/taskfile-webpack.js b/packages/next/taskfile-webpack.js new file mode 100644 index 0000000000000..bcf713df440c1 --- /dev/null +++ b/packages/next/taskfile-webpack.js @@ -0,0 +1,29 @@ +const webpack = require('webpack') + +module.exports = function (task) { + task.plugin('webpack', {}, function* (_, options) { + options = options || {} + + const compiler = webpack(options.config) + + if (options.watch) { + compiler.watch({}, (err, stats) => { + if (err || stats.hasErrors()) { + console.error(err || stats.toString()) + } else { + console.log(`${options.name} compiled successfully.`) + } + }) + } else { + yield new Promise((resolve, reject) => { + compiler.run((err, stats) => { + if (err || stats.hasErrors()) { + console.error(err || stats.toString()) + reject(err || stats.toString()) + } + resolve() + }) + }) + } + }) +} diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 30b883b9b9285..60b2ec0ba4247 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -5,7 +5,6 @@ const glob = require('glob') const fs = require('fs-extra') // eslint-disable-next-line import/no-extraneous-dependencies const resolveFrom = require('resolve-from') -const { buildNextServer } = require('./taskfile-next-build') export async function next__polyfill_nomodule(task, opts) { await task @@ -2384,7 +2383,7 @@ export async function next_compile(task, opts) { } export async function compile(task, opts) { - await task.serial(['next_compile', 'next_minimal_compile']) + await task.serial(['next_compile', 'next_bundle'], opts) await task.serial([ 'ncc_react_refresh_utils', @@ -2648,12 +2647,26 @@ export async function release(task) { await task.clear('dist').start('build') } -export async function minimal_next_server(task) { - await task - .watch('src/', 'minimal_next_server_build') - .target('dist/compiled/minimal-next-server') +export async function next_bundle_prod(task, opts) { + await task.source('dist').webpack({ + watch: opts.dev, + config: require('./webpack.config')({ + dev: false, + }), + name: 'next-bundle-prod', + }) +} + +export async function next_bundle_dev(task, opts) { + await task.source('dist').webpack({ + watch: opts.dev, + config: require('./webpack.config')({ + dev: true, + }), + name: 'next-bundle-dev', + }) } -export async function next_minimal_compile(task) { - await buildNextServer() +export async function next_bundle(task, opts) { + await task.parallel(['next_bundle_prod', 'next_bundle_dev'], opts) } diff --git a/packages/next/taskfile-next-build.js b/packages/next/webpack.config.js similarity index 65% rename from packages/next/taskfile-next-build.js rename to packages/next/webpack.config.js index 5da649b4a878c..b0b0fead888eb 100644 --- a/packages/next/taskfile-next-build.js +++ b/packages/next/webpack.config.js @@ -1,4 +1,3 @@ -const fs = require('fs').promises const webpack = require('webpack') const path = require('path') const TerserPlugin = require('terser-webpack-plugin') @@ -41,26 +40,28 @@ const externalsMap = { './web/sandbox': 'next/dist/server/web/sandbox', } -const externalHandler = ({ context, request }, callback) => { - callback() -} +module.exports = ({ dev }) => { + const externalHandler = ({ context, request }, callback) => { + if (dev && request.endsWith('.external')) { + return callback(null, `commonjs ${request}`) + } -async function buildNextServer(task) { - // cleanup old files - await fs.rm(path.join(__dirname, 'dist/compiled/minimal-next-server'), { - recursive: true, - force: true, - }) + callback() + } /** @type {webpack.Configuration} */ - const config = { + return { entry: { server: path.join(__dirname, 'dist/esm/server/next-server.js'), - 'app-page-render': path.join( + 'app-page': path.join( __dirname, 'dist/esm/server/future/route-modules/app-page/module.js' ), - 'pages-render': path.join( + 'app-route': path.join( + __dirname, + 'dist/esm/server/future/route-modules/app-route/module.js' + ), + pages: path.join( __dirname, 'dist/esm/server/future/route-modules/pages/module.js' ), @@ -72,15 +73,13 @@ async function buildNextServer(task) { target: 'node', mode: 'production', output: { - path: path.join(__dirname, 'dist/compiled/minimal-next-server'), - filename: '[name].runtime.js', + path: path.join(__dirname, 'dist/compiled/next-server'), + filename: `[name].runtime.${dev ? 'dev' : 'prod'}.js`, libraryTarget: 'commonjs2', }, - // left in for debugging optimization: { - // moduleIds: 'named', - minimize: false, - // minimize: true, + moduleIds: 'named', + minimize: true, // splitChunks: { // chunks: 'all', // }, @@ -101,50 +100,19 @@ async function buildNextServer(task) { }, plugins: [ new webpack.DefinePlugin({ - 'this.minimalMode': JSON.stringify(true), - 'this.renderOpts.dev': JSON.stringify(false), - 'process.env.NODE_ENV': JSON.stringify('production'), 'process.env.NEXT_MINIMAL': JSON.stringify('true'), + 'this.minimalMode': JSON.stringify(true), + 'this.renderOpts.dev': JSON.stringify(dev), + 'process.env.NODE_ENV': JSON.stringify( + dev ? 'development' : 'production' + ), 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), }), !!process.env.ANALYZE && new BundleAnalyzerPlugin({}), ].filter(Boolean), stats: { - // Display bailout reasons optimizationBailout: true, }, externals: [...minimalExternals, externalsMap, externalHandler], } - - await new Promise((resolve, reject) => { - webpack(config, (err, stats) => { - if (err) return reject(err) - if (stats.hasErrors()) { - return reject(new Error(stats.toString('errors-only'))) - } else { - fs.writeFile( - path.join( - __dirname, - 'dist/compiled/minimal-next-server', - 'stats.json' - ), - JSON.stringify(stats.toJson()), - 'utf8' - ) - return resolve() - } - }) - }) - - return -} - -module.exports = { - buildNextServer, -} - -if (require.main === module) { - buildNextServer().then(() => { - console.log('Success!') - }) } diff --git a/scripts/minimal-server.js b/scripts/minimal-server.js index 0c229edf63422..08f9125a4f0cc 100644 --- a/scripts/minimal-server.js +++ b/scripts/minimal-server.js @@ -59,7 +59,7 @@ if (process.env.LOG_READFILE) { console.time('next-cold-start') const NextServer = process.env.USE_BUNDLED_NEXT - ? require('next/dist/compiled/minimal-next-server/server.runtime').default + ? require('next/dist/compiled/next-server/server.runtime.prod').default : require('next/dist/server/next-server').default if (process.env.LOG_READFILE) { From 292944b1b4aacb91c6adcab0cea650b00b890f62 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 12:45:18 +0200 Subject: [PATCH 046/101] disable monkey patching in dev --- packages/next/src/server/require-hook.ts | 5 ++++- packages/next/webpack.config.js | 22 +++++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 04a9905666405..95b387309d6b6 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -127,7 +127,10 @@ mod._resolveFilename = function ( }.bind(null, resolveFilename, hookPropertyMap) mod.prototype.require = function (request: string) { - if (process.env.__NEXT_PRIVATE_RENDER_RUNTIME) { + if ( + process.env.NODE_ENV === 'production' && + process.env.__NEXT_PRIVATE_RENDER_RUNTIME + ) { if (request.endsWith('.external')) { const base = path.basename(request, '.external') const camelized = base.replace(/-([a-z])/g, (g) => g[1].toUpperCase()) diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index b0b0fead888eb..cd42c64894308 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -41,12 +41,20 @@ const externalsMap = { } module.exports = ({ dev }) => { - const externalHandler = ({ context, request }, callback) => { - if (dev && request.endsWith('.external')) { - return callback(null, `commonjs ${request}`) - } - - callback() + const externalHandler = ({ context, request, getResolve }, callback) => { + ;(async () => { + if (dev && request.endsWith('.external')) { + const resolve = getResolve() + const resolved = await resolve(context, request) + const relative = path.relative( + path.join(__dirname, '..'), + resolved.replace('esm' + path.sep, '') + ) + callback(null, `commonjs ${relative}`) + } else { + callback() + } + })() } /** @type {webpack.Configuration} */ @@ -83,7 +91,7 @@ module.exports = ({ dev }) => { // splitChunks: { // chunks: 'all', // }, - concatenateModules: false, + concatenateModules: true, minimizer: [ new TerserPlugin({ extractComments: false, From 112ef014e0a487789d8d0608b73d688a739fa5bf Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 13:18:31 +0200 Subject: [PATCH 047/101] fix edge --- .../future/route-modules/app-page/module.compiled.ts | 10 ++++++---- .../future/route-modules/app-route/module.compiled.ts | 10 ++++++---- .../future/route-modules/pages-api/module.compiled.ts | 10 ++++++---- .../future/route-modules/pages/module.compiled.ts | 10 ++++++---- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts index c762584b621ad..08fcd723de36e 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts @@ -1,5 +1,7 @@ -if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') -} else { - module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') +if (process.env.NEXT_RUNTIME !== 'edge') { + if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') + } else { + module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') + } } diff --git a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts index bd87dbc4ff5c1..e17cb6c024c44 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts @@ -1,5 +1,7 @@ -if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') -} else { - module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') +if (process.env.NEXT_RUNTIME !== 'edge') { + if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') + } else { + module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') + } } diff --git a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts index 18588d60feee3..2b586e637ab3e 100644 --- a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts @@ -1,5 +1,7 @@ -if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') -} else { - module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') +if (process.env.NEXT_RUNTIME !== 'edge') { + if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') + } else { + module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') + } } diff --git a/packages/next/src/server/future/route-modules/pages/module.compiled.ts b/packages/next/src/server/future/route-modules/pages/module.compiled.ts index 2263623164c1b..ba8dc94d8d1bf 100644 --- a/packages/next/src/server/future/route-modules/pages/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages/module.compiled.ts @@ -1,5 +1,7 @@ -if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') -} else { - module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') +if (process.env.NEXT_RUNTIME !== 'edge') { + if (process.env.NODE_ENV === 'production') { + module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') + } else { + module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') + } } From c073495bff9fbc05b04f162df6c521baccdef275 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 13:43:23 +0200 Subject: [PATCH 048/101] fix edge route module --- .../src/server/future/route-modules/app-page/module.compiled.ts | 2 ++ .../server/future/route-modules/app-route/module.compiled.ts | 2 ++ .../server/future/route-modules/pages-api/module.compiled.ts | 2 ++ .../src/server/future/route-modules/pages/module.compiled.ts | 2 ++ 4 files changed, 8 insertions(+) diff --git a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts index 08fcd723de36e..bd4d20de1f755 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts @@ -4,4 +4,6 @@ if (process.env.NEXT_RUNTIME !== 'edge') { } else { module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') } +} else { + module.exports = require('next/dist/server/future/route-modules/app-page/module.js') } diff --git a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts index e17cb6c024c44..2540b794a54e8 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts @@ -4,4 +4,6 @@ if (process.env.NEXT_RUNTIME !== 'edge') { } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') } +} else { + module.exports = require('next/dist/server/future/route-modules/app-route/module.js') } diff --git a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts index 2b586e637ab3e..8aeafaa2387d8 100644 --- a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts @@ -4,4 +4,6 @@ if (process.env.NEXT_RUNTIME !== 'edge') { } else { module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') } +} else { + module.exports = require('next/dist/server/future/route-modules/pages-api/module.js') } diff --git a/packages/next/src/server/future/route-modules/pages/module.compiled.ts b/packages/next/src/server/future/route-modules/pages/module.compiled.ts index ba8dc94d8d1bf..9d205b618c883 100644 --- a/packages/next/src/server/future/route-modules/pages/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages/module.compiled.ts @@ -4,4 +4,6 @@ if (process.env.NEXT_RUNTIME !== 'edge') { } else { module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') } +} else { + module.exports = require('next/dist/server/future/route-modules/pages/module.js') } From d76592cd2f7c1141ea82267382a6f786bd969fb1 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 15:10:02 +0200 Subject: [PATCH 049/101] rename .external to shared-runtime + add new layer for app routes --- .../next-core/js/src/entry/app/hydrate.tsx | 2 +- packages/next/config.d.ts | 4 +-- packages/next/config.js | 2 +- packages/next/src/build/utils.ts | 17 +++++++++---- packages/next/src/build/webpack-config.ts | 25 +++++++++++++++---- packages/next/src/client/app-index.tsx | 4 +-- packages/next/src/client/compat/router.ts | 2 +- ...=> action-async-storage.shared-runtime.ts} | 0 .../next/src/client/components/app-router.tsx | 6 ++--- .../components/bailout-to-client-rendering.ts | 2 +- .../next/src/client/components/headers.ts | 4 +-- .../src/client/components/layout-router.tsx | 4 +-- .../next/src/client/components/navigation.ts | 8 +++--- .../internal/helpers/use-websocket.ts | 2 +- .../client/components/redirect-boundary.tsx | 2 +- .../next/src/client/components/redirect.ts | 2 +- .../render-from-template-context.tsx | 2 +- ...> request-async-storage.shared-runtime.ts} | 0 .../router-reducer/apply-flight-data.ts | 2 +- .../create-initial-router-state.test.tsx | 2 +- .../create-initial-router-state.ts | 4 +-- .../fill-cache-with-data-property.test.tsx | 2 +- .../fill-cache-with-data-property.ts | 2 +- .../fill-cache-with-new-subtree-data.test.tsx | 2 +- .../fill-cache-with-new-subtree-data.ts | 2 +- ...ll-lazy-items-till-leaf-with-head.test.tsx | 2 +- .../fill-lazy-items-till-leaf-with-head.ts | 2 +- ...te-cache-below-flight-segmentpath.test.tsx | 2 +- ...validate-cache-below-flight-segmentpath.ts | 2 +- .../invalidate-cache-by-router-state.test.tsx | 2 +- .../invalidate-cache-by-router-state.ts | 2 +- .../reducers/find-head-in-cache.test.tsx | 2 +- .../reducers/find-head-in-cache.ts | 2 +- .../reducers/navigate-reducer.test.tsx | 2 +- .../reducers/navigate-reducer.ts | 2 +- .../reducers/prefetch-reducer.test.tsx | 2 +- .../reducers/refresh-reducer.test.tsx | 2 +- .../reducers/refresh-reducer.ts | 2 +- .../reducers/restore-reducer.test.tsx | 2 +- .../reducers/server-action-reducer.ts | 2 +- .../reducers/server-patch-reducer.test.tsx | 2 +- .../router-reducer/router-reducer-types.ts | 2 +- ...eneration-async-storage.shared-runtime.ts} | 0 .../components/static-generation-bailout.ts | 2 +- packages/next/src/client/image-component.tsx | 4 +-- packages/next/src/client/index.tsx | 14 +++++------ packages/next/src/client/legacy/image.tsx | 2 +- packages/next/src/client/link.tsx | 4 +-- packages/next/src/client/router.ts | 2 +- packages/next/src/client/script.tsx | 2 +- packages/next/src/export/worker.ts | 2 +- packages/next/src/pages/_document.tsx | 4 +-- .../src/server/app-render/action-handler.ts | 6 ++--- .../next/src/server/app-render/app-render.tsx | 6 ++--- .../next/src/server/app-render/entry-base.ts | 6 ++--- .../app-render/server-inserted-html.tsx | 2 +- .../request-async-storage-wrapper.ts | 2 +- ...static-generation-async-storage-wrapper.ts | 2 +- packages/next/src/server/base-server.ts | 2 +- .../src/server/dev/static-paths-worker.ts | 9 ++++--- .../route-modules/app-page/externals.ts | 24 +++++++++--------- .../route-modules/app-route/externals.ts | 4 +++ .../future/route-modules/app-route/module.ts | 6 ++--- .../future/route-modules/pages/externals.ts | 22 ++++++++-------- packages/next/src/server/lib/patch-fetch.ts | 2 +- packages/next/src/server/render.tsx | 22 ++++++++-------- packages/next/src/server/require-hook.ts | 4 +-- .../adapters/request-cookies.ts | 2 +- .../web/spec-extension/revalidate-tag.ts | 2 +- .../web/spec-extension/unstable-cache.ts | 2 +- ...ernal.ts => amp-context.shared-runtime.ts} | 0 packages/next/src/shared/lib/amp.ts | 2 +- ...s => app-router-context.shared-runtime.ts} | 0 packages/next/src/shared/lib/dynamic.tsx | 2 +- ...=> head-manager-context.shared-runtime.ts} | 0 packages/next/src/shared/lib/head.tsx | 4 +-- ...=> hooks-client-context.shared-runtime.ts} | 0 ...rnal.ts => html-context.shared-runtime.ts} | 0 ...=> image-config-context.shared-runtime.ts} | 0 ....ts => loadable-context.shared-runtime.ts} | 0 ...ternal.tsx => loadable.shared-runtime.tsx} | 2 +- ...al.ts => router-context.shared-runtime.ts} | 0 ...ternal.tsx => adapters.shared-runtime.tsx} | 4 +-- .../src/shared/lib/router/adapters.test.tsx | 2 +- ...al.ts => runtime-config.shared-runtime.ts} | 0 ...> server-inserted-html.shared-runtime.tsx} | 0 packages/next/src/shared/lib/utils.ts | 2 +- packages/next/webpack.config.js | 2 +- .../e2e/getserversideprops/app/pages/index.js | 2 +- 89 files changed, 175 insertions(+), 146 deletions(-) rename packages/next/src/client/components/{action-async-storage.ts => action-async-storage.shared-runtime.ts} (100%) rename packages/next/src/client/components/{request-async-storage.ts => request-async-storage.shared-runtime.ts} (100%) rename packages/next/src/client/components/{static-generation-async-storage.ts => static-generation-async-storage.shared-runtime.ts} (100%) create mode 100644 packages/next/src/server/future/route-modules/app-route/externals.ts rename packages/next/src/shared/lib/{amp-context.external.ts => amp-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{app-router-context.external.ts => app-router-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{head-manager-context.external.ts => head-manager-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{hooks-client-context.external.ts => hooks-client-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{html-context.external.ts => html-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{image-config-context.external.ts => image-config-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{loadable-context.external.ts => loadable-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{loadable.external.tsx => loadable.shared-runtime.tsx} (99%) rename packages/next/src/shared/lib/{router-context.external.ts => router-context.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/router/{adapters.external.tsx => adapters.shared-runtime.tsx} (97%) rename packages/next/src/shared/lib/{runtime-config.external.ts => runtime-config.shared-runtime.ts} (100%) rename packages/next/src/shared/lib/{server-inserted-html.external.tsx => server-inserted-html.shared-runtime.tsx} (100%) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx b/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx index 70d83e2c982ba..61990e1b8599c 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app/hydrate.tsx @@ -6,7 +6,7 @@ import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-we import { callServer } from 'next/dist/client/app-call-server' import { linkGc } from 'next/dist/client/app-link-gc' -import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context.external' +import { HeadManagerContext } from 'next/dist/shared/lib/head-manager-context.shared-runtime' import { initializeHMR } from '@vercel/turbopack-next/dev/client' diff --git a/packages/next/config.d.ts b/packages/next/config.d.ts index 20c292fb467ef..2da1ee3c4029c 100644 --- a/packages/next/config.d.ts +++ b/packages/next/config.d.ts @@ -1,3 +1,3 @@ -import getConfig from './dist/shared/lib/runtime-config.external' -export * from './dist/shared/lib/runtime-config.external' +import getConfig from './dist/shared/lib/runtime-config.shared-runtime' +export * from './dist/shared/lib/runtime-config.shared-runtime' export default getConfig diff --git a/packages/next/config.js b/packages/next/config.js index 668ee7c54f0e0..6510748638097 100644 --- a/packages/next/config.js +++ b/packages/next/config.js @@ -1 +1 @@ -module.exports = require('./dist/shared/lib/runtime-config.external') +module.exports = require('./dist/shared/lib/runtime-config.shared-runtime') diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index 9ce0cbc9d07d7..b5aae38839fc7 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -14,7 +14,7 @@ import type { EdgeFunctionDefinition, MiddlewareManifest, } from './webpack/plugins/middleware-plugin' -import type { StaticGenerationAsyncStorage } from '../client/components/static-generation-async-storage' +import type { StaticGenerationAsyncStorage } from '../client/components/static-generation-async-storage.shared-runtime' import '../server/require-hook' import '../server/node-polyfill-fetch' @@ -66,7 +66,10 @@ import { nodeFs } from '../server/lib/node-fs-methods' import * as ciEnvironment from '../telemetry/ci-info' import { normalizeAppPath } from '../shared/lib/router/utils/app-paths' import { denormalizeAppPagePath } from '../shared/lib/page-path/denormalize-app-path' -import { AppRouteRouteModule } from '../server/future/route-modules/app-route/module' +// import { AppRouteRouteModule } from '../server/future/route-modules/app-route/module' +const { + AppRouteRouteModule, +} = require('../server/future/route-modules/app-route/module.compiled') export type ROUTER_TYPE = 'pages' | 'app' @@ -1378,7 +1381,7 @@ export async function isPageStatic({ const isPageStaticSpan = trace('is-page-static-utils', parentId) return isPageStaticSpan .traceAsyncFn(async () => { - require('../shared/lib/runtime-config.external').setConfig( + require('../shared/lib/runtime-config.shared-runtime').setConfig( runtimeEnvConfig ) setHttpClientAndAgentOptions({ @@ -1664,7 +1667,9 @@ export async function hasCustomGetInitialProps( runtimeEnvConfig: any, checkingApp: boolean ): Promise { - require('../shared/lib/runtime-config.external').setConfig(runtimeEnvConfig) + require('../shared/lib/runtime-config.shared-runtime').setConfig( + runtimeEnvConfig + ) const components = await loadComponents({ distDir, @@ -1687,7 +1692,9 @@ export async function getDefinedNamedExports( distDir: string, runtimeEnvConfig: any ): Promise> { - require('../shared/lib/runtime-config.external').setConfig(runtimeEnvConfig) + require('../shared/lib/runtime-config.shared-runtime').setConfig( + runtimeEnvConfig + ) const components = await loadComponents({ distDir, pathname: page, diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index e023579c3a7f7..c96aae7cf2d49 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1341,6 +1341,7 @@ export default async function getBaseWebpackConfig( WEBPACK_LAYERS.serverSideRendering, WEBPACK_LAYERS.appPagesBrowser, WEBPACK_LAYERS.actionBrowser, + 'app-route-handler', ].includes(layer!) if ( @@ -1431,7 +1432,7 @@ export default async function getBaseWebpackConfig( const pathSeparators = '[/\\\\]' const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})` - const externalFileEnd = '(\\.external(\\.js)?)$' + const externalFileEnd = '(\\.shared-runtime(\\.js)?)$' const nextDist = `next${pathSeparators}dist` @@ -1446,7 +1447,8 @@ export default async function getBaseWebpackConfig( return `commonjs ${localRes}` } - const name = path.parse(localRes).name.replace('.external', '') + const name = path.parse(localRes).name.replace('.shared-runtime', '') + console.log(layer, name, isAppLayer) const camelCaseName = name.replace(/-([a-z])/g, (_, w) => w.toUpperCase() ) @@ -1469,6 +1471,17 @@ export default async function getBaseWebpackConfig( // // todo // } else { + // app vs pages + // - app + // - pages + // - api + // - app route + const runtime = + layer === 'app-route-handler' + ? 'app-route' + : isAppLayer + ? 'app-page' + : 'pages' return [ 'commonjs ' + path.posix.join( @@ -1477,9 +1490,7 @@ export default async function getBaseWebpackConfig( 'compiled', 'next-server', // TODO: check if externals can happen for app routes or API routes - `${isAppLayer ? 'app-page' : 'pages'}.runtime.${ - dev ? 'dev' : 'prod' - }` + `${runtime}.runtime.${dev ? 'dev' : 'prod'}` ), 'default', 'externals', @@ -2005,6 +2016,10 @@ export default async function getBaseWebpackConfig( rules: [ ...(hasAppDir ? [ + { + layer: 'app-route-handler', + test: /\/route\.(js|ts)x?$/, + }, { // Make sure that AsyncLocalStorage module instance is shared between server and client // layers. diff --git a/packages/next/src/client/app-index.tsx b/packages/next/src/client/app-index.tsx index bb9eb92abc955..47c0bd13f369e 100644 --- a/packages/next/src/client/app-index.tsx +++ b/packages/next/src/client/app-index.tsx @@ -7,8 +7,8 @@ import React, { use } from 'react' // eslint-disable-next-line import/no-extraneous-dependencies import { createFromReadableStream } from 'react-server-dom-webpack/client' -import { HeadManagerContext } from '../shared/lib/head-manager-context.external' -import { GlobalLayoutRouterContext } from '../shared/lib/app-router-context.external' +import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' +import { GlobalLayoutRouterContext } from '../shared/lib/app-router-context.shared-runtime' import onRecoverableError from './on-recoverable-error' import { callServer } from './app-call-server' import { isNextRouterError } from './components/is-next-router-error' diff --git a/packages/next/src/client/compat/router.ts b/packages/next/src/client/compat/router.ts index 72711cb18b1a8..e9143c4117bd7 100644 --- a/packages/next/src/client/compat/router.ts +++ b/packages/next/src/client/compat/router.ts @@ -1,5 +1,5 @@ import { useContext } from 'react' -import { RouterContext } from '../../shared/lib/router-context.external' +import { RouterContext } from '../../shared/lib/router-context.shared-runtime' import { NextRouter } from '../router' /** diff --git a/packages/next/src/client/components/action-async-storage.ts b/packages/next/src/client/components/action-async-storage.shared-runtime.ts similarity index 100% rename from packages/next/src/client/components/action-async-storage.ts rename to packages/next/src/client/components/action-async-storage.shared-runtime.ts diff --git a/packages/next/src/client/components/app-router.tsx b/packages/next/src/client/components/app-router.tsx index 8041d57f0ef4c..78cdd422366b1 100644 --- a/packages/next/src/client/components/app-router.tsx +++ b/packages/next/src/client/components/app-router.tsx @@ -14,11 +14,11 @@ import { LayoutRouterContext, GlobalLayoutRouterContext, CacheStates, -} from '../../shared/lib/app-router-context.external' +} from '../../shared/lib/app-router-context.shared-runtime' import type { CacheNode, AppRouterInstance, -} from '../../shared/lib/app-router-context.external' +} from '../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState, FlightData, @@ -43,7 +43,7 @@ import { createHrefFromUrl } from './router-reducer/create-href-from-url' import { SearchParamsContext, PathnameContext, -} from '../../shared/lib/hooks-client-context.external' +} from '../../shared/lib/hooks-client-context.shared-runtime' import { useReducerWithReduxDevtools } from './use-reducer-with-devtools' import { ErrorBoundary } from './error-boundary' import { diff --git a/packages/next/src/client/components/bailout-to-client-rendering.ts b/packages/next/src/client/components/bailout-to-client-rendering.ts index 76356e05304a8..705e3a0af9708 100644 --- a/packages/next/src/client/components/bailout-to-client-rendering.ts +++ b/packages/next/src/client/components/bailout-to-client-rendering.ts @@ -1,5 +1,5 @@ import { suspense } from '../../shared/lib/lazy-dynamic/dynamic-no-ssr' -import { staticGenerationAsyncStorage } from './static-generation-async-storage' +import { staticGenerationAsyncStorage } from './static-generation-async-storage.shared-runtime' export function bailoutToClientRendering(): boolean | never { const staticGenerationStore = staticGenerationAsyncStorage.getStore() diff --git a/packages/next/src/client/components/headers.ts b/packages/next/src/client/components/headers.ts index 2b239c9b8763f..68c47ed48294a 100644 --- a/packages/next/src/client/components/headers.ts +++ b/packages/next/src/client/components/headers.ts @@ -4,8 +4,8 @@ import { } from '../../server/web/spec-extension/adapters/request-cookies' import { HeadersAdapter } from '../../server/web/spec-extension/adapters/headers' import { RequestCookies } from '../../server/web/spec-extension/cookies' -import { requestAsyncStorage } from './request-async-storage' -import { actionAsyncStorage } from './action-async-storage' +import { requestAsyncStorage } from './request-async-storage.shared-runtime' +import { actionAsyncStorage } from './action-async-storage.shared-runtime' import { staticGenerationBailout } from './static-generation-bailout' import { DraftMode } from './draft-mode' diff --git a/packages/next/src/client/components/layout-router.tsx b/packages/next/src/client/components/layout-router.tsx index 3250e2753af47..8c23e2cc9124e 100644 --- a/packages/next/src/client/components/layout-router.tsx +++ b/packages/next/src/client/components/layout-router.tsx @@ -1,6 +1,6 @@ 'use client' -import type { ChildSegmentMap } from '../../shared/lib/app-router-context.external' +import type { ChildSegmentMap } from '../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState, FlightSegmentPath, @@ -17,7 +17,7 @@ import { LayoutRouterContext, GlobalLayoutRouterContext, TemplateContext, -} from '../../shared/lib/app-router-context.external' +} from '../../shared/lib/app-router-context.shared-runtime' import { fetchServerResponse } from './router-reducer/fetch-server-response' import { createInfinitePromise } from './infinite-promise' import { ErrorBoundary } from './error-boundary' diff --git a/packages/next/src/client/components/navigation.ts b/packages/next/src/client/components/navigation.ts index 0c21d2d8c5258..c28133e3c30c5 100644 --- a/packages/next/src/client/components/navigation.ts +++ b/packages/next/src/client/components/navigation.ts @@ -6,11 +6,11 @@ import { AppRouterContext, GlobalLayoutRouterContext, LayoutRouterContext, -} from '../../shared/lib/app-router-context.external' +} from '../../shared/lib/app-router-context.shared-runtime' import { SearchParamsContext, PathnameContext, -} from '../../shared/lib/hooks-client-context.external' +} from '../../shared/lib/hooks-client-context.shared-runtime' import { clientHookInServerComponentError } from './client-hook-in-server-component-error' import { getSegmentValue } from './router-reducer/reducers/get-segment-value' @@ -111,12 +111,12 @@ export function usePathname(): string { export { ServerInsertedHTMLContext, useServerInsertedHTML, -} from '../../shared/lib/server-inserted-html.external' +} from '../../shared/lib/server-inserted-html.shared-runtime' /** * Get the router methods. For example router.push('/dashboard') */ -export function useRouter(): import('../../shared/lib/app-router-context.external').AppRouterInstance { +export function useRouter(): import('../../shared/lib/app-router-context.shared-runtime').AppRouterInstance { clientHookInServerComponentError('useRouter') const router = useContext(AppRouterContext) if (router === null) { diff --git a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts index 9b7194478cc55..d37fce9851e91 100644 --- a/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts +++ b/packages/next/src/client/components/react-dev-overlay/internal/helpers/use-websocket.ts @@ -1,5 +1,5 @@ import { useCallback, useContext, useEffect, useRef } from 'react' -import { GlobalLayoutRouterContext } from '../../../../../shared/lib/app-router-context.external' +import { GlobalLayoutRouterContext } from '../../../../../shared/lib/app-router-context.shared-runtime' import { getSocketUrl } from './get-socket-url' export function useWebsocket(assetPrefix: string) { diff --git a/packages/next/src/client/components/redirect-boundary.tsx b/packages/next/src/client/components/redirect-boundary.tsx index 1fd5345c76ff1..45cb30c9280ec 100644 --- a/packages/next/src/client/components/redirect-boundary.tsx +++ b/packages/next/src/client/components/redirect-boundary.tsx @@ -1,6 +1,6 @@ 'use client' import React, { useEffect } from 'react' -import { AppRouterInstance } from '../../shared/lib/app-router-context.external' +import { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime' import { useRouter } from './navigation' import { RedirectType, diff --git a/packages/next/src/client/components/redirect.ts b/packages/next/src/client/components/redirect.ts index 5c002a8842277..75dc41d65258a 100644 --- a/packages/next/src/client/components/redirect.ts +++ b/packages/next/src/client/components/redirect.ts @@ -1,4 +1,4 @@ -import { requestAsyncStorage } from './request-async-storage' +import { requestAsyncStorage } from './request-async-storage.shared-runtime' import type { ResponseCookies } from '../../server/web/spec-extension/cookies' const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT' diff --git a/packages/next/src/client/components/render-from-template-context.tsx b/packages/next/src/client/components/render-from-template-context.tsx index 006c158244357..c1755cc5056bf 100644 --- a/packages/next/src/client/components/render-from-template-context.tsx +++ b/packages/next/src/client/components/render-from-template-context.tsx @@ -1,7 +1,7 @@ 'use client' import React, { useContext } from 'react' -import { TemplateContext } from '../../shared/lib/app-router-context.external' +import { TemplateContext } from '../../shared/lib/app-router-context.shared-runtime' export default function RenderFromTemplateContext(): JSX.Element { const children = useContext(TemplateContext) diff --git a/packages/next/src/client/components/request-async-storage.ts b/packages/next/src/client/components/request-async-storage.shared-runtime.ts similarity index 100% rename from packages/next/src/client/components/request-async-storage.ts rename to packages/next/src/client/components/request-async-storage.shared-runtime.ts diff --git a/packages/next/src/client/components/router-reducer/apply-flight-data.ts b/packages/next/src/client/components/router-reducer/apply-flight-data.ts index 36da87fdc399d..003d0a5cde9e4 100644 --- a/packages/next/src/client/components/router-reducer/apply-flight-data.ts +++ b/packages/next/src/client/components/router-reducer/apply-flight-data.ts @@ -1,7 +1,7 @@ import { CacheNode, CacheStates, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import { FlightDataPath } from '../../../server/app-render/types' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx index 93fad634df705..414b553c63249 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.test.tsx @@ -3,7 +3,7 @@ import type { FlightRouterState } from '../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from './create-initial-router-state' const buildId = 'development' diff --git a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts index b0df0d2cf9252..94fdabb9b577a 100644 --- a/packages/next/src/client/components/router-reducer/create-initial-router-state.ts +++ b/packages/next/src/client/components/router-reducer/create-initial-router-state.ts @@ -1,8 +1,8 @@ import type { ReactNode } from 'react' -import type { CacheNode } from '../../../shared/lib/app-router-context.external' +import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState } from '../../../server/app-render/types' -import { CacheStates } from '../../../shared/lib/app-router-context.external' +import { CacheStates } from '../../../shared/lib/app-router-context.shared-runtime' import { createHrefFromUrl } from './create-href-from-url' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' import { extractPathFromFlightRouterState } from './compute-changed-path' diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx index 3f04bc4724852..648069ea76986 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.test.tsx @@ -4,7 +4,7 @@ import { fillCacheWithDataProperty } from './fill-cache-with-data-property' import { CacheStates, CacheNode, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' describe('fillCacheWithDataProperty', () => { it('should add data property', () => { const fetchServerResponseMock: jest.Mock< diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts index 5b45b590a3c6c..42df61a952af5 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-data-property.ts @@ -2,7 +2,7 @@ import { FlightSegmentPath } from '../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import { createRouterCacheKey } from './create-router-cache-key' import { fetchServerResponse } from './fetch-server-response' diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx index b07fe96295d65..ac888a3ede0ff 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.test.tsx @@ -3,7 +3,7 @@ import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' import { CacheStates, CacheNode, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightData } from '../../../server/app-render/types' const getFlightData = (): FlightData => { diff --git a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts index 8f9f4656481ee..7e9a93699fb65 100644 --- a/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts +++ b/packages/next/src/client/components/router-reducer/fill-cache-with-new-subtree-data.ts @@ -1,7 +1,7 @@ import { CacheNode, CacheStates, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightDataPath } from '../../../server/app-render/types' import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state' import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with-head' diff --git a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx index 34e60f882cd9c..1edbeffd7b3e9 100644 --- a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx +++ b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.test.tsx @@ -3,7 +3,7 @@ import { fillLazyItemsTillLeafWithHead } from './fill-lazy-items-till-leaf-with- import { CacheStates, CacheNode, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightData } from '../../../server/app-render/types' const getFlightData = (): FlightData => { diff --git a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts index 9ae8f208e1778..f558edfab2f1e 100644 --- a/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts +++ b/packages/next/src/client/components/router-reducer/fill-lazy-items-till-leaf-with-head.ts @@ -1,7 +1,7 @@ import { CacheNode, CacheStates, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState } from '../../../server/app-render/types' import { createRouterCacheKey } from './create-router-cache-key' diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx index 78fabee27df73..8c23c47d42d74 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.test.tsx @@ -4,7 +4,7 @@ import { invalidateCacheBelowFlightSegmentPath } from './invalidate-cache-below- import { CacheStates, CacheNode, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import { fillCacheWithNewSubTreeData } from './fill-cache-with-new-subtree-data' const getFlightData = (): FlightData => { diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts index 94a126916426a..d637d850b145a 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-below-flight-segmentpath.ts @@ -1,4 +1,4 @@ -import type { CacheNode } from '../../../shared/lib/app-router-context.external' +import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightSegmentPath } from '../../../server/app-render/types' import { createRouterCacheKey } from './create-router-cache-key' diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx index 12d3582c3fec0..bdd819b0614d9 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.test.tsx @@ -3,7 +3,7 @@ import { invalidateCacheByRouterState } from './invalidate-cache-by-router-state import { CacheStates, CacheNode, -} from '../../../shared/lib/app-router-context.external' +} from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState } from '../../../server/app-render/types' describe('invalidateCacheByRouterState', () => { diff --git a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts index 62f2c76edf8f8..1ec39ae9e35fd 100644 --- a/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts +++ b/packages/next/src/client/components/router-reducer/invalidate-cache-by-router-state.ts @@ -1,4 +1,4 @@ -import type { CacheNode } from '../../../shared/lib/app-router-context.external' +import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState } from '../../../server/app-render/types' import { createRouterCacheKey } from './create-router-cache-key' diff --git a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx index 0a909d6632ddc..2d4cdef348b1e 100644 --- a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.test.tsx @@ -3,7 +3,7 @@ import type { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import { findHeadInCache } from './find-head-in-cache' describe('findHeadInCache', () => { diff --git a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts index 724d7ec821e8c..08dcefc65f2ce 100644 --- a/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts +++ b/packages/next/src/client/components/router-reducer/reducers/find-head-in-cache.ts @@ -1,5 +1,5 @@ import type { FlightRouterState } from '../../../../server/app-render/types' -import type { CacheNode } from '../../../../shared/lib/app-router-context.external' +import type { CacheNode } from '../../../../shared/lib/app-router-context.shared-runtime' import { createRouterCacheKey } from '../create-router-cache-key' export function findHeadInCache( diff --git a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx index 0a7e9e8abfaa7..4ed01fed08c83 100644 --- a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.test.tsx @@ -79,7 +79,7 @@ import { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from '../create-initial-router-state' import { NavigateAction, diff --git a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts index cecb811be82f8..04be2e10d4936 100644 --- a/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts @@ -1,7 +1,7 @@ import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState, FlightSegmentPath, diff --git a/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx index 7fc38f87845d5..bbbee6ff5f2a4 100644 --- a/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/prefetch-reducer.test.tsx @@ -36,7 +36,7 @@ import { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from '../create-initial-router-state' import { PrefetchAction, diff --git a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx index 6c26ed511be24..9ed54e8994d2e 100644 --- a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.test.tsx @@ -46,7 +46,7 @@ import { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from '../create-initial-router-state' import { RefreshAction, ACTION_REFRESH } from '../router-reducer-types' import { refreshReducer } from './refresh-reducer' diff --git a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts index 66265ccc986e8..bd6dfc4ef9047 100644 --- a/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/refresh-reducer.ts @@ -11,7 +11,7 @@ import { } from '../router-reducer-types' import { handleExternalUrl } from './navigate-reducer' import { handleMutable } from '../handle-mutable' -import { CacheStates } from '../../../../shared/lib/app-router-context.external' +import { CacheStates } from '../../../../shared/lib/app-router-context.shared-runtime' import { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head' export function refreshReducer( diff --git a/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx index abec7159f65a7..36c978926517f 100644 --- a/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/restore-reducer.test.tsx @@ -3,7 +3,7 @@ import type { FlightRouterState } from '../../../../server/app-render/types' import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from '../create-initial-router-state' import { RestoreAction, ACTION_RESTORE } from '../router-reducer-types' import { restoreReducer } from './restore-reducer' diff --git a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts index 3f33189b77e28..36dd7bff9a101 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts +++ b/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts @@ -26,7 +26,7 @@ import { createHrefFromUrl } from '../create-href-from-url' import { handleExternalUrl } from './navigate-reducer' import { applyRouterStatePatchToTree } from '../apply-router-state-patch-to-tree' import { isNavigatingToNewRootLayout } from '../is-navigating-to-new-root-layout' -import { CacheStates } from '../../../../shared/lib/app-router-context.external' +import { CacheStates } from '../../../../shared/lib/app-router-context.shared-runtime' import { handleMutable } from '../handle-mutable' import { fillLazyItemsTillLeafWithHead } from '../fill-lazy-items-till-leaf-with-head' diff --git a/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx b/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx index a13d5409f05f2..0540c02079cb1 100644 --- a/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx +++ b/packages/next/src/client/components/router-reducer/reducers/server-patch-reducer.test.tsx @@ -41,7 +41,7 @@ jest.mock('../fetch-server-response', () => { import { CacheNode, CacheStates, -} from '../../../../shared/lib/app-router-context.external' +} from '../../../../shared/lib/app-router-context.shared-runtime' import { createInitialRouterState } from '../create-initial-router-state' import { ServerPatchAction, diff --git a/packages/next/src/client/components/router-reducer/router-reducer-types.ts b/packages/next/src/client/components/router-reducer/router-reducer-types.ts index 2ef059b4b03a4..d965b3f0c23e4 100644 --- a/packages/next/src/client/components/router-reducer/router-reducer-types.ts +++ b/packages/next/src/client/components/router-reducer/router-reducer-types.ts @@ -1,4 +1,4 @@ -import type { CacheNode } from '../../../shared/lib/app-router-context.external' +import type { CacheNode } from '../../../shared/lib/app-router-context.shared-runtime' import type { FlightRouterState, FlightData, diff --git a/packages/next/src/client/components/static-generation-async-storage.ts b/packages/next/src/client/components/static-generation-async-storage.shared-runtime.ts similarity index 100% rename from packages/next/src/client/components/static-generation-async-storage.ts rename to packages/next/src/client/components/static-generation-async-storage.shared-runtime.ts diff --git a/packages/next/src/client/components/static-generation-bailout.ts b/packages/next/src/client/components/static-generation-bailout.ts index 8f6b63f7c2295..deb5778baa60e 100644 --- a/packages/next/src/client/components/static-generation-bailout.ts +++ b/packages/next/src/client/components/static-generation-bailout.ts @@ -1,5 +1,5 @@ import { DynamicServerError } from './hooks-server-context' -import { staticGenerationAsyncStorage } from './static-generation-async-storage' +import { staticGenerationAsyncStorage } from './static-generation-async-storage.shared-runtime' class StaticGenBailoutError extends Error { code = 'NEXT_STATIC_GEN_BAILOUT' diff --git a/packages/next/src/client/image-component.tsx b/packages/next/src/client/image-component.tsx index eb50fbf664f9d..b00fa58fc63df 100644 --- a/packages/next/src/client/image-component.tsx +++ b/packages/next/src/client/image-component.tsx @@ -25,9 +25,9 @@ import type { ImageLoaderProps, } from '../shared/lib/image-config' import { imageConfigDefault } from '../shared/lib/image-config' -import { ImageConfigContext } from '../shared/lib/image-config-context.external' +import { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime' import { warnOnce } from '../shared/lib/utils/warn-once' -import { RouterContext } from '../shared/lib/router-context.external' +import { RouterContext } from '../shared/lib/router-context.shared-runtime' // @ts-ignore - This is replaced by webpack alias import defaultLoader from 'next/dist/shared/lib/image-loader' diff --git a/packages/next/src/client/index.tsx b/packages/next/src/client/index.tsx index e0458bd55a3fb..ba1acc8ffcc99 100644 --- a/packages/next/src/client/index.tsx +++ b/packages/next/src/client/index.tsx @@ -10,16 +10,16 @@ import type { import React from 'react' import ReactDOM from 'react-dom/client' -import { HeadManagerContext } from '../shared/lib/head-manager-context.external' +import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' import mitt, { MittEmitter } from '../shared/lib/mitt' -import { RouterContext } from '../shared/lib/router-context.external' +import { RouterContext } from '../shared/lib/router-context.shared-runtime' import { handleSmoothScroll } from '../shared/lib/router/utils/handle-smooth-scroll' import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic' import { urlQueryToSearchParams, assign, } from '../shared/lib/router/utils/querystring' -import { setConfig } from '../shared/lib/runtime-config.external' +import { setConfig } from '../shared/lib/runtime-config.shared-runtime' import { getURL, loadGetInitialProps, @@ -34,17 +34,17 @@ import measureWebVitals from './performance-relayer' import { RouteAnnouncer } from './route-announcer' import { createRouter, makePublicRouterInstance } from './router' import { getProperError } from '../lib/is-error' -import { ImageConfigContext } from '../shared/lib/image-config-context.external' +import { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime' import { ImageConfigComplete } from '../shared/lib/image-config' import { removeBasePath } from './remove-base-path' import { hasBasePath } from './has-base-path' -import { AppRouterContext } from '../shared/lib/app-router-context.external' +import { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime' import { adaptForAppRouterInstance, adaptForSearchParams, PathnameContextProviderAdapter, -} from '../shared/lib/router/adapters.external' -import { SearchParamsContext } from '../shared/lib/hooks-client-context.external' +} from '../shared/lib/router/adapters.shared-runtime' +import { SearchParamsContext } from '../shared/lib/hooks-client-context.shared-runtime' import onRecoverableError from './on-recoverable-error' /// diff --git a/packages/next/src/client/legacy/image.tsx b/packages/next/src/client/legacy/image.tsx index 7cd06d8f51a66..ccc60bbff86fa 100644 --- a/packages/next/src/client/legacy/image.tsx +++ b/packages/next/src/client/legacy/image.tsx @@ -16,7 +16,7 @@ import { VALID_LOADERS, } from '../../shared/lib/image-config' import { useIntersection } from '../use-intersection' -import { ImageConfigContext } from '../../shared/lib/image-config-context.external' +import { ImageConfigContext } from '../../shared/lib/image-config-context.shared-runtime' import { warnOnce } from '../../shared/lib/utils/warn-once' import { normalizePathTrailingSlash } from '../normalize-trailing-slash' diff --git a/packages/next/src/client/link.tsx b/packages/next/src/client/link.tsx index beb70280a17dd..9b591a548b68e 100644 --- a/packages/next/src/client/link.tsx +++ b/packages/next/src/client/link.tsx @@ -12,12 +12,12 @@ import { isLocalURL } from '../shared/lib/router/utils/is-local-url' import { formatUrl } from '../shared/lib/router/utils/format-url' import { isAbsoluteUrl } from '../shared/lib/utils' import { addLocale } from './add-locale' -import { RouterContext } from '../shared/lib/router-context.external' +import { RouterContext } from '../shared/lib/router-context.shared-runtime' import { AppRouterContext, AppRouterInstance, PrefetchOptions as AppRouterPrefetchOptions, -} from '../shared/lib/app-router-context.external' +} from '../shared/lib/app-router-context.shared-runtime' import { useIntersection } from './use-intersection' import { getDomainLocale } from './get-domain-locale' import { addBasePath } from './add-base-path' diff --git a/packages/next/src/client/router.ts b/packages/next/src/client/router.ts index 32a14c65f12f1..0dcf3ffb5126a 100644 --- a/packages/next/src/client/router.ts +++ b/packages/next/src/client/router.ts @@ -2,7 +2,7 @@ import React from 'react' import Router from '../shared/lib/router/router' import type { NextRouter } from '../shared/lib/router/router' -import { RouterContext } from '../shared/lib/router-context.external' +import { RouterContext } from '../shared/lib/router-context.shared-runtime' import isError from '../lib/is-error' type SingletonRouterBase = { diff --git a/packages/next/src/client/script.tsx b/packages/next/src/client/script.tsx index 3820c75f7941b..f695e691c482d 100644 --- a/packages/next/src/client/script.tsx +++ b/packages/next/src/client/script.tsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom' import React, { useEffect, useContext, useRef } from 'react' import { ScriptHTMLAttributes } from 'react' -import { HeadManagerContext } from '../shared/lib/head-manager-context.external' +import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' import { DOMAttributeNames } from './head-manager' import { requestIdleCallback } from './request-idle-callback' diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index 40237ae171d3b..a704c9105af79 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -51,7 +51,7 @@ import { } from '../server/web/spec-extension/adapters/next-request' import * as ciEnvironment from '../telemetry/ci-info' -const envConfig = require('../shared/lib/runtime-config.external') +const envConfig = require('../shared/lib/runtime-config.shared-runtime') ;(globalThis as any).__NEXT_DATA__ = { nextExport: true, diff --git a/packages/next/src/pages/_document.tsx b/packages/next/src/pages/_document.tsx index 8a60fffb38c26..f0a29cb15d1fc 100644 --- a/packages/next/src/pages/_document.tsx +++ b/packages/next/src/pages/_document.tsx @@ -20,8 +20,8 @@ import isError from '../lib/is-error' import { HtmlContext, useHtmlContext, -} from '../shared/lib/html-context.external' -import type { HtmlProps } from '../shared/lib/html-context.external' +} from '../shared/lib/html-context.shared-runtime' +import type { HtmlProps } from '../shared/lib/html-context.shared-runtime' export { DocumentContext, DocumentInitialProps, DocumentProps } diff --git a/packages/next/src/server/app-render/action-handler.ts b/packages/next/src/server/app-render/action-handler.ts index 7e660a58ff124..f10f0599e107a 100644 --- a/packages/next/src/server/app-render/action-handler.ts +++ b/packages/next/src/server/app-render/action-handler.ts @@ -19,10 +19,10 @@ import { isRedirectError, } from '../../client/components/redirect' import RenderResult from '../render-result' -import { StaticGenerationStore } from '../../client/components/static-generation-async-storage' +import { StaticGenerationStore } from '../../client/components/static-generation-async-storage.shared-runtime' import { FlightRenderResult } from './flight-render-result' import { ActionResult } from './types' -import { ActionAsyncStorage } from '../../client/components/action-async-storage' +import { ActionAsyncStorage } from '../../client/components/action-async-storage.shared-runtime' import { filterReqHeaders, actionsForbiddenHeaders, @@ -31,7 +31,7 @@ import { appendMutableCookies, getModifiedCookieValues, } from '../web/spec-extension/adapters/request-cookies' -import { RequestStore } from '../../client/components/request-async-storage' +import { RequestStore } from '../../client/components/request-async-storage.shared-runtime' function nodeToWebReadableStream(nodeReadable: import('stream').Readable) { if (process.env.NEXT_RUNTIME !== 'edge') { diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 2ecc645aa5b87..32f80f2546b3c 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -11,9 +11,9 @@ import type { Segment, } from './types' -import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage' +import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' import type { StaticGenerationBailout } from '../../client/components/static-generation-bailout' -import type { RequestAsyncStorage } from '../../client/components/request-async-storage' +import type { RequestAsyncStorage } from '../../client/components/request-async-storage.shared-runtime' import React from 'react' import { NotFound as DefaultNotFound } from '../../client/components/error' @@ -1450,7 +1450,7 @@ export async function renderToHTMLOrFlight( ) const { HeadManagerContext } = - require('../../shared/lib/head-manager-context.external') as typeof import('../../shared/lib/head-manager-context.external') + require('../../shared/lib/head-manager-context.shared-runtime') as typeof import('../../shared/lib/head-manager-context.shared-runtime') // On each render, create a new `ServerInsertedHTML` context to capture // injected nodes from user code (`useServerInsertedHTML`). diff --git a/packages/next/src/server/app-render/entry-base.ts b/packages/next/src/server/app-render/entry-base.ts index c35c8cb20279c..1ecffbff9f8d2 100644 --- a/packages/next/src/server/app-render/entry-base.ts +++ b/packages/next/src/server/app-render/entry-base.ts @@ -6,12 +6,12 @@ const { default: RenderFromTemplateContext } = require('next/dist/client/components/render-from-template-context') as typeof import('../../client/components/render-from-template-context') const { staticGenerationAsyncStorage } = - require('next/dist/client/components/static-generation-async-storage') as typeof import('../../client/components/static-generation-async-storage') + require('next/dist/client/components/static-generation-async-storage.shared-runtime') as typeof import('../../client/components/static-generation-async-storage.shared-runtime') const { requestAsyncStorage } = - require('next/dist/client/components/request-async-storage') as typeof import('../../client/components/request-async-storage') + require('next/dist/client/components/request-async-storage.shared-runtime') as typeof import('../../client/components/request-async-storage.shared-runtime') const { actionAsyncStorage } = - require('next/dist/client/components/action-async-storage') as typeof import('../../client/components/action-async-storage') + require('next/dist/client/components/action-async-storage.shared-runtime') as typeof import('../../client/components/action-async-storage.shared-runtime') const { staticGenerationBailout } = require('next/dist/client/components/static-generation-bailout') as typeof import('../../client/components/static-generation-bailout') diff --git a/packages/next/src/server/app-render/server-inserted-html.tsx b/packages/next/src/server/app-render/server-inserted-html.tsx index adbbb34d2e73c..764dc62792077 100644 --- a/packages/next/src/server/app-render/server-inserted-html.tsx +++ b/packages/next/src/server/app-render/server-inserted-html.tsx @@ -2,7 +2,7 @@ // elements into the HTML stream. import React from 'react' -import { ServerInsertedHTMLContext } from '../../shared/lib/server-inserted-html.external' +import { ServerInsertedHTMLContext } from '../../shared/lib/server-inserted-html.shared-runtime' export function createServerInsertedHTML() { const serverInsertedHTMLCallbacks: (() => React.ReactNode)[] = [] diff --git a/packages/next/src/server/async-storage/request-async-storage-wrapper.ts b/packages/next/src/server/async-storage/request-async-storage-wrapper.ts index 53ea482fe96ab..2898c8922f349 100644 --- a/packages/next/src/server/async-storage/request-async-storage-wrapper.ts +++ b/packages/next/src/server/async-storage/request-async-storage-wrapper.ts @@ -1,7 +1,7 @@ import type { BaseNextRequest, BaseNextResponse } from '../base-http' import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http' import type { AsyncLocalStorage } from 'async_hooks' -import type { RequestStore } from '../../client/components/request-async-storage' +import type { RequestStore } from '../../client/components/request-async-storage.shared-runtime' import type { RenderOpts } from '../app-render/types' import type { AsyncStorageWrapper } from './async-storage-wrapper' import type { NextRequest } from '../web/spec-extension/request' diff --git a/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts b/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts index 663dd6dc10601..19d627954571b 100644 --- a/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts +++ b/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts @@ -1,5 +1,5 @@ import type { AsyncStorageWrapper } from './async-storage-wrapper' -import type { StaticGenerationStore } from '../../client/components/static-generation-async-storage' +import type { StaticGenerationStore } from '../../client/components/static-generation-async-storage.shared-runtime' import type { AsyncLocalStorage } from 'async_hooks' import type { IncrementalCache } from '../lib/incremental-cache' diff --git a/packages/next/src/server/base-server.ts b/packages/next/src/server/base-server.ts index 7b9f1e4f6eb95..466d30117605b 100644 --- a/packages/next/src/server/base-server.ts +++ b/packages/next/src/server/base-server.ts @@ -51,7 +51,7 @@ import { getCookieParser, checkIsOnDemandRevalidate, } from './api-utils' -import { setConfig } from '../shared/lib/runtime-config.external' +import { setConfig } from '../shared/lib/runtime-config.shared-runtime' import { setRevalidateHeaders } from './send-payload/revalidate-headers' import { execOnce } from '../shared/lib/utils' diff --git a/packages/next/src/server/dev/static-paths-worker.ts b/packages/next/src/server/dev/static-paths-worker.ts index 82aa53172e0ed..61c23ef147a23 100644 --- a/packages/next/src/server/dev/static-paths-worker.ts +++ b/packages/next/src/server/dev/static-paths-worker.ts @@ -14,8 +14,11 @@ import { loadComponents } from '../load-components' import { setHttpClientAndAgentOptions } from '../setup-http-agent-env' import { IncrementalCache } from '../lib/incremental-cache' import * as serverHooks from '../../client/components/hooks-server-context' -import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage' -import { AppRouteRouteModule } from '../future/route-modules/app-route/module' +import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' +// import { AppRouteRouteModule } from '../future/route-modules/app-route/module' +const { + AppRouteRouteModule, +} = require('../future/route-modules/app-route/module.compiled') type RuntimeConfig = any @@ -56,7 +59,7 @@ export async function loadStaticPaths({ fallback?: boolean | 'blocking' }> { // update work memory runtime-config - require('../../shared/lib/runtime-config.external').setConfig(config) + require('../../shared/lib/runtime-config.shared-runtime').setConfig(config) setHttpClientAndAgentOptions({ httpAgentOptions, }) diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts index 2a1a68349f5d2..e986c1bad3894 100644 --- a/packages/next/src/server/future/route-modules/app-page/externals.ts +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -1,13 +1,13 @@ // the name of the export has to be the camelCase version of the file name (without the extension) -export * as headManagerContext from '../../../../shared/lib/head-manager-context.external' -export * as serverInsertedHtml from '../../../../shared/lib/server-inserted-html.external' -export * as appRouterContext from '../../../../shared/lib/app-router-context.external' -export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' -export * as routerContext from '../../../../shared/lib/router-context.external' -export * as htmlContext from '../../../../shared/lib/html-context.external' -export * as ampContext from '../../../../shared/lib/amp-context.external' -export * as adapters from '../../../../shared/lib/router/adapters.external' -export * as loadableContext from '../../../../shared/lib/loadable-context.external' -export * as imageConfigContext from '../../../../shared/lib/image-config-context.external' -export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' -export * as loadable from '../../../../shared/lib/loadable.external' +export * as headManagerContext from '../../../../shared/lib/head-manager-context.shared-runtime' +export * as serverInsertedHtml from '../../../../shared/lib/server-inserted-html.shared-runtime' +export * as appRouterContext from '../../../../shared/lib/app-router-context.shared-runtime' +export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.shared-runtime' +export * as routerContext from '../../../../shared/lib/router-context.shared-runtime' +export * as htmlContext from '../../../../shared/lib/html-context.shared-runtime' +export * as ampContext from '../../../../shared/lib/amp-context.shared-runtime' +export * as adapters from '../../../../shared/lib/router/adapters.shared-runtime' +export * as loadableContext from '../../../../shared/lib/loadable-context.shared-runtime' +export * as imageConfigContext from '../../../../shared/lib/image-config-context.shared-runtime' +export * as runtimeConfig from '../../../../shared/lib/runtime-config.shared-runtime' +export * as loadable from '../../../../shared/lib/loadable.shared-runtime' diff --git a/packages/next/src/server/future/route-modules/app-route/externals.ts b/packages/next/src/server/future/route-modules/app-route/externals.ts new file mode 100644 index 0000000000000..a90649d08f775 --- /dev/null +++ b/packages/next/src/server/future/route-modules/app-route/externals.ts @@ -0,0 +1,4 @@ +// the name of the export has to be the camelCase version of the file name (without the extension) +export * as requestAsyncStorage from '../../../../client/components/request-async-storage.shared-runtime' +export * as actionAsyncStorage from '../../../../client/components/action-async-storage.shared-runtime' +export * as staticGenerationAsyncStorage from '../../../../client/components/static-generation-async-storage.shared-runtime' diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index 1bee78f92179c..687a58334a1b1 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -40,9 +40,9 @@ import { parsedUrlQueryToParams } from './helpers/parsed-url-query-to-params' // can't do that directly because we need types from the source files. So we // import the types from the source files and then import the built files. const { requestAsyncStorage } = - require('next/dist/client/components/request-async-storage') as typeof import('../../../../client/components/request-async-storage') + require('next/dist/client/components/request-async-storage.shared-runtime') as typeof import('../../../../client/components/request-async-storage.shared-runtime') const { staticGenerationAsyncStorage } = - require('next/dist/client/components/static-generation-async-storage') as typeof import('../../../../client/components/static-generation-async-storage') + require('next/dist/client/components/static-generation-async-storage.shared-runtime') as typeof import('../../../../client/components/static-generation-async-storage.shared-runtime') const serverHooks = require('next/dist/client/components/hooks-server-context') as typeof import('../../../../client/components/hooks-server-context') const headerHooks = @@ -50,7 +50,7 @@ const headerHooks = const { staticGenerationBailout } = require('next/dist/client/components/static-generation-bailout') as typeof import('../../../../client/components/static-generation-bailout') const { actionAsyncStorage } = - require('next/dist/client/components/action-async-storage') as typeof import('../../../../client/components/action-async-storage') + require('next/dist/client/components/action-async-storage.shared-runtime') as typeof import('../../../../client/components/action-async-storage.shared-runtime') /** * AppRouteRouteHandlerContext is the context that is passed to the route diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/externals.ts index c77e147898bce..55cdfbdeca37c 100644 --- a/packages/next/src/server/future/route-modules/pages/externals.ts +++ b/packages/next/src/server/future/route-modules/pages/externals.ts @@ -1,12 +1,12 @@ // the name of the export has to be the camelCase version of the file name (without the extension) -export * as htmlContext from '../../../../shared/lib/html-context.external' -export * as routerContext from '../../../../shared/lib/router-context.external' -export * as ampContext from '../../../../shared/lib/amp-context.external' -export * as headManagerContext from '../../../../shared/lib/head-manager-context.external' -export * as adapters from '../../../../shared/lib/router/adapters.external' -export * as loadableContext from '../../../../shared/lib/loadable-context.external' -export * as appRouterContext from '../../../../shared/lib/app-router-context.external' -export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.external' -export * as imageConfigContext from '../../../../shared/lib/image-config-context.external' -export * as runtimeConfig from '../../../../shared/lib/runtime-config.external' -export * as loadable from '../../../../shared/lib/loadable.external' +export * as htmlContext from '../../../../shared/lib/html-context.shared-runtime' +export * as routerContext from '../../../../shared/lib/router-context.shared-runtime' +export * as ampContext from '../../../../shared/lib/amp-context.shared-runtime' +export * as headManagerContext from '../../../../shared/lib/head-manager-context.shared-runtime' +export * as adapters from '../../../../shared/lib/router/adapters.shared-runtime' +export * as loadableContext from '../../../../shared/lib/loadable-context.shared-runtime' +export * as appRouterContext from '../../../../shared/lib/app-router-context.shared-runtime' +export * as hooksClientContext from '../../../../shared/lib/hooks-client-context.shared-runtime' +export * as imageConfigContext from '../../../../shared/lib/image-config-context.shared-runtime' +export * as runtimeConfig from '../../../../shared/lib/runtime-config.shared-runtime' +export * as loadable from '../../../../shared/lib/loadable.shared-runtime' diff --git a/packages/next/src/server/lib/patch-fetch.ts b/packages/next/src/server/lib/patch-fetch.ts index 218c250514341..cbdebcc1029e2 100644 --- a/packages/next/src/server/lib/patch-fetch.ts +++ b/packages/next/src/server/lib/patch-fetch.ts @@ -1,4 +1,4 @@ -import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage' +import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' import type * as ServerHooks from '../../client/components/hooks-server-context' import { AppRenderSpan } from './trace/constants' diff --git a/packages/next/src/server/render.tsx b/packages/next/src/server/render.tsx index fc73879b289fc..34e3b491663ae 100644 --- a/packages/next/src/server/render.tsx +++ b/packages/next/src/server/render.tsx @@ -1,7 +1,7 @@ import type { IncomingMessage, ServerResponse } from 'http' import type { ParsedUrlQuery } from 'querystring' import type { NextRouter } from '../shared/lib/router/router' -import type { HtmlProps } from '../shared/lib/html-context.external' +import type { HtmlProps } from '../shared/lib/html-context.shared-runtime' import type { DomainLocale } from './config' import type { AppType, @@ -52,12 +52,12 @@ import { } from '../shared/lib/constants' import { isSerializableProps } from '../lib/is-serializable-props' import { isInAmpMode } from '../shared/lib/amp-mode' -import { AmpStateContext } from '../shared/lib/amp-context.external' +import { AmpStateContext } from '../shared/lib/amp-context.shared-runtime' import { defaultHead } from '../shared/lib/head' -import { HeadManagerContext } from '../shared/lib/head-manager-context.external' -import Loadable from '../shared/lib/loadable.external' -import { LoadableContext } from '../shared/lib/loadable-context.external' -import { RouterContext } from '../shared/lib/router-context.external' +import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime' +import Loadable from '../shared/lib/loadable.shared-runtime' +import { LoadableContext } from '../shared/lib/loadable-context.shared-runtime' +import { RouterContext } from '../shared/lib/router-context.shared-runtime' import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic' import { ComponentsEnhancer, @@ -65,7 +65,7 @@ import { isResSent, loadGetInitialProps, } from '../shared/lib/utils' -import { HtmlContext } from '../shared/lib/html-context.external' +import { HtmlContext } from '../shared/lib/html-context.shared-runtime' import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path' import { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path' import { getRequestMeta, NextParsedUrlQuery } from './request-meta' @@ -79,16 +79,16 @@ import { renderToInitialStream, continueFromInitialStream, } from './stream-utils/node-web-streams-helper' -import { ImageConfigContext } from '../shared/lib/image-config-context.external' +import { ImageConfigContext } from '../shared/lib/image-config-context.shared-runtime' import stripAnsi from 'next/dist/compiled/strip-ansi' import { stripInternalQueries } from './internal-utils' import { adaptForAppRouterInstance, adaptForSearchParams, PathnameContextProviderAdapter, -} from '../shared/lib/router/adapters.external' -import { AppRouterContext } from '../shared/lib/app-router-context.external' -import { SearchParamsContext } from '../shared/lib/hooks-client-context.external' +} from '../shared/lib/router/adapters.shared-runtime' +import { AppRouterContext } from '../shared/lib/app-router-context.shared-runtime' +import { SearchParamsContext } from '../shared/lib/hooks-client-context.shared-runtime' import { getTracer } from './lib/trace/tracer' import { RenderSpan } from './lib/trace/constants' import { ReflectAdapter } from './web/spec-extension/adapters/reflect' diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 95b387309d6b6..ff74f791818a2 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -131,8 +131,8 @@ mod.prototype.require = function (request: string) { process.env.NODE_ENV === 'production' && process.env.__NEXT_PRIVATE_RENDER_RUNTIME ) { - if (request.endsWith('.external')) { - const base = path.basename(request, '.external') + if (request.endsWith('.shared-runtime')) { + const base = path.basename(request, '.shared-runtime') const camelized = base.replace(/-([a-z])/g, (g) => g[1].toUpperCase()) const instance = originalRequire.call(this, currentRuntime) return instance.default.externals[camelized] diff --git a/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts b/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts index d1824f0bd38ee..d389f0ee3fc34 100644 --- a/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts +++ b/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts @@ -1,7 +1,7 @@ import type { RequestCookies } from '../cookies' import type { BaseNextResponse } from '../../../base-http' import type { ServerResponse } from 'http' -import { StaticGenerationStore } from '../../../../client/components/static-generation-async-storage' +import { StaticGenerationStore } from '../../../../client/components/static-generation-async-storage.shared-runtime' import { ResponseCookies } from '../cookies' import { ReflectAdapter } from './reflect' diff --git a/packages/next/src/server/web/spec-extension/revalidate-tag.ts b/packages/next/src/server/web/spec-extension/revalidate-tag.ts index 8d7cd68bd3a9a..67337b7b82a06 100644 --- a/packages/next/src/server/web/spec-extension/revalidate-tag.ts +++ b/packages/next/src/server/web/spec-extension/revalidate-tag.ts @@ -1,7 +1,7 @@ import { StaticGenerationAsyncStorage, StaticGenerationStore, -} from '../../../client/components/static-generation-async-storage' +} from '../../../client/components/static-generation-async-storage.shared-runtime' export function revalidateTag(tag: string) { const staticGenerationAsyncStorage = ( diff --git a/packages/next/src/server/web/spec-extension/unstable-cache.ts b/packages/next/src/server/web/spec-extension/unstable-cache.ts index c424ddb67c568..a8791f4bc086f 100644 --- a/packages/next/src/server/web/spec-extension/unstable-cache.ts +++ b/packages/next/src/server/web/spec-extension/unstable-cache.ts @@ -2,7 +2,7 @@ import { StaticGenerationStore, staticGenerationAsyncStorage as _staticGenerationAsyncStorage, StaticGenerationAsyncStorage, -} from '../../../client/components/static-generation-async-storage' +} from '../../../client/components/static-generation-async-storage.shared-runtime' import { CACHE_ONE_YEAR } from '../../../lib/constants' import { addImplicitTags } from '../../lib/patch-fetch' diff --git a/packages/next/src/shared/lib/amp-context.external.ts b/packages/next/src/shared/lib/amp-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/amp-context.external.ts rename to packages/next/src/shared/lib/amp-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/amp.ts b/packages/next/src/shared/lib/amp.ts index f26dc0e2ce48b..8edd21db9c299 100644 --- a/packages/next/src/shared/lib/amp.ts +++ b/packages/next/src/shared/lib/amp.ts @@ -1,5 +1,5 @@ import React from 'react' -import { AmpStateContext } from './amp-context.external' +import { AmpStateContext } from './amp-context.shared-runtime' import { isInAmpMode } from './amp-mode' export function useAmp(): boolean { diff --git a/packages/next/src/shared/lib/app-router-context.external.ts b/packages/next/src/shared/lib/app-router-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/app-router-context.external.ts rename to packages/next/src/shared/lib/app-router-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/dynamic.tsx b/packages/next/src/shared/lib/dynamic.tsx index 178080f10a7b8..390410edda29e 100644 --- a/packages/next/src/shared/lib/dynamic.tsx +++ b/packages/next/src/shared/lib/dynamic.tsx @@ -1,5 +1,5 @@ import React from 'react' -import Loadable from './loadable.external' +import Loadable from './loadable.shared-runtime' const isServerSide = typeof window === 'undefined' diff --git a/packages/next/src/shared/lib/head-manager-context.external.ts b/packages/next/src/shared/lib/head-manager-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/head-manager-context.external.ts rename to packages/next/src/shared/lib/head-manager-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/head.tsx b/packages/next/src/shared/lib/head.tsx index d411ff4644d22..42f95767bfa4c 100644 --- a/packages/next/src/shared/lib/head.tsx +++ b/packages/next/src/shared/lib/head.tsx @@ -2,8 +2,8 @@ import React, { useContext } from 'react' import Effect from './side-effect' -import { AmpStateContext } from './amp-context.external' -import { HeadManagerContext } from './head-manager-context.external' +import { AmpStateContext } from './amp-context.shared-runtime' +import { HeadManagerContext } from './head-manager-context.shared-runtime' import { isInAmpMode } from './amp-mode' import { warnOnce } from './utils/warn-once' diff --git a/packages/next/src/shared/lib/hooks-client-context.external.ts b/packages/next/src/shared/lib/hooks-client-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/hooks-client-context.external.ts rename to packages/next/src/shared/lib/hooks-client-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/html-context.external.ts b/packages/next/src/shared/lib/html-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/html-context.external.ts rename to packages/next/src/shared/lib/html-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/image-config-context.external.ts b/packages/next/src/shared/lib/image-config-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/image-config-context.external.ts rename to packages/next/src/shared/lib/image-config-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/loadable-context.external.ts b/packages/next/src/shared/lib/loadable-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/loadable-context.external.ts rename to packages/next/src/shared/lib/loadable-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/loadable.external.tsx b/packages/next/src/shared/lib/loadable.shared-runtime.tsx similarity index 99% rename from packages/next/src/shared/lib/loadable.external.tsx rename to packages/next/src/shared/lib/loadable.shared-runtime.tsx index d1884a18ae5d9..82ba84182701f 100644 --- a/packages/next/src/shared/lib/loadable.external.tsx +++ b/packages/next/src/shared/lib/loadable.shared-runtime.tsx @@ -23,7 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE // Modified to be compatible with webpack 4 / Next.js import React from 'react' -import { LoadableContext } from './loadable-context.external' +import { LoadableContext } from './loadable-context.shared-runtime' function resolve(obj: any) { return obj && obj.default ? obj.default : obj diff --git a/packages/next/src/shared/lib/router-context.external.ts b/packages/next/src/shared/lib/router-context.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/router-context.external.ts rename to packages/next/src/shared/lib/router-context.shared-runtime.ts diff --git a/packages/next/src/shared/lib/router/adapters.external.tsx b/packages/next/src/shared/lib/router/adapters.shared-runtime.tsx similarity index 97% rename from packages/next/src/shared/lib/router/adapters.external.tsx rename to packages/next/src/shared/lib/router/adapters.shared-runtime.tsx index 84c3b10d93092..29f92dda8dc08 100644 --- a/packages/next/src/shared/lib/router/adapters.external.tsx +++ b/packages/next/src/shared/lib/router/adapters.shared-runtime.tsx @@ -3,8 +3,8 @@ import React, { useMemo, useRef } from 'react' import type { AppRouterInstance, NavigateOptions, -} from '../app-router-context.external' -import { PathnameContext } from '../hooks-client-context.external' +} from '../app-router-context.shared-runtime' +import { PathnameContext } from '../hooks-client-context.shared-runtime' import type { NextRouter } from './router' import { isDynamicRoute } from './utils' diff --git a/packages/next/src/shared/lib/router/adapters.test.tsx b/packages/next/src/shared/lib/router/adapters.test.tsx index 0e0c97a881a93..e47ce2174dd35 100644 --- a/packages/next/src/shared/lib/router/adapters.test.tsx +++ b/packages/next/src/shared/lib/router/adapters.test.tsx @@ -1,4 +1,4 @@ -import { adaptForAppRouterInstance } from './adapters.external' +import { adaptForAppRouterInstance } from './adapters.shared-runtime' import { NextRouter } from './router' describe('adaptForAppRouterInstance', () => { diff --git a/packages/next/src/shared/lib/runtime-config.external.ts b/packages/next/src/shared/lib/runtime-config.shared-runtime.ts similarity index 100% rename from packages/next/src/shared/lib/runtime-config.external.ts rename to packages/next/src/shared/lib/runtime-config.shared-runtime.ts diff --git a/packages/next/src/shared/lib/server-inserted-html.external.tsx b/packages/next/src/shared/lib/server-inserted-html.shared-runtime.tsx similarity index 100% rename from packages/next/src/shared/lib/server-inserted-html.external.tsx rename to packages/next/src/shared/lib/server-inserted-html.shared-runtime.tsx diff --git a/packages/next/src/shared/lib/utils.ts b/packages/next/src/shared/lib/utils.ts index a3759881f7e6e..4e8036a6894a2 100644 --- a/packages/next/src/shared/lib/utils.ts +++ b/packages/next/src/shared/lib/utils.ts @@ -1,4 +1,4 @@ -import type { HtmlProps } from './html-context.external' +import type { HtmlProps } from './html-context.shared-runtime' import type { ComponentType } from 'react' import type { DomainLocale } from '../../server/config' import type { Env } from '@next/env' diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index cd42c64894308..5c9aabfc8d316 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -43,7 +43,7 @@ const externalsMap = { module.exports = ({ dev }) => { const externalHandler = ({ context, request, getResolve }, callback) => { ;(async () => { - if (dev && request.endsWith('.external')) { + if (dev && request.endsWith('.shared-runtime')) { const resolve = getResolve() const resolved = await resolve(context, request) const relative = path.relative( diff --git a/test/e2e/getserversideprops/app/pages/index.js b/test/e2e/getserversideprops/app/pages/index.js index 80dea3fa51dde..da17edc01839d 100644 --- a/test/e2e/getserversideprops/app/pages/index.js +++ b/test/e2e/getserversideprops/app/pages/index.js @@ -1,6 +1,6 @@ import Link from 'next/link' import ReactDOM from 'react-dom/server' -import { RouterContext } from 'next/dist/shared/lib/router-context.external' +import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime' import { useRouter } from 'next/router' function RouterComp(props) { From 1017540a534be939dd011cb88cf5823efc1fb5f2 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 21:36:09 +0200 Subject: [PATCH 050/101] fix storage --- packages/next/src/build/webpack-config.ts | 2 +- .../next/src/client/components/headers.ts | 1 - .../future/route-modules/app-route/module.ts | 34 ++++++++-------- packages/next/src/server/next-server.ts | 40 +++++++++---------- packages/next/webpack.config.js | 5 ++- 5 files changed, 42 insertions(+), 40 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index c96aae7cf2d49..fe148ed0d3911 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1448,7 +1448,7 @@ export default async function getBaseWebpackConfig( } const name = path.parse(localRes).name.replace('.shared-runtime', '') - console.log(layer, name, isAppLayer) + const camelCaseName = name.replace(/-([a-z])/g, (_, w) => w.toUpperCase() ) diff --git a/packages/next/src/client/components/headers.ts b/packages/next/src/client/components/headers.ts index 68c47ed48294a..d2c50b07abd6e 100644 --- a/packages/next/src/client/components/headers.ts +++ b/packages/next/src/client/components/headers.ts @@ -13,7 +13,6 @@ export function headers() { if (staticGenerationBailout('headers')) { return HeadersAdapter.seal(new Headers({})) } - const requestStore = requestAsyncStorage.getStore() if (!requestStore) { throw new Error( diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index 687a58334a1b1..796bc93f5b092 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -34,23 +34,21 @@ import { getNonStaticMethods } from './helpers/get-non-static-methods' import { appendMutableCookies } from '../../../web/spec-extension/adapters/request-cookies' import { RouteKind } from '../../route-kind' import { parsedUrlQueryToParams } from './helpers/parsed-url-query-to-params' - -// These are imported weirdly like this because of the way that the bundling -// works. We need to import the built files from the dist directory, but we -// can't do that directly because we need types from the source files. So we -// import the types from the source files and then import the built files. -const { requestAsyncStorage } = - require('next/dist/client/components/request-async-storage.shared-runtime') as typeof import('../../../../client/components/request-async-storage.shared-runtime') -const { staticGenerationAsyncStorage } = - require('next/dist/client/components/static-generation-async-storage.shared-runtime') as typeof import('../../../../client/components/static-generation-async-storage.shared-runtime') -const serverHooks = - require('next/dist/client/components/hooks-server-context') as typeof import('../../../../client/components/hooks-server-context') -const headerHooks = - require('next/dist/client/components/headers') as typeof import('../../../../client/components/headers') -const { staticGenerationBailout } = - require('next/dist/client/components/static-generation-bailout') as typeof import('../../../../client/components/static-generation-bailout') -const { actionAsyncStorage } = - require('next/dist/client/components/action-async-storage.shared-runtime') as typeof import('../../../../client/components/action-async-storage.shared-runtime') +import * as externals from './externals' + +import * as serverHooks from '../../../../client/components/hooks-server-context' +import * as headerHooks from '../../../../client/components/headers' +import { staticGenerationBailout } from '../../../../client/components/static-generation-bailout' + +const { + requestAsyncStorage: { requestAsyncStorage }, + staticGenerationAsyncStorage: { staticGenerationAsyncStorage }, + actionAsyncStorage: { actionAsyncStorage }, +} = externals as { + requestAsyncStorage: typeof import('../../../../client/components/request-async-storage.shared-runtime') + staticGenerationAsyncStorage: typeof import('../../../../client/components/static-generation-async-storage.shared-runtime') + actionAsyncStorage: typeof import('../../../../client/components/action-async-storage.shared-runtime') +} /** * AppRouteRouteHandlerContext is the context that is passed to the route @@ -160,6 +158,8 @@ export class AppRouteRouteModule extends RouteModule< private readonly nonStaticMethods: ReadonlyArray | false private readonly dynamic: AppRouteUserlandModule['dynamic'] + public static readonly externals = externals + public static is(route: RouteModule): route is AppRouteRouteModule { return route.definition.kind === RouteKind.APP_ROUTE } diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 97ac965838341..1cec06d0a3537 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -458,17 +458,28 @@ export default class NextNodeServer extends BaseServer { throw new Error( 'invariant: renderHTML should not be called in minimal mode' ) - } + } else { + // Due to the way we pass data by mutating `renderOpts`, we can't extend the + // object here but only updating its `nextFontManifest` field. + // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952 + renderOpts.nextFontManifest = this.nextFontManifest + + if (this.hasAppDir && renderOpts.isAppPath) { + const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = + require('./app-render/app-render') as typeof import('./app-render/app-render') + return appRenderToHTMLOrFlight( + req.originalRequest, + res.originalResponse, + pathname, + query, + renderOpts + ) + } - // Due to the way we pass data by mutating `renderOpts`, we can't extend the - // object here but only updating its `nextFontManifest` field. - // https://github.com/vercel/next.js/blob/df7cbd904c3bd85f399d1ce90680c0ecf92d2752/packages/next/server/render.tsx#L947-L952 - renderOpts.nextFontManifest = this.nextFontManifest + // TODO: re-enable this once we've refactored to use implicit matches + // throw new Error('Invariant: render should have used routeModule') - if (this.hasAppDir && renderOpts.isAppPath) { - const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = - require('./app-render/app-render') as typeof import('./app-render/app-render') - return appRenderToHTMLOrFlight( + return require('./render').renderToHTML( req.originalRequest, res.originalResponse, pathname, @@ -476,17 +487,6 @@ export default class NextNodeServer extends BaseServer { renderOpts ) } - - // TODO: re-enable this once we've refactored to use implicit matches - // throw new Error('Invariant: render should have used routeModule') - - return require('./render').renderToHTML( - req.originalRequest, - res.originalResponse, - pathname, - query, - renderOpts - ) } private streamResponseChunk(res: ServerResponse, chunk: any) { diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index 5c9aabfc8d316..922d9a12e3824 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -116,7 +116,10 @@ module.exports = ({ dev }) => { ), 'process.env.NEXT_RUNTIME': JSON.stringify('nodejs'), }), - !!process.env.ANALYZE && new BundleAnalyzerPlugin({}), + !!process.env.ANALYZE && + new BundleAnalyzerPlugin({ + analyzerPort: dev ? 8888 : 8889, + }), ].filter(Boolean), stats: { optimizationBailout: true, From db9fcec28101a130eae3ac11767dffb871d844a5 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 21:41:22 +0200 Subject: [PATCH 051/101] fix types --- packages/next/src/build/utils.ts | 5 ++--- packages/next/src/server/dev/static-paths-worker.ts | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index b5aae38839fc7..3b604547efa87 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -67,9 +67,8 @@ import * as ciEnvironment from '../telemetry/ci-info' import { normalizeAppPath } from '../shared/lib/router/utils/app-paths' import { denormalizeAppPagePath } from '../shared/lib/page-path/denormalize-app-path' // import { AppRouteRouteModule } from '../server/future/route-modules/app-route/module' -const { - AppRouteRouteModule, -} = require('../server/future/route-modules/app-route/module.compiled') +const { AppRouteRouteModule } = + require('../server/future/route-modules/app-route/module.compiled') as typeof import('../server/future/route-modules/app-route/module') export type ROUTER_TYPE = 'pages' | 'app' diff --git a/packages/next/src/server/dev/static-paths-worker.ts b/packages/next/src/server/dev/static-paths-worker.ts index 61c23ef147a23..acfa5cbf22399 100644 --- a/packages/next/src/server/dev/static-paths-worker.ts +++ b/packages/next/src/server/dev/static-paths-worker.ts @@ -15,10 +15,9 @@ import { setHttpClientAndAgentOptions } from '../setup-http-agent-env' import { IncrementalCache } from '../lib/incremental-cache' import * as serverHooks from '../../client/components/hooks-server-context' import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' -// import { AppRouteRouteModule } from '../future/route-modules/app-route/module' -const { - AppRouteRouteModule, -} = require('../future/route-modules/app-route/module.compiled') + +const { AppRouteRouteModule } = + require('../future/route-modules/app-route/module.compiled') as typeof import('../future/route-modules/app-route/module') type RuntimeConfig = any From 005c4b78db278d44a82977ff0ff8e497413409a3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 3 Aug 2023 22:02:20 +0200 Subject: [PATCH 052/101] fix type --- packages/next/src/server/web/adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/server/web/adapter.ts b/packages/next/src/server/web/adapter.ts index 2b62c89e6acbf..d436fb2209642 100644 --- a/packages/next/src/server/web/adapter.ts +++ b/packages/next/src/server/web/adapter.ts @@ -19,7 +19,7 @@ import { import { NEXT_QUERY_PARAM_PREFIX } from '../../lib/constants' import { ensureInstrumentationRegistered } from './globals' import { RequestAsyncStorageWrapper } from '../async-storage/request-async-storage-wrapper' -import { requestAsyncStorage } from '../../client/components/request-async-storage' +import { requestAsyncStorage } from '../../client/components/request-async-storage.shared-runtime' import { PrerenderManifest } from '../../build' class NextRequestHint extends NextRequest { From 94c33b8e659f9fa5e74f2f3b282fc8628e205b70 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 4 Aug 2023 09:52:49 +0200 Subject: [PATCH 053/101] fix types --- packages/next/src/trace/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next/src/trace/index.ts b/packages/next/src/trace/index.ts index e242e19c9041f..e3928f775f613 100644 --- a/packages/next/src/trace/index.ts +++ b/packages/next/src/trace/index.ts @@ -1,4 +1,5 @@ import { trace, flushAllTraces, Span, SpanStatus } from './trace' import { SpanId, setGlobal } from './shared' -export { trace, flushAllTraces, SpanId, Span, SpanStatus, setGlobal } +export { trace, flushAllTraces, Span, setGlobal, SpanStatus } +export type { SpanId } From 66d5d62a3d4bddbc509b4fd8e7fe9d8258879d3c Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 4 Aug 2023 09:59:24 +0200 Subject: [PATCH 054/101] fix static gen --- .../next/src/server/future/route-modules/app-page/externals.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts index e986c1bad3894..d350464c447e9 100644 --- a/packages/next/src/server/future/route-modules/app-page/externals.ts +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -11,3 +11,6 @@ export * as loadableContext from '../../../../shared/lib/loadable-context.shared export * as imageConfigContext from '../../../../shared/lib/image-config-context.shared-runtime' export * as runtimeConfig from '../../../../shared/lib/runtime-config.shared-runtime' export * as loadable from '../../../../shared/lib/loadable.shared-runtime' +export * as requestAsyncStorage from '../../../../client/components/request-async-storage.shared-runtime' +export * as actionAsyncStorage from '../../../../client/components/action-async-storage.shared-runtime' +export * as staticGenerationAsyncStorage from '../../../../client/components/static-generation-async-storage.shared-runtime' From e53218f8fdfefa45c87ef47ff1e688f916a28972 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 4 Aug 2023 19:33:10 +0200 Subject: [PATCH 055/101] switch async storages to externals --- packages/next/src/build/utils.ts | 2 +- packages/next/src/build/webpack-config.ts | 56 ++++++++------- ...me.ts => action-async-storage.external.ts} | 0 .../components/bailout-to-client-rendering.ts | 2 +- .../next/src/client/components/headers.ts | 4 +- .../next/src/client/components/redirect.ts | 2 +- ...e.ts => request-async-storage.external.ts} | 0 ...atic-generation-async-storage.external.ts} | 0 .../components/static-generation-bailout.ts | 2 +- packages/next/src/export/worker.ts | 3 +- .../src/server/app-render/action-handler.ts | 6 +- .../next/src/server/app-render/app-render.tsx | 4 +- .../next/src/server/app-render/entry-base.ts | 69 ++++++++++++------- .../request-async-storage-wrapper.ts | 2 +- ...static-generation-async-storage-wrapper.ts | 2 +- .../src/server/dev/static-paths-worker.ts | 2 +- .../route-modules/app-page/externals.ts | 3 - .../route-modules/app-route/externals.ts | 4 -- .../future/route-modules/app-route/module.ts | 16 ++--- packages/next/src/server/lib/patch-fetch.ts | 2 +- packages/next/src/server/web/adapter.ts | 2 +- .../adapters/request-cookies.ts | 2 +- .../web/spec-extension/revalidate-tag.ts | 2 +- .../web/spec-extension/unstable-cache.ts | 2 +- packages/next/webpack.config.js | 5 +- 25 files changed, 105 insertions(+), 89 deletions(-) rename packages/next/src/client/components/{action-async-storage.shared-runtime.ts => action-async-storage.external.ts} (100%) rename packages/next/src/client/components/{request-async-storage.shared-runtime.ts => request-async-storage.external.ts} (100%) rename packages/next/src/client/components/{static-generation-async-storage.shared-runtime.ts => static-generation-async-storage.external.ts} (100%) delete mode 100644 packages/next/src/server/future/route-modules/app-route/externals.ts diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index 3b604547efa87..f6651b09e8766 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -14,7 +14,7 @@ import type { EdgeFunctionDefinition, MiddlewareManifest, } from './webpack/plugins/middleware-plugin' -import type { StaticGenerationAsyncStorage } from '../client/components/static-generation-async-storage.shared-runtime' +import type { StaticGenerationAsyncStorage } from '../client/components/static-generation-async-storage.external' import '../server/require-hook' import '../server/node-polyfill-fetch' diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index fe148ed0d3911..01284871931c4 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1420,10 +1420,10 @@ export default async function getBaseWebpackConfig( // we need to process shared `router/router`, `head` and `dynamic`, // so that the DefinePlugin can inject process.env values. - // Treat next internals as non-external for server layer - if (isWebpackServerLayer(layer)) { - return - } + // // Treat next internals as non-external for server layer + // if (isWebpackServerLayer(layer)) { + // return + // } // const isNextExternal = // /next[/\\]dist[/\\](esm[\\/])?(shared|server)[/\\](?!lib[/\\](router[/\\]router|dynamic|app-dynamic|image-external|lazy-dynamic|head[^-]))/.test( @@ -1432,17 +1432,24 @@ export default async function getBaseWebpackConfig( const pathSeparators = '[/\\\\]' const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})` - const externalFileEnd = '(\\.shared-runtime(\\.js)?)$' - + const sharedRuntimeFileEnd = '(\\.shared-runtime(\\.js)?)$' + const externalFileEnd = '(\\.external(\\.js)?)$' const nextDist = `next${pathSeparators}dist` - const regexPattern = new RegExp( + const sharedRuntimePattern = new RegExp( + `${nextDist}${optionalEsmPart}.*${sharedRuntimeFileEnd}` + ) + const externalPattern = new RegExp( `${nextDist}${optionalEsmPart}.*${externalFileEnd}` ) - const isNextExternal = regexPattern.test(localRes) + const isSharedRuntime = sharedRuntimePattern.test(localRes) + const isExternal = externalPattern.test(localRes) - if (isNextExternal) { + if (isExternal) { + return `commonjs ${localRes}` + } + if (isSharedRuntime) { if (dev) { return `commonjs ${localRes}` } @@ -1542,7 +1549,10 @@ export default async function getBaseWebpackConfig( // Early return if the request needs to be bundled, such as in the client layer. // Treat react packages and next internals as external for SSR layer, // also map react to builtin ones with require-hook. - if (layer === WEBPACK_LAYERS.serverSideRendering) { + if ( + layer === WEBPACK_LAYERS.serverSideRendering || + layer === WEBPACK_LAYERS.reactServerComponents + ) { if (reactPackagesRegex.test(request)) { return `commonjs next/dist/compiled/${request.replace( /^(react-server-dom-webpack|react-dom|react)/, @@ -2020,12 +2030,12 @@ export default async function getBaseWebpackConfig( layer: 'app-route-handler', test: /\/route\.(js|ts)x?$/, }, - { - // Make sure that AsyncLocalStorage module instance is shared between server and client - // layers. - layer: WEBPACK_LAYERS.shared, - test: asyncStoragesRegex, - }, + // { + // // Make sure that AsyncLocalStorage module instance is shared between server and client + // // layers. + // layer: WEBPACK_LAYERS.shared, + // test: asyncStoragesRegex, + // }, // Convert metadata routes to separate layer { resourceQuery: new RegExp( @@ -2082,7 +2092,7 @@ export default async function getBaseWebpackConfig( and: [ codeCondition.test, { - not: [optOutBundlingPackageRegex, asyncStoragesRegex], + not: [optOutBundlingPackageRegex], }, ], }, @@ -2137,7 +2147,7 @@ export default async function getBaseWebpackConfig( // Alias react for switching between default set and share subset. oneOf: [ { - exclude: [asyncStoragesRegex], + // exclude: [asyncStoragesRegex], issuerLayer: { or: [isWebpackServerLayer], }, @@ -2146,9 +2156,9 @@ export default async function getBaseWebpackConfig( // opted out of bundling. and: [ codeCondition.test, - { - not: [optOutBundlingPackageRegex], - }, + // { + // // not: [optOutBundlingPackageRegex], + // }, ], }, resolve: { @@ -2214,7 +2224,7 @@ export default async function getBaseWebpackConfig( issuerLayer: { or: [isWebpackServerLayer], }, - exclude: [asyncStoragesRegex], + // exclude: [asyncStoragesRegex], use: swcLoaderForServerLayer, }, { @@ -2232,7 +2242,7 @@ export default async function getBaseWebpackConfig( WEBPACK_LAYERS.appPagesBrowser, ], }, - exclude: [asyncStoragesRegex, codeCondition.exclude], + exclude: [codeCondition.exclude], use: [ ...(dev && isClient ? [ diff --git a/packages/next/src/client/components/action-async-storage.shared-runtime.ts b/packages/next/src/client/components/action-async-storage.external.ts similarity index 100% rename from packages/next/src/client/components/action-async-storage.shared-runtime.ts rename to packages/next/src/client/components/action-async-storage.external.ts diff --git a/packages/next/src/client/components/bailout-to-client-rendering.ts b/packages/next/src/client/components/bailout-to-client-rendering.ts index 705e3a0af9708..799398b5f300c 100644 --- a/packages/next/src/client/components/bailout-to-client-rendering.ts +++ b/packages/next/src/client/components/bailout-to-client-rendering.ts @@ -1,5 +1,5 @@ import { suspense } from '../../shared/lib/lazy-dynamic/dynamic-no-ssr' -import { staticGenerationAsyncStorage } from './static-generation-async-storage.shared-runtime' +import { staticGenerationAsyncStorage } from './static-generation-async-storage.external' export function bailoutToClientRendering(): boolean | never { const staticGenerationStore = staticGenerationAsyncStorage.getStore() diff --git a/packages/next/src/client/components/headers.ts b/packages/next/src/client/components/headers.ts index d2c50b07abd6e..ecb4cf128d047 100644 --- a/packages/next/src/client/components/headers.ts +++ b/packages/next/src/client/components/headers.ts @@ -4,8 +4,8 @@ import { } from '../../server/web/spec-extension/adapters/request-cookies' import { HeadersAdapter } from '../../server/web/spec-extension/adapters/headers' import { RequestCookies } from '../../server/web/spec-extension/cookies' -import { requestAsyncStorage } from './request-async-storage.shared-runtime' -import { actionAsyncStorage } from './action-async-storage.shared-runtime' +import { requestAsyncStorage } from './request-async-storage.external' +import { actionAsyncStorage } from './action-async-storage.external' import { staticGenerationBailout } from './static-generation-bailout' import { DraftMode } from './draft-mode' diff --git a/packages/next/src/client/components/redirect.ts b/packages/next/src/client/components/redirect.ts index 75dc41d65258a..2f7ad914ebf23 100644 --- a/packages/next/src/client/components/redirect.ts +++ b/packages/next/src/client/components/redirect.ts @@ -1,4 +1,4 @@ -import { requestAsyncStorage } from './request-async-storage.shared-runtime' +import { requestAsyncStorage } from './request-async-storage.external' import type { ResponseCookies } from '../../server/web/spec-extension/cookies' const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT' diff --git a/packages/next/src/client/components/request-async-storage.shared-runtime.ts b/packages/next/src/client/components/request-async-storage.external.ts similarity index 100% rename from packages/next/src/client/components/request-async-storage.shared-runtime.ts rename to packages/next/src/client/components/request-async-storage.external.ts diff --git a/packages/next/src/client/components/static-generation-async-storage.shared-runtime.ts b/packages/next/src/client/components/static-generation-async-storage.external.ts similarity index 100% rename from packages/next/src/client/components/static-generation-async-storage.shared-runtime.ts rename to packages/next/src/client/components/static-generation-async-storage.external.ts diff --git a/packages/next/src/client/components/static-generation-bailout.ts b/packages/next/src/client/components/static-generation-bailout.ts index deb5778baa60e..d2e4d98d1750f 100644 --- a/packages/next/src/client/components/static-generation-bailout.ts +++ b/packages/next/src/client/components/static-generation-bailout.ts @@ -1,5 +1,5 @@ import { DynamicServerError } from './hooks-server-context' -import { staticGenerationAsyncStorage } from './static-generation-async-storage.shared-runtime' +import { staticGenerationAsyncStorage } from './static-generation-async-storage.external' class StaticGenBailoutError extends Error { code = 'NEXT_STATIC_GEN_BAILOUT' diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index a704c9105af79..e951489b8dfdd 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -429,12 +429,12 @@ export default async function exportPage({ // This is a route handler, which means it has it's handler in the // bundled file already, we should just use that. const filename = posix.join(distDir, 'server', 'app', page) + console.log('module', filename) // Load the module for the route. const module = await RouteModuleLoader.load( filename ) - // Call the handler with the request and context from the module. const response = await module.handle(request, context) @@ -455,6 +455,7 @@ export default async function exportPage({ const headers = toNodeOutgoingHttpHeaders(response.headers) const cacheTags = (context.staticGenerationContext as any) .fetchTags + console.log('cacheTags for ', page, cacheTags) if (cacheTags) { headers['x-next-cache-tags'] = cacheTags diff --git a/packages/next/src/server/app-render/action-handler.ts b/packages/next/src/server/app-render/action-handler.ts index f10f0599e107a..18a4bb6e307ce 100644 --- a/packages/next/src/server/app-render/action-handler.ts +++ b/packages/next/src/server/app-render/action-handler.ts @@ -19,10 +19,10 @@ import { isRedirectError, } from '../../client/components/redirect' import RenderResult from '../render-result' -import { StaticGenerationStore } from '../../client/components/static-generation-async-storage.shared-runtime' +import { StaticGenerationStore } from '../../client/components/static-generation-async-storage.external' import { FlightRenderResult } from './flight-render-result' import { ActionResult } from './types' -import { ActionAsyncStorage } from '../../client/components/action-async-storage.shared-runtime' +import { ActionAsyncStorage } from '../../client/components/action-async-storage.external' import { filterReqHeaders, actionsForbiddenHeaders, @@ -31,7 +31,7 @@ import { appendMutableCookies, getModifiedCookieValues, } from '../web/spec-extension/adapters/request-cookies' -import { RequestStore } from '../../client/components/request-async-storage.shared-runtime' +import { RequestStore } from '../../client/components/request-async-storage.external' function nodeToWebReadableStream(nodeReadable: import('stream').Readable) { if (process.env.NEXT_RUNTIME !== 'edge') { diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 861fb3e4b9bfe..369b56d37ab66 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -11,9 +11,9 @@ import type { Segment, } from './types' -import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' +import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.external' import type { StaticGenerationBailout } from '../../client/components/static-generation-bailout' -import type { RequestAsyncStorage } from '../../client/components/request-async-storage.shared-runtime' +import type { RequestAsyncStorage } from '../../client/components/request-async-storage.external' import React from 'react' import { NotFound as DefaultNotFound } from '../../client/components/error' diff --git a/packages/next/src/server/app-render/entry-base.ts b/packages/next/src/server/app-render/entry-base.ts index 1ecffbff9f8d2..1970777f28dfa 100644 --- a/packages/next/src/server/app-render/entry-base.ts +++ b/packages/next/src/server/app-render/entry-base.ts @@ -1,27 +1,27 @@ -const { default: AppRouter } = - require('next/dist/client/components/app-router') as typeof import('../../client/components/app-router') -const { default: LayoutRouter } = - require('next/dist/client/components/layout-router') as typeof import('../../client/components/layout-router') -const { default: RenderFromTemplateContext } = - require('next/dist/client/components/render-from-template-context') as typeof import('../../client/components/render-from-template-context') - -const { staticGenerationAsyncStorage } = - require('next/dist/client/components/static-generation-async-storage.shared-runtime') as typeof import('../../client/components/static-generation-async-storage.shared-runtime') - -const { requestAsyncStorage } = - require('next/dist/client/components/request-async-storage.shared-runtime') as typeof import('../../client/components/request-async-storage.shared-runtime') -const { actionAsyncStorage } = - require('next/dist/client/components/action-async-storage.shared-runtime') as typeof import('../../client/components/action-async-storage.shared-runtime') - -const { staticGenerationBailout } = - require('next/dist/client/components/static-generation-bailout') as typeof import('../../client/components/static-generation-bailout') -const { default: StaticGenerationSearchParamsBailoutProvider } = - require('next/dist/client/components/static-generation-searchparams-bailout-provider') as typeof import('../../client/components/static-generation-searchparams-bailout-provider') -const { createSearchParamsBailoutProxy } = - require('next/dist/client/components/searchparams-bailout-proxy') as typeof import('../../client/components/searchparams-bailout-proxy') - -const serverHooks = - require('next/dist/client/components/hooks-server-context') as typeof import('../../client/components/hooks-server-context') +// const { default: AppRouter } = +// require('next/dist/client/components/app-router') as typeof import('../../client/components/app-router') +// const { default: LayoutRouter } = +// require('next/dist/client/components/layout-router') as typeof import('../../client/components/layout-router') +// const { default: RenderFromTemplateContext } = +// require('next/dist/client/components/render-from-template-context') as typeof import('../../client/components/render-from-template-context') + +// const { staticGenerationAsyncStorage } = +// require('next/dist/client/components/static-generation-async-storage.shared-runtime') as typeof import('../../client/components/static-generation-async-storage.shared-runtime') + +// const { requestAsyncStorage } = +// require('next/dist/client/components/request-async-storage.shared-runtime') as typeof import('../../client/components/request-async-storage.shared-runtime') +// const { actionAsyncStorage } = +// require('next/dist/client/components/action-async-storage.shared-runtime') as typeof import('../../client/components/action-async-storage.shared-runtime') + +// const { staticGenerationBailout } = +// require('next/dist/client/components/static-generation-bailout') as typeof import('../../client/components/static-generation-bailout') +// const { default: StaticGenerationSearchParamsBailoutProvider } = +// require('next/dist/client/components/static-generation-searchparams-bailout-provider') as typeof import('../../client/components/static-generation-searchparams-bailout-provider') +// const { createSearchParamsBailoutProxy } = +// require('next/dist/client/components/searchparams-bailout-proxy') as typeof import('../../client/components/searchparams-bailout-proxy') + +// const serverHooks = +// require('next/dist/client/components/hooks-server-context') as typeof import('../../client/components/hooks-server-context') const { renderToReadableStream, @@ -29,8 +29,25 @@ const { decodeAction, // eslint-disable-next-line import/no-extraneous-dependencies } = require('react-server-dom-webpack/server.edge') -const { preloadStyle, preloadFont, preconnect } = - require('next/dist/server/app-render/rsc/preloads') as typeof import('../../server/app-render/rsc/preloads') +// const { preloadStyle, preloadFont, preconnect } = +// require('next/dist/server/app-render/rsc/preloads') as typeof import('../../server/app-render/rsc/preloads') + +import AppRouter from '../../client/components/app-router' +import LayoutRouter from '../../client/components/layout-router' +import RenderFromTemplateContext from '../../client/components/render-from-template-context' +import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.external' +import { requestAsyncStorage } from '../../client/components/request-async-storage.external' +import { actionAsyncStorage } from '../../client/components/action-async-storage.external' +import { staticGenerationBailout } from '../../client/components/static-generation-bailout' +import StaticGenerationSearchParamsBailoutProvider from '../../client/components/static-generation-searchparams-bailout-provider' +import { createSearchParamsBailoutProxy } from '../../client/components/searchparams-bailout-proxy' +import * as serverHooks from '../../client/components/hooks-server-context' + +import { + preloadStyle, + preloadFont, + preconnect, +} from '../../server/app-render/rsc/preloads' export { AppRouter, diff --git a/packages/next/src/server/async-storage/request-async-storage-wrapper.ts b/packages/next/src/server/async-storage/request-async-storage-wrapper.ts index cab8059f7a4e0..1376ecfb197cd 100644 --- a/packages/next/src/server/async-storage/request-async-storage-wrapper.ts +++ b/packages/next/src/server/async-storage/request-async-storage-wrapper.ts @@ -1,7 +1,7 @@ import type { BaseNextRequest, BaseNextResponse } from '../base-http' import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'http' import type { AsyncLocalStorage } from 'async_hooks' -import type { RequestStore } from '../../client/components/request-async-storage.shared-runtime' +import type { RequestStore } from '../../client/components/request-async-storage.external' import type { RenderOpts } from '../app-render/types' import type { AsyncStorageWrapper } from './async-storage-wrapper' import type { NextRequest } from '../web/spec-extension/request' diff --git a/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts b/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts index 19d627954571b..0ed136fb98f46 100644 --- a/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts +++ b/packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts @@ -1,5 +1,5 @@ import type { AsyncStorageWrapper } from './async-storage-wrapper' -import type { StaticGenerationStore } from '../../client/components/static-generation-async-storage.shared-runtime' +import type { StaticGenerationStore } from '../../client/components/static-generation-async-storage.external' import type { AsyncLocalStorage } from 'async_hooks' import type { IncrementalCache } from '../lib/incremental-cache' diff --git a/packages/next/src/server/dev/static-paths-worker.ts b/packages/next/src/server/dev/static-paths-worker.ts index acfa5cbf22399..ddd6526e52f23 100644 --- a/packages/next/src/server/dev/static-paths-worker.ts +++ b/packages/next/src/server/dev/static-paths-worker.ts @@ -14,7 +14,7 @@ import { loadComponents } from '../load-components' import { setHttpClientAndAgentOptions } from '../setup-http-agent-env' import { IncrementalCache } from '../lib/incremental-cache' import * as serverHooks from '../../client/components/hooks-server-context' -import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' +import { staticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.external' const { AppRouteRouteModule } = require('../future/route-modules/app-route/module.compiled') as typeof import('../future/route-modules/app-route/module') diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/externals.ts index d350464c447e9..e986c1bad3894 100644 --- a/packages/next/src/server/future/route-modules/app-page/externals.ts +++ b/packages/next/src/server/future/route-modules/app-page/externals.ts @@ -11,6 +11,3 @@ export * as loadableContext from '../../../../shared/lib/loadable-context.shared export * as imageConfigContext from '../../../../shared/lib/image-config-context.shared-runtime' export * as runtimeConfig from '../../../../shared/lib/runtime-config.shared-runtime' export * as loadable from '../../../../shared/lib/loadable.shared-runtime' -export * as requestAsyncStorage from '../../../../client/components/request-async-storage.shared-runtime' -export * as actionAsyncStorage from '../../../../client/components/action-async-storage.shared-runtime' -export * as staticGenerationAsyncStorage from '../../../../client/components/static-generation-async-storage.shared-runtime' diff --git a/packages/next/src/server/future/route-modules/app-route/externals.ts b/packages/next/src/server/future/route-modules/app-route/externals.ts deleted file mode 100644 index a90649d08f775..0000000000000 --- a/packages/next/src/server/future/route-modules/app-route/externals.ts +++ /dev/null @@ -1,4 +0,0 @@ -// the name of the export has to be the camelCase version of the file name (without the extension) -export * as requestAsyncStorage from '../../../../client/components/request-async-storage.shared-runtime' -export * as actionAsyncStorage from '../../../../client/components/action-async-storage.shared-runtime' -export * as staticGenerationAsyncStorage from '../../../../client/components/static-generation-async-storage.shared-runtime' diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index 796bc93f5b092..52860fe39820e 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -34,21 +34,14 @@ import { getNonStaticMethods } from './helpers/get-non-static-methods' import { appendMutableCookies } from '../../../web/spec-extension/adapters/request-cookies' import { RouteKind } from '../../route-kind' import { parsedUrlQueryToParams } from './helpers/parsed-url-query-to-params' -import * as externals from './externals' import * as serverHooks from '../../../../client/components/hooks-server-context' import * as headerHooks from '../../../../client/components/headers' import { staticGenerationBailout } from '../../../../client/components/static-generation-bailout' -const { - requestAsyncStorage: { requestAsyncStorage }, - staticGenerationAsyncStorage: { staticGenerationAsyncStorage }, - actionAsyncStorage: { actionAsyncStorage }, -} = externals as { - requestAsyncStorage: typeof import('../../../../client/components/request-async-storage.shared-runtime') - staticGenerationAsyncStorage: typeof import('../../../../client/components/static-generation-async-storage.shared-runtime') - actionAsyncStorage: typeof import('../../../../client/components/action-async-storage.shared-runtime') -} +import { requestAsyncStorage } from '../../../../client/components/request-async-storage.external' +import { staticGenerationAsyncStorage } from '../../../../client/components/static-generation-async-storage.external' +import { actionAsyncStorage } from '../../../../client/components/action-async-storage.external' /** * AppRouteRouteHandlerContext is the context that is passed to the route @@ -158,8 +151,6 @@ export class AppRouteRouteModule extends RouteModule< private readonly nonStaticMethods: ReadonlyArray | false private readonly dynamic: AppRouteUserlandModule['dynamic'] - public static readonly externals = externals - public static is(route: RouteModule): route is AppRouteRouteModule { return route.definition.kind === RouteKind.APP_ROUTE } @@ -374,6 +365,7 @@ export class AppRouteRouteModule extends RouteModule< staticGenerationStore.pendingRevalidates || [] ) addImplicitTags(staticGenerationStore) + console.log('tags for ', route, staticGenerationStore.tags) ;(context.staticGenerationContext as any).fetchTags = staticGenerationStore.tags?.join(',') diff --git a/packages/next/src/server/lib/patch-fetch.ts b/packages/next/src/server/lib/patch-fetch.ts index cbdebcc1029e2..783014f88d327 100644 --- a/packages/next/src/server/lib/patch-fetch.ts +++ b/packages/next/src/server/lib/patch-fetch.ts @@ -1,4 +1,4 @@ -import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.shared-runtime' +import type { StaticGenerationAsyncStorage } from '../../client/components/static-generation-async-storage.external' import type * as ServerHooks from '../../client/components/hooks-server-context' import { AppRenderSpan } from './trace/constants' diff --git a/packages/next/src/server/web/adapter.ts b/packages/next/src/server/web/adapter.ts index d436fb2209642..4da5b2940a0a9 100644 --- a/packages/next/src/server/web/adapter.ts +++ b/packages/next/src/server/web/adapter.ts @@ -19,7 +19,7 @@ import { import { NEXT_QUERY_PARAM_PREFIX } from '../../lib/constants' import { ensureInstrumentationRegistered } from './globals' import { RequestAsyncStorageWrapper } from '../async-storage/request-async-storage-wrapper' -import { requestAsyncStorage } from '../../client/components/request-async-storage.shared-runtime' +import { requestAsyncStorage } from '../../client/components/request-async-storage.external' import { PrerenderManifest } from '../../build' class NextRequestHint extends NextRequest { diff --git a/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts b/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts index 1d3aecc1e7779..d44ea986cad65 100644 --- a/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts +++ b/packages/next/src/server/web/spec-extension/adapters/request-cookies.ts @@ -1,5 +1,5 @@ import type { RequestCookies } from '../cookies' -import { StaticGenerationStore } from '../../../../client/components/static-generation-async-storage.shared-runtime' +import { StaticGenerationStore } from '../../../../client/components/static-generation-async-storage.external' import { ResponseCookies } from '../cookies' import { ReflectAdapter } from './reflect' diff --git a/packages/next/src/server/web/spec-extension/revalidate-tag.ts b/packages/next/src/server/web/spec-extension/revalidate-tag.ts index 67337b7b82a06..7c7bff8c2f784 100644 --- a/packages/next/src/server/web/spec-extension/revalidate-tag.ts +++ b/packages/next/src/server/web/spec-extension/revalidate-tag.ts @@ -1,7 +1,7 @@ import { StaticGenerationAsyncStorage, StaticGenerationStore, -} from '../../../client/components/static-generation-async-storage.shared-runtime' +} from '../../../client/components/static-generation-async-storage.external' export function revalidateTag(tag: string) { const staticGenerationAsyncStorage = ( diff --git a/packages/next/src/server/web/spec-extension/unstable-cache.ts b/packages/next/src/server/web/spec-extension/unstable-cache.ts index a8791f4bc086f..735d005048e8e 100644 --- a/packages/next/src/server/web/spec-extension/unstable-cache.ts +++ b/packages/next/src/server/web/spec-extension/unstable-cache.ts @@ -2,7 +2,7 @@ import { StaticGenerationStore, staticGenerationAsyncStorage as _staticGenerationAsyncStorage, StaticGenerationAsyncStorage, -} from '../../../client/components/static-generation-async-storage.shared-runtime' +} from '../../../client/components/static-generation-async-storage.external' import { CACHE_ONE_YEAR } from '../../../lib/constants' import { addImplicitTags } from '../../lib/patch-fetch' diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index 922d9a12e3824..ad76b2b50aa05 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -43,7 +43,10 @@ const externalsMap = { module.exports = ({ dev }) => { const externalHandler = ({ context, request, getResolve }, callback) => { ;(async () => { - if (dev && request.endsWith('.shared-runtime')) { + if ( + (dev && request.endsWith('.shared-runtime')) || + request.endsWith('.external') + ) { const resolve = getResolve() const resolved = await resolve(context, request) const relative = path.relative( From 178f422bbf435c794cdd4d2d65301def4326b6d5 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 11:08:53 +0200 Subject: [PATCH 056/101] fix edge layers --- packages/next/src/build/webpack-config.ts | 24 +++++++++---------- .../route-modules/app-route/externals.ts | 3 +++ .../future/route-modules/app-route/module.ts | 3 +++ 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 packages/next/src/server/future/route-modules/app-route/externals.ts diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 01284871931c4..46edef7b72bf9 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -2030,12 +2030,12 @@ export default async function getBaseWebpackConfig( layer: 'app-route-handler', test: /\/route\.(js|ts)x?$/, }, - // { - // // Make sure that AsyncLocalStorage module instance is shared between server and client - // // layers. - // layer: WEBPACK_LAYERS.shared, - // test: asyncStoragesRegex, - // }, + { + // Make sure that AsyncLocalStorage module instance is shared between server and client + // layers. + layer: WEBPACK_LAYERS.shared, + test: asyncStoragesRegex, + }, // Convert metadata routes to separate layer { resourceQuery: new RegExp( @@ -2092,7 +2092,7 @@ export default async function getBaseWebpackConfig( and: [ codeCondition.test, { - not: [optOutBundlingPackageRegex], + not: [optOutBundlingPackageRegex, asyncStoragesRegex], }, ], }, @@ -2147,7 +2147,7 @@ export default async function getBaseWebpackConfig( // Alias react for switching between default set and share subset. oneOf: [ { - // exclude: [asyncStoragesRegex], + exclude: [asyncStoragesRegex], issuerLayer: { or: [isWebpackServerLayer], }, @@ -2156,9 +2156,9 @@ export default async function getBaseWebpackConfig( // opted out of bundling. and: [ codeCondition.test, - // { - // // not: [optOutBundlingPackageRegex], - // }, + { + not: [optOutBundlingPackageRegex], + }, ], }, resolve: { @@ -2224,7 +2224,7 @@ export default async function getBaseWebpackConfig( issuerLayer: { or: [isWebpackServerLayer], }, - // exclude: [asyncStoragesRegex], + exclude: [asyncStoragesRegex], use: swcLoaderForServerLayer, }, { diff --git a/packages/next/src/server/future/route-modules/app-route/externals.ts b/packages/next/src/server/future/route-modules/app-route/externals.ts new file mode 100644 index 0000000000000..e6139d5a69404 --- /dev/null +++ b/packages/next/src/server/future/route-modules/app-route/externals.ts @@ -0,0 +1,3 @@ +// the name of the export has to be the camelCase version of the file name (without the extension) +// TODO: remove this. We need it because using notFound from next/navigation imports this file :( +export * as appRouterContext from '../../../../shared/lib/app-router-context.shared-runtime' diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index 52860fe39820e..89ee5f787e1e9 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -42,6 +42,7 @@ import { staticGenerationBailout } from '../../../../client/components/static-ge import { requestAsyncStorage } from '../../../../client/components/request-async-storage.external' import { staticGenerationAsyncStorage } from '../../../../client/components/static-generation-async-storage.external' import { actionAsyncStorage } from '../../../../client/components/action-async-storage.external' +import * as externals from './externals' /** * AppRouteRouteHandlerContext is the context that is passed to the route @@ -138,6 +139,8 @@ export class AppRouteRouteModule extends RouteModule< */ public readonly staticGenerationBailout = staticGenerationBailout + public static readonly externals = externals + /** * A reference to the mutation related async storage, such as mutations of * cookies. From c6f160afcb15538f4f2f2dbced78e726676dba65 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 11:58:29 +0200 Subject: [PATCH 057/101] fix typings --- packages/next/src/build/webpack-config.ts | 2 +- .../src/build/webpack/plugins/next-types-plugin/index.ts | 9 ++++++--- packages/next/src/lib/constants.ts | 5 +++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 46edef7b72bf9..9a67e86bec41b 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -2027,7 +2027,7 @@ export default async function getBaseWebpackConfig( ...(hasAppDir ? [ { - layer: 'app-route-handler', + layer: WEBPACK_LAYERS.appRouteHandler, test: /\/route\.(js|ts)x?$/, }, { diff --git a/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts b/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts index 560cbdfff902f..6f5b320e45292 100644 --- a/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts +++ b/packages/next/src/build/webpack/plugins/next-types-plugin/index.ts @@ -442,7 +442,7 @@ declare module 'next/link' { declare module 'next/navigation' { export * from 'next/dist/client/components/navigation.js' - import type { NavigateOptions, AppRouterInstance as OriginalAppRouterInstance } from 'next/dist/shared/lib/app-router-context.js' + import type { NavigateOptions, AppRouterInstance as OriginalAppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime.js' interface AppRouterInstance extends OriginalAppRouterInstance { /** * Navigate to the provided href. @@ -575,8 +575,11 @@ export class NextTypesPlugin { } return } - - if (mod.layer !== WEBPACK_LAYERS.reactServerComponents) return + if ( + mod.layer !== WEBPACK_LAYERS.reactServerComponents && + mod.layer !== WEBPACK_LAYERS.appRouteHandler + ) + return const IS_LAYOUT = /[/\\]layout\.[^./\\]+$/.test(mod.resource) const IS_PAGE = !IS_LAYOUT && /[/\\]page\.[^.]+$/.test(mod.resource) diff --git a/packages/next/src/lib/constants.ts b/packages/next/src/lib/constants.ts index 29e849eb5cf03..0fee1b7fbe359 100644 --- a/packages/next/src/lib/constants.ts +++ b/packages/next/src/lib/constants.ts @@ -127,6 +127,10 @@ const WEBPACK_LAYERS_NAMES = { * The server bundle layer for metadata routes. */ appMetadataRoute: 'app-metadata-route', + /** + * The layer for the server bundle for App Route handlers. + */ + appRouteHandler: 'app-route-handler', } export const WEBPACK_LAYERS = { @@ -136,6 +140,7 @@ export const WEBPACK_LAYERS = { WEBPACK_LAYERS_NAMES.reactServerComponents, WEBPACK_LAYERS_NAMES.actionBrowser, WEBPACK_LAYERS_NAMES.appMetadataRoute, + WEBPACK_LAYERS_NAMES.appRouteHandler, ], }, } From 69511924566686d364e39fd2bf15ad9510d5bc5e Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 12:09:41 +0200 Subject: [PATCH 058/101] remove external test --- .../app/node_modules/comps/index.js | 5 --- .../app/node_modules/comps/package.json | 6 ---- .../externalize-next-server/app/package.json | 6 ---- .../app/pages/index.js | 12 ------- .../test/index.test.js | 36 ------------------- 5 files changed, 65 deletions(-) delete mode 100644 test/integration/externalize-next-server/app/node_modules/comps/index.js delete mode 100644 test/integration/externalize-next-server/app/node_modules/comps/package.json delete mode 100644 test/integration/externalize-next-server/app/package.json delete mode 100644 test/integration/externalize-next-server/app/pages/index.js delete mode 100644 test/integration/externalize-next-server/test/index.test.js diff --git a/test/integration/externalize-next-server/app/node_modules/comps/index.js b/test/integration/externalize-next-server/app/node_modules/comps/index.js deleted file mode 100644 index 74c3153f1b835..0000000000000 --- a/test/integration/externalize-next-server/app/node_modules/comps/index.js +++ /dev/null @@ -1,5 +0,0 @@ -const react = require('react') - -module.exports = function() { - return react.createElement('p', null, 'MyComp:', typeof window) -} diff --git a/test/integration/externalize-next-server/app/node_modules/comps/package.json b/test/integration/externalize-next-server/app/node_modules/comps/package.json deleted file mode 100644 index 6e665b646a6ad..0000000000000 --- a/test/integration/externalize-next-server/app/node_modules/comps/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "comps", - "version": "1.0.0", - "main": "index.js", - "license": "MIT" -} diff --git a/test/integration/externalize-next-server/app/package.json b/test/integration/externalize-next-server/app/package.json deleted file mode 100644 index c5bd706a3a950..0000000000000 --- a/test/integration/externalize-next-server/app/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "externalize-next-server-app", - "version": "1.0.0", - "main": "index.js", - "license": "MIT" -} diff --git a/test/integration/externalize-next-server/app/pages/index.js b/test/integration/externalize-next-server/app/pages/index.js deleted file mode 100644 index 9ceb7bee3db17..0000000000000 --- a/test/integration/externalize-next-server/app/pages/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import MyComp from 'comps' - -const Page = () => ( - <> -

Hello {typeof window}

- - -) - -Page.getInitialProps = () => ({}) - -export default Page diff --git a/test/integration/externalize-next-server/test/index.test.js b/test/integration/externalize-next-server/test/index.test.js deleted file mode 100644 index c88f4627c1fdb..0000000000000 --- a/test/integration/externalize-next-server/test/index.test.js +++ /dev/null @@ -1,36 +0,0 @@ -/* eslint-env jest */ -import path from 'path' -import { nextBuild, readNextBuildServerPageFile } from 'next-test-utils' -import escapeStringRegexp from 'escape-string-regexp' - -const appDir = path.join(__dirname, '../app') - -describe('externalize next/dist/shared', () => { - beforeAll(async () => { - await nextBuild(appDir) - }) - - it('Bundle next/dist/shared/lib/head.js but not next/dist/shared/lib/head-manager-context.js in _error', async () => { - const content = readNextBuildServerPageFile(appDir, '/_error') - expect(content).toMatch( - new RegExp( - '^' + - escapeStringRegexp( - `module.exports = require("next/dist/shared/lib/head-manager-context.js");` - ) + - ';?$', - 'm' - ) - ) - expect(content).not.toMatch( - new RegExp( - '^' + - escapeStringRegexp( - `module.exports = require("next/dist/shared/lib/head.js");` - ) + - ';?$', - 'm' - ) - ) - }) -}) From e21d0e5a149958af914e850c1a45c1396efb7409 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 12:20:29 +0200 Subject: [PATCH 059/101] upgrade test --- test/integration/jsconfig-paths/test/index.test.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/integration/jsconfig-paths/test/index.test.js b/test/integration/jsconfig-paths/test/index.test.js index 77c84e7edfbb4..bc3c635b9ce96 100644 --- a/test/integration/jsconfig-paths/test/index.test.js +++ b/test/integration/jsconfig-paths/test/index.test.js @@ -89,9 +89,6 @@ function runTests() { await nextBuild(appDir) }) it('should trace correctly', async () => { - const appTrace = await fs.readJSON( - join(appDir, '.next/server/pages/_app.js.nft.json') - ) const singleAliasTrace = await fs.readJSON( join(appDir, '.next/server/pages/single-alias.js.nft.json') ) @@ -107,9 +104,7 @@ function runTests() { const basicAliasTrace = await fs.readJSON( join(appDir, '.next/server/pages/basic-alias.js.nft.json') ) - expect( - appTrace.files.some((file) => file.includes('node_modules/next')) - ).toBe(true) + expect( singleAliasTrace.files.some((file) => file.includes('components/hello.js') From 5165ab3f051cb180b514a59d52334d8bf04c5c64 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 12:41:34 +0200 Subject: [PATCH 060/101] fix native test --- test/e2e/prerender-native-module.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/e2e/prerender-native-module.test.ts b/test/e2e/prerender-native-module.test.ts index c23b1d2d05cd0..a2b8e4dc7a8d9 100644 --- a/test/e2e/prerender-native-module.test.ts +++ b/test/e2e/prerender-native-module.test.ts @@ -85,8 +85,6 @@ describe('prerender native module', () => { /node_modules\/sqlite3\/.*?\.node/, /node_modules\/sqlite\/.*?\.js/, /node_modules\/next/, - /next\/router\.js/, - /next\/dist\/client\/router\.js/, /\/data\.sqlite/, ], notTests: [], @@ -99,7 +97,7 @@ describe('prerender native module', () => { ) const { version, files } = JSON.parse(contents) expect(version).toBe(1) - + console.log(files, check.page) expect( check.tests.every((item) => files.some((file) => item.test(file))) ).toBe(true) From 556294770d40b56fa7f00f14c7c088e46a24b6b3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 15:00:19 +0200 Subject: [PATCH 061/101] fix integratin test --- test/integration/jsconfig-baseurl/test/index.test.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/integration/jsconfig-baseurl/test/index.test.js b/test/integration/jsconfig-baseurl/test/index.test.js index 91f084ce1d55e..4ad014d0e8f03 100644 --- a/test/integration/jsconfig-baseurl/test/index.test.js +++ b/test/integration/jsconfig-baseurl/test/index.test.js @@ -72,12 +72,6 @@ describe('TypeScript Features', () => { const helloTrace = await fs.readJSON( join(appDir, '.next/server/pages/hello.js.nft.json') ) - const appTrace = await fs.readJSON( - join(appDir, '.next/server/pages/_app.js.nft.json') - ) - expect( - appTrace.files.some((file) => file.includes('node_modules/next')) - ).toBe(true) expect( helloTrace.files.some((file) => file.includes('components/world.js')) ).toBe(false) From 4de5f78bd250c5693d2b0ba5efb090cb3e6e14dd Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 15:38:41 +0200 Subject: [PATCH 062/101] fix require logic --- packages/next/src/build/webpack-config.ts | 5 +---- .../server/future/route-modules/app-page/module.compiled.ts | 6 +++--- .../future/route-modules/app-route/module.compiled.ts | 6 +++--- .../future/route-modules/pages-api/module.compiled.ts | 6 +++--- .../server/future/route-modules/pages/module.compiled.ts | 6 +++--- packages/next/src/server/require-hook.ts | 4 ++-- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 9a67e86bec41b..ff83d7228ccf0 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1549,10 +1549,7 @@ export default async function getBaseWebpackConfig( // Early return if the request needs to be bundled, such as in the client layer. // Treat react packages and next internals as external for SSR layer, // also map react to builtin ones with require-hook. - if ( - layer === WEBPACK_LAYERS.serverSideRendering || - layer === WEBPACK_LAYERS.reactServerComponents - ) { + if (layer === WEBPACK_LAYERS.serverSideRendering) { if (reactPackagesRegex.test(request)) { return `commonjs next/dist/compiled/${request.replace( /^(react-server-dom-webpack|react-dom|react)/, diff --git a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts index bd4d20de1f755..1f69a8abd3895 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts @@ -1,8 +1,8 @@ if (process.env.NEXT_RUNTIME !== 'edge') { - if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') - } else { + if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') + } else { + module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') } } else { module.exports = require('next/dist/server/future/route-modules/app-page/module.js') diff --git a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts index 2540b794a54e8..ea21d87ce1998 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts @@ -1,8 +1,8 @@ if (process.env.NEXT_RUNTIME !== 'edge') { - if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') - } else { + if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') + } else { + module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') } } else { module.exports = require('next/dist/server/future/route-modules/app-route/module.js') diff --git a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts index 8aeafaa2387d8..6465ee27439cd 100644 --- a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts @@ -1,8 +1,8 @@ if (process.env.NEXT_RUNTIME !== 'edge') { - if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') - } else { + if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') + } else { + module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') } } else { module.exports = require('next/dist/server/future/route-modules/pages-api/module.js') diff --git a/packages/next/src/server/future/route-modules/pages/module.compiled.ts b/packages/next/src/server/future/route-modules/pages/module.compiled.ts index 9d205b618c883..5c43e381a19ad 100644 --- a/packages/next/src/server/future/route-modules/pages/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages/module.compiled.ts @@ -1,8 +1,8 @@ if (process.env.NEXT_RUNTIME !== 'edge') { - if (process.env.NODE_ENV === 'production') { - module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') - } else { + if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') + } else { + module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') } } else { module.exports = require('next/dist/server/future/route-modules/pages/module.js') diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 330d023b4a2da..aa12c7b4907d8 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -32,7 +32,7 @@ const currentRuntime = `${ process.env.__NEXT_PRIVATE_RENDER_RUNTIME === 'pages' ? 'next/dist/compiled/next-server/pages.runtime' : 'next/dist/compiled/next-server/app-page.runtime' -}.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}` +}.${process.env.NODE_ENV === 'development' ? 'dev' : 'prod'}` export const baseOverrides = { react: 'next/dist/compiled/react', @@ -129,7 +129,7 @@ mod._resolveFilename = function ( mod.prototype.require = function (request: string) { if ( - process.env.NODE_ENV === 'production' && + process.env.NODE_ENV !== 'development' && process.env.__NEXT_PRIVATE_RENDER_RUNTIME ) { if (request.endsWith('.shared-runtime')) { From 3a7283aae02eefcde574acdab31a8e3c4cffaf04 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 15:43:43 +0200 Subject: [PATCH 063/101] fix lint --- .eslintrc.json | 5 ++++- packages/next/src/build/entries.ts | 1 - packages/next/src/build/webpack/loaders/next-app-loader.ts | 2 -- packages/next/src/server/dev/hot-reloader.ts | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 67a879a8193fe..0de223eb66a56 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -161,7 +161,10 @@ }, { "files": ["packages/**"], - "excludedFiles": ["packages/next/taskfile*.js"], + "excludedFiles": [ + "packages/next/taskfile*.js", + "packages/next/webpack-config.js" + ], "rules": { "no-shadow": ["warn", { "builtinGlobals": false }], "import/no-extraneous-dependencies": [ diff --git a/packages/next/src/build/entries.ts b/packages/next/src/build/entries.ts index 69da677cb78f6..e090732a2a948 100644 --- a/packages/next/src/build/entries.ts +++ b/packages/next/src/build/entries.ts @@ -647,7 +647,6 @@ export async function createEntrypoints( middlewareConfig: Buffer.from( JSON.stringify(staticInfo.middleware || {}) ).toString('base64'), - isEdge: true, }).import } const normalizedServerBundlePath = diff --git a/packages/next/src/build/webpack/loaders/next-app-loader.ts b/packages/next/src/build/webpack/loaders/next-app-loader.ts index 9fb2ed44702cd..1f03fe48a266f 100644 --- a/packages/next/src/build/webpack/loaders/next-app-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-app-loader.ts @@ -38,7 +38,6 @@ export type AppLoaderOptions = { basePath: string nextConfigOutput?: NextConfig['output'] middlewareConfig: string - isEdge?: boolean } type AppLoader = webpack.LoaderDefinitionFunction @@ -415,7 +414,6 @@ const nextAppLoader: AppLoader = async function nextAppLoader() { preferredRegion, basePath, middlewareConfig: middlewareConfigBase64, - isEdge, } = loaderOptions const buildInfo = getModuleBuildInfo((this as any)._module) diff --git a/packages/next/src/server/dev/hot-reloader.ts b/packages/next/src/server/dev/hot-reloader.ts index 3143c8f590834..68aa05fb097e0 100644 --- a/packages/next/src/server/dev/hot-reloader.ts +++ b/packages/next/src/server/dev/hot-reloader.ts @@ -819,7 +819,6 @@ export default class HotReloader { middlewareConfig: Buffer.from( JSON.stringify(staticInfo.middleware || {}) ).toString('base64'), - isEdge: true, }).import : undefined From 85476d4db5a65316926038a7dff15fd11a5f906a Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 16:24:19 +0200 Subject: [PATCH 064/101] fix otel --- .eslintrc.json | 2 +- packages/next/taskfile-webpack.js | 6 + packages/next/webpack.config.js | 11 +- test/e2e/opentelemetry/opentelemetry.test.ts | 456 ++++++++++--------- 4 files changed, 246 insertions(+), 229 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 0de223eb66a56..2d2c9d828992b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -163,7 +163,7 @@ "files": ["packages/**"], "excludedFiles": [ "packages/next/taskfile*.js", - "packages/next/webpack-config.js" + "packages/next/webpack.config.js" ], "rules": { "no-shadow": ["warn", { "builtinGlobals": false }], diff --git a/packages/next/taskfile-webpack.js b/packages/next/taskfile-webpack.js index bcf713df440c1..04495d7b3621c 100644 --- a/packages/next/taskfile-webpack.js +++ b/packages/next/taskfile-webpack.js @@ -21,6 +21,12 @@ module.exports = function (task) { console.error(err || stats.toString()) reject(err || stats.toString()) } + if (process.env.ANALYZE) { + require('fs').writeFileSync( + require('path').join(__dirname, options.name + '-stats.json'), + JSON.stringify(stats.toJson()) + ) + } resolve() }) }) diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index ad76b2b50aa05..5e99203a0484f 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -36,10 +36,13 @@ const minimalExternals = [ ] const externalsMap = { - '/(.*)config$/': 'next/dist/server/config', './web/sandbox': 'next/dist/server/web/sandbox', } +const externalsRegexMap = { + '(.*)trace/tracer$': 'next/dist/server/lib/trace/tracer', +} + module.exports = ({ dev }) => { const externalHandler = ({ context, request, getResolve }, callback) => { ;(async () => { @@ -55,6 +58,12 @@ module.exports = ({ dev }) => { ) callback(null, `commonjs ${relative}`) } else { + const regexMatch = Object.keys(externalsRegexMap).find((regex) => + new RegExp(regex).test(request) + ) + if (regexMatch) { + return callback(null, 'commonjs ' + externalsRegexMap[regexMatch]) + } callback() } })() diff --git a/test/e2e/opentelemetry/opentelemetry.test.ts b/test/e2e/opentelemetry/opentelemetry.test.ts index ae798ec7c5c2d..13e0fefea2787 100644 --- a/test/e2e/opentelemetry/opentelemetry.test.ts +++ b/test/e2e/opentelemetry/opentelemetry.test.ts @@ -77,80 +77,80 @@ createNextDescribe( await check(async () => { expect(await getSanitizedTraces(1)).toMatchInlineSnapshot(` - Array [ - Object { - "attributes": Object { - "http.method": "GET", - "http.url": "https://vercel.com/", - "net.peer.name": "vercel.com", - "next.span_name": "fetch GET https://vercel.com/", - "next.span_type": "AppRender.fetch", - }, - "kind": 2, - "name": "fetch GET https://vercel.com/", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.route": "/app/[param]/rsc-fetch", - "next.span_name": "render route (app) /app/[param]/rsc-fetch", - "next.span_type": "AppRender.getBodyResult", - }, - "kind": 0, - "name": "render route (app) /app/[param]/rsc-fetch", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "http.method": "GET", - "http.route": "/app/[param]/rsc-fetch", - "http.status_code": 200, - "http.target": "/app/param/rsc-fetch", - "next.route": "/app/[param]/rsc-fetch", - "next.span_name": "GET /app/[param]/rsc-fetch", - "next.span_type": "BaseServer.handleRequest", - }, - "kind": 1, - "name": "GET /app/[param]/rsc-fetch", - "parentId": undefined, - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.page": "/app/[param]/layout", - "next.span_name": "generateMetadata /app/[param]/layout", - "next.span_type": "ResolveMetadata.generateMetadata", - }, - "kind": 0, - "name": "generateMetadata /app/[param]/layout", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.page": "/app/[param]/rsc-fetch/page", - "next.span_name": "generateMetadata /app/[param]/rsc-fetch/page", - "next.span_type": "ResolveMetadata.generateMetadata", - }, - "kind": 0, - "name": "generateMetadata /app/[param]/rsc-fetch/page", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - ] - `) + Array [ + Object { + "attributes": Object { + "http.method": "GET", + "http.url": "https://vercel.com/", + "net.peer.name": "vercel.com", + "next.span_name": "fetch GET https://vercel.com/", + "next.span_type": "AppRender.fetch", + }, + "kind": 2, + "name": "fetch GET https://vercel.com/", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.route": "/app/[param]/rsc-fetch", + "next.span_name": "render route (app) /app/[param]/rsc-fetch", + "next.span_type": "AppRender.getBodyResult", + }, + "kind": 0, + "name": "render route (app) /app/[param]/rsc-fetch", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "http.method": "GET", + "http.route": "/app/[param]/rsc-fetch", + "http.status_code": 200, + "http.target": "/app/param/rsc-fetch", + "next.route": "/app/[param]/rsc-fetch", + "next.span_name": "GET /app/[param]/rsc-fetch", + "next.span_type": "BaseServer.handleRequest", + }, + "kind": 1, + "name": "GET /app/[param]/rsc-fetch", + "parentId": undefined, + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.page": "/app/[param]/layout", + "next.span_name": "generateMetadata /app/[param]/layout", + "next.span_type": "ResolveMetadata.generateMetadata", + }, + "kind": 0, + "name": "generateMetadata /app/[param]/layout", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.page": "/app/[param]/rsc-fetch/page", + "next.span_name": "generateMetadata /app/[param]/rsc-fetch/page", + "next.span_type": "ResolveMetadata.generateMetadata", + }, + "kind": 0, + "name": "generateMetadata /app/[param]/rsc-fetch/page", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + ] + `) return 'success' }, 'success') }) @@ -160,37 +160,39 @@ createNextDescribe( await check(async () => { expect(await getSanitizedTraces(1)).toMatchInlineSnapshot(` - Array [ - Object { - "attributes": Object { - "next.route": "/api/app/[param]/data/route", - "next.span_name": "executing api route (app) /api/app/[param]/data/route", - "next.span_type": "AppRouteRouteHandlers.runHandler", - }, - "kind": 0, - "name": "executing api route (app) /api/app/[param]/data/route", - "parentId": "[parent-id]", - "status": Object { - "code": 0, + Array [ + Object { + "attributes": Object { + "next.route": "/api/app/[param]/data/route", + "next.span_name": "executing api route (app) /api/app/[param]/data/route", + "next.span_type": "AppRouteRouteHandlers.runHandler", + }, + "kind": 0, + "name": "executing api route (app) /api/app/[param]/data/route", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, }, - }, - Object { - "attributes": Object { - "http.method": "GET", - "http.status_code": 200, - "http.target": "/api/app/param/data", - "next.span_name": "GET /api/app/param/data", - "next.span_type": "BaseServer.handleRequest", + Object { + "attributes": Object { + "http.method": "GET", + "http.route": "/api/app/[param]/data/route", + "http.status_code": 200, + "http.target": "/api/app/param/data", + "next.route": "/api/app/[param]/data/route", + "next.span_name": "GET /api/app/[param]/data/route", + "next.span_type": "BaseServer.handleRequest", + }, + "kind": 1, + "name": "GET /api/app/[param]/data/route", + "parentId": undefined, + "status": Object { + "code": 0, + }, }, - "kind": 1, - "name": "GET /api/app/param/data", - "parentId": undefined, - "status": Object { - "code": 0, - }, - }, - ] - `) + ] + `) return 'success' }, 'success') }) @@ -202,52 +204,52 @@ createNextDescribe( await check(async () => { expect(await getSanitizedTraces(1)).toMatchInlineSnapshot(` - Array [ - Object { - "attributes": Object { - "http.method": "GET", - "http.route": "/pages/[param]/getServerSideProps", - "http.status_code": 200, - "http.target": "/pages/param/getServerSideProps", - "next.route": "/pages/[param]/getServerSideProps", - "next.span_name": "GET /pages/[param]/getServerSideProps", - "next.span_type": "BaseServer.handleRequest", - }, - "kind": 1, - "name": "GET /pages/[param]/getServerSideProps", - "parentId": undefined, - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.route": "/pages/[param]/getServerSideProps", - "next.span_name": "getServerSideProps /pages/[param]/getServerSideProps", - "next.span_type": "Render.getServerSideProps", - }, - "kind": 0, - "name": "getServerSideProps /pages/[param]/getServerSideProps", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.route": "/pages/[param]/getServerSideProps", - "next.span_name": "render route (pages) /pages/[param]/getServerSideProps", - "next.span_type": "Render.renderDocument", - }, - "kind": 0, - "name": "render route (pages) /pages/[param]/getServerSideProps", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - ] - `) + Array [ + Object { + "attributes": Object { + "http.method": "GET", + "http.route": "/pages/[param]/getServerSideProps", + "http.status_code": 200, + "http.target": "/pages/param/getServerSideProps", + "next.route": "/pages/[param]/getServerSideProps", + "next.span_name": "GET /pages/[param]/getServerSideProps", + "next.span_type": "BaseServer.handleRequest", + }, + "kind": 1, + "name": "GET /pages/[param]/getServerSideProps", + "parentId": undefined, + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.route": "/pages/[param]/getServerSideProps", + "next.span_name": "getServerSideProps /pages/[param]/getServerSideProps", + "next.span_type": "Render.getServerSideProps", + }, + "kind": 0, + "name": "getServerSideProps /pages/[param]/getServerSideProps", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.route": "/pages/[param]/getServerSideProps", + "next.span_name": "render route (pages) /pages/[param]/getServerSideProps", + "next.span_type": "Render.renderDocument", + }, + "kind": 0, + "name": "render route (pages) /pages/[param]/getServerSideProps", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + ] + `) return 'success' }, 'success') }) @@ -257,52 +259,52 @@ createNextDescribe( await check(async () => { expect(await getSanitizedTraces(1)).toMatchInlineSnapshot(` - Array [ - Object { - "attributes": Object { - "http.method": "GET", - "http.route": "/pages/[param]/getStaticProps", - "http.status_code": 200, - "http.target": "/pages/param/getStaticProps", - "next.route": "/pages/[param]/getStaticProps", - "next.span_name": "GET /pages/[param]/getStaticProps", - "next.span_type": "BaseServer.handleRequest", - }, - "kind": 1, - "name": "GET /pages/[param]/getStaticProps", - "parentId": undefined, - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.route": "/pages/[param]/getStaticProps", - "next.span_name": "getStaticProps /pages/[param]/getStaticProps", - "next.span_type": "Render.getStaticProps", - }, - "kind": 0, - "name": "getStaticProps /pages/[param]/getStaticProps", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.route": "/pages/[param]/getStaticProps", - "next.span_name": "render route (pages) /pages/[param]/getStaticProps", - "next.span_type": "Render.renderDocument", - }, - "kind": 0, - "name": "render route (pages) /pages/[param]/getStaticProps", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - ] - `) + Array [ + Object { + "attributes": Object { + "http.method": "GET", + "http.route": "/pages/[param]/getStaticProps", + "http.status_code": 200, + "http.target": "/pages/param/getStaticProps", + "next.route": "/pages/[param]/getStaticProps", + "next.span_name": "GET /pages/[param]/getStaticProps", + "next.span_type": "BaseServer.handleRequest", + }, + "kind": 1, + "name": "GET /pages/[param]/getStaticProps", + "parentId": undefined, + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.route": "/pages/[param]/getStaticProps", + "next.span_name": "getStaticProps /pages/[param]/getStaticProps", + "next.span_type": "Render.getStaticProps", + }, + "kind": 0, + "name": "getStaticProps /pages/[param]/getStaticProps", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.route": "/pages/[param]/getStaticProps", + "next.span_name": "render route (pages) /pages/[param]/getStaticProps", + "next.span_type": "Render.renderDocument", + }, + "kind": 0, + "name": "render route (pages) /pages/[param]/getStaticProps", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + ] + `) return 'success' }, 'success') }) @@ -312,38 +314,38 @@ createNextDescribe( await check(async () => { expect(await getSanitizedTraces(1)).toMatchInlineSnapshot(` - Array [ - Object { - "attributes": Object { - "http.method": "GET", - "http.route": "/api/pages/[param]/basic", - "http.status_code": 200, - "http.target": "/api/pages/param/basic", - "next.route": "/api/pages/[param]/basic", - "next.span_name": "GET /api/pages/[param]/basic", - "next.span_type": "BaseServer.handleRequest", - }, - "kind": 1, - "name": "GET /api/pages/[param]/basic", - "parentId": undefined, - "status": Object { - "code": 0, - }, - }, - Object { - "attributes": Object { - "next.span_name": "executing api route (pages) /api/pages/[param]/basic", - "next.span_type": "Node.runHandler", - }, - "kind": 0, - "name": "executing api route (pages) /api/pages/[param]/basic", - "parentId": "[parent-id]", - "status": Object { - "code": 0, - }, - }, - ] - `) + Array [ + Object { + "attributes": Object { + "http.method": "GET", + "http.route": "/api/pages/[param]/basic", + "http.status_code": 200, + "http.target": "/api/pages/param/basic", + "next.route": "/api/pages/[param]/basic", + "next.span_name": "GET /api/pages/[param]/basic", + "next.span_type": "BaseServer.handleRequest", + }, + "kind": 1, + "name": "GET /api/pages/[param]/basic", + "parentId": undefined, + "status": Object { + "code": 0, + }, + }, + Object { + "attributes": Object { + "next.span_name": "executing api route (pages) /api/pages/[param]/basic", + "next.span_type": "Node.runHandler", + }, + "kind": 0, + "name": "executing api route (pages) /api/pages/[param]/basic", + "parentId": "[parent-id]", + "status": Object { + "code": 0, + }, + }, + ] + `) return 'success' }, 'success') }) From 9461423a9ad5ef6b709ff2c544f262a7da225700 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 16:36:36 +0200 Subject: [PATCH 065/101] fix action test --- test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts b/test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts index a61e222c3872e..3e5e6b82ea050 100644 --- a/test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts +++ b/test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts @@ -113,7 +113,7 @@ createNextDescribe( await check(() => { const fullLog = logs.join('') - return fullLog.includes('Error: Body exceeded 1.5mb limit') && + return fullLog.includes('[Error]: Body exceeded 1.5mb limit') && fullLog.includes( 'To configure the body size limit for Server Actions, see' ) From 37c34bba9bc0d48effd92cc2749452677d501d9f Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 16:55:58 +0200 Subject: [PATCH 066/101] fix test --- test/e2e/prerender.test.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/e2e/prerender.test.ts b/test/e2e/prerender.test.ts index f21b4224fe236..1ff677e583b15 100644 --- a/test/e2e/prerender.test.ts +++ b/test/e2e/prerender.test.ts @@ -2070,7 +2070,6 @@ describe('Prerender', () => { /node_modules\/react\/index\.js/, /node_modules\/react\/package\.json/, /node_modules\/react\/cjs\/react\.production\.min\.js/, - /node_modules\/next/, ], notTests: [], }, @@ -2082,7 +2081,6 @@ describe('Prerender', () => { /node_modules\/react\/index\.js/, /node_modules\/react\/package\.json/, /node_modules\/react\/cjs\/react\.production\.min\.js/, - /node_modules\/next/, /\/world.txt/, ], notTests: [ @@ -2098,9 +2096,6 @@ describe('Prerender', () => { /node_modules\/react\/index\.js/, /node_modules\/react\/package\.json/, /node_modules\/react\/cjs\/react\.production\.min\.js/, - /node_modules\/next/, - /next\/router\.js/, - /next\/dist\/client\/router\.js/, /node_modules\/@firebase\/firestore\/.*?\.js/, ], notTests: [/\/world.txt/], From cec06668d8af0fccbfe85befdf5b3cbffdaed4d3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 17:21:25 +0200 Subject: [PATCH 067/101] fix external --- packages/next/src/build/webpack-config.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index ff83d7228ccf0..da76acf1dc5b4 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1305,20 +1305,6 @@ export default async function getBaseWebpackConfig( resolveRequest: string ) => Promise<[string | null, boolean]> ) { - // if ( - // request.includes('dist/compiled/next-server/app-page-render.runtime.js') - // ) { - // return `next/dist/compiled/next-server/app-page-render.runtime.js` - // } - - // if (request.includes('dist/compiled/next-server/pages-render.runtime.js')) { - // return `next/dist/compiled/next-server/pages-render.runtime.js` - // } - - // if (request.includes('dist/compiled/next-server/pages-api.runtime.js')) { - // return `next/dist/compiled/next-server/pages-api.runtime.js` - // } - // We need to externalize internal requests for files intended to // not be bundled. const isLocal: boolean = @@ -1447,7 +1433,9 @@ export default async function getBaseWebpackConfig( const isExternal = externalPattern.test(localRes) if (isExternal) { - return `commonjs ${localRes}` + // it's important we return the path that starts with `next/dist/` here instead of the absolute path + // otherwise NFT will get tripped up + return `commonjs ${localRes.replace(/.*?next[\/\\]dist/, 'next/dist')}` } if (isSharedRuntime) { if (dev) { From 2d6ff40df55102ca260aeedba5144437c67e0c98 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Mon, 7 Aug 2023 17:32:45 +0200 Subject: [PATCH 068/101] fix lint --- packages/next/src/build/webpack-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index da76acf1dc5b4..0ed3d8272c456 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1435,7 +1435,7 @@ export default async function getBaseWebpackConfig( if (isExternal) { // it's important we return the path that starts with `next/dist/` here instead of the absolute path // otherwise NFT will get tripped up - return `commonjs ${localRes.replace(/.*?next[\/\\]dist/, 'next/dist')}` + return `commonjs ${localRes.replace(/.*?next[/\\]dist/, 'next/dist')}` } if (isSharedRuntime) { if (dev) { From 28f66a4e8247cd11c1ee1a0f72d7d6d35dc46553 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 12:39:40 +0200 Subject: [PATCH 069/101] add rs plugin --- .../crates/next-core/src/next_import_map.rs | 5 +-- .../next-core/src/next_server/context.rs | 9 +++- .../next-core/src/next_shared/resolve.rs | 41 ++++++++++++++++++- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 485e45c23126d..128deb8358a2e 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -217,8 +217,6 @@ pub async fn get_next_server_import_map( match ty { ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } => { - import_map.insert_exact_alias("next", external); - import_map.insert_wildcard_alias("next/", external); import_map.insert_exact_alias("react", external); import_map.insert_wildcard_alias("react/", external); import_map.insert_exact_alias("react-dom", external); @@ -231,7 +229,7 @@ pub async fn get_next_server_import_map( | ServerContextType::AppRSC { .. } | ServerContextType::AppRoute { .. } => { match mode { - NextMode::Development | NextMode::Build => { + NextMode::Build => { import_map.insert_wildcard_alias("next/dist/server/", external); import_map.insert_wildcard_alias("next/dist/shared/", external); } @@ -239,6 +237,7 @@ pub async fn get_next_server_import_map( // The sandbox can't be bundled and needs to be external import_map.insert_exact_alias("next/dist/server/web/sandbox", external); } + NextMode::Development => {} } import_map.insert_exact_alias( "next/head", diff --git a/packages/next-swc/crates/next-core/src/next_server/context.rs b/packages/next-swc/crates/next-core/src/next_server/context.rs index 1f9b7e4aceb78..e0b0ec843859b 100644 --- a/packages/next-swc/crates/next-core/src/next_server/context.rs +++ b/packages/next-swc/crates/next-core/src/next_server/context.rs @@ -46,7 +46,10 @@ use crate::{ next_import_map::{get_next_server_import_map, mdx_import_source_file}, next_server::resolve::ExternalPredicate, next_shared::{ - resolve::{ModuleFeatureReportResolvePlugin, UnsupportedModulesResolvePlugin}, + resolve::{ + ModuleFeatureReportResolvePlugin, NextExternalResolvePlugin, + UnsupportedModulesResolvePlugin, + }, transforms::{ emotion::get_emotion_transform_plugin, get_relay_transform_plugin, styled_components::get_styled_components_transform_plugin, @@ -121,12 +124,15 @@ pub async fn get_server_resolve_options_context( ExternalPredicate::AllExcept(next_config.transpile_packages()).cell(), ); + let next_external_plugin = NextExternalResolvePlugin::new(project_path); + let plugins = match ty { ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } => { vec![ Vc::upcast(module_feature_report_resolve_plugin), Vc::upcast(external_cjs_modules_plugin), Vc::upcast(unsupported_modules_resolve_plugin), + Vc::upcast(next_external_plugin), ] } ServerContextType::AppSSR { .. } @@ -137,6 +143,7 @@ pub async fn get_server_resolve_options_context( Vc::upcast(module_feature_report_resolve_plugin), Vc::upcast(server_component_externals_plugin), Vc::upcast(unsupported_modules_resolve_plugin), + Vc::upcast(next_external_plugin), ] } }; diff --git a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs index 46ba476b331e9..b412b8ac3c0f1 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs @@ -13,7 +13,7 @@ use turbopack_binding::{ parse::Request, pattern::Pattern, plugin::{ResolvePlugin, ResolvePluginCondition}, - ResolveResultOption, + ResolveResult, ResolveResultItem, ResolveResultOption, }, }, }; @@ -102,6 +102,45 @@ impl ResolvePlugin for UnsupportedModulesResolvePlugin { } } +#[turbo_tasks::value] +pub(crate) struct NextExternalResolvePlugin { + root: Vc, +} + +#[turbo_tasks::value_impl] +impl NextExternalResolvePlugin { + #[turbo_tasks::function] + pub fn new(root: Vc) -> Vc { + NextExternalResolvePlugin { root }.cell() + } +} + +#[turbo_tasks::value_impl] +impl ResolvePlugin for NextExternalResolvePlugin { + #[turbo_tasks::function] + fn after_resolve_condition(&self) -> Vc { + ResolvePluginCondition::new( + self.root.root(), + Glob::new( + "**/next/dist/**/*.{external,shared-runtime,runtime.dev,runtime.prod}.js" + .to_string(), + ), + ) + } + + #[turbo_tasks::function] + async fn after_resolve( + &self, + _fs_path: Vc, + _context: Vc, + _request: Vc, + ) -> Result> { + Ok(Vc::cell(Some( + ResolveResult::primary(ResolveResultItem::OriginalReferenceExternal).into(), + ))) + } +} + /// A resolver plugin tracks the usage of certain import paths, emit /// telemetry events if there is a match. #[turbo_tasks::value] From a6e96371f230da9ce5fd12018cb64a8165facb12 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 12:57:49 +0200 Subject: [PATCH 070/101] remove require hook from next swc --- packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx | 1 - .../crates/next-core/js/src/internal/page-server-handler.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index 73a97a1a65001..dbf3ff2c34bd9 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -2,7 +2,6 @@ // the other imports import startOperationStreamHandler from '../internal/operation-stream' -import 'next/dist/server/require-hook.js' import '../polyfill/app-polyfills.ts' import type { IncomingMessage } from 'node:http' diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index 945e77369be08..1ff513fd8ee4c 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -2,7 +2,6 @@ // the other imports import { IPC } from '@vercel/turbopack-node/ipc/index' -import 'next/dist/server/require-hook.js' import 'next/dist/server/node-polyfill-fetch.js' import './shims' From 416ecdf980e77947e4c643f03e8899030543399d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 13:24:28 +0200 Subject: [PATCH 071/101] add alias for next build --- packages/next-swc/crates/next-core/src/next_import_map.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 128deb8358a2e..75e6240347151 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -224,6 +224,8 @@ pub async fn get_next_server_import_map( import_map.insert_exact_alias("styled-jsx", external); import_map.insert_wildcard_alias("styled-jsx/", external); import_map.insert_exact_alias("react-server-dom-webpack/", external); + // TODO: we should not bundle next/dist/build/utils in the pages renderer at all + import_map.insert_wildcard_alias("next/dist/build/utils", external); } ServerContextType::AppSSR { .. } | ServerContextType::AppRSC { .. } From 744167df8bcbd10ffa3013f2bdfa5495251b4d3d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:02:32 +0200 Subject: [PATCH 072/101] cleanup tracing logic --- packages/next/src/build/index.ts | 21 ----- .../build/utils/trace-module/trace-module.ts | 85 ------------------- .../src/build/utils/trace-module/worker.ts | 54 ------------ 3 files changed, 160 deletions(-) delete mode 100644 packages/next/src/build/utils/trace-module/trace-module.ts delete mode 100644 packages/next/src/build/utils/trace-module/worker.ts diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 0bcc3589ddcbb..679c04d102dfa 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -141,7 +141,6 @@ import { createValidFileMatcher } from '../server/lib/find-page-file' import { startTypeChecking } from './type-check' import { generateInterceptionRoutesRewrites } from '../lib/generate-interception-routes-rewrites' -import { traceModule } from './utils/trace-module/trace-module' import { buildDataRoute } from '../server/lib/router-utils/build-data-route' import { baseOverrides, experimentalOverrides } from '../server/require-hook' import { initialize } from '../server/lib/incremental-cache-server' @@ -1750,26 +1749,6 @@ export default async function build( } } - if ( - process.env.NEXT_TRACE_MODULES && - !isEdgeRuntime(pageRuntime) && - !isStatic && - !isSsg && - !isReservedPage(page) && - pageInfos.get(page) === undefined - ) { - const pagePathNormal = path.join( - path.dirname(pagePath), - path.parse(pagePath).name - ) - await traceModule( - path.resolve( - path.join(distDir, 'server', pageType, pagePathNormal) - ), - distDir - ) - } - pageInfos.set(page, { size: selfSize, totalSize: allSize, diff --git a/packages/next/src/build/utils/trace-module/trace-module.ts b/packages/next/src/build/utils/trace-module/trace-module.ts deleted file mode 100644 index c5b60b6671064..0000000000000 --- a/packages/next/src/build/utils/trace-module/trace-module.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Worker } from 'worker_threads' -import path from 'path' -import chalk from 'next/dist/compiled/chalk' - -let worker: any - -function prettyPrint( - node: any, - distDir: string, - prefix = '', - isLast = false, - isRoot = true -) { - let duration = `${node.selfDuration.toFixed( - 2 - )}ms / ${node.totalDuration.toFixed(2)}ms` - - let output = `${prefix}${isLast || isRoot ? '└─ ' : '├─ '}${chalk.green( - path.relative(distDir, node.id) - )} ${chalk.yellow(duration)}\n` - - const childPrefix = `${prefix}${isRoot ? ' ' : isLast ? ' ' : '│ '}` - - node.children.forEach((child: any, i: number) => { - output += prettyPrint( - child, - node.id, - childPrefix, - i === node.children.length - 1, - false - ) - }) - - return output -} - -async function traceModuleImpl(modulePath: string, distDir: string) { - return new Promise((resolve) => { - const onResolve = ({ modulePath: mod, node }: any) => { - if (mod !== modulePath) { - return - } else { - worker.off('message', onResolve) - } - if (node?.error) { - console.log('failed for module', modulePath) - resolve(node) - } - require('fs').writeFileSync( - path.join(modulePath, '..', 'trace.json'), - node - ) - - console.log(prettyPrint(JSON.parse(node), distDir)) - resolve(node) - } - - worker.on('message', onResolve) - - worker.postMessage(modulePath) - }) -} - -const queue = [] as any[] -let pendingPromise = Promise.resolve() - -function runQueue() { - pendingPromise = pendingPromise.then(async () => { - while (queue.length > 0) { - const { modulePath, distDir, resolve } = queue.shift() - const node = await traceModuleImpl(modulePath, distDir) - resolve(node) - } - }) -} - -export function traceModule(modulePath: string, distDir: string) { - if (!worker) { - worker = new Worker(path.join(__dirname, 'worker.js'), {}) - } - return new Promise((resolve) => { - queue.push({ modulePath, distDir, resolve }) - runQueue() - }) -} diff --git a/packages/next/src/build/utils/trace-module/worker.ts b/packages/next/src/build/utils/trace-module/worker.ts deleted file mode 100644 index 4acd16652b4a8..0000000000000 --- a/packages/next/src/build/utils/trace-module/worker.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { parentPort } from 'worker_threads' - -// we import it to get all the relevant polyfills in place -require('next/dist/compiled/next-server/server.runtime.js') - -const originalCompile = require('module').prototype._compile - -let currentNode: any = null - -require('module').prototype._compile = function ( - _content: string, - filename: string -) { - let parent = currentNode - - currentNode = { - id: filename, - selfDuration: 0, - totalDuration: 0, - children: [], - } - - const start = performance.now() - const result = originalCompile.apply(this, arguments) - const end = performance.now() - - currentNode.totalDuration = end - start - currentNode.selfDuration = currentNode.children.reduce( - (acc: number, child: any) => acc - child.selfDuration, - currentNode.totalDuration - ) - - parent?.children.push(currentNode) - currentNode = parent || currentNode - return result -} - -parentPort?.on('message', (modulePath: string) => { - for (let moduleId in require.cache) { - delete require.cache[moduleId] - } - - try { - require(modulePath) - } catch (e) { - console.log(e) - parentPort?.postMessage({ - error: JSON.stringify(e), - }) - } - - parentPort?.postMessage({ modulePath, node: JSON.stringify(currentNode) }) - currentNode = null -}) From 01b79f81a4fdfdf0d129a83e8058befbbeb521cb Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:07:44 +0200 Subject: [PATCH 073/101] clean up route modules --- .../server/future/route-modules/app-page/module.compiled.ts | 6 +++--- .../next/src/server/future/route-modules/app-page/module.ts | 4 ++-- .../app-page/{externals.ts => shared-modules.ts} | 0 .../future/route-modules/app-route/module.compiled.ts | 6 +++--- .../src/server/future/route-modules/app-route/module.ts | 4 ++-- .../app-route/{externals.ts => shared-modules.ts} | 0 .../future/route-modules/pages-api/module.compiled.ts | 6 +++--- .../server/future/route-modules/pages/module.compiled.ts | 6 +++--- .../next/src/server/future/route-modules/pages/module.ts | 4 ++-- .../route-modules/pages/{externals.ts => shared-modules.ts} | 0 .../next/src/server/future/route-modules/route-module.ts | 4 ++-- 11 files changed, 20 insertions(+), 20 deletions(-) rename packages/next/src/server/future/route-modules/app-page/{externals.ts => shared-modules.ts} (100%) rename packages/next/src/server/future/route-modules/app-route/{externals.ts => shared-modules.ts} (100%) rename packages/next/src/server/future/route-modules/pages/{externals.ts => shared-modules.ts} (100%) diff --git a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts index 1f69a8abd3895..e04794e1cae4c 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts @@ -1,9 +1,9 @@ -if (process.env.NEXT_RUNTIME !== 'edge') { +if (process.env.NEXT_RUNTIME === 'edge') { + module.exports = require('next/dist/server/future/route-modules/app-page/module.js') +} else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') } else { module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') } -} else { - module.exports = require('next/dist/server/future/route-modules/app-page/module.js') } diff --git a/packages/next/src/server/future/route-modules/app-page/module.ts b/packages/next/src/server/future/route-modules/app-page/module.ts index 9693825287f90..daa0291a1c8b4 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.ts @@ -11,7 +11,7 @@ import { type RouteModuleOptions, type RouteModuleHandleContext, } from '../route-module' -import * as externals from './externals' +import * as sharedModules from './shared-modules' type AppPageUserlandModule = { /** @@ -35,7 +35,7 @@ export class AppPageRouteModule extends RouteModule< AppPageRouteDefinition, AppPageUserlandModule > { - static readonly externals = externals + static readonly sharedModules = sharedModules public render( req: IncomingMessage, diff --git a/packages/next/src/server/future/route-modules/app-page/externals.ts b/packages/next/src/server/future/route-modules/app-page/shared-modules.ts similarity index 100% rename from packages/next/src/server/future/route-modules/app-page/externals.ts rename to packages/next/src/server/future/route-modules/app-page/shared-modules.ts diff --git a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts index ea21d87ce1998..82156aede9199 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts @@ -1,9 +1,9 @@ -if (process.env.NEXT_RUNTIME !== 'edge') { +if (process.env.NEXT_RUNTIME === 'edge') { + module.exports = require('next/dist/server/future/route-modules/app-route/module.js') +} else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') } -} else { - module.exports = require('next/dist/server/future/route-modules/app-route/module.js') } diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index 89ee5f787e1e9..200e8d28f49e5 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -42,7 +42,7 @@ import { staticGenerationBailout } from '../../../../client/components/static-ge import { requestAsyncStorage } from '../../../../client/components/request-async-storage.external' import { staticGenerationAsyncStorage } from '../../../../client/components/static-generation-async-storage.external' import { actionAsyncStorage } from '../../../../client/components/action-async-storage.external' -import * as externals from './externals' +import * as sharedModules from './shared-modules' /** * AppRouteRouteHandlerContext is the context that is passed to the route @@ -139,7 +139,7 @@ export class AppRouteRouteModule extends RouteModule< */ public readonly staticGenerationBailout = staticGenerationBailout - public static readonly externals = externals + public static readonly sharedModules = sharedModules /** * A reference to the mutation related async storage, such as mutations of diff --git a/packages/next/src/server/future/route-modules/app-route/externals.ts b/packages/next/src/server/future/route-modules/app-route/shared-modules.ts similarity index 100% rename from packages/next/src/server/future/route-modules/app-route/externals.ts rename to packages/next/src/server/future/route-modules/app-route/shared-modules.ts diff --git a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts index 6465ee27439cd..860bca83527ab 100644 --- a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts @@ -1,9 +1,9 @@ -if (process.env.NEXT_RUNTIME !== 'edge') { +if (process.env.NEXT_RUNTIME === 'edge') { + module.exports = require('next/dist/server/future/route-modules/pages-api/module.js') +} else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') } else { module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') } -} else { - module.exports = require('next/dist/server/future/route-modules/pages-api/module.js') } diff --git a/packages/next/src/server/future/route-modules/pages/module.compiled.ts b/packages/next/src/server/future/route-modules/pages/module.compiled.ts index 5c43e381a19ad..ef28db3f84d09 100644 --- a/packages/next/src/server/future/route-modules/pages/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages/module.compiled.ts @@ -1,9 +1,9 @@ -if (process.env.NEXT_RUNTIME !== 'edge') { +if (process.env.NEXT_RUNTIME === 'edge') { + module.exports = require('next/dist/server/future/route-modules/pages/module.js') +} else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') } else { module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') } -} else { - module.exports = require('next/dist/server/future/route-modules/pages/module.js') } diff --git a/packages/next/src/server/future/route-modules/pages/module.ts b/packages/next/src/server/future/route-modules/pages/module.ts index 574f9038dc64b..e2730ef668901 100644 --- a/packages/next/src/server/future/route-modules/pages/module.ts +++ b/packages/next/src/server/future/route-modules/pages/module.ts @@ -18,7 +18,7 @@ import { type RouteModuleOptions, } from '../route-module' import { renderToHTMLImpl, renderToHTML } from '../../../render' -import * as externals from './externals' +import * as sharedModules from './shared-modules' /** * The userland module for a page. This is the module that is exported from the @@ -105,7 +105,7 @@ export class PagesRouteModule extends RouteModule< > { private readonly components: PagesComponents - static readonly externals = externals + static readonly sharedModules = sharedModules constructor(options: PagesRouteModuleOptions) { super(options) diff --git a/packages/next/src/server/future/route-modules/pages/externals.ts b/packages/next/src/server/future/route-modules/pages/shared-modules.ts similarity index 100% rename from packages/next/src/server/future/route-modules/pages/externals.ts rename to packages/next/src/server/future/route-modules/pages/shared-modules.ts diff --git a/packages/next/src/server/future/route-modules/route-module.ts b/packages/next/src/server/future/route-modules/route-module.ts index 51a7bcfcd7bd9..a8e5dd6c5945a 100644 --- a/packages/next/src/server/future/route-modules/route-module.ts +++ b/packages/next/src/server/future/route-modules/route-module.ts @@ -45,9 +45,9 @@ export abstract class RouteModule< public readonly definition: Readonly /** - * The externals that are required for the route module. + * The shared modules that are exposed and required for the route module. */ - public static readonly externals: any + public static readonly sharedModules: any constructor({ userland, definition }: RouteModuleOptions) { this.userland = userland From 7ae65e239173b11d8a96a65615a3028868235ad7 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:17:37 +0200 Subject: [PATCH 074/101] cleanup webpack config --- packages/next/src/build/webpack-config.ts | 55 +++++++---------------- 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 0ed3d8272c456..48bf7b45394a9 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1401,21 +1401,14 @@ export default async function getBaseWebpackConfig( // Also disable esm request when appDir is enabled const isEsmRequested = dependencyType === 'esm' + /** + * @param {string} localRes the full path to the file + * @returns {string | undefined} the externalized path + * @description returns an externalized path if the file is a Next.js file and ends with either `.shared-runtime.js` or `.external.js` + * This is used to ensure that files used across the rendering runtime(s) and the user code are one and the same. The logic in this function + * will rewrite the require to the correct bundle location depending on the layer at which the file is being used. + */ const isLocalCallback = (localRes: string) => { - // Makes sure dist/shared and dist/server are not bundled - // we need to process shared `router/router`, `head` and `dynamic`, - // so that the DefinePlugin can inject process.env values. - - // // Treat next internals as non-external for server layer - // if (isWebpackServerLayer(layer)) { - // return - // } - - // const isNextExternal = - // /next[/\\]dist[/\\](esm[\\/])?(shared|server)[/\\](?!lib[/\\](router[/\\]router|dynamic|app-dynamic|image-external|lazy-dynamic|head[^-]))/.test( - // localRes - // ) - const pathSeparators = '[/\\\\]' const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})` const sharedRuntimeFileEnd = '(\\.shared-runtime(\\.js)?)$' @@ -1432,11 +1425,16 @@ export default async function getBaseWebpackConfig( const isSharedRuntime = sharedRuntimePattern.test(localRes) const isExternal = externalPattern.test(localRes) + // if the file ends with .external, we need to make it a commonjs require in all cases + // this is used mainly to share the async local storage across the routing, rendering and user layers. if (isExternal) { // it's important we return the path that starts with `next/dist/` here instead of the absolute path // otherwise NFT will get tripped up return `commonjs ${localRes.replace(/.*?next[/\\]dist/, 'next/dist')}` } + // if the file ends with .shared-runtime, we need to make it point to the correct bundle depending on the layer + // this is because each shared-runtime files are unique per bundle, so if you use app-router context in pages, + // it'll be a different instance than the one used in the app-router runtime. if (isSharedRuntime) { if (dev) { return `commonjs ${localRes}` @@ -1447,30 +1445,9 @@ export default async function getBaseWebpackConfig( const camelCaseName = name.replace(/-([a-z])/g, (_, w) => w.toUpperCase() ) - // // Generate Next.js external import - // const externalRequest = path.posix.join( - // 'next', - // 'dist', - // path - // .relative( - // // Root of Next.js package: - // path.join(__dirname, '..'), - // localRes - // ) - // // Windows path normalization - // .replace(/\\/g, '/') - // ) - // return `commonjs ${externalRequest}` - - // if (isAppLayer) { - // // todo - // } else { - - // app vs pages - // - app - // - pages - // - api - // - app route + + // there's no externals for API routes but if need be, they'll need to be added here and have + // their own layer const runtime = layer === 'app-route-handler' ? 'app-route' @@ -1484,14 +1461,12 @@ export default async function getBaseWebpackConfig( 'dist', 'compiled', 'next-server', - // TODO: check if externals can happen for app routes or API routes `${runtime}.runtime.${dev ? 'dev' : 'prod'}` ), 'default', 'externals', camelCaseName, ] - // } } } From 0d4dbdce421e7f4d614171a9a915a90935944b6d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:19:54 +0200 Subject: [PATCH 075/101] cleanup entry-base --- .../next/src/server/app-render/entry-base.ts | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/packages/next/src/server/app-render/entry-base.ts b/packages/next/src/server/app-render/entry-base.ts index 1970777f28dfa..3efd671ccfb05 100644 --- a/packages/next/src/server/app-render/entry-base.ts +++ b/packages/next/src/server/app-render/entry-base.ts @@ -1,36 +1,9 @@ -// const { default: AppRouter } = -// require('next/dist/client/components/app-router') as typeof import('../../client/components/app-router') -// const { default: LayoutRouter } = -// require('next/dist/client/components/layout-router') as typeof import('../../client/components/layout-router') -// const { default: RenderFromTemplateContext } = -// require('next/dist/client/components/render-from-template-context') as typeof import('../../client/components/render-from-template-context') - -// const { staticGenerationAsyncStorage } = -// require('next/dist/client/components/static-generation-async-storage.shared-runtime') as typeof import('../../client/components/static-generation-async-storage.shared-runtime') - -// const { requestAsyncStorage } = -// require('next/dist/client/components/request-async-storage.shared-runtime') as typeof import('../../client/components/request-async-storage.shared-runtime') -// const { actionAsyncStorage } = -// require('next/dist/client/components/action-async-storage.shared-runtime') as typeof import('../../client/components/action-async-storage.shared-runtime') - -// const { staticGenerationBailout } = -// require('next/dist/client/components/static-generation-bailout') as typeof import('../../client/components/static-generation-bailout') -// const { default: StaticGenerationSearchParamsBailoutProvider } = -// require('next/dist/client/components/static-generation-searchparams-bailout-provider') as typeof import('../../client/components/static-generation-searchparams-bailout-provider') -// const { createSearchParamsBailoutProxy } = -// require('next/dist/client/components/searchparams-bailout-proxy') as typeof import('../../client/components/searchparams-bailout-proxy') - -// const serverHooks = -// require('next/dist/client/components/hooks-server-context') as typeof import('../../client/components/hooks-server-context') - const { renderToReadableStream, decodeReply, decodeAction, // eslint-disable-next-line import/no-extraneous-dependencies } = require('react-server-dom-webpack/server.edge') -// const { preloadStyle, preloadFont, preconnect } = -// require('next/dist/server/app-render/rsc/preloads') as typeof import('../../server/app-render/rsc/preloads') import AppRouter from '../../client/components/app-router' import LayoutRouter from '../../client/components/layout-router' From d57f74690ce631a9a065e977a0cc62774704ea37 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:23:08 +0200 Subject: [PATCH 076/101] misc cleanup --- test/e2e/app-dir/app-edge/next.config.js | 10 ---------- test/e2e/prerender-native-module.test.ts | 1 - 2 files changed, 11 deletions(-) delete mode 100644 test/e2e/app-dir/app-edge/next.config.js diff --git a/test/e2e/app-dir/app-edge/next.config.js b/test/e2e/app-dir/app-edge/next.config.js deleted file mode 100644 index f44f1b9459e21..0000000000000 --- a/test/e2e/app-dir/app-edge/next.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { - config.plugins.push((c) => - c.hooks.done.tap('test', (stats) => - console.log(stats.toString({ errorDetails: true })) - ) - ) - return config - }, -} diff --git a/test/e2e/prerender-native-module.test.ts b/test/e2e/prerender-native-module.test.ts index a2b8e4dc7a8d9..34adb36ce5bd8 100644 --- a/test/e2e/prerender-native-module.test.ts +++ b/test/e2e/prerender-native-module.test.ts @@ -97,7 +97,6 @@ describe('prerender native module', () => { ) const { version, files } = JSON.parse(contents) expect(version).toBe(1) - console.log(files, check.page) expect( check.tests.every((item) => files.some((file) => item.test(file))) ).toBe(true) From 39753ab1785b443764b9c727a9324567324e900d Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:27:24 +0200 Subject: [PATCH 077/101] add comment to require-hook --- packages/next/src/server/require-hook.ts | 29 +++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index aa12c7b4907d8..00aa22d16c40d 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -28,12 +28,6 @@ export const defaultOverrides = { 'styled-jsx/style': require.resolve('styled-jsx/style'), } -const currentRuntime = `${ - process.env.__NEXT_PRIVATE_RENDER_RUNTIME === 'pages' - ? 'next/dist/compiled/next-server/pages.runtime' - : 'next/dist/compiled/next-server/app-page.runtime' -}.${process.env.NODE_ENV === 'development' ? 'dev' : 'prod'}` - export const baseOverrides = { react: 'next/dist/compiled/react', 'react/package.json': 'next/dist/compiled/react/package.json', @@ -127,18 +121,27 @@ mod._resolveFilename = function ( // We use `bind` here to avoid referencing outside variables to create potential memory leaks. }.bind(null, resolveFilename, hookPropertyMap) -mod.prototype.require = function (request: string) { - if ( - process.env.NODE_ENV !== 'development' && - process.env.__NEXT_PRIVATE_RENDER_RUNTIME - ) { +// This is a hack to make sure that if a user requires a Next.js module that wasn't bundled +// that needs to point to the rendering runtime version, it will point to the correct one. +// This can happen on `pages` when a user requires a dependency that uses next/image for example. +// This is only needed in production as in development we fallback to the external version. +if ( + process.env.NODE_ENV !== 'development' && + process.env.__NEXT_PRIVATE_RENDER_RUNTIME +) { + const currentRuntime = `${ + process.env.__NEXT_PRIVATE_RENDER_RUNTIME === 'pages' + ? 'next/dist/compiled/next-server/pages.runtime' + : 'next/dist/compiled/next-server/app-page.runtime' + }.prod` + + mod.prototype.require = function (request: string) { if (request.endsWith('.shared-runtime')) { const base = path.basename(request, '.shared-runtime') const camelized = base.replace(/-([a-z])/g, (g) => g[1].toUpperCase()) const instance = originalRequire.call(this, currentRuntime) return instance.default.externals[camelized] } + return originalRequire.call(this, request) } - - return originalRequire.call(this, request) } From 3aae11fcfe9b522652f0f7e0c9e832d905c8ee99 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:48:46 +0200 Subject: [PATCH 078/101] tweak resolve --- .../next-swc/crates/next-core/src/next_shared/resolve.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs index b412b8ac3c0f1..677c35900d429 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs @@ -131,12 +131,14 @@ impl ResolvePlugin for NextExternalResolvePlugin { #[turbo_tasks::function] async fn after_resolve( &self, - _fs_path: Vc, + fs_path: Vc, _context: Vc, _request: Vc, ) -> Result> { + let raw_fs_path = &*fs_path.await?; + let path = (&raw_fs_path.path).to_string(); Ok(Vc::cell(Some( - ResolveResult::primary(ResolveResultItem::OriginalReferenceExternal).into(), + ResolveResult::primary(ResolveResultItem::OriginalReferenceTypeExternal(path)).into(), ))) } } From 29fdc96516af37ba6f47a134a617b2d11c598e83 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 14:58:07 +0200 Subject: [PATCH 079/101] fix compiler lint --- packages/next-swc/crates/next-core/src/next_shared/resolve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs index 677c35900d429..1cb41409c443c 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs @@ -136,7 +136,7 @@ impl ResolvePlugin for NextExternalResolvePlugin { _request: Vc, ) -> Result> { let raw_fs_path = &*fs_path.await?; - let path = (&raw_fs_path.path).to_string(); + let path = raw_fs_path.path.to_string(); Ok(Vc::cell(Some( ResolveResult::primary(ResolveResultItem::OriginalReferenceTypeExternal(path)).into(), ))) From 4a005150ec9e8c71971c9cae2767b56ed1fc7c6b Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 8 Aug 2023 15:17:29 +0200 Subject: [PATCH 080/101] rename externals --- packages/next/src/build/webpack-config.ts | 2 +- packages/next/src/server/require-hook.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 48bf7b45394a9..6515867b75a6a 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1464,7 +1464,7 @@ export default async function getBaseWebpackConfig( `${runtime}.runtime.${dev ? 'dev' : 'prod'}` ), 'default', - 'externals', + 'sharedModules', camelCaseName, ] } diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 00aa22d16c40d..3d329ca758922 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -140,7 +140,7 @@ if ( const base = path.basename(request, '.shared-runtime') const camelized = base.replace(/-([a-z])/g, (g) => g[1].toUpperCase()) const instance = originalRequire.call(this, currentRuntime) - return instance.default.externals[camelized] + return instance.default.sharedModules[camelized] } return originalRequire.call(this, request) } From b6e539fac69a1cf6a4735c0727a7380acc36a6df Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 16:11:57 +0200 Subject: [PATCH 081/101] fix path --- .../next-swc/crates/next-core/src/next_shared/resolve.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs index 1cb41409c443c..558a3a5259534 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs @@ -137,8 +137,15 @@ impl ResolvePlugin for NextExternalResolvePlugin { ) -> Result> { let raw_fs_path = &*fs_path.await?; let path = raw_fs_path.path.to_string(); + // Find the starting index of 'next/dist' and slice from that point. It should + // always be found since the glob pattern above is specific enough. + let starting_index = path.find("next/dist").unwrap(); + let modified_path = &path[starting_index..]; Ok(Vc::cell(Some( - ResolveResult::primary(ResolveResultItem::OriginalReferenceTypeExternal(path)).into(), + ResolveResult::primary(ResolveResultItem::OriginalReferenceTypeExternal( + modified_path.to_string(), + )) + .into(), ))) } } From cc403872de88bf8f423d5cb5ea49858ebb2a4635 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 16:34:22 +0200 Subject: [PATCH 082/101] cleanup --- packages/next/src/build/webpack-config.ts | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 6515867b75a6a..de5aca34dc111 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -102,6 +102,19 @@ const reactPackagesRegex = /^(react|react-dom|react-server-dom-webpack)($|\/)/ const asyncStoragesRegex = /next[\\/]dist[\\/](esm[\\/])?client[\\/]components[\\/](static-generation-async-storage|action-async-storage|request-async-storage)/ +const pathSeparators = '[/\\\\]' +const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})` +const sharedRuntimeFileEnd = '(\\.shared-runtime(\\.js)?)$' +const externalFileEnd = '(\\.external(\\.js)?)$' +const nextDist = `next${pathSeparators}dist` + +const sharedRuntimePattern = new RegExp( + `${nextDist}${optionalEsmPart}.*${sharedRuntimeFileEnd}` +) +const externalPattern = new RegExp( + `${nextDist}${optionalEsmPart}.*${externalFileEnd}` +) + // exports. const edgeConditionNames = [ 'edge-light', @@ -1327,7 +1340,7 @@ export default async function getBaseWebpackConfig( WEBPACK_LAYERS.serverSideRendering, WEBPACK_LAYERS.appPagesBrowser, WEBPACK_LAYERS.actionBrowser, - 'app-route-handler', + WEBPACK_LAYERS.appRouteHandler, ].includes(layer!) if ( @@ -1409,19 +1422,6 @@ export default async function getBaseWebpackConfig( * will rewrite the require to the correct bundle location depending on the layer at which the file is being used. */ const isLocalCallback = (localRes: string) => { - const pathSeparators = '[/\\\\]' - const optionalEsmPart = `((${pathSeparators}esm)?${pathSeparators})` - const sharedRuntimeFileEnd = '(\\.shared-runtime(\\.js)?)$' - const externalFileEnd = '(\\.external(\\.js)?)$' - const nextDist = `next${pathSeparators}dist` - - const sharedRuntimePattern = new RegExp( - `${nextDist}${optionalEsmPart}.*${sharedRuntimeFileEnd}` - ) - const externalPattern = new RegExp( - `${nextDist}${optionalEsmPart}.*${externalFileEnd}` - ) - const isSharedRuntime = sharedRuntimePattern.test(localRes) const isExternal = externalPattern.test(localRes) @@ -1988,7 +1988,7 @@ export default async function getBaseWebpackConfig( ? [ { layer: WEBPACK_LAYERS.appRouteHandler, - test: /\/route\.(js|ts)x?$/, + test: /private-next-app-dir\/.*\/route\.js$/, }, { // Make sure that AsyncLocalStorage module instance is shared between server and client From f0bb4f6eb5ec1fa825bd3e1624d02a41705393c3 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 16:50:35 +0200 Subject: [PATCH 083/101] fix lint --- packages/next/src/build/webpack-config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index de5aca34dc111..91b6cab10b212 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1049,7 +1049,7 @@ export default async function getBaseWebpackConfig( const customRootAliases: { [key: string]: string[] } = {} if (dev) { - const nextDist = 'next/dist/' + (isEdgeServer ? 'esm/' : '') + const nextDistPath = 'next/dist/' + (isEdgeServer ? 'esm/' : '') customAppAliases[`${PAGES_DIR_ALIAS}/_app`] = [ ...(pagesDir ? pageExtensions.reduce((prev, ext) => { @@ -1057,7 +1057,7 @@ export default async function getBaseWebpackConfig( return prev }, [] as string[]) : []), - `${nextDist}pages/_app.js`, + `${nextDistPath}pages/_app.js`, ] customAppAliases[`${PAGES_DIR_ALIAS}/_error`] = [ ...(pagesDir @@ -1066,7 +1066,7 @@ export default async function getBaseWebpackConfig( return prev }, [] as string[]) : []), - `${nextDist}pages/_error.js`, + `${nextDistPath}pages/_error.js`, ] customDocumentAliases[`${PAGES_DIR_ALIAS}/_document`] = [ ...(pagesDir @@ -1075,7 +1075,7 @@ export default async function getBaseWebpackConfig( return prev }, [] as string[]) : []), - `${nextDist}pages/_document.js`, + `${nextDistPath}pages/_document.js`, ] } From 1b459f1efc4ada0456fbf4126b6ab65d36b25661 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 17:56:43 +0200 Subject: [PATCH 084/101] add turbo prod bundle --- .../route-modules/app-page/module.compiled.ts | 2 ++ .../route-modules/app-route/module.compiled.ts | 2 ++ .../route-modules/pages-api/module.compiled.ts | 2 ++ .../future/route-modules/pages/module.compiled.ts | 2 ++ packages/next/src/server/next-server.ts | 4 ++-- packages/next/src/server/require-hook.ts | 3 ++- packages/next/taskfile.js | 14 +++++++++++++- packages/next/webpack.config.js | 8 +++++--- 8 files changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts index e04794e1cae4c..78601739acbe5 100644 --- a/packages/next/src/server/future/route-modules/app-page/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-page/module.compiled.ts @@ -3,6 +3,8 @@ if (process.env.NEXT_RUNTIME === 'edge') { } else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js') + } else if (process.env.TURBOPACK) { + module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.prod.js') } else { module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js') } diff --git a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts index 82156aede9199..f5909104bc772 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.compiled.ts @@ -3,6 +3,8 @@ if (process.env.NEXT_RUNTIME === 'edge') { } else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/app-route.runtime.dev.js') + } else if (process.env.TURBOPACK) { + module.exports = require('next/dist/compiled/next-server/app-route-turbo.runtime.prod.js') } else { module.exports = require('next/dist/compiled/next-server/app-route.runtime.prod.js') } diff --git a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts index 860bca83527ab..ed74c41adb918 100644 --- a/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages-api/module.compiled.ts @@ -3,6 +3,8 @@ if (process.env.NEXT_RUNTIME === 'edge') { } else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/pages-api.runtime.dev.js') + } else if (process.env.TURBOPACK) { + module.exports = require('next/dist/compiled/next-server/pages-api-turbo.runtime.prod.js') } else { module.exports = require('next/dist/compiled/next-server/pages-api.runtime.prod.js') } diff --git a/packages/next/src/server/future/route-modules/pages/module.compiled.ts b/packages/next/src/server/future/route-modules/pages/module.compiled.ts index ef28db3f84d09..a935b62abdcad 100644 --- a/packages/next/src/server/future/route-modules/pages/module.compiled.ts +++ b/packages/next/src/server/future/route-modules/pages/module.compiled.ts @@ -3,6 +3,8 @@ if (process.env.NEXT_RUNTIME === 'edge') { } else { if (process.env.NODE_ENV === 'development') { module.exports = require('next/dist/compiled/next-server/pages.runtime.dev.js') + } else if (process.env.TURBOPACK) { + module.exports = require('next/dist/compiled/next-server/pages-turbo.runtime.prod.js') } else { module.exports = require('next/dist/compiled/next-server/pages.runtime.prod.js') } diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 16741480eb3cb..d4609be2396dd 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -466,7 +466,7 @@ export default class NextNodeServer extends BaseServer { if (this.hasAppDir && renderOpts.isAppPath) { const { renderToHTMLOrFlight: appRenderToHTMLOrFlight } = - require('./app-render/app-render') as typeof import('./app-render/app-render') + require('./future/route-modules/app-page/module.compiled') as typeof import('./app-render/app-render') return appRenderToHTMLOrFlight( req.originalRequest, res.originalResponse, @@ -479,7 +479,7 @@ export default class NextNodeServer extends BaseServer { // TODO: re-enable this once we've refactored to use implicit matches // throw new Error('Invariant: render should have used routeModule') - return require('./render').renderToHTML( + return require('./future/route-modules/pages/module.compiled').renderToHTML( req.originalRequest, res.originalResponse, pathname, diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 3d329ca758922..9063dbc6b65b2 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -127,7 +127,8 @@ mod._resolveFilename = function ( // This is only needed in production as in development we fallback to the external version. if ( process.env.NODE_ENV !== 'development' && - process.env.__NEXT_PRIVATE_RENDER_RUNTIME + process.env.__NEXT_PRIVATE_RENDER_RUNTIME && + !process.env.TURBOPACK ) { const currentRuntime = `${ process.env.__NEXT_PRIVATE_RENDER_RUNTIME === 'pages' diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index 60b2ec0ba4247..584de856d555f 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -2667,6 +2667,18 @@ export async function next_bundle_dev(task, opts) { }) } +export async function next_bundle_turbo_prod(task, opts) { + await task.source('dist').webpack({ + watch: opts.dev, + config: require('./webpack.config')({ + turbo: true, + }), + name: 'next-bundle-prod-turbo', + }) +} export async function next_bundle(task, opts) { - await task.parallel(['next_bundle_prod', 'next_bundle_dev'], opts) + await task.parallel( + ['next_bundle_prod', 'next_bundle_dev', 'next_bundle_turbo_prod'], + opts + ) } diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index 5e99203a0484f..08f75be5ac5fd 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -43,11 +43,11 @@ const externalsRegexMap = { '(.*)trace/tracer$': 'next/dist/server/lib/trace/tracer', } -module.exports = ({ dev }) => { +module.exports = ({ dev, turbo }) => { const externalHandler = ({ context, request, getResolve }, callback) => { ;(async () => { if ( - (dev && request.endsWith('.shared-runtime')) || + ((dev || turbo) && request.endsWith('.shared-runtime')) || request.endsWith('.external') ) { const resolve = getResolve() @@ -94,7 +94,9 @@ module.exports = ({ dev }) => { mode: 'production', output: { path: path.join(__dirname, 'dist/compiled/next-server'), - filename: `[name].runtime.${dev ? 'dev' : 'prod'}.js`, + filename: `[name]${turbo ? '-turbo' : ''}.runtime.${ + dev ? 'dev' : 'prod' + }.js`, libraryTarget: 'commonjs2', }, optimization: { From 5d3480c0dadccf554571721d9983ba4e2465d541 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 22:04:01 +0200 Subject: [PATCH 085/101] add require hook to turbo --- .../next-core/js/src/entry/app-renderer.tsx | 2 + .../js/src/internal/page-server-handler.tsx | 1 + .../crates/next-core/src/next_import_map.rs | 43 ++++++------------- .../next-core/src/next_shared/resolve.rs | 3 +- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index dbf3ff2c34bd9..f3efec2ff3063 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -3,6 +3,8 @@ import startOperationStreamHandler from '../internal/operation-stream' import '../polyfill/app-polyfills.ts' +process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = 'next' +import 'next/dist/server/require-hook' import type { IncomingMessage } from 'node:http' diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index 1ff513fd8ee4c..c44e75c038369 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -3,6 +3,7 @@ import { IPC } from '@vercel/turbopack-node/ipc/index' import 'next/dist/server/node-polyfill-fetch.js' +import 'next/dist/server/require-hook.js' import './shims' import type { IncomingMessage, ServerResponse } from 'node:http' diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 75e6240347151..8f3a920a6a6e5 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -213,7 +213,7 @@ pub async fn get_next_server_import_map( let ty = ty.into_value(); insert_next_server_special_aliases(&mut import_map, ty, mode, NextRuntime::NodeJs).await?; - let external = ImportMapping::External(None).cell(); + let external: Vc = ImportMapping::External(None).cell(); match ty { ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } => { @@ -223,7 +223,7 @@ pub async fn get_next_server_import_map( import_map.insert_wildcard_alias("react-dom/", external); import_map.insert_exact_alias("styled-jsx", external); import_map.insert_wildcard_alias("styled-jsx/", external); - import_map.insert_exact_alias("react-server-dom-webpack/", external); + import_map.insert_wildcard_alias("react-server-dom-webpack/", external); // TODO: we should not bundle next/dist/build/utils in the pages renderer at all import_map.insert_wildcard_alias("next/dist/build/utils", external); } @@ -249,6 +249,7 @@ pub async fn get_next_server_import_map( "next/dynamic", request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"), ); + import_map.insert_exact_alias("next/dist/server/require-hook", external); } ServerContextType::Middleware => {} } @@ -406,40 +407,24 @@ async fn insert_next_server_special_aliases( // SSR, since we're bundling Next.js alongside it. ( NextMode::DevServer, - ServerContextType::AppSSR { app_dir } - | ServerContextType::AppRSC { app_dir, .. } - | ServerContextType::AppRoute { app_dir }, + ServerContextType::AppSSR { app_dir } | ServerContextType::AppRoute { app_dir }, ) => { + let external: Vc = ImportMapping::External(None).cell(); import_map.insert_exact_alias( "@opentelemetry/api", // TODO(WEB-625) this actually need to prefer the local version of // @opentelemetry/api request_to_import_mapping(app_dir, "next/dist/compiled/@opentelemetry/api"), ); - import_map.insert_exact_alias( - "react", - request_to_import_mapping(app_dir, "next/dist/compiled/react"), - ); - import_map.insert_wildcard_alias( - "react/", - request_to_import_mapping(app_dir, "next/dist/compiled/react/*"), - ); - import_map.insert_exact_alias( - "react-dom", - request_to_import_mapping( - app_dir, - "next/dist/compiled/react-dom/server-rendering-stub.js", - ), - ); - import_map.insert_wildcard_alias( - "react-dom/", - request_to_import_mapping(app_dir, "next/dist/compiled/react-dom/*"), - ); - import_map.insert_wildcard_alias( - "react-server-dom-webpack/", - request_to_import_mapping(app_dir, "next/dist/compiled/react-server-dom-webpack/*"), - ); + import_map.insert_exact_alias("react", external); + import_map.insert_wildcard_alias("react/", external); + import_map.insert_exact_alias("react-dom", external); + import_map.insert_wildcard_alias("react-dom/", external); + import_map.insert_exact_alias("styled-jsx", external); + import_map.insert_wildcard_alias("styled-jsx/", external); + import_map.insert_wildcard_alias("react-server-dom-webpack/", external); } + // NOTE(alexkirsz) This logic maps loosely to // `next.js/packages/next/src/build/webpack-config.ts`, where: // @@ -451,7 +436,7 @@ async fn insert_next_server_special_aliases( // * passes through (react|react-dom|react-server-dom-webpack)/(.*) to // next/dist/compiled/$1/$2 ( - NextMode::Build | NextMode::Development, + NextMode::Build | NextMode::Development | NextMode::DevServer, ServerContextType::AppRSC { app_dir, .. } | ServerContextType::AppRoute { app_dir }, ) => { import_map.insert_exact_alias( diff --git a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs index 558a3a5259534..a12005ed1464e 100644 --- a/packages/next-swc/crates/next-core/src/next_shared/resolve.rs +++ b/packages/next-swc/crates/next-core/src/next_shared/resolve.rs @@ -140,7 +140,8 @@ impl ResolvePlugin for NextExternalResolvePlugin { // Find the starting index of 'next/dist' and slice from that point. It should // always be found since the glob pattern above is specific enough. let starting_index = path.find("next/dist").unwrap(); - let modified_path = &path[starting_index..]; + // Replace '/esm/' with '/' to match the CJS version of the file. + let modified_path = &path[starting_index..].replace("/esm/", "/"); Ok(Vc::cell(Some( ResolveResult::primary(ResolveResultItem::OriginalReferenceTypeExternal( modified_path.to_string(), From baa17eb616ef396f066e27111352e12d7b21cdd6 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 22:18:40 +0200 Subject: [PATCH 086/101] insert require hook config to pags --- packages/next-swc/crates/next-core/src/next_import_map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 8f3a920a6a6e5..dabe0cb3c4e9f 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -215,6 +215,7 @@ pub async fn get_next_server_import_map( insert_next_server_special_aliases(&mut import_map, ty, mode, NextRuntime::NodeJs).await?; let external: Vc = ImportMapping::External(None).cell(); + import_map.insert_exact_alias("next/dist/server/require-hook", external); match ty { ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } => { import_map.insert_exact_alias("react", external); @@ -249,7 +250,6 @@ pub async fn get_next_server_import_map( "next/dynamic", request_to_import_mapping(project_path, "next/dist/shared/lib/app-dynamic"), ); - import_map.insert_exact_alias("next/dist/server/require-hook", external); } ServerContextType::Middleware => {} } From 9e5df4ada704fc4e26ec52ad8b65404b2a774c3a Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 9 Aug 2023 22:43:16 +0200 Subject: [PATCH 087/101] fix page server handler --- .../crates/next-core/js/src/internal/page-server-handler.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index c44e75c038369..591f10ebdf819 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -3,7 +3,7 @@ import { IPC } from '@vercel/turbopack-node/ipc/index' import 'next/dist/server/node-polyfill-fetch.js' -import 'next/dist/server/require-hook.js' +import 'next/dist/server/require-hook' import './shims' import type { IncomingMessage, ServerResponse } from 'node:http' From 7b97013fca04757bf286647ec70e7f669804d773 Mon Sep 17 00:00:00 2001 From: Alex Kirszenberg Date: Fri, 11 Aug 2023 15:13:23 +0200 Subject: [PATCH 088/101] Also apply the next external plugin in edge context --- packages/next-swc/crates/next-core/src/next_edge/context.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 54c7dd3331a63..4bcd32370b105 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -24,7 +24,10 @@ use crate::{ next_config::NextConfig, next_import_map::get_next_edge_import_map, next_server::context::ServerContextType, - next_shared::resolve::{ModuleFeatureReportResolvePlugin, UnsupportedModulesResolvePlugin}, + next_shared::resolve::{ + ModuleFeatureReportResolvePlugin, NextExternalResolvePlugin, + UnsupportedModulesResolvePlugin, + }, util::foreign_code_context_condition, }; @@ -114,6 +117,7 @@ pub async fn get_edge_resolve_options_context( plugins: vec![ Vc::upcast(ModuleFeatureReportResolvePlugin::new(project_path)), Vc::upcast(UnsupportedModulesResolvePlugin::new(project_path)), + Vc::upcast(NextExternalResolvePlugin::new(project_path)), ], ..Default::default() }; From 9f454fa6c6d1a7bb53b2436ac593c550f6a962e1 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 31 Aug 2023 13:59:52 +0200 Subject: [PATCH 089/101] rebase artifacst --- packages/next/src/server/load-default-error-components.ts | 6 ++++-- packages/next/webpack.config.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/next/src/server/load-default-error-components.ts b/packages/next/src/server/load-default-error-components.ts index d06a68506b8da..c390e9180b3d9 100644 --- a/packages/next/src/server/load-default-error-components.ts +++ b/packages/next/src/server/load-default-error-components.ts @@ -18,6 +18,7 @@ import { BuildManifest } from './get-page-files' import { interopDefault } from '../lib/interop-default' import { getTracer } from './lib/trace/tracer' import { LoadComponentsSpan } from './lib/trace/constants' +import { loadManifestWithRetries } from './load-components' export type ManifestItem = { id: number | string files: string[] @@ -62,14 +63,15 @@ async function loadDefaultErrorComponentsImpl( Document, Component, pageConfig: {}, - buildManifest: require(join(distDir, `fallback-${BUILD_MANIFEST}`)), + buildManifest: await loadManifestWithRetries( + join(distDir, `fallback-${BUILD_MANIFEST}`) + ), reactLoadableManifest: {}, ComponentMod, pathname: '/_error', routeModule: ComponentMod.routeModule, } } - export const loadDefaultErrorComponents = getTracer().wrap( LoadComponentsSpan.loadDefaultErrorComponents, loadDefaultErrorComponentsImpl diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index 08f75be5ac5fd..efc8f70fb28dc 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -33,6 +33,7 @@ const minimalExternals = [ 'next/dist/compiled/compression', 'next/dist/compiled/jsonwebtoken', 'next/dist/compiled/@opentelemetry/api', + 'next/dist/compiled/@mswjs/interceptors/ClientRequest', ] const externalsMap = { From 0af32185aa978da7995b77a5f975c1924816fde0 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 31 Aug 2023 14:12:49 +0200 Subject: [PATCH 090/101] add test mode --- packages/next/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index efc8f70fb28dc..a79ac8b5fe3c1 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -124,6 +124,7 @@ module.exports = ({ dev, turbo }) => { plugins: [ new webpack.DefinePlugin({ 'process.env.NEXT_MINIMAL': JSON.stringify('true'), + 'this.serverOptions.experimentalTestProxy': JSON.stringify(false), 'this.minimalMode': JSON.stringify(true), 'this.renderOpts.dev': JSON.stringify(dev), 'process.env.NODE_ENV': JSON.stringify( From 6f5cec1ca7afbaa62ee7523c989ec33026604ade Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 31 Aug 2023 14:49:57 +0200 Subject: [PATCH 091/101] Revert "Also apply the next external plugin in edge context" This reverts commit 7b97013fca04757bf286647ec70e7f669804d773. --- packages/next-swc/crates/next-core/src/next_edge/context.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 4bcd32370b105..54c7dd3331a63 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -24,10 +24,7 @@ use crate::{ next_config::NextConfig, next_import_map::get_next_edge_import_map, next_server::context::ServerContextType, - next_shared::resolve::{ - ModuleFeatureReportResolvePlugin, NextExternalResolvePlugin, - UnsupportedModulesResolvePlugin, - }, + next_shared::resolve::{ModuleFeatureReportResolvePlugin, UnsupportedModulesResolvePlugin}, util::foreign_code_context_condition, }; @@ -117,7 +114,6 @@ pub async fn get_edge_resolve_options_context( plugins: vec![ Vc::upcast(ModuleFeatureReportResolvePlugin::new(project_path)), Vc::upcast(UnsupportedModulesResolvePlugin::new(project_path)), - Vc::upcast(NextExternalResolvePlugin::new(project_path)), ], ..Default::default() }; From a54fce64df77102eb04bd2919975a7b21b467813 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Thu, 31 Aug 2023 16:48:22 +0200 Subject: [PATCH 092/101] fix lint --- packages/next/src/server/next-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 5e62f593e9192..26a9b9ef9b6c4 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -15,7 +15,7 @@ import { import type { MiddlewareManifest } from '../build/webpack/plugins/middleware-plugin' import type RenderResult from './render-result' import type { FetchEventResult } from './web/types' -import type { PrerenderManifest, RoutesManifest } from '../build' +import type { PrerenderManifest } from '../build' import { BaseNextRequest, BaseNextResponse } from './base-http' import type { PagesManifest } from '../build/webpack/plugins/pages-manifest-plugin' import type { PayloadOptions } from './send-payload' From 4dbb38cb31479d60e71e1f10efcbe6de30c3c99a Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 1 Sep 2023 09:44:58 +0200 Subject: [PATCH 093/101] fix webpack dev server --- packages/next/webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index a79ac8b5fe3c1..8e7c3063fa5ed 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -134,7 +134,7 @@ module.exports = ({ dev, turbo }) => { }), !!process.env.ANALYZE && new BundleAnalyzerPlugin({ - analyzerPort: dev ? 8888 : 8889, + analyzerPort: 8888 + (dev ? 0 : 1) + (turbo ? 1 : 0), }), ].filter(Boolean), stats: { From be83d0a4402e912d962a6d12581aa4d2ec5571a8 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 1 Sep 2023 09:45:37 +0200 Subject: [PATCH 094/101] remove image-optimizer --- .../next/src/server/lib/trace/constants.ts | 1 - packages/next/src/server/next-server.ts | 257 +++++++++--------- 2 files changed, 128 insertions(+), 130 deletions(-) diff --git a/packages/next/src/server/lib/trace/constants.ts b/packages/next/src/server/lib/trace/constants.ts index 50eb4528c7dec..1b45358bdf8ed 100644 --- a/packages/next/src/server/lib/trace/constants.ts +++ b/packages/next/src/server/lib/trace/constants.ts @@ -43,7 +43,6 @@ enum NextNodeServerSpan { generatePublicRoutes = 'NextNodeServer.generatePublicRoutes', generateImageRoutes = 'NextNodeServer.generateImageRoutes.route', sendRenderResult = 'NextNodeServer.sendRenderResult', - sendStatic = 'NextNodeServer.sendStatic', proxyRequest = 'NextNodeServer.proxyRequest', runApi = 'NextNodeServer.runApi', render = 'NextNodeServer.render', diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 26a9b9ef9b6c4..96c523c46fdf1 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -48,7 +48,6 @@ import { findDir } from '../lib/find-pages-dir' import { UrlWithParsedQuery } from 'url' import { NodeNextRequest, NodeNextResponse } from './base-http/node' import { sendRenderResult } from './send-payload' -import { getExtension, serveStatic } from './serve-static' import { ParsedUrlQuery } from 'querystring' import { ParsedUrl, parseUrl } from '../shared/lib/router/utils/parse-url' import * as Log from '../build/output/log' @@ -376,14 +375,6 @@ export default class NextNodeServer extends BaseServer { }) } - protected sendStatic( - req: NodeNextRequest, - res: NodeNextResponse, - path: string - ): Promise { - return serveStatic(req.originalRequest, res.originalResponse, path) - } - protected async runApi( req: BaseNextRequest | NodeNextRequest, res: BaseNextResponse | NodeNextResponse, @@ -504,56 +495,59 @@ export default class NextNodeServer extends BaseServer { throw new Error( 'invariant: imageOptimizer should not be called in minimal mode' ) - } - const { imageOptimizer } = - require('./image-optimizer') as typeof import('./image-optimizer') - - return imageOptimizer( - req.originalRequest, - res.originalResponse, - paramsResult, - this.nextConfig, - this.renderOpts.dev, - async (newReq, newRes, newParsedUrl) => { - if (newReq.url === req.url) { - throw new Error(`Invariant attempted to optimize _next/image itself`) - } - - if (this.isRenderWorker) { - const invokeRes = await invokeRequest( - `http://${this.fetchHostname || 'localhost'}:${this.port}${ - newReq.url || '' - }`, - { - method: newReq.method || 'GET', - headers: newReq.headers, - signal: signalFromNodeResponse(res.originalResponse), - } - ) - const filteredResHeaders = filterReqHeaders( - toNodeOutgoingHttpHeaders(invokeRes.headers), - ipcForbiddenHeaders - ) + } else { + const { imageOptimizer } = + require('./image-optimizer') as typeof import('./image-optimizer') - for (const key of Object.keys(filteredResHeaders)) { - newRes.setHeader(key, filteredResHeaders[key] || '') + return imageOptimizer( + req.originalRequest, + res.originalResponse, + paramsResult, + this.nextConfig, + this.renderOpts.dev, + async (newReq, newRes, newParsedUrl) => { + if (newReq.url === req.url) { + throw new Error( + `Invariant attempted to optimize _next/image itself` + ) } - newRes.statusCode = invokeRes.status || 200 - if (invokeRes.body) { - await pipeReadable(invokeRes.body, newRes) - } else { - res.send() + if (this.isRenderWorker) { + const invokeRes = await invokeRequest( + `http://${this.fetchHostname || 'localhost'}:${this.port}${ + newReq.url || '' + }`, + { + method: newReq.method || 'GET', + headers: newReq.headers, + signal: signalFromNodeResponse(res.originalResponse), + } + ) + const filteredResHeaders = filterReqHeaders( + toNodeOutgoingHttpHeaders(invokeRes.headers), + ipcForbiddenHeaders + ) + + for (const key of Object.keys(filteredResHeaders)) { + newRes.setHeader(key, filteredResHeaders[key] || '') + } + newRes.statusCode = invokeRes.status || 200 + + if (invokeRes.body) { + await pipeReadable(invokeRes.body, newRes) + } else { + res.send() + } + return } - return + return this.getRequestHandler()( + new NodeNextRequest(newReq), + new NodeNextResponse(newRes), + newParsedUrl + ) } - return this.getRequestHandler()( - new NodeNextRequest(newReq), - new NodeNextResponse(newRes), - newParsedUrl - ) - } - ) + ) + } } protected getPagePath(pathname: string, locales?: string[]): string { @@ -734,93 +728,98 @@ export default class NextNodeServer extends BaseServer { return { finished: true, } - } - const { ImageOptimizerCache } = - require('./image-optimizer') as typeof import('./image-optimizer') + } else { + const { ImageOptimizerCache } = + require('./image-optimizer') as typeof import('./image-optimizer') - const imageOptimizerCache = new ImageOptimizerCache({ - distDir: this.distDir, - nextConfig: this.nextConfig, - }) + const imageOptimizerCache = new ImageOptimizerCache({ + distDir: this.distDir, + nextConfig: this.nextConfig, + }) - const { getHash, sendResponse, ImageError } = - require('./image-optimizer') as typeof import('./image-optimizer') + const { getHash, sendResponse, ImageError } = + require('./image-optimizer') as typeof import('./image-optimizer') - if (!this.imageResponseCache) { - throw new Error('invariant image optimizer cache was not initialized') - } - const imagesConfig = this.nextConfig.images + if (!this.imageResponseCache) { + throw new Error('invariant image optimizer cache was not initialized') + } + const imagesConfig = this.nextConfig.images - if (imagesConfig.loader !== 'default' || imagesConfig.unoptimized) { - await this.render404(req, res) - return { finished: true } - } - const paramsResult = ImageOptimizerCache.validateParams( - (req as NodeNextRequest).originalRequest, - parsedUrl.query, - this.nextConfig, - !!this.renderOpts.dev - ) + if (imagesConfig.loader !== 'default' || imagesConfig.unoptimized) { + await this.render404(req, res) + return { finished: true } + } + const paramsResult = ImageOptimizerCache.validateParams( + (req as NodeNextRequest).originalRequest, + parsedUrl.query, + this.nextConfig, + !!this.renderOpts.dev + ) - if ('errorMessage' in paramsResult) { - res.statusCode = 400 - res.body(paramsResult.errorMessage).send() - return { finished: true } - } - const cacheKey = ImageOptimizerCache.getCacheKey(paramsResult) + if ('errorMessage' in paramsResult) { + res.statusCode = 400 + res.body(paramsResult.errorMessage).send() + return { finished: true } + } + const cacheKey = ImageOptimizerCache.getCacheKey(paramsResult) - try { - const cacheEntry = await this.imageResponseCache.get( - cacheKey, - async () => { - const { buffer, contentType, maxAge } = await this.imageOptimizer( - req as NodeNextRequest, - res as NodeNextResponse, - paramsResult - ) - const etag = getHash([buffer]) + try { + const { getExtension } = + require('./serve-static') as typeof import('./serve-static') + const cacheEntry = await this.imageResponseCache.get( + cacheKey, + async () => { + const { buffer, contentType, maxAge } = await this.imageOptimizer( + req as NodeNextRequest, + res as NodeNextResponse, + paramsResult + ) + const etag = getHash([buffer]) + + return { + value: { + kind: 'IMAGE', + buffer, + etag, + extension: getExtension(contentType) as string, + }, + revalidate: maxAge, + } + }, + { + incrementalCache: imageOptimizerCache, + } + ) + if (cacheEntry?.value?.kind !== 'IMAGE') { + throw new Error( + 'invariant did not get entry from image response cache' + ) + } + sendResponse( + (req as NodeNextRequest).originalRequest, + (res as NodeNextResponse).originalResponse, + paramsResult.href, + cacheEntry.value.extension, + cacheEntry.value.buffer, + paramsResult.isStatic, + cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT', + imagesConfig, + cacheEntry.revalidate || 0, + Boolean(this.renderOpts.dev) + ) + } catch (err) { + if (err instanceof ImageError) { + res.statusCode = err.statusCode + res.body(err.message).send() return { - value: { - kind: 'IMAGE', - buffer, - etag, - extension: getExtension(contentType) as string, - }, - revalidate: maxAge, + finished: true, } - }, - { - incrementalCache: imageOptimizerCache, - } - ) - - if (cacheEntry?.value?.kind !== 'IMAGE') { - throw new Error('invariant did not get entry from image response cache') - } - sendResponse( - (req as NodeNextRequest).originalRequest, - (res as NodeNextResponse).originalResponse, - paramsResult.href, - cacheEntry.value.extension, - cacheEntry.value.buffer, - paramsResult.isStatic, - cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT', - imagesConfig, - cacheEntry.revalidate || 0, - Boolean(this.renderOpts.dev) - ) - } catch (err) { - if (err instanceof ImageError) { - res.statusCode = err.statusCode - res.body(err.message).send() - return { - finished: true, } + throw err } - throw err + return { finished: true } } - return { finished: true } } protected async handleCatchallRenderRequest( From c13175cbcc7a822468c1a75ce4707cd1629b1c10 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 1 Sep 2023 10:06:32 +0200 Subject: [PATCH 095/101] fix require hook (tmp) --- packages/next/src/server/require-hook.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 9063dbc6b65b2..d8b570eeecd55 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -24,8 +24,8 @@ const toResolveMap = (map: Record): [string, string][] => // these must use require.resolve to be statically analyzable export const defaultOverrides = { - 'styled-jsx': dirname(require.resolve('styled-jsx/package.json')), - 'styled-jsx/style': require.resolve('styled-jsx/style'), + 'styled-jsx': dirname(resolve('styled-jsx/package.json')), + 'styled-jsx/style': resolve('styled-jsx/style'), } export const baseOverrides = { From c6dc9aad3d9950bebbde668fd4bed03fd2526c51 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 1 Sep 2023 11:30:35 +0200 Subject: [PATCH 096/101] try removing the stylex-jsx ref --- packages/next/src/server/require-hook.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index d8b570eeecd55..51aaa64b1d0aa 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -6,7 +6,6 @@ import path from 'path' // This module will only be loaded once per process. -const { dirname } = require('path') const mod = require('module') const resolveFilename = mod._resolveFilename const originalRequire = mod.prototype.require @@ -22,12 +21,6 @@ const resolve = process.env.NEXT_MINIMAL const toResolveMap = (map: Record): [string, string][] => Object.entries(map).map(([key, value]) => [key, resolve(value)]) -// these must use require.resolve to be statically analyzable -export const defaultOverrides = { - 'styled-jsx': dirname(resolve('styled-jsx/package.json')), - 'styled-jsx/style': resolve('styled-jsx/style'), -} - export const baseOverrides = { react: 'next/dist/compiled/react', 'react/package.json': 'next/dist/compiled/react/package.json', @@ -81,9 +74,6 @@ export function addHookAliases(aliases: [string, string][] = []) { } } -// Add default aliases -addHookAliases(toResolveMap(defaultOverrides)) - // Override built-in React packages if necessary function overrideReact() { if (process.env.__NEXT_PRIVATE_PREBUNDLED_REACT) { From 831cce74c8e618805989330d3cc9f0bb8cede4b2 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Fri, 1 Sep 2023 14:32:18 +0200 Subject: [PATCH 097/101] Revert "Fix tracing in require-hook (#53642)" This reverts commit f11406015c9e282a9fcd4aad3839c781b585cd63. --- packages/next/src/build/index.ts | 34 +++++++++++++----------- packages/next/src/server/require-hook.ts | 9 ++++++- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index dc86a8b029788..b6e02dc405ad4 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -20,7 +20,7 @@ import devalue from 'next/dist/compiled/devalue' import findUp from 'next/dist/compiled/find-up' import { nanoid } from 'next/dist/compiled/nanoid/index.cjs' import { pathToRegexp } from 'next/dist/compiled/path-to-regexp' -import path from 'path' +import path, { dirname } from 'path' import { STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR, PUBLIC_DIR_MIDDLEWARE_CONFLICT, @@ -145,7 +145,11 @@ import { startTypeChecking } from './type-check' import { generateInterceptionRoutesRewrites } from '../lib/generate-interception-routes-rewrites' import { buildDataRoute } from '../server/lib/router-utils/build-data-route' -import { baseOverrides, experimentalOverrides } from '../server/require-hook' +import { + baseOverrides, + defaultOverrides, + experimentalOverrides, +} from '../server/require-hook' import { initialize } from '../server/lib/incremental-cache-server' import { nodeFs } from '../server/lib/node-fs-methods' @@ -2090,15 +2094,25 @@ export default async function build( ...Object.values(experimentalOverrides).map((override) => require.resolve(override) ), + ...(config.experimental.turbotrace + ? [] + : Object.keys(defaultOverrides).map((value) => + require.resolve(value, { + paths: [require.resolve('next/dist/server/require-hook')], + }) + )), require.resolve( - 'next/dist/compiled/next-server/server.runtime.prod' + 'next/dist/compiled/next-server/app-page.runtime.prod' ), require.resolve( - 'next/dist/compiled/next-server/app-page.runtime.prod' + 'next/dist/compiled/next-server/app-route.runtime.prod' ), require.resolve( 'next/dist/compiled/next-server/pages.runtime.prod' ), + require.resolve( + 'next/dist/compiled/next-server/pages-api.runtime.prod' + ), ] // ensure we trace any dependencies needed for custom @@ -2126,18 +2140,6 @@ export default async function build( require.resolve( 'next/dist/compiled/next-server/server.runtime.prod' ), - require.resolve( - 'next/dist/compiled/next-server/app-page.runtime.prod' - ), - require.resolve( - 'next/dist/compiled/next-server/pages.runtime.prod' - ), - require.resolve( - 'next/dist/compiled/next-server/pages-api.runtime.prod' - ), - require.resolve( - 'next/dist/compiled/next-server/app-route.runtime.prod' - ), ].filter(Boolean) const additionalIgnores = new Set() diff --git a/packages/next/src/server/require-hook.ts b/packages/next/src/server/require-hook.ts index 51aaa64b1d0aa..9b2e1526eec0e 100644 --- a/packages/next/src/server/require-hook.ts +++ b/packages/next/src/server/require-hook.ts @@ -2,7 +2,7 @@ // This is needed for userland plugins to attach to the same webpack instance as Next.js'. // Individually compiled modules are as defined for the compilation in bundles/webpack/packages/*. -import path from 'path' +import path, { dirname } from 'path' // This module will only be loaded once per process. @@ -21,6 +21,11 @@ const resolve = process.env.NEXT_MINIMAL const toResolveMap = (map: Record): [string, string][] => Object.entries(map).map(([key, value]) => [key, resolve(value)]) +export const defaultOverrides = { + 'styled-jsx': dirname(resolve('styled-jsx/package.json')), + 'styled-jsx/style': resolve('styled-jsx/style'), +} + export const baseOverrides = { react: 'next/dist/compiled/react', 'react/package.json': 'next/dist/compiled/react/package.json', @@ -74,6 +79,8 @@ export function addHookAliases(aliases: [string, string][] = []) { } } +addHookAliases(toResolveMap(defaultOverrides)) + // Override built-in React packages if necessary function overrideReact() { if (process.env.__NEXT_PRIVATE_PREBUNDLED_REACT) { From 7c599ec14904d38f660ff2d9c5a701ed2c5c402f Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 5 Sep 2023 11:37:26 +0200 Subject: [PATCH 098/101] fix rust transition --- .../next-swc/crates/next-core/src/app_source.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/next-swc/crates/next-core/src/app_source.rs b/packages/next-swc/crates/next-core/src/app_source.rs index e5af263c3d6bd..738f5a4bf938f 100644 --- a/packages/next-swc/crates/next-core/src/app_source.rs +++ b/packages/next-swc/crates/next-core/src/app_source.rs @@ -2,7 +2,7 @@ use std::{collections::HashMap, io::Write as _, iter::once}; use anyhow::{bail, Result}; use indexmap::indexmap; -use indoc::indoc; +use indoc::formatdoc; use serde_json::Value as JsonValue; use turbo_tasks::Vc; use turbopack_binding::{ @@ -968,13 +968,18 @@ impl AppRenderer { .emit(); } - let mut result = RopeBuilder::from(indoc! {" - \"TURBOPACK { chunking-type: isolatedParallel; transition: next-edge-server-component }\"; + let mut result = RopeBuilder::from( + formatdoc!( + " + \"TURBOPACK {{ chunking-type: isolatedParallel; transition: {rsc_transition} }}\"; import GlobalErrorMod from \"next/dist/client/components/error-boundary\" - const { GlobalError } = GlobalErrorMod; - \"TURBOPACK { chunking-type: isolatedParallel; transition: next-edge-server-component }\"; + const {{ GlobalError }} = GlobalErrorMod; + \"TURBOPACK {{ chunking-type: isolatedParallel; transition: {rsc_transition} }}\"; import base from \"next/dist/server/app-render/entry-base\"\n - "}); + " + ) + .into_bytes(), + ); for import in loader_tree_module.imports { writeln!(result, "{import}")?; From a9303b90eb41556c073d8e086e157814d0daed15 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 5 Sep 2023 13:22:30 +0200 Subject: [PATCH 099/101] fix turbopack Co-authored-by: Tobias Koppers --- .../js/src/entry/app-edge-renderer.tsx | 2 + .../crates/next-core/src/next_edge/context.rs | 7 +- .../src/next_edge/route_transition.rs | 16 +++-- .../crates/next-core/src/next_import_map.rs | 70 ++++++++++++++----- .../next-core/src/next_server/context.rs | 7 +- ...File(__q____q____q____star__0__-3e4dd8.txt | 17 +++++ ...FileSync(__q____q____q____star_-e11df4.txt | 15 ++++ .../Error during SSR Rendering-8ad1c9.txt | 47 +++++++++++++ .../Error during SSR Rendering-d9114a.txt | 6 -- .../next/import/conditions/input/app/test.js | 4 +- ...rror resolving commonjs request-b2593b.txt | 13 ---- ...rror resolving commonjs request-dd84e7.txt | 13 ---- ...File(__q____q____q____star__0__-76c34b.txt | 17 +++++ ...FileSync(__q____q____q____star_-f7e52c.txt | 15 ++++ .../next/src/server/app-render/app-render.tsx | 11 +-- 15 files changed, 191 insertions(+), 69 deletions(-) create mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-3e4dd8.txt create mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-e11df4.txt create mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-8ad1c9.txt delete mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-d9114a.txt delete mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-b2593b.txt delete mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-dd84e7.txt create mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-76c34b.txt create mode 100644 packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-f7e52c.txt diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-edge-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-edge-renderer.tsx index fdec9ffc360fe..38f27b3c1c7a3 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-edge-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-edge-renderer.tsx @@ -2,6 +2,8 @@ // the other imports import startOperationStreamHandler from '../internal/operation-stream' +import 'next/dist/server/node-polyfill-fetch' + import { join } from 'path' import { parse as parseUrl } from 'node:url' diff --git a/packages/next-swc/crates/next-core/src/next_edge/context.rs b/packages/next-swc/crates/next-core/src/next_edge/context.rs index 54c7dd3331a63..cfe9eebf19f94 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/context.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/context.rs @@ -96,10 +96,9 @@ pub async fn get_edge_resolve_options_context( ]; match ty { - ServerContextType::AppRSC { .. } | ServerContextType::AppRoute { .. } => { - custom_conditions.push("react-server".to_string()) - } - ServerContextType::Pages { .. } + ServerContextType::AppRSC { .. } => custom_conditions.push("react-server".to_string()), + ServerContextType::AppRoute { .. } + | ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } | ServerContextType::AppSSR { .. } | ServerContextType::Middleware { .. } => {} diff --git a/packages/next-swc/crates/next-core/src/next_edge/route_transition.rs b/packages/next-swc/crates/next-core/src/next_edge/route_transition.rs index de0bd2f2e7bf7..05326de255203 100644 --- a/packages/next-swc/crates/next-core/src/next_edge/route_transition.rs +++ b/packages/next-swc/crates/next-core/src/next_edge/route_transition.rs @@ -58,24 +58,26 @@ impl Transition for NextEdgeRouteTransition { #[turbo_tasks::function] async fn process_module( - &self, + self: Vc, asset: Vc>, context: Vc, ) -> Result>> { + let new_context = self.process_context(context); + let this = self.await?; let new_asset = route_bootstrap( asset, - Vc::upcast(context), - self.base_path, - self.bootstrap_asset, + Vc::upcast(new_context), + this.base_path, + this.bootstrap_asset, Vc::cell(indexmap! { - "NAME".to_string() => self.entry_name.clone(), + "NAME".to_string() => this.entry_name.clone(), }), ); let asset = ChunkGroupFilesAsset { module: Vc::upcast(new_asset), - client_root: self.output_path, - chunking_context: self.edge_chunking_context, + client_root: this.output_path, + chunking_context: this.edge_chunking_context, runtime_entries: None, }; diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 836d0748ae0eb..c530f3bcb9290 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -379,6 +379,11 @@ async fn insert_next_server_special_aliases( NextRuntime::Edge => request_to_import_mapping(context_dir, request), NextRuntime::NodeJs => external_request_to_import_mapping(request), }; + let passthrough_external_if_node = + move |context_dir: Vc, request: &str| match runtime { + NextRuntime::Edge => request_to_import_mapping(context_dir, request), + NextRuntime::NodeJs => ImportMapping::External(None).cell(), + }; match (mode, ty) { (_, ServerContextType::Pages { pages_dir }) => { import_map.insert_exact_alias( @@ -415,24 +420,47 @@ async fn insert_next_server_special_aliases( (_, ServerContextType::PagesData { .. }) => {} // In development, we *always* use the bundled version of React, even in // SSR, since we're bundling Next.js alongside it. - ( - NextMode::DevServer, - ServerContextType::AppSSR { app_dir } | ServerContextType::AppRoute { app_dir }, - ) => { - let external: Vc = ImportMapping::External(None).cell(); + (NextMode::DevServer, ServerContextType::AppSSR { app_dir }) => { import_map.insert_exact_alias( "@opentelemetry/api", // TODO(WEB-625) this actually need to prefer the local version of // @opentelemetry/api request_to_import_mapping(app_dir, "next/dist/compiled/@opentelemetry/api"), ); - import_map.insert_exact_alias("react", external); - import_map.insert_wildcard_alias("react/", external); - import_map.insert_exact_alias("react-dom", external); - import_map.insert_wildcard_alias("react-dom/", external); - import_map.insert_exact_alias("styled-jsx", external); - import_map.insert_wildcard_alias("styled-jsx/", external); - import_map.insert_wildcard_alias("react-server-dom-webpack/", external); + import_map.insert_exact_alias( + "react", + passthrough_external_if_node(app_dir, "next/dist/compiled/react"), + ); + import_map.insert_wildcard_alias( + "react/", + passthrough_external_if_node(app_dir, "next/dist/compiled/react/*"), + ); + import_map.insert_exact_alias( + "react-dom", + passthrough_external_if_node( + app_dir, + "next/dist/compiled/react-dom/server-rendering-stub.js", + ), + ); + import_map.insert_wildcard_alias( + "react-dom/", + passthrough_external_if_node(app_dir, "next/dist/compiled/react-dom/*"), + ); + import_map.insert_exact_alias( + "styled-jsx", + passthrough_external_if_node(app_dir, "next/dist/compiled/styled-jsx"), + ); + import_map.insert_wildcard_alias( + "styled-jsx/", + passthrough_external_if_node(app_dir, "next/dist/compiled/styled-jsx/*"), + ); + import_map.insert_wildcard_alias( + "react-server-dom-webpack/", + passthrough_external_if_node( + app_dir, + "next/dist/compiled/react-server-dom-webpack/*", + ), + ); } // NOTE(alexkirsz) This logic maps loosely to @@ -455,10 +483,20 @@ async fn insert_next_server_special_aliases( // @opentelemetry/api request_to_import_mapping(app_dir, "next/dist/compiled/@opentelemetry/api"), ); - import_map.insert_exact_alias( - "react", - request_to_import_mapping(app_dir, "next/dist/compiled/react/react.shared-subset"), - ); + if matches!(ty, ServerContextType::AppRSC { .. }) { + import_map.insert_exact_alias( + "react", + request_to_import_mapping( + app_dir, + "next/dist/compiled/react/react.shared-subset", + ), + ); + } else { + import_map.insert_exact_alias( + "react", + request_to_import_mapping(app_dir, "next/dist/compiled/react"), + ); + } import_map.insert_exact_alias( "react-dom", request_to_import_mapping( diff --git a/packages/next-swc/crates/next-core/src/next_server/context.rs b/packages/next-swc/crates/next-core/src/next_server/context.rs index ff79091e8e202..1d242498b36df 100644 --- a/packages/next-swc/crates/next-core/src/next_server/context.rs +++ b/packages/next-swc/crates/next-core/src/next_server/context.rs @@ -111,10 +111,9 @@ pub async fn get_server_resolve_options_context( let mut custom_conditions = vec![mode.node_env().to_string(), "node".to_string()]; match ty { - ServerContextType::AppRSC { .. } | ServerContextType::AppRoute { .. } => { - custom_conditions.push("react-server".to_string()) - } - ServerContextType::Pages { .. } + ServerContextType::AppRSC { .. } => custom_conditions.push("react-server".to_string()), + ServerContextType::AppRoute { .. } + | ServerContextType::Pages { .. } | ServerContextType::PagesData { .. } | ServerContextType::AppSSR { .. } | ServerContextType::Middleware { .. } => {} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-3e4dd8.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-3e4dd8.txt new file mode 100644 index 0000000000000..a5ad94c85fb0a --- /dev/null +++ b/packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-3e4dd8.txt @@ -0,0 +1,17 @@ +warning - [parse] [project]/packages/next/dist/server/web/sandbox/context.js /packages/next/dist/server/web/sandbox/context.js:64:56 lint TP1004 fs.readFile(???*0*) is very dynamic + 60 | } + 61 | async function loadWasm(wasm) { + 62 | const modules = {}; + 63 | await Promise.all(wasm.map(async (binding)=>{ + + v + 64 + const module1 = await WebAssembly.compile(await _fs.promises.readFile(binding.filePath)); + + ^ + 65 | modules[binding.name] = module1; + 66 | })); + 67 | return modules; + 68 | } + + - *0* ???*1*["filePath"] + ⚠️ unknown object + - *1* binding + ⚠️ pattern without value \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-e11df4.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-e11df4.txt new file mode 100644 index 0000000000000..c80db085946c2 --- /dev/null +++ b/packages/next-swc/crates/next-dev-tests/tests/integration/next/api/basic/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-e11df4.txt @@ -0,0 +1,15 @@ +warning - [parse] [project]/packages/next/dist/server/web/sandbox/context.js /packages/next/dist/server/web/sandbox/context.js:355:28 lint TP1004 fs.readFileSync(???*0*, "utf-8") is very dynamic + 351 | } + 352 | const moduleContext = lazyModuleContext; + 353 | const evaluateInContext = (filepath)=>{ + 354 | if (!moduleContext.paths.has(filepath)) { + + v + 355 + const content = (0, _fs.readFileSync)(filepath, "utf-8"); + + ^ + 356 | try { + 357 | (0, _vm.runInContext)(content, moduleContext.runtime.context, { + 358 | filename: filepath + 359 | }); + + - *0* filepath + ⚠️ pattern without value \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-8ad1c9.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-8ad1c9.txt new file mode 100644 index 0000000000000..39e97b4ccc85e --- /dev/null +++ b/packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-8ad1c9.txt @@ -0,0 +1,47 @@ +error - [rendering] [root of the server]/invalid Error during SSR Rendering + Error: Invalid src prop (https://image-optimization-test.vercel.app/test.webp) on `next/image`, hostname "image-optimization-test.vercel.app" is not configured under images in your `next.config.js` + + Debug info: + - Error: Invalid src prop (https://image-optimization-test.vercel.app/test.webp) on `next/image`, hostname "image-optimization-test.vercel.app" is not configured under images in your `next.config.js` + See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host + at defaultLoader (packages/next/dist/shared/lib/image-loader.js:41:27) + 37 | process.env.NEXT_RUNTIME !== "edge") { + 38 | // We use dynamic require because this should only error in development + 39 | const { hasMatch } = require("./match-remote-pattern"); + 40 | if (!hasMatch(config.domains, config.remotePatterns, parsedSrc)) { + | v + 41 + throw new Error("Invalid src prop (" + src + ') on `next/image`, hostname "' + parsedSrc.hostname + '" i...xt.config.js`\n' + "See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host"); + | ^ + 42 | } + 43 | } + 44 | } + 45 | } + + at (packages/next/dist/shared/lib/get-img-props.js:101:36) + 97 | const { widths , kind } = getWidths(config, width, sizes); + 98 | const last = widths.length - 1; + 99 | return { + 100 | sizes: !sizes && kind === "w" ? "100vw" : sizes, + | v + 101 + srcSet: widths.map((w, i)=>loader({ + | ^ + 102 | config, + 103 | src, + 104 | quality, + 105 | width: w + + at generateImgAttrs (packages/next/dist/shared/lib/get-img-props.js:101:24) + 97 | const { widths , kind } = getWidths(config, width, sizes); + 98 | const last = widths.length - 1; + 99 | return { + 100 | sizes: !sizes && kind === "w" ? "100vw" : sizes, + | v + 101 + srcSet: widths.map((w, i)=>loader({ + | ^ + 102 | config, + 103 | src, + 104 | quality, + 105 | width: w + + at getImgProps (packages/next/dist/shared/lib/get-img-props.js:392:27) + at (packages/next/dist/client/image-component.js:275:82) \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-d9114a.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-d9114a.txt deleted file mode 100644 index ce775cb8df7e8..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/image/remotepattern/issues/Error during SSR Rendering-d9114a.txt +++ /dev/null @@ -1,6 +0,0 @@ -error - [rendering] [root of the server]/invalid Error during SSR Rendering - Error: Invalid src prop (https://image-optimization-test.vercel.app/test.webp) on `next/image`, hostname "image-optimization-test.vercel.app" is not configured under images in your `next.config.js` - - Debug info: - - Error: Invalid src prop (https://image-optimization-test.vercel.app/test.webp) on `next/image`, hostname "image-optimization-test.vercel.app" is not configured under images in your `next.config.js` - See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/input/app/test.js b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/input/app/test.js index e2c2f40a06dd7..108b763da879c 100644 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/input/app/test.js +++ b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/input/app/test.js @@ -120,7 +120,7 @@ function runTests() { expect(json).toMatchObject({ edgeThenNode: 'node', nodeThenEdge: 'node', - reactServer: 'react-server', + reactServer: 'default', }) }) @@ -129,7 +129,7 @@ function runTests() { expect(json).toMatchObject({ edgeThenNode: 'edge', nodeThenEdge: 'edge', - reactServer: 'react-server', + reactServer: 'default', }) }) diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-b2593b.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-b2593b.txt deleted file mode 100644 index 72c048d7b6481..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-b2593b.txt +++ /dev/null @@ -1,13 +0,0 @@ -error - [resolve] [project]/packages/next/dist/compiled/nanoid/index.cjs /packages/next/dist/compiled/nanoid/index.cjs:1:45 Error resolving commonjs request - + v---------------v - 1 + (()=>{var e={113:e=>{"use strict";e.exports=require("crypto")},660:(e,r,t)=>{let l=t(113);let{urlAlphabet:a}=t(591);const n=128;let _,u;let fillPool=e=>{if(!_||...ndefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(660);module.exports=t})(); - + ^---------------^ - - unable to resolve module "crypto" - - | It was not possible to find the requested file. - | Parsed request as written in source code: module "crypto" - | Path where resolving has started: [project]/packages/next/dist/compiled/nanoid/index.cjs - | Type of request: commonjs request - | Import map: No import map entry - | \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-dd84e7.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-dd84e7.txt deleted file mode 100644 index 72c048d7b6481..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/Error resolving commonjs request-dd84e7.txt +++ /dev/null @@ -1,13 +0,0 @@ -error - [resolve] [project]/packages/next/dist/compiled/nanoid/index.cjs /packages/next/dist/compiled/nanoid/index.cjs:1:45 Error resolving commonjs request - + v---------------v - 1 + (()=>{var e={113:e=>{"use strict";e.exports=require("crypto")},660:(e,r,t)=>{let l=t(113);let{urlAlphabet:a}=t(591);const n=128;let _,u;let fillPool=e=>{if(!_||...ndefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(660);module.exports=t})(); - + ^---------------^ - - unable to resolve module "crypto" - - | It was not possible to find the requested file. - | Parsed request as written in source code: module "crypto" - | Path where resolving has started: [project]/packages/next/dist/compiled/nanoid/index.cjs - | Type of request: commonjs request - | Import map: No import map entry - | \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-76c34b.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-76c34b.txt new file mode 100644 index 0000000000000..a5ad94c85fb0a --- /dev/null +++ b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFile(__q____q____q____star__0__-76c34b.txt @@ -0,0 +1,17 @@ +warning - [parse] [project]/packages/next/dist/server/web/sandbox/context.js /packages/next/dist/server/web/sandbox/context.js:64:56 lint TP1004 fs.readFile(???*0*) is very dynamic + 60 | } + 61 | async function loadWasm(wasm) { + 62 | const modules = {}; + 63 | await Promise.all(wasm.map(async (binding)=>{ + + v + 64 + const module1 = await WebAssembly.compile(await _fs.promises.readFile(binding.filePath)); + + ^ + 65 | modules[binding.name] = module1; + 66 | })); + 67 | return modules; + 68 | } + + - *0* ???*1*["filePath"] + ⚠️ unknown object + - *1* binding + ⚠️ pattern without value \ No newline at end of file diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-f7e52c.txt b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-f7e52c.txt new file mode 100644 index 0000000000000..c80db085946c2 --- /dev/null +++ b/packages/next-swc/crates/next-dev-tests/tests/integration/next/import/conditions/issues/lint TP1004 fs.readFileSync(__q____q____q____star_-f7e52c.txt @@ -0,0 +1,15 @@ +warning - [parse] [project]/packages/next/dist/server/web/sandbox/context.js /packages/next/dist/server/web/sandbox/context.js:355:28 lint TP1004 fs.readFileSync(???*0*, "utf-8") is very dynamic + 351 | } + 352 | const moduleContext = lazyModuleContext; + 353 | const evaluateInContext = (filepath)=>{ + 354 | if (!moduleContext.paths.has(filepath)) { + + v + 355 + const content = (0, _fs.readFileSync)(filepath, "utf-8"); + + ^ + 356 | try { + 357 | (0, _vm.runInContext)(content, moduleContext.runtime.context, { + 358 | filename: filepath + 359 | }); + + - *0* filepath + ⚠️ pattern without value \ No newline at end of file diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 74b2673b3b5c9..1dd2eb8f7c639 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -286,10 +286,13 @@ export async function renderToHTMLOrFlight( * that we need to resolve the final metadata. */ - const requestId = - process.env.NEXT_RUNTIME === 'edge' - ? crypto.randomUUID() - : require('next/dist/compiled/nanoid').nanoid() + let requestId: string + + if (process.env.NEXT_RUNTIME === 'edge') { + requestId = crypto.randomUUID() + } else { + requestId = require('next/dist/compiled/nanoid').nanoid() + } const LayoutRouter = ComponentMod.LayoutRouter as typeof import('../../client/components/layout-router').default From faa9492572ea6af5974eb480478a6170aa75dccc Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Tue, 5 Sep 2023 13:27:32 +0200 Subject: [PATCH 100/101] fix build + lint errors --- packages/next/src/build/index.ts | 2 +- packages/next/src/server/render-result.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 102b14816bcce..d4d2b9b900158 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -20,7 +20,7 @@ import devalue from 'next/dist/compiled/devalue' import findUp from 'next/dist/compiled/find-up' import { nanoid } from 'next/dist/compiled/nanoid/index.cjs' import { pathToRegexp } from 'next/dist/compiled/path-to-regexp' -import path, { dirname } from 'path' +import path from 'path' import { STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR, PUBLIC_DIR_MIDDLEWARE_CONFLICT, diff --git a/packages/next/src/server/render-result.ts b/packages/next/src/server/render-result.ts index b93dfce5fae21..2a8252e4fd143 100644 --- a/packages/next/src/server/render-result.ts +++ b/packages/next/src/server/render-result.ts @@ -1,4 +1,4 @@ -import { StaticGenerationStore } from '../client/components/static-generation-async-storage' +import { StaticGenerationStore } from '../client/components/static-generation-async-storage.external' import { pipeReadable, PipeTarget } from './pipe-readable' type ContentTypeOption = string | undefined From 6737b04652ea07a93e3bd5c3d5c99cf8899bad71 Mon Sep 17 00:00:00 2001 From: Jimmy Lai Date: Wed, 6 Sep 2023 12:48:53 +0200 Subject: [PATCH 101/101] adress comments --- .../crates/next-core/js/src/entry/app-renderer.tsx | 1 + .../next-core/js/src/internal/page-server-handler.tsx | 2 +- packages/next/src/build/webpack-config.ts | 10 +++++++--- packages/next/src/export/worker.ts | 2 -- .../future/helpers/module-loader/node-module-loader.ts | 4 ++-- .../server/future/route-modules/app-route/module.ts | 1 - packages/next/src/server/next-server.ts | 2 ++ packages/next/src/server/response-cache/web.ts | 3 +-- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx index bf5aa8f1b99c5..25437fec08ef4 100644 --- a/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx +++ b/packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx @@ -3,6 +3,7 @@ import startOperationStreamHandler from '../internal/operation-stream' import '../polyfill/app-polyfills.ts' +// TODO: when actions are supported, this should be removed/changed process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = 'next' import 'next/dist/server/require-hook' diff --git a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx index 591f10ebdf819..cecafb35f77a7 100644 --- a/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx +++ b/packages/next-swc/crates/next-core/js/src/internal/page-server-handler.tsx @@ -8,7 +8,7 @@ import './shims' import type { IncomingMessage, ServerResponse } from 'node:http' -import { RenderOpts } from 'next/dist/server/render' +import type { RenderOpts } from 'next/dist/server/render' import { getRedirectStatus } from 'next/dist/lib/redirect-status' import { PERMANENT_REDIRECT_STATUS } from 'next/dist/shared/lib/constants' import { buildStaticPaths } from 'next/dist/build/utils' diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 3dfcd70b90ff8..7348a892d9b09 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -1405,8 +1405,8 @@ export default async function getBaseWebpackConfig( const isEsmRequested = dependencyType === 'esm' /** - * @param {string} localRes the full path to the file - * @returns {string | undefined} the externalized path + * @param localRes the full path to the file + * @returns the externalized path * @description returns an externalized path if the file is a Next.js file and ends with either `.shared-runtime.js` or `.external.js` * This is used to ensure that files used across the rendering runtime(s) and the user code are one and the same. The logic in this function * will rewrite the require to the correct bundle location depending on the layer at which the file is being used. @@ -2023,7 +2023,11 @@ export default async function getBaseWebpackConfig( ? [ { layer: WEBPACK_LAYERS.appRouteHandler, - test: /private-next-app-dir\/.*\/route\.js$/, + test: new RegExp( + `private-next-app-dir\\/.*\\/route\\.(${pageExtensions.join( + '|' + )})$` + ), }, { // Make sure that AsyncLocalStorage module instance is shared between server and client diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index 15360bdd845dc..b9fb7b9afd60a 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -476,7 +476,6 @@ export default async function exportPage({ // This is a route handler, which means it has it's handler in the // bundled file already, we should just use that. const filename = posix.join(distDir, 'server', 'app', page) - console.log('module', filename) // Load the module for the route. const module = await RouteModuleLoader.load( @@ -502,7 +501,6 @@ export default async function exportPage({ const headers = toNodeOutgoingHttpHeaders(response.headers) const cacheTags = (context.staticGenerationContext as any) .fetchTags - console.log('cacheTags for ', page, cacheTags) if (cacheTags) { headers[NEXT_CACHE_TAGS_HEADER] = cacheTags diff --git a/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts b/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts index 0e64e60375b69..6f70685df7e75 100644 --- a/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts +++ b/packages/next/src/server/future/helpers/module-loader/node-module-loader.ts @@ -7,10 +7,10 @@ export class NodeModuleLoader implements ModuleLoader { public async load(id: string): Promise { if (process.env.NEXT_RUNTIME !== 'edge') { // Need to `await` to cover the case that route is marked ESM modules by ESM escalation. - return (await process.env.NEXT_MINIMAL) + return await (process.env.NEXT_MINIMAL ? // @ts-ignore __non_webpack_require__(id) - : require(id) + : require(id)) } throw new Error('NodeModuleLoader is not supported in edge runtime.') diff --git a/packages/next/src/server/future/route-modules/app-route/module.ts b/packages/next/src/server/future/route-modules/app-route/module.ts index de9d8ec18a4db..d1d36d31501e4 100644 --- a/packages/next/src/server/future/route-modules/app-route/module.ts +++ b/packages/next/src/server/future/route-modules/app-route/module.ts @@ -369,7 +369,6 @@ export class AppRouteRouteModule extends RouteModule< staticGenerationStore.pendingRevalidates || [] ) addImplicitTags(staticGenerationStore) - console.log('tags for ', route, staticGenerationStore.tags) ;(context.staticGenerationContext as any).fetchTags = staticGenerationStore.tags?.join(',') diff --git a/packages/next/src/server/next-server.ts b/packages/next/src/server/next-server.ts index 3ed1e9c814de2..7abf3605541ad 100644 --- a/packages/next/src/server/next-server.ts +++ b/packages/next/src/server/next-server.ts @@ -459,6 +459,7 @@ export default class NextNodeServer extends BaseServer { throw new Error( 'invariant: renderHTML should not be called in minimal mode' ) + // the `else` branch is needed for tree-shaking } else { // Due to the way we pass data by mutating `renderOpts`, we can't extend the // object here but only updating its `nextFontManifest` field. @@ -732,6 +733,7 @@ export default class NextNodeServer extends BaseServer { return { finished: true, } + // the `else` branch is needed for tree-shaking } else { const { ImageOptimizerCache } = require('./image-optimizer') as typeof import('./image-optimizer') diff --git a/packages/next/src/server/response-cache/web.ts b/packages/next/src/server/response-cache/web.ts index 7fc2761b63dc5..f255fdd5412d4 100644 --- a/packages/next/src/server/response-cache/web.ts +++ b/packages/next/src/server/response-cache/web.ts @@ -17,8 +17,7 @@ export default class WebResponseCache { this.pendingResponses = new Map() // this is a hack to avoid Webpack knowing this is equal to this.minimalMode // because we replace this.minimalMode to true in production bundles. - const minimalModeKey = 'minimalMode' - this[minimalModeKey] = minimalMode + Object.assign(this, { minimalMode }) } public get(