Repository: WebReflection/highlighted-code Branch: main Commit: 9c39a28431c5 Files: 25 Total size: 5.1 MB Directory structure: gitextract_2dzjfsyh/ ├── .gitignore ├── .npmignore ├── .npmrc ├── LICENSE ├── README.md ├── cjs/ │ ├── index.js │ └── package.json ├── dedicated/ │ ├── sql.js │ └── web.js ├── esm/ │ └── index.js ├── index.js ├── min.js ├── package.json ├── rollup/ │ ├── es.config.js │ ├── index.config.js │ ├── sql.config.js │ └── web.config.js ├── sql.js ├── test/ │ ├── checker.html │ ├── demo.html │ ├── index.html │ ├── index.js │ ├── middle.html │ └── package.json └── web.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .DS_Store .nyc_output coverage/ node_modules/ ================================================ FILE: .npmignore ================================================ .DS_Store .nyc_output .eslintrc.json .travis.yml coverage/ node_modules/ rollup/ test/ ================================================ FILE: .npmrc ================================================ package-lock=false ================================================ FILE: LICENSE ================================================ ISC License Copyright (c) 2022, Andrea Giammarchi, @WebReflection Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: README.md ================================================ # highlighted-code A textarea builtin extend to automatically provide code highlights based on one of the languages available via [highlight.js](https://highlightjs.org/). **[Live demo](https://webreflection.github.io/highlighted-code/test/demo.html)** ```html ``` ## API The component is literally a [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) so everything that works or applies for this kind of element works and applies for this custom element too. The only extras attributes this component offer are: * **language**, reflected as `area.language` to define which kind of language should be highlighted. See the [list of supported languages here](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) (see those that don't require extra packages). * **tab-size**, reflected as `area.tabSize`, to determine the amount of virtual spaces covered by tabs. Because we live in a Mobile world, the default is `2`. * **auto-height**, reflected as `area.autoHeight`, to render the textarea as if it was a regular element. See the [test page](https://webreflection.github.io/highlighted-code/test/) as example, or set `autoHeight = true` in the live demo and see the area growing while typing. The exported `HighlightedCode` default class exposes these public methods/accessors: * `HighlightedCode.useTheme(name:string)` to bootstrap [any valid CSS theme](https://github.com/highlightjs/highlight.js/tree/main/src/styles) by name. This can also be a fully qualified URL to avoid CDN when desired. * `HighlightedCode.insertText(text:string)` to programmatically insert some text where the selection is. * `HighlightedCode.library:hljs` a getter to retrieve the imported [hljs library](https://highlightjs.org/), usable to register missing PLs or do something else. ## Exports The main export uses all default languages included in *highlight.js*, but there are other variants: * `highlighted-code/web`, which includes only Markdown, JS, TS, JSON, CSS, and HTML or XML * `highlighted-code/sql`, which includes only SQL These variants are much lighter than default module. ## F.A.Q.
How to disable editing?
You can either `textarea.disabled = true` or: ```html ```
How to disable spellcheck?
You can either `textarea.spellcheck = false` or: ```html ```
How to set cols or rows?
```html ```
How to set a placeholder?
```html ```
How to ...?
Look, this is [a custom element builtin extend](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example). If you know how and when to use a textarea, you're 90% done with this module. Now you need just the `is` attribute with value `highlighted-code`, a `language` attribute with a supported language from *highlight.js* library, optionally a `tab-size` attribute to have tabs wider than 2, and a theme, where `default` would work too, as long as `HighlightedCode.useTheme('default')` is invoked.
================================================ FILE: cjs/index.js ================================================ 'use strict'; const hljs = (m => /* c8 ignore start */ m.__esModule ? m.default : m /* c8 ignore stop */)(require('highlight.js')); /*! (c) Andrea Giammarchi - ISC */ const TAG = 'highlighted-code'; const targets = new WeakMap; const components = new Set; const options = {timeout: 300, box: 'border-box'}; const noIdle = typeof cancelIdleCallback !== 'function'; const setIdle = noIdle ? setTimeout : requestIdleCallback; const dropIdle = noIdle ? clearTimeout : cancelIdleCallback; const FF = typeof netscape === 'object'; let theme, resizeObserver; /** * A textarea builtin extend able to automatically highlight while the area is * being typed. Requires `HighlightedCode.useTheme('default')` call to actually * highlight the resulting code. * @example `` */ class HighlightedCode extends HTMLTextAreaElement { static get library() { return hljs; } static get observedAttributes() { return ['auto-height', 'disabled', 'language', 'tab-size']; } /** * Inserts some text where the selection is. * @param {string} text any text to insert. */ static insertText(text) { const {activeElement} = document; try { // they say it's deprecated, but it's the only one that works and // guarantees ctrl+z behavior ... no idea why anyone would remove this! if (!( text ? document.execCommand('insertText', false, text) : document.execCommand('delete') )) throw event; } catch(o_O) { const {selectionStart} = activeElement; activeElement.setRangeText(text); activeElement.selectionStart = activeElement.selectionEnd = selectionStart + text.length; } activeElement.oninput(); } /** * Automatically set a CSS theme for the highlighted code. * @param {string} name One of the themes from highlight.js or a css file to * point at. Names are like `default`, `github`, `tokio-night-dark` and so on * https://github.com/highlightjs/highlight.js/tree/main/src/styles */ static useTheme(name) { if (!theme) { theme = document.head.appendChild( document.createElement('link') ); theme.rel = 'stylesheet'; theme.addEventListener('load', () => { for (const textarea of document.querySelectorAll(`textarea[is="${TAG}"]`)) _backgroundColor.call(textarea); }); } theme.href = name.includes('.') ? name : `https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/${name}.min.css`; } constructor() { super(); this.idle = 0; const pre = this.ownerDocument.createElement('pre'); pre.className = TAG; pre.innerHTML = ''; targets.set(this, pre); this.style.cssText += ` tab-size: 2; white-space: pre; font-family: monospace; color: transparent; background-color: transparent; `; // setup internal class const {autoHeight, language, tabSize} = this; if (autoHeight) { delete this.autoHeight; this.autoHeight = autoHeight; } if (language) { delete this.language; this.language = language; } if (tabSize) { delete this.tabSize; this.tabSize = tabSize; } } /** * Avoid vertical scrollbar. * @type {boolean} */ get autoHeight() { return this.hasAttribute('auto-height'); } set autoHeight(value) { if (value) { this.style.resize = 'none'; this.setAttribute('auto-height', ''); } else { this.style.resize = null; this.removeAttribute('auto-height'); } } /** * The used language, compatible with hljs. * @type {string} */ get language() { return this.getAttribute('language'); } set language(name) { this.setAttribute('language', name); } /** * The tab-size value. * @type {string} */ get tabSize() { return this.getAttribute('tab-size'); } set tabSize(value) { this.setAttribute('tab-size', value); } /** * Set code to highlight. * @type {string} */ get value() { return super.value; } set value(code) { super.value = code; this.oninput(); } attributeChangedCallback(name, _, value) { switch (name) { case 'auto-height': this.style.height = null; if (value != null) { this.value = this.value.trimEnd(); _autoHeight.call(this); } break; case 'disabled': if (FF) targets.get(this).style.pointerEvents = this.disabled ? 'all' : 'none'; break; case 'language': let className = 'hljs'; if (value) className += ' language-' + value; targets.get(this).querySelector('code').className = className; break; case 'tab-size': this.style.tabSize = value; targets.get(this).style.tabSize = value; break; } } connectedCallback() { components.add(this); this.parentElement.insertBefore(targets.get(this), this.nextSibling); this.oninput(); _backgroundColor.call(this); resizeObserver.observe(this, options); this.addEventListener('keydown', this); this.addEventListener('scroll', this); this.addEventListener('input', this); } disconnectedCallback() { components.delete(this); targets.get(this).remove(); resizeObserver.unobserve(this); this.removeEventListener('keydown', this); this.removeEventListener('scroll', this); this.removeEventListener('input', this); } handleEvent(event) { this['on' + event.type](event); } onkeydown(event) { if (event.key === 'Tab') { HighlightedCode.insertText('\t'); event.preventDefault(); } } oninput() { dropIdle(this.idle); const idle = (this.idle = setIdle( () => { const {language, value} = this; const code = targets.get(this).querySelector('code'); // Please note no language is very slow! if (!language) code.className = 'hljs'; code.innerHTML = ( language ? hljs.highlight(value, {language}) : hljs.highlightAuto(value) ).value + '
'; this.onscroll(); if (idle === this.idle && this.autoHeight) _autoHeight.call(this); }, options )); } onscroll() { const {scrollTop, scrollLeft} = this; const pre = targets.get(this); pre.scrollTop = scrollTop; pre.scrollLeft = scrollLeft; // a very Firefox specific issue if (FF && 'scrollLeftMax' in pre) this.scrollLeft = Math.min(scrollLeft, pre.scrollLeftMax); } } if (!customElements.get(TAG)) { const onResize = entries => { for (const {target} of entries) { const pre = targets.get(target); const {border, font, letterSpacing, lineHeight, padding, wordSpacing} = getComputedStyle(target); const {top, left, width, height} = target.getBoundingClientRect(); pre.style.cssText = ` position: absolute; overflow: auto; box-sizing: border-box; pointer-events: ${(FF && target.disabled) ? 'all' : 'none'}; tab-size: ${target.tabSize || 2}; top: ${top + scrollY}px; left: ${left + scrollX}px; width: ${width}px; height: ${height}px; font: ${font}; letter-spacing: ${letterSpacing}; word-spacing: ${wordSpacing}; line-height: ${lineHeight}; padding: ${padding}; border: ${border}; margin: 0; background: initial; border-color: transparent; `; } }; addEventListener('resize', () => { const entries = []; for (const target of components) entries.push({target}); onResize(entries); }); resizeObserver = new ResizeObserver(onResize); customElements.define(TAG, HighlightedCode, {extends: 'textarea'}); } /** @type {HighlightedCode} */ module.exports = customElements.get(TAG); function _autoHeight() { this.style.height = 'auto'; const {boxSizing, borderTop, borderBottom, paddingTop, paddingBottom} = getComputedStyle(this); const paddingDiff = (parseFloat(paddingTop) || 0) + (parseFloat(paddingBottom) || 0); const borderDiff = (parseFloat(borderTop) || 0) + (parseFloat(borderBottom) || 0); const diff = boxSizing === 'border-box' ? -borderDiff : paddingDiff; this.style.height = `${this.scrollHeight - diff}px`; } function _backgroundColor() { const code = targets.get(this).querySelector('code'); code.style.backgroundColor = null; const {color, backgroundColor} = getComputedStyle(code); this.style.caretColor = color; this.style.backgroundColor = backgroundColor; code.style.cssText = ` background-color: transparent; overflow: unset; margin: 0; padding: 0; `; } ================================================ FILE: cjs/package.json ================================================ {"type":"commonjs"} ================================================ FILE: dedicated/sql.js ================================================ /*! Highlight.js v11.5.0 (git: 7a62552656) (c) 2006-2022 Ivan Sagalaev and other contributors License: BSD-3-Clause */ var hljs=function(){"use strict";var e={exports:{}};function t(e){ return e instanceof Map?e.clear=e.delete=e.set=()=>{ throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ throw Error("set is read-only") }),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((n=>{var i=e[n] ;"object"!=typeof i||Object.isFrozen(i)||t(i)})),e} e.exports=t,e.exports.default=t;var n=e.exports;class i{constructor(e){ void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} ignoreMatch(){this.isMatchIgnored=!0}}function r(e){ return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") }function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] ;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const o=e=>!!e.kind ;class a{constructor(e,t){ this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ this.buffer+=r(e)}openNode(e){if(!o(e))return;let t=e.kind ;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){ const n=e.split(".") ;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") }return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){ o(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ this.buffer+=``}}class c{constructor(){this.rootNode={ children:[]},this.stack=[this.rootNode]}get top(){ return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} ;this.add(t),this.stack.push(t)}closeNode(){ if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ "string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e} addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())} addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root ;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ return new a(this,this.options).value()}finalize(){return!0}}function g(e){ return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")} function u(e){return f("(?:",e,")*")}function h(e){return f("(?:",e,")?")} function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const t=(e=>{ const t=e[e.length-1] ;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} })(e);return"("+(t.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"} function b(e){return RegExp(e.toString()+"|").exec("").length-1} const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ ;function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n ;let i=g(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break} r+=i.substring(0,e.index), i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0], "("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)} const x="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",v={ begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", illegal:"\\n",contains:[v]},N={scope:"string",begin:'"',end:'"',illegal:"\\n", contains:[v]},M=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t, contains:[]},n);i.contains.push({scope:"doctag", begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) ;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) ;return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i },S=M("//","$"),R=M("/\\*","\\*/"),j=M("#","$");var A=Object.freeze({ __proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:x,UNDERSCORE_IDENT_RE:w, NUMBER_RE:y,C_NUMBER_RE:_,BINARY_NUMBER_RE:k, RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", SHEBANG:(e={})=>{const t=/^#![ ]*\// ;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t, end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, BACKSLASH_ESCAPE:v,APOS_STRING_MODE:O,QUOTE_STRING_MODE:N,PHRASAL_WORDS_MODE:{ begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ },COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:j, NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number", begin:_,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:k,relevance:0}, REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, end:/\/[gimuy]*/,illegal:/\n/,contains:[v,{begin:/\[/,end:/\]/,relevance:0, contains:[v]}]}]},TITLE_MODE:{scope:"title",begin:x,relevance:0}, UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0},METHOD_GUARD:{ begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ "on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function I(e,t){ "."===e.input[e.index-1]&&t.ignoreMatch()}function T(e,t){ void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,t){ t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, void 0===e.relevance&&(e.relevance=0))}function B(e,t){ Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function D(e,t){ if(e.match){ if(e.begin||e.end)throw Error("begin & end are not supported with match") ;e.begin=e.match,delete e.match}}function H(e,t){ void 0===e.relevance&&(e.relevance=1)}const P=(e,t)=>{if(!e.beforeMatch)return ;if(e.starts)throw Error("beforeMatch cannot be used with starts") ;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] })),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={ relevance:0,contains:[Object.assign(n,{endsParent:!0})] },e.relevance=0,delete n.beforeMatch },C=["of","and","for","in","not","or","if","then","parent","list","value"] ;function $(e,t,n="keyword"){const i=Object.create(null) ;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{ Object.assign(i,$(e[n],t,n))})),i;function r(e,n){ t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") ;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ return t?Number(t):(e=>C.includes(e.toLowerCase()))(e)?0:1}const z={},K=e=>{ console.error(e)},W=(e,...t)=>{console.log("WARN: "+e,...t)},X=(e,t)=>{ z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) },G=Error();function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={} ;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=b(t[e-1]) ;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function F(e){(e=>{ e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ _wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope }),(e=>{if(Array.isArray(e.begin)){ if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), G ;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), G;Z(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}})(e),(e=>{ if(Array.isArray(e.end)){ if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), G ;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), G;Z(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}})(e)}function V(e){ function t(t,n){ return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) }class n{constructor(){ this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} addRule(e,t){ t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), this.matchAt+=b(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) ;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(E(e,{joinWith:"|" }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex ;const t=this.matcherRe.exec(e);if(!t)return null ;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] ;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){ this.rules=[],this.multiRegexes=[], this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n ;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex ;let n=t.exec(e) ;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} return n&&(this.regexIndex+=n.position+1, this.regexIndex===this.count&&this.considerAll()),n}} if(e.compilerExtensions||(e.compilerExtensions=[]), e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") ;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r ;if(r.isCompiled)return a ;[T,D,F,P].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))), r.__beforeBegin=null,[L,B,H].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null ;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), c=r.keywords.$pattern, delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=$(r.keywords,e.case_insensitive)), a.keywordPatternRe=t(c,!0), o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), r.end&&(a.endRe=t(a.end)), a.terminatorEnd=g(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)), r.illegal&&(a.illegalRe=t(r.illegal)), r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{ variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?s(e,{ starts:e.starts?s(e.starts):null }):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a) })),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i ;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" }))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" }),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} const Y=r,Q=s,ee=Symbol("nomatch");var te=(e=>{ const t=Object.create(null),r=Object.create(null),s=[];let o=!0 ;const a="Could not find the language '{}', did you forget to load/include a language module?",c={ disableAutodetect:!0,name:"Plain text",contains:[]};let g={ ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", cssSelector:"pre code",languages:null,__emitter:l};function b(e){ return g.noHighlightRe.test(e)}function m(e,t,n){let i="",r="" ;"object"==typeof t?(i=e, n=t.ignoreIllegals,r=t.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."), X("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};N("before:highlight",s) ;const o=s.result?s.result:E(s.language,s.code,n) ;return o.code=s.code,N("after:highlight",o),o}function E(e,n,r,s){ const c=Object.create(null);function l(){if(!O.keywords)return void M.addText(S) ;let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(S),n="" ;for(;t;){n+=S.substring(e,t.index) ;const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,O.keywords[i]);if(s){ const[e,i]=s ;if(M.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{ const n=y.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0] ;e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(S)}var i ;n+=S.substr(e),M.addText(n)}function d(){null!=O.subLanguage?(()=>{ if(""===S)return;let e=null;if("string"==typeof O.subLanguage){ if(!t[O.subLanguage])return void M.addText(S) ;e=E(O.subLanguage,S,!0,N[O.subLanguage]),N[O.subLanguage]=e._top }else e=x(S,O.subLanguage.length?O.subLanguage:null) ;O.relevance>0&&(R+=e.relevance),M.addSublanguage(e._emitter,e.language) })():l(),S=""}function u(e,t){let n=1;const i=t.length-1;for(;n<=i;){ if(!e._emit[n]){n++;continue}const i=y.classNameAliases[e[n]]||e[n],r=t[n] ;i?M.addKeyword(r,i):(S=r,l(),S=""),n++}}function h(e,t){ return e.scope&&"string"==typeof e.scope&&M.openNode(y.classNameAliases[e.scope]||e.scope), e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), S=""):e.beginScope._multi&&(u(e.beginScope,t),S="")),O=Object.create(e,{parent:{ value:O}}),O}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t) ;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e) ;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){ for(;e.endsParent&&e.parent;)e=e.parent;return e}} if(e.endsWithParent)return f(e.parent,t,n)}function p(e){ return 0===O.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function b(e){ const t=e[0],i=n.substr(e.index),r=f(O,e,i);if(!r)return ee;const s=O ;O.endScope&&O.endScope._wrap?(d(), M.addKeyword(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(d(), u(O.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t), d(),s.excludeEnd&&(S=t));do{ O.scope&&M.closeNode(),O.skip||O.subLanguage||(R+=O.relevance),O=O.parent }while(O!==r.parent);return r.starts&&h(r.starts,e),s.returnEnd?0:t.length} let m={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return d(),0 ;if("begin"===m.type&&"end"===s.type&&m.index===s.index&&""===a){ if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`) ;throw t.languageName=e,t.badRule=m.rule,t}return 1} if(m=s,"begin"===s.type)return(e=>{ const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]] ;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return p(t) ;return n.skip?S+=t:(n.excludeBegin&&(S+=t), d(),n.returnBegin||n.excludeBegin||(S=t)),h(n,e),n.returnBegin?0:t.length})(s) ;if("illegal"===s.type&&!r){ const e=Error('Illegal lexeme "'+a+'" for mode "'+(O.scope||"")+'"') ;throw e.mode=O,e}if("end"===s.type){const e=b(s);if(e!==ee)return e} if("illegal"===s.type&&""===a)return 1 ;if(A>1e5&&A>3*s.index)throw Error("potential infinite loop, way more iterations than matches") ;return S+=a,a.length}const y=k(e) ;if(!y)throw K(a.replace("{}",e)),Error('Unknown language: "'+e+'"') ;const _=V(y);let v="",O=s||_;const N={},M=new g.__emitter(g);(()=>{const e=[] ;for(let t=O;t!==y;t=t.parent)t.scope&&e.unshift(t.scope) ;e.forEach((e=>M.openNode(e)))})();let S="",R=0,j=0,A=0,I=!1;try{ for(O.matcher.considerAll();;){ A++,I?I=!1:O.matcher.considerAll(),O.matcher.lastIndex=j ;const e=O.matcher.exec(n);if(!e)break;const t=w(n.substring(j,e.index),e) ;j=e.index+t}return w(n.substr(j)),M.closeAllNodes(),M.finalize(),v=M.toHTML(),{ language:e,value:v,relevance:R,illegal:!1,_emitter:M,_top:O}}catch(t){ if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), illegal:!0,relevance:0,_illegalBy:{message:t.message,index:j, context:n.slice(j-100,j+100),mode:t.mode,resultSoFar:v},_emitter:M};if(o)return{ language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:O} ;throw t}}function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{ const t={value:Y(e),illegal:!1,relevance:0,_top:c,_emitter:new g.__emitter(g)} ;return t._emitter.addText(e),t})(e),r=n.filter(k).filter(O).map((t=>E(t,e,!1))) ;r.unshift(i);const s=r.sort(((e,t)=>{ if(e.relevance!==t.relevance)return t.relevance-e.relevance ;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1 ;if(k(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,l=o ;return l.secondBest=a,l}function w(e){let t=null;const n=(e=>{ let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" ;const n=g.languageDetectRe.exec(t);if(n){const t=k(n[1]) ;return t||(W(a.replace("{}",n[1])), W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} return t.split(/\s+/).find((e=>b(e)||k(e)))})(e);if(b(n))return ;if(N("before:highlightElement",{el:e,language:n }),e.children.length>0&&(g.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(e)),g.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) ;t=e;const i=t.textContent,s=n?m(i,{language:n,ignoreIllegals:!0}):x(i) ;e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n ;e.classList.add("hljs"),e.classList.add("language-"+i) })(e,n,s.language),e.result={language:s.language,re:s.relevance, relevance:s.relevance},s.secondBest&&(e.secondBest={ language:s.secondBest.language,relevance:s.secondBest.relevance }),N("after:highlightElement",{el:e,result:s,text:i})}let y=!1;function _(){ "loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(w):y=!0 }function k(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]} function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ r[e.toLowerCase()]=t}))}function O(e){const t=k(e) ;return t&&!t.disableAutodetect}function N(e,t){const n=e;s.forEach((e=>{ e[n]&&e[n](t)}))} "undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ y&&_()}),!1),Object.assign(e,{highlight:m,highlightAuto:x,highlightAll:_, highlightElement:w, highlightBlock:e=>(X("10.7.0","highlightBlock will be removed entirely in v12.0"), X("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{g=Q(g,e)}, initHighlighting:()=>{ _(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, initHighlightingOnLoad:()=>{ _(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") },registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){ if(K("Language definition for '{}' could not be registered.".replace("{}",n)), !o)throw e;K(e),r=c} r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&v(r.aliases,{ languageName:n})},unregisterLanguage:e=>{delete t[e] ;for(const t of Object.keys(r))r[t]===e&&delete r[t]}, listLanguages:()=>Object.keys(t),getLanguage:k,registerAliases:v, autoDetection:O,inherit:Q,addPlugin:e=>{(e=>{ e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ e["before:highlightBlock"](Object.assign({block:t.el},t)) }),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} }),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0 },e.versionString="11.5.0",e.regex={concat:f,lookahead:d,either:p,optional:h, anyNumberOfTimes:u};for(const e in A)"object"==typeof A[e]&&n(A[e]) ;return Object.assign(e,A),e})({});return te}() ;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `sql` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict";return e=>{ const r=e.regex,t=e.COMMENT("--","$"),n=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=i,c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={ begin:r.concat(/\b/,r.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} ;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ $pattern:/\b[\w\.]+/,keyword:((e,{exceptions:r,when:t}={})=>{const n=t ;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e)) })(c,{when:e=>e.length<3}),literal:n,type:a, built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] },contains:[{begin:r.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, keyword:c.concat(s),literal:n,type:a}},{className:"type", begin:r.either("double precision","large object","with timezone","without timezone") },l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator", begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})() ;hljs.registerLanguage("sql",e)})(); ================================================ FILE: dedicated/web.js ================================================ /*! Highlight.js v11.5.0 (git: 7a62552656) (c) 2006-2022 Ivan Sagalaev and other contributors License: BSD-3-Clause */ var hljs=function(){"use strict";var e={exports:{}};function t(e){ return e instanceof Map?e.clear=e.delete=e.set=()=>{ throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ throw Error("set is read-only") }),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((n=>{var i=e[n] ;"object"!=typeof i||Object.isFrozen(i)||t(i)})),e} e.exports=t,e.exports.default=t;var n=e.exports;class i{constructor(e){ void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} ignoreMatch(){this.isMatchIgnored=!0}}function r(e){ return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") }function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] ;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const o=e=>!!e.kind ;class a{constructor(e,t){ this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ this.buffer+=r(e)}openNode(e){if(!o(e))return;let t=e.kind ;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){ const n=e.split(".") ;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") }return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){ o(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ this.buffer+=``}}class c{constructor(){this.rootNode={ children:[]},this.stack=[this.rootNode]}get top(){ return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} ;this.add(t),this.stack.push(t)}closeNode(){ if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ "string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e} addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())} addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root ;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ return new a(this,this.options).value()}finalize(){return!0}}function g(e){ return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")} function u(e){return f("(?:",e,")*")}function h(e){return f("(?:",e,")?")} function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const t=(e=>{ const t=e[e.length-1] ;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} })(e);return"("+(t.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"} function b(e){return RegExp(e.toString()+"|").exec("").length-1} const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ ;function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n ;let i=g(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break} r+=i.substring(0,e.index), i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0], "("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)} const x="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",k="\\b(0b[01]+)",v={ begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", illegal:"\\n",contains:[v]},N={scope:"string",begin:'"',end:'"',illegal:"\\n", contains:[v]},M=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t, contains:[]},n);i.contains.push({scope:"doctag", begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) ;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) ;return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i },S=M("//","$"),R=M("/\\*","\\*/"),j=M("#","$");var A=Object.freeze({ __proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:x,UNDERSCORE_IDENT_RE:w, NUMBER_RE:y,C_NUMBER_RE:_,BINARY_NUMBER_RE:k, RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", SHEBANG:(e={})=>{const t=/^#![ ]*\// ;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t, end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, BACKSLASH_ESCAPE:v,APOS_STRING_MODE:O,QUOTE_STRING_MODE:N,PHRASAL_WORDS_MODE:{ begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ },COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:j, NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number", begin:_,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:k,relevance:0}, REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, end:/\/[gimuy]*/,illegal:/\n/,contains:[v,{begin:/\[/,end:/\]/,relevance:0, contains:[v]}]}]},TITLE_MODE:{scope:"title",begin:x,relevance:0}, UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0},METHOD_GUARD:{ begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ "on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function I(e,t){ "."===e.input[e.index-1]&&t.ignoreMatch()}function T(e,t){ void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,t){ t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, void 0===e.relevance&&(e.relevance=0))}function B(e,t){ Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function D(e,t){ if(e.match){ if(e.begin||e.end)throw Error("begin & end are not supported with match") ;e.begin=e.match,delete e.match}}function H(e,t){ void 0===e.relevance&&(e.relevance=1)}const P=(e,t)=>{if(!e.beforeMatch)return ;if(e.starts)throw Error("beforeMatch cannot be used with starts") ;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] })),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={ relevance:0,contains:[Object.assign(n,{endsParent:!0})] },e.relevance=0,delete n.beforeMatch },C=["of","and","for","in","not","or","if","then","parent","list","value"] ;function $(e,t,n="keyword"){const i=Object.create(null) ;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{ Object.assign(i,$(e[n],t,n))})),i;function r(e,n){ t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") ;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ return t?Number(t):(e=>C.includes(e.toLowerCase()))(e)?0:1}const z={},K=e=>{ console.error(e)},W=(e,...t)=>{console.log("WARN: "+e,...t)},X=(e,t)=>{ z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) },G=Error();function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={} ;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=b(t[e-1]) ;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function F(e){(e=>{ e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ _wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope }),(e=>{if(Array.isArray(e.begin)){ if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), G ;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), G;Z(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}})(e),(e=>{ if(Array.isArray(e.end)){ if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), G ;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), G;Z(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}})(e)}function V(e){ function t(t,n){ return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) }class n{constructor(){ this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} addRule(e,t){ t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), this.matchAt+=b(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) ;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(E(e,{joinWith:"|" }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex ;const t=this.matcherRe.exec(e);if(!t)return null ;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] ;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){ this.rules=[],this.multiRegexes=[], this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n ;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex ;let n=t.exec(e) ;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} return n&&(this.regexIndex+=n.position+1, this.regexIndex===this.count&&this.considerAll()),n}} if(e.compilerExtensions||(e.compilerExtensions=[]), e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") ;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r ;if(r.isCompiled)return a ;[T,D,F,P].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))), r.__beforeBegin=null,[L,B,H].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null ;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), c=r.keywords.$pattern, delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=$(r.keywords,e.case_insensitive)), a.keywordPatternRe=t(c,!0), o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), r.end&&(a.endRe=t(a.end)), a.terminatorEnd=g(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)), r.illegal&&(a.illegalRe=t(r.illegal)), r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{ variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?s(e,{ starts:e.starts?s(e.starts):null }):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a) })),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i ;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" }))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" }),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} const Y=r,Q=s,ee=Symbol("nomatch");var te=(e=>{ const t=Object.create(null),r=Object.create(null),s=[];let o=!0 ;const a="Could not find the language '{}', did you forget to load/include a language module?",c={ disableAutodetect:!0,name:"Plain text",contains:[]};let g={ ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", cssSelector:"pre code",languages:null,__emitter:l};function b(e){ return g.noHighlightRe.test(e)}function m(e,t,n){let i="",r="" ;"object"==typeof t?(i=e, n=t.ignoreIllegals,r=t.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."), X("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};N("before:highlight",s) ;const o=s.result?s.result:E(s.language,s.code,n) ;return o.code=s.code,N("after:highlight",o),o}function E(e,n,r,s){ const c=Object.create(null);function l(){if(!O.keywords)return void M.addText(S) ;let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(S),n="" ;for(;t;){n+=S.substring(e,t.index) ;const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,O.keywords[i]);if(s){ const[e,i]=s ;if(M.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{ const n=y.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0] ;e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(S)}var i ;n+=S.substr(e),M.addText(n)}function d(){null!=O.subLanguage?(()=>{ if(""===S)return;let e=null;if("string"==typeof O.subLanguage){ if(!t[O.subLanguage])return void M.addText(S) ;e=E(O.subLanguage,S,!0,N[O.subLanguage]),N[O.subLanguage]=e._top }else e=x(S,O.subLanguage.length?O.subLanguage:null) ;O.relevance>0&&(R+=e.relevance),M.addSublanguage(e._emitter,e.language) })():l(),S=""}function u(e,t){let n=1;const i=t.length-1;for(;n<=i;){ if(!e._emit[n]){n++;continue}const i=y.classNameAliases[e[n]]||e[n],r=t[n] ;i?M.addKeyword(r,i):(S=r,l(),S=""),n++}}function h(e,t){ return e.scope&&"string"==typeof e.scope&&M.openNode(y.classNameAliases[e.scope]||e.scope), e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), S=""):e.beginScope._multi&&(u(e.beginScope,t),S="")),O=Object.create(e,{parent:{ value:O}}),O}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t) ;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e) ;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){ for(;e.endsParent&&e.parent;)e=e.parent;return e}} if(e.endsWithParent)return f(e.parent,t,n)}function p(e){ return 0===O.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function b(e){ const t=e[0],i=n.substr(e.index),r=f(O,e,i);if(!r)return ee;const s=O ;O.endScope&&O.endScope._wrap?(d(), M.addKeyword(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(d(), u(O.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t), d(),s.excludeEnd&&(S=t));do{ O.scope&&M.closeNode(),O.skip||O.subLanguage||(R+=O.relevance),O=O.parent }while(O!==r.parent);return r.starts&&h(r.starts,e),s.returnEnd?0:t.length} let m={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return d(),0 ;if("begin"===m.type&&"end"===s.type&&m.index===s.index&&""===a){ if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`) ;throw t.languageName=e,t.badRule=m.rule,t}return 1} if(m=s,"begin"===s.type)return(e=>{ const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]] ;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return p(t) ;return n.skip?S+=t:(n.excludeBegin&&(S+=t), d(),n.returnBegin||n.excludeBegin||(S=t)),h(n,e),n.returnBegin?0:t.length})(s) ;if("illegal"===s.type&&!r){ const e=Error('Illegal lexeme "'+a+'" for mode "'+(O.scope||"")+'"') ;throw e.mode=O,e}if("end"===s.type){const e=b(s);if(e!==ee)return e} if("illegal"===s.type&&""===a)return 1 ;if(A>1e5&&A>3*s.index)throw Error("potential infinite loop, way more iterations than matches") ;return S+=a,a.length}const y=k(e) ;if(!y)throw K(a.replace("{}",e)),Error('Unknown language: "'+e+'"') ;const _=V(y);let v="",O=s||_;const N={},M=new g.__emitter(g);(()=>{const e=[] ;for(let t=O;t!==y;t=t.parent)t.scope&&e.unshift(t.scope) ;e.forEach((e=>M.openNode(e)))})();let S="",R=0,j=0,A=0,I=!1;try{ for(O.matcher.considerAll();;){ A++,I?I=!1:O.matcher.considerAll(),O.matcher.lastIndex=j ;const e=O.matcher.exec(n);if(!e)break;const t=w(n.substring(j,e.index),e) ;j=e.index+t}return w(n.substr(j)),M.closeAllNodes(),M.finalize(),v=M.toHTML(),{ language:e,value:v,relevance:R,illegal:!1,_emitter:M,_top:O}}catch(t){ if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), illegal:!0,relevance:0,_illegalBy:{message:t.message,index:j, context:n.slice(j-100,j+100),mode:t.mode,resultSoFar:v},_emitter:M};if(o)return{ language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:O} ;throw t}}function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{ const t={value:Y(e),illegal:!1,relevance:0,_top:c,_emitter:new g.__emitter(g)} ;return t._emitter.addText(e),t})(e),r=n.filter(k).filter(O).map((t=>E(t,e,!1))) ;r.unshift(i);const s=r.sort(((e,t)=>{ if(e.relevance!==t.relevance)return t.relevance-e.relevance ;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1 ;if(k(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,l=o ;return l.secondBest=a,l}function w(e){let t=null;const n=(e=>{ let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" ;const n=g.languageDetectRe.exec(t);if(n){const t=k(n[1]) ;return t||(W(a.replace("{}",n[1])), W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} return t.split(/\s+/).find((e=>b(e)||k(e)))})(e);if(b(n))return ;if(N("before:highlightElement",{el:e,language:n }),e.children.length>0&&(g.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(e)),g.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) ;t=e;const i=t.textContent,s=n?m(i,{language:n,ignoreIllegals:!0}):x(i) ;e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n ;e.classList.add("hljs"),e.classList.add("language-"+i) })(e,n,s.language),e.result={language:s.language,re:s.relevance, relevance:s.relevance},s.secondBest&&(e.secondBest={ language:s.secondBest.language,relevance:s.secondBest.relevance }),N("after:highlightElement",{el:e,result:s,text:i})}let y=!1;function _(){ "loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(w):y=!0 }function k(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]} function v(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ r[e.toLowerCase()]=t}))}function O(e){const t=k(e) ;return t&&!t.disableAutodetect}function N(e,t){const n=e;s.forEach((e=>{ e[n]&&e[n](t)}))} "undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ y&&_()}),!1),Object.assign(e,{highlight:m,highlightAuto:x,highlightAll:_, highlightElement:w, highlightBlock:e=>(X("10.7.0","highlightBlock will be removed entirely in v12.0"), X("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{g=Q(g,e)}, initHighlighting:()=>{ _(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, initHighlightingOnLoad:()=>{ _(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") },registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){ if(K("Language definition for '{}' could not be registered.".replace("{}",n)), !o)throw e;K(e),r=c} r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&v(r.aliases,{ languageName:n})},unregisterLanguage:e=>{delete t[e] ;for(const t of Object.keys(r))r[t]===e&&delete r[t]}, listLanguages:()=>Object.keys(t),getLanguage:k,registerAliases:v, autoDetection:O,inherit:Q,addPlugin:e=>{(e=>{ e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ e["before:highlightBlock"](Object.assign({block:t.el},t)) }),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} }),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0 },e.versionString="11.5.0",e.regex={concat:f,lookahead:d,either:p,optional:h, anyNumberOfTimes:u};for(const e in A)"object"==typeof A[e]&&n(A[e]) ;return Object.assign(e,A),e})({});return te}() ;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `css` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict" ;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],r=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],t=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],o=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse() ;return n=>{const a=n.regex,l=(e=>({IMPORTANT:{scope:"meta",begin:"!important"}, BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number", begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{ className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{ scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ scope:"number", begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/} }))(n),s=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS", case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"}, classNameAliases:{keyframePosition:"selector-tag"},contains:[l.BLOCK_COMMENT,{ begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l.CSS_NUMBER_MODE,{ className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{ className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 },l.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ begin:":("+r.join("|")+")"},{begin:":(:)?("+t.join("|")+")"}]},l.CSS_VARIABLE,{ className:"attribute",begin:"\\b("+o.join("|")+")\\b"},{begin:/:/,end:/[;}{]/, contains:[l.BLOCK_COMMENT,l.HEXCOLOR,l.IMPORTANT,l.CSS_NUMBER_MODE,...s,{ begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" },contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}] },l.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0, illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{ begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{ $pattern:/[a-z-]+/,keyword:"and or not only",attribute:i.join(" ")},contains:[{ begin:/[a-z-]+(?=:)/,className:"attribute"},...s,l.CSS_NUMBER_MODE]}]},{ className:"selector-tag",begin:"\\b("+e.join("|")+")\\b"}]}}})() ;hljs.registerLanguage("css",e)})();/*! `javascript` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict" ;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s) ;return o=>{const l=o.regex,b=e,d={begin:/<[A-Za-z0-9\\._:-]+/, end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ const a=e[0].length+e.index,t=e.input[a] ;if("<"===t||","===t)return void n.ignoreMatch();let s ;">"===t&&(((e,{after:n})=>{const a="",M={ match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(C)], keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]} ;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{ PARAMS_CONTAINS:p,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/, contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ label:"use_strict",className:"meta",relevance:10, begin:/^\s*['"]use (strict|asm)['"]/ },o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,y,N,_,f,E,R,{className:"attr", begin:b+l.lookahead(":"),relevance:0},M,{ begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", keywords:"return throw case",relevance:0,contains:[f,o.REGEXP_MODE,{ className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{ className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{ className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, excludeEnd:!0,keywords:g,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/, relevance:0},{variants:[{begin:"<>",end:""},{ match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:d.begin, "on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{ begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},O,{ beginKeywords:"while if switch catch for"},{ begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", returnBegin:!0,label:"func.def",contains:[S,o.inherit(o.TITLE_MODE,{begin:b, className:"title.function"})]},{match:/\.\.\./,relevance:0},x,{match:"\\$"+b, relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, contains:[S]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, className:"variable.constant"},w,T,{match:/\$[(.]/}]}}})() ;hljs.registerLanguage("javascript",e)})();/*! `xml` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict";return e=>{ const a=e.regex,n=a.concat(/[A-Z_]/,a.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),s={ className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},t={begin:/\s/, contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] },i=e.inherit(t,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{ className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),r={ endsWithParent:!0,illegal:/`]+/}]}]}]};return{ name:"HTML, XML", aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], case_insensitive:!0,contains:[{className:"meta",begin://, relevance:10,contains:[t,l,c,i,{begin:/\[/,end:/\]/,contains:[{className:"meta", begin://,contains:[t,i,l,c]}]}]},e.COMMENT(//,{ relevance:10}),{begin://,relevance:10},s,{ className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l] },{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/, keywords:{name:"style"},contains:[r],starts:{end:/<\/style>/,returnEnd:!0, subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/, keywords:{name:"script"},contains:[r],starts:{end:/<\/script>/,returnEnd:!0, subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/ },{className:"tag", begin:a.concat(//,/>/,/\s/)))), end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:r}]},{ className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{ className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}} })();hljs.registerLanguage("xml",e)})();/*! `typescript` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict" ;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s) ;function o(o){const l=o.regex,d=e,b={begin:/<[A-Za-z0-9\\._:-]+/, end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ const a=e[0].length+e.index,t=e.input[a] ;if("<"===t||","===t)return void n.ignoreMatch();let s ;">"===t&&(((e,{after:n})=>{const a="",M={ match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,l.lookahead(T)], keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]} ;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:g,exports:{ PARAMS_CONTAINS:v,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/, contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ label:"use_strict",className:"meta",relevance:10, begin:/^\s*['"]use (strict|asm)['"]/ },o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,A,_,p,N,E,R,{className:"attr", begin:d+l.lookahead(":"),relevance:0},M,{ begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", keywords:"return throw case",relevance:0,contains:[N,o.REGEXP_MODE,{ className:"function",begin:T,returnBegin:!0,end:"\\s*=>",contains:[{ className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{ className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, excludeEnd:!0,keywords:g,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/, relevance:0},{variants:[{begin:"<>",end:""},{ match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:b.begin, "on:begin":b.isTrulyOpeningTag,end:b.end}],subLanguage:"xml",contains:[{ begin:b.begin,end:b.end,skip:!0,contains:["self"]}]}]},x,{ beginKeywords:"while if switch catch for"},{ begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", returnBegin:!0,label:"func.def",contains:[S,o.inherit(o.TITLE_MODE,{begin:d, className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+d, relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, contains:[S]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, className:"variable.constant"},w,C,{match:/\$[(.]/}]}}return t=>{ const s=o(t),r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],l={ beginKeywords:"namespace",end:/\{/,excludeEnd:!0, contains:[s.exports.CLASS_REFERENCE]},d={beginKeywords:"interface",end:/\{/, excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r}, contains:[s.exports.CLASS_REFERENCE]},b={$pattern:e, keyword:n.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]), literal:a,built_in:i.concat(r),"variable.language":c},g={className:"meta", begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},u=(e,n,a)=>{ const t=e.contains.findIndex((e=>e.label===n)) ;if(-1===t)throw Error("can not find mode to replace");e.contains.splice(t,1,a)} ;return Object.assign(s.keywords,b), s.exports.PARAMS_CONTAINS.push(g),s.contains=s.contains.concat([g,l,d]), u(s,"shebang",t.SHEBANG()),u(s,"use_strict",{className:"meta",relevance:10, begin:/^\s*['"]use strict['"]/ }),s.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(s,{ name:"TypeScript",aliases:["ts","tsx"]}),s}})() ;hljs.registerLanguage("typescript",e)})();/*! `markdown` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict";return e=>{const n={begin:/<\/?[A-Za-z_]/, end:">",subLanguage:"xml",relevance:0},a={variants:[{begin:/\[.+?\]\[.*?\]/, relevance:0},{ begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, relevance:2},{ begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/ },{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[], variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={ className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{ begin:/_(?!_)/,end:/_/,relevance:0}]},c=e.inherit(i,{contains:[] }),t=e.inherit(s,{contains:[]});i.contains.push(t),s.contains.push(c) ;let g=[n,a];return[i,s,c,t].forEach((e=>{e.contains=e.contains.concat(g) })),g=g.concat(i,s),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{ begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", contains:g}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:g, end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})() ;hljs.registerLanguage("markdown",e)})();/*! `json` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{"use strict";return e=>({name:"JSON",contains:[{ className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{ match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{ beginKeywords:"true false null" },e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}) })();hljs.registerLanguage("json",e)})(); ================================================ FILE: esm/index.js ================================================ import hljs from 'highlight.js'; /*! (c) Andrea Giammarchi - ISC */ const TAG = 'highlighted-code'; const targets = new WeakMap; const components = new Set; const options = {timeout: 300, box: 'border-box'}; const noIdle = typeof cancelIdleCallback !== 'function'; const setIdle = noIdle ? setTimeout : requestIdleCallback; const dropIdle = noIdle ? clearTimeout : cancelIdleCallback; const FF = typeof netscape === 'object'; let theme, resizeObserver; /** * A textarea builtin extend able to automatically highlight while the area is * being typed. Requires `HighlightedCode.useTheme('default')` call to actually * highlight the resulting code. * @example `` */ class HighlightedCode extends HTMLTextAreaElement { static get library() { return hljs; } static get observedAttributes() { return ['auto-height', 'disabled', 'language', 'tab-size']; } /** * Inserts some text where the selection is. * @param {string} text any text to insert. */ static insertText(text) { const {activeElement} = document; try { // they say it's deprecated, but it's the only one that works and // guarantees ctrl+z behavior ... no idea why anyone would remove this! if (!( text ? document.execCommand('insertText', false, text) : document.execCommand('delete') )) throw event; } catch(o_O) { const {selectionStart} = activeElement; activeElement.setRangeText(text); activeElement.selectionStart = activeElement.selectionEnd = selectionStart + text.length; } activeElement.oninput(); } /** * Automatically set a CSS theme for the highlighted code. * @param {string} name One of the themes from highlight.js or a css file to * point at. Names are like `default`, `github`, `tokio-night-dark` and so on * https://github.com/highlightjs/highlight.js/tree/main/src/styles */ static useTheme(name) { if (!theme) { theme = document.head.appendChild( document.createElement('link') ); theme.rel = 'stylesheet'; theme.addEventListener('load', () => { for (const textarea of document.querySelectorAll(`textarea[is="${TAG}"]`)) _backgroundColor.call(textarea); }); } theme.href = name.includes('.') ? name : `https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/${name}.min.css`; } constructor() { super(); this.idle = 0; const pre = this.ownerDocument.createElement('pre'); pre.className = TAG; pre.innerHTML = ''; targets.set(this, pre); this.style.cssText += ` tab-size: 2; white-space: pre; font-family: monospace; color: transparent; background-color: transparent; `; // setup internal class const {autoHeight, language, tabSize} = this; if (autoHeight) { delete this.autoHeight; this.autoHeight = autoHeight; } if (language) { delete this.language; this.language = language; } if (tabSize) { delete this.tabSize; this.tabSize = tabSize; } } /** * Avoid vertical scrollbar. * @type {boolean} */ get autoHeight() { return this.hasAttribute('auto-height'); } set autoHeight(value) { if (value) { this.style.resize = 'none'; this.setAttribute('auto-height', ''); } else { this.style.resize = null; this.removeAttribute('auto-height'); } } /** * The used language, compatible with hljs. * @type {string} */ get language() { return this.getAttribute('language'); } set language(name) { this.setAttribute('language', name); } /** * The tab-size value. * @type {string} */ get tabSize() { return this.getAttribute('tab-size'); } set tabSize(value) { this.setAttribute('tab-size', value); } /** * Set code to highlight. * @type {string} */ get value() { return super.value; } set value(code) { super.value = code; this.oninput(); } attributeChangedCallback(name, _, value) { switch (name) { case 'auto-height': this.style.height = null; if (value != null) { this.value = this.value.trimEnd(); _autoHeight.call(this); } break; case 'disabled': if (FF) targets.get(this).style.pointerEvents = this.disabled ? 'all' : 'none'; break; case 'language': let className = 'hljs'; if (value) className += ' language-' + value; targets.get(this).querySelector('code').className = className; break; case 'tab-size': this.style.tabSize = value; targets.get(this).style.tabSize = value; break; } } connectedCallback() { components.add(this); this.parentElement.insertBefore(targets.get(this), this.nextSibling); this.oninput(); _backgroundColor.call(this); resizeObserver.observe(this, options); this.addEventListener('keydown', this); this.addEventListener('scroll', this); this.addEventListener('input', this); } disconnectedCallback() { components.delete(this); targets.get(this).remove(); resizeObserver.unobserve(this); this.removeEventListener('keydown', this); this.removeEventListener('scroll', this); this.removeEventListener('input', this); } handleEvent(event) { this['on' + event.type](event); } onkeydown(event) { if (event.key === 'Tab') { HighlightedCode.insertText('\t'); event.preventDefault(); } } oninput() { dropIdle(this.idle); const idle = (this.idle = setIdle( () => { const {language, value} = this; const code = targets.get(this).querySelector('code'); // Please note no language is very slow! if (!language) code.className = 'hljs'; code.innerHTML = ( language ? hljs.highlight(value, {language}) : hljs.highlightAuto(value) ).value + '
'; this.onscroll(); if (idle === this.idle && this.autoHeight) _autoHeight.call(this); }, options )); } onscroll() { const {scrollTop, scrollLeft} = this; const pre = targets.get(this); pre.scrollTop = scrollTop; pre.scrollLeft = scrollLeft; // a very Firefox specific issue if (FF && 'scrollLeftMax' in pre) this.scrollLeft = Math.min(scrollLeft, pre.scrollLeftMax); } } if (!customElements.get(TAG)) { const onResize = entries => { for (const {target} of entries) { const pre = targets.get(target); const {border, font, letterSpacing, lineHeight, padding, wordSpacing} = getComputedStyle(target); const {top, left, width, height} = target.getBoundingClientRect(); pre.style.cssText = ` position: absolute; overflow: auto; box-sizing: border-box; pointer-events: ${(FF && target.disabled) ? 'all' : 'none'}; tab-size: ${target.tabSize || 2}; top: ${top + scrollY}px; left: ${left + scrollX}px; width: ${width}px; height: ${height}px; font: ${font}; letter-spacing: ${letterSpacing}; word-spacing: ${wordSpacing}; line-height: ${lineHeight}; padding: ${padding}; border: ${border}; margin: 0; background: initial; border-color: transparent; `; } }; addEventListener('resize', () => { const entries = []; for (const target of components) entries.push({target}); onResize(entries); }); resizeObserver = new ResizeObserver(onResize); customElements.define(TAG, HighlightedCode, {extends: 'textarea'}); } /** @type {HighlightedCode} */ export default customElements.get(TAG); function _autoHeight() { this.style.height = 'auto'; const {boxSizing, borderTop, borderBottom, paddingTop, paddingBottom} = getComputedStyle(this); const paddingDiff = (parseFloat(paddingTop) || 0) + (parseFloat(paddingBottom) || 0); const borderDiff = (parseFloat(borderTop) || 0) + (parseFloat(borderBottom) || 0); const diff = boxSizing === 'border-box' ? -borderDiff : paddingDiff; this.style.height = `${this.scrollHeight - diff}px`; } function _backgroundColor() { const code = targets.get(this).querySelector('code'); code.style.backgroundColor = null; const {color, backgroundColor} = getComputedStyle(code); this.style.caretColor = color; this.style.backgroundColor = backgroundColor; code.style.cssText = ` background-color: transparent; overflow: unset; margin: 0; padding: 0; `; } ================================================ FILE: index.js ================================================ var deepFreezeEs6 = {exports: {}}; function deepFreeze(obj) { if (obj instanceof Map) { obj.clear = obj.delete = obj.set = function () { throw new Error('map is read-only'); }; } else if (obj instanceof Set) { obj.add = obj.clear = obj.delete = function () { throw new Error('set is read-only'); }; } // Freeze self Object.freeze(obj); Object.getOwnPropertyNames(obj).forEach(function (name) { var prop = obj[name]; // Freeze prop if it is an object if (typeof prop == 'object' && !Object.isFrozen(prop)) { deepFreeze(prop); } }); return obj; } deepFreezeEs6.exports = deepFreeze; deepFreezeEs6.exports.default = deepFreeze; var deepFreeze$1 = deepFreezeEs6.exports; /** @typedef {import('highlight.js').CallbackResponse} CallbackResponse */ /** @typedef {import('highlight.js').CompiledMode} CompiledMode */ /** @implements CallbackResponse */ class Response { /** * @param {CompiledMode} mode */ constructor(mode) { // eslint-disable-next-line no-undefined if (mode.data === undefined) mode.data = {}; this.data = mode.data; this.isMatchIgnored = false; } ignoreMatch() { this.isMatchIgnored = true; } } /** * @param {string} value * @returns {string} */ function escapeHTML(value) { return value .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); } /** * performs a shallow merge of multiple objects into one * * @template T * @param {T} original * @param {Record[]} objects * @returns {T} a single new object */ function inherit$1(original, ...objects) { /** @type Record */ const result = Object.create(null); for (const key in original) { result[key] = original[key]; } objects.forEach(function(obj) { for (const key in obj) { result[key] = obj[key]; } }); return /** @type {T} */ (result); } /** * @typedef {object} Renderer * @property {(text: string) => void} addText * @property {(node: Node) => void} openNode * @property {(node: Node) => void} closeNode * @property {() => string} value */ /** @typedef {{kind?: string, sublanguage?: boolean}} Node */ /** @typedef {{walk: (r: Renderer) => void}} Tree */ /** */ const SPAN_CLOSE = '
'; /** * Determines if a node needs to be wrapped in * * @param {Node} node */ const emitsWrappingTags = (node) => { return !!node.kind; }; /** * * @param {string} name * @param {{prefix:string}} options */ const expandScopeName = (name, { prefix }) => { if (name.includes(".")) { const pieces = name.split("."); return [ `${prefix}${pieces.shift()}`, ...(pieces.map((x, i) => `${x}${"_".repeat(i + 1)}`)) ].join(" "); } return `${prefix}${name}`; }; /** @type {Renderer} */ class HTMLRenderer { /** * Creates a new HTMLRenderer * * @param {Tree} parseTree - the parse tree (must support `walk` API) * @param {{classPrefix: string}} options */ constructor(parseTree, options) { this.buffer = ""; this.classPrefix = options.classPrefix; parseTree.walk(this); } /** * Adds texts to the output stream * * @param {string} text */ addText(text) { this.buffer += escapeHTML(text); } /** * Adds a node open to the output stream (if needed) * * @param {Node} node */ openNode(node) { if (!emitsWrappingTags(node)) return; let scope = node.kind; if (node.sublanguage) { scope = `language-${scope}`; } else { scope = expandScopeName(scope, { prefix: this.classPrefix }); } this.span(scope); } /** * Adds a node close to the output stream (if needed) * * @param {Node} node */ closeNode(node) { if (!emitsWrappingTags(node)) return; this.buffer += SPAN_CLOSE; } /** * returns the accumulated buffer */ value() { return this.buffer; } // helpers /** * Builds a span element * * @param {string} className */ span(className) { this.buffer += ``; } } /** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} | string} Node */ /** @typedef {{kind?: string, sublanguage?: boolean, children: Node[]} } DataNode */ /** @typedef {import('highlight.js').Emitter} Emitter */ /** */ class TokenTree { constructor() { /** @type DataNode */ this.rootNode = { children: [] }; this.stack = [this.rootNode]; } get top() { return this.stack[this.stack.length - 1]; } get root() { return this.rootNode; } /** @param {Node} node */ add(node) { this.top.children.push(node); } /** @param {string} kind */ openNode(kind) { /** @type Node */ const node = { kind, children: [] }; this.add(node); this.stack.push(node); } closeNode() { if (this.stack.length > 1) { return this.stack.pop(); } // eslint-disable-next-line no-undefined return undefined; } closeAllNodes() { while (this.closeNode()); } toJSON() { return JSON.stringify(this.rootNode, null, 4); } /** * @typedef { import("./html_renderer").Renderer } Renderer * @param {Renderer} builder */ walk(builder) { // this does not return this.constructor._walk(builder, this.rootNode); // this works // return TokenTree._walk(builder, this.rootNode); } /** * @param {Renderer} builder * @param {Node} node */ static _walk(builder, node) { if (typeof node === "string") { builder.addText(node); } else if (node.children) { builder.openNode(node); node.children.forEach((child) => this._walk(builder, child)); builder.closeNode(node); } return builder; } /** * @param {Node} node */ static _collapse(node) { if (typeof node === "string") return; if (!node.children) return; if (node.children.every(el => typeof el === "string")) { // node.text = node.children.join(""); // delete node.children; node.children = [node.children.join("")]; } else { node.children.forEach((child) => { TokenTree._collapse(child); }); } } } /** Currently this is all private API, but this is the minimal API necessary that an Emitter must implement to fully support the parser. Minimal interface: - addKeyword(text, kind) - addText(text) - addSublanguage(emitter, subLanguageName) - finalize() - openNode(kind) - closeNode() - closeAllNodes() - toHTML() */ /** * @implements {Emitter} */ class TokenTreeEmitter extends TokenTree { /** * @param {*} options */ constructor(options) { super(); this.options = options; } /** * @param {string} text * @param {string} kind */ addKeyword(text, kind) { if (text === "") { return; } this.openNode(kind); this.addText(text); this.closeNode(); } /** * @param {string} text */ addText(text) { if (text === "") { return; } this.add(text); } /** * @param {Emitter & {root: DataNode}} emitter * @param {string} name */ addSublanguage(emitter, name) { /** @type DataNode */ const node = emitter.root; node.kind = name; node.sublanguage = true; this.add(node); } toHTML() { const renderer = new HTMLRenderer(this, this.options); return renderer.value(); } finalize() { return true; } } /** * @param {string} value * @returns {RegExp} * */ /** * @param {RegExp | string } re * @returns {string} */ function source(re) { if (!re) return null; if (typeof re === "string") return re; return re.source; } /** * @param {RegExp | string } re * @returns {string} */ function lookahead(re) { return concat('(?=', re, ')'); } /** * @param {RegExp | string } re * @returns {string} */ function anyNumberOfTimes(re) { return concat('(?:', re, ')*'); } /** * @param {RegExp | string } re * @returns {string} */ function optional(re) { return concat('(?:', re, ')?'); } /** * @param {...(RegExp | string) } args * @returns {string} */ function concat(...args) { const joined = args.map((x) => source(x)).join(""); return joined; } /** * @param { Array } args * @returns {object} */ function stripOptionsFromArgs(args) { const opts = args[args.length - 1]; if (typeof opts === 'object' && opts.constructor === Object) { args.splice(args.length - 1, 1); return opts; } else { return {}; } } /** @typedef { {capture?: boolean} } RegexEitherOptions */ /** * Any of the passed expresssions may match * * Creates a huge this | this | that | that match * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args * @returns {string} */ function either(...args) { /** @type { object & {capture?: boolean} } */ const opts = stripOptionsFromArgs(args); const joined = '(' + (opts.capture ? "" : "?:") + args.map((x) => source(x)).join("|") + ")"; return joined; } /** * @param {RegExp | string} re * @returns {number} */ function countMatchGroups(re) { return (new RegExp(re.toString() + '|')).exec('').length - 1; } /** * Does lexeme start with a regular expression match at the beginning * @param {RegExp} re * @param {string} lexeme */ function startsWith(re, lexeme) { const match = re && re.exec(lexeme); return match && match.index === 0; } // BACKREF_RE matches an open parenthesis or backreference. To avoid // an incorrect parse, it additionally matches the following: // - [...] elements, where the meaning of parentheses and escapes change // - other escape sequences, so we do not misparse escape sequences as // interesting elements // - non-matching or lookahead parentheses, which do not capture. These // follow the '(' with a '?'. const BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; // **INTERNAL** Not intended for outside usage // join logically computes regexps.join(separator), but fixes the // backreferences so they continue to match. // it also places each individual regular expression into it's own // match group, keeping track of the sequencing of those match groups // is currently an exercise for the caller. :-) /** * @param {(string | RegExp)[]} regexps * @param {{joinWith: string}} opts * @returns {string} */ function _rewriteBackreferences(regexps, { joinWith }) { let numCaptures = 0; return regexps.map((regex) => { numCaptures += 1; const offset = numCaptures; let re = source(regex); let out = ''; while (re.length > 0) { const match = BACKREF_RE.exec(re); if (!match) { out += re; break; } out += re.substring(0, match.index); re = re.substring(match.index + match[0].length); if (match[0][0] === '\\' && match[1]) { // Adjust the backreference. out += '\\' + String(Number(match[1]) + offset); } else { out += match[0]; if (match[0] === '(') { numCaptures++; } } } return out; }).map(re => `(${re})`).join(joinWith); } /** @typedef {import('highlight.js').Mode} Mode */ /** @typedef {import('highlight.js').ModeCallback} ModeCallback */ // Common regexps const MATCH_NOTHING_RE = /\b\B/; const IDENT_RE = '[a-zA-Z]\\w*'; const UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*'; const NUMBER_RE = '\\b\\d+(\\.\\d+)?'; const C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float const BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b... const RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'; /** * @param { Partial & {binary?: string | RegExp} } opts */ const SHEBANG = (opts = {}) => { const beginShebang = /^#![ ]*\//; if (opts.binary) { opts.begin = concat( beginShebang, /.*\b/, opts.binary, /\b.*/); } return inherit$1({ scope: 'meta', begin: beginShebang, end: /$/, relevance: 0, /** @type {ModeCallback} */ "on:begin": (m, resp) => { if (m.index !== 0) resp.ignoreMatch(); } }, opts); }; // Common modes const BACKSLASH_ESCAPE = { begin: '\\\\[\\s\\S]', relevance: 0 }; const APOS_STRING_MODE = { scope: 'string', begin: '\'', end: '\'', illegal: '\\n', contains: [BACKSLASH_ESCAPE] }; const QUOTE_STRING_MODE = { scope: 'string', begin: '"', end: '"', illegal: '\\n', contains: [BACKSLASH_ESCAPE] }; const PHRASAL_WORDS_MODE = { begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ }; /** * Creates a comment mode * * @param {string | RegExp} begin * @param {string | RegExp} end * @param {Mode | {}} [modeOptions] * @returns {Partial} */ const COMMENT = function(begin, end, modeOptions = {}) { const mode = inherit$1( { scope: 'comment', begin, end, contains: [] }, modeOptions ); mode.contains.push({ scope: 'doctag', // hack to avoid the space from being included. the space is necessary to // match here to prevent the plain text rule below from gobbling up doctags begin: '[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)', end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/, excludeBegin: true, relevance: 0 }); const ENGLISH_WORD = either( // list of common 1 and 2 letter words in English "I", "a", "is", "so", "us", "to", "at", "if", "in", "it", "on", // note: this is not an exhaustive list of contractions, just popular ones /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, // contractions - can't we'd they're let's, etc /[A-Za-z]+[-][a-z]+/, // `no-way`, etc. /[A-Za-z][a-z]{2,}/ // allow capitalized words at beginning of sentences ); // looking like plain text, more likely to be a comment mode.contains.push( { // TODO: how to include ", (, ) without breaking grammars that use these for // comment delimiters? // begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/ // --- // this tries to find sequences of 3 english words in a row (without any // "programming" type syntax) this gives us a strong signal that we've // TRULY found a comment - vs perhaps scanning with the wrong language. // It's possible to find something that LOOKS like the start of the // comment - but then if there is no readable text - good chance it is a // false match and not a comment. // // for a visual example please see: // https://github.com/highlightjs/highlight.js/issues/2827 begin: concat( /[ ]+/, // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */ '(', ENGLISH_WORD, /[.]?[:]?([.][ ]|[ ])/, '){3}') // look for 3 words in a row } ); return mode; }; const C_LINE_COMMENT_MODE = COMMENT('//', '$'); const C_BLOCK_COMMENT_MODE = COMMENT('/\\*', '\\*/'); const HASH_COMMENT_MODE = COMMENT('#', '$'); const NUMBER_MODE = { scope: 'number', begin: NUMBER_RE, relevance: 0 }; const C_NUMBER_MODE = { scope: 'number', begin: C_NUMBER_RE, relevance: 0 }; const BINARY_NUMBER_MODE = { scope: 'number', begin: BINARY_NUMBER_RE, relevance: 0 }; const REGEXP_MODE = { // this outer rule makes sure we actually have a WHOLE regex and not simply // an expression such as: // // 3 / something // // (which will then blow up when regex's `illegal` sees the newline) begin: /(?=\/[^/\n]*\/)/, contains: [{ scope: 'regexp', begin: /\//, end: /\/[gimuy]*/, illegal: /\n/, contains: [ BACKSLASH_ESCAPE, { begin: /\[/, end: /\]/, relevance: 0, contains: [BACKSLASH_ESCAPE] } ] }] }; const TITLE_MODE = { scope: 'title', begin: IDENT_RE, relevance: 0 }; const UNDERSCORE_TITLE_MODE = { scope: 'title', begin: UNDERSCORE_IDENT_RE, relevance: 0 }; const METHOD_GUARD = { // excludes method names from keyword processing begin: '\\.\\s*' + UNDERSCORE_IDENT_RE, relevance: 0 }; /** * Adds end same as begin mechanics to a mode * * Your mode must include at least a single () match group as that first match * group is what is used for comparison * @param {Partial} mode */ const END_SAME_AS_BEGIN = function(mode) { return Object.assign(mode, { /** @type {ModeCallback} */ 'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; }, /** @type {ModeCallback} */ 'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); } }); }; var MODES = /*#__PURE__*/Object.freeze({ __proto__: null, MATCH_NOTHING_RE: MATCH_NOTHING_RE, IDENT_RE: IDENT_RE, UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE, NUMBER_RE: NUMBER_RE, C_NUMBER_RE: C_NUMBER_RE, BINARY_NUMBER_RE: BINARY_NUMBER_RE, RE_STARTERS_RE: RE_STARTERS_RE, SHEBANG: SHEBANG, BACKSLASH_ESCAPE: BACKSLASH_ESCAPE, APOS_STRING_MODE: APOS_STRING_MODE, QUOTE_STRING_MODE: QUOTE_STRING_MODE, PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE, COMMENT: COMMENT, C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE, C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE, HASH_COMMENT_MODE: HASH_COMMENT_MODE, NUMBER_MODE: NUMBER_MODE, C_NUMBER_MODE: C_NUMBER_MODE, BINARY_NUMBER_MODE: BINARY_NUMBER_MODE, REGEXP_MODE: REGEXP_MODE, TITLE_MODE: TITLE_MODE, UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE, METHOD_GUARD: METHOD_GUARD, END_SAME_AS_BEGIN: END_SAME_AS_BEGIN }); /** @typedef {import('highlight.js').CallbackResponse} CallbackResponse @typedef {import('highlight.js').CompilerExt} CompilerExt */ // Grammar extensions / plugins // See: https://github.com/highlightjs/highlight.js/issues/2833 // Grammar extensions allow "syntactic sugar" to be added to the grammar modes // without requiring any underlying changes to the compiler internals. // `compileMatch` being the perfect small example of now allowing a grammar // author to write `match` when they desire to match a single expression rather // than being forced to use `begin`. The extension then just moves `match` into // `begin` when it runs. Ie, no features have been added, but we've just made // the experience of writing (and reading grammars) a little bit nicer. // ------ // TODO: We need negative look-behind support to do this properly /** * Skip a match if it has a preceding dot * * This is used for `beginKeywords` to prevent matching expressions such as * `bob.keyword.do()`. The mode compiler automatically wires this up as a * special _internal_ 'on:begin' callback for modes with `beginKeywords` * @param {RegExpMatchArray} match * @param {CallbackResponse} response */ function skipIfHasPrecedingDot(match, response) { const before = match.input[match.index - 1]; if (before === ".") { response.ignoreMatch(); } } /** * * @type {CompilerExt} */ function scopeClassName(mode, _parent) { // eslint-disable-next-line no-undefined if (mode.className !== undefined) { mode.scope = mode.className; delete mode.className; } } /** * `beginKeywords` syntactic sugar * @type {CompilerExt} */ function beginKeywords(mode, parent) { if (!parent) return; if (!mode.beginKeywords) return; // for languages with keywords that include non-word characters checking for // a word boundary is not sufficient, so instead we check for a word boundary // or whitespace - this does no harm in any case since our keyword engine // doesn't allow spaces in keywords anyways and we still check for the boundary // first mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?!\\.)(?=\\b|\\s)'; mode.__beforeBegin = skipIfHasPrecedingDot; mode.keywords = mode.keywords || mode.beginKeywords; delete mode.beginKeywords; // prevents double relevance, the keywords themselves provide // relevance, the mode doesn't need to double it // eslint-disable-next-line no-undefined if (mode.relevance === undefined) mode.relevance = 0; } /** * Allow `illegal` to contain an array of illegal values * @type {CompilerExt} */ function compileIllegal(mode, _parent) { if (!Array.isArray(mode.illegal)) return; mode.illegal = either(...mode.illegal); } /** * `match` to match a single expression for readability * @type {CompilerExt} */ function compileMatch(mode, _parent) { if (!mode.match) return; if (mode.begin || mode.end) throw new Error("begin & end are not supported with match"); mode.begin = mode.match; delete mode.match; } /** * provides the default 1 relevance to all modes * @type {CompilerExt} */ function compileRelevance(mode, _parent) { // eslint-disable-next-line no-undefined if (mode.relevance === undefined) mode.relevance = 1; } // allow beforeMatch to act as a "qualifier" for the match // the full match begin must be [beforeMatch][begin] const beforeMatchExt = (mode, parent) => { if (!mode.beforeMatch) return; // starts conflicts with endsParent which we need to make sure the child // rule is not matched multiple times if (mode.starts) throw new Error("beforeMatch cannot be used with starts"); const originalMode = Object.assign({}, mode); Object.keys(mode).forEach((key) => { delete mode[key]; }); mode.keywords = originalMode.keywords; mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin)); mode.starts = { relevance: 0, contains: [ Object.assign(originalMode, { endsParent: true }) ] }; mode.relevance = 0; delete originalMode.beforeMatch; }; // keywords that should have no default relevance value const COMMON_KEYWORDS = [ 'of', 'and', 'for', 'in', 'not', 'or', 'if', 'then', 'parent', // common variable name 'list', // common variable name 'value' // common variable name ]; const DEFAULT_KEYWORD_SCOPE = "keyword"; /** * Given raw keywords from a language definition, compile them. * * @param {string | Record | Array} rawKeywords * @param {boolean} caseInsensitive */ function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) { /** @type KeywordDict */ const compiledKeywords = Object.create(null); // input can be a string of keywords, an array of keywords, or a object with // named keys representing scopeName (which can then point to a string or array) if (typeof rawKeywords === 'string') { compileList(scopeName, rawKeywords.split(" ")); } else if (Array.isArray(rawKeywords)) { compileList(scopeName, rawKeywords); } else { Object.keys(rawKeywords).forEach(function(scopeName) { // collapse all our objects back into the parent object Object.assign( compiledKeywords, compileKeywords(rawKeywords[scopeName], caseInsensitive, scopeName) ); }); } return compiledKeywords; // --- /** * Compiles an individual list of keywords * * Ex: "for if when while|5" * * @param {string} scopeName * @param {Array} keywordList */ function compileList(scopeName, keywordList) { if (caseInsensitive) { keywordList = keywordList.map(x => x.toLowerCase()); } keywordList.forEach(function(keyword) { const pair = keyword.split('|'); compiledKeywords[pair[0]] = [scopeName, scoreForKeyword(pair[0], pair[1])]; }); } } /** * Returns the proper score for a given keyword * * Also takes into account comment keywords, which will be scored 0 UNLESS * another score has been manually assigned. * @param {string} keyword * @param {string} [providedScore] */ function scoreForKeyword(keyword, providedScore) { // manual scores always win over common keywords // so you can force a score of 1 if you really insist if (providedScore) { return Number(providedScore); } return commonKeyword(keyword) ? 0 : 1; } /** * Determines if a given keyword is common or not * * @param {string} keyword */ function commonKeyword(keyword) { return COMMON_KEYWORDS.includes(keyword.toLowerCase()); } /* For the reasoning behind this please see: https://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419 */ /** * @type {Record} */ const seenDeprecations = {}; /** * @param {string} message */ const error = (message) => { console.error(message); }; /** * @param {string} message * @param {any} args */ const warn = (message, ...args) => { console.log(`WARN: ${message}`, ...args); }; /** * @param {string} version * @param {string} message */ const deprecated = (version, message) => { if (seenDeprecations[`${version}/${message}`]) return; console.log(`Deprecated as of ${version}. ${message}`); seenDeprecations[`${version}/${message}`] = true; }; /* eslint-disable no-throw-literal */ /** @typedef {import('highlight.js').CompiledMode} CompiledMode */ const MultiClassError = new Error(); /** * Renumbers labeled scope names to account for additional inner match * groups that otherwise would break everything. * * Lets say we 3 match scopes: * * { 1 => ..., 2 => ..., 3 => ... } * * So what we need is a clean match like this: * * (a)(b)(c) => [ "a", "b", "c" ] * * But this falls apart with inner match groups: * * (a)(((b)))(c) => ["a", "b", "b", "b", "c" ] * * Our scopes are now "out of alignment" and we're repeating `b` 3 times. * What needs to happen is the numbers are remapped: * * { 1 => ..., 2 => ..., 5 => ... } * * We also need to know that the ONLY groups that should be output * are 1, 2, and 5. This function handles this behavior. * * @param {CompiledMode} mode * @param {Array} regexes * @param {{key: "beginScope"|"endScope"}} opts */ function remapScopeNames(mode, regexes, { key }) { let offset = 0; const scopeNames = mode[key]; /** @type Record */ const emit = {}; /** @type Record */ const positions = {}; for (let i = 1; i <= regexes.length; i++) { positions[i + offset] = scopeNames[i]; emit[i + offset] = true; offset += countMatchGroups(regexes[i - 1]); } // we use _emit to keep track of which match groups are "top-level" to avoid double // output from inside match groups mode[key] = positions; mode[key]._emit = emit; mode[key]._multi = true; } /** * @param {CompiledMode} mode */ function beginMultiClass(mode) { if (!Array.isArray(mode.begin)) return; if (mode.skip || mode.excludeBegin || mode.returnBegin) { error("skip, excludeBegin, returnBegin not compatible with beginScope: {}"); throw MultiClassError; } if (typeof mode.beginScope !== "object" || mode.beginScope === null) { error("beginScope must be object"); throw MultiClassError; } remapScopeNames(mode, mode.begin, { key: "beginScope" }); mode.begin = _rewriteBackreferences(mode.begin, { joinWith: "" }); } /** * @param {CompiledMode} mode */ function endMultiClass(mode) { if (!Array.isArray(mode.end)) return; if (mode.skip || mode.excludeEnd || mode.returnEnd) { error("skip, excludeEnd, returnEnd not compatible with endScope: {}"); throw MultiClassError; } if (typeof mode.endScope !== "object" || mode.endScope === null) { error("endScope must be object"); throw MultiClassError; } remapScopeNames(mode, mode.end, { key: "endScope" }); mode.end = _rewriteBackreferences(mode.end, { joinWith: "" }); } /** * this exists only to allow `scope: {}` to be used beside `match:` * Otherwise `beginScope` would necessary and that would look weird { match: [ /def/, /\w+/ ] scope: { 1: "keyword" , 2: "title" } } * @param {CompiledMode} mode */ function scopeSugar(mode) { if (mode.scope && typeof mode.scope === "object" && mode.scope !== null) { mode.beginScope = mode.scope; delete mode.scope; } } /** * @param {CompiledMode} mode */ function MultiClass(mode) { scopeSugar(mode); if (typeof mode.beginScope === "string") { mode.beginScope = { _wrap: mode.beginScope }; } if (typeof mode.endScope === "string") { mode.endScope = { _wrap: mode.endScope }; } beginMultiClass(mode); endMultiClass(mode); } /** @typedef {import('highlight.js').Mode} Mode @typedef {import('highlight.js').CompiledMode} CompiledMode @typedef {import('highlight.js').Language} Language @typedef {import('highlight.js').HLJSPlugin} HLJSPlugin @typedef {import('highlight.js').CompiledLanguage} CompiledLanguage */ // compilation /** * Compiles a language definition result * * Given the raw result of a language definition (Language), compiles this so * that it is ready for highlighting code. * @param {Language} language * @returns {CompiledLanguage} */ function compileLanguage(language) { /** * Builds a regex with the case sensitivity of the current language * * @param {RegExp | string} value * @param {boolean} [global] */ function langRe(value, global) { return new RegExp( source(value), 'm' + (language.case_insensitive ? 'i' : '') + (language.unicodeRegex ? 'u' : '') + (global ? 'g' : '') ); } /** Stores multiple regular expressions and allows you to quickly search for them all in a string simultaneously - returning the first match. It does this by creating a huge (a|b|c) regex - each individual item wrapped with () and joined by `|` - using match groups to track position. When a match is found checking which position in the array has content allows us to figure out which of the original regexes / match groups triggered the match. The match object itself (the result of `Regex.exec`) is returned but also enhanced by merging in any meta-data that was registered with the regex. This is how we keep track of which mode matched, and what type of rule (`illegal`, `begin`, end, etc). */ class MultiRegex { constructor() { this.matchIndexes = {}; // @ts-ignore this.regexes = []; this.matchAt = 1; this.position = 0; } // @ts-ignore addRule(re, opts) { opts.position = this.position++; // @ts-ignore this.matchIndexes[this.matchAt] = opts; this.regexes.push([opts, re]); this.matchAt += countMatchGroups(re) + 1; } compile() { if (this.regexes.length === 0) { // avoids the need to check length every time exec is called // @ts-ignore this.exec = () => null; } const terminators = this.regexes.map(el => el[1]); this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: '|' }), true); this.lastIndex = 0; } /** @param {string} s */ exec(s) { this.matcherRe.lastIndex = this.lastIndex; const match = this.matcherRe.exec(s); if (!match) { return null; } // eslint-disable-next-line no-undefined const i = match.findIndex((el, i) => i > 0 && el !== undefined); // @ts-ignore const matchData = this.matchIndexes[i]; // trim off any earlier non-relevant match groups (ie, the other regex // match groups that make up the multi-matcher) match.splice(0, i); return Object.assign(match, matchData); } } /* Created to solve the key deficiently with MultiRegex - there is no way to test for multiple matches at a single location. Why would we need to do that? In the future a more dynamic engine will allow certain matches to be ignored. An example: if we matched say the 3rd regex in a large group but decided to ignore it - we'd need to started testing again at the 4th regex... but MultiRegex itself gives us no real way to do that. So what this class creates MultiRegexs on the fly for whatever search position they are needed. NOTE: These additional MultiRegex objects are created dynamically. For most grammars most of the time we will never actually need anything more than the first MultiRegex - so this shouldn't have too much overhead. Say this is our search group, and we match regex3, but wish to ignore it. regex1 | regex2 | regex3 | regex4 | regex5 ' ie, startAt = 0 What we need is a new MultiRegex that only includes the remaining possibilities: regex4 | regex5 ' ie, startAt = 3 This class wraps all that complexity up in a simple API... `startAt` decides where in the array of expressions to start doing the matching. It auto-increments, so if a match is found at position 2, then startAt will be set to 3. If the end is reached startAt will return to 0. MOST of the time the parser will be setting startAt manually to 0. */ class ResumableMultiRegex { constructor() { // @ts-ignore this.rules = []; // @ts-ignore this.multiRegexes = []; this.count = 0; this.lastIndex = 0; this.regexIndex = 0; } // @ts-ignore getMatcher(index) { if (this.multiRegexes[index]) return this.multiRegexes[index]; const matcher = new MultiRegex(); this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts)); matcher.compile(); this.multiRegexes[index] = matcher; return matcher; } resumingScanAtSamePosition() { return this.regexIndex !== 0; } considerAll() { this.regexIndex = 0; } // @ts-ignore addRule(re, opts) { this.rules.push([re, opts]); if (opts.type === "begin") this.count++; } /** @param {string} s */ exec(s) { const m = this.getMatcher(this.regexIndex); m.lastIndex = this.lastIndex; let result = m.exec(s); // The following is because we have no easy way to say "resume scanning at the // existing position but also skip the current rule ONLY". What happens is // all prior rules are also skipped which can result in matching the wrong // thing. Example of matching "booger": // our matcher is [string, "booger", number] // // ....booger.... // if "booger" is ignored then we'd really need a regex to scan from the // SAME position for only: [string, number] but ignoring "booger" (if it // was the first match), a simple resume would scan ahead who knows how // far looking only for "number", ignoring potential string matches (or // future "booger" matches that might be valid.) // So what we do: We execute two matchers, one resuming at the same // position, but the second full matcher starting at the position after: // /--- resume first regex match here (for [number]) // |/---- full match here for [string, "booger", number] // vv // ....booger.... // Which ever results in a match first is then used. So this 3-4 step // process essentially allows us to say "match at this position, excluding // a prior rule that was ignored". // // 1. Match "booger" first, ignore. Also proves that [string] does non match. // 2. Resume matching for [number] // 3. Match at index + 1 for [string, "booger", number] // 4. If #2 and #3 result in matches, which came first? if (this.resumingScanAtSamePosition()) { if (result && result.index === this.lastIndex) ; else { // use the second matcher result const m2 = this.getMatcher(0); m2.lastIndex = this.lastIndex + 1; result = m2.exec(s); } } if (result) { this.regexIndex += result.position + 1; if (this.regexIndex === this.count) { // wrap-around to considering all matches again this.considerAll(); } } return result; } } /** * Given a mode, builds a huge ResumableMultiRegex that can be used to walk * the content and find matches. * * @param {CompiledMode} mode * @returns {ResumableMultiRegex} */ function buildModeRegex(mode) { const mm = new ResumableMultiRegex(); mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: "begin" })); if (mode.terminatorEnd) { mm.addRule(mode.terminatorEnd, { type: "end" }); } if (mode.illegal) { mm.addRule(mode.illegal, { type: "illegal" }); } return mm; } /** skip vs abort vs ignore * * @skip - The mode is still entered and exited normally (and contains rules apply), * but all content is held and added to the parent buffer rather than being * output when the mode ends. Mostly used with `sublanguage` to build up * a single large buffer than can be parsed by sublanguage. * * - The mode begin ands ends normally. * - Content matched is added to the parent mode buffer. * - The parser cursor is moved forward normally. * * @abort - A hack placeholder until we have ignore. Aborts the mode (as if it * never matched) but DOES NOT continue to match subsequent `contains` * modes. Abort is bad/suboptimal because it can result in modes * farther down not getting applied because an earlier rule eats the * content but then aborts. * * - The mode does not begin. * - Content matched by `begin` is added to the mode buffer. * - The parser cursor is moved forward accordingly. * * @ignore - Ignores the mode (as if it never matched) and continues to match any * subsequent `contains` modes. Ignore isn't technically possible with * the current parser implementation. * * - The mode does not begin. * - Content matched by `begin` is ignored. * - The parser cursor is not moved forward. */ /** * Compiles an individual mode * * This can raise an error if the mode contains certain detectable known logic * issues. * @param {Mode} mode * @param {CompiledMode | null} [parent] * @returns {CompiledMode | never} */ function compileMode(mode, parent) { const cmode = /** @type CompiledMode */ (mode); if (mode.isCompiled) return cmode; [ scopeClassName, // do this early so compiler extensions generally don't have to worry about // the distinction between match/begin compileMatch, MultiClass, beforeMatchExt ].forEach(ext => ext(mode, parent)); language.compilerExtensions.forEach(ext => ext(mode, parent)); // __beforeBegin is considered private API, internal use only mode.__beforeBegin = null; [ beginKeywords, // do this later so compiler extensions that come earlier have access to the // raw array if they wanted to perhaps manipulate it, etc. compileIllegal, // default to 1 relevance if not specified compileRelevance ].forEach(ext => ext(mode, parent)); mode.isCompiled = true; let keywordPattern = null; if (typeof mode.keywords === "object" && mode.keywords.$pattern) { // we need a copy because keywords might be compiled multiple times // so we can't go deleting $pattern from the original on the first // pass mode.keywords = Object.assign({}, mode.keywords); keywordPattern = mode.keywords.$pattern; delete mode.keywords.$pattern; } keywordPattern = keywordPattern || /\w+/; if (mode.keywords) { mode.keywords = compileKeywords(mode.keywords, language.case_insensitive); } cmode.keywordPatternRe = langRe(keywordPattern, true); if (parent) { if (!mode.begin) mode.begin = /\B|\b/; cmode.beginRe = langRe(cmode.begin); if (!mode.end && !mode.endsWithParent) mode.end = /\B|\b/; if (mode.end) cmode.endRe = langRe(cmode.end); cmode.terminatorEnd = source(cmode.end) || ''; if (mode.endsWithParent && parent.terminatorEnd) { cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd; } } if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal)); if (!mode.contains) mode.contains = []; mode.contains = [].concat(...mode.contains.map(function(c) { return expandOrCloneMode(c === 'self' ? mode : c); })); mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); }); if (mode.starts) { compileMode(mode.starts, parent); } cmode.matcher = buildModeRegex(cmode); return cmode; } if (!language.compilerExtensions) language.compilerExtensions = []; // self is not valid at the top-level if (language.contains && language.contains.includes('self')) { throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation."); } // we need a null object, which inherit will guarantee language.classNameAliases = inherit$1(language.classNameAliases || {}); return compileMode(/** @type Mode */ (language)); } /** * Determines if a mode has a dependency on it's parent or not * * If a mode does have a parent dependency then often we need to clone it if * it's used in multiple places so that each copy points to the correct parent, * where-as modes without a parent can often safely be re-used at the bottom of * a mode chain. * * @param {Mode | null} mode * @returns {boolean} - is there a dependency on the parent? * */ function dependencyOnParent(mode) { if (!mode) return false; return mode.endsWithParent || dependencyOnParent(mode.starts); } /** * Expands a mode or clones it if necessary * * This is necessary for modes with parental dependenceis (see notes on * `dependencyOnParent`) and for nodes that have `variants` - which must then be * exploded into their own individual modes at compile time. * * @param {Mode} mode * @returns {Mode | Mode[]} * */ function expandOrCloneMode(mode) { if (mode.variants && !mode.cachedVariants) { mode.cachedVariants = mode.variants.map(function(variant) { return inherit$1(mode, { variants: null }, variant); }); } // EXPAND // if we have variants then essentially "replace" the mode with the variants // this happens in compileMode, where this function is called from if (mode.cachedVariants) { return mode.cachedVariants; } // CLONE // if we have dependencies on parents then we need a unique // instance of ourselves, so we can be reused with many // different parents without issue if (dependencyOnParent(mode)) { return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null }); } if (Object.isFrozen(mode)) { return inherit$1(mode); } // no special dependency issues, just return ourselves return mode; } var version = "11.5.1"; class HTMLInjectionError extends Error { constructor(reason, html) { super(reason); this.name = "HTMLInjectionError"; this.html = html; } } /* Syntax highlighting with language autodetection. https://highlightjs.org/ */ /** @typedef {import('highlight.js').Mode} Mode @typedef {import('highlight.js').CompiledMode} CompiledMode @typedef {import('highlight.js').CompiledScope} CompiledScope @typedef {import('highlight.js').Language} Language @typedef {import('highlight.js').HLJSApi} HLJSApi @typedef {import('highlight.js').HLJSPlugin} HLJSPlugin @typedef {import('highlight.js').PluginEvent} PluginEvent @typedef {import('highlight.js').HLJSOptions} HLJSOptions @typedef {import('highlight.js').LanguageFn} LanguageFn @typedef {import('highlight.js').HighlightedHTMLElement} HighlightedHTMLElement @typedef {import('highlight.js').BeforeHighlightContext} BeforeHighlightContext @typedef {import('highlight.js/private').MatchType} MatchType @typedef {import('highlight.js/private').KeywordData} KeywordData @typedef {import('highlight.js/private').EnhancedMatch} EnhancedMatch @typedef {import('highlight.js/private').AnnotatedError} AnnotatedError @typedef {import('highlight.js').AutoHighlightResult} AutoHighlightResult @typedef {import('highlight.js').HighlightOptions} HighlightOptions @typedef {import('highlight.js').HighlightResult} HighlightResult */ const escape = escapeHTML; const inherit = inherit$1; const NO_MATCH = Symbol("nomatch"); const MAX_KEYWORD_HITS = 7; /** * @param {any} hljs - object that is extended (legacy) * @returns {HLJSApi} */ const HLJS = function(hljs) { // Global internal variables used within the highlight.js library. /** @type {Record} */ const languages = Object.create(null); /** @type {Record} */ const aliases = Object.create(null); /** @type {HLJSPlugin[]} */ const plugins = []; // safe/production mode - swallows more errors, tries to keep running // even if a single syntax or parse hits a fatal error let SAFE_MODE = true; const LANGUAGE_NOT_FOUND = "Could not find the language '{}', did you forget to load/include a language module?"; /** @type {Language} */ const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] }; // Global options used when within external APIs. This is modified when // calling the `hljs.configure` function. /** @type HLJSOptions */ let options = { ignoreUnescapedHTML: false, throwUnescapedHTML: false, noHighlightRe: /^(no-?highlight)$/i, languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i, classPrefix: 'hljs-', cssSelector: 'pre code', languages: null, // beta configuration options, subject to change, welcome to discuss // https://github.com/highlightjs/highlight.js/issues/1086 __emitter: TokenTreeEmitter }; /* Utility functions */ /** * Tests a language name to see if highlighting should be skipped * @param {string} languageName */ function shouldNotHighlight(languageName) { return options.noHighlightRe.test(languageName); } /** * @param {HighlightedHTMLElement} block - the HTML element to determine language for */ function blockLanguage(block) { let classes = block.className + ' '; classes += block.parentNode ? block.parentNode.className : ''; // language-* takes precedence over non-prefixed class names. const match = options.languageDetectRe.exec(classes); if (match) { const language = getLanguage(match[1]); if (!language) { warn(LANGUAGE_NOT_FOUND.replace("{}", match[1])); warn("Falling back to no-highlight mode for this block.", block); } return language ? match[1] : 'no-highlight'; } return classes .split(/\s+/) .find((_class) => shouldNotHighlight(_class) || getLanguage(_class)); } /** * Core highlighting function. * * OLD API * highlight(lang, code, ignoreIllegals, continuation) * * NEW API * highlight(code, {lang, ignoreIllegals}) * * @param {string} codeOrLanguageName - the language to use for highlighting * @param {string | HighlightOptions} optionsOrCode - the code to highlight * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail * * @returns {HighlightResult} Result - an object that represents the result * @property {string} language - the language name * @property {number} relevance - the relevance score * @property {string} value - the highlighted HTML code * @property {string} code - the original raw code * @property {CompiledMode} top - top of the current mode stack * @property {boolean} illegal - indicates whether any illegal matches were found */ function highlight(codeOrLanguageName, optionsOrCode, ignoreIllegals) { let code = ""; let languageName = ""; if (typeof optionsOrCode === "object") { code = codeOrLanguageName; ignoreIllegals = optionsOrCode.ignoreIllegals; languageName = optionsOrCode.language; } else { // old API deprecated("10.7.0", "highlight(lang, code, ...args) has been deprecated."); deprecated("10.7.0", "Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"); languageName = codeOrLanguageName; code = optionsOrCode; } // https://github.com/highlightjs/highlight.js/issues/3149 // eslint-disable-next-line no-undefined if (ignoreIllegals === undefined) { ignoreIllegals = true; } /** @type {BeforeHighlightContext} */ const context = { code, language: languageName }; // the plugin can change the desired language or the code to be highlighted // just be changing the object it was passed fire("before:highlight", context); // a before plugin can usurp the result completely by providing it's own // in which case we don't even need to call highlight const result = context.result ? context.result : _highlight(context.language, context.code, ignoreIllegals); result.code = context.code; // the plugin can change anything in result to suite it fire("after:highlight", result); return result; } /** * private highlight that's used internally and does not fire callbacks * * @param {string} languageName - the language to use for highlighting * @param {string} codeToHighlight - the code to highlight * @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail * @param {CompiledMode?} [continuation] - current continuation mode, if any * @returns {HighlightResult} - result of the highlight operation */ function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) { const keywordHits = Object.create(null); /** * Return keyword data if a match is a keyword * @param {CompiledMode} mode - current mode * @param {string} matchText - the textual match * @returns {KeywordData | false} */ function keywordData(mode, matchText) { return mode.keywords[matchText]; } function processKeywords() { if (!top.keywords) { emitter.addText(modeBuffer); return; } let lastIndex = 0; top.keywordPatternRe.lastIndex = 0; let match = top.keywordPatternRe.exec(modeBuffer); let buf = ""; while (match) { buf += modeBuffer.substring(lastIndex, match.index); const word = language.case_insensitive ? match[0].toLowerCase() : match[0]; const data = keywordData(top, word); if (data) { const [kind, keywordRelevance] = data; emitter.addText(buf); buf = ""; keywordHits[word] = (keywordHits[word] || 0) + 1; if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance; if (kind.startsWith("_")) { // _ implied for relevance only, do not highlight // by applying a class name buf += match[0]; } else { const cssClass = language.classNameAliases[kind] || kind; emitter.addKeyword(match[0], cssClass); } } else { buf += match[0]; } lastIndex = top.keywordPatternRe.lastIndex; match = top.keywordPatternRe.exec(modeBuffer); } buf += modeBuffer.substr(lastIndex); emitter.addText(buf); } function processSubLanguage() { if (modeBuffer === "") return; /** @type HighlightResult */ let result = null; if (typeof top.subLanguage === 'string') { if (!languages[top.subLanguage]) { emitter.addText(modeBuffer); return; } result = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]); continuations[top.subLanguage] = /** @type {CompiledMode} */ (result._top); } else { result = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null); } // Counting embedded language score towards the host language may be disabled // with zeroing the containing mode relevance. Use case in point is Markdown that // allows XML everywhere and makes every XML snippet to have a much larger Markdown // score. if (top.relevance > 0) { relevance += result.relevance; } emitter.addSublanguage(result._emitter, result.language); } function processBuffer() { if (top.subLanguage != null) { processSubLanguage(); } else { processKeywords(); } modeBuffer = ''; } /** * @param {CompiledScope} scope * @param {RegExpMatchArray} match */ function emitMultiClass(scope, match) { let i = 1; const max = match.length - 1; while (i <= max) { if (!scope._emit[i]) { i++; continue; } const klass = language.classNameAliases[scope[i]] || scope[i]; const text = match[i]; if (klass) { emitter.addKeyword(text, klass); } else { modeBuffer = text; processKeywords(); modeBuffer = ""; } i++; } } /** * @param {CompiledMode} mode - new mode to start * @param {RegExpMatchArray} match */ function startNewMode(mode, match) { if (mode.scope && typeof mode.scope === "string") { emitter.openNode(language.classNameAliases[mode.scope] || mode.scope); } if (mode.beginScope) { // beginScope just wraps the begin match itself in a scope if (mode.beginScope._wrap) { emitter.addKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap); modeBuffer = ""; } else if (mode.beginScope._multi) { // at this point modeBuffer should just be the match emitMultiClass(mode.beginScope, match); modeBuffer = ""; } } top = Object.create(mode, { parent: { value: top } }); return top; } /** * @param {CompiledMode } mode - the mode to potentially end * @param {RegExpMatchArray} match - the latest match * @param {string} matchPlusRemainder - match plus remainder of content * @returns {CompiledMode | void} - the next mode, or if void continue on in current mode */ function endOfMode(mode, match, matchPlusRemainder) { let matched = startsWith(mode.endRe, matchPlusRemainder); if (matched) { if (mode["on:end"]) { const resp = new Response(mode); mode["on:end"](match, resp); if (resp.isMatchIgnored) matched = false; } if (matched) { while (mode.endsParent && mode.parent) { mode = mode.parent; } return mode; } } // even if on:end fires an `ignore` it's still possible // that we might trigger the end node because of a parent mode if (mode.endsWithParent) { return endOfMode(mode.parent, match, matchPlusRemainder); } } /** * Handle matching but then ignoring a sequence of text * * @param {string} lexeme - string containing full match text */ function doIgnore(lexeme) { if (top.matcher.regexIndex === 0) { // no more regexes to potentially match here, so we move the cursor forward one // space modeBuffer += lexeme[0]; return 1; } else { // no need to move the cursor, we still have additional regexes to try and // match at this very spot resumeScanAtSamePosition = true; return 0; } } /** * Handle the start of a new potential mode match * * @param {EnhancedMatch} match - the current match * @returns {number} how far to advance the parse cursor */ function doBeginMatch(match) { const lexeme = match[0]; const newMode = match.rule; const resp = new Response(newMode); // first internal before callbacks, then the public ones const beforeCallbacks = [newMode.__beforeBegin, newMode["on:begin"]]; for (const cb of beforeCallbacks) { if (!cb) continue; cb(match, resp); if (resp.isMatchIgnored) return doIgnore(lexeme); } if (newMode.skip) { modeBuffer += lexeme; } else { if (newMode.excludeBegin) { modeBuffer += lexeme; } processBuffer(); if (!newMode.returnBegin && !newMode.excludeBegin) { modeBuffer = lexeme; } } startNewMode(newMode, match); return newMode.returnBegin ? 0 : lexeme.length; } /** * Handle the potential end of mode * * @param {RegExpMatchArray} match - the current match */ function doEndMatch(match) { const lexeme = match[0]; const matchPlusRemainder = codeToHighlight.substr(match.index); const endMode = endOfMode(top, match, matchPlusRemainder); if (!endMode) { return NO_MATCH; } const origin = top; if (top.endScope && top.endScope._wrap) { processBuffer(); emitter.addKeyword(lexeme, top.endScope._wrap); } else if (top.endScope && top.endScope._multi) { processBuffer(); emitMultiClass(top.endScope, match); } else if (origin.skip) { modeBuffer += lexeme; } else { if (!(origin.returnEnd || origin.excludeEnd)) { modeBuffer += lexeme; } processBuffer(); if (origin.excludeEnd) { modeBuffer = lexeme; } } do { if (top.scope) { emitter.closeNode(); } if (!top.skip && !top.subLanguage) { relevance += top.relevance; } top = top.parent; } while (top !== endMode.parent); if (endMode.starts) { startNewMode(endMode.starts, match); } return origin.returnEnd ? 0 : lexeme.length; } function processContinuations() { const list = []; for (let current = top; current !== language; current = current.parent) { if (current.scope) { list.unshift(current.scope); } } list.forEach(item => emitter.openNode(item)); } /** @type {{type?: MatchType, index?: number, rule?: Mode}}} */ let lastMatch = {}; /** * Process an individual match * * @param {string} textBeforeMatch - text preceding the match (since the last match) * @param {EnhancedMatch} [match] - the match itself */ function processLexeme(textBeforeMatch, match) { const lexeme = match && match[0]; // add non-matched text to the current mode buffer modeBuffer += textBeforeMatch; if (lexeme == null) { processBuffer(); return 0; } // we've found a 0 width match and we're stuck, so we need to advance // this happens when we have badly behaved rules that have optional matchers to the degree that // sometimes they can end up matching nothing at all // Ref: https://github.com/highlightjs/highlight.js/issues/2140 if (lastMatch.type === "begin" && match.type === "end" && lastMatch.index === match.index && lexeme === "") { // spit the "skipped" character that our regex choked on back into the output sequence modeBuffer += codeToHighlight.slice(match.index, match.index + 1); if (!SAFE_MODE) { /** @type {AnnotatedError} */ const err = new Error(`0 width match regex (${languageName})`); err.languageName = languageName; err.badRule = lastMatch.rule; throw err; } return 1; } lastMatch = match; if (match.type === "begin") { return doBeginMatch(match); } else if (match.type === "illegal" && !ignoreIllegals) { // illegal match, we do not continue processing /** @type {AnnotatedError} */ const err = new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.scope || '') + '"'); err.mode = top; throw err; } else if (match.type === "end") { const processed = doEndMatch(match); if (processed !== NO_MATCH) { return processed; } } // edge case for when illegal matches $ (end of line) which is technically // a 0 width match but not a begin/end match so it's not caught by the // first handler (when ignoreIllegals is true) if (match.type === "illegal" && lexeme === "") { // advance so we aren't stuck in an infinite loop return 1; } // infinite loops are BAD, this is a last ditch catch all. if we have a // decent number of iterations yet our index (cursor position in our // parsing) still 3x behind our index then something is very wrong // so we bail if (iterations > 100000 && iterations > match.index * 3) { const err = new Error('potential infinite loop, way more iterations than matches'); throw err; } /* Why might be find ourselves here? An potential end match that was triggered but could not be completed. IE, `doEndMatch` returned NO_MATCH. (this could be because a callback requests the match be ignored, etc) This causes no real harm other than stopping a few times too many. */ modeBuffer += lexeme; return lexeme.length; } const language = getLanguage(languageName); if (!language) { error(LANGUAGE_NOT_FOUND.replace("{}", languageName)); throw new Error('Unknown language: "' + languageName + '"'); } const md = compileLanguage(language); let result = ''; /** @type {CompiledMode} */ let top = continuation || md; /** @type Record */ const continuations = {}; // keep continuations for sub-languages const emitter = new options.__emitter(options); processContinuations(); let modeBuffer = ''; let relevance = 0; let index = 0; let iterations = 0; let resumeScanAtSamePosition = false; try { top.matcher.considerAll(); for (;;) { iterations++; if (resumeScanAtSamePosition) { // only regexes not matched previously will now be // considered for a potential match resumeScanAtSamePosition = false; } else { top.matcher.considerAll(); } top.matcher.lastIndex = index; const match = top.matcher.exec(codeToHighlight); // console.log("match", match[0], match.rule && match.rule.begin) if (!match) break; const beforeMatch = codeToHighlight.substring(index, match.index); const processedCount = processLexeme(beforeMatch, match); index = match.index + processedCount; } processLexeme(codeToHighlight.substr(index)); emitter.closeAllNodes(); emitter.finalize(); result = emitter.toHTML(); return { language: languageName, value: result, relevance: relevance, illegal: false, _emitter: emitter, _top: top }; } catch (err) { if (err.message && err.message.includes('Illegal')) { return { language: languageName, value: escape(codeToHighlight), illegal: true, relevance: 0, _illegalBy: { message: err.message, index: index, context: codeToHighlight.slice(index - 100, index + 100), mode: err.mode, resultSoFar: result }, _emitter: emitter }; } else if (SAFE_MODE) { return { language: languageName, value: escape(codeToHighlight), illegal: false, relevance: 0, errorRaised: err, _emitter: emitter, _top: top }; } else { throw err; } } } /** * returns a valid highlight result, without actually doing any actual work, * auto highlight starts with this and it's possible for small snippets that * auto-detection may not find a better match * @param {string} code * @returns {HighlightResult} */ function justTextHighlightResult(code) { const result = { value: escape(code), illegal: false, relevance: 0, _top: PLAINTEXT_LANGUAGE, _emitter: new options.__emitter(options) }; result._emitter.addText(code); return result; } /** Highlighting with language detection. Accepts a string with the code to highlight. Returns an object with the following properties: - language (detected language) - relevance (int) - value (an HTML string with highlighting markup) - secondBest (object with the same structure for second-best heuristically detected language, may be absent) @param {string} code @param {Array} [languageSubset] @returns {AutoHighlightResult} */ function highlightAuto(code, languageSubset) { languageSubset = languageSubset || options.languages || Object.keys(languages); const plaintext = justTextHighlightResult(code); const results = languageSubset.filter(getLanguage).filter(autoDetection).map(name => _highlight(name, code, false) ); results.unshift(plaintext); // plaintext is always an option const sorted = results.sort((a, b) => { // sort base on relevance if (a.relevance !== b.relevance) return b.relevance - a.relevance; // always award the tie to the base language // ie if C++ and Arduino are tied, it's more likely to be C++ if (a.language && b.language) { if (getLanguage(a.language).supersetOf === b.language) { return 1; } else if (getLanguage(b.language).supersetOf === a.language) { return -1; } } // otherwise say they are equal, which has the effect of sorting on // relevance while preserving the original ordering - which is how ties // have historically been settled, ie the language that comes first always // wins in the case of a tie return 0; }); const [best, secondBest] = sorted; /** @type {AutoHighlightResult} */ const result = best; result.secondBest = secondBest; return result; } /** * Builds new class name for block given the language name * * @param {HTMLElement} element * @param {string} [currentLang] * @param {string} [resultLang] */ function updateClassName(element, currentLang, resultLang) { const language = (currentLang && aliases[currentLang]) || resultLang; element.classList.add("hljs"); element.classList.add(`language-${language}`); } /** * Applies highlighting to a DOM node containing code. * * @param {HighlightedHTMLElement} element - the HTML element to highlight */ function highlightElement(element) { /** @type HTMLElement */ let node = null; const language = blockLanguage(element); if (shouldNotHighlight(language)) return; fire("before:highlightElement", { el: element, language: language }); // we should be all text, no child nodes (unescaped HTML) - this is possibly // an HTML injection attack - it's likely too late if this is already in // production (the code has likely already done its damage by the time // we're seeing it)... but we yell loudly about this so that hopefully it's // more likely to be caught in development before making it to production if (element.children.length > 0) { if (!options.ignoreUnescapedHTML) { console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."); console.warn("https://github.com/highlightjs/highlight.js/wiki/security"); console.warn("The element with unescaped HTML:"); console.warn(element); } if (options.throwUnescapedHTML) { const err = new HTMLInjectionError( "One of your code blocks includes unescaped HTML.", element.innerHTML ); throw err; } } node = element; const text = node.textContent; const result = language ? highlight(text, { language, ignoreIllegals: true }) : highlightAuto(text); element.innerHTML = result.value; updateClassName(element, language, result.language); element.result = { language: result.language, // TODO: remove with version 11.0 re: result.relevance, relevance: result.relevance }; if (result.secondBest) { element.secondBest = { language: result.secondBest.language, relevance: result.secondBest.relevance }; } fire("after:highlightElement", { el: element, result, text }); } /** * Updates highlight.js global options with the passed options * * @param {Partial} userOptions */ function configure(userOptions) { options = inherit(options, userOptions); } // TODO: remove v12, deprecated const initHighlighting = () => { highlightAll(); deprecated("10.6.0", "initHighlighting() deprecated. Use highlightAll() now."); }; // TODO: remove v12, deprecated function initHighlightingOnLoad() { highlightAll(); deprecated("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now."); } let wantsHighlight = false; /** * auto-highlights all pre>code elements on the page */ function highlightAll() { // if we are called too early in the loading process if (document.readyState === "loading") { wantsHighlight = true; return; } const blocks = document.querySelectorAll(options.cssSelector); blocks.forEach(highlightElement); } function boot() { // if a highlight was requested before DOM was loaded, do now if (wantsHighlight) highlightAll(); } // make sure we are in the browser environment if (typeof window !== 'undefined' && window.addEventListener) { window.addEventListener('DOMContentLoaded', boot, false); } /** * Register a language grammar module * * @param {string} languageName * @param {LanguageFn} languageDefinition */ function registerLanguage(languageName, languageDefinition) { let lang = null; try { lang = languageDefinition(hljs); } catch (error$1) { error("Language definition for '{}' could not be registered.".replace("{}", languageName)); // hard or soft error if (!SAFE_MODE) { throw error$1; } else { error(error$1); } // languages that have serious errors are replaced with essentially a // "plaintext" stand-in so that the code blocks will still get normal // css classes applied to them - and one bad language won't break the // entire highlighter lang = PLAINTEXT_LANGUAGE; } // give it a temporary name if it doesn't have one in the meta-data if (!lang.name) lang.name = languageName; languages[languageName] = lang; lang.rawDefinition = languageDefinition.bind(null, hljs); if (lang.aliases) { registerAliases(lang.aliases, { languageName }); } } /** * Remove a language grammar module * * @param {string} languageName */ function unregisterLanguage(languageName) { delete languages[languageName]; for (const alias of Object.keys(aliases)) { if (aliases[alias] === languageName) { delete aliases[alias]; } } } /** * @returns {string[]} List of language internal names */ function listLanguages() { return Object.keys(languages); } /** * @param {string} name - name of the language to retrieve * @returns {Language | undefined} */ function getLanguage(name) { name = (name || '').toLowerCase(); return languages[name] || languages[aliases[name]]; } /** * * @param {string|string[]} aliasList - single alias or list of aliases * @param {{languageName: string}} opts */ function registerAliases(aliasList, { languageName }) { if (typeof aliasList === 'string') { aliasList = [aliasList]; } aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; }); } /** * Determines if a given language has auto-detection enabled * @param {string} name - name of the language */ function autoDetection(name) { const lang = getLanguage(name); return lang && !lang.disableAutodetect; } /** * Upgrades the old highlightBlock plugins to the new * highlightElement API * @param {HLJSPlugin} plugin */ function upgradePluginAPI(plugin) { // TODO: remove with v12 if (plugin["before:highlightBlock"] && !plugin["before:highlightElement"]) { plugin["before:highlightElement"] = (data) => { plugin["before:highlightBlock"]( Object.assign({ block: data.el }, data) ); }; } if (plugin["after:highlightBlock"] && !plugin["after:highlightElement"]) { plugin["after:highlightElement"] = (data) => { plugin["after:highlightBlock"]( Object.assign({ block: data.el }, data) ); }; } } /** * @param {HLJSPlugin} plugin */ function addPlugin(plugin) { upgradePluginAPI(plugin); plugins.push(plugin); } /** * * @param {PluginEvent} event * @param {any} args */ function fire(event, args) { const cb = event; plugins.forEach(function(plugin) { if (plugin[cb]) { plugin[cb](args); } }); } /** * DEPRECATED * @param {HighlightedHTMLElement} el */ function deprecateHighlightBlock(el) { deprecated("10.7.0", "highlightBlock will be removed entirely in v12.0"); deprecated("10.7.0", "Please use highlightElement now."); return highlightElement(el); } /* Interface definition */ Object.assign(hljs, { highlight, highlightAuto, highlightAll, highlightElement, // TODO: Remove with v12 API highlightBlock: deprecateHighlightBlock, configure, initHighlighting, initHighlightingOnLoad, registerLanguage, unregisterLanguage, listLanguages, getLanguage, registerAliases, autoDetection, inherit, addPlugin }); hljs.debugMode = function() { SAFE_MODE = false; }; hljs.safeMode = function() { SAFE_MODE = true; }; hljs.versionString = version; hljs.regex = { concat: concat, lookahead: lookahead, either: either, optional: optional, anyNumberOfTimes: anyNumberOfTimes }; for (const key in MODES) { // @ts-ignore if (typeof MODES[key] === "object") { // @ts-ignore deepFreeze$1(MODES[key]); } } // merge all the modes/regexes into our main object Object.assign(hljs, MODES); return hljs; }; // export an "instance" of the highlighter var highlight = HLJS({}); var core = highlight; highlight.HighlightJS = highlight; highlight.default = highlight; /* Language: 1C:Enterprise Author: Stanislav Belov Description: built-in language 1C:Enterprise (v7, v8) Category: enterprise */ var _1c_1; var hasRequired_1c; function require_1c () { if (hasRequired_1c) return _1c_1; hasRequired_1c = 1; function _1c(hljs) { // общий паттерн для определения идентификаторов const UNDERSCORE_IDENT_RE = '[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+'; // v7 уникальные ключевые слова, отсутствующие в v8 ==> keyword const v7_keywords = 'далее '; // v8 ключевые слова ==> keyword const v8_keywords = 'возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли ' + 'конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт '; // keyword : ключевые слова const KEYWORD = v7_keywords + v8_keywords; // v7 уникальные директивы, отсутствующие в v8 ==> meta-keyword const v7_meta_keywords = 'загрузитьизфайла '; // v8 ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях ==> meta-keyword const v8_meta_keywords = 'вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер ' + 'наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед ' + 'после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент '; // meta-keyword : ключевые слова в инструкциях препроцессора, директивах компиляции, аннотациях const METAKEYWORD = v7_meta_keywords + v8_meta_keywords; // v7 системные константы ==> built_in const v7_system_constants = 'разделительстраниц разделительстрок символтабуляции '; // v7 уникальные методы глобального контекста, отсутствующие в v8 ==> built_in const v7_global_context_methods = 'ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов ' + 'датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя ' + 'кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца ' + 'коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид ' + 'назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца ' + 'начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов ' + 'основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута ' + 'получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта ' + 'префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына ' + 'рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента ' + 'счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон '; // v8 методы глобального контекста ==> built_in const v8_global_context_methods = 'acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока ' + 'xmlтип xmlтипзнч активноеокно безопасныйрежим безопасныйрежимразделенияданных булево ввестидату ввестизначение ' + 'ввестистроку ввестичисло возможностьчтенияxml вопрос восстановитьзначение врег выгрузитьжурналрегистрации ' + 'выполнитьобработкуоповещения выполнитьпроверкуправдоступа вычислить год данныеформывзначение дата день деньгода ' + 'деньнедели добавитьмесяц заблокироватьданныедляредактирования заблокироватьработупользователя завершитьработусистемы ' + 'загрузитьвнешнююкомпоненту закрытьсправку записатьjson записатьxml записатьдатуjson записьжурналарегистрации ' + 'заполнитьзначениясвойств запроситьразрешениепользователя запуститьприложение запуститьсистему зафиксироватьтранзакцию ' + 'значениевданныеформы значениевстрокувнутр значениевфайл значениезаполнено значениеизстрокивнутр значениеизфайла ' + 'изxmlтипа импортмоделиxdto имякомпьютера имяпользователя инициализироватьпредопределенныеданные информацияобошибке ' + 'каталогбиблиотекимобильногоустройства каталогвременныхфайлов каталогдокументов каталогпрограммы кодироватьстроку ' + 'кодлокализацииинформационнойбазы кодсимвола командасистемы конецгода конецдня конецквартала конецмесяца конецминуты ' + 'конецнедели конецчаса конфигурациябазыданныхизмененадинамически конфигурацияизменена копироватьданныеформы ' + 'копироватьфайл краткоепредставлениеошибки лев макс местноевремя месяц мин минута монопольныйрежим найти ' + 'найтинедопустимыесимволыxml найтиокнопонавигационнойссылке найтипомеченныенаудаление найтипоссылкам найтифайлы ' + 'началогода началодня началоквартала началомесяца началоминуты началонедели началочаса начатьзапросразрешенияпользователя ' + 'начатьзапускприложения начатькопированиефайла начатьперемещениефайла начатьподключениевнешнейкомпоненты ' + 'начатьподключениерасширенияработыскриптографией начатьподключениерасширенияработысфайлами начатьпоискфайлов ' + 'начатьполучениекаталогавременныхфайлов начатьполучениекаталогадокументов начатьполучениерабочегокаталогаданныхпользователя ' + 'начатьполучениефайлов начатьпомещениефайла начатьпомещениефайлов начатьсозданиедвоичныхданныхизфайла начатьсозданиекаталога ' + 'начатьтранзакцию начатьудалениефайлов начатьустановкувнешнейкомпоненты начатьустановкурасширенияработыскриптографией ' + 'начатьустановкурасширенияработысфайлами неделягода необходимостьзавершениясоединения номерсеансаинформационнойбазы ' + 'номерсоединенияинформационнойбазы нрег нстр обновитьинтерфейс обновитьнумерациюобъектов обновитьповторноиспользуемыезначения ' + 'обработкапрерыванияпользователя объединитьфайлы окр описаниеошибки оповестить оповеститьобизменении ' + 'отключитьобработчикзапросанастроекклиенталицензирования отключитьобработчикожидания отключитьобработчикоповещения ' + 'открытьзначение открытьиндекссправки открытьсодержаниесправки открытьсправку открытьформу открытьформумодально ' + 'отменитьтранзакцию очиститьжурналрегистрации очиститьнастройкипользователя очиститьсообщения параметрыдоступа ' + 'перейтипонавигационнойссылке переместитьфайл подключитьвнешнююкомпоненту ' + 'подключитьобработчикзапросанастроекклиенталицензирования подключитьобработчикожидания подключитьобработчикоповещения ' + 'подключитьрасширениеработыскриптографией подключитьрасширениеработысфайлами подробноепредставлениеошибки ' + 'показатьвводдаты показатьвводзначения показатьвводстроки показатьвводчисла показатьвопрос показатьзначение ' + 'показатьинформациюобошибке показатьнакарте показатьоповещениепользователя показатьпредупреждение полноеимяпользователя ' + 'получитьcomобъект получитьxmlтип получитьадреспоместоположению получитьблокировкусеансов получитьвремязавершенияспящегосеанса ' + 'получитьвремязасыпанияпассивногосеанса получитьвремяожиданияблокировкиданных получитьданныевыбора ' + 'получитьдополнительныйпараметрклиенталицензирования получитьдопустимыекодылокализации получитьдопустимыечасовыепояса ' + 'получитьзаголовокклиентскогоприложения получитьзаголовоксистемы получитьзначенияотборажурналарегистрации ' + 'получитьидентификаторконфигурации получитьизвременногохранилища получитьимявременногофайла ' + 'получитьимяклиенталицензирования получитьинформациюэкрановклиента получитьиспользованиежурналарегистрации ' + 'получитьиспользованиесобытияжурналарегистрации получитькраткийзаголовокприложения получитьмакетоформления ' + 'получитьмаскувсефайлы получитьмаскувсефайлыклиента получитьмаскувсефайлысервера получитьместоположениепоадресу ' + 'получитьминимальнуюдлинупаролейпользователей получитьнавигационнуюссылку получитьнавигационнуюссылкуинформационнойбазы ' + 'получитьобновлениеконфигурациибазыданных получитьобновлениепредопределенныхданныхинформационнойбазы получитьобщиймакет ' + 'получитьобщуюформу получитьокна получитьоперативнуюотметкувремени получитьотключениебезопасногорежима ' + 'получитьпараметрыфункциональныхопцийинтерфейса получитьполноеимяпредопределенногозначения ' + 'получитьпредставлениянавигационныхссылок получитьпроверкусложностипаролейпользователей получитьразделительпути ' + 'получитьразделительпутиклиента получитьразделительпутисервера получитьсеансыинформационнойбазы ' + 'получитьскоростьклиентскогосоединения получитьсоединенияинформационнойбазы получитьсообщенияпользователю ' + 'получитьсоответствиеобъектаиформы получитьсоставстандартногоинтерфейсаodata получитьструктурухранениябазыданных ' + 'получитьтекущийсеансинформационнойбазы получитьфайл получитьфайлы получитьформу получитьфункциональнуюопцию ' + 'получитьфункциональнуюопциюинтерфейса получитьчасовойпоясинформационнойбазы пользователиос поместитьвовременноехранилище ' + 'поместитьфайл поместитьфайлы прав праводоступа предопределенноезначение представлениекодалокализации представлениепериода ' + 'представлениеправа представлениеприложения представлениесобытияжурналарегистрации представлениечасовогопояса предупреждение ' + 'прекратитьработусистемы привилегированныйрежим продолжитьвызов прочитатьjson прочитатьxml прочитатьдатуjson пустаястрока ' + 'рабочийкаталогданныхпользователя разблокироватьданныедляредактирования разделитьфайл разорватьсоединениесвнешнимисточникомданных ' + 'раскодироватьстроку рольдоступна секунда сигнал символ скопироватьжурналрегистрации смещениелетнеговремени ' + 'смещениестандартноговремени соединитьбуферыдвоичныхданных создатькаталог создатьфабрикуxdto сокрл сокрлп сокрп сообщить ' + 'состояние сохранитьзначение сохранитьнастройкипользователя сред стрдлина стрзаканчиваетсяна стрзаменить стрнайти стрначинаетсяс ' + 'строка строкасоединенияинформационнойбазы стрполучитьстроку стрразделить стрсоединить стрсравнить стрчисловхождений ' + 'стрчислострок стршаблон текущаядата текущаядатасеанса текущаяуниверсальнаядата текущаяуниверсальнаядатавмиллисекундах ' + 'текущийвариантинтерфейсаклиентскогоприложения текущийвариантосновногошрифтаклиентскогоприложения текущийкодлокализации ' + 'текущийрежимзапуска текущийязык текущийязыксистемы тип типзнч транзакцияактивна трег удалитьданныеинформационнойбазы ' + 'удалитьизвременногохранилища удалитьобъекты удалитьфайлы универсальноевремя установитьбезопасныйрежим ' + 'установитьбезопасныйрежимразделенияданных установитьблокировкусеансов установитьвнешнююкомпоненту ' + 'установитьвремязавершенияспящегосеанса установитьвремязасыпанияпассивногосеанса установитьвремяожиданияблокировкиданных ' + 'установитьзаголовокклиентскогоприложения установитьзаголовоксистемы установитьиспользованиежурналарегистрации ' + 'установитьиспользованиесобытияжурналарегистрации установитькраткийзаголовокприложения ' + 'установитьминимальнуюдлинупаролейпользователей установитьмонопольныйрежим установитьнастройкиклиенталицензирования ' + 'установитьобновлениепредопределенныхданныхинформационнойбазы установитьотключениебезопасногорежима ' + 'установитьпараметрыфункциональныхопцийинтерфейса установитьпривилегированныйрежим ' + 'установитьпроверкусложностипаролейпользователей установитьрасширениеработыскриптографией ' + 'установитьрасширениеработысфайлами установитьсоединениесвнешнимисточникомданных установитьсоответствиеобъектаиформы ' + 'установитьсоставстандартногоинтерфейсаodata установитьчасовойпоясинформационнойбазы установитьчасовойпояссеанса ' + 'формат цел час часовойпояс часовойпояссеанса число числопрописью этоадресвременногохранилища '; // v8 свойства глобального контекста ==> built_in const v8_global_context_property = 'wsссылки библиотекакартинок библиотекамакетовоформлениякомпоновкиданных библиотекастилей бизнеспроцессы ' + 'внешниеисточникиданных внешниеобработки внешниеотчеты встроенныепокупки главныйинтерфейс главныйстиль ' + 'документы доставляемыеуведомления журналыдокументов задачи информацияобинтернетсоединении использованиерабочейдаты ' + 'историяработыпользователя константы критерииотбора метаданные обработки отображениерекламы отправкадоставляемыхуведомлений ' + 'отчеты панельзадачос параметрзапуска параметрысеанса перечисления планывидоврасчета планывидовхарактеристик ' + 'планыобмена планысчетов полнотекстовыйпоиск пользователиинформационнойбазы последовательности проверкавстроенныхпокупок ' + 'рабочаядата расширенияконфигурации регистрыбухгалтерии регистрынакопления регистрырасчета регистрысведений ' + 'регламентныезадания сериализаторxdto справочники средствагеопозиционирования средствакриптографии средствамультимедиа ' + 'средстваотображениярекламы средствапочты средствателефонии фабрикаxdto файловыепотоки фоновыезадания хранилищанастроек ' + 'хранилищевариантовотчетов хранилищенастроекданныхформ хранилищеобщихнастроек хранилищепользовательскихнастроекдинамическихсписков ' + 'хранилищепользовательскихнастроекотчетов хранилищесистемныхнастроек '; // built_in : встроенные или библиотечные объекты (константы, классы, функции) const BUILTIN = v7_system_constants + v7_global_context_methods + v8_global_context_methods + v8_global_context_property; // v8 системные наборы значений ==> class const v8_system_sets_of_values = 'webцвета windowsцвета windowsшрифты библиотекакартинок рамкистиля символы цветастиля шрифтыстиля '; // v8 системные перечисления - интерфейсные ==> class const v8_system_enums_interface = 'автоматическоесохранениеданныхформывнастройках автонумерациявформе автораздвижениесерий ' + 'анимациядиаграммы вариантвыравниванияэлементовизаголовков вариантуправлениявысотойтаблицы ' + 'вертикальнаяпрокруткаформы вертикальноеположение вертикальноеположениеэлемента видгруппыформы ' + 'виддекорацииформы виддополненияэлементаформы видизмененияданных видкнопкиформы видпереключателя ' + 'видподписейкдиаграмме видполяформы видфлажка влияниеразмеранапузырекдиаграммы горизонтальноеположение ' + 'горизонтальноеположениеэлемента группировкаколонок группировкаподчиненныхэлементовформы ' + 'группыиэлементы действиеперетаскивания дополнительныйрежимотображения допустимыедействияперетаскивания ' + 'интервалмеждуэлементамиформы использованиевывода использованиеполосыпрокрутки ' + 'используемоезначениеточкибиржевойдиаграммы историявыборапривводе источникзначенийоситочекдиаграммы ' + 'источникзначенияразмерапузырькадиаграммы категориягруппыкоманд максимумсерий начальноеотображениедерева ' + 'начальноеотображениесписка обновлениетекстаредактирования ориентациядендрограммы ориентациядиаграммы ' + 'ориентацияметокдиаграммы ориентацияметоксводнойдиаграммы ориентацияэлементаформы отображениевдиаграмме ' + 'отображениевлегендедиаграммы отображениегруппыкнопок отображениезаголовкашкалыдиаграммы ' + 'отображениезначенийсводнойдиаграммы отображениезначенияизмерительнойдиаграммы ' + 'отображениеинтерваладиаграммыганта отображениекнопки отображениекнопкивыбора отображениеобсужденийформы ' + 'отображениеобычнойгруппы отображениеотрицательныхзначенийпузырьковойдиаграммы отображениепанелипоиска ' + 'отображениеподсказки отображениепредупрежденияприредактировании отображениеразметкиполосырегулирования ' + 'отображениестраницформы отображениетаблицы отображениетекстазначениядиаграммыганта ' + 'отображениеуправленияобычнойгруппы отображениефигурыкнопки палитрацветовдиаграммы поведениеобычнойгруппы ' + 'поддержкамасштабадендрограммы поддержкамасштабадиаграммыганта поддержкамасштабасводнойдиаграммы ' + 'поисквтаблицепривводе положениезаголовкаэлементаформы положениекартинкикнопкиформы ' + 'положениекартинкиэлементаграфическойсхемы положениекоманднойпанелиформы положениекоманднойпанелиэлементаформы ' + 'положениеопорнойточкиотрисовки положениеподписейкдиаграмме положениеподписейшкалызначенийизмерительнойдиаграммы ' + 'положениесостоянияпросмотра положениестрокипоиска положениетекстасоединительнойлинии положениеуправленияпоиском ' + 'положениешкалывремени порядокотображенияточекгоризонтальнойгистограммы порядоксерийвлегендедиаграммы ' + 'размеркартинки расположениезаголовкашкалыдиаграммы растягиваниеповертикалидиаграммыганта ' + 'режимавтоотображениясостояния режимвводастроктаблицы режимвыборанезаполненного режимвыделениядаты ' + 'режимвыделениястрокитаблицы режимвыделениятаблицы режимизмененияразмера режимизменениясвязанногозначения ' + 'режимиспользованиядиалогапечати режимиспользованияпараметракоманды режиммасштабированияпросмотра ' + 'режимосновногоокнаклиентскогоприложения режимоткрытияокнаформы режимотображениявыделения ' + 'режимотображениягеографическойсхемы режимотображениязначенийсерии режимотрисовкисеткиграфическойсхемы ' + 'режимполупрозрачностидиаграммы режимпробеловдиаграммы режимразмещениянастранице режимредактированияколонки ' + 'режимсглаживаниядиаграммы режимсглаживанияиндикатора режимсписказадач сквозноевыравнивание ' + 'сохранениеданныхформывнастройках способзаполнениятекстазаголовкашкалыдиаграммы ' + 'способопределенияограничивающегозначениядиаграммы стандартнаягруппакоманд стандартноеоформление ' + 'статусоповещенияпользователя стильстрелки типаппроксимациилиниитрендадиаграммы типдиаграммы ' + 'типединицышкалывремени типимпортасерийслоягеографическойсхемы типлиниигеографическойсхемы типлиниидиаграммы ' + 'типмаркерагеографическойсхемы типмаркерадиаграммы типобластиоформления ' + 'типорганизацииисточникаданныхгеографическойсхемы типотображениясериислоягеографическойсхемы ' + 'типотображенияточечногообъектагеографическойсхемы типотображенияшкалыэлементалегендыгеографическойсхемы ' + 'типпоискаобъектовгеографическойсхемы типпроекциигеографическойсхемы типразмещенияизмерений ' + 'типразмещенияреквизитовизмерений типрамкиэлементауправления типсводнойдиаграммы ' + 'типсвязидиаграммыганта типсоединениязначенийпосериямдиаграммы типсоединенияточекдиаграммы ' + 'типсоединительнойлинии типстороныэлементаграфическойсхемы типформыотчета типшкалырадарнойдиаграммы ' + 'факторлиниитрендадиаграммы фигуракнопки фигурыграфическойсхемы фиксациявтаблице форматдняшкалывремени ' + 'форматкартинки ширинаподчиненныхэлементовформы '; // v8 системные перечисления - свойства прикладных объектов ==> class const v8_system_enums_objects_properties = 'виддвижениябухгалтерии виддвижениянакопления видпериодарегистрарасчета видсчета видточкимаршрутабизнеспроцесса ' + 'использованиеагрегатарегистранакопления использованиегруппиэлементов использованиережимапроведения ' + 'использованиесреза периодичностьагрегатарегистранакопления режимавтовремя режимзаписидокумента режимпроведениядокумента '; // v8 системные перечисления - планы обмена ==> class const v8_system_enums_exchange_plans = 'авторегистрацияизменений допустимыйномерсообщения отправкаэлементаданных получениеэлементаданных '; // v8 системные перечисления - табличный документ ==> class const v8_system_enums_tabular_document = 'использованиерасшифровкитабличногодокумента ориентациястраницы положениеитоговколоноксводнойтаблицы ' + 'положениеитоговстроксводнойтаблицы положениетекстаотносительнокартинки расположениезаголовкагруппировкитабличногодокумента ' + 'способчтениязначенийтабличногодокумента типдвустороннейпечати типзаполненияобластитабличногодокумента ' + 'типкурсоровтабличногодокумента типлиниирисункатабличногодокумента типлинииячейкитабличногодокумента ' + 'типнаправленияпереходатабличногодокумента типотображениявыделениятабличногодокумента типотображениялинийсводнойтаблицы ' + 'типразмещениятекстатабличногодокумента типрисункатабличногодокумента типсмещениятабличногодокумента ' + 'типузоратабличногодокумента типфайлатабличногодокумента точностьпечати чередованиерасположениястраниц '; // v8 системные перечисления - планировщик ==> class const v8_system_enums_sheduler = 'отображениевремениэлементовпланировщика '; // v8 системные перечисления - форматированный документ ==> class const v8_system_enums_formatted_document = 'типфайлаформатированногодокумента '; // v8 системные перечисления - запрос ==> class const v8_system_enums_query = 'обходрезультатазапроса типзаписизапроса '; // v8 системные перечисления - построитель отчета ==> class const v8_system_enums_report_builder = 'видзаполнениярасшифровкипостроителяотчета типдобавленияпредставлений типизмеренияпостроителяотчета типразмещенияитогов '; // v8 системные перечисления - работа с файлами ==> class const v8_system_enums_files = 'доступкфайлу режимдиалогавыборафайла режимоткрытияфайла '; // v8 системные перечисления - построитель запроса ==> class const v8_system_enums_query_builder = 'типизмеренияпостроителязапроса '; // v8 системные перечисления - анализ данных ==> class const v8_system_enums_data_analysis = 'видданныханализа методкластеризации типединицыинтервалавременианализаданных типзаполнениятаблицырезультатаанализаданных ' + 'типиспользованиячисловыхзначенийанализаданных типисточникаданныхпоискаассоциаций типколонкианализаданныхдереворешений ' + 'типколонкианализаданныхкластеризация типколонкианализаданныхобщаястатистика типколонкианализаданныхпоискассоциаций ' + 'типколонкианализаданныхпоискпоследовательностей типколонкимоделипрогноза типмерырасстоянияанализаданных ' + 'типотсеченияправилассоциации типполяанализаданных типстандартизациианализаданных типупорядочиванияправилассоциациианализаданных ' + 'типупорядочиванияшаблоновпоследовательностейанализаданных типупрощениядереварешений '; // v8 системные перечисления - xml, json, xs, dom, xdto, web-сервисы ==> class const v8_system_enums_xml_json_xs_dom_xdto_ws = 'wsнаправлениепараметра вариантxpathxs вариантзаписидатыjson вариантпростоготипаxs видгруппымоделиxs видфасетаxdto ' + 'действиепостроителяdom завершенностьпростоготипаxs завершенностьсоставноготипаxs завершенностьсхемыxs запрещенныеподстановкиxs ' + 'исключениягруппподстановкиxs категорияиспользованияатрибутаxs категорияограниченияидентичностиxs категорияограниченияпространствименxs ' + 'методнаследованияxs модельсодержимогоxs назначениетипаxml недопустимыеподстановкиxs обработкапробельныхсимволовxs обработкасодержимогоxs ' + 'ограничениезначенияxs параметрыотбораузловdom переносстрокjson позициявдокументеdom пробельныесимволыxml типатрибутаxml типзначенияjson ' + 'типканоническогоxml типкомпонентыxs типпроверкиxml типрезультатаdomxpath типузлаdom типузлаxml формаxml формапредставленияxs ' + 'форматдатыjson экранированиесимволовjson '; // v8 системные перечисления - система компоновки данных ==> class const v8_system_enums_data_composition_system = 'видсравнениякомпоновкиданных действиеобработкирасшифровкикомпоновкиданных направлениесортировкикомпоновкиданных ' + 'расположениевложенныхэлементоврезультатакомпоновкиданных расположениеитоговкомпоновкиданных расположениегруппировкикомпоновкиданных ' + 'расположениеполейгруппировкикомпоновкиданных расположениеполякомпоновкиданных расположениереквизитовкомпоновкиданных ' + 'расположениересурсовкомпоновкиданных типбухгалтерскогоостаткакомпоновкиданных типвыводатекстакомпоновкиданных ' + 'типгруппировкикомпоновкиданных типгруппыэлементовотборакомпоновкиданных типдополненияпериодакомпоновкиданных ' + 'типзаголовкаполейкомпоновкиданных типмакетагруппировкикомпоновкиданных типмакетаобластикомпоновкиданных типостаткакомпоновкиданных ' + 'типпериодакомпоновкиданных типразмещениятекстакомпоновкиданных типсвязинаборовданныхкомпоновкиданных типэлементарезультатакомпоновкиданных ' + 'расположениелегендыдиаграммыкомпоновкиданных типпримененияотборакомпоновкиданных режимотображенияэлементанастройкикомпоновкиданных ' + 'режимотображениянастроеккомпоновкиданных состояниеэлементанастройкикомпоновкиданных способвосстановлениянастроеккомпоновкиданных ' + 'режимкомпоновкирезультата использованиепараметракомпоновкиданных автопозицияресурсовкомпоновкиданных ' + 'вариантиспользованиягруппировкикомпоновкиданных расположениересурсоввдиаграммекомпоновкиданных фиксациякомпоновкиданных ' + 'использованиеусловногооформлениякомпоновкиданных '; // v8 системные перечисления - почта ==> class const v8_system_enums_email = 'важностьинтернетпочтовогосообщения обработкатекстаинтернетпочтовогосообщения способкодированияинтернетпочтовоговложения ' + 'способкодированиянеasciiсимволовинтернетпочтовогосообщения типтекстапочтовогосообщения протоколинтернетпочты ' + 'статусразборапочтовогосообщения '; // v8 системные перечисления - журнал регистрации ==> class const v8_system_enums_logbook = 'режимтранзакциизаписижурналарегистрации статустранзакциизаписижурналарегистрации уровеньжурналарегистрации '; // v8 системные перечисления - криптография ==> class const v8_system_enums_cryptography = 'расположениехранилищасертификатовкриптографии режимвключениясертификатовкриптографии режимпроверкисертификатакриптографии ' + 'типхранилищасертификатовкриптографии '; // v8 системные перечисления - ZIP ==> class const v8_system_enums_zip = 'кодировкаименфайловвzipфайле методсжатияzip методшифрованияzip режимвосстановленияпутейфайловzip режимобработкиподкаталоговzip ' + 'режимсохраненияпутейzip уровеньсжатияzip '; // v8 системные перечисления - // Блокировка данных, Фоновые задания, Автоматизированное тестирование, // Доставляемые уведомления, Встроенные покупки, Интернет, Работа с двоичными данными ==> class const v8_system_enums_other = 'звуковоеоповещение направлениепереходакстроке позициявпотоке порядокбайтов режимблокировкиданных режимуправленияблокировкойданных ' + 'сервисвстроенныхпокупок состояниефоновогозадания типподписчикадоставляемыхуведомлений уровеньиспользованиязащищенногосоединенияftp '; // v8 системные перечисления - схема запроса ==> class const v8_system_enums_request_schema = 'направлениепорядкасхемызапроса типдополненияпериодамисхемызапроса типконтрольнойточкисхемызапроса типобъединениясхемызапроса ' + 'типпараметрадоступнойтаблицысхемызапроса типсоединениясхемызапроса '; // v8 системные перечисления - свойства объектов метаданных ==> class const v8_system_enums_properties_of_metadata_objects = 'httpметод автоиспользованиеобщегореквизита автопрефиксномеразадачи вариантвстроенногоязыка видиерархии видрегистранакопления ' + 'видтаблицывнешнегоисточникаданных записьдвиженийприпроведении заполнениепоследовательностей индексирование ' + 'использованиебазыпланавидоврасчета использованиебыстроговыбора использованиеобщегореквизита использованиеподчинения ' + 'использованиеполнотекстовогопоиска использованиеразделяемыхданныхобщегореквизита использованиереквизита ' + 'назначениеиспользованияприложения назначениерасширенияконфигурации направлениепередачи обновлениепредопределенныхданных ' + 'оперативноепроведение основноепредставлениевидарасчета основноепредставлениевидахарактеристики основноепредставлениезадачи ' + 'основноепредставлениепланаобмена основноепредставлениесправочника основноепредставлениесчета перемещениеграницыприпроведении ' + 'периодичностьномерабизнеспроцесса периодичностьномерадокумента периодичностьрегистрарасчета периодичностьрегистрасведений ' + 'повторноеиспользованиевозвращаемыхзначений полнотекстовыйпоискпривводепостроке принадлежностьобъекта проведение ' + 'разделениеаутентификацииобщегореквизита разделениеданныхобщегореквизита разделениерасширенийконфигурацииобщегореквизита ' + 'режимавтонумерацииобъектов режимзаписирегистра режимиспользованиямодальности ' + 'режимиспользованиясинхронныхвызововрасширенийплатформыивнешнихкомпонент режимповторногоиспользованиясеансов ' + 'режимполученияданныхвыборапривводепостроке режимсовместимости режимсовместимостиинтерфейса ' + 'режимуправленияблокировкойданныхпоумолчанию сериикодовпланавидовхарактеристик сериикодовпланасчетов ' + 'сериикодовсправочника созданиепривводе способвыбора способпоискастрокипривводепостроке способредактирования ' + 'типданныхтаблицывнешнегоисточникаданных типкодапланавидоврасчета типкодасправочника типмакета типномерабизнеспроцесса ' + 'типномерадокумента типномеразадачи типформы удалениедвижений '; // v8 системные перечисления - разные ==> class const v8_system_enums_differents = 'важностьпроблемыприменениярасширенияконфигурации вариантинтерфейсаклиентскогоприложения вариантмасштабаформклиентскогоприложения ' + 'вариантосновногошрифтаклиентскогоприложения вариантстандартногопериода вариантстандартнойдатыначала видграницы видкартинки ' + 'видотображенияполнотекстовогопоиска видрамки видсравнения видцвета видчисловогозначения видшрифта допустимаядлина допустимыйзнак ' + 'использованиеbyteordermark использованиеметаданныхполнотекстовогопоиска источникрасширенийконфигурации клавиша кодвозвратадиалога ' + 'кодировкаxbase кодировкатекста направлениепоиска направлениесортировки обновлениепредопределенныхданных обновлениеприизмененииданных ' + 'отображениепанелиразделов проверказаполнения режимдиалогавопрос режимзапускаклиентскогоприложения режимокругления режимоткрытияформприложения ' + 'режимполнотекстовогопоиска скоростьклиентскогосоединения состояниевнешнегоисточникаданных состояниеобновленияконфигурациибазыданных ' + 'способвыборасертификатаwindows способкодированиястроки статуссообщения типвнешнейкомпоненты типплатформы типповеденияклавишиenter ' + 'типэлементаинформацииовыполненииобновленияконфигурациибазыданных уровеньизоляциитранзакций хешфункция частидаты'; // class: встроенные наборы значений, системные перечисления (содержат дочерние значения, обращения к которым через разыменование) const CLASS = v8_system_sets_of_values + v8_system_enums_interface + v8_system_enums_objects_properties + v8_system_enums_exchange_plans + v8_system_enums_tabular_document + v8_system_enums_sheduler + v8_system_enums_formatted_document + v8_system_enums_query + v8_system_enums_report_builder + v8_system_enums_files + v8_system_enums_query_builder + v8_system_enums_data_analysis + v8_system_enums_xml_json_xs_dom_xdto_ws + v8_system_enums_data_composition_system + v8_system_enums_email + v8_system_enums_logbook + v8_system_enums_cryptography + v8_system_enums_zip + v8_system_enums_other + v8_system_enums_request_schema + v8_system_enums_properties_of_metadata_objects + v8_system_enums_differents; // v8 общие объекты (у объектов есть конструктор, экземпляры создаются методом НОВЫЙ) ==> type const v8_shared_object = 'comобъект ftpсоединение httpзапрос httpсервисответ httpсоединение wsопределения wsпрокси xbase анализданных аннотацияxs ' + 'блокировкаданных буфердвоичныхданных включениеxs выражениекомпоновкиданных генераторслучайныхчисел географическаясхема ' + 'географическиекоординаты графическаясхема группамоделиxs данныерасшифровкикомпоновкиданных двоичныеданные дендрограмма ' + 'диаграмма диаграммаганта диалогвыборафайла диалогвыборацвета диалогвыборашрифта диалограсписаниярегламентногозадания ' + 'диалогредактированиястандартногопериода диапазон документdom документhtml документацияxs доставляемоеуведомление ' + 'записьdom записьfastinfoset записьhtml записьjson записьxml записьzipфайла записьданных записьтекста записьузловdom ' + 'запрос защищенноесоединениеopenssl значенияполейрасшифровкикомпоновкиданных извлечениетекста импортxs интернетпочта ' + 'интернетпочтовоесообщение интернетпочтовыйпрофиль интернетпрокси интернетсоединение информациядляприложенияxs ' + 'использованиеатрибутаxs использованиесобытияжурналарегистрации источникдоступныхнастроеккомпоновкиданных ' + 'итераторузловdom картинка квалификаторыдаты квалификаторыдвоичныхданных квалификаторыстроки квалификаторычисла ' + 'компоновщикмакетакомпоновкиданных компоновщикнастроеккомпоновкиданных конструктормакетаоформлениякомпоновкиданных ' + 'конструкторнастроеккомпоновкиданных конструкторформатнойстроки линия макеткомпоновкиданных макетобластикомпоновкиданных ' + 'макетоформлениякомпоновкиданных маскаxs менеджеркриптографии наборсхемxml настройкикомпоновкиданных настройкисериализацииjson ' + 'обработкакартинок обработкарасшифровкикомпоновкиданных обходдереваdom объявлениеатрибутаxs объявлениенотацииxs ' + 'объявлениеэлементаxs описаниеиспользованиясобытиядоступжурналарегистрации ' + 'описаниеиспользованиясобытияотказвдоступежурналарегистрации описаниеобработкирасшифровкикомпоновкиданных ' + 'описаниепередаваемогофайла описаниетипов определениегруппыатрибутовxs определениегруппымоделиxs ' + 'определениеограниченияидентичностиxs определениепростоготипаxs определениесоставноготипаxs определениетипадокументаdom ' + 'определенияxpathxs отборкомпоновкиданных пакетотображаемыхдокументов параметрвыбора параметркомпоновкиданных ' + 'параметрызаписиjson параметрызаписиxml параметрычтенияxml переопределениеxs планировщик полеанализаданных ' + 'полекомпоновкиданных построительdom построительзапроса построительотчета построительотчетаанализаданных ' + 'построительсхемxml поток потоквпамяти почта почтовоесообщение преобразованиеxsl преобразованиекканоническомуxml ' + 'процессорвыводарезультатакомпоновкиданныхвколлекциюзначений процессорвыводарезультатакомпоновкиданныхвтабличныйдокумент ' + 'процессоркомпоновкиданных разыменовательпространствименdom рамка расписаниерегламентногозадания расширенноеимяxml ' + 'результатчтенияданных своднаядиаграмма связьпараметравыбора связьпотипу связьпотипукомпоновкиданных сериализаторxdto ' + 'сертификатклиентаwindows сертификатклиентафайл сертификаткриптографии сертификатыудостоверяющихцентровwindows ' + 'сертификатыудостоверяющихцентровфайл сжатиеданных системнаяинформация сообщениепользователю сочетаниеклавиш ' + 'сравнениезначений стандартнаядатаначала стандартныйпериод схемаxml схемакомпоновкиданных табличныйдокумент ' + 'текстовыйдокумент тестируемоеприложение типданныхxml уникальныйидентификатор фабрикаxdto файл файловыйпоток ' + 'фасетдлиныxs фасетколичестваразрядовдробнойчастиxs фасетмаксимальноговключающегозначенияxs ' + 'фасетмаксимальногоисключающегозначенияxs фасетмаксимальнойдлиныxs фасетминимальноговключающегозначенияxs ' + 'фасетминимальногоисключающегозначенияxs фасетминимальнойдлиныxs фасетобразцаxs фасетобщегоколичестваразрядовxs ' + 'фасетперечисленияxs фасетпробельныхсимволовxs фильтрузловdom форматированнаястрока форматированныйдокумент ' + 'фрагментxs хешированиеданных хранилищезначения цвет чтениеfastinfoset чтениеhtml чтениеjson чтениеxml чтениеzipфайла ' + 'чтениеданных чтениетекста чтениеузловdom шрифт элементрезультатакомпоновкиданных '; // v8 универсальные коллекции значений ==> type const v8_universal_collection = 'comsafearray деревозначений массив соответствие списокзначений структура таблицазначений фиксированнаяструктура ' + 'фиксированноесоответствие фиксированныймассив '; // type : встроенные типы const TYPE = v8_shared_object + v8_universal_collection; // literal : примитивные типы const LITERAL = 'null истина ложь неопределено'; // number : числа const NUMBERS = hljs.inherit(hljs.NUMBER_MODE); // string : строки const STRINGS = { className: 'string', begin: '"|\\|', end: '"|$', contains: [ { begin: '""' } ] }; // number : даты const DATE = { begin: "'", end: "'", excludeBegin: true, excludeEnd: true, contains: [ { className: 'number', begin: '\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}' } ] }; // comment : комментарии const COMMENTS = hljs.inherit(hljs.C_LINE_COMMENT_MODE); // meta : инструкции препроцессора, директивы компиляции const META = { className: 'meta', begin: '#|&', end: '$', keywords: { $pattern: UNDERSCORE_IDENT_RE, keyword: KEYWORD + METAKEYWORD }, contains: [ COMMENTS ] }; // symbol : метка goto const SYMBOL = { className: 'symbol', begin: '~', end: ';|:', excludeEnd: true }; // function : объявление процедур и функций const FUNCTION = { className: 'function', variants: [ { begin: 'процедура|функция', end: '\\)', keywords: 'процедура функция' }, { begin: 'конецпроцедуры|конецфункции', keywords: 'конецпроцедуры конецфункции' } ], contains: [ { begin: '\\(', end: '\\)', endsParent: true, contains: [ { className: 'params', begin: UNDERSCORE_IDENT_RE, end: ',', excludeEnd: true, endsWithParent: true, keywords: { $pattern: UNDERSCORE_IDENT_RE, keyword: 'знач', literal: LITERAL }, contains: [ NUMBERS, STRINGS, DATE ] }, COMMENTS ] }, hljs.inherit(hljs.TITLE_MODE, { begin: UNDERSCORE_IDENT_RE }) ] }; return { name: '1C:Enterprise', case_insensitive: true, keywords: { $pattern: UNDERSCORE_IDENT_RE, keyword: KEYWORD, built_in: BUILTIN, class: CLASS, type: TYPE, literal: LITERAL }, contains: [ META, FUNCTION, COMMENTS, SYMBOL, NUMBERS, STRINGS, DATE ] }; } _1c_1 = _1c; return _1c_1; } /* Language: Augmented Backus-Naur Form Author: Alex McKibben Website: https://tools.ietf.org/html/rfc5234 Audit: 2020 */ var abnf_1; var hasRequiredAbnf; function requireAbnf () { if (hasRequiredAbnf) return abnf_1; hasRequiredAbnf = 1; /** @type LanguageFn */ function abnf(hljs) { const regex = hljs.regex; const IDENT = /^[a-zA-Z][a-zA-Z0-9-]*/; const KEYWORDS = [ "ALPHA", "BIT", "CHAR", "CR", "CRLF", "CTL", "DIGIT", "DQUOTE", "HEXDIG", "HTAB", "LF", "LWSP", "OCTET", "SP", "VCHAR", "WSP" ]; const COMMENT = hljs.COMMENT(/;/, /$/); const TERMINAL_BINARY = { scope: "symbol", match: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/ }; const TERMINAL_DECIMAL = { scope: "symbol", match: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/ }; const TERMINAL_HEXADECIMAL = { scope: "symbol", match: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/ }; const CASE_SENSITIVITY = { scope: "symbol", match: /%[si](?=".*")/ }; const RULE_DECLARATION = { scope: "attribute", match: regex.concat(IDENT, /(?=\s*=)/) }; const ASSIGNMENT = { scope: "operator", match: /=\/?/ }; return { name: 'Augmented Backus-Naur Form', illegal: /[!@#$^&',?+~`|:]/, keywords: KEYWORDS, contains: [ ASSIGNMENT, RULE_DECLARATION, COMMENT, TERMINAL_BINARY, TERMINAL_DECIMAL, TERMINAL_HEXADECIMAL, CASE_SENSITIVITY, hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE ] }; } abnf_1 = abnf; return abnf_1; } /* Language: Apache Access Log Author: Oleg Efimov Description: Apache/Nginx Access Logs Website: https://httpd.apache.org/docs/2.4/logs.html#accesslog Category: web, logs Audit: 2020 */ var accesslog_1; var hasRequiredAccesslog; function requireAccesslog () { if (hasRequiredAccesslog) return accesslog_1; hasRequiredAccesslog = 1; /** @type LanguageFn */ function accesslog(hljs) { const regex = hljs.regex; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods const HTTP_VERBS = [ "GET", "POST", "HEAD", "PUT", "DELETE", "CONNECT", "OPTIONS", "PATCH", "TRACE" ]; return { name: 'Apache Access Log', contains: [ // IP { className: 'number', begin: /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/, relevance: 5 }, // Other numbers { className: 'number', begin: /\b\d+\b/, relevance: 0 }, // Requests { className: 'string', begin: regex.concat(/"/, regex.either(...HTTP_VERBS)), end: /"/, keywords: HTTP_VERBS, illegal: /\n/, relevance: 5, contains: [ { begin: /HTTP\/[12]\.\d'/, relevance: 5 } ] }, // Dates { className: 'string', // dates must have a certain length, this prevents matching // simple array accesses a[123] and [] and other common patterns // found in other languages begin: /\[\d[^\]\n]{8,}\]/, illegal: /\n/, relevance: 1 }, { className: 'string', begin: /\[/, end: /\]/, illegal: /\n/, relevance: 0 }, // User agent / relevance boost { className: 'string', begin: /"Mozilla\/\d\.\d \(/, end: /"/, illegal: /\n/, relevance: 3 }, // Strings { className: 'string', begin: /"/, end: /"/, illegal: /\n/, relevance: 0 } ] }; } accesslog_1 = accesslog; return accesslog_1; } /* Language: ActionScript Author: Alexander Myadzel Category: scripting Audit: 2020 */ var actionscript_1; var hasRequiredActionscript; function requireActionscript () { if (hasRequiredActionscript) return actionscript_1; hasRequiredActionscript = 1; /** @type LanguageFn */ function actionscript(hljs) { const regex = hljs.regex; const IDENT_RE = /[a-zA-Z_$][a-zA-Z0-9_$]*/; const PKG_NAME_RE = regex.concat( IDENT_RE, regex.concat("(\\.", IDENT_RE, ")*") ); const IDENT_FUNC_RETURN_TYPE_RE = /([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/; const AS3_REST_ARG_MODE = { className: 'rest_arg', begin: /[.]{3}/, end: IDENT_RE, relevance: 10 }; const KEYWORDS = [ "as", "break", "case", "catch", "class", "const", "continue", "default", "delete", "do", "dynamic", "each", "else", "extends", "final", "finally", "for", "function", "get", "if", "implements", "import", "in", "include", "instanceof", "interface", "internal", "is", "namespace", "native", "new", "override", "package", "private", "protected", "public", "return", "set", "static", "super", "switch", "this", "throw", "try", "typeof", "use", "var", "void", "while", "with" ]; const LITERALS = [ "true", "false", "null", "undefined" ]; return { name: 'ActionScript', aliases: [ 'as' ], keywords: { keyword: KEYWORDS, literal: LITERALS }, contains: [ hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, hljs.C_NUMBER_MODE, { match: [ /\bpackage/, /\s+/, PKG_NAME_RE ], className: { 1: "keyword", 3: "title.class" } }, { match: [ /\b(?:class|interface|extends|implements)/, /\s+/, IDENT_RE ], className: { 1: "keyword", 3: "title.class" } }, { className: 'meta', beginKeywords: 'import include', end: /;/, keywords: { keyword: 'import include' } }, { beginKeywords: 'function', end: /[{;]/, excludeEnd: true, illegal: /\S/, contains: [ hljs.inherit(hljs.TITLE_MODE, { className: "title.function" }), { className: 'params', begin: /\(/, end: /\)/, contains: [ hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, AS3_REST_ARG_MODE ] }, { begin: regex.concat(/:\s*/, IDENT_FUNC_RETURN_TYPE_RE) } ] }, hljs.METHOD_GUARD ], illegal: /#/ }; } actionscript_1 = actionscript; return actionscript_1; } /* Language: Ada Author: Lars Schulna Description: Ada is a general-purpose programming language that has great support for saftey critical and real-time applications. It has been developed by the DoD and thus has been used in military and safety-critical applications (like civil aviation). The first version appeared in the 80s, but it's still actively developed today with the newest standard being Ada2012. */ var ada_1; var hasRequiredAda; function requireAda () { if (hasRequiredAda) return ada_1; hasRequiredAda = 1; // We try to support full Ada2012 // // We highlight all appearances of types, keywords, literals (string, char, number, bool) // and titles (user defined function/procedure/package) // CSS classes are set accordingly // // Languages causing problems for language detection: // xml (broken by Foo : Bar type), elm (broken by Foo : Bar type), vbscript-html (broken by body keyword) // sql (ada default.txt has a lot of sql keywords) /** @type LanguageFn */ function ada(hljs) { // Regular expression for Ada numeric literals. // stolen form the VHDL highlighter // Decimal literal: const INTEGER_RE = '\\d(_|\\d)*'; const EXPONENT_RE = '[eE][-+]?' + INTEGER_RE; const DECIMAL_LITERAL_RE = INTEGER_RE + '(\\.' + INTEGER_RE + ')?' + '(' + EXPONENT_RE + ')?'; // Based literal: const BASED_INTEGER_RE = '\\w+'; const BASED_LITERAL_RE = INTEGER_RE + '#' + BASED_INTEGER_RE + '(\\.' + BASED_INTEGER_RE + ')?' + '#' + '(' + EXPONENT_RE + ')?'; const NUMBER_RE = '\\b(' + BASED_LITERAL_RE + '|' + DECIMAL_LITERAL_RE + ')'; // Identifier regex const ID_REGEX = '[A-Za-z](_?[A-Za-z0-9.])*'; // bad chars, only allowed in literals const BAD_CHARS = `[]\\{\\}%#'"`; // Ada doesn't have block comments, only line comments const COMMENTS = hljs.COMMENT('--', '$'); // variable declarations of the form // Foo : Bar := Baz; // where only Bar will be highlighted const VAR_DECLS = { // TODO: These spaces are not required by the Ada syntax // however, I have yet to see handwritten Ada code where // someone does not put spaces around : begin: '\\s+:\\s+', end: '\\s*(:=|;|\\)|=>|$)', // endsWithParent: true, // returnBegin: true, illegal: BAD_CHARS, contains: [ { // workaround to avoid highlighting // named loops and declare blocks beginKeywords: 'loop for declare others', endsParent: true }, { // properly highlight all modifiers className: 'keyword', beginKeywords: 'not null constant access function procedure in out aliased exception' }, { className: 'type', begin: ID_REGEX, endsParent: true, relevance: 0 } ] }; const KEYWORDS = [ "abort", "else", "new", "return", "abs", "elsif", "not", "reverse", "abstract", "end", "accept", "entry", "select", "access", "exception", "of", "separate", "aliased", "exit", "or", "some", "all", "others", "subtype", "and", "for", "out", "synchronized", "array", "function", "overriding", "at", "tagged", "generic", "package", "task", "begin", "goto", "pragma", "terminate", "body", "private", "then", "if", "procedure", "type", "case", "in", "protected", "constant", "interface", "is", "raise", "use", "declare", "range", "delay", "limited", "record", "when", "delta", "loop", "rem", "while", "digits", "renames", "with", "do", "mod", "requeue", "xor" ]; return { name: 'Ada', case_insensitive: true, keywords: { keyword: KEYWORDS, literal: [ "True", "False" ] }, contains: [ COMMENTS, // strings "foobar" { className: 'string', begin: /"/, end: /"/, contains: [ { begin: /""/, relevance: 0 } ] }, // characters '' { // character literals always contain one char className: 'string', begin: /'.'/ }, { // number literals className: 'number', begin: NUMBER_RE, relevance: 0 }, { // Attributes className: 'symbol', begin: "'" + ID_REGEX }, { // package definition, maybe inside generic className: 'title', begin: '(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?', end: '(is|$)', keywords: 'package body', excludeBegin: true, excludeEnd: true, illegal: BAD_CHARS }, { // function/procedure declaration/definition // maybe inside generic begin: '(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+', end: '(\\bis|\\bwith|\\brenames|\\)\\s*;)', keywords: 'overriding function procedure with is renames return', // we need to re-match the 'function' keyword, so that // the title mode below matches only exactly once returnBegin: true, contains: [ COMMENTS, { // name of the function/procedure className: 'title', begin: '(\\bwith\\s+)?\\b(function|procedure)\\s+', end: '(\\(|\\s+|$)', excludeBegin: true, excludeEnd: true, illegal: BAD_CHARS }, // 'self' // // parameter types VAR_DECLS, { // return type className: 'type', begin: '\\breturn\\s+', end: '(\\s+|;|$)', keywords: 'return', excludeBegin: true, excludeEnd: true, // we are done with functions endsParent: true, illegal: BAD_CHARS } ] }, { // new type declarations // maybe inside generic className: 'type', begin: '\\b(sub)?type\\s+', end: '\\s+', keywords: 'type', excludeBegin: true, illegal: BAD_CHARS }, // see comment above the definition VAR_DECLS // no markup // relevance boosters for small snippets // {begin: '\\s*=>\\s*'}, // {begin: '\\s*:=\\s*'}, // {begin: '\\s+:=\\s+'}, ] }; } ada_1 = ada; return ada_1; } /* Language: AngelScript Author: Melissa Geels Category: scripting Website: https://www.angelcode.com/angelscript/ */ var angelscript_1; var hasRequiredAngelscript; function requireAngelscript () { if (hasRequiredAngelscript) return angelscript_1; hasRequiredAngelscript = 1; /** @type LanguageFn */ function angelscript(hljs) { const builtInTypeMode = { className: 'built_in', begin: '\\b(void|bool|int8|int16|int32|int64|int|uint8|uint16|uint32|uint64|uint|string|ref|array|double|float|auto|dictionary)' }; const objectHandleMode = { className: 'symbol', begin: '[a-zA-Z0-9_]+@' }; const genericMode = { className: 'keyword', begin: '<', end: '>', contains: [ builtInTypeMode, objectHandleMode ] }; builtInTypeMode.contains = [ genericMode ]; objectHandleMode.contains = [ genericMode ]; const KEYWORDS = [ "for", "in|0", "break", "continue", "while", "do|0", "return", "if", "else", "case", "switch", "namespace", "is", "cast", "or", "and", "xor", "not", "get|0", "in", "inout|10", "out", "override", "set|0", "private", "public", "const", "default|0", "final", "shared", "external", "mixin|10", "enum", "typedef", "funcdef", "this", "super", "import", "from", "interface", "abstract|0", "try", "catch", "protected", "explicit", "property" ]; return { name: 'AngelScript', aliases: [ 'asc' ], keywords: KEYWORDS, // avoid close detection with C# and JS illegal: '(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])', contains: [ { // 'strings' className: 'string', begin: '\'', end: '\'', illegal: '\\n', contains: [ hljs.BACKSLASH_ESCAPE ], relevance: 0 }, // """heredoc strings""" { className: 'string', begin: '"""', end: '"""' }, { // "strings" className: 'string', begin: '"', end: '"', illegal: '\\n', contains: [ hljs.BACKSLASH_ESCAPE ], relevance: 0 }, hljs.C_LINE_COMMENT_MODE, // single-line comments hljs.C_BLOCK_COMMENT_MODE, // comment blocks { // metadata className: 'string', begin: '^\\s*\\[', end: '\\]' }, { // interface or namespace declaration beginKeywords: 'interface namespace', end: /\{/, illegal: '[;.\\-]', contains: [ { // interface or namespace name className: 'symbol', begin: '[a-zA-Z0-9_]+' } ] }, { // class declaration beginKeywords: 'class', end: /\{/, illegal: '[;.\\-]', contains: [ { // class name className: 'symbol', begin: '[a-zA-Z0-9_]+', contains: [ { begin: '[:,]\\s*', contains: [ { className: 'symbol', begin: '[a-zA-Z0-9_]+' } ] } ] } ] }, builtInTypeMode, // built-in types objectHandleMode, // object handles { // literals className: 'literal', begin: '\\b(null|true|false)' }, { // numbers className: 'number', relevance: 0, begin: '(-?)(\\b0[xXbBoOdD][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)' } ] }; } angelscript_1 = angelscript; return angelscript_1; } /* Language: Apache config Author: Ruslan Keba Contributors: Ivan Sagalaev Website: https://httpd.apache.org Description: language definition for Apache configuration files (httpd.conf & .htaccess) Category: config, web Audit: 2020 */ var apache_1; var hasRequiredApache; function requireApache () { if (hasRequiredApache) return apache_1; hasRequiredApache = 1; /** @type LanguageFn */ function apache(hljs) { const NUMBER_REF = { className: 'number', begin: /[$%]\d+/ }; const NUMBER = { className: 'number', begin: /\b\d+/ }; const IP_ADDRESS = { className: "number", begin: /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/ }; const PORT_NUMBER = { className: "number", begin: /:\d{1,5}/ }; return { name: 'Apache config', aliases: [ 'apacheconf' ], case_insensitive: true, contains: [ hljs.HASH_COMMENT_MODE, { className: 'section', begin: /<\/?/, end: />/, contains: [ IP_ADDRESS, PORT_NUMBER, // low relevance prevents us from claming XML/HTML where this rule would // match strings inside of XML tags hljs.inherit(hljs.QUOTE_STRING_MODE, { relevance: 0 }) ] }, { className: 'attribute', begin: /\w+/, relevance: 0, // keywords aren’t needed for highlighting per se, they only boost relevance // for a very generally defined mode (starts with a word, ends with line-end keywords: { _: [ "order", "deny", "allow", "setenv", "rewriterule", "rewriteengine", "rewritecond", "documentroot", "sethandler", "errordocument", "loadmodule", "options", "header", "listen", "serverroot", "servername" ] }, starts: { end: /$/, relevance: 0, keywords: { literal: 'on off all deny allow' }, contains: [ { className: 'meta', begin: /\s\[/, end: /\]$/ }, { className: 'variable', begin: /[\$%]\{/, end: /\}/, contains: [ 'self', NUMBER_REF ] }, IP_ADDRESS, NUMBER, hljs.QUOTE_STRING_MODE ] } } ], illegal: /\S/ }; } apache_1 = apache; return apache_1; } /* Language: AppleScript Authors: Nathan Grigg , Dr. Drang Category: scripting Website: https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html Audit: 2020 */ var applescript_1; var hasRequiredApplescript; function requireApplescript () { if (hasRequiredApplescript) return applescript_1; hasRequiredApplescript = 1; /** @type LanguageFn */ function applescript(hljs) { const regex = hljs.regex; const STRING = hljs.inherit( hljs.QUOTE_STRING_MODE, { illegal: null }); const PARAMS = { className: 'params', begin: /\(/, end: /\)/, contains: [ 'self', hljs.C_NUMBER_MODE, STRING ] }; const COMMENT_MODE_1 = hljs.COMMENT(/--/, /$/); const COMMENT_MODE_2 = hljs.COMMENT( /\(\*/, /\*\)/, { contains: [ 'self', // allow nesting COMMENT_MODE_1 ] } ); const COMMENTS = [ COMMENT_MODE_1, COMMENT_MODE_2, hljs.HASH_COMMENT_MODE ]; const KEYWORD_PATTERNS = [ /apart from/, /aside from/, /instead of/, /out of/, /greater than/, /isn't|(doesn't|does not) (equal|come before|come after|contain)/, /(greater|less) than( or equal)?/, /(starts?|ends|begins?) with/, /contained by/, /comes (before|after)/, /a (ref|reference)/, /POSIX (file|path)/, /(date|time) string/, /quoted form/ ]; const BUILT_IN_PATTERNS = [ /clipboard info/, /the clipboard/, /info for/, /list (disks|folder)/, /mount volume/, /path to/, /(close|open for) access/, /(get|set) eof/, /current date/, /do shell script/, /get volume settings/, /random number/, /set volume/, /system attribute/, /system info/, /time to GMT/, /(load|run|store) script/, /scripting components/, /ASCII (character|number)/, /localized string/, /choose (application|color|file|file name|folder|from list|remote application|URL)/, /display (alert|dialog)/ ]; return { name: 'AppleScript', aliases: [ 'osascript' ], keywords: { keyword: 'about above after against and around as at back before beginning ' + 'behind below beneath beside between but by considering ' + 'contain contains continue copy div does eighth else end equal ' + 'equals error every exit fifth first for fourth from front ' + 'get given global if ignoring in into is it its last local me ' + 'middle mod my ninth not of on onto or over prop property put ref ' + 'reference repeat returning script second set seventh since ' + 'sixth some tell tenth that the|0 then third through thru ' + 'timeout times to transaction try until where while whose with ' + 'without', literal: 'AppleScript false linefeed return pi quote result space tab true', built_in: 'alias application boolean class constant date file integer list ' + 'number real record string text ' + 'activate beep count delay launch log offset read round ' + 'run say summarize write ' + 'character characters contents day frontmost id item length ' + 'month name|0 paragraph paragraphs rest reverse running time version ' + 'weekday word words year' }, contains: [ STRING, hljs.C_NUMBER_MODE, { className: 'built_in', begin: regex.concat( /\b/, regex.either(...BUILT_IN_PATTERNS), /\b/ ) }, { className: 'built_in', begin: /^\s*return\b/ }, { className: 'literal', begin: /\b(text item delimiters|current application|missing value)\b/ }, { className: 'keyword', begin: regex.concat( /\b/, regex.either(...KEYWORD_PATTERNS), /\b/ ) }, { beginKeywords: 'on', illegal: /[${=;\n]/, contains: [ hljs.UNDERSCORE_TITLE_MODE, PARAMS ] }, ...COMMENTS ], illegal: /\/\/|->|=>|\[\[/ }; } applescript_1 = applescript; return applescript_1; } /* Language: ArcGIS Arcade Category: scripting Author: John Foster Website: https://developers.arcgis.com/arcade/ Description: ArcGIS Arcade is an expression language used in many Esri ArcGIS products such as Pro, Online, Server, Runtime, JavaScript, and Python */ var arcade_1; var hasRequiredArcade; function requireArcade () { if (hasRequiredArcade) return arcade_1; hasRequiredArcade = 1; /** @type LanguageFn */ function arcade(hljs) { const IDENT_RE = '[A-Za-z_][0-9A-Za-z_]*'; const KEYWORDS = { keyword: [ "if", "for", "while", "var", "new", "function", "do", "return", "void", "else", "break" ], literal: [ "BackSlash", "DoubleQuote", "false", "ForwardSlash", "Infinity", "NaN", "NewLine", "null", "PI", "SingleQuote", "Tab", "TextFormatting", "true", "undefined" ], built_in: [ "Abs", "Acos", "All", "Angle", "Any", "Area", "AreaGeodetic", "Array", "Asin", "Atan", "Atan2", "Attachments", "Average", "Back", "Bearing", "Boolean", "Buffer", "BufferGeodetic", "Ceil", "Centroid", "Clip", "Concatenate", "Console", "Constrain", "Contains", "ConvertDirection", "Cos", "Count", "Crosses", "Cut", "Date", "DateAdd", "DateDiff", "Day", "Decode", "DefaultValue", "Densify", "DensifyGeodetic", "Dictionary", "Difference", "Disjoint", "Distance", "DistanceGeodetic", "Distinct", "Domain", "DomainCode", "DomainName", "EnvelopeIntersects", "Equals", "Erase", "Exp", "Expects", "Extent", "Feature", "FeatureSet", "FeatureSetByAssociation", "FeatureSetById", "FeatureSetByName", "FeatureSetByPortalItem", "FeatureSetByRelationshipName", "Filter", "Find", "First", "Floor", "FromCharCode", "FromCodePoint", "FromJSON", "GdbVersion", "Generalize", "Geometry", "GetFeatureSet", "GetUser", "GroupBy", "Guid", "Hash", "HasKey", "Hour", "IIf", "Includes", "IndexOf", "Insert", "Intersection", "Intersects", "IsEmpty", "IsNan", "ISOMonth", "ISOWeek", "ISOWeekday", "ISOYear", "IsSelfIntersecting", "IsSimple", "Left|0", "Length", "Length3D", "LengthGeodetic", "Log", "Lower", "Map", "Max", "Mean", "Mid", "Millisecond", "Min", "Minute", "Month", "MultiPartToSinglePart", "Multipoint", "NextSequenceValue", "None", "Now", "Number", "Offset|0", "OrderBy", "Overlaps", "Point", "Polygon", "Polyline", "Pop", "Portal", "Pow", "Proper", "Push", "Random", "Reduce", "Relate", "Replace", "Resize", "Reverse", "Right|0", "RingIsClockwise", "Rotate", "Round", "Schema", "Second", "SetGeometry", "Simplify", "Sin", "Slice", "Sort", "Splice", "Split", "Sqrt", "Stdev", "SubtypeCode", "SubtypeName", "Subtypes", "Sum", "SymmetricDifference", "Tan", "Text", "Timestamp", "ToCharCode", "ToCodePoint", "Today", "ToHex", "ToLocal", "Top|0", "Touches", "ToUTC", "TrackAccelerationAt", "TrackAccelerationWindow", "TrackCurrentAcceleration", "TrackCurrentDistance", "TrackCurrentSpeed", "TrackCurrentTime", "TrackDistanceAt", "TrackDistanceWindow", "TrackDuration", "TrackFieldWindow", "TrackGeometryWindow", "TrackIndex", "TrackSpeedAt", "TrackSpeedWindow", "TrackStartTime", "TrackWindow", "Trim", "TypeOf", "Union", "Upper", "UrlEncode", "Variance", "Week", "Weekday", "When", "Within", "Year" ] }; const SYMBOL = { className: 'symbol', begin: '\\$[datastore|feature|layer|map|measure|sourcefeature|sourcelayer|targetfeature|targetlayer|value|view]+' }; const NUMBER = { className: 'number', variants: [ { begin: '\\b(0[bB][01]+)' }, { begin: '\\b(0[oO][0-7]+)' }, { begin: hljs.C_NUMBER_RE } ], relevance: 0 }; const SUBST = { className: 'subst', begin: '\\$\\{', end: '\\}', keywords: KEYWORDS, contains: [] // defined later }; const TEMPLATE_STRING = { className: 'string', begin: '`', end: '`', contains: [ hljs.BACKSLASH_ESCAPE, SUBST ] }; SUBST.contains = [ hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, TEMPLATE_STRING, NUMBER, hljs.REGEXP_MODE ]; const PARAMS_CONTAINS = SUBST.contains.concat([ hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE ]); return { name: 'ArcGIS Arcade', case_insensitive: true, keywords: KEYWORDS, contains: [ hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, TEMPLATE_STRING, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, SYMBOL, NUMBER, { // object attr container begin: /[{,]\s*/, relevance: 0, contains: [ { begin: IDENT_RE + '\\s*:', returnBegin: true, relevance: 0, contains: [ { className: 'attr', begin: IDENT_RE, relevance: 0 } ] } ] }, { // "value" container begin: '(' + hljs.RE_STARTERS_RE + '|\\b(return)\\b)\\s*', keywords: 'return', contains: [ hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, hljs.REGEXP_MODE, { className: 'function', begin: '(\\(.*?\\)|' + IDENT_RE + ')\\s*=>', returnBegin: true, end: '\\s*=>', contains: [ { className: 'params', variants: [ { begin: IDENT_RE }, { begin: /\(\s*\)/ }, { begin: /\(/, end: /\)/, excludeBegin: true, excludeEnd: true, keywords: KEYWORDS, contains: PARAMS_CONTAINS } ] } ] } ], relevance: 0 }, { beginKeywords: 'function', end: /\{/, excludeEnd: true, contains: [ hljs.inherit(hljs.TITLE_MODE, { className: "title.function", begin: IDENT_RE }), { className: 'params', begin: /\(/, end: /\)/, excludeBegin: true, excludeEnd: true, contains: PARAMS_CONTAINS } ], illegal: /\[|%/ }, { begin: /\$[(.]/ } ], illegal: /#(?!!)/ }; } arcade_1 = arcade; return arcade_1; } /* Language: C++ Category: common, system Website: https://isocpp.org */ var arduino_1; var hasRequiredArduino; function requireArduino () { if (hasRequiredArduino) return arduino_1; hasRequiredArduino = 1; /** @type LanguageFn */ function cPlusPlus(hljs) { const regex = hljs.regex; // added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does // not include such support nor can we be sure all the grammars depending // on it would desire this behavior const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', { contains: [ { begin: /\\\n/ } ] }); const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)'; const NAMESPACE_RE = '[a-zA-Z_]\\w*::'; const TEMPLATE_ARGUMENT_RE = '<[^<>]+>'; const FUNCTION_TYPE_RE = '(?!struct)(' + DECLTYPE_AUTO_RE + '|' + regex.optional(NAMESPACE_RE) + '[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE) + ')'; const CPP_PRIMITIVE_TYPES = { className: 'type', begin: '\\b[a-z\\d_]*_t\\b' }; // https://en.cppreference.com/w/cpp/language/escape // \\ \x \xFF \u2837 \u00323747 \374 const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)'; const STRINGS = { className: 'string', variants: [ { begin: '(u8?|U|L)?"', end: '"', illegal: '\\n', contains: [ hljs.BACKSLASH_ESCAPE ] }, { begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + '|.)', end: '\'', illegal: '.' }, hljs.END_SAME_AS_BEGIN({ begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, end: /\)([^()\\ ]{0,16})"/ }) ] }; const NUMBERS = { className: 'number', variants: [ { begin: '\\b(0b[01\']+)' }, { begin: '(-?)\\b([\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)' }, { begin: '(-?)(\\b0[xX][a-fA-F0-9\']+|(\\b[\\d\']+(\\.[\\d\']*)?|\\.[\\d\']+)([eE][-+]?[\\d\']+)?)' } ], relevance: 0 }; const PREPROCESSOR = { className: 'meta', begin: /#\s*[a-z]+\b/, end: /$/, keywords: { keyword: 'if else elif endif define undef warning error line ' + 'pragma _Pragma ifdef ifndef include' }, contains: [ { begin: /\\\n/, relevance: 0 }, hljs.inherit(STRINGS, { className: 'string' }), { className: 'string', begin: /<.*?>/ }, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE ] }; const TITLE_MODE = { className: 'title', begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE, relevance: 0 }; const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\('; // https://en.cppreference.com/w/cpp/keyword const RESERVED_KEYWORDS = [ 'alignas', 'alignof', 'and', 'and_eq', 'asm', 'atomic_cancel', 'atomic_commit', 'atomic_noexcept', 'auto', 'bitand', 'bitor', 'break', 'case', 'catch', 'class', 'co_await', 'co_return', 'co_yield', 'compl', 'concept', 'const_cast|10', 'consteval', 'constexpr', 'constinit', 'continue', 'decltype', 'default', 'delete', 'do', 'dynamic_cast|10', 'else', 'enum', 'explicit', 'export', 'extern', 'false', 'final', 'for', 'friend', 'goto', 'if', 'import', 'inline', 'module', 'mutable', 'namespace', 'new', 'noexcept', 'not', 'not_eq', 'nullptr', 'operator', 'or', 'or_eq', 'override', 'private', 'protected', 'public', 'reflexpr', 'register', 'reinterpret_cast|10', 'requires', 'return', 'sizeof', 'static_assert', 'static_cast|10', 'struct', 'switch', 'synchronized', 'template', 'this', 'thread_local', 'throw', 'transaction_safe', 'transaction_safe_dynamic', 'true', 'try', 'typedef', 'typeid', 'typename', 'union', 'using', 'virtual', 'volatile', 'while', 'xor', 'xor_eq' ]; // https://en.cppreference.com/w/cpp/keyword const RESERVED_TYPES = [ 'bool', 'char', 'char16_t', 'char32_t', 'char8_t', 'double', 'float', 'int', 'long', 'short', 'void', 'wchar_t', 'unsigned', 'signed', 'const', 'static' ]; const TYPE_HINTS = [ 'any', 'auto_ptr', 'barrier', 'binary_semaphore', 'bitset', 'complex', 'condition_variable', 'condition_variable_any', 'counting_semaphore', 'deque', 'false_type', 'future', 'imaginary', 'initializer_list', 'istringstream', 'jthread', 'latch', 'lock_guard', 'multimap', 'multiset', 'mutex', 'optional', 'ostringstream', 'packaged_task', 'pair', 'promise', 'priority_queue', 'queue', 'recursive_mutex', 'recursive_timed_mutex', 'scoped_lock', 'set', 'shared_future', 'shared_lock', 'shared_mutex', 'shared_timed_mutex', 'shared_ptr', 'stack', 'string_view', 'stringstream', 'timed_mutex', 'thread', 'true_type', 'tuple', 'unique_lock', 'unique_ptr', 'unordered_map', 'unordered_multimap', 'unordered_multiset', 'unordered_set', 'variant', 'vector', 'weak_ptr', 'wstring', 'wstring_view' ]; const FUNCTION_HINTS = [ 'abort', 'abs', 'acos', 'apply', 'as_const', 'asin', 'atan', 'atan2', 'calloc', 'ceil', 'cerr', 'cin', 'clog', 'cos', 'cosh', 'cout', 'declval', 'endl', 'exchange', 'exit', 'exp', 'fabs', 'floor', 'fmod', 'forward', 'fprintf', 'fputs', 'free', 'frexp', 'fscanf', 'future', 'invoke', 'isalnum', 'isalpha', 'iscntrl', 'isdigit', 'isgraph', 'islower', 'isprint', 'ispunct', 'isspace', 'isupper', 'isxdigit', 'labs', 'launder', 'ldexp', 'log', 'log10', 'make_pair', 'make_shared', 'make_shared_for_overwrite', 'make_tuple', 'make_unique', 'malloc', 'memchr', 'memcmp', 'memcpy', 'memset', 'modf', 'move', 'pow', 'printf', 'putchar', 'puts', 'realloc', 'scanf', 'sin', 'sinh', 'snprintf', 'sprintf', 'sqrt', 'sscanf', 'std', 'stderr', 'stdin', 'stdout', 'strcat', 'strchr', 'strcmp', 'strcpy', 'strcspn', 'strlen', 'strncat', 'strncmp', 'strncpy', 'strpbrk', 'strrchr', 'strspn', 'strstr', 'swap', 'tan', 'tanh', 'terminate', 'to_underlying', 'tolower', 'toupper', 'vfprintf', 'visit', 'vprintf', 'vsprintf' ]; const LITERALS = [ 'NULL', 'false', 'nullopt', 'nullptr', 'true' ]; // https://en.cppreference.com/w/cpp/keyword const BUILT_IN = [ '_Pragma' ]; const CPP_KEYWORDS = { type: RESERVED_TYPES, keyword: RESERVED_KEYWORDS, literal: LITERALS, built_in: BUILT_IN, _type_hints: TYPE_HINTS }; const FUNCTION_DISPATCH = { className: 'function.dispatch', relevance: 0, keywords: { // Only for relevance, not highlighting. _hint: FUNCTION_HINTS }, begin: regex.concat( /\b/, /(?!decltype)/, /(?!if)/, /(?!for)/, /(?!switch)/, /(?!while)/, hljs.IDENT_RE, regex.lookahead(/(<[^<>]+>|)\s*\(/)) }; const EXPRESSION_CONTAINS = [ FUNCTION_DISPATCH, PREPROCESSOR, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, NUMBERS, STRINGS ]; const EXPRESSION_CONTEXT = { // This mode covers expression context where we can't expect a function // definition and shouldn't highlight anything that looks like one: // `return some()`, `else if()`, `(x*sum(1, 2))` variants: [ { begin: /=/, end: /;/ }, { begin: /\(/, end: /\)/ }, { beginKeywords: 'new throw return else', end: /;/ } ], keywords: CPP_KEYWORDS, contains: EXPRESSION_CONTAINS.concat([ { begin: /\(/, end: /\)/, keywords: CPP_KEYWORDS, contains: EXPRESSION_CONTAINS.concat([ 'self' ]), relevance: 0 } ]), relevance: 0 }; const FUNCTION_DECLARATION = { className: 'function', begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE, returnBegin: true, end: /[{;=]/, excludeEnd: true, keywords: CPP_KEYWORDS, illegal: /[^\w\s\*&:<>.]/, contains: [ { // to prevent it from being confused as the function title begin: DECLTYPE_AUTO_RE, keywords: CPP_KEYWORDS, relevance: 0 }, { begin: FUNCTION_TITLE, returnBegin: true, contains: [ TITLE_MODE ], relevance: 0 }, // needed because we do not have look-behind on the below rule // to prevent it from grabbing the final : in a :: pair { begin: /::/, relevance: 0 }, // initializers { begin: /:/, endsWithParent: true, contains: [ STRINGS, NUMBERS ] }, // allow for multiple declarations, e.g.: // extern void f(int), g(char); { relevance: 0, match: /,/ }, { className: 'params', begin: /\(/, end: /\)/, keywords: CPP_KEYWORDS, relevance: 0, contains: [ C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES, // Count matching parentheses. { begin: /\(/, end: /\)/, keywords: CPP_KEYWORDS, relevance: 0, contains: [ 'self', C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRINGS, NUMBERS, CPP_PRIMITIVE_TYPES ] } ] }, CPP_PRIMITIVE_TYPES, C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, PREPROCESSOR ] }; return { name: 'C++', aliases: [ 'cc', 'c++', 'h++', 'hpp', 'hh', 'hxx', 'cxx' ], keywords: CPP_KEYWORDS, illegal: ' rooms (9);` begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)', end: '>', keywords: CPP_KEYWORDS, contains: [ 'self', CPP_PRIMITIVE_TYPES ] }, { begin: hljs.IDENT_RE + '::', keywords: CPP_KEYWORDS }, { match: [ // extra complexity to deal with `enum class` and `enum struct` /\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/, /\s+/, /\w+/ ], className: { 1: 'keyword', 3: 'title.class' } } ]) }; } /* Language: Arduino Author: Stefania Mellai Description: The Arduino® Language is a superset of C++. This rules are designed to highlight the Arduino® source code. For info about language see http://www.arduino.cc. Website: https://www.arduino.cc */ /** @type LanguageFn */ function arduino(hljs) { const ARDUINO_KW = { type: [ "boolean", "byte", "word", "String" ], built_in: [ "KeyboardController", "MouseController", "SoftwareSerial", "EthernetServer", "EthernetClient", "LiquidCrystal", "RobotControl", "GSMVoiceCall", "EthernetUDP", "EsploraTFT", "HttpClient", "RobotMotor", "WiFiClient", "GSMScanner", "FileSystem", "Scheduler", "GSMServer", "YunClient", "YunServer", "IPAddress", "GSMClient", "GSMModem", "Keyboard", "Ethernet", "Console", "GSMBand", "Esplora", "Stepper", "Process", "WiFiUDP", "GSM_SMS", "Mailbox", "USBHost", "Firmata", "PImage", "Client", "Server", "GSMPIN", "FileIO", "Bridge", "Serial", "EEPROM", "Stream", "Mouse", "Audio", "Servo", "File", "Task", "GPRS", "WiFi", "Wire", "TFT", "GSM", "SPI", "SD" ], _hints: [ "setup", "loop", "runShellCommandAsynchronously", "analogWriteResolution", "retrieveCallingNumber", "printFirmwareVersion", "analogReadResolution", "sendDigitalPortPair", "noListenOnLocalhost", "readJoystickButton", "setFirmwareVersion", "readJoystickSwitch", "scrollDisplayRight", "getVoiceCallStatus", "scrollDisplayLeft", "writeMicroseconds", "delayMicroseconds", "beginTransmission", "getSignalStrength", "runAsynchronously", "getAsynchronously", "listenOnLocalhost", "getCurrentCarrier", "readAccelerometer", "messageAvailable", "sendDigitalPorts", "lineFollowConfig", "countryNameWrite", "runShellCommand", "readStringUntil", "rewindDirectory", "readTemperature", "setClockDivider", "readLightSensor", "endTransmission", "analogReference", "detachInterrupt", "countryNameRead", "attachInterrupt", "encryptionType", "readBytesUntil", "robotNameWrite", "readMicrophone", "robotNameRead", "cityNameWrite", "userNameWrite", "readJoystickY", "readJoystickX", "mouseReleased", "openNextFile", "scanNetworks", "noInterrupts", "digitalWrite", "beginSpeaker", "mousePressed", "isActionDone", "mouseDragged", "displayLogos", "noAutoscroll", "addParameter", "remoteNumber", "getModifiers", "keyboardRead", "userNameRead", "waitContinue", "processInput", "parseCommand", "printVersion", "readNetworks", "writeMessage", "blinkVersion", "cityNameRead", "readMessage", "setDataMode", "parsePacket", "isListening", "setBitOrder", "beginPacket", "isDirectory", "motorsWrite", "drawCompass", "digitalRead", "clearScreen", "serialEvent", "rightToLeft", "setTextSize", "leftToRight", "requestFrom", "keyReleased", "compassRead", "analogWrite", "interrupts", "WiFiServer", "disconnect", "playMelody", "parseFloat", "autoscroll", "getPINUsed", "setPINUsed", "setTimeout", "sendAnalog", "readSlider", "analogRead", "beginWrite", "createChar", "motorsStop", "keyPressed", "tempoWrite", "readButton", "subnetMask", "debugPrint", "macAddress", "writeGreen", "randomSeed", "attachGPRS", "readString", "sendString", "remotePort", "releaseAll", "mouseMoved", "background", "getXChange", "getYChange", "answerCall", "getResult", "voiceCall", "endPacket", "constrain", "getSocket", "writeJSON", "getButton", "available", "connected", "findUntil", "readBytes", "exitValue", "readGreen", "writeBlue", "startLoop", "IPAddress", "isPressed", "sendSysex", "pauseMode", "gatewayIP", "setCursor", "getOemKey", "tuneWrite", "noDisplay", "loadImage", "switchPIN", "onRequest", "onReceive", "changePIN", "playFile", "noBuffer", "parseInt", "overflow", "checkPIN", "knobRead", "beginTFT", "bitClear", "updateIR", "bitWrite", "position", "writeRGB", "highByte", "writeRed", "setSpeed", "readBlue", "noStroke", "remoteIP", "transfer", "shutdown", "hangCall", "beginSMS", "endWrite", "attached", "maintain", "noCursor", "checkReg", "checkPUK", "shiftOut", "isValid", "shiftIn", "pulseIn", "connect", "println", "localIP", "pinMode", "getIMEI", "display", "noBlink", "process", "getBand", "running", "beginSD", "drawBMP", "lowByte", "setBand", "release", "bitRead", "prepare", "pointTo", "readRed", "setMode", "noFill", "remove", "listen", "stroke", "detach", "attach", "noTone", "exists", "buffer", "height", "bitSet", "circle", "config", "cursor", "random", "IRread", "setDNS", "endSMS", "getKey", "micros", "millis", "begin", "print", "write", "ready", "flush", "width", "isPIN", "blink", "clear", "press", "mkdir", "rmdir", "close", "point", "yield", "image", "BSSID", "click", "delay", "read", "text", "move", "peek", "beep", "rect", "line", "open", "seek", "fill", "size", "turn", "stop", "home", "find", "step", "tone", "sqrt", "RSSI", "SSID", "end", "bit", "tan", "cos", "sin", "pow", "map", "abs", "max", "min", "get", "run", "put" ], literal: [ "DIGITAL_MESSAGE", "FIRMATA_STRING", "ANALOG_MESSAGE", "REPORT_DIGITAL", "REPORT_ANALOG", "INPUT_PULLUP", "SET_PIN_MODE", "INTERNAL2V56", "SYSTEM_RESET", "LED_BUILTIN", "INTERNAL1V1", "SYSEX_START", "INTERNAL", "EXTERNAL", "DEFAULT", "OUTPUT", "INPUT", "HIGH", "LOW" ] }; const ARDUINO = cPlusPlus(hljs); const kws = /** @type {Record} */ (ARDUINO.keywords); kws.type = [ ...kws.type, ...ARDUINO_KW.type ]; kws.literal = [ ...kws.literal, ...ARDUINO_KW.literal ]; kws.built_in = [ ...kws.built_in, ...ARDUINO_KW.built_in ]; kws._hints = ARDUINO_KW._hints; ARDUINO.name = 'Arduino'; ARDUINO.aliases = [ 'ino' ]; ARDUINO.supersetOf = "cpp"; return ARDUINO; } arduino_1 = arduino; return arduino_1; } /* Language: ARM Assembly Author: Dan Panzarella Description: ARM Assembly including Thumb and Thumb2 instructions Category: assembler */ var armasm_1; var hasRequiredArmasm; function requireArmasm () { if (hasRequiredArmasm) return armasm_1; hasRequiredArmasm = 1; /** @type LanguageFn */ function armasm(hljs) { // local labels: %?[FB]?[AT]?\d{1,2}\w+ const COMMENT = { variants: [ hljs.COMMENT('^[ \\t]*(?=#)', '$', { relevance: 0, excludeBegin: true }), hljs.COMMENT('[;@]', '$', { relevance: 0 }), hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE ] }; return { name: 'ARM Assembly', case_insensitive: true, aliases: [ 'arm' ], keywords: { $pattern: '\\.?' + hljs.IDENT_RE, meta: // GNU preprocs '.2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ' // ARM directives + 'ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND ', built_in: 'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 ' // standard registers + 'pc lr sp ip sl sb fp ' // typical regs plus backward compatibility + 'a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 ' // more regs and fp + 'p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 ' // coprocessor regs + 'c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 ' // more coproc + 'q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 ' // advanced SIMD NEON regs // program status registers + 'cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf ' + 'spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf ' // NEON and VFP registers + 's0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 ' + 's16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 ' + 'd0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 ' + 'd16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 ' + '{PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @' }, contains: [ { className: 'keyword', begin: '\\b(' // mnemonics + 'adc|' + '(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|' + 'and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|' + 'bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|' + 'setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|' + 'ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|' + 'mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|' + 'mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|' + 'mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|' + 'rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|' + 'stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|' + '[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|' + 'wfe|wfi|yield' + ')' + '(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?' // condition codes + '[sptrx]?' // legal postfixes + '(?=\\s)' // followed by space }, COMMENT, hljs.QUOTE_STRING_MODE, { className: 'string', begin: '\'', end: '[^\\\\]\'', relevance: 0 }, { className: 'title', begin: '\\|', end: '\\|', illegal: '\\n', relevance: 0 }, { className: 'number', variants: [ { // hex begin: '[#$=]?0x[0-9a-f]+' }, { // bin begin: '[#$=]?0b[01]+' }, { // literal begin: '[#$=]\\d+' }, { // bare number begin: '\\b\\d+' } ], relevance: 0 }, { className: 'symbol', variants: [ { // GNU ARM syntax begin: '^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:' }, { // ARM syntax begin: '^[a-z_\\.\\$][a-z0-9_\\.\\$]+' }, { // label reference begin: '[=#]\\w+' } ], relevance: 0 } ] }; } armasm_1 = armasm; return armasm_1; } /* Language: HTML, XML Website: https://www.w3.org/XML/ Category: common, web Audit: 2020 */ var xml_1; var hasRequiredXml; function requireXml () { if (hasRequiredXml) return xml_1; hasRequiredXml = 1; /** @type LanguageFn */ function xml(hljs) { const regex = hljs.regex; // Element names can contain letters, digits, hyphens, underscores, and periods const TAG_NAME_RE = regex.concat(/[A-Z_]/, regex.optional(/[A-Z0-9_.-]*:/), /[A-Z0-9_.-]*/); const XML_IDENT_RE = /[A-Za-z0-9._:-]+/; const XML_ENTITIES = { className: 'symbol', begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/ }; const XML_META_KEYWORDS = { begin: /\s/, contains: [ { className: 'keyword', begin: /#?[a-z_][a-z1-9_-]+/, illegal: /\n/ } ] }; const XML_META_PAR_KEYWORDS = hljs.inherit(XML_META_KEYWORDS, { begin: /\(/, end: /\)/ }); const APOS_META_STRING_MODE = hljs.inherit(hljs.APOS_STRING_MODE, { className: 'string' }); const QUOTE_META_STRING_MODE = hljs.inherit(hljs.QUOTE_STRING_MODE, { className: 'string' }); const TAG_INTERNALS = { endsWithParent: true, illegal: /`]+/ } ] } ] } ] }; return { name: 'HTML, XML', aliases: [ 'html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist', 'wsf', 'svg' ], case_insensitive: true, contains: [ { className: 'meta', begin: //, relevance: 10, contains: [ XML_META_KEYWORDS, QUOTE_META_STRING_MODE, APOS_META_STRING_MODE, XML_META_PAR_KEYWORDS, { begin: /\[/, end: /\]/, contains: [ { className: 'meta', begin: //, contains: [ XML_META_KEYWORDS, XML_META_PAR_KEYWORDS, QUOTE_META_STRING_MODE, APOS_META_STRING_MODE ] } ] } ] }, hljs.COMMENT( //, { relevance: 10 } ), { begin: //, relevance: 10 }, XML_ENTITIES, // xml processing instructions { className: 'meta', end: /\?>/, variants: [ { begin: /<\?xml/, relevance: 10, contains: [ QUOTE_META_STRING_MODE ] }, { begin: /<\?[a-z][a-z0-9]+/, } ] }, { className: 'tag', /* The lookahead pattern (?=...) ensures that 'begin' only matches ')/, end: />/, keywords: { name: 'style' }, contains: [ TAG_INTERNALS ], starts: { end: /<\/style>/, returnEnd: true, subLanguage: [ 'css', 'xml' ] } }, { className: 'tag', // See the comment in the ================================================ FILE: test/demo.html ================================================
================================================ FILE: test/index.html ================================================ highlighted-code
auto-height & disabled

disabled

auto-height
================================================ FILE: test/index.js ================================================ require('../cjs'); ================================================ FILE: test/middle.html ================================================ highlighted-code
auto-height & disabled

disabled

auto-height
================================================ FILE: test/package.json ================================================ {"type":"commonjs"} ================================================ FILE: web.js ================================================ var e={exports:{}}; /*! Highlight.js v11.5.0 (git: 7a62552656) (c) 2006-2022 Ivan Sagalaev and other contributors License: BSD-3-Clause */!function(e,n){var t,a=function(){var e={exports:{}};function n(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{var a=e[t];"object"!=typeof a||Object.isFrozen(a)||n(a)})),e}e.exports=n,e.exports.default=n;var t=e.exports;class a{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t}const s=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let n=e.kind;n=e.sublanguage?"language-"+n:((e,{prefix:n})=>{if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(n,{prefix:this.classPrefix}),this.span(n)}closeNode(e){s(e)&&(this.buffer+="
")}value(){return this.buffer}span(e){this.buffer+=``}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){return!0}}function d(e){return e?"string"==typeof e?e:e.source:null}function g(e){return h("(?=",e,")")}function u(e){return h("(?:",e,")*")}function b(e){return h("(?:",e,")?")}function h(...e){return e.map((e=>d(e))).join("")}function m(...e){const n=(e=>{const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}})(e);return"("+(n.capture?"":"?:")+e.map((e=>d(e))).join("|")+")"}function p(e){return RegExp(e.toString()+"|").exec("").length-1}const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function y(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let a=d(e),i="";for(;a.length>0;){const e=f.exec(a);if(!e){i+=a;break}i+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0],"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)}const E="[a-zA-Z]\\w*",v="[a-zA-Z_]\\w*",x="\\b\\d+(\\.\\d+)?",w="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",_="\\b(0b[01]+)",k={begin:"\\\\[\\s\\S]",relevance:0},N={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[k]},A={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[k]},S=(e,n,t={})=>{const a=r({scope:"comment",begin:e,end:n,contains:[]},t);a.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return a.contains.push({begin:h(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a},O=S("//","$"),M=S("/\\*","\\*/"),R=S("#","$");var T=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:E,UNDERSCORE_IDENT_RE:v,NUMBER_RE:x,C_NUMBER_RE:w,BINARY_NUMBER_RE:_,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=h(n,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:k,APOS_STRING_MODE:N,QUOTE_STRING_MODE:A,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:S,C_LINE_COMMENT_MODE:O,C_BLOCK_COMMENT_MODE:M,HASH_COMMENT_MODE:R,NUMBER_MODE:{scope:"number",begin:x,relevance:0},C_NUMBER_MODE:{scope:"number",begin:w,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:_,relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[k,{begin:/\[/,end:/\]/,relevance:0,contains:[k]}]}]},TITLE_MODE:{scope:"title",begin:E,relevance:0},UNDERSCORE_TITLE_MODE:{scope:"title",begin:v,relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})});function I(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function C(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function z(e,n){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function B(e,n){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function j(e,n){void 0===e.relevance&&(e.relevance=1)}const D=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=h(t.beforeMatch,g(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},$=["of","and","for","in","not","or","if","then","parent","list","value"];function P(e,n,t="keyword"){const a=Object.create(null);return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{Object.assign(a,P(e[t],n,t))})),a;function i(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|");a[t[0]]=[e,U(t[0],t[1])]}))}}function U(e,n){return n?Number(n):(e=>$.includes(e.toLowerCase()))(e)?0:1}const Z={},H=e=>{console.error(e)},F=(e,...n)=>{console.log("WARN: "+e,...n)},G=(e,n)=>{Z[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),Z[`${e}/${n}`]=!0)},K=Error();function W(e,n,{key:t}){let a=0;const i=e[t],r={},s={};for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=p(n[e-1]);e[t]=s,e[t]._emit=r,e[t]._multi=!0}function X(e){(e=>{e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),(e=>{if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw H("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),K;if("object"!=typeof e.beginScope||null===e.beginScope)throw H("beginScope must be object"),K;W(e,e.begin,{key:"beginScope"}),e.begin=y(e.begin,{joinWith:""})}})(e),(e=>{if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw H("skip, excludeEnd, returnEnd not compatible with endScope: {}"),K;if("object"!=typeof e.endScope||null===e.endScope)throw H("endScope must be object"),K;W(e,e.end,{key:"endScope"}),e.end=y(e.end,{joinWith:""})}})(e)}function q(e){function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(y(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function t(i,s){const o=i;if(i.isCompiled)return o;[C,B,X,D].forEach((e=>e(i,s))),e.compilerExtensions.forEach((e=>e(i,s))),i.__beforeBegin=null,[L,z,j].forEach((e=>e(i,s))),i.isCompiled=!0;let l=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=P(i.keywords,e.case_insensitive)),o.keywordPatternRe=n(l,!0),s&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(o.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(o.end)),o.terminatorEnd=d(o.end)||"",i.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+s.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>r(e,{variants:null},n)))),e.cachedVariants?e.cachedVariants:J(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e))("self"===e?i:e)))),i.contains.forEach((e=>{t(e,o)})),i.starts&&t(i.starts,s),o.matcher=(e=>{const n=new a;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function J(e){return!!e&&(e.endsWithParent||J(e.starts))}class Q extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const V=i,Y=r,ee=Symbol("nomatch");var ne=(e=>{const n=Object.create(null),i=Object.create(null),r=[];let s=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let d={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function p(e){return d.noHighlightRe.test(e)}function f(e,n,t){let a="",i="";"object"==typeof n?(a=e,t=n.ignoreIllegals,i=n.language):(G("10.7.0","highlight(lang, code, ...args) has been deprecated."),G("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};A("before:highlight",r);const s=r.result?r.result:y(r.language,r.code,t);return s.code=r.code,A("after:highlight",s),s}function y(e,t,i,r){const l=Object.create(null);function c(){if(!k.keywords)return void A.addText(S);let e=0;k.keywordPatternRe.lastIndex=0;let n=k.keywordPatternRe.exec(S),t="";for(;n;){t+=S.substring(e,n.index);const i=v.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,k.keywords[a]);if(r){const[e,a]=r;if(A.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(O+=a),e.startsWith("_"))t+=n[0];else{const t=v.classNameAliases[e]||e;A.addKeyword(n[0],t)}}else t+=n[0];e=k.keywordPatternRe.lastIndex,n=k.keywordPatternRe.exec(S)}var a;t+=S.substr(e),A.addText(t)}function g(){null!=k.subLanguage?(()=>{if(""===S)return;let e=null;if("string"==typeof k.subLanguage){if(!n[k.subLanguage])return void A.addText(S);e=y(k.subLanguage,S,!0,N[k.subLanguage]),N[k.subLanguage]=e._top}else e=E(S,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(O+=e.relevance),A.addSublanguage(e._emitter,e.language)})():c(),S=""}function u(e,n){let t=1;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue}const a=v.classNameAliases[e[t]]||e[t],i=n[t];a?A.addKeyword(i,a):(S=i,c(),S=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&A.openNode(v.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(A.addKeyword(S,v.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),S=""):e.beginScope._multi&&(u(e.beginScope,n),S="")),k=Object.create(e,{parent:{value:k}}),k}function h(e,n,t){let i=((e,n)=>{const t=e&&e.exec(n);return t&&0===t.index})(e.endRe,t);if(i){if(e["on:end"]){const t=new a(e);e["on:end"](n,t),t.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return h(e.parent,n,t)}function m(e){return 0===k.matcher.regexIndex?(S+=e[0],1):(T=!0,0)}let p={};function f(n,r){const o=r&&r[0];if(S+=n,null==o)return g(),0;if("begin"===p.type&&"end"===r.type&&p.index===r.index&&""===o){if(S+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=p.rule,n}return 1}if(p=r,"begin"===r.type)return(e=>{const n=e[0],t=e.rule,i=new a(t),r=[t.__beforeBegin,t["on:begin"]];for(const t of r)if(t&&(t(e,i),i.isMatchIgnored))return m(n);return t.skip?S+=n:(t.excludeBegin&&(S+=n),g(),t.returnBegin||t.excludeBegin||(S=n)),b(t,e),t.returnBegin?0:n.length})(r);if("illegal"===r.type&&!i){const e=Error('Illegal lexeme "'+o+'" for mode "'+(k.scope||"")+'"');throw e.mode=k,e}if("end"===r.type){const e=function(e){const n=e[0],a=t.substr(e.index),i=h(k,e,a);if(!i)return ee;const r=k;k.endScope&&k.endScope._wrap?(g(),A.addKeyword(n,k.endScope._wrap)):k.endScope&&k.endScope._multi?(g(),u(k.endScope,e)):r.skip?S+=n:(r.returnEnd||r.excludeEnd||(S+=n),g(),r.excludeEnd&&(S=n));do{k.scope&&A.closeNode(),k.skip||k.subLanguage||(O+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length}(r);if(e!==ee)return e}if("illegal"===r.type&&""===o)return 1;if(R>1e5&&R>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return S+=o,o.length}const v=_(e);if(!v)throw H(o.replace("{}",e)),Error('Unknown language: "'+e+'"');const x=q(v);let w="",k=r||x;const N={},A=new d.__emitter(d);(()=>{const e=[];for(let n=k;n!==v;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>A.openNode(e)))})();let S="",O=0,M=0,R=0,T=!1;try{for(k.matcher.considerAll();;){R++,T?T=!1:k.matcher.considerAll(),k.matcher.lastIndex=M;const e=k.matcher.exec(t);if(!e)break;const n=f(t.substring(M,e.index),e);M=e.index+n}return f(t.substr(M)),A.closeAllNodes(),A.finalize(),w=A.toHTML(),{language:e,value:w,relevance:O,illegal:!1,_emitter:A,_top:k}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:V(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:M,context:t.slice(M-100,M+100),mode:n.mode,resultSoFar:w},_emitter:A};if(s)return{language:e,value:V(t),illegal:!1,relevance:0,errorRaised:n,_emitter:A,_top:k};throw n}}function E(e,t){t=t||d.languages||Object.keys(n);const a=(e=>{const n={value:V(e),illegal:!1,relevance:0,_top:l,_emitter:new d.__emitter(d)};return n._emitter.addText(e),n})(e),i=t.filter(_).filter(N).map((n=>y(n,e,!1)));i.unshift(a);const r=i.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(_(e.language).supersetOf===n.language)return 1;if(_(n.language).supersetOf===e.language)return-1}return 0})),[s,o]=r,c=s;return c.secondBest=o,c}function v(e){let n=null;const t=(e=>{let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=d.languageDetectRe.exec(n);if(t){const n=_(t[1]);return n||(F(o.replace("{}",t[1])),F("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>p(e)||_(e)))})(e);if(p(t))return;if(A("before:highlightElement",{el:e,language:t}),e.children.length>0&&(d.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),d.throwUnescapedHTML))throw new Q("One of your code blocks includes unescaped HTML.",e.innerHTML);n=e;const a=n.textContent,r=t?f(a,{language:t,ignoreIllegals:!0}):E(a);e.innerHTML=r.value,((e,n,t)=>{const a=n&&i[n]||t;e.classList.add("hljs"),e.classList.add("language-"+a)})(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),A("after:highlightElement",{el:e,result:r,text:a})}let x=!1;function w(){"loading"!==document.readyState?document.querySelectorAll(d.cssSelector).forEach(v):x=!0}function _(e){return e=(e||"").toLowerCase(),n[e]||n[i[e]]}function k(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{i[e.toLowerCase()]=n}))}function N(e){const n=_(e);return n&&!n.disableAutodetect}function A(e,n){const t=e;r.forEach((e=>{e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{x&&w()}),!1),Object.assign(e,{highlight:f,highlightAuto:E,highlightAll:w,highlightElement:v,highlightBlock:e=>(G("10.7.0","highlightBlock will be removed entirely in v12.0"),G("10.7.0","Please use highlightElement now."),v(e)),configure:e=>{d=Y(d,e)},initHighlighting:()=>{w(),G("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{w(),G("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(t,a)=>{let i=null;try{i=a(e)}catch(e){if(H("Language definition for '{}' could not be registered.".replace("{}",t)),!s)throw e;H(e),i=l}i.name||(i.name=t),n[t]=i,i.rawDefinition=a.bind(null,e),i.aliases&&k(i.aliases,{languageName:t})},unregisterLanguage:e=>{delete n[e];for(const n of Object.keys(i))i[n]===e&&delete i[n]},listLanguages:()=>Object.keys(n),getLanguage:_,registerAliases:k,autoDetection:N,inherit:Y,addPlugin:e=>{(e=>{e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)}}),e.debugMode=()=>{s=!1},e.safeMode=()=>{s=!0},e.versionString="11.5.0",e.regex={concat:h,lookahead:g,either:m,optional:b,anyNumberOfTimes:u};for(const e in T)"object"==typeof T[e]&&t(T[e]);return Object.assign(e,T),e})({});return ne}();e.exports=a,/*! `css` grammar compiled for Highlight.js 11.5.0 */ t=(()=>{const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],t=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],a=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],i=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();return r=>{const s=r.regex,o=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(r),l=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[o.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},o.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+t.join("|")+")"},{begin:":(:)?("+a.join("|")+")"}]},o.CSS_VARIABLE,{className:"attribute",begin:"\\b("+i.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[o.BLOCK_COMMENT,o.HEXCOLOR,o.IMPORTANT,o.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},o.FUNCTION_DISPATCH]},{begin:s.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:n.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,o.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+e.join("|")+")\\b"}]}}})(),a.registerLanguage("css",t),/*! `javascript` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],t=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],i=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],s=["arguments","this","super","console","window","document","localStorage","module","global"],o=[].concat(r,a,i);return l=>{const c=l.regex,d=e,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,a=e.input[t];if("<"===a||","===a)return void n.ignoreMatch();let i;">"===a&&(((e,{after:n})=>{const t="",C={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,c.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[l.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},l.APOS_STRING_MODE,l.QUOTE_STRING_MODE,f,y,E,v,m,A,{className:"attr",begin:d+c.lookahead(":"),relevance:0},C,{begin:"("+l.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,l.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:l.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+l.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,l.inherit(l.TITLE_MODE,{begin:d,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},O,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},N,T,{match:/\$[(.]/}]}}})();a.registerLanguage("javascript",e)})(),/*! `xml` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=e=>{const n=e.regex,t=n.concat(/[A-Z_]/,n.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,r,o,s]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}};a.registerLanguage("xml",e)})(),/*! `typescript` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=(()=>{const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],t=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],i=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],s=["arguments","this","super","console","window","document","localStorage","module","global"],o=[].concat(r,a,i);function l(l){const c=l.regex,d=e,g={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,a=e.input[t];if("<"===a||","===a)return void n.ignoreMatch();let i;">"===a&&(((e,{after:n})=>{const t="",C={match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,/(async\s*)?/,c.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:A},illegal:/#(?![$_A-z])/,contains:[l.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},l.APOS_STRING_MODE,l.QUOTE_STRING_MODE,f,y,E,v,m,A,{className:"attr",begin:d+c.lookahead(":"),relevance:0},C,{begin:"("+l.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,l.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:l.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:g.begin,"on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+l.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,l.inherit(l.TITLE_MODE,{begin:d,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+d,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},O,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},N,T,{match:/\$[(.]/}]}}return a=>{const i=l(a),r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[i.exports.CLASS_REFERENCE]},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[i.exports.CLASS_REFERENCE]},g={$pattern:e,keyword:n.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:t,built_in:o.concat(r),"variable.language":s},u={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},b=(e,n,t)=>{const a=e.contains.findIndex((e=>e.label===n));if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,t)};return Object.assign(i.keywords,g),i.exports.PARAMS_CONTAINS.push(u),i.contains=i.contains.concat([u,c,d]),b(i,"shebang",a.SHEBANG()),b(i,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),i.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx"]}),i}})();a.registerLanguage("typescript",e)})(),/*! `markdown` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=e=>{const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]},r=e.inherit(a,{contains:[]}),s=e.inherit(i,{contains:[]});a.contains.push(s),i.contains.push(r);let o=[n,t];return[a,i,r,s].forEach((e=>{e.contains=e.contains.concat(o)})),o=o.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:o}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:o,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}};a.registerLanguage("markdown",e)})(),/*! `json` grammar compiled for Highlight.js 11.5.0 */ (()=>{var e=e=>({name:"JSON",contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{beginKeywords:"true false null"},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"});a.registerLanguage("json",e)})()}(e);var n=e.exports; /*! (c) Andrea Giammarchi - ISC */const t="highlighted-code",a=new WeakMap,i=new Set,r={timeout:300,box:"border-box"},s="function"!=typeof cancelIdleCallback,o=s?setTimeout:requestIdleCallback,l=s?clearTimeout:cancelIdleCallback,c="object"==typeof netscape;let d,g;class u extends HTMLTextAreaElement{static get library(){return n}static get observedAttributes(){return["auto-height","disabled","language","tab-size"]}static insertText(e){const{activeElement:n}=document;try{if(!(e?document.execCommand("insertText",!1,e):document.execCommand("delete")))throw event}catch(t){const{selectionStart:a}=n;n.setRangeText(e),n.selectionStart=n.selectionEnd=a+e.length}n.oninput()}static useTheme(e){d||(d=document.head.appendChild(document.createElement("link")),d.rel="stylesheet",d.addEventListener("load",(()=>{for(const e of document.querySelectorAll(`textarea[is="${t}"]`))m.call(e)}))),d.href=e.includes(".")?e:`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/${e}.min.css`}constructor(){super(),this.idle=0;const e=this.ownerDocument.createElement("pre");e.className=t,e.innerHTML="",a.set(this,e),this.style.cssText+="\n tab-size: 2;\n white-space: pre;\n font-family: monospace;\n color: transparent;\n background-color: transparent;\n ";const{autoHeight:n,language:i,tabSize:r}=this;n&&(delete this.autoHeight,this.autoHeight=n),i&&(delete this.language,this.language=i),r&&(delete this.tabSize,this.tabSize=r)}get autoHeight(){return this.hasAttribute("auto-height")}set autoHeight(e){e?(this.style.resize="none",this.setAttribute("auto-height","")):(this.style.resize=null,this.removeAttribute("auto-height"))}get language(){return this.getAttribute("language")}set language(e){this.setAttribute("language",e)}get tabSize(){return this.getAttribute("tab-size")}set tabSize(e){this.setAttribute("tab-size",e)}get value(){return super.value}set value(e){super.value=e,this.oninput()}attributeChangedCallback(e,n,t){switch(e){case"auto-height":this.style.height=null,null!=t&&(this.value=this.value.trimEnd(),h.call(this));break;case"disabled":c&&(a.get(this).style.pointerEvents=this.disabled?"all":"none");break;case"language":let e="hljs";t&&(e+=" language-"+t),a.get(this).querySelector("code").className=e;break;case"tab-size":this.style.tabSize=t,a.get(this).style.tabSize=t}}connectedCallback(){i.add(this),this.parentElement.insertBefore(a.get(this),this.nextSibling),this.oninput(),m.call(this),g.observe(this,r),this.addEventListener("keydown",this),this.addEventListener("scroll",this),this.addEventListener("input",this)}disconnectedCallback(){i.delete(this),a.get(this).remove(),g.unobserve(this),this.removeEventListener("keydown",this),this.removeEventListener("scroll",this),this.removeEventListener("input",this)}handleEvent(e){this["on"+e.type](e)}onkeydown(e){"Tab"===e.key&&(u.insertText("\t"),e.preventDefault())}oninput(){l(this.idle);const e=this.idle=o((()=>{const{language:t,value:i}=this,r=a.get(this).querySelector("code");t||(r.className="hljs"),r.innerHTML=(t?n.highlight(i,{language:t}):n.highlightAuto(i)).value+"
",this.onscroll(),e===this.idle&&this.autoHeight&&h.call(this)}),r)}onscroll(){const{scrollTop:e,scrollLeft:n}=this,t=a.get(this);t.scrollTop=e,t.scrollLeft=n,c&&"scrollLeftMax"in t&&(this.scrollLeft=Math.min(n,t.scrollLeftMax))}}if(!customElements.get(t)){const e=e=>{for(const{target:n}of e){const e=a.get(n),{border:t,font:i,letterSpacing:r,lineHeight:s,padding:o,wordSpacing:l}=getComputedStyle(n),{top:d,left:g,width:u,height:b}=n.getBoundingClientRect();e.style.cssText=`\n position: absolute;\n overflow: auto;\n box-sizing: border-box;\n pointer-events: ${c&&n.disabled?"all":"none"};\n tab-size: ${n.tabSize||2};\n top: ${d+scrollY}px;\n left: ${g+scrollX}px;\n width: ${u}px;\n height: ${b}px;\n font: ${i};\n letter-spacing: ${r};\n word-spacing: ${l};\n line-height: ${s};\n padding: ${o};\n border: ${t};\n margin: 0;\n background: initial;\n border-color: transparent;\n `}};addEventListener("resize",(()=>{const n=[];for(const e of i)n.push({target:e});e(n)})),g=new ResizeObserver(e),customElements.define(t,u,{extends:"textarea"})}var b=customElements.get(t);function h(){this.style.height="auto";const{boxSizing:e,borderTop:n,borderBottom:t,paddingTop:a,paddingBottom:i}=getComputedStyle(this),r=(parseFloat(a)||0)+(parseFloat(i)||0),s=(parseFloat(n)||0)+(parseFloat(t)||0),o="border-box"===e?-s:r;this.style.height=this.scrollHeight-o+"px"}function m(){const e=a.get(this).querySelector("code");e.style.backgroundColor=null;const{color:n,backgroundColor:t}=getComputedStyle(e);this.style.caretColor=n,this.style.backgroundColor=t,e.style.cssText="\n background-color: transparent;\n overflow: unset;\n margin: 0;\n padding: 0;\n "}export{b as default};