From 80c66240409fefe3354b19a06ebffdc134abd358 Mon Sep 17 00:00:00 2001 From: Martyanov Andrey <37772440+martyanovandrey@users.noreply.github.com> Date: Thu, 27 Oct 2022 13:11:22 +0500 Subject: [PATCH] feat: allow load custom resources (#184) * feat: allow load custom resources * tests for loading custom resources * misc refactor * generate relative paths only for html mode * fix: md2md add meta only core resource path * chore(rebase): change args source --- src/constants.ts | 6 ++ src/index.ts | 20 +++++++ src/models.ts | 9 ++- src/resolvers/md2html.ts | 16 +++-- src/services/metadata.ts | 40 +++++++++++-- src/steps/processAssets.ts | 16 +---- src/steps/processPages.ts | 59 +++++++++++++++++-- src/utils/file.ts | 17 ++++++ src/utils/index.ts | 1 + src/utils/markup.ts | 35 +++++++++-- tests/e2e/load-custom-resources.spec.ts | 35 +++++++++++ .../expected-output/_assets/script/test1.js | 0 .../expected-output/_assets/style/test.css | 13 ++++ .../expected-output/_bundle/app.js | 52 ++++++++++++++++ .../expected-output/index.html | 27 +++++++++ .../expected-output/page.html | 26 ++++++++ .../expected-output/project/config.html | 26 ++++++++ .../md2html-with-resources/input/.yfm | 5 ++ .../input/_assets/script/test1.js | 0 .../input/_assets/style/test.css | 13 ++++ .../md2html-with-resources/input/index.yaml | 9 +++ .../md2html-with-resources/input/page.md | 5 ++ .../input/project/config.md | 1 + .../md2html-with-resources/input/toc.yaml | 7 +++ .../md2md-with-resources/expected-output/.yfm | 5 ++ .../expected-output/_assets/script/test1.js | 0 .../expected-output/_assets/style/test.css | 13 ++++ .../expected-output/index.yaml | 13 ++++ .../expected-output/page.md | 10 ++++ .../expected-output/project/config.md | 8 +++ .../expected-output/toc.yaml | 8 +++ .../md2md-with-resources/input/.yfm | 5 ++ .../input/_assets/script/test1.js | 0 .../input/_assets/style/test.css | 13 ++++ .../md2md-with-resources/input/index.yaml | 9 +++ .../md2md-with-resources/input/page.md | 5 ++ .../input/project/config.md | 1 + .../md2md-with-resources/input/toc.yaml | 7 +++ .../expected-output/_assets/script/test1.js | 0 .../expected-output/_assets/style/test.css | 13 ++++ .../expected-output/_bundle/app.js | 52 ++++++++++++++++ .../expected-output/index.html | 27 +++++++++ .../expected-output/page.html | 26 ++++++++ .../expected-output/project/config.html | 26 ++++++++ .../expected-output/single-page.html | 26 ++++++++ .../expected-output/single-page.json | 1 + .../single-page-with-resources/input/.yfm | 5 ++ .../input/_assets/script/test1.js | 0 .../input/_assets/style/test.css | 13 ++++ .../input/index.yaml | 9 +++ .../single-page-with-resources/input/page.md | 5 ++ .../input/project/config.md | 1 + .../single-page-with-resources/input/toc.yaml | 7 +++ tests/utils.ts | 19 ++++-- webpack.config.js | 27 ++++++++- 55 files changed, 754 insertions(+), 38 deletions(-) create mode 100644 src/utils/file.ts create mode 100644 tests/e2e/load-custom-resources.spec.ts create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/script/test1.js create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/style/test.css create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_bundle/app.js create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/expected-output/index.html create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/expected-output/page.html create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/expected-output/project/config.html create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/.yfm create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/_assets/script/test1.js create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/_assets/style/test.css create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/index.yaml create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/page.md create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/project/config.md create mode 100644 tests/mocks/load-custom-resources/md2html-with-resources/input/toc.yaml create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/.yfm create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/_assets/script/test1.js create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/_assets/style/test.css create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/index.yaml create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/page.md create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/project/config.md create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/expected-output/toc.yaml create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/.yfm create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/_assets/script/test1.js create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/_assets/style/test.css create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/index.yaml create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/page.md create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/project/config.md create mode 100644 tests/mocks/load-custom-resources/md2md-with-resources/input/toc.yaml create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/_assets/script/test1.js create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/_assets/style/test.css create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/_bundle/app.js create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/index.html create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/page.html create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/project/config.html create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/single-page.html create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/expected-output/single-page.json create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/.yfm create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/_assets/script/test1.js create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/_assets/style/test.css create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/index.yaml create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/page.md create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/project/config.md create mode 100644 tests/mocks/load-custom-resources/single-page-with-resources/input/toc.yaml diff --git a/src/constants.ts b/src/constants.ts index 0b21c253..35d87bd2 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -30,6 +30,7 @@ export const REDIRECTS_FILENAME = 'redirects.yaml'; export const LINT_CONFIG_FILENAME = '.yfmlint'; export const SINGLE_PAGE_FILENAME = 'single-page.html'; export const SINGLE_PAGE_DATA_FILENAME = 'single-page.json'; +export const CUSTOM_STYLE = 'custom-style'; export enum Stage { NEW = 'new', @@ -55,6 +56,11 @@ export enum IncludeMode { LINK = 'link' } +export enum ResourceType { + style = 'style', + script = 'script', +} + export const BUILD_FOLDER_PATH = dirname(process.mainModule?.filename || ''); export const YFM_PLUGINS = [ diff --git a/src/index.ts b/src/index.ts index b0019907..fd5d4ad0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,6 +28,8 @@ import { import {ArgvService, Includers} from './services'; import {argvValidator} from './validator'; import {prepareMapFile} from './steps/processMapFile'; +import {copyFiles} from './utils'; +import {Resources} from './models'; console.time(MAIN_TIMER_ID); @@ -136,6 +138,11 @@ yargs describe: 'Disable building', type: 'boolean', }) + .option('allow-custom-resources', { + default: false, + describe: 'Allow loading custom resources', + type: 'boolean', + }) .check(argvValidator) .example('yfm -i ./input -o ./output', '') .demandOption(['input', 'output'], 'Please provide input and output arguments to work with this tool') @@ -168,6 +175,8 @@ async function main(args: Arguments) { lintDisabled, buildDisabled, addMapFile, + allowCustomResources, + resources, } = ArgvService.getConfig(); preparingTemporaryFolders(args, userOutputFolder, tmpInputFolder, tmpOutputFolder); @@ -207,6 +216,17 @@ async function main(args: Arguments) { shell.cp(resolve(pathToRedirects), tmpOutputFolder); shell.cp(resolve(pathToLintConfig), tmpOutputFolder); + if (resources && allowCustomResources) { + const resourcePaths: string[] = []; + + // collect paths of all resources + Object.keys(resources).forEach((type) => + resources[type as keyof Resources]?.forEach((path: string) => resourcePaths.push(path))); + + //copy resources + copyFiles(args.input, tmpOutputFolder, resourcePaths); + } + break; } } diff --git a/src/models.ts b/src/models.ts index 5395e5a2..df6206e4 100644 --- a/src/models.ts +++ b/src/models.ts @@ -2,7 +2,7 @@ import {Logger} from '@doc-tools/transform/lib/log'; import {LintConfig} from '@doc-tools/transform/lib/yfmlint'; import {FileContributors, VCSConnector, VCSConnectorConfig} from './vcs-connector/connector-models'; -import {Lang, Stage, IncludeMode} from './constants'; +import {Lang, Stage, IncludeMode, ResourceType} from './constants'; export type VarsPreset = 'internal'|'external'; @@ -33,6 +33,7 @@ interface YfmConfig { lintDisabled: boolean; buildDisabled: boolean; lintConfig: LintConfig; + resources?: Resources; } export interface YfmArgv extends YfmConfig { @@ -49,6 +50,7 @@ export interface YfmArgv extends YfmConfig { contributors: boolean; addSystemMeta: boolean; addMapFile: boolean; + allowCustomResources: boolean; } export interface DocPreset { @@ -158,6 +160,7 @@ export interface MetaDataOptions { vcsConnector?: VCSConnector; addSystemMeta?: boolean; addSourcePath?: boolean; + resources?: Resources; } export interface PluginOptions { @@ -221,3 +224,7 @@ export interface ResolveMd2HTMLResult { }; lang: Lang; } + +export type Resources = { + [key in ResourceType]?: string[]; +}; diff --git a/src/resolvers/md2html.ts b/src/resolvers/md2html.ts index b1b05984..e0b6ff10 100644 --- a/src/resolvers/md2html.ts +++ b/src/resolvers/md2html.ts @@ -10,7 +10,7 @@ import {ResolverOptions, YfmToc, ResolveMd2HTMLResult} from '../models'; import {ArgvService, TocService, PluginService} from '../services'; import {generateStaticMarkup, logger, transformToc, getVarsPerFile, getVarsPerRelativeFile} from '../utils'; import {PROCESSING_FINISHED, Lang} from '../constants'; -import {getUpdatedMetadata} from '../services/metadata'; +import {getAssetsPublicPath, getUpdatedMetadata} from '../services/metadata'; export interface FileTransformOptions { path: string; @@ -31,7 +31,7 @@ export async function resolveMd2HTML(options: ResolverOptions): Promise) { + metaResources[type] = metaResources[type]?.map((el) => { + return join(assetsPublicPath, el); + }); + } + + return metaResources; +} + export { getContentWithUpdatedMetadata, getContentWithUpdatedStaticMetadata, getUpdatedMetadata, + getResolvedResourcePaths, + getAssetsPublicPath, }; diff --git a/src/steps/processAssets.ts b/src/steps/processAssets.ts index e0ee61d6..5c0289a2 100644 --- a/src/steps/processAssets.ts +++ b/src/steps/processAssets.ts @@ -1,11 +1,10 @@ import walkSync from 'walk-sync'; -import {dirname, resolve} from 'path'; +import {resolve} from 'path'; import shell from 'shelljs'; -import {copyFileSync} from 'fs'; import {BUNDLE_FILENAME, BUILD_FOLDER_PATH} from '../constants'; import {ArgvService} from '../services'; -import {logger} from '../utils'; +import {copyFiles} from '../utils'; /** * Processes assets files (everything except .yaml and .md files) @@ -27,16 +26,7 @@ export function processAssets(outputBundlePath: string) { ], }); - for (const pathToAsset of assetFilePath) { - const outputDir: string = resolve(outputFolderPath, dirname(pathToAsset)); - const from = resolve(inputFolderPath, pathToAsset); - const to = resolve(outputFolderPath, pathToAsset); - - shell.mkdir('-p', outputDir); - copyFileSync(from, to); - - logger.copy(pathToAsset); - } + copyFiles(inputFolderPath, outputFolderPath, assetFilePath); /* Copy js bundle to user' output folder */ const sourceBundlePath = resolve(BUILD_FOLDER_PATH, BUNDLE_FILENAME); diff --git a/src/steps/processPages.ts b/src/steps/processPages.ts index 15064258..f60a28ac 100644 --- a/src/steps/processPages.ts +++ b/src/steps/processPages.ts @@ -1,21 +1,31 @@ import {basename, dirname, extname, resolve, join, relative} from 'path'; import shell from 'shelljs'; -import {copyFileSync, writeFileSync} from 'fs'; +import {copyFileSync, readFileSync, writeFileSync} from 'fs'; import {bold} from 'chalk'; +import {dump, load} from 'js-yaml'; import log from '@doc-tools/transform/lib/log'; import {ArgvService, LeadingService, TocService, PluginService} from '../services'; import {resolveMd2HTML, resolveMd2Md} from '../resolvers'; import {generateStaticMarkup, joinSinglePageResults, logger, transformTocForSinglePage} from '../utils'; -import {MetaDataOptions, SinglePageResult, PathData, YfmToc, ResolveMd2HTMLResult} from '../models'; +import { + MetaDataOptions, + SinglePageResult, + PathData, + YfmToc, + ResolveMd2HTMLResult, + Resources, + LeadingPage, +} from '../models'; import {VCSConnector} from '../vcs-connector/connector-models'; import {getVCSConnector} from '../vcs-connector'; import { SINGLE_PAGE_FILENAME, SINGLE_PAGE_DATA_FILENAME, - Lang, + Lang, ResourceType, } from '../constants'; +import {getAssetsPublicPath, getResolvedResourcePaths} from '../services/metadata'; const singlePageResults: Record = {}; const singlePagePaths: Record> = {}; @@ -28,6 +38,7 @@ export async function processPages(outputBundlePath: string): Promise { outputFormat, singlePage, resolveConditions, + allowCustomResources, } = ArgvService.getConfig(); const vcsConnector = await getVCSConnector(); @@ -43,6 +54,10 @@ export async function processPages(outputBundlePath: string): Promise { const metaDataOptions = getMetaDataOptions(pathData, inputFolderPath.length, vcsConnector); + if (allowCustomResources && metaDataOptions.resources && outputFormat === 'html') { + metaDataOptions.resources = getResolvedResourcePaths(metaDataOptions.resources, getAssetsPublicPath(pathToFile)); + } + promises.push(preparingPagesByOutputFormat(pathData, metaDataOptions, resolveConditions, singlePage)); } @@ -93,6 +108,7 @@ async function saveSinglePages(outputBundlePath: string) { input: inputFolderPath, output: outputFolderPath, lang, + resources, } = ArgvService.getConfig(); try { @@ -114,7 +130,7 @@ async function saveSinglePages(outputBundlePath: string) { leading: false, html: singlePageBody, headings: [], - meta: {}, + meta: resources || {}, toc: preparedToc, }, router: { @@ -164,7 +180,7 @@ function savePageResultForSinglePage(pageProps: ResolveMd2HTMLResult, pathData: function getMetaDataOptions(pathData: PathData, inputFolderPathLength: number, vcsConnector?: VCSConnector, ): MetaDataOptions { - const {contributors, addSystemMeta} = ArgvService.getConfig(); + const {contributors, addSystemMeta, resources, allowCustomResources} = ArgvService.getConfig(); const metaDataOptions: MetaDataOptions = { vcsConnector, @@ -177,6 +193,19 @@ function getMetaDataOptions(pathData: PathData, inputFolderPathLength: number, v addSystemMeta, }; + + if (allowCustomResources && resources) { + const allowedResources = Object.entries(resources).reduce((acc: Resources, [key, val]) => { + if (Object.keys(ResourceType).includes(key)) { + acc[key as keyof typeof ResourceType] = val; + } + return acc; + }, {}); + + metaDataOptions.resources = allowedResources; + } + + return metaDataOptions; } @@ -195,6 +224,7 @@ async function preparingPagesByOutputFormat( outputFormat, pathToFile, } = path; + const {allowCustomResources} = ArgvService.getConfig(); try { shell.mkdir('-p', outputDir); @@ -205,6 +235,11 @@ async function preparingPagesByOutputFormat( LeadingService.filterFile(pathToFile); } + if (outputFormat === 'md' && isYamlFileExtension && allowCustomResources) { + processingYamlFile(path, metaDataOptions); + return; + } + if (outputFormat === 'md' && isYamlFileExtension || outputFormat === 'html' && !isYamlFileExtension && fileExtension !== '.md') { copyFileWithoutChanges(resolvedPathToFile, outputDir, filename); @@ -231,6 +266,20 @@ async function preparingPagesByOutputFormat( log.error(message); } } +//@ts-ignore +function processingYamlFile(path: PathData, metaDataOptions: MetaDataOptions) { + const {pathToFile, outputFolderPath, inputFolderPath} = path; + + const filePath = resolve(inputFolderPath, pathToFile); + const content = readFileSync(filePath, 'utf8'); + const parsedContent = load(content) as LeadingPage; + + if (metaDataOptions.resources) { + parsedContent.meta = {...parsedContent.meta, ...metaDataOptions.resources}; + } + + writeFileSync(resolve(outputFolderPath, pathToFile), dump(parsedContent)); +} function copyFileWithoutChanges(resolvedPathToFile: string, outputDir: string, filename: string): void { const from = resolvedPathToFile; diff --git a/src/utils/file.ts b/src/utils/file.ts new file mode 100644 index 00000000..4fba1fde --- /dev/null +++ b/src/utils/file.ts @@ -0,0 +1,17 @@ +import {dirname, resolve} from 'path'; +import shell from 'shelljs'; +import {copyFileSync} from 'fs'; +import {logger} from './logger'; + +export function copyFiles(inputFolderPath: string, outputFolderPath: string, files: string[]): void { + for (const pathToAsset of files) { + const outputDir: string = resolve(outputFolderPath, dirname(pathToAsset)); + const from = resolve(inputFolderPath, pathToAsset); + const to = resolve(outputFolderPath, pathToAsset); + + shell.mkdir('-p', outputDir); + copyFileSync(from, to); + + logger.copy(pathToAsset); + } +} diff --git a/src/utils/index.ts b/src/utils/index.ts index ad90a89f..7586f2a1 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -6,3 +6,4 @@ export * from './path'; export * from './toc'; export * from './presets'; export * from './glob'; +export * from './file'; diff --git a/src/utils/markup.ts b/src/utils/markup.ts index 298ed902..d0ffa1fc 100644 --- a/src/utils/markup.ts +++ b/src/utils/markup.ts @@ -1,13 +1,19 @@ import {platform} from 'process'; -import {Platforms} from '../constants'; -import {ResolveMd2HTMLResult, SinglePageResult} from '../models'; + +import {CUSTOM_STYLE, Platforms, ResourceType} from '../constants'; +import {ResolveMd2HTMLResult, SinglePageResult, Resources} from '../models'; import {PluginService} from '../services'; import {preprocessPageHtmlForSinglePage} from './singlePage'; export interface GenerateStaticMarkup extends ResolveMd2HTMLResult {} +export interface TitleMeta { + title?: string; +} +export type Meta = TitleMeta & Resources; + export function generateStaticMarkup(props: GenerateStaticMarkup, pathToBundle: string): string { - const {title: metaTitle} = props.data.meta as {title?: string} || {}; + const {title: metaTitle, style, script} = props.data.meta as Meta || {}; const {title: tocTitle} = props.data.toc; const {title: pageTitle} = props.data; @@ -16,6 +22,7 @@ export function generateStaticMarkup(props: GenerateStaticMarkup, pathToBundle: tocTitle: tocTitle as string, pageTitle, }); + const resources = getResources({style, script}); return ` @@ -31,6 +38,7 @@ export function generateStaticMarkup(props: GenerateStaticMarkup, pathToBundle: } ${PluginService.getHeadContent()} + ${resources}
@@ -68,7 +76,8 @@ function getMetadata(metadata: Record): string { return ''; } - const metaEntries = Object.entries(metadata); + // Exclude resources from meta, proceed them separately + const metaEntries = Object.keys(metadata).filter((key) => !Object.keys(ResourceType).includes(key)); return metaEntries .map(([name, content]) => { @@ -77,6 +86,24 @@ function getMetadata(metadata: Record): string { .join('\n'); } +function getResources({style, script}: Resources) { + const resourcesTags: string[] = []; + + if (style) { + style.forEach((el, id) => resourcesTags.push( + ``, + )); + } + + if (script) { + script.forEach((el) => resourcesTags.push( + ``, + )); + } + + return resourcesTags.join('\n'); +} + export const сarriage = platform === Platforms.WINDOWS ? '\r\n' : '\n'; export function joinSinglePageResults(singlePageResults: SinglePageResult[], root: string, tocDir: string): string { diff --git a/tests/e2e/load-custom-resources.spec.ts b/tests/e2e/load-custom-resources.spec.ts new file mode 100644 index 00000000..3b7e9563 --- /dev/null +++ b/tests/e2e/load-custom-resources.spec.ts @@ -0,0 +1,35 @@ +import {getTestPaths, runYfmDocs, compareDirectories} from '../utils'; + +const geretateMapTestTemplate = (testTitle, testRootPath, {md2md = true, md2html = true, args = '--allow-custom-resources'}) => { + test(testTitle, () => { + const {inputPath, outputPath, expectedOutputPath} = getTestPaths(testRootPath); + runYfmDocs(inputPath, outputPath, {md2md, md2html, args}); + + const unifyData = (text) => text + // Remove unique id's + .replace(/"id":"Documentation.+?"|Config.+?"/gm, '') + // Unify windows & mac data + .replace(/\\/gm, '/') + .replace(/\/r\/n|\/r|\/n/gm, '') + .replace(/\r\n|\r|\n/gm, '') + .replace(/\/|\\/gm, '') + + const compareResult = compareDirectories(expectedOutputPath, outputPath, unifyData) + + if (typeof compareResult === 'boolean') { + expect(true).toEqual(compareResult); + } else { + const {expectedContent, outputContent} = compareResult; + + expect(expectedContent).toEqual(outputContent); + } + }); +} + +describe('Allow load custom resources', () => { + geretateMapTestTemplate('md2md with custom resources', 'mocks/load-custom-resources/md2md-with-resources', {md2html: false}) + + geretateMapTestTemplate('md2html with custom resources', 'mocks/load-custom-resources/md2html-with-resources', {md2md: false}) + + geretateMapTestTemplate('md2html single page with custom resources', 'mocks/load-custom-resources/single-page-with-resources', {md2md: false, args: '--allow-custom-resources --single-page'}) +}); diff --git a/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/script/test1.js b/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/script/test1.js new file mode 100644 index 00000000..e69de29b diff --git a/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/style/test.css b/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/style/test.css new file mode 100644 index 00000000..1d78a130 --- /dev/null +++ b/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_assets/style/test.css @@ -0,0 +1,13 @@ +.Header { + background-color: darkkhaki; +} + +h1 { + /*font-family: 'Qwitcher Grypen', cursive;*/ + font-family: 'QwitcherGrypen-Regular'; +} + +@font-face { + font-family: 'QwitcherGrypen-Regular'; + src: url('https://yfm-test-doc123.martyanov-av.ui.yandex.net/docs-assets/yfm-test-doc123/test39/ru/_assets/fonts/QwitcherGrypen-Regular.ttf'); +} \ No newline at end of file diff --git a/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_bundle/app.js b/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_bundle/app.js new file mode 100644 index 00000000..d4a2de93 --- /dev/null +++ b/tests/mocks/load-custom-resources/md2html-with-resources/expected-output/_bundle/app.js @@ -0,0 +1,52 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=134)}([function(e,t,n){"use strict";e.exports=n(52)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(61),o=(0,r.setup)();function i(e){return"string"==typeof e}function a(e){return i(e)||Array.isArray(e)&&e.every(i)}function l(e){var t=o(e);function n(){for(var e=[],n=0;n + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var i="Expected a function",a="__lodash_placeholder__",l=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",s="[object Array]",u="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",g="[object GeneratorFunction]",h="[object Map]",A="[object Number]",m="[object Object]",y="[object RegExp]",v="[object Set]",b="[object String]",E="[object Symbol]",x="[object WeakMap]",w="[object ArrayBuffer]",C="[object DataView]",B="[object Float32Array]",I="[object Float64Array]",k="[object Int8Array]",Q="[object Int16Array]",_="[object Int32Array]",S="[object Uint8Array]",T="[object Uint16Array]",M="[object Uint32Array]",O=/\b__p \+= '';/g,P=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,D=/[&<>"']/g,z=RegExp(j.source),L=RegExp(D.source),F=/<%-([\s\S]+?)%>/g,R=/<%([\s\S]+?)%>/g,V=/<%=([\s\S]+?)%>/g,U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,G=RegExp(W.source),H=/^\s+/,K=/\s/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,oe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,le=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,se=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,fe=/['\n\r\u2028\u2029\\]/g,de="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ge="[\\ud800-\\udfff]",he="["+pe+"]",Ae="["+de+"]",me="\\d+",ye="[\\u2700-\\u27bf]",ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",be="[^\\ud800-\\udfff"+pe+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",xe="[^\\ud800-\\udfff]",we="(?:\\ud83c[\\udde6-\\uddff]){2}",Ce="[\\ud800-\\udbff][\\udc00-\\udfff]",Be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ie="(?:"+ve+"|"+be+")",ke="(?:"+Be+"|"+be+")",Qe="(?:"+Ae+"|"+Ee+")"+"?",_e="[\\ufe0e\\ufe0f]?"+Qe+("(?:\\u200d(?:"+[xe,we,Ce].join("|")+")[\\ufe0e\\ufe0f]?"+Qe+")*"),Se="(?:"+[ye,we,Ce].join("|")+")"+_e,Te="(?:"+[xe+Ae+"?",Ae,we,Ce,ge].join("|")+")",Me=RegExp("['’]","g"),Oe=RegExp(Ae,"g"),Pe=RegExp(Ee+"(?="+Ee+")|"+Te+_e,"g"),Ne=RegExp([Be+"?"+ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[he,Be,"$"].join("|")+")",ke+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[he,Be+Ie,"$"].join("|")+")",Be+"?"+Ie+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,Se].join("|"),"g"),je=RegExp("[\\u200d\\ud800-\\udfff"+de+"\\ufe0e\\ufe0f]"),De=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ze=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Le=-1,Fe={};Fe[B]=Fe[I]=Fe[k]=Fe[Q]=Fe[_]=Fe[S]=Fe["[object Uint8ClampedArray]"]=Fe[T]=Fe[M]=!0,Fe[c]=Fe[s]=Fe[w]=Fe[u]=Fe[C]=Fe[f]=Fe[d]=Fe[p]=Fe[h]=Fe[A]=Fe[m]=Fe[y]=Fe[v]=Fe[b]=Fe[x]=!1;var Re={};Re[c]=Re[s]=Re[w]=Re[C]=Re[u]=Re[f]=Re[B]=Re[I]=Re[k]=Re[Q]=Re[_]=Re[h]=Re[A]=Re[m]=Re[y]=Re[v]=Re[b]=Re[E]=Re[S]=Re["[object Uint8ClampedArray]"]=Re[T]=Re[M]=!0,Re[d]=Re[p]=Re[x]=!1;var Ve={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,Ye=parseInt,qe="object"==typeof e&&e&&e.Object===Object&&e,We="object"==typeof self&&self&&self.Object===Object&&self,Ge=qe||We||Function("return this")(),He=t&&!t.nodeType&&t,Ke=He&&"object"==typeof r&&r&&!r.nodeType&&r,Je=Ke&&Ke.exports===He,Xe=Je&&qe.process,Ze=function(){try{var e=Ke&&Ke.require&&Ke.require("util").types;return e||Xe&&Xe.binding&&Xe.binding("util")}catch(e){}}(),$e=Ze&&Ze.isArrayBuffer,et=Ze&&Ze.isDate,tt=Ze&&Ze.isMap,nt=Ze&&Ze.isRegExp,rt=Ze&&Ze.isSet,ot=Ze&&Ze.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o-1}function dt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function Nt(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function jt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Dt=It({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),zt=It({"&":"&","<":"<",">":">",'"':""","'":"'"});function Lt(e){return"\\"+Ve[e]}function Ft(e){return je.test(e)}function Rt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Vt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,r=e.length,o=0,i=[];++n",""":'"',"'":"'"});var Jt=function e(t){var n,r=(t=null==t?Ge:Jt.defaults(Ge.Object(),t,Jt.pick(Ge,ze))).Array,o=t.Date,K=t.Error,de=t.Function,pe=t.Math,ge=t.Object,he=t.RegExp,Ae=t.String,me=t.TypeError,ye=r.prototype,ve=de.prototype,be=ge.prototype,Ee=t["__core-js_shared__"],xe=ve.toString,we=be.hasOwnProperty,Ce=0,Be=(n=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ie=be.toString,ke=xe.call(ge),Qe=Ge._,_e=he("^"+xe.call(we).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Se=Je?t.Buffer:void 0,Te=t.Symbol,Pe=t.Uint8Array,je=Se?Se.allocUnsafe:void 0,Ve=Vt(ge.getPrototypeOf,ge),qe=ge.create,We=be.propertyIsEnumerable,He=ye.splice,Ke=Te?Te.isConcatSpreadable:void 0,Xe=Te?Te.iterator:void 0,Ze=Te?Te.toStringTag:void 0,yt=function(){try{var e=ti(ge,"defineProperty");return e({},"",{}),e}catch(e){}}(),It=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Xt=o&&o.now!==Ge.Date.now&&o.now,Zt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,$t=pe.ceil,en=pe.floor,tn=ge.getOwnPropertySymbols,nn=Se?Se.isBuffer:void 0,rn=t.isFinite,on=ye.join,an=Vt(ge.keys,ge),ln=pe.max,cn=pe.min,sn=o.now,un=t.parseInt,fn=pe.random,dn=ye.reverse,pn=ti(t,"DataView"),gn=ti(t,"Map"),hn=ti(t,"Promise"),An=ti(t,"Set"),mn=ti(t,"WeakMap"),yn=ti(ge,"create"),vn=mn&&new mn,bn={},En=Qi(pn),xn=Qi(gn),wn=Qi(hn),Cn=Qi(An),Bn=Qi(mn),In=Te?Te.prototype:void 0,kn=In?In.valueOf:void 0,Qn=In?In.toString:void 0;function _n(e){if(qa(e)&&!Pa(e)&&!(e instanceof On)){if(e instanceof Mn)return e;if(we.call(e,"__wrapped__"))return _i(e)}return new Mn(e)}var Sn=function(){function e(){}return function(t){if(!Ya(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Tn(){}function Mn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Xn(e,t,n,r,o,i){var a,l=1&t,s=2&t,d=4&t;if(n&&(a=o?n(e,r,o,i):n(e)),void 0!==a)return a;if(!Ya(e))return e;var x=Pa(e);if(x){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&we.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return vo(e,a)}else{var O=oi(e),P=O==p||O==g;if(za(e))return po(e,l);if(O==m||O==c||P&&!o){if(a=s||P?{}:ai(e),!l)return s?function(e,t){return bo(e,ri(e),t)}(e,function(e,t){return e&&bo(t,xl(t),e)}(a,e)):function(e,t){return bo(e,ni(e),t)}(e,Gn(a,e))}else{if(!Re[O])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case w:return go(e);case u:case f:return new r(+e);case C:return function(e,t){var n=t?go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case B:case I:case k:case Q:case _:case S:case"[object Uint8ClampedArray]":case T:case M:return ho(e,n);case h:return new r;case A:case b:return new r(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case v:return new r;case E:return o=e,kn?ge(kn.call(o)):{}}var o}(e,O,l)}}i||(i=new zn);var N=i.get(e);if(N)return N;i.set(e,a),Ja(e)?e.forEach((function(r){a.add(Xn(r,t,n,r,e,i))})):Wa(e)&&e.forEach((function(r,o){a.set(o,Xn(r,t,n,o,e,i))}));var j=x?void 0:(d?s?Ho:Go:s?xl:El)(e);return lt(j||e,(function(r,o){j&&(r=e[o=r]),Yn(a,o,Xn(r,t,n,o,e,i))})),a}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ge(e);r--;){var o=n[r],i=t[o],a=e[o];if(void 0===a&&!(o in e)||!i(a))return!1}return!0}function $n(e,t,n){if("function"!=typeof e)throw new me(i);return Ei((function(){e.apply(void 0,n)}),t)}function er(e,t,n,r){var o=-1,i=ft,a=!0,l=e.length,c=[],s=t.length;if(!l)return c;n&&(t=pt(t,Tt(n))),r?(i=dt,a=!1):t.length>=200&&(i=Ot,a=!1,t=new Dn(t));e:for(;++o-1},Nn.prototype.set=function(e,t){var n=this.__data__,r=qn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Pn,map:new(gn||Nn),string:new Pn}},jn.prototype.delete=function(e){var t=$o(this,e).delete(e);return this.size-=t?1:0,t},jn.prototype.get=function(e){return $o(this,e).get(e)},jn.prototype.has=function(e){return $o(this,e).has(e)},jn.prototype.set=function(e,t){var n=$o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Dn.prototype.add=Dn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.clear=function(){this.__data__=new Nn,this.size=0},zn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zn.prototype.get=function(e){return this.__data__.get(e)},zn.prototype.has=function(e){return this.__data__.has(e)},zn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Nn){var r=n.__data__;if(!gn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(e,t),this.size=n.size,this};var tr=wo(sr),nr=wo(ur,!0);function rr(e,t){var n=!0;return tr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function or(e,t,n){for(var r=-1,o=e.length;++r0&&n(l)?t>1?ar(l,t-1,n,r,o):gt(o,l):r||(o[o.length]=l)}return o}var lr=Co(),cr=Co(!0);function sr(e,t){return e&&lr(e,t,El)}function ur(e,t){return e&&cr(e,t,El)}function fr(e,t){return ut(t,(function(t){return Ra(e[t])}))}function dr(e,t){for(var n=0,r=(t=co(t,e)).length;null!=e&&nt}function Ar(e,t){return null!=e&&we.call(e,t)}function mr(e,t){return null!=e&&t in ge(e)}function yr(e,t,n){for(var o=n?dt:ft,i=e[0].length,a=e.length,l=a,c=r(a),s=1/0,u=[];l--;){var f=e[l];l&&t&&(f=pt(f,Tt(t))),s=cn(f.length,s),c[l]=!n&&(t||i>=120&&f.length>=120)?new Dn(l&&f):void 0}f=e[0];var d=-1,p=c[0];e:for(;++d=l)return c;var s=n[r];return c*("desc"==s?-1:1)}}return e.index-t.index}(e,t,n)}))}function Pr(e,t,n){for(var r=-1,o=t.length,i={};++r-1;)l!==e&&He.call(l,c,1),He.call(e,c,1);return e}function jr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;ci(o)?He.call(e,o,1):eo(e,o)}}return e}function Dr(e,t){return e+en(fn()*(t-e+1))}function zr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=en(t/2))&&(e+=e)}while(t);return n}function Lr(e,t){return xi(Ai(e,t,Gl),e+"")}function Fr(e){return Fn(Sl(e))}function Rr(e,t){var n=Sl(e);return Bi(n,Jn(t,0,n.length))}function Vr(e,t,n,r){if(!Ya(e))return e;for(var o=-1,i=(t=co(t,e)).length,a=i-1,l=e;null!=l&&++oi?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o>>1,a=e[i];null!==a&&!Za(a)&&(n?a<=t:a=200){var s=t?null:Lo(e);if(s)return Yt(s);a=!1,o=Ot,c=new Dn}else c=t?[]:l;e:for(;++r=r?e:Wr(e,t,n)}var fo=It||function(e){return Ge.clearTimeout(e)};function po(e,t){if(t)return e.slice();var n=e.length,r=je?je(n):new e.constructor(n);return e.copy(r),r}function go(e){var t=new e.constructor(e.byteLength);return new Pe(t).set(new Pe(e)),t}function ho(e,t){var n=t?go(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ao(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Za(e),a=void 0!==t,l=null===t,c=t==t,s=Za(t);if(!l&&!s&&!i&&e>t||i&&a&&c&&!l&&!s||r&&a&&c||!n&&c||!o)return 1;if(!r&&!i&&!s&&e1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&si(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=ge(t);++r-1?o[i?t[a]:a]:void 0}}function _o(e){return Wo((function(t){var n=t.length,r=n,o=Mn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new me(i);if(o&&!l&&"wrapper"==Jo(a))var l=new Mn([],!0)}for(r=l?r:n;++r1&&v.reverse(),f&&sl))return!1;var s=i.get(e),u=i.get(t);if(s&&u)return s==t&&u==e;var f=-1,d=!0,p=2&n?new Dn:void 0;for(i.set(e,t),i.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(J,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return lt(l,(function(n){var r="_."+n[0];t&n[1]&&!ft(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Z):[]}(r),n)))}function Ci(e){var t=0,n=0;return function(){var r=sn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Bi(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ki(e,n)}));function na(e){var t=_n(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var oa=Wo((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof On&&ci(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[o],thisArg:void 0}),new Mn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(o)}));var ia=Eo((function(e,t,n){we.call(e,n)?++e[n]:Hn(e,n,1)}));var aa=Qo(Oi),la=Qo(Pi);function ca(e,t){return(Pa(e)?lt:tr)(e,Zo(t,3))}function sa(e,t){return(Pa(e)?ct:nr)(e,Zo(t,3))}var ua=Eo((function(e,t,n){we.call(e,n)?e[n].push(t):Hn(e,n,[t])}));var fa=Lr((function(e,t,n){var o=-1,i="function"==typeof t,a=ja(e)?r(e.length):[];return tr(e,(function(e){a[++o]=i?it(t,e,n):vr(e,t,n)})),a})),da=Eo((function(e,t,n){Hn(e,n,t)}));function pa(e,t){return(Pa(e)?pt:Qr)(e,Zo(t,3))}var ga=Eo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ha=Lr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&si(e,t[0],t[1])?t=[]:n>2&&si(t[0],t[1],t[2])&&(t=[t[0]]),Or(e,ar(t,1),[])})),Aa=Xt||function(){return Ge.Date.now()};function ma(e,t,n){return t=n?void 0:t,Ro(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var n;if("function"!=typeof t)throw new me(i);return e=ol(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var va=Lr((function(e,t,n){var r=1;if(n.length){var o=Ut(n,Xo(va));r|=32}return Ro(e,r,t,n,o)})),ba=Lr((function(e,t,n){var r=3;if(n.length){var o=Ut(n,Xo(ba));r|=32}return Ro(t,r,e,n,o)}));function Ea(e,t,n){var r,o,a,l,c,s,u=0,f=!1,d=!1,p=!0;if("function"!=typeof e)throw new me(i);function g(t){var n=r,i=o;return r=o=void 0,u=t,l=e.apply(i,n)}function h(e){return u=e,c=Ei(m,t),f?g(e):l}function A(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-u>=a}function m(){var e=Aa();if(A(e))return y(e);c=Ei(m,function(e){var n=t-(e-s);return d?cn(n,a-(e-u)):n}(e))}function y(e){return c=void 0,p&&r?g(e):(r=o=void 0,l)}function v(){var e=Aa(),n=A(e);if(r=arguments,o=this,s=e,n){if(void 0===c)return h(s);if(d)return fo(c),c=Ei(m,t),g(s)}return void 0===c&&(c=Ei(m,t)),l}return t=al(t)||0,Ya(n)&&(f=!!n.leading,a=(d="maxWait"in n)?ln(al(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==c&&fo(c),u=0,r=s=o=c=void 0},v.flush=function(){return void 0===c?l:y(Aa())},v}var xa=Lr((function(e,t){return $n(e,1,t)})),wa=Lr((function(e,t,n){return $n(e,al(t)||0,n)}));function Ca(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ca.Cache||jn),n}function Ba(e){if("function"!=typeof e)throw new me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ca.Cache=jn;var Ia=so((function(e,t){var n=(t=1==t.length&&Pa(t[0])?pt(t[0],Tt(Zo())):pt(ar(t,1),Tt(Zo()))).length;return Lr((function(r){for(var o=-1,i=cn(r.length,n);++o=t})),Oa=br(function(){return arguments}())?br:function(e){return qa(e)&&we.call(e,"callee")&&!We.call(e,"callee")},Pa=r.isArray,Na=$e?Tt($e):function(e){return qa(e)&&gr(e)==w};function ja(e){return null!=e&&Ua(e.length)&&!Ra(e)}function Da(e){return qa(e)&&ja(e)}var za=nn||ac,La=et?Tt(et):function(e){return qa(e)&&gr(e)==f};function Fa(e){if(!qa(e))return!1;var t=gr(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ha(e)}function Ra(e){if(!Ya(e))return!1;var t=gr(e);return t==p||t==g||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Va(e){return"number"==typeof e&&e==ol(e)}function Ua(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ya(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qa(e){return null!=e&&"object"==typeof e}var Wa=tt?Tt(tt):function(e){return qa(e)&&oi(e)==h};function Ga(e){return"number"==typeof e||qa(e)&&gr(e)==A}function Ha(e){if(!qa(e)||gr(e)!=m)return!1;var t=Ve(e);if(null===t)return!0;var n=we.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&xe.call(n)==ke}var Ka=nt?Tt(nt):function(e){return qa(e)&&gr(e)==y};var Ja=rt?Tt(rt):function(e){return qa(e)&&oi(e)==v};function Xa(e){return"string"==typeof e||!Pa(e)&&qa(e)&&gr(e)==b}function Za(e){return"symbol"==typeof e||qa(e)&&gr(e)==E}var $a=ot?Tt(ot):function(e){return qa(e)&&Ua(e.length)&&!!Fe[gr(e)]};var el=jo(kr),tl=jo((function(e,t){return e<=t}));function nl(e){if(!e)return[];if(ja(e))return Xa(e)?Gt(e):vo(e);if(Xe&&e[Xe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Xe]());var t=oi(e);return(t==h?Rt:t==v?Yt:Sl)(e)}function rl(e){return e?(e=al(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ol(e){var t=rl(e),n=t%1;return t==t?n?t-n:t:0}function il(e){return e?Jn(ol(e),0,4294967295):0}function al(e){if("number"==typeof e)return e;if(Za(e))return NaN;if(Ya(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ya(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=St(e);var n=ie.test(e);return n||le.test(e)?Ye(e.slice(2),n?2:8):oe.test(e)?NaN:+e}function ll(e){return bo(e,xl(e))}function cl(e){return null==e?"":Zr(e)}var sl=xo((function(e,t){if(pi(t)||ja(t))bo(t,El(t),e);else for(var n in t)we.call(t,n)&&Yn(e,n,t[n])})),ul=xo((function(e,t){bo(t,xl(t),e)})),fl=xo((function(e,t,n,r){bo(t,xl(t),e,r)})),dl=xo((function(e,t,n,r){bo(t,El(t),e,r)})),pl=Wo(Kn);var gl=Lr((function(e,t){e=ge(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&si(t[0],t[1],o)&&(r=1);++n1),t})),bo(e,Ho(e),n),r&&(n=Xn(n,7,Yo));for(var o=t.length;o--;)eo(n,t[o]);return n}));var Il=Wo((function(e,t){return null==e?{}:function(e,t){return Pr(e,t,(function(t,n){return ml(e,n)}))}(e,t)}));function kl(e,t){if(null==e)return{};var n=pt(Ho(e),(function(e){return[e]}));return t=Zo(t),Pr(e,n,(function(e,n){return t(e,n[0])}))}var Ql=Fo(El),_l=Fo(xl);function Sl(e){return null==e?[]:Mt(e,El(e))}var Tl=Io((function(e,t,n){return t=t.toLowerCase(),e+(n?Ml(t):t)}));function Ml(e){return Fl(cl(e).toLowerCase())}function Ol(e){return(e=cl(e))&&e.replace(se,Dt).replace(Oe,"")}var Pl=Io((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Nl=Io((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),jl=Bo("toLowerCase");var Dl=Io((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var zl=Io((function(e,t,n){return e+(n?" ":"")+Fl(t)}));var Ll=Io((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Fl=Bo("toUpperCase");function Rl(e,t,n){return e=cl(e),void 0===(t=n?void 0:t)?function(e){return De.test(e)}(e)?function(e){return e.match(Ne)||[]}(e):function(e){return e.match($)||[]}(e):e.match(t)||[]}var Vl=Lr((function(e,t){try{return it(e,void 0,t)}catch(e){return Fa(e)?e:new K(e)}})),Ul=Wo((function(e,t){return lt(t,(function(t){t=ki(t),Hn(e,t,va(e[t],e))})),e}));function Yl(e){return function(){return e}}var ql=_o(),Wl=_o(!0);function Gl(e){return e}function Hl(e){return Cr("function"==typeof e?e:Xn(e,1))}var Kl=Lr((function(e,t){return function(n){return vr(n,e,t)}})),Jl=Lr((function(e,t){return function(n){return vr(e,n,t)}}));function Xl(e,t,n){var r=El(t),o=fr(t,r);null!=n||Ya(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=fr(t,El(t)));var i=!(Ya(n)&&"chain"in n&&!n.chain),a=Ra(e);return lt(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=vo(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,gt([this.value()],arguments))})})),e}function Zl(){}var $l=Oo(pt),ec=Oo(st),tc=Oo(mt);function nc(e){return ui(e)?Bt(ki(e)):function(e){return function(t){return dr(t,e)}}(e)}var rc=No(),oc=No(!0);function ic(){return[]}function ac(){return!1}var lc=Mo((function(e,t){return e+t}),0),cc=zo("ceil"),sc=Mo((function(e,t){return e/t}),1),uc=zo("floor");var fc,dc=Mo((function(e,t){return e*t}),1),pc=zo("round"),gc=Mo((function(e,t){return e-t}),0);return _n.after=function(e,t){if("function"!=typeof t)throw new me(i);return e=ol(e),function(){if(--e<1)return t.apply(this,arguments)}},_n.ary=ma,_n.assign=sl,_n.assignIn=ul,_n.assignInWith=fl,_n.assignWith=dl,_n.at=pl,_n.before=ya,_n.bind=va,_n.bindAll=Ul,_n.bindKey=ba,_n.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pa(e)?e:[e]},_n.chain=na,_n.chunk=function(e,t,n){t=(n?si(e,t,n):void 0===t)?1:ln(ol(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var i=0,a=0,l=r($t(o/t));io?0:o+n),(r=void 0===r||r>o?o:ol(r))<0&&(r+=o),r=n>r?0:il(r);n>>0)?(e=cl(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Zr(t))&&Ft(e)?uo(Gt(e),0,n):e.split(t,n):[]},_n.spread=function(e,t){if("function"!=typeof e)throw new me(i);return t=null==t?0:ln(ol(t),0),Lr((function(n){var r=n[t],o=uo(n,0,t);return r&>(o,r),it(e,this,o)}))},_n.tail=function(e){var t=null==e?0:e.length;return t?Wr(e,1,t):[]},_n.take=function(e,t,n){return e&&e.length?Wr(e,0,(t=n||void 0===t?1:ol(t))<0?0:t):[]},_n.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=r-(t=n||void 0===t?1:ol(t)))<0?0:t,r):[]},_n.takeRightWhile=function(e,t){return e&&e.length?no(e,Zo(t,3),!1,!0):[]},_n.takeWhile=function(e,t){return e&&e.length?no(e,Zo(t,3)):[]},_n.tap=function(e,t){return t(e),e},_n.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new me(i);return Ya(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ea(e,t,{leading:r,maxWait:t,trailing:o})},_n.thru=ra,_n.toArray=nl,_n.toPairs=Ql,_n.toPairsIn=_l,_n.toPath=function(e){return Pa(e)?pt(e,ki):Za(e)?[e]:vo(Ii(cl(e)))},_n.toPlainObject=ll,_n.transform=function(e,t,n){var r=Pa(e),o=r||za(e)||$a(e);if(t=Zo(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Ya(e)&&Ra(i)?Sn(Ve(e)):{}}return(o?lt:sr)(e,(function(e,r,o){return t(n,e,r,o)})),n},_n.unary=function(e){return ma(e,1)},_n.union=qi,_n.unionBy=Wi,_n.unionWith=Gi,_n.uniq=function(e){return e&&e.length?$r(e):[]},_n.uniqBy=function(e,t){return e&&e.length?$r(e,Zo(t,2)):[]},_n.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?$r(e,void 0,t):[]},_n.unset=function(e,t){return null==e||eo(e,t)},_n.unzip=Hi,_n.unzipWith=Ki,_n.update=function(e,t,n){return null==e?e:to(e,t,lo(n))},_n.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:to(e,t,lo(n),r)},_n.values=Sl,_n.valuesIn=function(e){return null==e?[]:Mt(e,xl(e))},_n.without=Ji,_n.words=Rl,_n.wrap=function(e,t){return ka(lo(t),e)},_n.xor=Xi,_n.xorBy=Zi,_n.xorWith=$i,_n.zip=ea,_n.zipObject=function(e,t){return io(e||[],t||[],Yn)},_n.zipObjectDeep=function(e,t){return io(e||[],t||[],Vr)},_n.zipWith=ta,_n.entries=Ql,_n.entriesIn=_l,_n.extend=ul,_n.extendWith=fl,Xl(_n,_n),_n.add=lc,_n.attempt=Vl,_n.camelCase=Tl,_n.capitalize=Ml,_n.ceil=cc,_n.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=al(n))==n?n:0),void 0!==t&&(t=(t=al(t))==t?t:0),Jn(al(e),t,n)},_n.clone=function(e){return Xn(e,4)},_n.cloneDeep=function(e){return Xn(e,5)},_n.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},_n.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},_n.conformsTo=function(e,t){return null==t||Zn(e,t,El(t))},_n.deburr=Ol,_n.defaultTo=function(e,t){return null==e||e!=e?t:e},_n.divide=sc,_n.endsWith=function(e,t,n){e=cl(e),t=Zr(t);var r=e.length,o=n=void 0===n?r:Jn(ol(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},_n.eq=Sa,_n.escape=function(e){return(e=cl(e))&&L.test(e)?e.replace(D,zt):e},_n.escapeRegExp=function(e){return(e=cl(e))&&G.test(e)?e.replace(W,"\\$&"):e},_n.every=function(e,t,n){var r=Pa(e)?st:rr;return n&&si(e,t,n)&&(t=void 0),r(e,Zo(t,3))},_n.find=aa,_n.findIndex=Oi,_n.findKey=function(e,t){return vt(e,Zo(t,3),sr)},_n.findLast=la,_n.findLastIndex=Pi,_n.findLastKey=function(e,t){return vt(e,Zo(t,3),ur)},_n.floor=uc,_n.forEach=ca,_n.forEachRight=sa,_n.forIn=function(e,t){return null==e?e:lr(e,Zo(t,3),xl)},_n.forInRight=function(e,t){return null==e?e:cr(e,Zo(t,3),xl)},_n.forOwn=function(e,t){return e&&sr(e,Zo(t,3))},_n.forOwnRight=function(e,t){return e&&ur(e,Zo(t,3))},_n.get=Al,_n.gt=Ta,_n.gte=Ma,_n.has=function(e,t){return null!=e&&ii(e,t,Ar)},_n.hasIn=ml,_n.head=ji,_n.identity=Gl,_n.includes=function(e,t,n,r){e=ja(e)?e:Sl(e),n=n&&!r?ol(n):0;var o=e.length;return n<0&&(n=ln(o+n,0)),Xa(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Et(e,t,n)>-1},_n.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:ol(n);return o<0&&(o=ln(r+o,0)),Et(e,t,o)},_n.inRange=function(e,t,n){return t=rl(t),void 0===n?(n=t,t=0):n=rl(n),function(e,t,n){return e>=cn(t,n)&&e=-9007199254740991&&e<=9007199254740991},_n.isSet=Ja,_n.isString=Xa,_n.isSymbol=Za,_n.isTypedArray=$a,_n.isUndefined=function(e){return void 0===e},_n.isWeakMap=function(e){return qa(e)&&oi(e)==x},_n.isWeakSet=function(e){return qa(e)&&"[object WeakSet]"==gr(e)},_n.join=function(e,t){return null==e?"":on.call(e,t)},_n.kebabCase=Pl,_n.last=Fi,_n.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ol(n))<0?ln(r+o,0):cn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):bt(e,wt,o,!0)},_n.lowerCase=Nl,_n.lowerFirst=jl,_n.lt=el,_n.lte=tl,_n.max=function(e){return e&&e.length?or(e,Gl,hr):void 0},_n.maxBy=function(e,t){return e&&e.length?or(e,Zo(t,2),hr):void 0},_n.mean=function(e){return Ct(e,Gl)},_n.meanBy=function(e,t){return Ct(e,Zo(t,2))},_n.min=function(e){return e&&e.length?or(e,Gl,kr):void 0},_n.minBy=function(e,t){return e&&e.length?or(e,Zo(t,2),kr):void 0},_n.stubArray=ic,_n.stubFalse=ac,_n.stubObject=function(){return{}},_n.stubString=function(){return""},_n.stubTrue=function(){return!0},_n.multiply=dc,_n.nth=function(e,t){return e&&e.length?Mr(e,ol(t)):void 0},_n.noConflict=function(){return Ge._===this&&(Ge._=Qe),this},_n.noop=Zl,_n.now=Aa,_n.pad=function(e,t,n){e=cl(e);var r=(t=ol(t))?Wt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Po(en(o),n)+e+Po($t(o),n)},_n.padEnd=function(e,t,n){e=cl(e);var r=(t=ol(t))?Wt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=fn();return cn(e+o*(t-e+Ue("1e-"+((o+"").length-1))),t)}return Dr(e,t)},_n.reduce=function(e,t,n){var r=Pa(e)?ht:kt,o=arguments.length<3;return r(e,Zo(t,4),n,o,tr)},_n.reduceRight=function(e,t,n){var r=Pa(e)?At:kt,o=arguments.length<3;return r(e,Zo(t,4),n,o,nr)},_n.repeat=function(e,t,n){return t=(n?si(e,t,n):void 0===t)?1:ol(t),zr(cl(e),t)},_n.replace=function(){var e=arguments,t=cl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},_n.result=function(e,t,n){var r=-1,o=(t=co(t,e)).length;for(o||(o=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=cn(e,4294967295);e-=4294967295;for(var o=_t(r,t=Zo(t));++n=i)return e;var l=n-Wt(r);if(l<1)return r;var c=a?uo(a,0,l).join(""):e.slice(0,l);if(void 0===o)return c+r;if(a&&(l+=c.length-l),Ka(o)){if(e.slice(l).search(o)){var s,u=c;for(o.global||(o=he(o.source,cl(re.exec(o))+"g")),o.lastIndex=0;s=o.exec(u);)var f=s.index;c=c.slice(0,void 0===f?l:f)}}else if(e.indexOf(Zr(o),l)!=l){var d=c.lastIndexOf(o);d>-1&&(c=c.slice(0,d))}return c+r},_n.unescape=function(e){return(e=cl(e))&&z.test(e)?e.replace(j,Kt):e},_n.uniqueId=function(e){var t=++Ce;return cl(e)+t},_n.upperCase=Ll,_n.upperFirst=Fl,_n.each=ca,_n.eachRight=sa,_n.first=ji,Xl(_n,(fc={},sr(_n,(function(e,t){we.call(_n.prototype,t)||(fc[t]=e)})),fc),{chain:!1}),_n.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){_n[e].placeholder=_n})),lt(["drop","take"],(function(e,t){On.prototype[e]=function(n){n=void 0===n?1:ln(ol(n),0);var r=this.__filtered__&&!t?new On(this):this.clone();return r.__filtered__?r.__takeCount__=cn(n,r.__takeCount__):r.__views__.push({size:cn(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),lt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Zo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),lt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}})),lt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}})),On.prototype.compact=function(){return this.filter(Gl)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Lr((function(e,t){return"function"==typeof e?new On(this):this.map((function(n){return vr(n,e,t)}))})),On.prototype.reject=function(e){return this.filter(Ba(Zo(e)))},On.prototype.slice=function(e,t){e=ol(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ol(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},sr(On.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=_n[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(_n.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,l=t instanceof On,c=a[0],s=l||Pa(t),u=function(e){var t=o.apply(_n,gt([e],a));return r&&f?t[0]:t};s&&n&&"function"==typeof c&&1!=c.length&&(l=s=!1);var f=this.__chain__,d=!!this.__actions__.length,p=i&&!f,g=l&&!d;if(!i&&s){t=g?t:new On(this);var h=e.apply(t,a);return h.__actions__.push({func:ra,args:[u],thisArg:void 0}),new Mn(h,f)}return p&&g?e.apply(this,a):(h=this.thru(u),p?r?h.value()[0]:h.value():h)})})),lt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);_n.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Pa(o)?o:[],e)}return this[n]((function(n){return t.apply(Pa(n)?n:[],e)}))}})),sr(On.prototype,(function(e,t){var n=_n[t];if(n){var r=n.name+"";we.call(bn,r)||(bn[r]=[]),bn[r].push({name:t,func:n})}})),bn[So(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=vo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vo(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},_n.prototype.plant=function(e){for(var t,n=this;n instanceof Tn;){var r=_i(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},_n.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:ra,args:[Yi],thisArg:void 0}),new Mn(t,this.__chain__)}return this.thru(Yi)},_n.prototype.toJSON=_n.prototype.valueOf=_n.prototype.value=function(){return ro(this.__wrapped__,this.__actions__)},_n.prototype.first=_n.prototype.head,Xe&&(_n.prototype[Xe]=function(){return this}),_n}();Ge._=Jt,void 0===(o=function(){return Jt}.call(t,n,t,r))||(r.exports=o)}).call(this)}).call(this,n(37),n(36)(e))},,,,,function(e,t,n){"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,c=a(e),s=1;s",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),f=["%","/","?",";","#"].concat(u),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},A={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(72);function v(e,t,n){if(e&&o.isObject(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}i.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),l=-1!==i&&i127?O+="x":O+=M[P];if(!O.match(p)){var j=S.slice(0,k),D=S.slice(k+1),z=M.match(g);z&&(j.push(z[1]),D.unshift(z[2])),D.length&&(v="/"+D.join(".")+v),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),_||(this.hostname=r.toASCII(this.hostname));var L=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+L,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!h[x])for(k=0,T=u.length;k0)&&n.host.split("@"))&&(n.auth=_.shift(),n.host=n.hostname=_.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var B=w.slice(-1)[0],I=(n.host||e.host||w.length>1)&&("."===B||".."===B)||""===B,k=0,Q=w.length;Q>=0;Q--)"."===(B=w[Q])?w.splice(Q,1):".."===B?(w.splice(Q,1),k++):k&&(w.splice(Q,1),k--);if(!E&&!x)for(;k--;k)w.unshift("..");!E||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),I&&"/"!==w.join("/").substr(-1)&&w.push("");var _,S=""===w[0]||w[0]&&"/"===w[0].charAt(0);C&&(n.hostname=n.host=S?"":w.length?w.shift():"",(_=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=_.shift(),n.host=n.hostname=_.shift()));return(E=E||n.host&&w.length)&&!S&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";e.exports=n(83)},,,,,,,,,,,,,,function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(2),o=n(85);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:function(e){const t=document.querySelector("head"),n=document.querySelector("#custom-style"),r=window._lastElementInsertedByStyleLoader;r?r.nextSibling?t.insertBefore(e,r.nextSibling):t.appendChild(e):t.insertBefore(e,n),window._lastElementInsertedByStyleLoader=e},singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t,n){var r=n(2),o=n(96);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.i,o,""]]);var i={insert:function(e){const t=document.querySelector("head"),n=document.querySelector("#custom-style"),r=window._lastElementInsertedByStyleLoader;r?r.nextSibling?t.insertBefore(e,r.nextSibling):t.appendChild(e):t.insertBefore(e,n),window._lastElementInsertedByStyleLoader=e},singleton:!1};r(o,i);e.exports=o.locals||{}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(e,t){for(var n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var n="undefined"!=typeof Element,r="function"==typeof Map,o="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;e.exports=function(e,t){try{return function e(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var l,c,s,u;if(Array.isArray(t)){if((l=t.length)!=a.length)return!1;for(c=l;0!=c--;)if(!e(t[c],a[c]))return!1;return!0}if(r&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(u=t.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=t.entries();!(c=u.next()).done;)if(!e(c.value[1],a.get(c.value[0])))return!1;return!0}if(o&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(u=t.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((l=t.length)!=a.length)return!1;for(c=l;0!=c--;)if(t[c]!==a[c])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((l=(s=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(c=l;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,s[c]))return!1;if(n&&t instanceof Element)return!1;for(c=l;0!=c--;)if(("_owner"!==s[c]&&"__v"!==s[c]&&"__o"!==s[c]||!t.$$typeof)&&!e(t[s[c]],a[s[c]]))return!1;return!0}return t!=t&&a!=a}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},function(e,t,n){e.exports=n(99)()},,,,,,function(e,t,n){"use strict"; +/** @license React v16.14.0 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=n(19),o="function"==typeof Symbol&&Symbol.for,i=o?Symbol.for("react.element"):60103,a=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,c=o?Symbol.for("react.strict_mode"):60108,s=o?Symbol.for("react.profiler"):60114,u=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113,g=o?Symbol.for("react.memo"):60115,h=o?Symbol.for("react.lazy"):60116,A="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nS.length&&S.push(e)}function O(e,t,n){return null==e?0:function e(t,n,r,o){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var c=!1;if(null===t)c=!0;else switch(l){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case i:case a:c=!0}}if(c)return r(o,t,""===n?"."+P(t,0):n),1;if(c=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s