diff --git a/.github/workflows/capture.yml b/.github/workflows/capture.yml index 20cf8d3..2207747 100644 --- a/.github/workflows/capture.yml +++ b/.github/workflows/capture.yml @@ -10,16 +10,29 @@ on: type: choice options: - '0.5' + - '0.75' - '1' + - '1.25' - '1.5' - - '3' + - '2' + num_workers: + description: Number of Chromium workers to run in parallel + required: false + default: '8' + type: choice + options: + - '1' + - '2' + - '4' + - '6' + - '8' permissions: contents: write jobs: screenshot: - runs-on: ubuntu-latest + runs-on: blacksmith-8vcpu-ubuntu-2404 steps: - name: Checkout uses: actions/checkout@v6 @@ -47,201 +60,19 @@ jobs: - name: Start server and take screenshots env: SCREENSHOT_ZOOM_LEVEL: ${{ inputs.zoom_level || '1' }} + SCREENSHOT_NUM_WORKERS: ${{ inputs.num_workers || '4' }} + SCREENSHOT_OUT_DIR: ${{ github.workspace }}/.screenshots run: | - # Start static server in background - bunx --bun serve . -p 1313 > /dev/null 2>&1 & - SERVER_PID=$! - - # Wait for server to be ready - echo "Waiting for server to start..." - for i in {1..30}; do - if curl -s http://localhost:1313/ > /dev/null 2>&1; then - echo "Server is ready!" - break - fi - sleep 1 - done - - # Create screenshot directories and capture slides - node << 'EOF' - const { chromium } = require('playwright'); - const fs = require('fs'); - const path = require('path'); - const zoomLevel = Number(process.env.SCREENSHOT_ZOOM_LEVEL || '1'); - - if (!Number.isFinite(zoomLevel) || zoomLevel <= 0) { - throw new Error(`Invalid SCREENSHOT_ZOOM_LEVEL: ${process.env.SCREENSHOT_ZOOM_LEVEL}`); - } - - // URLs to capture: [url, folderName] or [url, folderName, waitTimeMs] - // Optional waitTimeMs: wait after load before screenshot (for animated slides) - // Main slides 1-17, plus basement slides at 8 and 16 - const urls = [ - ['/', 'slide-01'], - ['/#/2', 'slide-02'], - ['/#/3', 'slide-03'], - ['/#/4', 'slide-04'], - // ['/#/5', 'slide-05'], - // ['/#/6', 'slide-06'], - // ['/#/7', 'slide-07'], - ['/#/8', 'slide-08-01'], - ['/#/8/2', 'slide-08-02'], - // ['/#/9', 'slide-09'], - ['/#/10', 'slide-10'], - ['/#/11', 'slide-11'], - ['/#/12', 'slide-12'], - // ['/#/13', 'slide-13'], - // ['/#/14', 'slide-14'], - // ['/#/15', 'slide-15'], - ['/#/16', 'slide-16-01'], - ['/#/16/2', 'slide-16-02'], - ['/#/16/3', 'slide-16-03'], - // ['/#/17', 'slide-17'], - ]; - - // Define resolutions: [width, height, label] - const resolutions = [ - // Mobile - [375, 667, 'iphone-se'], - [390, 844, 'iphone-12-13'], - [430, 932, 'iphone-14-15-16-17-pro-max'], - // Mobile Landscape - [667, 375, 'iphone-se-landscape'], - [844, 390, 'iphone-12-13-landscape'], - [932, 430, 'iphone-14-15-16-17-pro-max-landscape'], - // Tablet - [768, 1024, 'ipad-portrait'], - [1024, 768, 'ipad-landscape'], - // Desktop - [1280, 720, 'desktop-1280x720'], - [1366, 768, 'desktop-1366x768'], - [1440, 900, 'desktop-1440x900'], - [1920, 1080, 'desktop-1920x1080'], - [2560, 1440, 'desktop-2560x1440'], - ]; - - async function takeScreenshots(url, folder, waitTime = 0) { - const browser = await chromium.launch(); - const screenshots = []; - const fullUrl = `http://localhost:1313${url}`; - - if (waitTime > 0) { - // Load once, wait for animation, then resize for each resolution - console.log(`Loading ${url} at ${zoomLevel}x zoom and waiting ${waitTime}ms for animation...`); - const page = await browser.newPage(); - const [firstWidth, firstHeight, firstLabel] = resolutions[0]; - await page.setViewportSize({ width: firstWidth, height: firstHeight }); - await page.goto(fullUrl, { waitUntil: 'networkidle' }); - await page.waitForTimeout(500); - await page.evaluate((zoom) => { - document.documentElement.style.zoom = String(zoom); - }, zoomLevel); - await page.waitForTimeout(100); - await page.waitForTimeout(waitTime); - - // Now take screenshots at all resolutions by resizing - for (const [width, height, label] of resolutions) { - console.log(`Taking ${width}x${height} (${label}) for ${url} at ${zoomLevel}x zoom`); - await page.setViewportSize({ width, height }); - await page.evaluate((zoom) => { - document.documentElement.style.zoom = String(zoom); - }, zoomLevel); - // Small delay to let layout adjust after resize - await page.waitForTimeout(100); - - const filename = `${width}x${height}-${label}.png`; - const filepath = path.join(folder, filename); - await page.screenshot({ path: filepath, fullPage: false }); - screenshots.push({ filename, width, height, label }); - } - - await page.close(); - } else { - // Reload for each resolution - for (const [width, height, label] of resolutions) { - console.log(`Taking ${width}x${height} (${label}) for ${url} at ${zoomLevel}x zoom`); - const page = await browser.newPage(); - await page.setViewportSize({ width, height }); - await page.goto(fullUrl, { waitUntil: 'networkidle' }); - await page.waitForTimeout(500); - await page.evaluate((zoom) => { - document.documentElement.style.zoom = String(zoom); - }, zoomLevel); - await page.waitForTimeout(100); - - const filename = `${width}x${height}-${label}.png`; - const filepath = path.join(folder, filename); - await page.screenshot({ path: filepath, fullPage: false }); - await page.close(); - - screenshots.push({ filename, width, height, label }); - } - } - - await browser.close(); - return screenshots; - } - - function getFolderTitle(folderName) { - return folderName - .split('-') - .map(word => word.charAt(0).toUpperCase() + word.slice(1)) - .join(' '); - } - - async function generateReadme(folder, screenshots) { - const timestamp = new Date().toISOString().replace(/:/g, '-').split('.')[0] + 'Z'; - const readmePath = path.join(folder, 'README.md'); - - let content = `# ${getFolderTitle(folder)}\n\n`; - content += `Generated: ${new Date().toISOString()}\n\n`; - content += `| Resolution | Device | Screenshot |\n`; - content += `|------------|--------|------------|\n`; - - for (const { filename, width, height, label } of screenshots) { - content += `| ${width} × ${height} | ${label} | ![${label}](${filename}?${timestamp}) |\n`; - } - - fs.writeFileSync(readmePath, content); - } - - (async () => { - try { - const allFolders = []; - console.log(`Using screenshot zoom level: ${zoomLevel}x`); - - for (const entry of urls) { - const [url, folderName, waitTime = 0] = entry; - fs.mkdirSync(folderName, { recursive: true }); - allFolders.push(folderName); - - const waitMsg = waitTime > 0 ? ` (wait ${waitTime}ms)` : ''; - console.log(`=== Capturing ${folderName} for ${url}${waitMsg} ===`); - const screenshots = await takeScreenshots(url, folderName, waitTime); - await generateReadme(folderName, screenshots); - console.log(`Captured ${screenshots.length} screenshots for ${folderName}`); - } - - console.log('All screenshots saved successfully'); - fs.writeFileSync('_screenshot_folders.json', JSON.stringify(allFolders)); - } catch (error) { - console.error('Error taking screenshots:', error); - process.exit(1); - } - })(); - EOF - - # Stop server - kill $SERVER_PID 2>/dev/null || true + ./scripts/capture-screenshots.sh - name: Create orphan branch and commit screenshots run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - FOLDERS=$(node -e "console.log(require('./_screenshot_folders.json').join(' '))") - rm _screenshot_folders.json - mv $FOLDERS /tmp/ + FOLDERS=$(bun -e "console.log(JSON.parse(require('fs').readFileSync('.screenshots/_screenshot_folders.json', 'utf8')).join(' '))") + rm .screenshots/_screenshot_folders.json + mv .screenshots/slide-* /tmp/ git checkout main || git checkout master || true git branch -D screenshots 2>/dev/null || true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ccc4619 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.screenshots/ +node_modules +bun.lock +package.json +*.cjs \ No newline at end of file diff --git a/README.md b/README.md index ef50717..784f4f9 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ Reveal.js runtime assets are vendored in-repo for offline use. - `index.html`: Reveal.js bootstrap, markdown loading, and custom slide behavior. - `custom.css`: presentation theme and layout styling. - `vendor/reveal.js/`: local Reveal.js CSS/JS/plugin assets used by `index.html`. +- `vendor/katex/`: slim local KaTeX runtime used for offline math rendering. +- `scripts/vendor-katex.sh`: idempotent vendoring script for the KaTeX runtime subset. +- `scripts/capture-screenshots.sh`: local multi-resolution screenshot capture for visual validation. ## Run In Dev @@ -20,17 +23,60 @@ bunx --bun serve . -p 1313 Then open the local URL printed by `serve` in your browser. -## Refresh Vendored Reveal Assets +## Capture Screenshots Locally + +To validate typography/layout changes across the same resolution set used in CI: ```bash -mkdir -p vendor/reveal.js/dist/theme vendor/reveal.js/plugin/markdown vendor/reveal.js/plugin/highlight -wget -q -O vendor/reveal.js/dist/reveal.css https://cdn.jsdelivr.net/npm/reveal.js@5/dist/reveal.css -wget -q -O vendor/reveal.js/dist/theme/black.css https://cdn.jsdelivr.net/npm/reveal.js@5/dist/theme/black.css -wget -q -O vendor/reveal.js/dist/reveal.js https://cdn.jsdelivr.net/npm/reveal.js@5/dist/reveal.js -wget -q -O vendor/reveal.js/plugin/markdown/markdown.js https://cdn.jsdelivr.net/npm/reveal.js@5/plugin/markdown/markdown.js -wget -q -O vendor/reveal.js/plugin/highlight/highlight.js https://cdn.jsdelivr.net/npm/reveal.js@5/plugin/highlight/highlight.js +SCREENSHOT_ZOOM_LEVEL=1 ./scripts/capture-screenshots.sh +``` + +This writes slide image folders plus `_screenshot_folders.json` into `.screenshots/` by default. +The script aligns with CI by ensuring the `playwright` package is installed locally before capture, then installing Chromium. +Override `SCREENSHOT_OUT_DIR` to capture elsewhere, and `SCREENSHOT_PORT` if `1313` is already in use. + +## Authoring Math + +Display math can be written using fenced `math` blocks in `present.md`: + +````md +```math +\int_0^\infty e^{-x^2} \, dx = \frac{\sqrt{\pi}}{2} ``` +```` + +`index.html` rewrites these fences to KaTeX display-math delimiters before Reveal parses the deck, so slide authoring stays markdown-native while rendering still uses Reveal's math plugin. + +Inline math also works with standard KaTeX delimiters such as `$x^2$`, `\(...\)`, and `\[...\]`. + +## Refresh Vendored Assets + +```bash +mkdir -p vendor/reveal.js/dist/theme vendor/reveal.js/plugin/markdown vendor/reveal.js/plugin/highlight vendor/reveal.js/plugin/math +curl -fsSL https://cdn.jsdelivr.net/npm/reveal.js@5.2.1/dist/reveal.css -o vendor/reveal.js/dist/reveal.css +curl -fsSL https://cdn.jsdelivr.net/npm/reveal.js@5.2.1/dist/theme/black.css -o vendor/reveal.js/dist/theme/black.css +curl -fsSL https://cdn.jsdelivr.net/npm/reveal.js@5.2.1/dist/reveal.js -o vendor/reveal.js/dist/reveal.js +curl -fsSL https://cdn.jsdelivr.net/npm/reveal.js@5.2.1/plugin/markdown/markdown.js -o vendor/reveal.js/plugin/markdown/markdown.js +curl -fsSL https://cdn.jsdelivr.net/npm/reveal.js@5.2.1/plugin/highlight/highlight.js -o vendor/reveal.js/plugin/highlight/highlight.js +curl -fsSL https://cdn.jsdelivr.net/npm/reveal.js@5.2.1/plugin/math/math.js -o vendor/reveal.js/plugin/math/math.js +./scripts/vendor-katex.sh +``` + +The KaTeX script vendors only the runtime files Reveal needs: + +- `dist/katex.min.js` +- `dist/katex.min.css` +- `dist/contrib/auto-render.min.js` +- `dist/fonts/*.woff2` +- `dist/fonts/*.woff` +- `LICENSE` + +Set `KATEX_VERSION` to override the pinned default when refreshing, for example: + +```bash +KATEX_VERSION=0.16.37 ./scripts/vendor-katex.sh +``` + +## Footer Text -# Footer Text -Line 294 of `index.html` can be edited to change the footer text from `present.md` to anything else. -It is there that the styling of the pagination is also handled. +Edit the `counter.textContent = \`${current} / ${total} | present.md\`;` line in `index.html` to change the footer text from `present.md` to something else. diff --git a/custom.css b/custom.css index a0ca74b..4faead9 100644 --- a/custom.css +++ b/custom.css @@ -3,7 +3,26 @@ --fg: #d8dee9; --muted: #8f98ab; --line: #5f6b84; - --slide-font-size: clamp(14px, 0.85vw + 0.65vh, 18px); + --slide-font-size: clamp(14px, calc(11px + 0.28vw + 0.22vh), 20px); + --content-heading-size: clamp(24px, calc(18px + 0.34vw + 0.24vh), 34px); + --content-body-size: clamp(20px, calc(16px + 0.24vw + 0.16vh), 28px); + --content-table-size: clamp(18px, calc(15px + 0.22vw + 0.14vh), 26px); + --content-table-only-size: clamp(21px, calc(16px + 0.3vw + 0.2vh), 30px); + --content-table-fit-scale: 1; + --slide-content-fit-scale: 1; + --table-border-width: 1px; + --content-code-size: clamp(16px, calc(13px + 0.2vw + 0.12vh), 22px); + --content-math-size: clamp(26px, calc(20px + 0.38vw + 0.28vh), 38px); + --standalone-table-slide-width: clamp(42rem, 62vw, 110rem); + --chrome-header-size: 13px; + --chrome-header-margin-y: 8px; + --chrome-header-margin-x: 8px; + --chrome-header-pad-y: 4px; + --chrome-header-pad-x: 7px; + --chrome-border-width: 1px; + --chrome-counter-size: 13px; + --chrome-counter-left: 14px; + --chrome-counter-bottom: 10px; --slide-pad-top-base: 5.2rem; --slide-pad-bottom-base: 3rem; --deck-header-offset: var(--slide-pad-top-base); @@ -13,6 +32,10 @@ --slide-pad-left: clamp(1rem, 3.4vw, 4rem); --slide-pad-right: clamp(0.75rem, 2.2vw, 1.25rem); --walkthrough-code-height: min(66vh, calc(100vh - 12.5rem)); + --content-pre-margin-top: 2px; + --content-pre-margin-bottom: 14px; + --math-display-margin-top: 4px; + --math-display-margin-bottom: 14px; } html, @@ -84,10 +107,17 @@ body { margin-top: 0 !important; } -.reveal .slides section > :not(table):not(figure):not(pre):not(section) { +.reveal .slides section > :not(table):not(figure):not(pre):not(section):not(ul):not(ol):not(dl) { margin-left: 0 !important; margin-right: 0 !important; - max-width: min(72ch, 100%) !important; + max-width: min(96ch, 100%) !important; + text-align: left !important; +} + +.reveal .slides section > :is(ul, ol, dl) { + margin-left: 0 !important; + margin-right: 0 !important; + max-width: 100% !important; text-align: left !important; } @@ -116,7 +146,7 @@ body { .reveal .slides section h5, .reveal .slides section h6 { font-family: "JetBrains Mono", "Fira Code", monospace; - font-size: 1em; + font-size: calc(var(--content-heading-size) * var(--slide-content-fit-scale)); font-weight: 500; letter-spacing: 0; line-height: 1.25; @@ -128,10 +158,23 @@ body { .reveal .slides section li, .reveal .slides section th, .reveal .slides section td { - font-size: 0.9em; + font-size: calc(var(--content-body-size) * var(--slide-content-fit-scale)); line-height: 1.34; } +.reveal .slides section table:not(.hljs-ln) th, +.reveal .slides section table:not(.hljs-ln) td { + font-size: calc(var(--content-table-size) * var(--content-table-fit-scale) * var(--slide-content-fit-scale)); + line-height: 1.22; +} + +.reveal .slides section.standalone-table-slide > table:not(.hljs-ln) th, +.reveal .slides section.standalone-table-slide > table:not(.hljs-ln) td, +.reveal .slides section.standalone-table-slide > figure > table:not(.hljs-ln) th, +.reveal .slides section.standalone-table-slide > figure > table:not(.hljs-ln) td { + font-size: calc(var(--content-table-only-size) * var(--slide-content-fit-scale)); +} + .reveal .slides section ul, .reveal .slides section ol, .reveal .slides section dl { @@ -140,6 +183,13 @@ body { padding-left: 0; } +.reveal .slides section li > ul, +.reveal .slides section li > ol, +.reveal .slides section li > dl { + margin: 0.15em 0 !important; + padding-left: 1.6em; +} + .reveal .slides section ul { list-style: none; } @@ -159,6 +209,7 @@ body { } .reveal .slides section li { + margin: 0.15em 0 !important; margin-left: 0 !important; padding-left: 0 !important; } @@ -184,7 +235,7 @@ body { .reveal .slides section table:not(.hljs-ln) { margin: 0.5em auto 0.8em auto !important; width: auto; - border: 1px solid rgba(95, 107, 132, 0.45); + border: calc(var(--table-border-width) * var(--content-table-fit-scale)) solid rgba(95, 107, 132, 0.45); border-collapse: collapse; } @@ -218,8 +269,8 @@ body { } /* Override Reveal's display:block on .present; use grid for reliable centering */ -.reveal .slides section.table-only-slide, -.reveal .slides section.table-only-slide.present { +.reveal .slides section.standalone-table-slide, +.reveal .slides section.standalone-table-slide.present { display: grid !important; place-items: center; place-content: center; @@ -231,27 +282,32 @@ body { overflow: visible; } -.reveal .slides section.table-only-slide > table:not(.hljs-ln), -.reveal .slides section.table-only-slide > figure { +.reveal .slides section.standalone-table-slide > table:not(.hljs-ln), +.reveal .slides section.standalone-table-slide > figure { margin: 0 !important; transform: none !important; - max-width: min(80ch, 100%); + width: min(100%, var(--standalone-table-slide-width)); + max-width: min(100%, var(--standalone-table-slide-width)); justify-self: center; align-self: center; } -.reveal .slides section.table-only-slide > figure > table:not(.hljs-ln) { +.reveal .slides section.standalone-table-slide > figure > table:not(.hljs-ln) { margin: 0 !important; + width: 100%; } .reveal .slides section table:not(.hljs-ln) th, .reveal .slides section table:not(.hljs-ln) td { - border: 1px solid rgba(95, 107, 132, 0.45); + border: calc(var(--table-border-width) * var(--content-table-fit-scale)) solid rgba(95, 107, 132, 0.45); padding: 0.18em 0.45em; + overflow-wrap: break-word; + word-break: normal; + hyphens: manual; } .reveal .slides section table:not(.hljs-ln) tbody tr:last-child td { - border-bottom: 1px solid rgba(95, 107, 132, 0.45) !important; + border-bottom: calc(var(--table-border-width) * var(--content-table-fit-scale)) solid rgba(95, 107, 132, 0.45) !important; } .reveal .slides section.code-walkthrough pre { @@ -272,14 +328,12 @@ body { scrollbar-gutter: stable both-edges; scrollbar-width: thin; scrollbar-color: rgba(143, 152, 171, 0.55) rgba(6, 8, 12, 0.35); - font-size: 0.98em; + font-size: var(--content-code-size); line-height: 1.34; } @media (max-width: 768px) { :root { - --slide-pad-top-base: 3.2rem; - --slide-pad-bottom-base: 2.5rem; --slide-pad-left: 1rem; --slide-pad-right: 1rem; --walkthrough-code-height: min(56vh, calc(100vh - 8.5rem)); @@ -287,8 +341,8 @@ body { .reveal .slides section > table:not(.hljs-ln), .reveal .slides section > figure, - .reveal .slides section.table-only-slide > table:not(.hljs-ln), - .reveal .slides section.table-only-slide > figure { + .reveal .slides section.standalone-table-slide > table:not(.hljs-ln), + .reveal .slides section.standalone-table-slide > figure { transform: none !important; } @@ -298,6 +352,13 @@ body { .reveal .slides section td { overflow-wrap: anywhere; } + + .reveal .slides section table:not(.hljs-ln) th, + .reveal .slides section table:not(.hljs-ln) td { + overflow-wrap: break-word; + word-break: normal; + padding: 0.12em 0.28em; + } } .reveal .slides section.code-walkthrough pre code::-webkit-scrollbar { @@ -347,7 +408,7 @@ body { .reveal table.hljs-ln td { padding: 0 !important; - font-size: 0.98em !important; + font-size: calc(var(--content-code-size) * var(--slide-content-fit-scale)) !important; line-height: 1.34 !important; } @@ -369,7 +430,10 @@ body { } .reveal pre { - margin: 0.15em 0 0.7em !important; + margin: + calc(var(--content-pre-margin-top) * var(--slide-content-fit-scale)) + 0 + calc(var(--content-pre-margin-bottom) * var(--slide-content-fit-scale)) !important; margin-left: 0 !important; margin-right: auto !important; display: block; @@ -380,26 +444,41 @@ body { box-shadow: none; } -.reveal pre.raw-fence::before { - content: "```" attr(data-lang); +.reveal pre:has(+ .katex-display), +.reveal pre:has(+ p .katex-display), +.reveal pre:has(+ p > .katex-display) { + margin-bottom: calc(4px * var(--slide-content-fit-scale)) !important; +} + +.reveal pre.raw-fence::before, +.reveal pre.raw-fence::after { display: block; - margin-bottom: 0.12em; color: var(--muted); - font-size: 0.98em; + font-family: inherit; + font-size: calc(var(--content-code-size) * var(--slide-content-fit-scale)); + font-weight: inherit; letter-spacing: 0.01em; + line-height: 1.34; +} + +.reveal pre.raw-fence::before { + content: "```" attr(data-lang); + margin-bottom: 0.24em; } .reveal pre.raw-fence::after { content: "```"; - display: block; - margin-top: 0.06em; - color: var(--muted); - font-size: 0.98em; - letter-spacing: 0.01em; + margin-top: 0.24em; +} + +.reveal pre.raw-fence:has(+ .katex-display)::after, +.reveal pre.raw-fence:has(+ p .katex-display)::after, +.reveal pre.raw-fence:has(+ p > .katex-display)::after { + margin-top: 0.08em; } .reveal pre code { - font-size: 0.98em; + font-size: calc(var(--content-code-size) * var(--slide-content-fit-scale)); line-height: 1.34; padding: 0; text-align: left; @@ -475,6 +554,45 @@ body { color: #c7a8ff; } +.reveal .katex { + color: var(--fg); +} + +.reveal .katex-display { + font-size: 1em; + margin: + calc(var(--math-display-margin-top) * var(--slide-content-fit-scale)) + 0 + calc(var(--math-display-margin-bottom) * var(--slide-content-fit-scale)) !important; + overflow-x: auto; + overflow-y: hidden; +} + +.reveal pre + .katex-display { + margin-top: calc(0px * var(--slide-content-fit-scale)) !important; +} + +.reveal pre + p:has(.katex-display), +.reveal pre + p:has(> .katex-display) { + margin-top: 0 !important; + margin-bottom: calc(2px * var(--slide-content-fit-scale)) !important; +} + +.reveal pre + p .katex-display, +.reveal pre + p > .katex-display { + margin-top: 0 !important; +} + +.reveal .katex-display > .katex { + font-size: calc(var(--content-math-size) * var(--slide-content-fit-scale)) !important; + text-align: left; +} + +.reveal .katex-display > .base { + margin-left: 0; + margin-right: auto; +} + #deck-header { position: fixed; top: 0; @@ -486,7 +604,7 @@ body { padding: 0; color: var(--fg); font-family: "JetBrains Mono", "Fira Code", "IBM Plex Mono", monospace; - font-size: clamp(0.72rem, 0.6rem + 0.35vw, 0.9rem); + font-size: var(--chrome-header-size); font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; @@ -496,11 +614,11 @@ body { #deck-header-text { display: block; - margin: clamp(0.35rem, 0.3rem + 0.25vw, 0.55rem) clamp(0.35rem, 0.3rem + 0.25vw, 0.55rem) 0; - padding: clamp(0.24rem, 0.2rem + 0.15vw, 0.34rem) clamp(0.42rem, 0.35rem + 0.2vw, 0.58rem); - border: 1px solid var(--line); + margin: var(--chrome-header-margin-y) var(--chrome-header-margin-x) 0; + padding: var(--chrome-header-pad-y) var(--chrome-header-pad-x); + border: var(--chrome-border-width) solid var(--line); background: rgba(12, 15, 20, 0.92); - box-shadow: 0 0 0 1px rgba(95, 107, 132, 0.2) inset; + box-shadow: 0 0 0 var(--chrome-border-width) rgba(95, 107, 132, 0.2) inset; box-sizing: border-box; overflow: hidden; overflow-wrap: anywhere; @@ -509,14 +627,14 @@ body { #deck-counter { position: fixed; - left: clamp(0.75rem, 0.45rem + 0.8vw, 1.1rem); - bottom: clamp(0.55rem, 0.35rem + 0.8vw, 0.8rem); + left: var(--chrome-counter-left); + bottom: var(--chrome-counter-bottom); z-index: 40; color: var(--muted); font-family: "JetBrains Mono", "Fira Code", monospace; - font-size: clamp(0.76rem, 0.68rem + 0.25vw, 0.9rem); + font-size: var(--chrome-counter-size); letter-spacing: 0.02em; - max-width: calc(100vw - 1.5rem); + max-width: calc(100vw - (var(--chrome-counter-left) * 2)); overflow-wrap: anywhere; pointer-events: none; } diff --git a/index.html b/index.html index 70db392..18b3486 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,8 @@
@@ -29,287 +30,664 @@ + diff --git a/makefile b/makefile new file mode 100644 index 0000000..b583296 --- /dev/null +++ b/makefile @@ -0,0 +1,8 @@ +clean: + rm bun.lock package.json + rm -rf node_modules/ + rm -rf .screenshots/ + +test: + SCREENSHOT_NUM_WORKERS=6 SCREENSHOT_ZOOM_LEVEL=1 ./scripts/capture-screenshots.sh + diff --git a/present.md b/present.md index 8cc288d..7c42129 100644 --- a/present.md +++ b/present.md @@ -21,6 +21,7 @@ Key objective: reduce coordination overhead while increasing release confidence. --- + ## Centered Data Table | User Type | Primary Need | Success Signal | | --- | --- | --- | @@ -116,7 +117,7 @@ def summarize(payload: dict[str, Any]) -> ValidationResult: --- -## TypeScript Code Block (Short Snippet) +## TypeScript Code Block (Short Snippet) & Math ```ts type Status = "planned" | "in_progress" | "blocked" | "done"; @@ -132,6 +133,13 @@ export function badgeColor(status: Status): string { } ``` +```math +E = mc^2 +``` + +```math +\int_0^\infty e^{-x^2} \, \ dx = \frac{\sqrt{\pi}}{2} +``` --- @@ -651,7 +659,7 @@ fn format_summary(team: &str, score: f32) -> String { --- - + ## Standalone Table (Centered) with Basement Slides | Risk | Impact | Mitigation | | --- | --- | --- | @@ -668,7 +676,8 @@ fn format_summary(team: &str, score: f32) -> String { - Containment: - freeze net-new scope for one cycle - split critical/non-critical paths - - add checkpoint at 50% completion + - add checkpoint at 50% completion + - review risk/mitigation plan at 50% completion -- diff --git a/scripts/capture-screenshots.sh b/scripts/capture-screenshots.sh new file mode 100755 index 0000000..a5fa2e3 --- /dev/null +++ b/scripts/capture-screenshots.sh @@ -0,0 +1,297 @@ +#!/usr/bin/env bash + +set -euo pipefail + +RUN_STARTED_AT=$SECONDS + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PORT="${SCREENSHOT_PORT:-1313}" +ZOOM_LEVEL="${SCREENSHOT_ZOOM_LEVEL:-1}" +NUM_WORKERS="${SCREENSHOT_NUM_WORKERS:-${NUM_WORKERS:-1}}" +HOST="${SCREENSHOT_HOST:-127.0.0.1}" +OUT_DIR="${SCREENSHOT_OUT_DIR:-$ROOT_DIR/.screenshots}" +WAIT_TIMEOUT_SECS="${SCREENSHOT_SERVER_WAIT_SECS:-30}" +SERVER_LOG="$(mktemp)" +CAPTURE_JS="$(mktemp "$ROOT_DIR/.capture-screenshots.XXXXXX.cjs")" +CAPTURE_PID="" +SERVER_PID="" +IN_CLEANUP=0 + +require_command() { + if ! command -v "$1" >/dev/null 2>&1; then + printf 'Missing required command: %s\n' "$1" >&2 + exit 1 + fi +} + +format_elapsed_time() { + local total_seconds=$1 + local hours=$((total_seconds / 3600)) + local minutes=$(((total_seconds % 3600) / 60)) + local seconds=$((total_seconds % 60)) + printf '%02dh:%02dm:%02ds' "$hours" "$minutes" "$seconds" +} + +cleanup() { + if [[ "$IN_CLEANUP" -eq 1 ]]; then + return + fi + IN_CLEANUP=1 + + if [[ -n "${CAPTURE_PID:-}" ]]; then + kill "$CAPTURE_PID" 2>/dev/null || true + wait "$CAPTURE_PID" 2>/dev/null || true + fi + if [[ -n "${SERVER_PID:-}" ]]; then + kill "$SERVER_PID" 2>/dev/null || true + wait "$SERVER_PID" 2>/dev/null || true + fi + rm -f "$SERVER_LOG" + rm -f "$CAPTURE_JS" +} + +trap 'cleanup' EXIT INT TERM + +require_command curl +require_command bun +require_command bunx +require_command node + +mkdir -p "$OUT_DIR" + +printf 'Ensuring Playwright package is installed...\n' +bun add -d playwright >/dev/null + +printf 'Ensuring Playwright Chromium is installed...\n' +bunx playwright install chromium >/dev/null + +printf 'Starting local server on http://%s:%s ...\n' "$HOST" "$PORT" +bunx --bun serve "$ROOT_DIR" -p "$PORT" >"$SERVER_LOG" 2>&1 & +SERVER_PID=$! + +printf 'Waiting for server to be ready...\n' +for ((i = 0; i < WAIT_TIMEOUT_SECS; i += 1)); do + if curl -fsS "http://${HOST}:${PORT}/" >/dev/null 2>&1; then + printf 'Server is ready.\n' + break + fi + sleep 1 +done + +if ! curl -fsS "http://${HOST}:${PORT}/" >/dev/null 2>&1; then + printf 'Server did not become ready within %ss.\n' "$WAIT_TIMEOUT_SECS" >&2 + printf 'Server log:\n' >&2 + sed 's/^/ /' "$SERVER_LOG" >&2 + exit 1 +fi + +cat >"$CAPTURE_JS" <<'EOF' +const { chromium } = require('playwright'); +const fs = require('fs'); +const path = require('path'); + +const rootDir = process.env.ROOT_DIR; +const outDir = process.env.SCREENSHOT_OUT_DIR || rootDir; +const host = process.env.SCREENSHOT_HOST || '127.0.0.1'; +const port = Number(process.env.SCREENSHOT_PORT || '1313'); +const zoomLevel = Number(process.env.SCREENSHOT_ZOOM_LEVEL || '1'); +const requestedNumWorkers = Number(process.env.SCREENSHOT_NUM_WORKERS || process.env.NUM_WORKERS || '1'); + +if (!Number.isFinite(port) || port <= 0) { + throw new Error(`Invalid SCREENSHOT_PORT: ${process.env.SCREENSHOT_PORT}`); +} + +if (!Number.isFinite(zoomLevel) || zoomLevel <= 0) { + throw new Error(`Invalid SCREENSHOT_ZOOM_LEVEL: ${process.env.SCREENSHOT_ZOOM_LEVEL}`); +} + +if (!Number.isInteger(requestedNumWorkers) || requestedNumWorkers <= 0) { + throw new Error( + `Invalid SCREENSHOT_NUM_WORKERS/NUM_WORKERS: ${process.env.SCREENSHOT_NUM_WORKERS || process.env.NUM_WORKERS}` + ); +} + +// URLs to capture: [url, folderName] or [url, folderName, waitTimeMs] +// Optional waitTimeMs: wait after load before screenshot (for animated slides) +// Main slides 1-17, plus basement slides at 8 and 16 +const urls = [ + ['/', 'slide-01'], + ['/#/2', 'slide-02'], + ['/#/3', 'slide-03'], + ['/#/4', 'slide-04'], + // ['/#/5', 'slide-05'], + // ['/#/6', 'slide-06'], + // ['/#/7', 'slide-07'], + ['/#/8', 'slide-08-01'], + ['/#/8/2', 'slide-08-02'], + ['/#/9', 'slide-09'], + ['/#/10', 'slide-10'], + ['/#/11', 'slide-11'], + ['/#/12', 'slide-12'], + // ['/#/13', 'slide-13'], + // ['/#/14', 'slide-14'], + ['/#/15', 'slide-15'], + ['/#/16', 'slide-16-01'], + ['/#/16/2', 'slide-16-02'], + ['/#/16/3', 'slide-16-03'], + // ['/#/17', 'slide-17'], +]; + +const resolutions = [ + [375, 667, 'iphone-se'], + [390, 844, 'iphone-12-13'], + [430, 932, 'iphone-14-15-16-17-pro-max'], + [667, 375, 'iphone-se-landscape'], + [844, 390, 'iphone-12-13-landscape'], + [932, 430, 'iphone-14-15-16-17-pro-max-landscape'], + [768, 1024, 'ipad-portrait'], + [1024, 768, 'ipad-landscape'], + [1280, 720, 'desktop-1280x720'], + [1366, 768, 'desktop-1366x768'], + [1440, 900, 'desktop-1440x900'], + [1920, 1080, 'desktop-1920x1080'], + [2560, 1440, 'desktop-2560x1440'], +]; + +function getFolderTitle(folderName) { + return folderName + .split('-') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +} + +let shouldLogDebugSteps = true; + +function logDebugStep(message) { + if (shouldLogDebugSteps) { + console.log(message); + } +} + +async function generateReadme(folder, screenshots) { + const timestamp = new Date().toISOString().replace(/:/g, '-').split('.')[0] + 'Z'; + const readmePath = path.join(folder, 'README.md'); + + let content = `# ${getFolderTitle(path.basename(folder))}\n\n`; + content += `Generated: ${new Date().toISOString()}\n\n`; + content += `| Resolution | Device | Screenshot |\n`; + content += `|------------|--------|------------|\n`; + + for (const { filename, width, height, label } of screenshots) { + content += `| ${width} × ${height} | ${label} | ![${label}](${filename}?${timestamp}) |\n`; + } + + fs.writeFileSync(readmePath, content); +} + +async function takeScreenshots(url, folder) { + const fullUrl = `http://${host}:${port}${url}`; + const browser = await chromium.launch(); + const screenshots = []; + + try { + for (const [width, height, label] of resolutions) { + console.log(`Taking ${width}x${height} (${label}) for ${url} at ${zoomLevel}x zoom`); + logDebugStep(` -> open page for ${width}x${height}`); + const page = await browser.newPage(); + logDebugStep(` <- open page for ${width}x${height}`); + try { + logDebugStep(` -> set viewport ${width}x${height}`); + await page.setViewportSize({ width, height }); + logDebugStep(` <- set viewport ${width}x${height}`); + + logDebugStep(` -> goto ${url} at ${width}x${height}`); + await page.goto(fullUrl, { waitUntil: 'networkidle' }); + logDebugStep(` <- goto ${url} at ${width}x${height}`); + + logDebugStep(` -> settle before zoom ${width}x${height}`); + await page.waitForTimeout(500); + logDebugStep(` <- settle before zoom ${width}x${height}`); + + logDebugStep(` -> apply zoom ${width}x${height}`); + await page.evaluate((zoom) => { + document.documentElement.style.zoom = String(zoom); + }, zoomLevel); + logDebugStep(` <- apply zoom ${width}x${height}`); + + logDebugStep(` -> settle after zoom ${width}x${height}`); + await page.waitForTimeout(100); + logDebugStep(` <- settle after zoom ${width}x${height}`); + + const filename = `${width}x${height}-${label}.png`; + const filepath = path.join(folder, filename); + logDebugStep(` -> save screenshot ${filename}`); + await page.screenshot({ path: filepath, fullPage: false }); + logDebugStep(` <- save screenshot ${filename}`); + + screenshots.push({ filename, width, height, label }); + } finally { + logDebugStep(` -> close page ${width}x${height}`); + await page.close(); + logDebugStep(` <- close page ${width}x${height}`); + } + } + } finally { + logDebugStep(` -> close browser for ${url}`); + await browser.close(); + logDebugStep(` <- close browser for ${url}`); + } + + return screenshots; +} + +(async () => { + const allFolders = urls.map(([, folderName]) => folderName); + const numWorkers = Math.min(requestedNumWorkers, urls.length); + shouldLogDebugSteps = numWorkers <= 1; + let nextTaskIndex = 0; + + console.log(`Using screenshot zoom level: ${zoomLevel}x`); + console.log(`Using ${numWorkers} screenshot worker(s)`); + + async function runWorker(workerId) { + while (true) { + const taskIndex = nextTaskIndex; + nextTaskIndex += 1; + + if (taskIndex >= urls.length) { + return; + } + + const [url, folderName] = urls[taskIndex]; + const folder = path.join(outDir, folderName); + fs.mkdirSync(folder, { recursive: true }); + + console.log(`[worker ${workerId}] === Capturing ${folderName} for ${url} ===`); + const screenshots = await takeScreenshots(url, folder); + await generateReadme(folder, screenshots); + console.log(`[worker ${workerId}] Captured ${screenshots.length} screenshots for ${folderName}`); + } + } + + await Promise.all(Array.from({ length: numWorkers }, (_, index) => runWorker(index + 1))); + + fs.writeFileSync(path.join(outDir, '_screenshot_folders.json'), JSON.stringify(allFolders)); + console.log('All screenshots saved successfully'); +})().catch((error) => { + console.error('Error taking screenshots:', error); + process.exit(1); +}); +EOF + +ROOT_DIR="$ROOT_DIR" \ +SCREENSHOT_OUT_DIR="$OUT_DIR" \ +SCREENSHOT_PORT="$PORT" \ +SCREENSHOT_HOST="$HOST" \ +SCREENSHOT_ZOOM_LEVEL="$ZOOM_LEVEL" \ +SCREENSHOT_NUM_WORKERS="$NUM_WORKERS" \ +node "$CAPTURE_JS" & +CAPTURE_PID=$! +wait "$CAPTURE_PID" +CAPTURE_PID="" + +printf 'Generating local screenshot viewer...\n' +SCREENSHOT_OUT_DIR="$OUT_DIR" node "$ROOT_DIR/scripts/generate-screenshot-view.mjs" + +printf 'Screenshots complete. Output written under %s\n' "$OUT_DIR" +printf 'Total execution time: %s\n' "$(format_elapsed_time "$((SECONDS - RUN_STARTED_AT))")" diff --git a/scripts/generate-screenshot-view.mjs b/scripts/generate-screenshot-view.mjs new file mode 100644 index 0000000..eb07afc --- /dev/null +++ b/scripts/generate-screenshot-view.mjs @@ -0,0 +1,526 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const rootDir = path.resolve(__dirname, '..'); +const screenshotsDir = path.resolve(process.env.SCREENSHOT_OUT_DIR || path.join(rootDir, '.screenshots')); +const outputPath = path.join(screenshotsDir, 'view.html'); +const screenshotFoldersPath = path.join(screenshotsDir, '_screenshot_folders.json'); + +const preferredResolutionOrder = [ + '375x667-iphone-se', + '390x844-iphone-12-13', + '430x932-iphone-14-15-16-17-pro-max', + '667x375-iphone-se-landscape', + '844x390-iphone-12-13-landscape', + '932x430-iphone-14-15-16-17-pro-max-landscape', + '768x1024-ipad-portrait', + '1024x768-ipad-landscape', + '1280x720-desktop-1280x720', + '1366x768-desktop-1366x768', + '1440x900-desktop-1440x900', + '1920x1080-desktop-1920x1080', + '2560x1440-desktop-2560x1440', +]; + +function formatSlideTitle(slideName) { + return slideName + .split('-') + .map((part) => part.toUpperCase()) + .join(' '); +} + +function readSlideNames() { + if (fs.existsSync(screenshotFoldersPath)) { + const folders = JSON.parse(fs.readFileSync(screenshotFoldersPath, 'utf8')); + return folders.filter((folder) => fs.existsSync(path.join(screenshotsDir, folder))); + } + + return fs + .readdirSync(screenshotsDir, { withFileTypes: true }) + .filter((entry) => entry.isDirectory() && /^slide-\d+(?:-\d+)?$/.test(entry.name)) + .map((entry) => entry.name) + .sort((left, right) => left.localeCompare(right, undefined, { numeric: true })); +} + +function readResolutionRank(key) { + const preferredIndex = preferredResolutionOrder.indexOf(key); + return preferredIndex === -1 ? Number.MAX_SAFE_INTEGER : preferredIndex; +} + +function readResolutionLabel(filenameMatch) { + const [, width, height, label] = filenameMatch; + return label; +} + +function collectScreenshots() { + const slideNames = readSlideNames(); + const slideTitles = new Map(slideNames.map((slide) => [slide, formatSlideTitle(slide)])); + const resolutionMap = new Map(); + const screenshots = []; + + for (const slide of slideNames) { + const slideDir = path.join(screenshotsDir, slide); + if (!fs.existsSync(slideDir)) { + continue; + } + + const pngFiles = fs + .readdirSync(slideDir, { withFileTypes: true }) + .filter((entry) => entry.isFile() && entry.name.endsWith('.png')) + .map((entry) => entry.name) + .sort((left, right) => left.localeCompare(right, undefined, { numeric: true })); + + for (const filename of pngFiles) { + const match = filename.match(/^(\d+)x(\d+)-(.+)\.png$/); + if (!match) { + continue; + } + + const [, width, height, label] = match; + const key = `${width}x${height}-${label}`; + + if (!resolutionMap.has(key)) { + resolutionMap.set(key, { + key, + width: Number(width), + height: Number(height), + label, + title: readResolutionLabel(match), + }); + } + + screenshots.push({ + id: `${slide}:${key}`, + slide, + slideTitle: slideTitles.get(slide) || slide, + resolutionKey: key, + resolutionTitle: readResolutionLabel(match), + width: Number(width), + height: Number(height), + label, + relativePath: `./${slide}/${filename}`, + }); + } + } + + const resolutions = Array.from(resolutionMap.values()).sort((left, right) => { + const preferredDelta = readResolutionRank(left.key) - readResolutionRank(right.key); + if (preferredDelta !== 0) { + return preferredDelta; + } + + if (left.width !== right.width) { + return left.width - right.width; + } + + if (left.height !== right.height) { + return left.height - right.height; + } + + return left.label.localeCompare(right.label); + }); + + return { + generatedAt: new Date().toISOString(), + slideCount: slideNames.length, + screenshotCount: screenshots.length, + slides: slideNames.map((slide) => ({ + key: slide, + title: slideTitles.get(slide) || slide, + })), + resolutions, + screenshots, + }; +} + +function buildHtml(data) { + const embeddedData = JSON.stringify(data); + + return ` + + + + + Screenshot Viewer + + + +
+
+
+

Local Screenshot Viewer

+
Open this file directly in a browser or serve the repo locally.
+
+
+
+ + +
+
+ +
+ + + +
+
+
+ + + + +`; +} + +function main() { + if (!fs.existsSync(screenshotsDir)) { + throw new Error(`Screenshot directory does not exist: ${screenshotsDir}`); + } + + const data = collectScreenshots(); + fs.writeFileSync(outputPath, buildHtml(data)); + console.log(`Wrote screenshot viewer to ${outputPath}`); +} + +main(); diff --git a/scripts/vendor-katex.sh b/scripts/vendor-katex.sh new file mode 100755 index 0000000..2c1bb56 --- /dev/null +++ b/scripts/vendor-katex.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +KATEX_VERSION="${KATEX_VERSION:-0.16.37}" +TMP_DIR="$(mktemp -d)" + +cleanup() { + rm -rf "$TMP_DIR" +} + +trap cleanup EXIT + +mkdir -p "$TMP_DIR" + +pushd "$TMP_DIR" >/dev/null +TARBALL="$(npm pack --silent "katex@${KATEX_VERSION}")" +tar -xzf "$TARBALL" +popd >/dev/null + +SRC_DIR="$TMP_DIR/package" +DEST_DIR="$ROOT_DIR/vendor/katex" + +rm -rf "$DEST_DIR" +mkdir -p "$DEST_DIR/dist/contrib" "$DEST_DIR/dist/fonts" + +cp "$SRC_DIR/LICENSE" "$DEST_DIR/LICENSE" +cp "$SRC_DIR/dist/katex.min.js" "$DEST_DIR/dist/katex.min.js" +cp "$SRC_DIR/dist/katex.min.css" "$DEST_DIR/dist/katex.min.css" +cp "$SRC_DIR/dist/contrib/auto-render.min.js" "$DEST_DIR/dist/contrib/auto-render.min.js" +cp "$SRC_DIR/dist/fonts/"*.woff2 "$DEST_DIR/dist/fonts/" +cp "$SRC_DIR/dist/fonts/"*.woff "$DEST_DIR/dist/fonts/" + +printf 'Vendored KaTeX %s into %s\n' "$KATEX_VERSION" "$DEST_DIR" diff --git a/vendor/katex/LICENSE b/vendor/katex/LICENSE new file mode 100644 index 0000000..37c6433 --- /dev/null +++ b/vendor/katex/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2020 Khan Academy and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/katex/dist/contrib/auto-render.min.js b/vendor/katex/dist/contrib/auto-render.min.js new file mode 100644 index 0000000..0a1f35d --- /dev/null +++ b/vendor/katex/dist/contrib/auto-render.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};r.d(o,{default:function(){return p}});var i=r(757),a=r.n(i);const l=function(e,t,n){let r=n,o=0;const i=e.length;for(;re.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")+")");for(;n=e.search(o),-1!==n;){n>0&&(r.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));const o=t.findIndex(t=>e.startsWith(t.left));if(n=l(t[o].right,e,t[o].left.length),-1===n)break;const i=e.slice(0,n+t[o].right.length),a=s.test(i)?i:e.slice(t[o].left.length,n);r.push({type:"math",data:a,rawData:i,display:t[o].display}),e=e.slice(n+t[o].right.length)}return""!==e&&r.push({type:"text",data:e}),r};const c=function(e,t){const n=d(e,t.delimiters);if(1===n.length&&"text"===n[0].type)return null;const r=document.createDocumentFragment();for(let e=0;e!e.includes(" "+t+" "))&&f(i,t)}}};var p=function(e,t){if(!e)throw new Error("No element provided to render");const n={};Object.assign(n,t),n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=new Set((null==t?void 0:t.ignoredTags)||["script","noscript","style","textarea","pre","code","option"]),n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},f(e,n)};return o=o.default}()}); \ No newline at end of file diff --git a/vendor/katex/dist/fonts/KaTeX_AMS-Regular.woff b/vendor/katex/dist/fonts/KaTeX_AMS-Regular.woff new file mode 100644 index 0000000..b804d7b Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_AMS-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_AMS-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_AMS-Regular.woff2 new file mode 100644 index 0000000..0acaaff Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_AMS-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff new file mode 100644 index 0000000..9759710 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 new file mode 100644 index 0000000..f390922 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff new file mode 100644 index 0000000..9bdd534 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 new file mode 100644 index 0000000..75344a1 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold.woff b/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold.woff new file mode 100644 index 0000000..e7730f6 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 b/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 new file mode 100644 index 0000000..395f28b Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular.woff new file mode 100644 index 0000000..acab069 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 new file mode 100644 index 0000000..735f694 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-Bold.woff b/vendor/katex/dist/fonts/KaTeX_Main-Bold.woff new file mode 100644 index 0000000..f38136a Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-Bold.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-Bold.woff2 b/vendor/katex/dist/fonts/KaTeX_Main-Bold.woff2 new file mode 100644 index 0000000..ab2ad21 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-Bold.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic.woff b/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic.woff new file mode 100644 index 0000000..67807b0 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 b/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 new file mode 100644 index 0000000..5931794 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-Italic.woff b/vendor/katex/dist/fonts/KaTeX_Main-Italic.woff new file mode 100644 index 0000000..6f43b59 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-Italic.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-Italic.woff2 b/vendor/katex/dist/fonts/KaTeX_Main-Italic.woff2 new file mode 100644 index 0000000..b50920e Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-Italic.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Main-Regular.woff new file mode 100644 index 0000000..21f5812 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Main-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Main-Regular.woff2 new file mode 100644 index 0000000..eb24a7b Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Main-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic.woff b/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic.woff new file mode 100644 index 0000000..0ae390d Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 b/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 new file mode 100644 index 0000000..2965702 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Math-Italic.woff b/vendor/katex/dist/fonts/KaTeX_Math-Italic.woff new file mode 100644 index 0000000..eb5159d Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Math-Italic.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Math-Italic.woff2 b/vendor/katex/dist/fonts/KaTeX_Math-Italic.woff2 new file mode 100644 index 0000000..215c143 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Math-Italic.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold.woff b/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold.woff new file mode 100644 index 0000000..8d47c02 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 b/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 new file mode 100644 index 0000000..cfaa3bd Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic.woff b/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic.woff new file mode 100644 index 0000000..7e02df9 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 b/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 new file mode 100644 index 0000000..349c06d Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular.woff b/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular.woff new file mode 100644 index 0000000..31b8482 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 new file mode 100644 index 0000000..a90eea8 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Script-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Script-Regular.woff new file mode 100644 index 0000000..0e7da82 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Script-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Script-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Script-Regular.woff2 new file mode 100644 index 0000000..b3048fc Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Script-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size1-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Size1-Regular.woff new file mode 100644 index 0000000..7f292d9 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size1-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size1-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Size1-Regular.woff2 new file mode 100644 index 0000000..c5a8462 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size1-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size2-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Size2-Regular.woff new file mode 100644 index 0000000..d241d9b Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size2-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size2-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Size2-Regular.woff2 new file mode 100644 index 0000000..e1bccfe Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size2-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size3-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Size3-Regular.woff new file mode 100644 index 0000000..e6e9b65 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size3-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size3-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Size3-Regular.woff2 new file mode 100644 index 0000000..249a286 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size3-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size4-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Size4-Regular.woff new file mode 100644 index 0000000..e1ec545 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size4-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Size4-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Size4-Regular.woff2 new file mode 100644 index 0000000..680c130 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Size4-Regular.woff2 differ diff --git a/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular.woff b/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular.woff new file mode 100644 index 0000000..2432419 Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular.woff differ diff --git a/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 b/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 new file mode 100644 index 0000000..771f1af Binary files /dev/null and b/vendor/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 differ diff --git a/vendor/katex/dist/katex.min.css b/vendor/katex/dist/katex.min.css new file mode 100644 index 0000000..2d5536b --- /dev/null +++ b/vendor/katex/dist/katex.min.css @@ -0,0 +1 @@ +@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.37"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo} diff --git a/vendor/katex/dist/katex.min.js b/vendor/katex/dist/katex.min.js new file mode 100644 index 0000000..99e8776 --- /dev/null +++ b/vendor/katex/dist/katex.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return so}});class r extends Error{constructor(e,t){let n,o,s="KaTeX parse error: "+e;const i=t&&t.loc;if(i&&i.start<=i.end){const e=i.lexer.input;n=i.start,o=i.end,n===e.length?s+=" at end of input: ":s+=" at position "+(n+1)+": ";const t=e.slice(n,o).replace(/[^]/g,"$&\u0332");let r,l;r=n>15?"\u2026"+e.slice(n-15,n):e.slice(0,n),l=o+15e.replace(o,"-$1").toLowerCase(),i={"&":"&",">":">","<":"<",'"':""","'":"'"},l=/[&><"']/g,a=e=>String(e).replace(l,e=>i[e]),c=e=>"ordgroup"===e.type||"color"===e.type?1===e.body.length?c(e.body[0]):e:"font"===e.type?c(e.body):e,h=new Set(["mathord","textord","atom"]),m=e=>h.has(c(e).type),u={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function p(e){if("default"in e)return e.default;const t=e.type,r=Array.isArray(t)?t[0]:t;if("string"!=typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class d{constructor(e){void 0===e&&(e={}),e=e||{};for(const t of Object.keys(u)){const r=u[t],n=e[t];this[t]=void 0!==n?r.processor?r.processor(n):n:p(r)}}reportNonstrict(e,t,r){let o=this.strict;if("function"==typeof o&&(o=o(e,t,r)),o&&"ignore"!==o){if(!0===o||"error"===o)throw new n("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===o?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+o+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,r){let n=this.strict;if("function"==typeof n)try{n=n(e,t,r)}catch(e){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if("url"in e&&e.url&&!e.protocol){const t=(e=>{const t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"})(e.url);if(null==t)return!1;e.protocol=t}const t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class g{constructor(e,t,r){this.id=e,this.size=t,this.cramped=r}sup(){return f[b[this.id]]}sub(){return f[y[this.id]]}fracNum(){return f[x[this.id]]}fracDen(){return f[w[this.id]]}cramp(){return f[v[this.id]]}text(){return f[k[this.id]]}isTight(){return this.size>=2}}const f=[new g(0,0,!1),new g(1,0,!0),new g(2,1,!1),new g(3,1,!0),new g(4,2,!1),new g(5,2,!0),new g(6,3,!1),new g(7,3,!0)],b=[4,5,4,5,6,7,6,7],y=[5,5,5,5,7,7,7,7],x=[2,3,4,5,6,7,6,7],w=[3,3,5,5,7,7,7,7],v=[1,1,3,3,5,5,7,7],k=[0,1,2,3,2,3,2,3];var z={DISPLAY:f[0],TEXT:f[2],SCRIPT:f[4],SCRIPTSCRIPT:f[6]};const S=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];const M=[];function A(e){for(let t=0;t=M[t]&&e<=M[t+1])return!0;return!1}S.forEach(e=>e.blocks.forEach(e=>M.push(...e)));const T=80,B={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},q={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},C={ex:!0,em:!0,mu:!0},I=function(e){return"string"!=typeof e&&(e=e.unit),e in q||e in C||"ex"===e},H=function(e,t){let r;if(e.unit in q)r=q[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{let o;if(o=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=o.fontMetrics().xHeight;else{if("em"!==e.unit)throw new n("Invalid unit: '"+e.unit+"'");r=o.fontMetrics().quad}o!==t&&(r*=o.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},R=function(e){return+e.toFixed(4)+"em"},E=function(e){return e.filter(e=>e).join(" ")},O=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");const e=t.getColor();e&&(this.style.color=e)}},N=function(e){const t=document.createElement(e);t.className=E(this.classes);for(const e of Object.keys(this.style))t.style[e]=this.style[e];for(const e of Object.keys(this.attributes))t.setAttribute(e,this.attributes[e]);for(let e=0;e/=\x00-\x1f]/,L=function(e){let t="<"+e;this.classes.length&&(t+=' class="'+a(E(this.classes))+'"');let r="";for(const e of Object.keys(this.style))r+=s(e)+":"+this.style[e]+";";r&&(t+=' style="'+a(r)+'"');for(const e of Object.keys(this.attributes)){if(D.test(e))throw new n("Invalid attribute name '"+e+"'");t+=" "+e+'="'+a(this.attributes[e])+'"'}t+=">";for(let e=0;e",t};class P{constructor(e,t,r,n){O.call(this,e,r,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return N.call(this,"span")}toMarkup(){return L.call(this,"span")}}class V{constructor(e,t,r,n){O.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return N.call(this,"a")}toMarkup(){return L.call(this,"a")}}class F{constructor(e,t,r){this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(const t of Object.keys(this.style))e.style[t]=this.style[t];return e}toMarkup(){let e=''+a(this.alt)+'=n[0]&&e<=n[1])return r.name}}return null}(this.text.charCodeAt(0));a&&this.classes.push(a+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=G[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createTextNode(this.text);let t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=R(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=E(this.classes));for(const e of Object.keys(this.style))t=t||document.createElement("span"),t.style[e]=this.style[e];return t?(t.appendChild(e),t):e}toMarkup(){let e=!1,t="0&&(r+="margin-right:"+this.italic+"em;");for(const e of Object.keys(this.style))r+=s(e)+":"+this.style[e]+";";r&&(e=!0,t+=' style="'+a(r)+'"');const n=a(this.text);return e?(t+=">",t+=n,t+="",t):n}}class Y{constructor(e,t){this.children=e||[],this.attributes=t||{}}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(const t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(let t=0;t':''}}class X{constructor(e){this.attributes=e||{}}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","line");for(const t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){let e="","\\gt",!0),ne(oe,ie,fe,"\u2208","\\in",!0),ne(oe,ie,fe,"\ue020","\\@not"),ne(oe,ie,fe,"\u2282","\\subset",!0),ne(oe,ie,fe,"\u2283","\\supset",!0),ne(oe,ie,fe,"\u2286","\\subseteq",!0),ne(oe,ie,fe,"\u2287","\\supseteq",!0),ne(oe,le,fe,"\u2288","\\nsubseteq",!0),ne(oe,le,fe,"\u2289","\\nsupseteq",!0),ne(oe,ie,fe,"\u22a8","\\models"),ne(oe,ie,fe,"\u2190","\\leftarrow",!0),ne(oe,ie,fe,"\u2264","\\le"),ne(oe,ie,fe,"\u2264","\\leq",!0),ne(oe,ie,fe,"<","\\lt",!0),ne(oe,ie,fe,"\u2192","\\rightarrow",!0),ne(oe,ie,fe,"\u2192","\\to"),ne(oe,le,fe,"\u2271","\\ngeq",!0),ne(oe,le,fe,"\u2270","\\nleq",!0),ne(oe,ie,be,"\xa0","\\ "),ne(oe,ie,be,"\xa0","\\space"),ne(oe,ie,be,"\xa0","\\nobreakspace"),ne(se,ie,be,"\xa0","\\ "),ne(se,ie,be,"\xa0"," "),ne(se,ie,be,"\xa0","\\space"),ne(se,ie,be,"\xa0","\\nobreakspace"),ne(oe,ie,be,null,"\\nobreak"),ne(oe,ie,be,null,"\\allowbreak"),ne(oe,ie,ge,",",","),ne(oe,ie,ge,";",";"),ne(oe,le,ce,"\u22bc","\\barwedge",!0),ne(oe,le,ce,"\u22bb","\\veebar",!0),ne(oe,ie,ce,"\u2299","\\odot",!0),ne(oe,ie,ce,"\u2295","\\oplus",!0),ne(oe,ie,ce,"\u2297","\\otimes",!0),ne(oe,ie,ye,"\u2202","\\partial",!0),ne(oe,ie,ce,"\u2298","\\oslash",!0),ne(oe,le,ce,"\u229a","\\circledcirc",!0),ne(oe,le,ce,"\u22a1","\\boxdot",!0),ne(oe,ie,ce,"\u25b3","\\bigtriangleup"),ne(oe,ie,ce,"\u25bd","\\bigtriangledown"),ne(oe,ie,ce,"\u2020","\\dagger"),ne(oe,ie,ce,"\u22c4","\\diamond"),ne(oe,ie,ce,"\u22c6","\\star"),ne(oe,ie,ce,"\u25c3","\\triangleleft"),ne(oe,ie,ce,"\u25b9","\\triangleright"),ne(oe,ie,de,"{","\\{"),ne(se,ie,ye,"{","\\{"),ne(se,ie,ye,"{","\\textbraceleft"),ne(oe,ie,he,"}","\\}"),ne(se,ie,ye,"}","\\}"),ne(se,ie,ye,"}","\\textbraceright"),ne(oe,ie,de,"{","\\lbrace"),ne(oe,ie,he,"}","\\rbrace"),ne(oe,ie,de,"[","\\lbrack",!0),ne(se,ie,ye,"[","\\lbrack",!0),ne(oe,ie,he,"]","\\rbrack",!0),ne(se,ie,ye,"]","\\rbrack",!0),ne(oe,ie,de,"(","\\lparen",!0),ne(oe,ie,he,")","\\rparen",!0),ne(se,ie,ye,"<","\\textless",!0),ne(se,ie,ye,">","\\textgreater",!0),ne(oe,ie,de,"\u230a","\\lfloor",!0),ne(oe,ie,he,"\u230b","\\rfloor",!0),ne(oe,ie,de,"\u2308","\\lceil",!0),ne(oe,ie,he,"\u2309","\\rceil",!0),ne(oe,ie,ye,"\\","\\backslash"),ne(oe,ie,ye,"\u2223","|"),ne(oe,ie,ye,"\u2223","\\vert"),ne(se,ie,ye,"|","\\textbar",!0),ne(oe,ie,ye,"\u2225","\\|"),ne(oe,ie,ye,"\u2225","\\Vert"),ne(se,ie,ye,"\u2225","\\textbardbl"),ne(se,ie,ye,"~","\\textasciitilde"),ne(se,ie,ye,"\\","\\textbackslash"),ne(se,ie,ye,"^","\\textasciicircum"),ne(oe,ie,fe,"\u2191","\\uparrow",!0),ne(oe,ie,fe,"\u21d1","\\Uparrow",!0),ne(oe,ie,fe,"\u2193","\\downarrow",!0),ne(oe,ie,fe,"\u21d3","\\Downarrow",!0),ne(oe,ie,fe,"\u2195","\\updownarrow",!0),ne(oe,ie,fe,"\u21d5","\\Updownarrow",!0),ne(oe,ie,pe,"\u2210","\\coprod"),ne(oe,ie,pe,"\u22c1","\\bigvee"),ne(oe,ie,pe,"\u22c0","\\bigwedge"),ne(oe,ie,pe,"\u2a04","\\biguplus"),ne(oe,ie,pe,"\u22c2","\\bigcap"),ne(oe,ie,pe,"\u22c3","\\bigcup"),ne(oe,ie,pe,"\u222b","\\int"),ne(oe,ie,pe,"\u222b","\\intop"),ne(oe,ie,pe,"\u222c","\\iint"),ne(oe,ie,pe,"\u222d","\\iiint"),ne(oe,ie,pe,"\u220f","\\prod"),ne(oe,ie,pe,"\u2211","\\sum"),ne(oe,ie,pe,"\u2a02","\\bigotimes"),ne(oe,ie,pe,"\u2a01","\\bigoplus"),ne(oe,ie,pe,"\u2a00","\\bigodot"),ne(oe,ie,pe,"\u222e","\\oint"),ne(oe,ie,pe,"\u222f","\\oiint"),ne(oe,ie,pe,"\u2230","\\oiiint"),ne(oe,ie,pe,"\u2a06","\\bigsqcup"),ne(oe,ie,pe,"\u222b","\\smallint"),ne(se,ie,me,"\u2026","\\textellipsis"),ne(oe,ie,me,"\u2026","\\mathellipsis"),ne(se,ie,me,"\u2026","\\ldots",!0),ne(oe,ie,me,"\u2026","\\ldots",!0),ne(oe,ie,me,"\u22ef","\\@cdots",!0),ne(oe,ie,me,"\u22f1","\\ddots",!0),ne(oe,ie,ye,"\u22ee","\\varvdots"),ne(se,ie,ye,"\u22ee","\\varvdots"),ne(oe,ie,ae,"\u02ca","\\acute"),ne(oe,ie,ae,"\u02cb","\\grave"),ne(oe,ie,ae,"\xa8","\\ddot"),ne(oe,ie,ae,"~","\\tilde"),ne(oe,ie,ae,"\u02c9","\\bar"),ne(oe,ie,ae,"\u02d8","\\breve"),ne(oe,ie,ae,"\u02c7","\\check"),ne(oe,ie,ae,"^","\\hat"),ne(oe,ie,ae,"\u20d7","\\vec"),ne(oe,ie,ae,"\u02d9","\\dot"),ne(oe,ie,ae,"\u02da","\\mathring"),ne(oe,ie,ue,"\ue131","\\@imath"),ne(oe,ie,ue,"\ue237","\\@jmath"),ne(oe,ie,ye,"\u0131","\u0131"),ne(oe,ie,ye,"\u0237","\u0237"),ne(se,ie,ye,"\u0131","\\i",!0),ne(se,ie,ye,"\u0237","\\j",!0),ne(se,ie,ye,"\xdf","\\ss",!0),ne(se,ie,ye,"\xe6","\\ae",!0),ne(se,ie,ye,"\u0153","\\oe",!0),ne(se,ie,ye,"\xf8","\\o",!0),ne(se,ie,ye,"\xc6","\\AE",!0),ne(se,ie,ye,"\u0152","\\OE",!0),ne(se,ie,ye,"\xd8","\\O",!0),ne(se,ie,ae,"\u02ca","\\'"),ne(se,ie,ae,"\u02cb","\\`"),ne(se,ie,ae,"\u02c6","\\^"),ne(se,ie,ae,"\u02dc","\\~"),ne(se,ie,ae,"\u02c9","\\="),ne(se,ie,ae,"\u02d8","\\u"),ne(se,ie,ae,"\u02d9","\\."),ne(se,ie,ae,"\xb8","\\c"),ne(se,ie,ae,"\u02da","\\r"),ne(se,ie,ae,"\u02c7","\\v"),ne(se,ie,ae,"\xa8",'\\"'),ne(se,ie,ae,"\u02dd","\\H"),ne(se,ie,ae,"\u25ef","\\textcircled");const xe={"--":!0,"---":!0,"``":!0,"''":!0};ne(se,ie,ye,"\u2013","--",!0),ne(se,ie,ye,"\u2013","\\textendash"),ne(se,ie,ye,"\u2014","---",!0),ne(se,ie,ye,"\u2014","\\textemdash"),ne(se,ie,ye,"\u2018","`",!0),ne(se,ie,ye,"\u2018","\\textquoteleft"),ne(se,ie,ye,"\u2019","'",!0),ne(se,ie,ye,"\u2019","\\textquoteright"),ne(se,ie,ye,"\u201c","``",!0),ne(se,ie,ye,"\u201c","\\textquotedblleft"),ne(se,ie,ye,"\u201d","''",!0),ne(se,ie,ye,"\u201d","\\textquotedblright"),ne(oe,ie,ye,"\xb0","\\degree",!0),ne(se,ie,ye,"\xb0","\\degree"),ne(se,ie,ye,"\xb0","\\textdegree",!0),ne(oe,ie,ye,"\xa3","\\pounds"),ne(oe,ie,ye,"\xa3","\\mathsterling",!0),ne(se,ie,ye,"\xa3","\\pounds"),ne(se,ie,ye,"\xa3","\\textsterling",!0),ne(oe,le,ye,"\u2720","\\maltese"),ne(se,le,ye,"\u2720","\\maltese");const we='0123456789/@."';for(let e=0;e<14;e++){const t=we.charAt(e);ne(oe,ie,ye,t,t)}const ve='0123456789!@*()-=+";:?/.,';for(let e=0;e<25;e++){const t=ve.charAt(e);ne(se,ie,ye,t,t)}const ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let e=0;e<52;e++){const t=ke.charAt(e);ne(oe,ie,ue,t,t),ne(se,ie,ye,t,t)}ne(oe,le,ye,"C","\u2102"),ne(se,le,ye,"C","\u2102"),ne(oe,le,ye,"H","\u210d"),ne(se,le,ye,"H","\u210d"),ne(oe,le,ye,"N","\u2115"),ne(se,le,ye,"N","\u2115"),ne(oe,le,ye,"P","\u2119"),ne(se,le,ye,"P","\u2119"),ne(oe,le,ye,"Q","\u211a"),ne(se,le,ye,"Q","\u211a"),ne(oe,le,ye,"R","\u211d"),ne(se,le,ye,"R","\u211d"),ne(oe,le,ye,"Z","\u2124"),ne(se,le,ye,"Z","\u2124"),ne(oe,ie,ue,"h","\u210e"),ne(se,ie,ue,"h","\u210e");let ze="";for(let e=0;e<52;e++){const t=ke.charAt(e);ze=String.fromCharCode(55349,56320+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56372+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56424+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56580+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56684+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56736+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56788+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56840+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56944+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),e<26&&(ze=String.fromCharCode(55349,56632+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,56476+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze))}ze=String.fromCharCode(55349,56668),ne(oe,ie,ue,"k",ze),ne(se,ie,ye,"k",ze);for(let e=0;e<10;e++){const t=e.toString();ze=String.fromCharCode(55349,57294+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,57314+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,57324+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze),ze=String.fromCharCode(55349,57334+e),ne(oe,ie,ue,t,ze),ne(se,ie,ye,t,ze)}const Se="\xd0\xde\xfe";for(let e=0;e<3;e++){const t=Se.charAt(e);ne(oe,ie,ue,t,t),ne(se,ie,ye,t,t)}const Me=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Ae=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]];class Te{constructor(e){this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createDocumentFragment();for(let t=0;te.toText()).join("")}}const Be=function(e,t,r){if(re[r][e]){const t=re[r][e].replace;t&&(e=t)}return{value:e,metrics:K(e,t,r)}},qe=function(e,t,r,n,o){const s=Be(e,t,r),i=s.metrics;let l;if(e=s.value,i){let t=i.italic;("text"===r||n&&"mathit"===n.font)&&(t=0),l=new U(e,i.height,i.depth,t,i.skew,i.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+r+"'"),l=new U(e,0,0,0,0,0,o);if(n){l.maxFontSize=n.sizeMultiplier,n.style.isTight()&&l.classes.push("mtight");const e=n.getColor();e&&(l.style.color=e)}return l},Ce=function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Be(e,"Main-Bold",t).metrics?qe(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===re[t][e].font?qe(e,"Main-Regular",t,r,n):qe(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},Ie=function(e,t,r){const o=e.mode,s=e.text,i=["mord"],l="math"===o||"text"===o&&t.font,a=l?t.font:t.fontFamily;let c="",h="";if(55349===s.charCodeAt(0)&&([c,h]=((e,t)=>{const r=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,o="math"===t?0:1;if(119808<=r&&r<120484){const e=Math.floor((r-119808)/26);return[Me[e][2],Me[e][o]]}if(120782<=r&&r<=120831){const e=Math.floor((r-120782)/10);return[Ae[e][2],Ae[e][o]]}if(120485===r||120486===r)return[Me[0][2],Me[0][o]];if(1204860)return qe(s,c,o,t,i.concat(h));if(a){let e,n;if("boldsymbol"===a){const t=function(e,t,r,n,o){return"textord"!==o&&Be(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(s,o,0,0,r);e=t.fontName,n=[t.fontClass]}else l?(e=Ue[a].fontName,n=[a]):(e=Ge(a,t.fontWeight,t.fontShape),n=[a,t.fontWeight,t.fontShape]);if(Be(s,e,o).metrics)return qe(s,e,o,t,i.concat(n));if(xe.hasOwnProperty(s)&&"Typewriter"===e.slice(0,10)){const r=[];for(let l=0;l{if(E(e.classes)!==E(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||0!==e.italic&&e.hasClass("mathnormal"))return!1;if(1===e.classes.length){const t=e.classes[0];if("mbin"===t||"mord"===t)return!1}for(const r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(const r of Object.keys(t.style))if(e.style[r]!==t.style[r])return!1;return!0},Re=e=>{for(let t=0;tt&&(t=s.height),s.depth>r&&(r=s.depth),s.maxFontSize>n&&(n=s.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},Oe=function(e,t,r,n){const o=new P(e,t,r,n);return Ee(o),o},Ne=(e,t,r,n)=>new P(e,t,r,n),De=function(e,t,r){const n=Oe([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=R(n.height),n.maxFontSize=1,n},Le=function(e){const t=new Te(e);return Ee(t),t},Pe=function(e,t){return e instanceof Te?Oe([],[e],t):e},Ve=function(e,t){const{children:r,depth:n}=function(e){if("individualShift"===e.positionType){const t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth;let o=n;for(let e=1;e{const r=Oe(["mspace"],[],t),n=H(e,t);return r.style.marginRight=R(n),r},Ge=function(e,t,r){let n,o="";switch(e){case"amsrm":o="AMS";break;case"textrm":o="Main";break;case"textsf":o="SansSerif";break;case"texttt":o="Typewriter";break;default:o=e}return n="textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular",o+"-"+n},Ue={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ye={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},We=function(e,t){const[r,n,o]=Ye[e],s=new W(r),i=new Y([s],{width:R(n),height:R(o),style:"width:"+R(n),viewBox:"0 0 "+1e3*n+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),l=Ne(["overlay"],[i],t);return l.height=o,l.style.height=R(o),l.style.width=R(n),l},Xe={number:3,unit:"mu"},je={number:4,unit:"mu"},_e={number:5,unit:"mu"},$e={mord:{mop:Xe,mbin:je,mrel:_e,minner:Xe},mop:{mord:Xe,mop:Xe,mrel:_e,minner:Xe},mbin:{mord:je,mop:je,mopen:je,minner:je},mrel:{mord:_e,mop:_e,mopen:_e,minner:_e},mopen:{},mclose:{mop:Xe,mbin:je,mrel:_e,minner:Xe},mpunct:{mord:Xe,mop:Xe,mrel:_e,mopen:Xe,mclose:Xe,mpunct:Xe,minner:Xe},minner:{mord:Xe,mop:Xe,mbin:je,mrel:_e,mopen:Xe,mpunct:Xe,minner:Xe}},Ze={mord:{mop:Xe},mop:{mord:Xe,mop:Xe},mbin:{},mrel:{},mopen:{},mclose:{mop:Xe},mpunct:{},minner:{mop:Xe}},Ke={},Je={},Qe={};function et(e){let{type:t,names:r,props:n,handler:o,htmlBuilder:s,mathmlBuilder:i}=e;const l={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:o};for(let e=0;e{const r=t.classes[0],n=e.classes[0];"mbin"===r&&st.has(n)?t.classes[0]="mord":"mbin"===n&&ot.has(r)&&(e.classes[0]="mord")},{node:i},l,a),ct(o,(e,t)=>{var r,n;const o=ut(t),i=ut(e),l=o&&i?e.hasClass("mtight")?null==(r=Ze[o])?void 0:r[i]:null==(n=$e[o])?void 0:n[i]:null;if(l)return Fe(l,s)},{node:i},l,a),o},ct=function(e,t,r,n,o){n&&e.push(n);let s=0;for(;sr=>{e.splice(t+1,0,r),s++})(s)}n&&e.pop()},ht=function(e){return e instanceof Te||e instanceof V||e instanceof P&&e.hasClass("enclosing")?e:null},mt=function(e,t){const r=ht(e);if(r){const e=r.children;if(e.length){if("right"===t)return mt(e[e.length-1],"right");if("left"===t)return mt(e[0],"left")}}return e},ut=function(e,t){if(!e)return null;t&&(e=mt(e,t));const r=e.classes[0];return lt[r]||null},pt=function(e,t){const r=["nulldelimiter"].concat(e.baseSizingClasses());return Oe(t.concat(r))},dt=function(e,t,r){if(!e)return Oe();if(Je[e.type]){let n=Je[e.type](e,t);if(r&&t.size!==r.size){n=Oe(t.sizingClasses(r),[n],t);const e=t.sizeMultiplier/r.sizeMultiplier;n.height*=e,n.depth*=e}return n}throw new n("Got group of unknown type: '"+e.type+"'")};function gt(e,t){const r=Oe(["base"],e,t),n=Oe(["strut"]);return n.style.height=R(r.height+r.depth),r.depth&&(n.style.verticalAlign=R(-r.depth)),r.children.unshift(n),r}function ft(e,t){let r=null;1===e.length&&"tag"===e[0].type&&(r=e[0].tag,e=e[0].body);const n=at(e,t,"root");let o;2===n.length&&n[1].hasClass("tag")&&(o=n.pop());const s=[];let i,l=[];for(let e=0;e0&&(s.push(gt(l,t)),l=[]),s.push(n[e]));l.length>0&&s.push(gt(l,t)),r?(i=gt(at(r,t,!0),t),i.classes=["tag"],s.push(i)):o&&s.push(o);const a=Oe(["katex-html"],s);if(a.setAttribute("aria-hidden","true"),i){const e=i.children[0];e.style.height=R(a.height+a.depth),a.depth&&(e.style.verticalAlign=R(-a.depth))}return a}function bt(e){return new Te(e)}class yt{constructor(e,t,r){this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){const e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=E(this.classes));for(let t=0;t0&&(e+=' class ="'+a(E(this.classes))+'"'),e+=">";for(let t=0;t",e}toText(){return this.children.map(e=>e.toText()).join("")}}class xt{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return a(this.toText())}toText(){return this.text}}class wt{constructor(e){this.width=e,this.character=e>=.05555&&e<=.05556?"\u200a":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200a":e>=-.05556&&e<=-.05555?"\u200a\u2063":e>=-.1667&&e<=-.1666?"\u2009\u2063":e>=-.2223&&e<=-.2222?"\u205f\u2063":e>=-.2778&&e<=-.2777?"\u2005\u2063":null}toNode(){if(this.character)return document.createTextNode(this.character);{const e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",R(this.width)),e}}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}const vt=new Set(["\\imath","\\jmath"]),kt=new Set(["mrow","mtable"]),zt=function(e,t,r){return!re[t][e]||!re[t][e].replace||55349===e.charCodeAt(0)||xe.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=re[t][e].replace),new xt(e)},St=function(e){return 1===e.length?e[0]:new yt("mrow",e)},Mt=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";const r=t.font;if(!r||"mathnormal"===r)return null;const n=e.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathsfit"===r)return"sans-serif-italic";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";let o=e.text;if(vt.has(o))return null;if(re[n][o]){const e=re[n][o].replace;e&&(o=e)}return K(o,Ue[r].fontName,n)?Ue[r].variant:null};function At(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){const t=e.children[0];return t instanceof xt&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){const t=e.children[0];return t instanceof xt&&","===t.text}return!1}const Tt=function(e,t,r){if(1===e.length){const n=qt(e[0],t);return r&&n instanceof yt&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}const n=[];let o;for(let r=0;r=1&&("mn"===o.type||At(o))){const e=s.children[0];e instanceof yt&&"mn"===e.type&&(e.children=[...o.children,...e.children],n.pop())}else if("mi"===o.type&&1===o.children.length){const e=o.children[0];if(e instanceof xt&&"\u0338"===e.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){const e=s.children[0];e instanceof xt&&e.text.length>0&&(e.text=e.text.slice(0,1)+"\u0338"+e.text.slice(1),n.pop())}}}n.push(s),o=s}return n},Bt=function(e,t,r){return St(Tt(e,t,r))},qt=function(e,t){if(!e)return new yt("mrow");if(Qe[e.type]){return Qe[e.type](e,t)}throw new n("Got group of unknown type: '"+e.type+"'")};function Ct(e,t,r,n,o){const s=Tt(e,r);let i;i=1===s.length&&s[0]instanceof yt&&kt.has(s[0].type)?s[0]:new yt("mrow",s);const l=new yt("annotation",[new xt(t)]);l.setAttribute("encoding","application/x-tex");const a=new yt("semantics",[i,l]),c=new yt("math",[a]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");return Oe([o?"katex":"katex-mathml"],[c])}const It=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Ht=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Rt=function(e,t){return t.size<2?e:It[e-1][t.size-1]};class Et{constructor(e){this.style=e.style,this.color=e.color,this.size=e.size||Et.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Ht[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){const t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new Et(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Rt(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Ht[e-1]})}havingBaseStyle(e){e=e||this.style.text();const t=Rt(Et.BASESIZE,e);return this.size===t&&this.textSize===Et.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){let e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Et.BASESIZE?["sizing","reset-size"+this.size,"size"+Et.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){let t;if(t=e>=5?0:e>=3?1:2,!J[t]){const e=J[t]={cssEmPerMu:$.quad[t]/18};for(const r in $)$.hasOwnProperty(r)&&(e[r]=$[r][t])}return J[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Et.BASESIZE=6;var Ot=Et;const Nt=function(e){return new Ot({style:e.displayMode?z.DISPLAY:z.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Dt=function(e,t){if(t.displayMode){const r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=Oe(r,[e])}return e},Lt=function(e,t,r){const n=Nt(r);let o;if("mathml"===r.output)return Ct(e,t,n,r.displayMode,!0);if("html"===r.output){const t=ft(e,n);o=Oe(["katex"],[t])}else{const s=Ct(e,t,n,r.displayMode,!1),i=ft(e,n);o=Oe(["katex"],[s,i])}return Dt(o,r)};const Pt={widehat:"^",widecheck:"\u02c7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23df",overbrace:"\u23de",overgroup:"\u23e0",undergroup:"\u23e1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xlongequal:"=",xtofrom:"\u21c4",xrightleftarrows:"\u21c4",xrightequilibrium:"\u21cc",xleftequilibrium:"\u21cb","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Vt=function(e){const t=new yt("mo",[new xt(Pt[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Ft={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Gt=new Set(["widehat","widecheck","widetilde","utilde"]),Ut=function(e,t){const{span:r,minWidth:n,height:o}=function(){let r=4e5;const n=e.label.slice(1);if(Gt.has(n)){const o=e,s="ordgroup"===o.base.type?o.base.body.length:1;let i,l,a;if(s>5)"widehat"===n||"widecheck"===n?(i=420,r=2364,a=.42,l=n+"4"):(i=312,r=2340,a=.34,l="tilde4");else{const e=[1,1,2,2,3,3][s];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][e],i=[0,239,300,360,420][e],a=[0,.24,.3,.3,.36,.42][e],l=n+e):(r=[0,600,1033,2339,2340][e],i=[0,260,286,306,312][e],a=[0,.26,.286,.3,.306,.34][e],l="tilde"+e)}const c=new W(l),h=new Y([c],{width:"100%",height:R(a),viewBox:"0 0 "+r+" "+i,preserveAspectRatio:"none"});return{span:Ne([],[h],t),minWidth:0,height:a}}{const e=[],o=Ft[n],[s,i,l]=o,a=l/1e3,c=s.length;let h,m;if(1===c){h=["hide-tail"],m=[o[3]]}else if(2===c)h=["halfarrow-left","halfarrow-right"],m=["xMinYMin","xMaxYMin"];else{if(3!==c)throw new Error("Correct katexImagesData or update code here to support\n "+c+" children.");h=["brace-left","brace-center","brace-right"],m=["xMinYMin","xMidYMin","xMaxYMin"]}for(let n=0;n0&&(r.style.minWidth=R(n)),r};function Yt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Wt(e){const t=Xt(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Xt(e){return e&&("atom"===e.type||ee.hasOwnProperty(e.type))?e:null}const jt=(e,t)=>{let r,n,o;e&&"supsub"===e.type?(n=Yt(e.base,"accent"),r=n.base,e.base=r,o=function(e){if(e instanceof P)return e;throw new Error("Expected span but got "+String(e)+".")}(dt(e,t)),e.base=n):(n=Yt(e,"accent"),r=n.base);const s=dt(r,t.havingCrampedStyle());let i=0;if(n.isShifty&&m(r)){const e=c(r);i=j(dt(e,t.havingCrampedStyle())).skew}const l="\\c"===n.label;let a,h=l?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(n.isStretchy)a=Ut(n,t),a=Ve({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:a,wrapperClasses:["svg-align"],wrapperStyle:i>0?{width:"calc(100% - "+R(2*i)+")",marginLeft:R(2*i)}:void 0}]});else{let e,r;"\\vec"===n.label?(e=We("vec",t),r=Ye.vec[1]):(e=Ie({type:"textord",mode:n.mode,text:n.label},t,"textord"),e=j(e),e.italic=0,r=e.width,l&&(h+=e.depth)),a=Oe(["accent-body"],[e]);const o="\\textcircled"===n.label;o&&(a.classes.push("accent-full"),h=s.height);let c=i;o||(c-=r/2),a.style.left=R(c),"\\textcircled"===n.label&&(a.style.top=".2em"),a=Ve({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-h},{type:"elem",elem:a}]})}const u=Oe(["mord","accent"],[a],t);return o?(o.children[0]=u,o.height=Math.max(u.height,o.height),o.classes[0]="mord",o):u},_t=(e,t)=>{const r=e.isStretchy?Vt(e.label):new yt("mo",[zt(e.label,e.mode)]),n=new yt("mover",[qt(e.base,t),r]);return n.setAttribute("accent","true"),n},$t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));et({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{const r=rt(t[0]),n=!$t.test(e.funcName),o=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:o,base:r}},htmlBuilder:jt,mathmlBuilder:_t}),et({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{const r=t[0];let n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:jt,mathmlBuilder:_t}),et({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:o}},htmlBuilder:(e,t)=>{const r=dt(e.base,t),n=Ut(e,t),o="\\utilde"===e.label?.12:0,s=Ve({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:r}]});return Oe(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{const r=Vt(e.label),n=new yt("munder",[qt(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});const Zt=e=>{const t=new yt("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};function Kt(e,t){const r=at(e.body,t,!0);return Oe([e.mclass],r,t)}function Jt(e,t){let r;const n=Tt(e.body,t);return"minner"===e.mclass?r=new yt("mpadded",n):"mord"===e.mclass?e.isCharacterBox?(r=n[0],r.type="mi"):r=new yt("mi",n):(e.isCharacterBox?(r=n[0],r.type="mo"):r=new yt("mo",n),"mbin"===e.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}et({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){let{parser:n,funcName:o}=e;return{type:"xArrow",mode:n.mode,label:o,body:t[0],below:r[0]}},htmlBuilder(e,t){const r=t.style;let n=t.havingStyle(r.sup());const o=Pe(dt(e.body,n,t),t),s="\\x"===e.label.slice(0,2)?"x":"cd";let i;o.classes.push(s+"-arrow-pad"),e.below&&(n=t.havingStyle(r.sub()),i=Pe(dt(e.below,n,t),t),i.classes.push(s+"-arrow-pad"));const l=Ut(e,t),a=-t.fontMetrics().axisHeight+.5*l.height;let c,h=-t.fontMetrics().axisHeight-.5*l.height-.111;if((o.depth>.25||"\\xleftequilibrium"===e.label)&&(h-=o.depth),i){const e=-t.fontMetrics().axisHeight+i.height+.5*l.height+.111;c=Ve({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h},{type:"elem",elem:l,shift:a},{type:"elem",elem:i,shift:e}]})}else c=Ve({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h},{type:"elem",elem:l,shift:a}]});return c.children[0].children[0].children[1].classes.push("svg-align"),Oe(["mrel","x-arrow"],[c],t)},mathmlBuilder(e,t){const r=Vt(e.label);let n;if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){const o=Zt(qt(e.body,t));if(e.below){const s=Zt(qt(e.below,t));n=new yt("munderover",[r,s,o])}else n=new yt("mover",[r,o])}else if(e.below){const o=Zt(qt(e.below,t));n=new yt("munder",[r,o])}else n=Zt(),n=new yt("mover",[r,n]);return n}}),et({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:nt(o),isCharacterBox:m(o)}},htmlBuilder:Kt,mathmlBuilder:Jt});const Qt=e=>{const t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};et({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){let{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:Qt(t[0]),body:nt(t[1]),isCharacterBox:m(t[1])}}}),et({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){let{parser:r,funcName:n}=e;const o=t[1],s=t[0];let i;i="\\stackrel"!==n?Qt(o):"mrel";const l={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==n,body:nt(o)},a={type:"supsub",mode:s.mode,base:l,sup:"\\underset"===n?null:s,sub:"\\underset"===n?s:null};return{type:"mclass",mode:r.mode,mclass:i,body:[a],isCharacterBox:m(a)}},htmlBuilder:Kt,mathmlBuilder:Jt}),et({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:Qt(t[0]),body:nt(t[0])}},htmlBuilder(e,t){const r=at(e.body,t,!0),n=Oe([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(e,t){const r=Tt(e.body,t),n=new yt("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});const er={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},tr=()=>({type:"styling",body:[],mode:"math",style:"display"}),rr=e=>"textord"===e.type&&"@"===e.text,nr=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function or(e,t,r){const n=er[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{const e={type:"atom",text:n,mode:"math",family:"rel"},o={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[e],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[o],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const e={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[e],[])}default:return{type:"textord",text:" ",mode:"math"}}}et({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder(e,t){const r=t.havingStyle(t.style.sup()),n=Pe(dt(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=R(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(e,t){let r=new yt("mrow",[qt(e.label,t)]);return r=new yt("mpadded",[r]),r.setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new yt("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),et({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){let{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){const r=Pe(dt(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(e,t){return new yt("mrow",[qt(e.fragment,t)])}}),et({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;const o=Yt(t[0],"ordgroup").body;let s="";for(let e=0;e=1114111)throw new n("\\@char with invalid code point "+s);return l<=65535?i=String.fromCharCode(l):(l-=65536,i=String.fromCharCode(55296+(l>>10),56320+(1023&l))),{type:"textord",mode:r.mode,text:i}}});const sr=(e,t)=>{const r=at(e.body,t.withColor(e.color),!1);return Le(r)},ir=(e,t)=>{const r=Tt(e.body,t.withColor(e.color)),n=new yt("mstyle",r);return n.setAttribute("mathcolor",e.color),n};et({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){let{parser:r}=e;const n=Yt(t[0],"color-token").color,o=t[1];return{type:"color",mode:r.mode,color:n,body:nt(o)}},htmlBuilder:sr,mathmlBuilder:ir}),et({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){let{parser:r,breakOnTokenText:n}=e;const o=Yt(t[0],"color-token").color;r.gullet.macros.set("\\current@color",o);const s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:o,body:s}},htmlBuilder:sr,mathmlBuilder:ir}),et({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){let{parser:n}=e;const o="["===n.gullet.future().text?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:o&&Yt(o,"size").value}},htmlBuilder(e,t){const r=Oe(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=R(H(e.size,t)))),r},mathmlBuilder(e,t){const r=new yt("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",R(H(e.size,t)))),r}});const lr={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ar=e=>{const t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new n("Expected a control sequence",e);return t},cr=(e,t,r,n)=>{let o=e.gullet.macros.get(r.text);null==o&&(r.noexpand=!0,o={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,o,n)};et({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){let{parser:t,funcName:r}=e;t.consumeSpaces();const o=t.fetch();if(lr[o.text])return"\\global"!==r&&"\\\\globallong"!==r||(o.text=lr[o.text]),Yt(t.parseFunction(),"internal");throw new n("Invalid token after macro prefix",o)}}),et({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e,o=t.gullet.popToken();const s=o.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new n("Expected a control sequence",o);let i,l=0;const a=[[]];for(;"{"!==t.gullet.future().text;)if(o=t.gullet.popToken(),"#"===o.text){if("{"===t.gullet.future().text){i=t.gullet.future(),a[l].push("{");break}if(o=t.gullet.popToken(),!/^[1-9]$/.test(o.text))throw new n('Invalid argument number "'+o.text+'"');if(parseInt(o.text)!==l+1)throw new n('Argument number "'+o.text+'" out of order');l++,a.push([])}else{if("EOF"===o.text)throw new n("Expected a macro definition");a[l].push(o.text)}let{tokens:c}=t.gullet.consumeArg();return i&&c.unshift(i),"\\edef"!==r&&"\\xdef"!==r||(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(s,{tokens:c,numArgs:l,delimiters:a},r===lr[r]),{type:"internal",mode:t.mode}}}),et({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e;const n=ar(t.gullet.popToken());t.gullet.consumeSpaces();const o=(e=>{let t=e.gullet.popToken();return"="===t.text&&(t=e.gullet.popToken()," "===t.text&&(t=e.gullet.popToken())),t})(t);return cr(t,n,o,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),et({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e;const n=ar(t.gullet.popToken()),o=t.gullet.popToken(),s=t.gullet.popToken();return cr(t,n,s,"\\\\globalfuture"===r),t.gullet.pushToken(s),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});const hr=function(e,t,r){const n=K(re.math[e]&&re.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},mr=function(e,t,r,n){const o=r.havingBaseStyle(t),s=Oe(n.concat(o.sizingClasses(r)),[e],r),i=o.sizeMultiplier/r.sizeMultiplier;return s.height*=i,s.depth*=i,s.maxFontSize=o.sizeMultiplier,s},ur=function(e,t,r){const n=t.havingBaseStyle(r),o=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=R(o),e.height-=o,e.depth+=o},pr=function(e,t,r,n,o,s){const i=function(e,t,r,n){return qe(e,"Size"+t+"-Regular",r,n)}(e,t,o,n),l=mr(Oe(["delimsizing","size"+t],[i],n),z.TEXT,n,s);return r&&ur(l,n,z.TEXT),l},dr=function(e,t,r){let n;n="Size1-Regular"===t?"delim-size1":"delim-size4";return{type:"elem",elem:Oe(["delimsizinginner",n],[Oe([],[qe(e,t,r)])])}},gr=function(e,t,r){const n=_["Size4-Regular"][e.charCodeAt(0)]?_["Size4-Regular"][e.charCodeAt(0)][4]:_["Size1-Regular"][e.charCodeAt(0)][4],o=new W("inner",function(e,t){switch(e){case"\u239c":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"\u2223":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"\u2225":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"\u239f":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"\u23a2":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"\u23a5":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"\u23aa":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"\u23d0":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"\u2016":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),s=new Y([o],{width:R(n),height:R(t),style:"width:"+R(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),i=Ne([],[s],r);return i.height=t,i.style.height=R(t),i.style.width=R(n),{type:"elem",elem:i}},fr={type:"kern",size:-.008},br=new Set(["|","\\lvert","\\rvert","\\vert"]),yr=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),xr=function(e,t,r,n,o,s){let i,l,a,c,h="",m=0;i=a=c=e,l=null;let u="Size1-Regular";"\\uparrow"===e?a=c="\u23d0":"\\Uparrow"===e?a=c="\u2016":"\\downarrow"===e?i=a="\u23d0":"\\Downarrow"===e?i=a="\u2016":"\\updownarrow"===e?(i="\\uparrow",a="\u23d0",c="\\downarrow"):"\\Updownarrow"===e?(i="\\Uparrow",a="\u2016",c="\\Downarrow"):br.has(e)?(a="\u2223",h="vert",m=333):yr.has(e)?(a="\u2225",h="doublevert",m=556):"["===e||"\\lbrack"===e?(i="\u23a1",a="\u23a2",c="\u23a3",u="Size4-Regular",h="lbrack",m=667):"]"===e||"\\rbrack"===e?(i="\u23a4",a="\u23a5",c="\u23a6",u="Size4-Regular",h="rbrack",m=667):"\\lfloor"===e||"\u230a"===e?(a=i="\u23a2",c="\u23a3",u="Size4-Regular",h="lfloor",m=667):"\\lceil"===e||"\u2308"===e?(i="\u23a1",a=c="\u23a2",u="Size4-Regular",h="lceil",m=667):"\\rfloor"===e||"\u230b"===e?(a=i="\u23a5",c="\u23a6",u="Size4-Regular",h="rfloor",m=667):"\\rceil"===e||"\u2309"===e?(i="\u23a4",a=c="\u23a5",u="Size4-Regular",h="rceil",m=667):"("===e||"\\lparen"===e?(i="\u239b",a="\u239c",c="\u239d",u="Size4-Regular",h="lparen",m=875):")"===e||"\\rparen"===e?(i="\u239e",a="\u239f",c="\u23a0",u="Size4-Regular",h="rparen",m=875):"\\{"===e||"\\lbrace"===e?(i="\u23a7",l="\u23a8",c="\u23a9",a="\u23aa",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(i="\u23ab",l="\u23ac",c="\u23ad",a="\u23aa",u="Size4-Regular"):"\\lgroup"===e||"\u27ee"===e?(i="\u23a7",c="\u23a9",a="\u23aa",u="Size4-Regular"):"\\rgroup"===e||"\u27ef"===e?(i="\u23ab",c="\u23ad",a="\u23aa",u="Size4-Regular"):"\\lmoustache"===e||"\u23b0"===e?(i="\u23a7",c="\u23ad",a="\u23aa",u="Size4-Regular"):"\\rmoustache"!==e&&"\u23b1"!==e||(i="\u23ab",c="\u23a9",a="\u23aa",u="Size4-Regular");const p=hr(i,u,o),d=p.height+p.depth,g=hr(a,u,o),f=g.height+g.depth,b=hr(c,u,o),y=b.height+b.depth;let x=0,w=1;if(null!==l){const e=hr(l,u,o);x=e.height+e.depth,w=2}const v=d+y+x,k=v+Math.max(0,Math.ceil((t-v)/(w*f)))*w*f;let S=n.fontMetrics().axisHeight;r&&(S*=n.sizeMultiplier);const M=k/2-S,A=[];if(h.length>0){const e=k-d-y,t=Math.round(1e3*k),r=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(h,Math.round(1e3*e)),o=new W(h,r),s=(m/1e3).toFixed(3)+"em",i=(t/1e3).toFixed(3)+"em",l=new Y([o],{width:s,height:i,viewBox:"0 0 "+m+" "+t}),a=Ne([],[l],n);a.height=t/1e3,a.style.width=s,a.style.height=i,A.push({type:"elem",elem:a})}else{if(A.push(dr(c,u,o)),A.push(fr),null===l){const e=k-d-y+.016;A.push(gr(a,e,n))}else{const e=(k-d-y-x)/2+.016;A.push(gr(a,e,n)),A.push(fr),A.push(dr(l,u,o)),A.push(fr),A.push(gr(a,e,n))}A.push(fr),A.push(dr(i,u,o))}const T=n.havingBaseStyle(z.TEXT),B=Ve({positionType:"bottom",positionData:M,children:A});return mr(Oe(["delimsizing","mult"],[B],T),z.TEXT,n,s)},wr=.08,vr=function(e,t,r,n,o){const s=function(e,t,r){t*=1e3;let n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,T);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,T);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,T);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,T);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,T);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,T,r)}return n}(e,n,r),i=new W(e,s),l=new Y([i],{width:"400em",height:R(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ne(["hide-tail"],[l],o)},kr=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","\\surd"]),zr=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1"]),Sr=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Mr=[0,1.2,1.8,2.4,3],Ar=function(e,t,r,o,s){if("<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),kr.has(e)||Sr.has(e))return pr(e,t,!1,r,o,s);if(zr.has(e))return xr(e,Mr[t],!1,r,o,s);throw new n("Illegal delimiter: '"+e+"'")},Tr=[{type:"small",style:z.SCRIPTSCRIPT},{type:"small",style:z.SCRIPT},{type:"small",style:z.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Br=[{type:"small",style:z.SCRIPTSCRIPT},{type:"small",style:z.SCRIPT},{type:"small",style:z.TEXT},{type:"stack"}],qr=[{type:"small",style:z.SCRIPTSCRIPT},{type:"small",style:z.SCRIPT},{type:"small",style:z.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Cr=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";{const t=e.type;throw new Error("Add support for delim type '"+t+"' here.")}},Ir=function(e,t,r,n){for(let o=Math.min(2,3-n.style.size);ot)return s}return r[r.length-1]},Hr=function(e,t,r,n,o,s){let i;"<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),i=Sr.has(e)?Tr:kr.has(e)?qr:Br;const l=Ir(e,t,i,n);return"small"===l.type?function(e,t,r,n,o,s){const i=qe(e,"Main-Regular",o,n),l=mr(i,t,n,s);return r&&ur(l,n,t),l}(e,l.style,r,n,o,s):"large"===l.type?pr(e,l.size,r,n,o,s):xr(e,t,r,n,o,s)},Rr=function(e,t,r,n,o,s){const i=n.fontMetrics().axisHeight*n.sizeMultiplier,l=5/n.fontMetrics().ptPerEm,a=Math.max(t-i,r+i),c=Math.max(a/500*901,2*a-l);return Hr(e,c,!0,n,o,s)},Er={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Or=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27e8","\\rangle","\u27e9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Nr(e,t){const r=Xt(e);if(r&&Or.has(r.text))return r;throw new n(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Dr(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}et({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{const r=Nr(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Er[e.funcName].size,mclass:Er[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>"."===e.delim?Oe([e.mclass]):Ar(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{const t=[];"."!==e.delim&&t.push(zt(e.delim,e.mode));const r=new yt("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");const n=R(Mr[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),et({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new n("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Nr(t[0],e).text,color:r}}}),et({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=Nr(t[0],e),n=e.parser;++n.leftrightDepth;const o=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);const s=Yt(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:o,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Dr(e);const r=at(e.body,t,!0,["mopen","mclose"]);let n,o,s=0,i=0,l=!1;for(let e=0;e{Dr(e);const r=Tt(e.body,t);if("."!==e.left){const t=new yt("mo",[zt(e.left,e.mode)]);t.setAttribute("fence","true"),r.unshift(t)}if("."!==e.right){const t=new yt("mo",[zt(e.right,e.mode)]);t.setAttribute("fence","true"),e.rightColor&&t.setAttribute("mathcolor",e.rightColor),r.push(t)}return St(r)}}),et({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=Nr(t[0],e);if(!e.parser.leftrightDepth)throw new n("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{let r;if("."===e.delim)r=pt(t,[]);else{r=Ar(e.delim,1,t,e.mode,[]);const n={delim:e.delim,options:t};r.isMiddle=n}return r},mathmlBuilder:(e,t)=>{const r="\\vert"===e.delim||"|"===e.delim?zt("|","text"):zt(e.delim,e.mode),n=new yt("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});const Lr=(e,t)=>{const r=Pe(dt(e.body,t),t),n=e.label.slice(1);let o,s=t.sizeMultiplier,i=0;const l=m(e.body);if("sout"===n)o=Oe(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/s,i=-.5*t.fontMetrics().xHeight;else if("phase"===n){const e=H({number:.6,unit:"pt"},t),n=H({number:.35,unit:"ex"},t);s/=t.havingBaseSizing().sizeMultiplier;const l=r.height+r.depth+e+n;r.style.paddingLeft=R(l/2+e);const c=Math.floor(1e3*l*s),h="M400000 "+(a=c)+" H0 L"+a/2+" 0 l65 45 L145 "+(a-80)+" H400000z",m=new Y([new W("phase",h)],{width:"400em",height:R(c/1e3),viewBox:"0 0 400000 "+c,preserveAspectRatio:"xMinYMin slice"});o=Ne(["hide-tail"],[m],t),o.style.height=R(l),i=r.depth+e+n}else{/cancel/.test(n)?l||r.classes.push("cancel-pad"):"angl"===n?r.classes.push("anglpad"):r.classes.push("boxpad");let s=0,a=0,c=0;/box/.test(n)?(c=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),s=t.fontMetrics().fboxsep+("colorbox"===n?0:c),a=s):"angl"===n?(c=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s=4*c,a=Math.max(0,.25-r.depth)):(s=l?.2:0,a=s),o=function(e,t,r,n,o){let s;const i=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(s=Oe(["stretchy",t],[],o),"fbox"===t){const e=o.color&&o.getColor();e&&(s.style.borderColor=e)}}else{const e=[];/^[bx]cancel$/.test(t)&&e.push(new X({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&e.push(new X({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));const r=new Y(e,{width:"100%",height:R(i)});s=Ne([],[r],o)}return s.height=i,s.style.height=R(i),s}(r,n,s,a,t),/fbox|boxed|fcolorbox/.test(n)?(o.style.borderStyle="solid",o.style.borderWidth=R(c)):"angl"===n&&.049!==c&&(o.style.borderTopWidth=R(c),o.style.borderRightWidth=R(c)),i=r.depth+a,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var a;let c;if(e.backgroundColor)c=Ve({positionType:"individualShift",children:[{type:"elem",elem:o,shift:i},{type:"elem",elem:r,shift:0}]});else{const e=/cancel|phase/.test(n)?["svg-align"]:[];c=Ve({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:o,shift:i,wrapperClasses:e}]})}return/cancel/.test(n)&&(c.height=r.height,c.depth=r.depth),/cancel/.test(n)&&!l?Oe(["mord","cancel-lap"],[c],t):Oe(["mord"],[c],t)},Pr=(e,t)=>{let r=0;const n=new yt(e.label.includes("colorbox")?"mpadded":"menclose",[qt(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){const r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+r+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};et({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,r){let{parser:n,funcName:o}=e;const s=Yt(t[0],"color-token").color,i=t[1];return{type:"enclose",mode:n.mode,label:o,backgroundColor:s,body:i}},htmlBuilder:Lr,mathmlBuilder:Pr}),et({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,r){let{parser:n,funcName:o}=e;const s=Yt(t[0],"color-token").color,i=Yt(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:n.mode,label:o,backgroundColor:i,borderColor:s,body:l}},htmlBuilder:Lr,mathmlBuilder:Pr}),et({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}}),et({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"enclose",mode:r.mode,label:n,body:o}},htmlBuilder:Lr,mathmlBuilder:Pr}),et({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){let{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});const Vr={};function Fr(e){let{type:t,names:r,props:n,handler:o,htmlBuilder:s,mathmlBuilder:i}=e;const l={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o};for(let e=0;e{if(!e.parser.settings.displayMode)throw new n("{"+e.envName+"} can be used only in display mode.")},_r=new Set(["gather","gather*"]);function $r(e){if(!e.includes("ed"))return!e.includes("*")}function Zr(e,t,r){let{hskipBeforeAndAfter:o,addJot:s,cols:i,arraystretch:l,colSeparationType:a,autoTag:c,singleRow:h,emptySingleRow:m,maxNumCols:u,leqno:p}=t;if(e.gullet.beginGroup(),h||e.gullet.macros.set("\\cr","\\\\\\relax"),!l){const t=e.gullet.expandMacroAsText("\\arraystretch");if(null==t)l=1;else if(l=parseFloat(t),!l||l<0)throw new n("Invalid \\arraystretch: "+t)}e.gullet.beginGroup();let d=[];const g=[d],f=[],b=[],y=null!=c?[]:void 0;function x(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Wr("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(c)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(x(),b.push(Xr(e));;){const t=e.parseExpression(!1,h?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();let o={type:"ordgroup",mode:e.mode,body:t};r&&(o={type:"styling",mode:e.mode,style:r,body:[o]}),d.push(o);const s=e.fetch().text;if("&"===s){if(u&&d.length===u){if(h||a)throw new n("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===s){w(),1===d.length&&"styling"===o.type&&1===o.body.length&&"ordgroup"===o.body[0].type&&0===o.body[0].body.length&&(g.length>1||!m)&&g.pop(),b.length0&&(y+=.25),c.push({pos:y,isDashed:e[t]})}for(x(i[0]),r=0;r0&&(u+=b,ce))for(r=0;r=l)continue;var q,C;if(o>0||e.hskipBeforeAndAfter)i=null!=(q=null==(C=c)?void 0:C.pregap)?q:u,0!==i&&(S=Oe(["arraycolsep"],[]),S.style.width=R(i),k.push(S));const p=[];for(r=0;r0){const e=De("hline",t,h),r=De("hdashline",t,h),n=[{type:"elem",elem:O,shift:0}];for(;c.length>0;){const t=c.pop(),o=t.pos-w;t.isDashed?n.push({type:"elem",elem:r,shift:o}):n.push({type:"elem",elem:e,shift:o})}O=Ve({positionType:"individualShift",children:n})}if(0===A.length)return Oe(["mord"],[O],t);{const e=Ve({positionType:"individualShift",children:A}),r=Oe(["tag"],[e],t);return Le([O,r])}},Qr={c:"center ",l:"left ",r:"right "},en=function(e,t){const r=[],n=new yt("mtd",[],["mtr-glue"]),o=new yt("mtd",[],["mml-eqn-num"]);for(let s=0;s0){const t=e.cols;let r="",n=!1,o=0,i=t.length;"separator"===t[0].type&&(l+="top ",o=1),"separator"===t[t.length-1].type&&(l+="bottom ",i-=1);for(let e=o;e0?"left ":"",l+=h[h.length-1].length>0?"right ":"";for(let e=1;e0&&h&&(n=1),r[e]={type:"align",align:t,pregap:n,postgap:0}}return i.colSeparationType=h?"align":"alignat",i};Fr({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){const r=(Xt(t[0])?[t[0]]:Yt(t[0],"ordgroup").body).map(function(e){const t=Wt(e).text;if("lcr".includes(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new n("Unknown column alignment: "+t,e)}),o={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Zr(e.parser,o,Kr(e.envName))},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){const t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")];let r="c";const o={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){const t=e.parser;if(t.consumeSpaces(),"["===t.fetch().text){if(t.consume(),t.consumeSpaces(),r=t.fetch().text,!"lcr".includes(r))throw new n("Expected l or c or r",t.nextToken);t.consume(),t.consumeSpaces(),t.expect("]"),t.consume(),o.cols=[{type:"align",align:r}]}}const s=Zr(e.parser,o,Kr(e.envName)),i=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(i).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){const t=Zr(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){const r=(Xt(t[0])?[t[0]]:Yt(t[0],"ordgroup").body).map(function(e){const t=Wt(e).text;if("lc".includes(t))return{type:"align",align:t};throw new n("Unknown column alignment: "+t,e)});if(r.length>1)throw new n("{subarray} can contain only one column");const o={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5},s=Zr(e.parser,o,"script");if(s.body.length>0&&s.body[0].length>1)throw new n("{subarray} can contain only one column");return s},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){const t=Zr(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Kr(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:tn,htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){_r.has(e.envName)&&jr(e);const t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:$r(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Zr(e.parser,t,"display")},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:tn,htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){jr(e);const t={autoTag:$r(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Zr(e.parser,t,"display")},htmlBuilder:Jr,mathmlBuilder:en}),Fr({type:"array",names:["CD"],props:{numArgs:0},handler(e){return jr(e),function(e){const t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();const r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new n("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}let r=[];const o=[r];for(let s=0;sAV".includes(o))throw new n('Expected one of "<>AV=|." after @',i[t]);for(let e=0;e<2;e++){let r=!0;for(let l=t+1;l{const r=e.font,n=t.withFont(r);return dt(e.body,n)},on=(e,t)=>{const r=e.font,n=t.withFont(r);return qt(e.body,n)},sn={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};et({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=rt(t[0]);let s=n;return s in sn&&(s=sn[s]),{type:"font",mode:r.mode,font:s.slice(1),body:o}},htmlBuilder:nn,mathmlBuilder:on}),et({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"mclass",mode:r.mode,mclass:Qt(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:m(n)}}}),et({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:n,breakOnTokenText:o}=e;const{mode:s}=r,i=r.parseExpression(!0,o);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:i}}},htmlBuilder:nn,mathmlBuilder:on});const ln=(e,t)=>{if(!t)return e;return{type:"styling",mode:e.mode,style:t,body:[e]}};et({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=t[1];let i,l=null,a=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":i=!0;break;case"\\\\atopfrac":i=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i=!1,l="(",a=")";break;case"\\\\bracefrac":i=!1,l="\\{",a="\\}";break;case"\\\\brackfrac":i=!1,l="[",a="]";break;default:throw new Error("Unrecognized genfrac command")}const c="\\cfrac"===n;let h=null;return c||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),ln({type:"genfrac",mode:r.mode,numer:o,denom:s,continued:c,hasBarLine:i,leftDelim:l,rightDelim:a,barSize:null},h)},htmlBuilder:(e,t)=>{const r=t.style,n=r.fracNum(),o=r.fracDen();let s;s=t.havingStyle(n);const i=dt(e.numer,s,t);if(e.continued){const e=8.5/t.fontMetrics().ptPerEm,r=3.5/t.fontMetrics().ptPerEm;i.height=i.height0?3*h:7*h,p=t.fontMetrics().denom1):(c>0?(m=t.fontMetrics().num2,u=h):(m=t.fontMetrics().num3,u=3*h),p=t.fontMetrics().denom2),a){const e=t.fontMetrics().axisHeight;m-i.depth-(e+.5*c){const r=new yt("mfrac",[qt(e.numer,t),qt(e.denom,t)]);if(e.hasBarLine){if(e.barSize){const n=H(e.barSize,t);r.setAttribute("linethickness",R(n))}}else r.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){const t=[];if(null!=e.leftDelim){const r=new yt("mo",[new xt(e.leftDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}if(t.push(r),null!=e.rightDelim){const r=new yt("mo",[new xt(e.rightDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}return St(t)}return r}}),et({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){let t,{parser:r,funcName:n,token:o}=e;switch(n){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:t,token:o}}});const an=["display","text","script","scriptscript"],cn=function(e){let t=null;return e.length>0&&(t=e,t="."===t?null:t),t};et({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){let{parser:r}=e;const n=t[4],o=t[5],s=rt(t[0]),i="atom"===s.type&&"open"===s.family?cn(s.text):null,l=rt(t[1]),a="atom"===l.type&&"close"===l.family?cn(l.text):null,c=Yt(t[2],"size");let h,m=null;c.isBlank?h=!0:(m=c.value,h=m.number>0);let u=null,p=t[3];if("ordgroup"===p.type){if(p.body.length>0){const e=Yt(p.body[0],"textord");u=an[Number(e.text)]}}else p=Yt(p,"textord"),u=an[Number(p.text)];return ln({type:"genfrac",mode:r.mode,numer:n,denom:o,continued:!1,hasBarLine:h,barSize:m,leftDelim:i,rightDelim:a},u)}}),et({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){let{parser:r,funcName:n,token:o}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Yt(t[0],"size").value,token:o}}}),et({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=Yt(t[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));const i=t[2],l=s.number>0;return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null}}});const hn=(e,t)=>{const r=t.style;let n,o;"supsub"===e.type?(n=e.sup?dt(e.sup,t.havingStyle(r.sup()),t):dt(e.sub,t.havingStyle(r.sub()),t),o=Yt(e.base,"horizBrace")):o=Yt(e,"horizBrace");const s=dt(o.base,t.havingBaseStyle(z.DISPLAY)),i=Ut(o,t);let l;if(o.isOver?(l=Ve({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:i}]}),l.children[0].children[0].children[1].classes.push("svg-align")):(l=Ve({positionType:"bottom",positionData:s.depth+.1+i.height,children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:s}]}),l.children[0].children[0].children[0].classes.push("svg-align")),n){const e=Oe(["mord",o.isOver?"mover":"munder"],[l],t);l=o.isOver?Ve({positionType:"firstBaseline",children:[{type:"elem",elem:e},{type:"kern",size:.2},{type:"elem",elem:n}]}):Ve({positionType:"bottom",positionData:e.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:e}]})}return Oe(["mord",o.isOver?"mover":"munder"],[l],t)};et({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:hn,mathmlBuilder:(e,t)=>{const r=Vt(e.label);return new yt(e.isOver?"mover":"munder",[qt(e.base,t),r])}}),et({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[1],o=Yt(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:r.mode,href:o,body:nt(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{const r=at(e.body,t,!1);return function(e,t,r,n){const o=new V(e,t,r,n);return Ee(o),o}(e.href,[],r,t)},mathmlBuilder:(e,t)=>{let r=Bt(e.body,t);return r instanceof yt||(r=new yt("mrow",[r])),r.setAttribute("href",e.href),r}}),et({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=Yt(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");const o=[];for(let e=0;e{let{parser:r,funcName:o,token:s}=e;const i=Yt(t[0],"raw").string,l=t[1];let a;r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");const c={};switch(o){case"\\htmlClass":c.class=i,a={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,a={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,a={command:"\\htmlStyle",style:i};break;case"\\htmlData":{const e=i.split(",");for(let t=0;t{const r=at(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/));const o=Oe(n,r,t);for(const t in e.attributes)"class"!==t&&e.attributes.hasOwnProperty(t)&&o.setAttribute(t,e.attributes[t]);return o},mathmlBuilder:(e,t)=>Bt(e.body,t)}),et({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:nt(t[0]),mathml:nt(t[1])}},htmlBuilder:(e,t)=>{const r=at(e.html,t,!1);return Le(r)},mathmlBuilder:(e,t)=>Bt(e.mathml,t)});const mn=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};{const t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new n("Invalid size: '"+e+"' in \\includegraphics");const r={number:+(t[1]+t[2]),unit:t[3]};if(!I(r))throw new n("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r}};et({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{let{parser:o}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},a="";if(r[0]){const e=Yt(r[0],"raw").string.split(",");for(let t=0;t{const r=H(e.height,t);let n=0;e.totalheight.number>0&&(n=H(e.totalheight,t)-r);let o=0;e.width.number>0&&(o=H(e.width,t));const s={height:R(r+n)};o>0&&(s.width=R(o)),n>0&&(s.verticalAlign=R(-n));const i=new F(e.src,e.alt,s);return i.height=r,i.depth=n,i},mathmlBuilder:(e,t)=>{const r=new yt("mglyph",[]);r.setAttribute("alt",e.alt);const n=H(e.height,t);let o=0;if(e.totalheight.number>0&&(o=H(e.totalheight,t)-n,r.setAttribute("valign",R(-o))),r.setAttribute("height",R(n+o)),e.width.number>0){const n=H(e.width,t);r.setAttribute("width",R(n))}return r.setAttribute("src",e.src),r}}),et({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=Yt(t[0],"size");if(r.settings.strict){const e="m"===n[1],t="mu"===o.value.unit;e?(t||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+o.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):t&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:o.value}},htmlBuilder(e,t){return Fe(e.dimension,t)},mathmlBuilder(e,t){const r=H(e.dimension,t);return new wt(r)}}),et({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:o}},htmlBuilder:(e,t)=>{let r;"clap"===e.alignment?(r=Oe([],[dt(e.body,t)]),r=Oe(["inner"],[r],t)):r=Oe(["inner"],[dt(e.body,t)]);const n=Oe(["fix"],[]);let o=Oe([e.alignment],[r,n],t);const s=Oe(["strut"]);return s.style.height=R(o.height+o.depth),o.depth&&(s.style.verticalAlign=R(-o.depth)),o.children.unshift(s),o=Oe(["thinbox"],[o],t),Oe(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{const r=new yt("mpadded",[qt(e.body,t)]);if("rlap"!==e.alignment){const t="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",t+"width")}return r.setAttribute("width","0px"),r}}),et({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){let{funcName:r,parser:n}=e;const o=n.mode;n.switchMode("math");const s="\\("===r?"\\)":"$",i=n.parseExpression(!1,s);return n.expect(s),n.switchMode(o),{type:"styling",mode:n.mode,style:"text",body:i}}}),et({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new n("Mismatched "+e.funcName)}});const un=(e,t)=>{switch(t.style.size){case z.DISPLAY.size:return e.display;case z.TEXT.size:return e.text;case z.SCRIPT.size:return e.script;case z.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};et({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{let{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:nt(t[0]),text:nt(t[1]),script:nt(t[2]),scriptscript:nt(t[3])}},htmlBuilder:(e,t)=>{const r=un(e,t),n=at(r,t,!1);return Le(n)},mathmlBuilder:(e,t)=>{const r=un(e,t);return Bt(r,t)}});const pn=(e,t,r,n,o,s,i)=>{e=Oe([],[e]);const l=r&&m(r);let a,c,h;if(t){const e=dt(t,n.havingStyle(o.sup()),n);c={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-e.depth)}}if(r){const e=dt(r,n.havingStyle(o.sub()),n);a={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-e.height)}}if(c&&a){const t=n.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+i;h=Ve({positionType:"bottom",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:R(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:R(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(a){const t=e.height-i;h=Ve({positionType:"top",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:R(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]})}else{if(!c)return e;{const t=e.depth+i;h=Ve({positionType:"bottom",positionData:t,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:R(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}}const u=[h];if(a&&0!==s&&!l){const e=Oe(["mspace"],[],n);e.style.marginRight=R(s),u.unshift(e)}return Oe(["mop","op-limits"],u,n)},dn=new Set(["\\smallint"]),gn=(e,t)=>{let r,n,o,s=!1;"supsub"===e.type?(r=e.sup,n=e.sub,o=Yt(e.base,"op"),s=!0):o=Yt(e,"op");const i=t.style;let l,a=!1;if(i.size===z.DISPLAY.size&&o.symbol&&!dn.has(o.name)&&(a=!0),o.symbol){const e=a?"Size2-Regular":"Size1-Regular";let r="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(r=o.name.slice(1),o.name="oiint"===r?"\\iint":"\\iiint"),l=qe(o.name,e,"math",t,["mop","op-symbol",a?"large-op":"small-op"]),r.length>0){const e=l.italic,n=We(r+"Size"+(a?"2":"1"),t);l=Ve({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:n,shift:a?.08:0}]}),o.name="\\"+r,l.classes.unshift("mop"),l.italic=e}}else if(o.body){const e=at(o.body,t,!0);1===e.length&&e[0]instanceof U?(l=e[0],l.classes[0]="mop"):l=Oe(["mop"],e,t)}else{const e=[];for(let r=1;r{let r;if(e.symbol)r=new yt("mo",[zt(e.name,e.mode)]),dn.has(e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new yt("mo",Tt(e.body,t));else{r=new yt("mi",[new xt(e.name.slice(1))]);const t=new yt("mo",[zt("\u2061","text")]);r=e.parentIsSupSub?new yt("mrow",[r,t]):bt([r,t])}return r},bn={"\u220f":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22c0":"\\bigwedge","\u22c1":"\\bigvee","\u22c2":"\\bigcap","\u22c3":"\\bigcup","\u2a00":"\\bigodot","\u2a01":"\\bigoplus","\u2a02":"\\bigotimes","\u2a04":"\\biguplus","\u2a06":"\\bigsqcup"};et({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220f","\u2210","\u2211","\u22c0","\u22c1","\u22c2","\u22c3","\u2a00","\u2a01","\u2a02","\u2a04","\u2a06"],props:{numArgs:0},handler:(e,t)=>{let{parser:r,funcName:n}=e,o=n;return 1===o.length&&(o=bn[o]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:gn,mathmlBuilder:fn}),et({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:nt(n)}},htmlBuilder:gn,mathmlBuilder:fn});const yn={"\u222b":"\\int","\u222c":"\\iint","\u222d":"\\iiint","\u222e":"\\oint","\u222f":"\\oiint","\u2230":"\\oiiint"};et({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:gn,mathmlBuilder:fn}),et({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:gn,mathmlBuilder:fn}),et({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222b","\u222c","\u222d","\u222e","\u222f","\u2230"],props:{numArgs:0,allowedInArgument:!0},handler(e){let{parser:t,funcName:r}=e,n=r;return 1===n.length&&(n=yn[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:gn,mathmlBuilder:fn});const xn=(e,t)=>{let r,n,o,s,i=!1;if("supsub"===e.type?(r=e.sup,n=e.sub,o=Yt(e.base,"operatorname"),i=!0):o=Yt(e,"operatorname"),o.body.length>0){const e=o.body.map(e=>{const t="text"in e?e.text:void 0;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),r=at(e,t.withFont("mathrm"),!0);for(let e=0;e{let{parser:r,funcName:n}=e;const o=t[0];return{type:"operatorname",mode:r.mode,body:nt(o),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}},htmlBuilder:xn,mathmlBuilder:(e,t)=>{let r=Tt(e.body,t.withFont("mathrm")),n=!0;for(let e=0;ee.toText()).join("");r=[new xt(e)]}const o=new yt("mi",r);o.setAttribute("mathvariant","normal");const s=new yt("mo",[zt("\u2061","text")]);return e.parentIsSupSub?new yt("mrow",[o,s]):bt([o,s])}}),Ur("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),tt({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Le(at(e.body,t,!1)):Oe(["mord"],at(e.body,t,!0),t)},mathmlBuilder(e,t){return Bt(e.body,t,!0)}}),et({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){let{parser:r}=e;const n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(e,t){const r=dt(e.body,t.havingCrampedStyle()),n=De("overline-line",t),o=t.fontMetrics().defaultRuleThickness,s=Ve({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n},{type:"kern",size:o}]});return Oe(["mord","overline"],[s],t)},mathmlBuilder(e,t){const r=new yt("mo",[new xt("\u203e")]);r.setAttribute("stretchy","true");const n=new yt("mover",[qt(e.body,t),r]);return n.setAttribute("accent","true"),n}}),et({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"phantom",mode:r.mode,body:nt(n)}},htmlBuilder:(e,t)=>{const r=at(e.body,t.withPhantom(),!1);return Le(r)},mathmlBuilder:(e,t)=>{const r=Tt(e.body,t);return new yt("mphantom",r)}}),Ur("\\hphantom","\\smash{\\phantom{#1}}"),et({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{const r=Oe(["inner"],[dt(e.body,t.withPhantom())]),n=Oe(["fix"],[]);return Oe(["mord","rlap"],[r,n],t)},mathmlBuilder:(e,t)=>{const r=Tt(nt(e.body),t),n=new yt("mphantom",r),o=new yt("mpadded",[n]);return o.setAttribute("width","0px"),o}}),et({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){let{parser:r}=e;const n=Yt(t[0],"size").value,o=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:o}},htmlBuilder(e,t){const r=dt(e.body,t),n=H(e.dy,t);return Ve({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(e,t){const r=new yt("mpadded",[qt(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}}),et({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){let{parser:t}=e;return{type:"internal",mode:t.mode}}}),et({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,r){let{parser:n}=e;const o=r[0],s=Yt(t[0],"size"),i=Yt(t[1],"size");return{type:"rule",mode:n.mode,shift:o&&Yt(o,"size").value,width:s.value,height:i.value}},htmlBuilder(e,t){const r=Oe(["mord","rule"],[],t),n=H(e.width,t),o=H(e.height,t),s=e.shift?H(e.shift,t):0;return r.style.borderRightWidth=R(n),r.style.borderTopWidth=R(o),r.style.bottom=R(s),r.width=n,r.height=o+s,r.depth=-s,r.maxFontSize=1.125*o*t.sizeMultiplier,r},mathmlBuilder(e,t){const r=H(e.width,t),n=H(e.height,t),o=e.shift?H(e.shift,t):0,s=t.color&&t.getColor()||"black",i=new yt("mspace");i.setAttribute("mathbackground",s),i.setAttribute("width",R(r)),i.setAttribute("height",R(n));const l=new yt("mpadded",[i]);return o>=0?l.setAttribute("height",R(o)):(l.setAttribute("height",R(o)),l.setAttribute("depth",R(-o))),l.setAttribute("voffset",R(o)),l}});const vn=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];et({type:"sizing",names:vn,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{let{breakOnTokenText:r,funcName:n,parser:o}=e;const s=o.parseExpression(!1,r);return{type:"sizing",mode:o.mode,size:vn.indexOf(n)+1,body:s}},htmlBuilder:(e,t)=>{const r=t.havingSize(e.size);return wn(e.body,r,t)},mathmlBuilder:(e,t)=>{const r=t.havingSize(e.size),n=Tt(e.body,r),o=new yt("mstyle",n);return o.setAttribute("mathsize",R(r.sizeMultiplier)),o}}),et({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{let{parser:n}=e,o=!1,s=!1;const i=r[0]&&Yt(r[0],"ordgroup");if(i){let e="";for(let t=0;t{const r=Oe([],[dt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0),e.smashDepth&&(r.depth=0),e.smashHeight&&e.smashDepth)return Oe(["mord","smash"],[r],t);if(r.children)for(let t=0;t{const r=new yt("mpadded",[qt(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}}),et({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){let{parser:n}=e;const o=r[0],s=t[0];return{type:"sqrt",mode:n.mode,body:s,index:o}},htmlBuilder(e,t){let r=dt(e.body,t.havingCrampedStyle());0===r.height&&(r.height=t.fontMetrics().xHeight),r=Pe(r,t);const n=t.fontMetrics().defaultRuleThickness;let o=n;t.style.idr.height+r.depth+s&&(s=(s+h-r.height-r.depth)/2);const m=l.height-r.height-s-a;r.style.paddingLeft=R(c);const u=Ve({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+m)},{type:"elem",elem:l},{type:"kern",size:a}]});if(e.index){const r=t.havingStyle(z.SCRIPTSCRIPT),n=dt(e.index,r,t),o=.6*(u.height-u.depth),s=Ve({positionType:"shift",positionData:-o,children:[{type:"elem",elem:n}]}),i=Oe(["root"],[s]);return Oe(["mord","sqrt"],[i,u],t)}return Oe(["mord","sqrt"],[u],t)},mathmlBuilder(e,t){const{body:r,index:n}=e;return n?new yt("mroot",[qt(r,t),qt(n,t)]):new yt("msqrt",[qt(r,t)])}});const kn={display:z.DISPLAY,text:z.TEXT,script:z.SCRIPT,scriptscript:z.SCRIPTSCRIPT};et({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){let{breakOnTokenText:r,funcName:n,parser:o}=e;const s=o.parseExpression(!0,r),i=n.slice(1,n.length-5);return{type:"styling",mode:o.mode,style:i,body:s}},htmlBuilder(e,t){const r=kn[e.style],n=t.havingStyle(r).withFont("");return wn(e.body,n,t)},mathmlBuilder(e,t){const r=kn[e.style],n=t.havingStyle(r),o=Tt(e.body,n),s=new yt("mstyle",o),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",i[0]),s.setAttribute("displaystyle",i[1]),s}});tt({type:"supsub",htmlBuilder(e,t){const r=function(e,t){const r=e.base;if(r)return"op"===r.type?r.limits&&(t.style.size===z.DISPLAY.size||r.alwaysHandleSupSub)?gn:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===z.DISPLAY.size||r.limits)?xn:null:"accent"===r.type?m(r.base)?jt:null:"horizBrace"===r.type&&!e.sub===r.isOver?hn:null;return null}(e,t);if(r)return r(e,t);const{base:n,sup:o,sub:s}=e,i=dt(n,t);let l,a;const c=t.fontMetrics();let h=0,u=0;const p=n&&m(n);if(o){const e=t.havingStyle(t.style.sup());l=dt(o,e,t),p||(h=i.height-e.fontMetrics().supDrop*e.sizeMultiplier/t.sizeMultiplier)}if(s){const e=t.havingStyle(t.style.sub());a=dt(s,e,t),p||(u=i.depth+e.fontMetrics().subDrop*e.sizeMultiplier/t.sizeMultiplier)}let d;d=t.style===z.DISPLAY?c.sup1:t.style.cramped?c.sup3:c.sup2;const g=t.sizeMultiplier,f=R(.5/c.ptPerEm/g);let b,y=null;if(a){const t=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(i instanceof U||t)&&(y=R(-i.italic))}if(l&&a){h=Math.max(h,d,l.depth+.25*c.xHeight),u=Math.max(u,c.sub2);const e=4*c.defaultRuleThickness;if(h-l.depth-(a.height-u)0&&(h+=t,u-=t)}b=Ve({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u,marginRight:f,marginLeft:y},{type:"elem",elem:l,shift:-h,marginRight:f}]})}else if(a){u=Math.max(u,c.sub1,a.height-.8*c.xHeight);b=Ve({positionType:"shift",positionData:u,children:[{type:"elem",elem:a,marginLeft:y,marginRight:f}]})}else{if(!l)throw new Error("supsub must have either sup or sub.");h=Math.max(h,d,l.depth+.25*c.xHeight),b=Ve({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:f}]})}const x=ut(i,"right")||"mord";return Oe([x],[i,Oe(["msupsub"],[b])],t)},mathmlBuilder(e,t){let r,n,o=!1;e.base&&"horizBrace"===e.base.type&&(n=!!e.sup,n===e.base.isOver&&(o=!0,r=e.base.isOver)),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);const s=[qt(e.base,t)];let i;if(e.sub&&s.push(qt(e.sub,t)),e.sup&&s.push(qt(e.sup,t)),o)i=r?"mover":"munder";else if(e.sub)if(e.sup){const r=e.base;i=r&&"op"===r.type&&r.limits&&t.style===z.DISPLAY||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(t.style===z.DISPLAY||r.limits)?"munderover":"msubsup"}else{const r=e.base;i=r&&"op"===r.type&&r.limits&&(t.style===z.DISPLAY||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.style===z.DISPLAY)?"munder":"msub"}else{const r=e.base;i=r&&"op"===r.type&&r.limits&&(t.style===z.DISPLAY||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.style===z.DISPLAY)?"mover":"msup"}return new yt(i,s)}}),tt({type:"atom",htmlBuilder(e,t){return Ce(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){const r=new yt("mo",[zt(e.text,e.mode)]);if("bin"===e.family){const n=Mt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});const zn={mi:"italic",mn:"normal",mtext:"normal"};tt({type:"mathord",htmlBuilder(e,t){return Ie(e,t,"mathord")},mathmlBuilder(e,t){const r=new yt("mi",[zt(e.text,e.mode,t)]),n=Mt(e,t)||"italic";return n!==zn[r.type]&&r.setAttribute("mathvariant",n),r}}),tt({type:"textord",htmlBuilder(e,t){return Ie(e,t,"textord")},mathmlBuilder(e,t){const r=zt(e.text,e.mode,t),n=Mt(e,t)||"normal";let o;return o="text"===e.mode?new yt("mtext",[r]):/[0-9]/.test(e.text)?new yt("mn",[r]):"\\prime"===e.text?new yt("mo",[r]):new yt("mi",[r]),n!==zn[o.type]&&o.setAttribute("mathvariant",n),o}});const Sn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Mn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};tt({type:"spacing",htmlBuilder(e,t){if(Mn.hasOwnProperty(e.text)){const r=Mn[e.text].className||"";if("text"===e.mode){const n=Ie(e,t,"textord");return n.classes.push(r),n}return Oe(["mspace",r],[Ce(e.text,e.mode,t)],t)}if(Sn.hasOwnProperty(e.text))return Oe(["mspace",Sn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){let r;if(!Mn.hasOwnProperty(e.text)){if(Sn.hasOwnProperty(e.text))return new yt("mspace");throw new n('Unknown type of space "'+e.text+'"')}return r=new yt("mtext",[new xt("\xa0")]),r}});const An=()=>{const e=new yt("mtd",[]);return e.setAttribute("width","50%"),e};tt({type:"tag",mathmlBuilder(e,t){const r=new yt("mtable",[new yt("mtr",[An(),new yt("mtd",[Bt(e.body,t)]),An(),new yt("mtd",[Bt(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});const Tn={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Bn={"\\textbf":"textbf","\\textmd":"textmd"},qn={"\\textit":"textit","\\textup":"textup"},Cn=(e,t)=>{const r=e.font;return r?Tn[r]?t.withTextFontFamily(Tn[r]):Bn[r]?t.withTextFontWeight(Bn[r]):"\\emph"===r?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(qn[r]):t};et({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"text",mode:r.mode,body:nt(o),font:n}},htmlBuilder(e,t){const r=Cn(e,t),n=at(e.body,r,!0);return Oe(["mord","text"],n,r)},mathmlBuilder(e,t){const r=Cn(e,t);return Bt(e.body,r)}}),et({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){const r=dt(e.body,t),n=De("underline-line",t),o=t.fontMetrics().defaultRuleThickness,s=Ve({positionType:"top",positionData:r.height,children:[{type:"kern",size:o},{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r}]});return Oe(["mord","underline"],[s],t)},mathmlBuilder(e,t){const r=new yt("mo",[new xt("\u203e")]);r.setAttribute("stretchy","true");const n=new yt("munder",[qt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),et({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){let{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){const r=dt(e.body,t),n=t.fontMetrics().axisHeight,o=.5*(r.height-n-(r.depth+n));return Ve({positionType:"shift",positionData:o,children:[{type:"elem",elem:r}]})},mathmlBuilder(e,t){return new yt("mpadded",[qt(e.body,t)],["vcenter"])}}),et({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){const r=In(e),n=[],o=t.havingStyle(t.style.text());for(let t=0;te.body.replace(/ /g,e.star?"\u2423":"\xa0");var Hn=Ke;const Rn="[ \r\n\t]",En="(\\\\[a-zA-Z@]+)"+Rn+"*",On="[\u0300-\u036f]",Nn=new RegExp(On+"+$"),Dn="("+Rn+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-\u2027\u202a-\ud7ff\uf900-\uffff]"+On+"*|[\ud800-\udbff][\udc00-\udfff]"+On+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+En+"|\\\\[^\ud800-\udfff])";class Ln{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(Dn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){const e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Wr("EOF",new Yr(this,t,t));const r=this.tokenRegex.exec(e);if(null===r||r.index!==t)throw new n("Unexpected character: '"+e[t]+"'",new Wr(e[t],new Yr(this,t,t+1)));const o=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[o]){const t=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===t?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=t+1,this.lex()}return new Wr(o,new Yr(this,t,this.tokenRegex.lastIndex))}}class Pn{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new n("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const e=this.undefStack.pop();for(const t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,r){if(void 0===r&&(r=!1),r){for(let t=0;t0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{const t=this.undefStack[this.undefStack.length-1];t&&!t.hasOwnProperty(e)&&(t[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Vn=Gr;Ur("\\noexpand",function(e){const t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Ur("\\expandafter",function(e){const t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Ur("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Ur("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Ur("\\@ifnextchar",function(e){const t=e.consumeArgs(3);e.consumeSpaces();const r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Ur("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Ur("\\TextOrMath",function(e){const t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});const Fn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Ur("\\char",function(e){let t,r=e.popToken(),o=0;if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if(r=e.popToken(),"\\"===r.text[0])o=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new n("\\char` missing argument");o=r.text.charCodeAt(0)}else t=10;if(t){if(o=Fn[r.text],null==o||o>=t)throw new n("Invalid base-"+t+" digit "+r.text);let s;for(;null!=(s=Fn[e.future().text])&&s{let s=e.consumeArg().tokens;if(1!==s.length)throw new n("\\newcommand's first argument must be a macro name");const i=s[0].text,l=e.isDefined(i);if(l&&!t)throw new n("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!l&&!r)throw new n("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");let a=0;if(s=e.consumeArg().tokens,1===s.length&&"["===s[0].text){let t="",r=e.expandNextToken();for(;"]"!==r.text&&"EOF"!==r.text;)t+=r.text,r=e.expandNextToken();if(!t.match(/^\s*[0-9]+\s*$/))throw new n("Invalid number of arguments: "+t);a=parseInt(t),s=e.consumeArg().tokens}return l&&o||e.macros.set(i,{tokens:s,numArgs:a}),""};Ur("\\newcommand",e=>Gn(e,!1,!0,!1)),Ur("\\renewcommand",e=>Gn(e,!0,!1,!1)),Ur("\\providecommand",e=>Gn(e,!0,!0,!0)),Ur("\\message",e=>{const t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Ur("\\errmessage",e=>{const t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Ur("\\show",e=>{const t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),Hn[r],re.math[r],re.text[r]),""}),Ur("\\bgroup","{"),Ur("\\egroup","}"),Ur("~","\\nobreakspace"),Ur("\\lq","`"),Ur("\\rq","'"),Ur("\\aa","\\r a"),Ur("\\AA","\\r A"),Ur("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xa9}"),Ur("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Ur("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xae}"),Ur("\u212c","\\mathscr{B}"),Ur("\u2130","\\mathscr{E}"),Ur("\u2131","\\mathscr{F}"),Ur("\u210b","\\mathscr{H}"),Ur("\u2110","\\mathscr{I}"),Ur("\u2112","\\mathscr{L}"),Ur("\u2133","\\mathscr{M}"),Ur("\u211b","\\mathscr{R}"),Ur("\u212d","\\mathfrak{C}"),Ur("\u210c","\\mathfrak{H}"),Ur("\u2128","\\mathfrak{Z}"),Ur("\\Bbbk","\\Bbb{k}"),Ur("\xb7","\\cdotp"),Ur("\\llap","\\mathllap{\\textrm{#1}}"),Ur("\\rlap","\\mathrlap{\\textrm{#1}}"),Ur("\\clap","\\mathclap{\\textrm{#1}}"),Ur("\\mathstrut","\\vphantom{(}"),Ur("\\underbar","\\underline{\\text{#1}}"),Ur("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),Ur("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),Ur("\\ne","\\neq"),Ur("\u2260","\\neq"),Ur("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),Ur("\u2209","\\notin"),Ur("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),Ur("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),Ur("\u225a","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225a}}"),Ur("\u225b","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225b}}"),Ur("\u225d","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225d}}"),Ur("\u225e","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225e}}"),Ur("\u225f","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225f}}"),Ur("\u27c2","\\perp"),Ur("\u203c","\\mathclose{!\\mkern-0.8mu!}"),Ur("\u220c","\\notni"),Ur("\u231c","\\ulcorner"),Ur("\u231d","\\urcorner"),Ur("\u231e","\\llcorner"),Ur("\u231f","\\lrcorner"),Ur("\xa9","\\copyright"),Ur("\xae","\\textregistered"),Ur("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Ur("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Ur("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Ur("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Ur("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Ur("\u22ee","\\vdots"),Ur("\\varGamma","\\mathit{\\Gamma}"),Ur("\\varDelta","\\mathit{\\Delta}"),Ur("\\varTheta","\\mathit{\\Theta}"),Ur("\\varLambda","\\mathit{\\Lambda}"),Ur("\\varXi","\\mathit{\\Xi}"),Ur("\\varPi","\\mathit{\\Pi}"),Ur("\\varSigma","\\mathit{\\Sigma}"),Ur("\\varUpsilon","\\mathit{\\Upsilon}"),Ur("\\varPhi","\\mathit{\\Phi}"),Ur("\\varPsi","\\mathit{\\Psi}"),Ur("\\varOmega","\\mathit{\\Omega}"),Ur("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Ur("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Ur("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Ur("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Ur("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Ur("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Ur("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Ur("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");const Un={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Yn=new Set(["bin","rel"]);Ur("\\dots",function(e){let t="\\dotso";const r=e.expandAfterFuture().text;return r in Un?t=Un[r]:("\\not"===r.slice(0,4)||r in re.math&&Yn.has(re.math[r].group))&&(t="\\dotsb"),t});const Wn={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Ur("\\dotso",function(e){return e.future().text in Wn?"\\ldots\\,":"\\ldots"}),Ur("\\dotsc",function(e){const t=e.future().text;return t in Wn&&","!==t?"\\ldots\\,":"\\ldots"}),Ur("\\cdots",function(e){return e.future().text in Wn?"\\@cdots\\,":"\\@cdots"}),Ur("\\dotsb","\\cdots"),Ur("\\dotsm","\\cdots"),Ur("\\dotsi","\\!\\cdots"),Ur("\\dotsx","\\ldots\\,"),Ur("\\DOTSI","\\relax"),Ur("\\DOTSB","\\relax"),Ur("\\DOTSX","\\relax"),Ur("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Ur("\\,","\\tmspace+{3mu}{.1667em}"),Ur("\\thinspace","\\,"),Ur("\\>","\\mskip{4mu}"),Ur("\\:","\\tmspace+{4mu}{.2222em}"),Ur("\\medspace","\\:"),Ur("\\;","\\tmspace+{5mu}{.2777em}"),Ur("\\thickspace","\\;"),Ur("\\!","\\tmspace-{3mu}{.1667em}"),Ur("\\negthinspace","\\!"),Ur("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Ur("\\negthickspace","\\tmspace-{5mu}{.277em}"),Ur("\\enspace","\\kern.5em "),Ur("\\enskip","\\hskip.5em\\relax"),Ur("\\quad","\\hskip1em\\relax"),Ur("\\qquad","\\hskip2em\\relax"),Ur("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Ur("\\tag@paren","\\tag@literal{({#1})}"),Ur("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new n("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Ur("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Ur("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Ur("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Ur("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Ur("\\newline","\\\\\\relax"),Ur("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");const Xn=R(_["Main-Regular"]["T".charCodeAt(0)][1]-.7*_["Main-Regular"]["A".charCodeAt(0)][1]);Ur("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Xn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Ur("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Xn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Ur("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Ur("\\@hspace","\\hskip #1\\relax"),Ur("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Ur("\\ordinarycolon",":"),Ur("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Ur("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Ur("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Ur("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Ur("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Ur("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Ur("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Ur("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Ur("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Ur("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Ur("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Ur("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Ur("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Ur("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Ur("\u2237","\\dblcolon"),Ur("\u2239","\\eqcolon"),Ur("\u2254","\\coloneqq"),Ur("\u2255","\\eqqcolon"),Ur("\u2a74","\\Coloneqq"),Ur("\\ratio","\\vcentcolon"),Ur("\\coloncolon","\\dblcolon"),Ur("\\colonequals","\\coloneqq"),Ur("\\coloncolonequals","\\Coloneqq"),Ur("\\equalscolon","\\eqqcolon"),Ur("\\equalscoloncolon","\\Eqqcolon"),Ur("\\colonminus","\\coloneq"),Ur("\\coloncolonminus","\\Coloneq"),Ur("\\minuscolon","\\eqcolon"),Ur("\\minuscoloncolon","\\Eqcolon"),Ur("\\coloncolonapprox","\\Colonapprox"),Ur("\\coloncolonsim","\\Colonsim"),Ur("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ur("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ur("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Ur("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Ur("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220c}}"),Ur("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Ur("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Ur("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Ur("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Ur("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Ur("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Ur("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Ur("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Ur("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Ur("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Ur("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Ur("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Ur("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Ur("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Ur("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Ur("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Ur("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Ur("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Ur("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228a}"),Ur("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2acb}"),Ur("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228b}"),Ur("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2acc}"),Ur("\\imath","\\html@mathml{\\@imath}{\u0131}"),Ur("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),Ur("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27e6}}"),Ur("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27e7}}"),Ur("\u27e6","\\llbracket"),Ur("\u27e7","\\rrbracket"),Ur("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Ur("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Ur("\u2983","\\lBrace"),Ur("\u2984","\\rBrace"),Ur("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29b5}}"),Ur("\u29b5","\\minuso"),Ur("\\darr","\\downarrow"),Ur("\\dArr","\\Downarrow"),Ur("\\Darr","\\Downarrow"),Ur("\\lang","\\langle"),Ur("\\rang","\\rangle"),Ur("\\uarr","\\uparrow"),Ur("\\uArr","\\Uparrow"),Ur("\\Uarr","\\Uparrow"),Ur("\\N","\\mathbb{N}"),Ur("\\R","\\mathbb{R}"),Ur("\\Z","\\mathbb{Z}"),Ur("\\alef","\\aleph"),Ur("\\alefsym","\\aleph"),Ur("\\Alpha","\\mathrm{A}"),Ur("\\Beta","\\mathrm{B}"),Ur("\\bull","\\bullet"),Ur("\\Chi","\\mathrm{X}"),Ur("\\clubs","\\clubsuit"),Ur("\\cnums","\\mathbb{C}"),Ur("\\Complex","\\mathbb{C}"),Ur("\\Dagger","\\ddagger"),Ur("\\diamonds","\\diamondsuit"),Ur("\\empty","\\emptyset"),Ur("\\Epsilon","\\mathrm{E}"),Ur("\\Eta","\\mathrm{H}"),Ur("\\exist","\\exists"),Ur("\\harr","\\leftrightarrow"),Ur("\\hArr","\\Leftrightarrow"),Ur("\\Harr","\\Leftrightarrow"),Ur("\\hearts","\\heartsuit"),Ur("\\image","\\Im"),Ur("\\infin","\\infty"),Ur("\\Iota","\\mathrm{I}"),Ur("\\isin","\\in"),Ur("\\Kappa","\\mathrm{K}"),Ur("\\larr","\\leftarrow"),Ur("\\lArr","\\Leftarrow"),Ur("\\Larr","\\Leftarrow"),Ur("\\lrarr","\\leftrightarrow"),Ur("\\lrArr","\\Leftrightarrow"),Ur("\\Lrarr","\\Leftrightarrow"),Ur("\\Mu","\\mathrm{M}"),Ur("\\natnums","\\mathbb{N}"),Ur("\\Nu","\\mathrm{N}"),Ur("\\Omicron","\\mathrm{O}"),Ur("\\plusmn","\\pm"),Ur("\\rarr","\\rightarrow"),Ur("\\rArr","\\Rightarrow"),Ur("\\Rarr","\\Rightarrow"),Ur("\\real","\\Re"),Ur("\\reals","\\mathbb{R}"),Ur("\\Reals","\\mathbb{R}"),Ur("\\Rho","\\mathrm{P}"),Ur("\\sdot","\\cdot"),Ur("\\sect","\\S"),Ur("\\spades","\\spadesuit"),Ur("\\sub","\\subset"),Ur("\\sube","\\subseteq"),Ur("\\supe","\\supseteq"),Ur("\\Tau","\\mathrm{T}"),Ur("\\thetasym","\\vartheta"),Ur("\\weierp","\\wp"),Ur("\\Zeta","\\mathrm{Z}"),Ur("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Ur("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Ur("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Ur("\\bra","\\mathinner{\\langle{#1}|}"),Ur("\\ket","\\mathinner{|{#1}\\rangle}"),Ur("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Ur("\\Bra","\\left\\langle#1\\right|"),Ur("\\Ket","\\left|#1\\right\\rangle");const jn=e=>t=>{const r=t.consumeArg().tokens,n=t.consumeArg().tokens,o=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();const a=t=>r=>{e&&(r.macros.set("|",i),o.length&&r.macros.set("\\|",l));let s=t;if(!t&&o.length){"|"===r.future().text&&(r.popToken(),s=!0)}return{tokens:s?o:n,numArgs:0}};t.macros.set("|",a(!1)),o.length&&t.macros.set("\\|",a(!0));const c=t.consumeArg().tokens,h=t.expandTokens([...s,...c,...r]);return t.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};Ur("\\bra@ket",jn(!1)),Ur("\\bra@set",jn(!0)),Ur("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Ur("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Ur("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Ur("\\angln","{\\angl n}"),Ur("\\blue","\\textcolor{##6495ed}{#1}"),Ur("\\orange","\\textcolor{##ffa500}{#1}"),Ur("\\pink","\\textcolor{##ff00af}{#1}"),Ur("\\red","\\textcolor{##df0030}{#1}"),Ur("\\green","\\textcolor{##28ae7b}{#1}"),Ur("\\gray","\\textcolor{gray}{#1}"),Ur("\\purple","\\textcolor{##9d38bd}{#1}"),Ur("\\blueA","\\textcolor{##ccfaff}{#1}"),Ur("\\blueB","\\textcolor{##80f6ff}{#1}"),Ur("\\blueC","\\textcolor{##63d9ea}{#1}"),Ur("\\blueD","\\textcolor{##11accd}{#1}"),Ur("\\blueE","\\textcolor{##0c7f99}{#1}"),Ur("\\tealA","\\textcolor{##94fff5}{#1}"),Ur("\\tealB","\\textcolor{##26edd5}{#1}"),Ur("\\tealC","\\textcolor{##01d1c1}{#1}"),Ur("\\tealD","\\textcolor{##01a995}{#1}"),Ur("\\tealE","\\textcolor{##208170}{#1}"),Ur("\\greenA","\\textcolor{##b6ffb0}{#1}"),Ur("\\greenB","\\textcolor{##8af281}{#1}"),Ur("\\greenC","\\textcolor{##74cf70}{#1}"),Ur("\\greenD","\\textcolor{##1fab54}{#1}"),Ur("\\greenE","\\textcolor{##0d923f}{#1}"),Ur("\\goldA","\\textcolor{##ffd0a9}{#1}"),Ur("\\goldB","\\textcolor{##ffbb71}{#1}"),Ur("\\goldC","\\textcolor{##ff9c39}{#1}"),Ur("\\goldD","\\textcolor{##e07d10}{#1}"),Ur("\\goldE","\\textcolor{##a75a05}{#1}"),Ur("\\redA","\\textcolor{##fca9a9}{#1}"),Ur("\\redB","\\textcolor{##ff8482}{#1}"),Ur("\\redC","\\textcolor{##f9685d}{#1}"),Ur("\\redD","\\textcolor{##e84d39}{#1}"),Ur("\\redE","\\textcolor{##bc2612}{#1}"),Ur("\\maroonA","\\textcolor{##ffbde0}{#1}"),Ur("\\maroonB","\\textcolor{##ff92c6}{#1}"),Ur("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Ur("\\maroonD","\\textcolor{##ca337c}{#1}"),Ur("\\maroonE","\\textcolor{##9e034e}{#1}"),Ur("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Ur("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Ur("\\purpleC","\\textcolor{##aa87ff}{#1}"),Ur("\\purpleD","\\textcolor{##7854ab}{#1}"),Ur("\\purpleE","\\textcolor{##543b78}{#1}"),Ur("\\mintA","\\textcolor{##f5f9e8}{#1}"),Ur("\\mintB","\\textcolor{##edf2df}{#1}"),Ur("\\mintC","\\textcolor{##e0e5cc}{#1}"),Ur("\\grayA","\\textcolor{##f6f7f7}{#1}"),Ur("\\grayB","\\textcolor{##f0f1f2}{#1}"),Ur("\\grayC","\\textcolor{##e3e5e6}{#1}"),Ur("\\grayD","\\textcolor{##d6d8da}{#1}"),Ur("\\grayE","\\textcolor{##babec2}{#1}"),Ur("\\grayF","\\textcolor{##888d93}{#1}"),Ur("\\grayG","\\textcolor{##626569}{#1}"),Ur("\\grayH","\\textcolor{##3b3e40}{#1}"),Ur("\\grayI","\\textcolor{##21242c}{#1}"),Ur("\\kaBlue","\\textcolor{##314453}{#1}"),Ur("\\kaGreen","\\textcolor{##71B307}{#1}");const _n={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class $n{constructor(e,t,r){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Pn(Vn,t.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new Ln(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){let t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:t,end:r}=this.consumeArg());return this.pushToken(new Wr("EOF",r.loc)),this.pushTokens(n),new Wr("",Yr.range(t,r))}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){const t=[],r=e&&e.length>0;r||this.consumeSpaces();const o=this.future();let s,i=0,l=0;do{if(s=this.popToken(),t.push(s),"{"===s.text)++i;else if("}"===s.text){if(--i,-1===i)throw new n("Extra }",s)}else if("EOF"===s.text)throw new n("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",s);if(e&&r)if((0===i||1===i&&"{"===e[l])&&s.text===e[l]){if(++l,l===e.length){t.splice(-l,l);break}}else l=0}while(0!==i||r);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new n("The length of delimiters doesn't match the number of args!");const r=t[0];for(let e=0;ethis.settings.maxExpand)throw new n("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){const t=this.popToken(),r=t.text,o=t.noexpand?null:this._getExpansion(r);if(null==o||e&&o.unexpandable){if(e&&null==o&&"\\"===r[0]&&!this.isDefined(r))throw new n("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);let s=o.tokens;const i=this.consumeArgs(o.numArgs,o.delimiters);if(o.numArgs){s=s.slice();for(let e=s.length-1;e>=0;--e){let t=s[e];if("#"===t.text){if(0===e)throw new n("Incomplete placeholder at end of macro body",t);if(t=s[--e],"#"===t.text)s.splice(e+1,1);else{if(!/^[1-9]$/.test(t.text))throw new n("Not a valid argument number",t);s.splice(e,2,...i[+t.text-1])}}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){const e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Wr(e)]):void 0}expandTokens(e){const t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(!1===this.expandOnce(!0)){const e=this.stack.pop();e.treatAsRelax&&(e.noexpand=!1,e.treatAsRelax=!1),t.push(e)}return this.countExpansion(t.length),t}expandMacroAsText(e){const t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){const t=this.macros.get(e);if(null==t)return t;if(1===e.length){const t=this.lexer.catcodes[e];if(null!=t&&13!==t)return}const r="function"==typeof t?t(this):t;if("string"==typeof r){let e=0;if(r.includes("#")){const t=r.replace(/##/g,"");for(;t.includes("#"+(e+1));)++e}const t=new Ln(r,this.settings),n=[];let o=t.lex();for(;"EOF"!==o.text;)n.push(o),o=t.lex();n.reverse();return{tokens:n,numArgs:e}}return r}isDefined(e){return this.macros.has(e)||Hn.hasOwnProperty(e)||re.math.hasOwnProperty(e)||re.text.hasOwnProperty(e)||_n.hasOwnProperty(e)}isExpandable(e){const t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Hn.hasOwnProperty(e)&&!Hn[e].primitive}}const Zn=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,Kn=Object.freeze({"\u208a":"+","\u208b":"-","\u208c":"=","\u208d":"(","\u208e":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1d62":"i","\u2c7c":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209a":"p","\u1d63":"r","\u209b":"s","\u209c":"t","\u1d64":"u","\u1d65":"v","\u2093":"x","\u1d66":"\u03b2","\u1d67":"\u03b3","\u1d68":"\u03c1","\u1d69":"\u03d5","\u1d6a":"\u03c7","\u207a":"+","\u207b":"-","\u207c":"=","\u207d":"(","\u207e":")","\u2070":"0","\xb9":"1","\xb2":"2","\xb3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1d2c":"A","\u1d2e":"B","\u1d30":"D","\u1d31":"E","\u1d33":"G","\u1d34":"H","\u1d35":"I","\u1d36":"J","\u1d37":"K","\u1d38":"L","\u1d39":"M","\u1d3a":"N","\u1d3c":"O","\u1d3e":"P","\u1d3f":"R","\u1d40":"T","\u1d41":"U","\u2c7d":"V","\u1d42":"W","\u1d43":"a","\u1d47":"b","\u1d9c":"c","\u1d48":"d","\u1d49":"e","\u1da0":"f","\u1d4d":"g","\u02b0":"h","\u2071":"i","\u02b2":"j","\u1d4f":"k","\u02e1":"l","\u1d50":"m","\u207f":"n","\u1d52":"o","\u1d56":"p","\u02b3":"r","\u02e2":"s","\u1d57":"t","\u1d58":"u","\u1d5b":"v","\u02b7":"w","\u02e3":"x","\u02b8":"y","\u1dbb":"z","\u1d5d":"\u03b2","\u1d5e":"\u03b3","\u1d5f":"\u03b4","\u1d60":"\u03d5","\u1d61":"\u03c7","\u1dbf":"\u03b8"}),Jn={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030c":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030a":{text:"\\r",math:"\\mathring"},"\u030b":{text:"\\H"},"\u0327":{text:"\\c"}},Qn={"\xe1":"a\u0301","\xe0":"a\u0300","\xe4":"a\u0308","\u01df":"a\u0308\u0304","\xe3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1eaf":"a\u0306\u0301","\u1eb1":"a\u0306\u0300","\u1eb5":"a\u0306\u0303","\u01ce":"a\u030c","\xe2":"a\u0302","\u1ea5":"a\u0302\u0301","\u1ea7":"a\u0302\u0300","\u1eab":"a\u0302\u0303","\u0227":"a\u0307","\u01e1":"a\u0307\u0304","\xe5":"a\u030a","\u01fb":"a\u030a\u0301","\u1e03":"b\u0307","\u0107":"c\u0301","\u1e09":"c\u0327\u0301","\u010d":"c\u030c","\u0109":"c\u0302","\u010b":"c\u0307","\xe7":"c\u0327","\u010f":"d\u030c","\u1e0b":"d\u0307","\u1e11":"d\u0327","\xe9":"e\u0301","\xe8":"e\u0300","\xeb":"e\u0308","\u1ebd":"e\u0303","\u0113":"e\u0304","\u1e17":"e\u0304\u0301","\u1e15":"e\u0304\u0300","\u0115":"e\u0306","\u1e1d":"e\u0327\u0306","\u011b":"e\u030c","\xea":"e\u0302","\u1ebf":"e\u0302\u0301","\u1ec1":"e\u0302\u0300","\u1ec5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1e1f":"f\u0307","\u01f5":"g\u0301","\u1e21":"g\u0304","\u011f":"g\u0306","\u01e7":"g\u030c","\u011d":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1e27":"h\u0308","\u021f":"h\u030c","\u0125":"h\u0302","\u1e23":"h\u0307","\u1e29":"h\u0327","\xed":"i\u0301","\xec":"i\u0300","\xef":"i\u0308","\u1e2f":"i\u0308\u0301","\u0129":"i\u0303","\u012b":"i\u0304","\u012d":"i\u0306","\u01d0":"i\u030c","\xee":"i\u0302","\u01f0":"j\u030c","\u0135":"j\u0302","\u1e31":"k\u0301","\u01e9":"k\u030c","\u0137":"k\u0327","\u013a":"l\u0301","\u013e":"l\u030c","\u013c":"l\u0327","\u1e3f":"m\u0301","\u1e41":"m\u0307","\u0144":"n\u0301","\u01f9":"n\u0300","\xf1":"n\u0303","\u0148":"n\u030c","\u1e45":"n\u0307","\u0146":"n\u0327","\xf3":"o\u0301","\xf2":"o\u0300","\xf6":"o\u0308","\u022b":"o\u0308\u0304","\xf5":"o\u0303","\u1e4d":"o\u0303\u0301","\u1e4f":"o\u0303\u0308","\u022d":"o\u0303\u0304","\u014d":"o\u0304","\u1e53":"o\u0304\u0301","\u1e51":"o\u0304\u0300","\u014f":"o\u0306","\u01d2":"o\u030c","\xf4":"o\u0302","\u1ed1":"o\u0302\u0301","\u1ed3":"o\u0302\u0300","\u1ed7":"o\u0302\u0303","\u022f":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030b","\u1e55":"p\u0301","\u1e57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030c","\u1e59":"r\u0307","\u0157":"r\u0327","\u015b":"s\u0301","\u1e65":"s\u0301\u0307","\u0161":"s\u030c","\u1e67":"s\u030c\u0307","\u015d":"s\u0302","\u1e61":"s\u0307","\u015f":"s\u0327","\u1e97":"t\u0308","\u0165":"t\u030c","\u1e6b":"t\u0307","\u0163":"t\u0327","\xfa":"u\u0301","\xf9":"u\u0300","\xfc":"u\u0308","\u01d8":"u\u0308\u0301","\u01dc":"u\u0308\u0300","\u01d6":"u\u0308\u0304","\u01da":"u\u0308\u030c","\u0169":"u\u0303","\u1e79":"u\u0303\u0301","\u016b":"u\u0304","\u1e7b":"u\u0304\u0308","\u016d":"u\u0306","\u01d4":"u\u030c","\xfb":"u\u0302","\u016f":"u\u030a","\u0171":"u\u030b","\u1e7d":"v\u0303","\u1e83":"w\u0301","\u1e81":"w\u0300","\u1e85":"w\u0308","\u0175":"w\u0302","\u1e87":"w\u0307","\u1e98":"w\u030a","\u1e8d":"x\u0308","\u1e8b":"x\u0307","\xfd":"y\u0301","\u1ef3":"y\u0300","\xff":"y\u0308","\u1ef9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1e8f":"y\u0307","\u1e99":"y\u030a","\u017a":"z\u0301","\u017e":"z\u030c","\u1e91":"z\u0302","\u017c":"z\u0307","\xc1":"A\u0301","\xc0":"A\u0300","\xc4":"A\u0308","\u01de":"A\u0308\u0304","\xc3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1eae":"A\u0306\u0301","\u1eb0":"A\u0306\u0300","\u1eb4":"A\u0306\u0303","\u01cd":"A\u030c","\xc2":"A\u0302","\u1ea4":"A\u0302\u0301","\u1ea6":"A\u0302\u0300","\u1eaa":"A\u0302\u0303","\u0226":"A\u0307","\u01e0":"A\u0307\u0304","\xc5":"A\u030a","\u01fa":"A\u030a\u0301","\u1e02":"B\u0307","\u0106":"C\u0301","\u1e08":"C\u0327\u0301","\u010c":"C\u030c","\u0108":"C\u0302","\u010a":"C\u0307","\xc7":"C\u0327","\u010e":"D\u030c","\u1e0a":"D\u0307","\u1e10":"D\u0327","\xc9":"E\u0301","\xc8":"E\u0300","\xcb":"E\u0308","\u1ebc":"E\u0303","\u0112":"E\u0304","\u1e16":"E\u0304\u0301","\u1e14":"E\u0304\u0300","\u0114":"E\u0306","\u1e1c":"E\u0327\u0306","\u011a":"E\u030c","\xca":"E\u0302","\u1ebe":"E\u0302\u0301","\u1ec0":"E\u0302\u0300","\u1ec4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1e1e":"F\u0307","\u01f4":"G\u0301","\u1e20":"G\u0304","\u011e":"G\u0306","\u01e6":"G\u030c","\u011c":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1e26":"H\u0308","\u021e":"H\u030c","\u0124":"H\u0302","\u1e22":"H\u0307","\u1e28":"H\u0327","\xcd":"I\u0301","\xcc":"I\u0300","\xcf":"I\u0308","\u1e2e":"I\u0308\u0301","\u0128":"I\u0303","\u012a":"I\u0304","\u012c":"I\u0306","\u01cf":"I\u030c","\xce":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1e30":"K\u0301","\u01e8":"K\u030c","\u0136":"K\u0327","\u0139":"L\u0301","\u013d":"L\u030c","\u013b":"L\u0327","\u1e3e":"M\u0301","\u1e40":"M\u0307","\u0143":"N\u0301","\u01f8":"N\u0300","\xd1":"N\u0303","\u0147":"N\u030c","\u1e44":"N\u0307","\u0145":"N\u0327","\xd3":"O\u0301","\xd2":"O\u0300","\xd6":"O\u0308","\u022a":"O\u0308\u0304","\xd5":"O\u0303","\u1e4c":"O\u0303\u0301","\u1e4e":"O\u0303\u0308","\u022c":"O\u0303\u0304","\u014c":"O\u0304","\u1e52":"O\u0304\u0301","\u1e50":"O\u0304\u0300","\u014e":"O\u0306","\u01d1":"O\u030c","\xd4":"O\u0302","\u1ed0":"O\u0302\u0301","\u1ed2":"O\u0302\u0300","\u1ed6":"O\u0302\u0303","\u022e":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030b","\u1e54":"P\u0301","\u1e56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030c","\u1e58":"R\u0307","\u0156":"R\u0327","\u015a":"S\u0301","\u1e64":"S\u0301\u0307","\u0160":"S\u030c","\u1e66":"S\u030c\u0307","\u015c":"S\u0302","\u1e60":"S\u0307","\u015e":"S\u0327","\u0164":"T\u030c","\u1e6a":"T\u0307","\u0162":"T\u0327","\xda":"U\u0301","\xd9":"U\u0300","\xdc":"U\u0308","\u01d7":"U\u0308\u0301","\u01db":"U\u0308\u0300","\u01d5":"U\u0308\u0304","\u01d9":"U\u0308\u030c","\u0168":"U\u0303","\u1e78":"U\u0303\u0301","\u016a":"U\u0304","\u1e7a":"U\u0304\u0308","\u016c":"U\u0306","\u01d3":"U\u030c","\xdb":"U\u0302","\u016e":"U\u030a","\u0170":"U\u030b","\u1e7c":"V\u0303","\u1e82":"W\u0301","\u1e80":"W\u0300","\u1e84":"W\u0308","\u0174":"W\u0302","\u1e86":"W\u0307","\u1e8c":"X\u0308","\u1e8a":"X\u0307","\xdd":"Y\u0301","\u1ef2":"Y\u0300","\u0178":"Y\u0308","\u1ef8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1e8e":"Y\u0307","\u0179":"Z\u0301","\u017d":"Z\u030c","\u1e90":"Z\u0302","\u017b":"Z\u0307","\u03ac":"\u03b1\u0301","\u1f70":"\u03b1\u0300","\u1fb1":"\u03b1\u0304","\u1fb0":"\u03b1\u0306","\u03ad":"\u03b5\u0301","\u1f72":"\u03b5\u0300","\u03ae":"\u03b7\u0301","\u1f74":"\u03b7\u0300","\u03af":"\u03b9\u0301","\u1f76":"\u03b9\u0300","\u03ca":"\u03b9\u0308","\u0390":"\u03b9\u0308\u0301","\u1fd2":"\u03b9\u0308\u0300","\u1fd1":"\u03b9\u0304","\u1fd0":"\u03b9\u0306","\u03cc":"\u03bf\u0301","\u1f78":"\u03bf\u0300","\u03cd":"\u03c5\u0301","\u1f7a":"\u03c5\u0300","\u03cb":"\u03c5\u0308","\u03b0":"\u03c5\u0308\u0301","\u1fe2":"\u03c5\u0308\u0300","\u1fe1":"\u03c5\u0304","\u1fe0":"\u03c5\u0306","\u03ce":"\u03c9\u0301","\u1f7c":"\u03c9\u0300","\u038e":"\u03a5\u0301","\u1fea":"\u03a5\u0300","\u03ab":"\u03a5\u0308","\u1fe9":"\u03a5\u0304","\u1fe8":"\u03a5\u0306","\u038f":"\u03a9\u0301","\u1ffa":"\u03a9\u0300"};class eo{constructor(e,t){this.mode="math",this.gullet=new $n(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new n("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{const e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){const t=this.nextToken;this.consume(),this.gullet.pushToken(new Wr("}")),this.gullet.pushTokens(e);const r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(e,t){const r=[];for(;;){"math"===this.mode&&this.consumeSpaces();const n=this.fetch();if(eo.endOfExpression.has(n.text))break;if(t&&n.text===t)break;if(e&&Hn[n.text]&&Hn[n.text].infix)break;const o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&r.push(o)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){let t,r=-1;for(let o=0;o=128))return null;this.settings.strict&&(A(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Yr.range(e),text:t}}if(this.consume(),r)for(let t=0;t{let t,e={messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],skipTags:["script","noscript","style","textarea","pre","code"]},skipStartupTypeset:!0};return{id:"mathjax2",init:function(n){t=n;let a=t.getConfig().mathjax2||t.getConfig().math||{},i={...e,...a},s=(i.mathjax||"https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js")+"?config="+(i.config||"TeX-AMS_HTML-full");i.tex2jax={...e.tex2jax,...a.tex2jax},i.mathjax=i.config=null,function(t,e){let n=document.querySelector("head"),a=document.createElement("script");a.type="text/javascript",a.src=t;let i=()=>{"function"==typeof e&&(e.call(),e=null)};a.onload=i,a.onreadystatechange=()=>{"loaded"===this.readyState&&i()},n.appendChild(a)}(s,(function(){MathJax.Hub.Config(i),MathJax.Hub.Queue(["Typeset",MathJax.Hub,t.getRevealElement()]),MathJax.Hub.Queue(t.layout),t.on("slidechanged",(function(t){MathJax.Hub.Queue(["Typeset",MathJax.Hub,t.currentSlide])}))}))}}},e=t;return Plugin=Object.assign(e(),{KaTeX:()=>{let t,e={version:"latest",delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],ignoredTags:["script","noscript","style","textarea","pre","code"]};const n=t=>new Promise(((e,n)=>{const a=document.createElement("script");a.type="text/javascript",a.onload=e,a.onerror=n,a.src=t,document.head.append(a)}));return{id:"katex",init:function(a){t=a;let i=t.getConfig().katex||{},s={...e,...i};const{local:o,version:l,extensions:c,...r}=s;let d=s.local||"https://cdn.jsdelivr.net/npm/katex",u=s.local?"":"@"+s.version,p=d+u+"/dist/katex.min.css",h=d+u+"/dist/contrib/mhchem.min.js",x=d+u+"/dist/contrib/auto-render.min.js",m=[d+u+"/dist/katex.min.js"];s.extensions&&s.extensions.includes("mhchem")&&m.push(h),m.push(x);const f=()=>{renderMathInElement(a.getSlidesElement(),r),t.layout()};(t=>{let e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.appendChild(e)})(p),async function(t){for(const e of t)await n(e)}(m).then((()=>{t.isReady()?f():t.on("ready",f.bind(this))}))}}},MathJax2:t,MathJax3:()=>{let t,e={tex:{inlineMath:[["$","$"],["\\(","\\)"]]},options:{skipHtmlTags:["script","noscript","style","textarea","pre","code"]},startup:{ready:()=>{MathJax.startup.defaultReady(),MathJax.startup.promise.then((()=>{t.layout()}))}}};return{id:"mathjax3",init:function(n){t=n;let a=t.getConfig().mathjax3||{},i={...e,...a};i.tex={...e.tex,...a.tex},i.options={...e.options,...a.options},i.startup={...e.startup,...a.startup};let s=i.mathjax||"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js";i.mathjax=null,window.MathJax=i,function(t,e){let n=document.createElement("script");n.type="text/javascript",n.id="MathJax-script",n.src=t,n.async=!0,n.onload=()=>{"function"==typeof e&&(e.call(),e=null)},document.head.appendChild(n)}(s,(function(){t.addEventListener("slidechanged",(function(t){MathJax.typeset()}))}))}}}})}));