@oscloudlab/knowledge-card 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abap-bNFqRLO1.js +84 -0
- package/dist/abnf-hvXtkKLY.js +87 -0
- package/dist/actionscript-6i80VbAv.js +43 -0
- package/dist/ada-CiSKRw34.js +52 -0
- package/dist/agda-BELchEdZ.js +56 -0
- package/dist/al-DkPZllof.js +56 -0
- package/dist/antlr4-D6U2qvIr.js +96 -0
- package/dist/apacheconf-DoADUQkC.js +80 -0
- package/dist/apex-Dwxgykqz.js +104 -0
- package/dist/apl-n43gQAL3.js +65 -0
- package/dist/applescript-DUNzhl2t.js +50 -0
- package/dist/aql-BNnsomU8.js +82 -0
- package/dist/arduino-Ctiiir5A.js +41 -0
- package/dist/arff-CF3A9Ff-.js +43 -0
- package/dist/asciidoc-BORHAu3L.js +240 -0
- package/dist/asm6502-OhJaS22O.js +62 -0
- package/dist/asmatmel-CG3mJBJs.js +74 -0
- package/dist/aspnet-Bgu9cVxS.js +83 -0
- package/dist/autohotkey-BMzF8w3W.js +64 -0
- package/dist/autoit-BUz7W_A-.js +67 -0
- package/dist/avisynth-D_5DsX9W.js +195 -0
- package/dist/avro-idl-DXBF-8pT.js +74 -0
- package/dist/bash-0-vitIuH.js +223 -0
- package/dist/bash-CmPTK8K6.js +26 -0
- package/dist/basic-CBrKUqQp.js +28 -0
- package/dist/basic-CgjK_kM4.js +26 -0
- package/dist/batch-DDuJqYDJ.js +125 -0
- package/dist/bbcode-BBBJW4h9.js +60 -0
- package/dist/bicep-B7Vet2aR.js +102 -0
- package/dist/birb-DPs12VRI.js +53 -0
- package/dist/bison-BKvEoKEG.js +73 -0
- package/dist/bnf-CaE0Bt3T.js +52 -0
- package/dist/brainfuck-GdsepcND.js +53 -0
- package/dist/brightscript-CaQ-B4pE.js +76 -0
- package/dist/bro-C_rmjGgn.js +60 -0
- package/dist/bsl-DQhyt9j4.js +101 -0
- package/dist/c-D8-laUL_.js +26 -0
- package/dist/c-b2c4WJSm.js +83 -0
- package/dist/cfscript-DcwVkFDX.js +71 -0
- package/dist/chaiscript-C1jdPAs0.js +89 -0
- package/dist/cil-C54xDxMg.js +52 -0
- package/dist/clike-D8ff3B0t.js +61 -0
- package/dist/clojure-BtKUzyKV.js +63 -0
- package/dist/cmake-CcFmEv5M.js +62 -0
- package/dist/cobol-SnYz3b9P.js +82 -0
- package/dist/coffeescript-CKJzYVhc.js +110 -0
- package/dist/concurnas-C6YKMKIG.js +90 -0
- package/dist/coq-AH1nKVcq.js +81 -0
- package/dist/core-CcwoL92f.js +1712 -0
- package/dist/cpp-Bh1PKWEj.js +26 -0
- package/dist/cpp-C0j-5811.js +115 -0
- package/dist/crystal-ByWjq0Om.js +87 -0
- package/dist/csharp-BmDeN1AH.js +388 -0
- package/dist/csharp-C-RIlwgF.js +26 -0
- package/dist/cshtml-BX2903vs.js +134 -0
- package/dist/csp-BKqyZN9w.js +90 -0
- package/dist/css-9KZNpeR_.js +90 -0
- package/dist/css-extras-DWWoGQa1.js +139 -0
- package/dist/csv-6jawsFvm.js +37 -0
- package/dist/cypher-GT5Ln_K4.js +65 -0
- package/dist/d-DQuNeOB7.js +109 -0
- package/dist/dart-CHER8X1l.js +101 -0
- package/dist/dataweave-DL_Y2LqP.js +73 -0
- package/dist/dax-D27J9qU6.js +60 -0
- package/dist/dhall-C-Dtjrdj.js +95 -0
- package/dist/diff-Dg1kV9wC.js +78 -0
- package/dist/django-LEJ_YyjH.js +81 -0
- package/dist/dns-zone-file-CX7rXdX2.js +64 -0
- package/dist/docker-CtY3JCLx.js +127 -0
- package/dist/dot-od_DZdpT.js +102 -0
- package/dist/ebnf-DIuzViAe.js +53 -0
- package/dist/editorconfig-CX02cRV5.js +60 -0
- package/dist/eiffel-D3XUiBw2.js +67 -0
- package/dist/ejs-2AfMOM5A.js +58 -0
- package/dist/elixir-722y_YPp.js +129 -0
- package/dist/elm-CIyhdE5y.js +78 -0
- package/dist/erb-B4chbVqA.js +60 -0
- package/dist/erlang-DxizlpkP.js +76 -0
- package/dist/etlua-D_9hun9v.js +58 -0
- package/dist/excel-formula-CmpI_82m.js +95 -0
- package/dist/factor-krg_8lb-.js +949 -0
- package/dist/false-B2gdCewG.js +60 -0
- package/dist/firestore-security-rules-xige90gq.js +67 -0
- package/dist/flow-bpD4sbhm.js +57 -0
- package/dist/fortran-B4crZzNk.js +73 -0
- package/dist/fsharp-BnvVN9HC.js +105 -0
- package/dist/ftl-BoWDVp6s.js +146 -0
- package/dist/gap-DxJ82BxA.js +78 -0
- package/dist/gcode-u6kBGAFD.js +49 -0
- package/dist/gdscript-DvuFm0WL.js +60 -0
- package/dist/gedcom-D6YNHC5R.js +61 -0
- package/dist/gherkin-DhC07ENE.js +115 -0
- package/dist/git-5vwNu_fL.js +96 -0
- package/dist/glsl-BGzQvWQa.js +39 -0
- package/dist/gml-DQQsqa0X.js +40 -0
- package/dist/gn-Bz3fehJS.js +76 -0
- package/dist/go-DQVNbr0F.js +57 -0
- package/dist/go-module-DAdBkEV6.js +55 -0
- package/dist/graphql-b5aI1fau.js +154 -0
- package/dist/groovy-C4Zi8h0f.js +82 -0
- package/dist/haml-B9jL77OH.js +172 -0
- package/dist/handlebars-BWszzUxR.js +74 -0
- package/dist/haskell-BrIvnyGx.js +26 -0
- package/dist/haskell-DR6jYji5.js +75 -0
- package/dist/haxe-DUpmVd5P.js +105 -0
- package/dist/hcl-CLqVpYtA.js +93 -0
- package/dist/hlsl-CsYJVSWg.js +55 -0
- package/dist/hoon-D0TgxHvB.js +47 -0
- package/dist/hpkp-BiU-mQjG.js +41 -0
- package/dist/hsts-DE54dR1b.js +41 -0
- package/dist/http-CfgOm4UI.js +155 -0
- package/dist/ichigojam-CVZ6Aj_t.js +46 -0
- package/dist/icon-CekiVVmc.js +53 -0
- package/dist/icu-message-format-CJA9loKb.js +165 -0
- package/dist/idris-KG9ztadM.js +51 -0
- package/dist/iecst-wFMMjMpf.js +65 -0
- package/dist/ignore-Byv4NN_B.js +51 -0
- package/dist/index-Sj89RFCY.js +136569 -0
- package/dist/index.esm.js +2 -683
- package/dist/index.umd.js +1611 -15
- package/dist/inform7-YsL-LiaC.js +90 -0
- package/dist/ini-ChNiYeuM.js +73 -0
- package/dist/io-BzLClKN_.js +55 -0
- package/dist/j-BuLAn7Gf.js +61 -0
- package/dist/java-3PJ6FLyt.js +26 -0
- package/dist/java-DYIb7l3j.js +98 -0
- package/dist/javadoc-BnSaiIyg.js +118 -0
- package/dist/javadoclike-BSqXhy54.js +26 -0
- package/dist/javadoclike-CHbTYI14.js +59 -0
- package/dist/javascript-Cl708kfq.js +152 -0
- package/dist/javastacktrace-DVGIqwxN.js +167 -0
- package/dist/jexl-DMjq6Vaw.js +47 -0
- package/dist/jolie-DXoSR52A.js +72 -0
- package/dist/jq-Dp1c5kuj.js +100 -0
- package/dist/js-extras-DJfB1MC8.js +150 -0
- package/dist/js-templates--GrCX2F1.js +197 -0
- package/dist/jsdoc-vErSu9Cr.js +116 -0
- package/dist/json-BW8KBIeJ.js +35 -0
- package/dist/json-BefNJCW-.js +26 -0
- package/dist/json5-CsdIXkOZ.js +56 -0
- package/dist/jsonp-Dz_5Lt-E.js +41 -0
- package/dist/jsstacktrace-DbBQ3Cv7.js +74 -0
- package/dist/jsx-Bv5_R7Yd.js +26 -0
- package/dist/jsx-FTe7XA1B.js +77 -0
- package/dist/julia-CoYGw2IR.js +68 -0
- package/dist/keepalived-CPWdwddz.js +81 -0
- package/dist/keyman-DNslP0Yy.js +76 -0
- package/dist/kotlin-CbZgjbyh.js +108 -0
- package/dist/kumir-Q_jLwxfZ.js +120 -0
- package/dist/kusto-dM9uOfWk.js +71 -0
- package/dist/latex-Bfeq39tO.js +92 -0
- package/dist/latte-CFxOlcdj.js +101 -0
- package/dist/less-DwfFB3qp.js +75 -0
- package/dist/lilypond-DaH_baew.js +104 -0
- package/dist/liquid-5rAVI9Ad.js +97 -0
- package/dist/lisp-Btc3xid7.js +194 -0
- package/dist/livescript-DQvJc3cA.js +150 -0
- package/dist/llvm-B7k0U20m.js +52 -0
- package/dist/log-B7ulCZCI.js +133 -0
- package/dist/lolcode-BEEMlfuU.js +81 -0
- package/dist/lua-BggcDXQp.js +31 -0
- package/dist/lua-D-T62TZ5.js +26 -0
- package/dist/magma-DAN3ZGAI.js +63 -0
- package/dist/makefile-Bjl-N6S3.js +63 -0
- package/dist/markdown-6Q2QSFJe.js +355 -0
- package/dist/markup-Bwuswjib.js +194 -0
- package/dist/markup-templating-BLspI5oq.js +26 -0
- package/dist/markup-templating-CVTxtFGH.js +77 -0
- package/dist/matlab-Bim6HLuO.js +46 -0
- package/dist/maxscript-BJqnafAC.js +97 -0
- package/dist/mel-C4iJe_aZ.js +74 -0
- package/dist/mermaid-DbKsw5IU.js +137 -0
- package/dist/mizar-DdUuEnQ0.js +45 -0
- package/dist/mongodb-C7OZqIiL.js +321 -0
- package/dist/monkey-CFQNpGhn.js +61 -0
- package/dist/moonscript-BDdCZd5M.js +87 -0
- package/dist/n1ql-C-ll6pgt.js +55 -0
- package/dist/n4js-DCLtuFdY.js +43 -0
- package/dist/nand2tetris-hdl-DJsK5r3l.js +42 -0
- package/dist/naniscript-DtHo8Sfl.js +165 -0
- package/dist/nasm-gJZT8LPh.js +57 -0
- package/dist/neon-SaMGcsnU.js +73 -0
- package/dist/nevod-Dqvto6vw.js +158 -0
- package/dist/nginx-Cp89qRQy.js +82 -0
- package/dist/nim-CdGVC6Mb.js +75 -0
- package/dist/nix-jnfiSyYI.js +69 -0
- package/dist/nsis-BZ4yPak6.js +58 -0
- package/dist/objectivec-B9lo2Gq2.js +44 -0
- package/dist/ocaml-DtZ_IyiS.js +88 -0
- package/dist/opencl-CtUznKol.js +83 -0
- package/dist/openqasm-BAmjbx7B.js +50 -0
- package/dist/oz-mvOvhn7u.js +61 -0
- package/dist/parigp-B5Xdmiju.js +81 -0
- package/dist/parser-Ct77dMe3.js +106 -0
- package/dist/pascal-Dwf-aqDs.js +95 -0
- package/dist/pascaligo-DWTvG1fw.js +115 -0
- package/dist/pcaxis-BUnNg5h_.js +84 -0
- package/dist/peoplecode-CewkQs1u.js +74 -0
- package/dist/perl-CmRi-uRU.js +164 -0
- package/dist/php-C_FrOCG4.js +334 -0
- package/dist/php-e7f7GtZ8.js +26 -0
- package/dist/php-extras-ATZDccPm.js +50 -0
- package/dist/phpdoc-uba1O-5-.js +61 -0
- package/dist/plsql-BLNilzVM.js +51 -0
- package/dist/powerquery-CddEWH0P.js +83 -0
- package/dist/powershell-SimxvdWh.js +88 -0
- package/dist/processing-IeXhsRmw.js +46 -0
- package/dist/prolog-CnTr7enQ.js +52 -0
- package/dist/promql-DpmXmCiA.js +120 -0
- package/dist/properties-BraQbkIL.js +42 -0
- package/dist/protobuf-BKmtm9wI.js +71 -0
- package/dist/psl-DfJLNMzA.js +68 -0
- package/dist/pug-C7olXkyh.js +212 -0
- package/dist/puppet-DMdAuQ_Z.js +167 -0
- package/dist/pure-BVQraXQo.js +111 -0
- package/dist/purebasic-DnAwivDW.js +87 -0
- package/dist/purescript-BBcUX3cf.js +62 -0
- package/dist/python-C9JXUpy2.js +94 -0
- package/dist/q-Ct9Ut4C4.js +83 -0
- package/dist/qml-DubjWeE3.js +103 -0
- package/dist/qore-CDjxpVlT.js +53 -0
- package/dist/qsharp-Dyr5mrma.js +128 -0
- package/dist/r-B4F2KUJL.js +55 -0
- package/dist/racket-D5k9UW-t.js +50 -0
- package/dist/reason-Cs82zJO7.js +54 -0
- package/dist/regex-Z8MvaNEm.js +124 -0
- package/dist/rego-CcGrxeab.js +58 -0
- package/dist/renpy-mByYQWSM.js +51 -0
- package/dist/rest-BoR9ZMoX.js +231 -0
- package/dist/rip-C3Bf4Bpl.js +62 -0
- package/dist/roboconf-1MYmsJJ7.js +60 -0
- package/dist/robotframework-fBSrPGHK.js +122 -0
- package/dist/ruby-BQlisu6i.js +182 -0
- package/dist/ruby-DRrUXRqW.js +26 -0
- package/dist/rust-DhUR7ICB.js +149 -0
- package/dist/sas-D7DM5vmM.js +362 -0
- package/dist/sass-B-3W9xmk.js +96 -0
- package/dist/scala-DmHnWeTz.js +80 -0
- package/dist/scheme-B-TWMKN_.js +122 -0
- package/dist/scheme-egHBLRqV.js +26 -0
- package/dist/scss-BU4D1BLj.js +106 -0
- package/dist/shell-session-6QFBv7G6.js +93 -0
- package/dist/smali-B48Y4QYt.js +112 -0
- package/dist/smalltalk-w59b04aF.js +71 -0
- package/dist/smarty-CnWvL-Ef.js +147 -0
- package/dist/sml-cUUD1qMQ.js +91 -0
- package/dist/solidity-Drt__SLk.js +49 -0
- package/dist/solution-file-CYG1BOQK.js +79 -0
- package/dist/soy-BZNQzgkB.js +112 -0
- package/dist/sparql-BQDndvZG.js +49 -0
- package/dist/splunk-spl-ezOLCJwA.js +57 -0
- package/dist/sqf-C83ezg-4.js +63 -0
- package/dist/sql-CVBSuRzU.js +26 -0
- package/dist/sql-qhcRp-Km.js +44 -0
- package/dist/squirrel-2r-3bEO_.js +74 -0
- package/dist/stan-D2wLHzr8.js +86 -0
- package/dist/style.css +1 -1
- package/dist/stylus-KkSvURTJ.js +165 -0
- package/dist/swift-c7528WsQ.js +152 -0
- package/dist/systemd-DWsV0AtP.js +88 -0
- package/dist/t4-cs-D7NmzTCB.js +38 -0
- package/dist/t4-templating-Bc9GyRcs.js +26 -0
- package/dist/t4-templating-yxm91MEk.js +56 -0
- package/dist/t4-vb-Df3tMe1Q.js +38 -0
- package/dist/tap-wFXvu_No.js +56 -0
- package/dist/tcl-BZqzhUcQ.js +79 -0
- package/dist/textile-DrTKyn7T.js +289 -0
- package/dist/toml-LVQpNmZe.js +86 -0
- package/dist/tremor-A_cxX8C4.js +90 -0
- package/dist/tsx-CQKNNLzi.js +46 -0
- package/dist/tt2-CPOtfoBh.js +78 -0
- package/dist/turtle-BjRE9oBS.js +26 -0
- package/dist/turtle-z6QfbtiY.js +61 -0
- package/dist/twig-Cz25rowk.js +72 -0
- package/dist/typescript--VNBoLO-.js +56 -0
- package/dist/typescript-Bx2QMcny.js +26 -0
- package/dist/typoscript-BdH7x5a4.js +109 -0
- package/dist/unrealscript-Cb8322pT.js +71 -0
- package/dist/uorazor-CHv0VHYn.js +81 -0
- package/dist/uri-ci9M926F.js +116 -0
- package/dist/v-DL4z_kNT.js +106 -0
- package/dist/vala-CPIzd5en.js +113 -0
- package/dist/vbnet-BoCvq106.js +26 -0
- package/dist/vbnet-ClfmYufs.js +36 -0
- package/dist/velocity-CBXhMUrK.js +99 -0
- package/dist/verilog-C1ZX-Tr8.js +59 -0
- package/dist/vhdl-CLlMgFjz.js +56 -0
- package/dist/vim-BuFUFT06.js +43 -0
- package/dist/visual-basic-CzPES6jG.js +59 -0
- package/dist/warpscript-C5YvStKz.js +54 -0
- package/dist/wasm-txCKMkgE.js +64 -0
- package/dist/web-idl-B4OgJf1y.js +118 -0
- package/dist/wiki-C6_DR7WK.js +110 -0
- package/dist/wolfram-D9ETP9M6.js +58 -0
- package/dist/wren-CkhJWcmB.js +121 -0
- package/dist/xeora-Cg3OrGlT.js +147 -0
- package/dist/xml-doc-C0mFvWUS.js +56 -0
- package/dist/xojo-CW6K9MHL.js +51 -0
- package/dist/xquery-B0ssbj_m.js +118 -0
- package/dist/yaml-S0xfBtlT.js +26 -0
- package/dist/yaml-hxc7aP7n.js +92 -0
- package/dist/yang-Dg6OSQ6Y.js +53 -0
- package/dist/zig-xuUtE8Pe.js +117 -0
- package/package.json +30 -4
- package/dist/index.d.ts +0 -2
|
@@ -0,0 +1,1712 @@
|
|
|
1
|
+
import { c as fe, g as yn } from "./index-Sj89RFCY.js";
|
|
2
|
+
import { a as xn } from "./markup-Bwuswjib.js";
|
|
3
|
+
import { a as bn } from "./css-9KZNpeR_.js";
|
|
4
|
+
import { a as wn } from "./clike-D8ff3B0t.js";
|
|
5
|
+
import { a as Cn } from "./javascript-Cl708kfq.js";
|
|
6
|
+
function Sn(e, n) {
|
|
7
|
+
for (var r = 0; r < n.length; r++) {
|
|
8
|
+
const t = n[r];
|
|
9
|
+
if (typeof t != "string" && !Array.isArray(t)) {
|
|
10
|
+
for (const f in t)
|
|
11
|
+
if (f !== "default" && !(f in e)) {
|
|
12
|
+
const v = Object.getOwnPropertyDescriptor(t, f);
|
|
13
|
+
v && Object.defineProperty(e, f, v.get ? v : {
|
|
14
|
+
enumerable: !0,
|
|
15
|
+
get: () => t[f]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
21
|
+
}
|
|
22
|
+
var An = En, Pn = Object.prototype.hasOwnProperty;
|
|
23
|
+
function En() {
|
|
24
|
+
for (var e = {}, n = 0; n < arguments.length; n++) {
|
|
25
|
+
var r = arguments[n];
|
|
26
|
+
for (var t in r)
|
|
27
|
+
Pn.call(r, t) && (e[t] = r[t]);
|
|
28
|
+
}
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
var Ve = Ke, xe = Ke.prototype;
|
|
32
|
+
xe.space = null;
|
|
33
|
+
xe.normal = {};
|
|
34
|
+
xe.property = {};
|
|
35
|
+
function Ke(e, n, r) {
|
|
36
|
+
this.property = e, this.normal = n, r && (this.space = r);
|
|
37
|
+
}
|
|
38
|
+
var Oe = An, $n = Ve, Tn = kn;
|
|
39
|
+
function kn(e) {
|
|
40
|
+
for (var n = e.length, r = [], t = [], f = -1, v, m; ++f < n; )
|
|
41
|
+
v = e[f], r.push(v.property), t.push(v.normal), m = v.space;
|
|
42
|
+
return new $n(
|
|
43
|
+
Oe.apply(null, r),
|
|
44
|
+
Oe.apply(null, t),
|
|
45
|
+
m
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
var be = Ln;
|
|
49
|
+
function Ln(e) {
|
|
50
|
+
return e.toLowerCase();
|
|
51
|
+
}
|
|
52
|
+
var Ye = Xe, U = Xe.prototype;
|
|
53
|
+
U.space = null;
|
|
54
|
+
U.attribute = null;
|
|
55
|
+
U.property = null;
|
|
56
|
+
U.boolean = !1;
|
|
57
|
+
U.booleanish = !1;
|
|
58
|
+
U.overloadedBoolean = !1;
|
|
59
|
+
U.number = !1;
|
|
60
|
+
U.commaSeparated = !1;
|
|
61
|
+
U.spaceSeparated = !1;
|
|
62
|
+
U.commaOrSpaceSeparated = !1;
|
|
63
|
+
U.mustUseProperty = !1;
|
|
64
|
+
U.defined = !1;
|
|
65
|
+
function Xe(e, n) {
|
|
66
|
+
this.property = e, this.attribute = n;
|
|
67
|
+
}
|
|
68
|
+
var H = {}, On = 0;
|
|
69
|
+
H.boolean = X();
|
|
70
|
+
H.booleanish = X();
|
|
71
|
+
H.overloadedBoolean = X();
|
|
72
|
+
H.number = X();
|
|
73
|
+
H.spaceSeparated = X();
|
|
74
|
+
H.commaSeparated = X();
|
|
75
|
+
H.commaOrSpaceSeparated = X();
|
|
76
|
+
function X() {
|
|
77
|
+
return Math.pow(2, ++On);
|
|
78
|
+
}
|
|
79
|
+
var Je = Ye, Me = H, Qe = we;
|
|
80
|
+
we.prototype = new Je();
|
|
81
|
+
we.prototype.defined = !0;
|
|
82
|
+
var Ze = [
|
|
83
|
+
"boolean",
|
|
84
|
+
"booleanish",
|
|
85
|
+
"overloadedBoolean",
|
|
86
|
+
"number",
|
|
87
|
+
"commaSeparated",
|
|
88
|
+
"spaceSeparated",
|
|
89
|
+
"commaOrSpaceSeparated"
|
|
90
|
+
], Mn = Ze.length;
|
|
91
|
+
function we(e, n, r, t) {
|
|
92
|
+
var f = -1, v;
|
|
93
|
+
for (Ie(this, "space", t), Je.call(this, e, n); ++f < Mn; )
|
|
94
|
+
v = Ze[f], Ie(this, v, (r & Me[v]) === Me[v]);
|
|
95
|
+
}
|
|
96
|
+
function Ie(e, n, r) {
|
|
97
|
+
r && (e[n] = r);
|
|
98
|
+
}
|
|
99
|
+
var De = be, In = Ve, Dn = Qe, le = Un;
|
|
100
|
+
function Un(e) {
|
|
101
|
+
var n = e.space, r = e.mustUseProperty || [], t = e.attributes || {}, f = e.properties, v = e.transform, m = {}, u = {}, g, P;
|
|
102
|
+
for (g in f)
|
|
103
|
+
P = new Dn(
|
|
104
|
+
g,
|
|
105
|
+
v(t, g),
|
|
106
|
+
f[g],
|
|
107
|
+
n
|
|
108
|
+
), r.indexOf(g) !== -1 && (P.mustUseProperty = !0), m[g] = P, u[De(g)] = g, u[De(P.attribute)] = g;
|
|
109
|
+
return new In(m, u, n);
|
|
110
|
+
}
|
|
111
|
+
var Nn = le, jn = Nn({
|
|
112
|
+
space: "xlink",
|
|
113
|
+
transform: Rn,
|
|
114
|
+
properties: {
|
|
115
|
+
xLinkActuate: null,
|
|
116
|
+
xLinkArcRole: null,
|
|
117
|
+
xLinkHref: null,
|
|
118
|
+
xLinkRole: null,
|
|
119
|
+
xLinkShow: null,
|
|
120
|
+
xLinkTitle: null,
|
|
121
|
+
xLinkType: null
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
function Rn(e, n) {
|
|
125
|
+
return "xlink:" + n.slice(5).toLowerCase();
|
|
126
|
+
}
|
|
127
|
+
var qn = le, zn = qn({
|
|
128
|
+
space: "xml",
|
|
129
|
+
transform: Hn,
|
|
130
|
+
properties: {
|
|
131
|
+
xmlLang: null,
|
|
132
|
+
xmlBase: null,
|
|
133
|
+
xmlSpace: null
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
function Hn(e, n) {
|
|
137
|
+
return "xml:" + n.slice(3).toLowerCase();
|
|
138
|
+
}
|
|
139
|
+
var _n = Bn;
|
|
140
|
+
function Bn(e, n) {
|
|
141
|
+
return n in e ? e[n] : n;
|
|
142
|
+
}
|
|
143
|
+
var Wn = _n, en = Fn;
|
|
144
|
+
function Fn(e, n) {
|
|
145
|
+
return Wn(e, n.toLowerCase());
|
|
146
|
+
}
|
|
147
|
+
var Gn = le, Vn = en, Kn = Gn({
|
|
148
|
+
space: "xmlns",
|
|
149
|
+
attributes: {
|
|
150
|
+
xmlnsxlink: "xmlns:xlink"
|
|
151
|
+
},
|
|
152
|
+
transform: Vn,
|
|
153
|
+
properties: {
|
|
154
|
+
xmlns: null,
|
|
155
|
+
xmlnsXLink: null
|
|
156
|
+
}
|
|
157
|
+
}), Ce = H, Yn = le, O = Ce.booleanish, D = Ce.number, Y = Ce.spaceSeparated, Xn = Yn({
|
|
158
|
+
transform: Jn,
|
|
159
|
+
properties: {
|
|
160
|
+
ariaActiveDescendant: null,
|
|
161
|
+
ariaAtomic: O,
|
|
162
|
+
ariaAutoComplete: null,
|
|
163
|
+
ariaBusy: O,
|
|
164
|
+
ariaChecked: O,
|
|
165
|
+
ariaColCount: D,
|
|
166
|
+
ariaColIndex: D,
|
|
167
|
+
ariaColSpan: D,
|
|
168
|
+
ariaControls: Y,
|
|
169
|
+
ariaCurrent: null,
|
|
170
|
+
ariaDescribedBy: Y,
|
|
171
|
+
ariaDetails: null,
|
|
172
|
+
ariaDisabled: O,
|
|
173
|
+
ariaDropEffect: Y,
|
|
174
|
+
ariaErrorMessage: null,
|
|
175
|
+
ariaExpanded: O,
|
|
176
|
+
ariaFlowTo: Y,
|
|
177
|
+
ariaGrabbed: O,
|
|
178
|
+
ariaHasPopup: null,
|
|
179
|
+
ariaHidden: O,
|
|
180
|
+
ariaInvalid: null,
|
|
181
|
+
ariaKeyShortcuts: null,
|
|
182
|
+
ariaLabel: null,
|
|
183
|
+
ariaLabelledBy: Y,
|
|
184
|
+
ariaLevel: D,
|
|
185
|
+
ariaLive: null,
|
|
186
|
+
ariaModal: O,
|
|
187
|
+
ariaMultiLine: O,
|
|
188
|
+
ariaMultiSelectable: O,
|
|
189
|
+
ariaOrientation: null,
|
|
190
|
+
ariaOwns: Y,
|
|
191
|
+
ariaPlaceholder: null,
|
|
192
|
+
ariaPosInSet: D,
|
|
193
|
+
ariaPressed: O,
|
|
194
|
+
ariaReadOnly: O,
|
|
195
|
+
ariaRelevant: null,
|
|
196
|
+
ariaRequired: O,
|
|
197
|
+
ariaRoleDescription: Y,
|
|
198
|
+
ariaRowCount: D,
|
|
199
|
+
ariaRowIndex: D,
|
|
200
|
+
ariaRowSpan: D,
|
|
201
|
+
ariaSelected: O,
|
|
202
|
+
ariaSetSize: D,
|
|
203
|
+
ariaSort: null,
|
|
204
|
+
ariaValueMax: D,
|
|
205
|
+
ariaValueMin: D,
|
|
206
|
+
ariaValueNow: D,
|
|
207
|
+
ariaValueText: null,
|
|
208
|
+
role: null
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
function Jn(e, n) {
|
|
212
|
+
return n === "role" ? n : "aria-" + n.slice(4).toLowerCase();
|
|
213
|
+
}
|
|
214
|
+
var ee = H, Qn = le, Zn = en, h = ee.boolean, er = ee.overloadedBoolean, re = ee.booleanish, x = ee.number, L = ee.spaceSeparated, ue = ee.commaSeparated, nr = Qn({
|
|
215
|
+
space: "html",
|
|
216
|
+
attributes: {
|
|
217
|
+
acceptcharset: "accept-charset",
|
|
218
|
+
classname: "class",
|
|
219
|
+
htmlfor: "for",
|
|
220
|
+
httpequiv: "http-equiv"
|
|
221
|
+
},
|
|
222
|
+
transform: Zn,
|
|
223
|
+
mustUseProperty: ["checked", "multiple", "muted", "selected"],
|
|
224
|
+
properties: {
|
|
225
|
+
// Standard Properties.
|
|
226
|
+
abbr: null,
|
|
227
|
+
accept: ue,
|
|
228
|
+
acceptCharset: L,
|
|
229
|
+
accessKey: L,
|
|
230
|
+
action: null,
|
|
231
|
+
allow: null,
|
|
232
|
+
allowFullScreen: h,
|
|
233
|
+
allowPaymentRequest: h,
|
|
234
|
+
allowUserMedia: h,
|
|
235
|
+
alt: null,
|
|
236
|
+
as: null,
|
|
237
|
+
async: h,
|
|
238
|
+
autoCapitalize: null,
|
|
239
|
+
autoComplete: L,
|
|
240
|
+
autoFocus: h,
|
|
241
|
+
autoPlay: h,
|
|
242
|
+
capture: h,
|
|
243
|
+
charSet: null,
|
|
244
|
+
checked: h,
|
|
245
|
+
cite: null,
|
|
246
|
+
className: L,
|
|
247
|
+
cols: x,
|
|
248
|
+
colSpan: null,
|
|
249
|
+
content: null,
|
|
250
|
+
contentEditable: re,
|
|
251
|
+
controls: h,
|
|
252
|
+
controlsList: L,
|
|
253
|
+
coords: x | ue,
|
|
254
|
+
crossOrigin: null,
|
|
255
|
+
data: null,
|
|
256
|
+
dateTime: null,
|
|
257
|
+
decoding: null,
|
|
258
|
+
default: h,
|
|
259
|
+
defer: h,
|
|
260
|
+
dir: null,
|
|
261
|
+
dirName: null,
|
|
262
|
+
disabled: h,
|
|
263
|
+
download: er,
|
|
264
|
+
draggable: re,
|
|
265
|
+
encType: null,
|
|
266
|
+
enterKeyHint: null,
|
|
267
|
+
form: null,
|
|
268
|
+
formAction: null,
|
|
269
|
+
formEncType: null,
|
|
270
|
+
formMethod: null,
|
|
271
|
+
formNoValidate: h,
|
|
272
|
+
formTarget: null,
|
|
273
|
+
headers: L,
|
|
274
|
+
height: x,
|
|
275
|
+
hidden: h,
|
|
276
|
+
high: x,
|
|
277
|
+
href: null,
|
|
278
|
+
hrefLang: null,
|
|
279
|
+
htmlFor: L,
|
|
280
|
+
httpEquiv: L,
|
|
281
|
+
id: null,
|
|
282
|
+
imageSizes: null,
|
|
283
|
+
imageSrcSet: ue,
|
|
284
|
+
inputMode: null,
|
|
285
|
+
integrity: null,
|
|
286
|
+
is: null,
|
|
287
|
+
isMap: h,
|
|
288
|
+
itemId: null,
|
|
289
|
+
itemProp: L,
|
|
290
|
+
itemRef: L,
|
|
291
|
+
itemScope: h,
|
|
292
|
+
itemType: L,
|
|
293
|
+
kind: null,
|
|
294
|
+
label: null,
|
|
295
|
+
lang: null,
|
|
296
|
+
language: null,
|
|
297
|
+
list: null,
|
|
298
|
+
loading: null,
|
|
299
|
+
loop: h,
|
|
300
|
+
low: x,
|
|
301
|
+
manifest: null,
|
|
302
|
+
max: null,
|
|
303
|
+
maxLength: x,
|
|
304
|
+
media: null,
|
|
305
|
+
method: null,
|
|
306
|
+
min: null,
|
|
307
|
+
minLength: x,
|
|
308
|
+
multiple: h,
|
|
309
|
+
muted: h,
|
|
310
|
+
name: null,
|
|
311
|
+
nonce: null,
|
|
312
|
+
noModule: h,
|
|
313
|
+
noValidate: h,
|
|
314
|
+
onAbort: null,
|
|
315
|
+
onAfterPrint: null,
|
|
316
|
+
onAuxClick: null,
|
|
317
|
+
onBeforePrint: null,
|
|
318
|
+
onBeforeUnload: null,
|
|
319
|
+
onBlur: null,
|
|
320
|
+
onCancel: null,
|
|
321
|
+
onCanPlay: null,
|
|
322
|
+
onCanPlayThrough: null,
|
|
323
|
+
onChange: null,
|
|
324
|
+
onClick: null,
|
|
325
|
+
onClose: null,
|
|
326
|
+
onContextMenu: null,
|
|
327
|
+
onCopy: null,
|
|
328
|
+
onCueChange: null,
|
|
329
|
+
onCut: null,
|
|
330
|
+
onDblClick: null,
|
|
331
|
+
onDrag: null,
|
|
332
|
+
onDragEnd: null,
|
|
333
|
+
onDragEnter: null,
|
|
334
|
+
onDragExit: null,
|
|
335
|
+
onDragLeave: null,
|
|
336
|
+
onDragOver: null,
|
|
337
|
+
onDragStart: null,
|
|
338
|
+
onDrop: null,
|
|
339
|
+
onDurationChange: null,
|
|
340
|
+
onEmptied: null,
|
|
341
|
+
onEnded: null,
|
|
342
|
+
onError: null,
|
|
343
|
+
onFocus: null,
|
|
344
|
+
onFormData: null,
|
|
345
|
+
onHashChange: null,
|
|
346
|
+
onInput: null,
|
|
347
|
+
onInvalid: null,
|
|
348
|
+
onKeyDown: null,
|
|
349
|
+
onKeyPress: null,
|
|
350
|
+
onKeyUp: null,
|
|
351
|
+
onLanguageChange: null,
|
|
352
|
+
onLoad: null,
|
|
353
|
+
onLoadedData: null,
|
|
354
|
+
onLoadedMetadata: null,
|
|
355
|
+
onLoadEnd: null,
|
|
356
|
+
onLoadStart: null,
|
|
357
|
+
onMessage: null,
|
|
358
|
+
onMessageError: null,
|
|
359
|
+
onMouseDown: null,
|
|
360
|
+
onMouseEnter: null,
|
|
361
|
+
onMouseLeave: null,
|
|
362
|
+
onMouseMove: null,
|
|
363
|
+
onMouseOut: null,
|
|
364
|
+
onMouseOver: null,
|
|
365
|
+
onMouseUp: null,
|
|
366
|
+
onOffline: null,
|
|
367
|
+
onOnline: null,
|
|
368
|
+
onPageHide: null,
|
|
369
|
+
onPageShow: null,
|
|
370
|
+
onPaste: null,
|
|
371
|
+
onPause: null,
|
|
372
|
+
onPlay: null,
|
|
373
|
+
onPlaying: null,
|
|
374
|
+
onPopState: null,
|
|
375
|
+
onProgress: null,
|
|
376
|
+
onRateChange: null,
|
|
377
|
+
onRejectionHandled: null,
|
|
378
|
+
onReset: null,
|
|
379
|
+
onResize: null,
|
|
380
|
+
onScroll: null,
|
|
381
|
+
onSecurityPolicyViolation: null,
|
|
382
|
+
onSeeked: null,
|
|
383
|
+
onSeeking: null,
|
|
384
|
+
onSelect: null,
|
|
385
|
+
onSlotChange: null,
|
|
386
|
+
onStalled: null,
|
|
387
|
+
onStorage: null,
|
|
388
|
+
onSubmit: null,
|
|
389
|
+
onSuspend: null,
|
|
390
|
+
onTimeUpdate: null,
|
|
391
|
+
onToggle: null,
|
|
392
|
+
onUnhandledRejection: null,
|
|
393
|
+
onUnload: null,
|
|
394
|
+
onVolumeChange: null,
|
|
395
|
+
onWaiting: null,
|
|
396
|
+
onWheel: null,
|
|
397
|
+
open: h,
|
|
398
|
+
optimum: x,
|
|
399
|
+
pattern: null,
|
|
400
|
+
ping: L,
|
|
401
|
+
placeholder: null,
|
|
402
|
+
playsInline: h,
|
|
403
|
+
poster: null,
|
|
404
|
+
preload: null,
|
|
405
|
+
readOnly: h,
|
|
406
|
+
referrerPolicy: null,
|
|
407
|
+
rel: L,
|
|
408
|
+
required: h,
|
|
409
|
+
reversed: h,
|
|
410
|
+
rows: x,
|
|
411
|
+
rowSpan: x,
|
|
412
|
+
sandbox: L,
|
|
413
|
+
scope: null,
|
|
414
|
+
scoped: h,
|
|
415
|
+
seamless: h,
|
|
416
|
+
selected: h,
|
|
417
|
+
shape: null,
|
|
418
|
+
size: x,
|
|
419
|
+
sizes: null,
|
|
420
|
+
slot: null,
|
|
421
|
+
span: x,
|
|
422
|
+
spellCheck: re,
|
|
423
|
+
src: null,
|
|
424
|
+
srcDoc: null,
|
|
425
|
+
srcLang: null,
|
|
426
|
+
srcSet: ue,
|
|
427
|
+
start: x,
|
|
428
|
+
step: null,
|
|
429
|
+
style: null,
|
|
430
|
+
tabIndex: x,
|
|
431
|
+
target: null,
|
|
432
|
+
title: null,
|
|
433
|
+
translate: null,
|
|
434
|
+
type: null,
|
|
435
|
+
typeMustMatch: h,
|
|
436
|
+
useMap: null,
|
|
437
|
+
value: re,
|
|
438
|
+
width: x,
|
|
439
|
+
wrap: null,
|
|
440
|
+
// Legacy.
|
|
441
|
+
// See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
|
|
442
|
+
align: null,
|
|
443
|
+
// Several. Use CSS `text-align` instead,
|
|
444
|
+
aLink: null,
|
|
445
|
+
// `<body>`. Use CSS `a:active {color}` instead
|
|
446
|
+
archive: L,
|
|
447
|
+
// `<object>`. List of URIs to archives
|
|
448
|
+
axis: null,
|
|
449
|
+
// `<td>` and `<th>`. Use `scope` on `<th>`
|
|
450
|
+
background: null,
|
|
451
|
+
// `<body>`. Use CSS `background-image` instead
|
|
452
|
+
bgColor: null,
|
|
453
|
+
// `<body>` and table elements. Use CSS `background-color` instead
|
|
454
|
+
border: x,
|
|
455
|
+
// `<table>`. Use CSS `border-width` instead,
|
|
456
|
+
borderColor: null,
|
|
457
|
+
// `<table>`. Use CSS `border-color` instead,
|
|
458
|
+
bottomMargin: x,
|
|
459
|
+
// `<body>`
|
|
460
|
+
cellPadding: null,
|
|
461
|
+
// `<table>`
|
|
462
|
+
cellSpacing: null,
|
|
463
|
+
// `<table>`
|
|
464
|
+
char: null,
|
|
465
|
+
// Several table elements. When `align=char`, sets the character to align on
|
|
466
|
+
charOff: null,
|
|
467
|
+
// Several table elements. When `char`, offsets the alignment
|
|
468
|
+
classId: null,
|
|
469
|
+
// `<object>`
|
|
470
|
+
clear: null,
|
|
471
|
+
// `<br>`. Use CSS `clear` instead
|
|
472
|
+
code: null,
|
|
473
|
+
// `<object>`
|
|
474
|
+
codeBase: null,
|
|
475
|
+
// `<object>`
|
|
476
|
+
codeType: null,
|
|
477
|
+
// `<object>`
|
|
478
|
+
color: null,
|
|
479
|
+
// `<font>` and `<hr>`. Use CSS instead
|
|
480
|
+
compact: h,
|
|
481
|
+
// Lists. Use CSS to reduce space between items instead
|
|
482
|
+
declare: h,
|
|
483
|
+
// `<object>`
|
|
484
|
+
event: null,
|
|
485
|
+
// `<script>`
|
|
486
|
+
face: null,
|
|
487
|
+
// `<font>`. Use CSS instead
|
|
488
|
+
frame: null,
|
|
489
|
+
// `<table>`
|
|
490
|
+
frameBorder: null,
|
|
491
|
+
// `<iframe>`. Use CSS `border` instead
|
|
492
|
+
hSpace: x,
|
|
493
|
+
// `<img>` and `<object>`
|
|
494
|
+
leftMargin: x,
|
|
495
|
+
// `<body>`
|
|
496
|
+
link: null,
|
|
497
|
+
// `<body>`. Use CSS `a:link {color: *}` instead
|
|
498
|
+
longDesc: null,
|
|
499
|
+
// `<frame>`, `<iframe>`, and `<img>`. Use an `<a>`
|
|
500
|
+
lowSrc: null,
|
|
501
|
+
// `<img>`. Use a `<picture>`
|
|
502
|
+
marginHeight: x,
|
|
503
|
+
// `<body>`
|
|
504
|
+
marginWidth: x,
|
|
505
|
+
// `<body>`
|
|
506
|
+
noResize: h,
|
|
507
|
+
// `<frame>`
|
|
508
|
+
noHref: h,
|
|
509
|
+
// `<area>`. Use no href instead of an explicit `nohref`
|
|
510
|
+
noShade: h,
|
|
511
|
+
// `<hr>`. Use background-color and height instead of borders
|
|
512
|
+
noWrap: h,
|
|
513
|
+
// `<td>` and `<th>`
|
|
514
|
+
object: null,
|
|
515
|
+
// `<applet>`
|
|
516
|
+
profile: null,
|
|
517
|
+
// `<head>`
|
|
518
|
+
prompt: null,
|
|
519
|
+
// `<isindex>`
|
|
520
|
+
rev: null,
|
|
521
|
+
// `<link>`
|
|
522
|
+
rightMargin: x,
|
|
523
|
+
// `<body>`
|
|
524
|
+
rules: null,
|
|
525
|
+
// `<table>`
|
|
526
|
+
scheme: null,
|
|
527
|
+
// `<meta>`
|
|
528
|
+
scrolling: re,
|
|
529
|
+
// `<frame>`. Use overflow in the child context
|
|
530
|
+
standby: null,
|
|
531
|
+
// `<object>`
|
|
532
|
+
summary: null,
|
|
533
|
+
// `<table>`
|
|
534
|
+
text: null,
|
|
535
|
+
// `<body>`. Use CSS `color` instead
|
|
536
|
+
topMargin: x,
|
|
537
|
+
// `<body>`
|
|
538
|
+
valueType: null,
|
|
539
|
+
// `<param>`
|
|
540
|
+
version: null,
|
|
541
|
+
// `<html>`. Use a doctype.
|
|
542
|
+
vAlign: null,
|
|
543
|
+
// Several. Use CSS `vertical-align` instead
|
|
544
|
+
vLink: null,
|
|
545
|
+
// `<body>`. Use CSS `a:visited {color}` instead
|
|
546
|
+
vSpace: x,
|
|
547
|
+
// `<img>` and `<object>`
|
|
548
|
+
// Non-standard Properties.
|
|
549
|
+
allowTransparency: null,
|
|
550
|
+
autoCorrect: null,
|
|
551
|
+
autoSave: null,
|
|
552
|
+
disablePictureInPicture: h,
|
|
553
|
+
disableRemotePlayback: h,
|
|
554
|
+
prefix: null,
|
|
555
|
+
property: null,
|
|
556
|
+
results: x,
|
|
557
|
+
security: null,
|
|
558
|
+
unselectable: null
|
|
559
|
+
}
|
|
560
|
+
}), rr = Tn, ar = jn, tr = zn, lr = Kn, ir = Xn, or = nr, sr = rr([tr, ar, lr, ir, or]), ur = be, cr = Qe, fr = Ye, Se = "data", dr = gr, vr = /^data[-\w.:]+$/i, nn = /-[a-z]/g, pr = /[A-Z]/g;
|
|
561
|
+
function gr(e, n) {
|
|
562
|
+
var r = ur(n), t = n, f = fr;
|
|
563
|
+
return r in e.normal ? e.property[e.normal[r]] : (r.length > 4 && r.slice(0, 4) === Se && vr.test(n) && (n.charAt(4) === "-" ? t = hr(n) : n = mr(n), f = cr), new f(t, n));
|
|
564
|
+
}
|
|
565
|
+
function hr(e) {
|
|
566
|
+
var n = e.slice(5).replace(nn, xr);
|
|
567
|
+
return Se + n.charAt(0).toUpperCase() + n.slice(1);
|
|
568
|
+
}
|
|
569
|
+
function mr(e) {
|
|
570
|
+
var n = e.slice(4);
|
|
571
|
+
return nn.test(n) ? e : (n = n.replace(pr, yr), n.charAt(0) !== "-" && (n = "-" + n), Se + n);
|
|
572
|
+
}
|
|
573
|
+
function yr(e) {
|
|
574
|
+
return "-" + e.toLowerCase();
|
|
575
|
+
}
|
|
576
|
+
function xr(e) {
|
|
577
|
+
return e.charAt(1).toUpperCase();
|
|
578
|
+
}
|
|
579
|
+
var br = wr, Ue = /[#.]/g;
|
|
580
|
+
function wr(e, n) {
|
|
581
|
+
for (var r = e || "", t = n || "div", f = {}, v = 0, m, u, g; v < r.length; )
|
|
582
|
+
Ue.lastIndex = v, g = Ue.exec(r), m = r.slice(v, g ? g.index : r.length), m && (u ? u === "#" ? f.id = m : f.className ? f.className.push(m) : f.className = [m] : t = m, v += m.length), g && (u = g[0], v++);
|
|
583
|
+
return { type: "element", tagName: t, properties: f, children: [] };
|
|
584
|
+
}
|
|
585
|
+
var Ae = {};
|
|
586
|
+
Ae.parse = Ar;
|
|
587
|
+
Ae.stringify = Pr;
|
|
588
|
+
var Ne = "", Cr = " ", Sr = /[ \t\n\r\f]+/g;
|
|
589
|
+
function Ar(e) {
|
|
590
|
+
var n = String(e || Ne).trim();
|
|
591
|
+
return n === Ne ? [] : n.split(Sr);
|
|
592
|
+
}
|
|
593
|
+
function Pr(e) {
|
|
594
|
+
return e.join(Cr).trim();
|
|
595
|
+
}
|
|
596
|
+
var Pe = {};
|
|
597
|
+
Pe.parse = Er;
|
|
598
|
+
Pe.stringify = $r;
|
|
599
|
+
var me = ",", je = " ", ae = "";
|
|
600
|
+
function Er(e) {
|
|
601
|
+
for (var n = [], r = String(e || ae), t = r.indexOf(me), f = 0, v = !1, m; !v; )
|
|
602
|
+
t === -1 && (t = r.length, v = !0), m = r.slice(f, t).trim(), (m || !v) && n.push(m), f = t + 1, t = r.indexOf(me, f);
|
|
603
|
+
return n;
|
|
604
|
+
}
|
|
605
|
+
function $r(e, n) {
|
|
606
|
+
var r = n || {}, t = r.padLeft === !1 ? ae : je, f = r.padRight ? je : ae;
|
|
607
|
+
return e[e.length - 1] === ae && (e = e.concat(ae)), e.join(f + me + t).trim();
|
|
608
|
+
}
|
|
609
|
+
var Tr = dr, Re = be, kr = br, qe = Ae.parse, ze = Pe.parse, Lr = Mr, Or = {}.hasOwnProperty;
|
|
610
|
+
function Mr(e, n, r) {
|
|
611
|
+
var t = r ? jr(r) : null;
|
|
612
|
+
return f;
|
|
613
|
+
function f(m, u) {
|
|
614
|
+
var g = kr(m, n), P = Array.prototype.slice.call(arguments, 2), T = g.tagName.toLowerCase(), C;
|
|
615
|
+
if (g.tagName = t && Or.call(t, T) ? t[T] : T, u && Ir(u, g) && (P.unshift(u), u = null), u)
|
|
616
|
+
for (C in u)
|
|
617
|
+
v(g.properties, C, u[C]);
|
|
618
|
+
return rn(g.children, P), g.tagName === "template" && (g.content = { type: "root", children: g.children }, g.children = []), g;
|
|
619
|
+
}
|
|
620
|
+
function v(m, u, g) {
|
|
621
|
+
var P, T, C;
|
|
622
|
+
g == null || g !== g || (P = Tr(e, u), T = P.property, C = g, typeof C == "string" && (P.spaceSeparated ? C = qe(C) : P.commaSeparated ? C = ze(C) : P.commaOrSpaceSeparated && (C = qe(ze(C).join(" ")))), T === "style" && typeof g != "string" && (C = Nr(C)), T === "className" && m.className && (C = m.className.concat(C)), m[T] = Ur(P, T, C));
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function Ir(e, n) {
|
|
626
|
+
return typeof e == "string" || "length" in e || Dr(n.tagName, e);
|
|
627
|
+
}
|
|
628
|
+
function Dr(e, n) {
|
|
629
|
+
var r = n.type;
|
|
630
|
+
return e === "input" || !r || typeof r != "string" ? !1 : typeof n.children == "object" && "length" in n.children ? !0 : (r = r.toLowerCase(), e === "button" ? r !== "menu" && r !== "submit" && r !== "reset" && r !== "button" : "value" in n);
|
|
631
|
+
}
|
|
632
|
+
function rn(e, n) {
|
|
633
|
+
var r, t;
|
|
634
|
+
if (typeof n == "string" || typeof n == "number") {
|
|
635
|
+
e.push({ type: "text", value: String(n) });
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
if (typeof n == "object" && "length" in n) {
|
|
639
|
+
for (r = -1, t = n.length; ++r < t; )
|
|
640
|
+
rn(e, n[r]);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (typeof n != "object" || !("type" in n))
|
|
644
|
+
throw new Error("Expected node, nodes, or string, got `" + n + "`");
|
|
645
|
+
e.push(n);
|
|
646
|
+
}
|
|
647
|
+
function Ur(e, n, r) {
|
|
648
|
+
var t, f, v;
|
|
649
|
+
if (typeof r != "object" || !("length" in r))
|
|
650
|
+
return He(e, n, r);
|
|
651
|
+
for (f = r.length, t = -1, v = []; ++t < f; )
|
|
652
|
+
v[t] = He(e, n, r[t]);
|
|
653
|
+
return v;
|
|
654
|
+
}
|
|
655
|
+
function He(e, n, r) {
|
|
656
|
+
var t = r;
|
|
657
|
+
return e.number || e.positiveNumber ? !isNaN(t) && t !== "" && (t = Number(t)) : (e.boolean || e.overloadedBoolean) && typeof t == "string" && (t === "" || Re(r) === Re(n)) && (t = !0), t;
|
|
658
|
+
}
|
|
659
|
+
function Nr(e) {
|
|
660
|
+
var n = [], r;
|
|
661
|
+
for (r in e)
|
|
662
|
+
n.push([r, e[r]].join(": "));
|
|
663
|
+
return n.join("; ");
|
|
664
|
+
}
|
|
665
|
+
function jr(e) {
|
|
666
|
+
for (var n = e.length, r = -1, t = {}, f; ++r < n; )
|
|
667
|
+
f = e[r], t[f.toLowerCase()] = f;
|
|
668
|
+
return t;
|
|
669
|
+
}
|
|
670
|
+
var Rr = sr, qr = Lr, an = qr(Rr, "div");
|
|
671
|
+
an.displayName = "html";
|
|
672
|
+
var zr = an, Hr = zr;
|
|
673
|
+
const _r = "Æ", Br = "&", Wr = "Á", Fr = "Â", Gr = "À", Vr = "Å", Kr = "Ã", Yr = "Ä", Xr = "©", Jr = "Ç", Qr = "Ð", Zr = "É", ea = "Ê", na = "È", ra = "Ë", aa = ">", ta = "Í", la = "Î", ia = "Ì", oa = "Ï", sa = "<", ua = "Ñ", ca = "Ó", fa = "Ô", da = "Ò", va = "Ø", pa = "Õ", ga = "Ö", ha = '"', ma = "®", ya = "Þ", xa = "Ú", ba = "Û", wa = "Ù", Ca = "Ü", Sa = "Ý", Aa = "á", Pa = "â", Ea = "´", $a = "æ", Ta = "à", ka = "&", La = "å", Oa = "ã", Ma = "ä", Ia = "¦", Da = "ç", Ua = "¸", Na = "¢", ja = "©", Ra = "¤", qa = "°", za = "÷", Ha = "é", _a = "ê", Ba = "è", Wa = "ð", Fa = "ë", Ga = "½", Va = "¼", Ka = "¾", Ya = ">", Xa = "í", Ja = "î", Qa = "¡", Za = "ì", et = "¿", nt = "ï", rt = "«", at = "<", tt = "¯", lt = "µ", it = "·", ot = " ", st = "¬", ut = "ñ", ct = "ó", ft = "ô", dt = "ò", vt = "ª", pt = "º", gt = "ø", ht = "õ", mt = "ö", yt = "¶", xt = "±", bt = "£", wt = '"', Ct = "»", St = "®", At = "§", Pt = "", Et = "¹", $t = "²", Tt = "³", kt = "ß", Lt = "þ", Ot = "×", Mt = "ú", It = "û", Dt = "ù", Ut = "¨", Nt = "ü", jt = "ý", Rt = "¥", qt = "ÿ", zt = {
|
|
674
|
+
AElig: _r,
|
|
675
|
+
AMP: Br,
|
|
676
|
+
Aacute: Wr,
|
|
677
|
+
Acirc: Fr,
|
|
678
|
+
Agrave: Gr,
|
|
679
|
+
Aring: Vr,
|
|
680
|
+
Atilde: Kr,
|
|
681
|
+
Auml: Yr,
|
|
682
|
+
COPY: Xr,
|
|
683
|
+
Ccedil: Jr,
|
|
684
|
+
ETH: Qr,
|
|
685
|
+
Eacute: Zr,
|
|
686
|
+
Ecirc: ea,
|
|
687
|
+
Egrave: na,
|
|
688
|
+
Euml: ra,
|
|
689
|
+
GT: aa,
|
|
690
|
+
Iacute: ta,
|
|
691
|
+
Icirc: la,
|
|
692
|
+
Igrave: ia,
|
|
693
|
+
Iuml: oa,
|
|
694
|
+
LT: sa,
|
|
695
|
+
Ntilde: ua,
|
|
696
|
+
Oacute: ca,
|
|
697
|
+
Ocirc: fa,
|
|
698
|
+
Ograve: da,
|
|
699
|
+
Oslash: va,
|
|
700
|
+
Otilde: pa,
|
|
701
|
+
Ouml: ga,
|
|
702
|
+
QUOT: ha,
|
|
703
|
+
REG: ma,
|
|
704
|
+
THORN: ya,
|
|
705
|
+
Uacute: xa,
|
|
706
|
+
Ucirc: ba,
|
|
707
|
+
Ugrave: wa,
|
|
708
|
+
Uuml: Ca,
|
|
709
|
+
Yacute: Sa,
|
|
710
|
+
aacute: Aa,
|
|
711
|
+
acirc: Pa,
|
|
712
|
+
acute: Ea,
|
|
713
|
+
aelig: $a,
|
|
714
|
+
agrave: Ta,
|
|
715
|
+
amp: ka,
|
|
716
|
+
aring: La,
|
|
717
|
+
atilde: Oa,
|
|
718
|
+
auml: Ma,
|
|
719
|
+
brvbar: Ia,
|
|
720
|
+
ccedil: Da,
|
|
721
|
+
cedil: Ua,
|
|
722
|
+
cent: Na,
|
|
723
|
+
copy: ja,
|
|
724
|
+
curren: Ra,
|
|
725
|
+
deg: qa,
|
|
726
|
+
divide: za,
|
|
727
|
+
eacute: Ha,
|
|
728
|
+
ecirc: _a,
|
|
729
|
+
egrave: Ba,
|
|
730
|
+
eth: Wa,
|
|
731
|
+
euml: Fa,
|
|
732
|
+
frac12: Ga,
|
|
733
|
+
frac14: Va,
|
|
734
|
+
frac34: Ka,
|
|
735
|
+
gt: Ya,
|
|
736
|
+
iacute: Xa,
|
|
737
|
+
icirc: Ja,
|
|
738
|
+
iexcl: Qa,
|
|
739
|
+
igrave: Za,
|
|
740
|
+
iquest: et,
|
|
741
|
+
iuml: nt,
|
|
742
|
+
laquo: rt,
|
|
743
|
+
lt: at,
|
|
744
|
+
macr: tt,
|
|
745
|
+
micro: lt,
|
|
746
|
+
middot: it,
|
|
747
|
+
nbsp: ot,
|
|
748
|
+
not: st,
|
|
749
|
+
ntilde: ut,
|
|
750
|
+
oacute: ct,
|
|
751
|
+
ocirc: ft,
|
|
752
|
+
ograve: dt,
|
|
753
|
+
ordf: vt,
|
|
754
|
+
ordm: pt,
|
|
755
|
+
oslash: gt,
|
|
756
|
+
otilde: ht,
|
|
757
|
+
ouml: mt,
|
|
758
|
+
para: yt,
|
|
759
|
+
plusmn: xt,
|
|
760
|
+
pound: bt,
|
|
761
|
+
quot: wt,
|
|
762
|
+
raquo: Ct,
|
|
763
|
+
reg: St,
|
|
764
|
+
sect: At,
|
|
765
|
+
shy: Pt,
|
|
766
|
+
sup1: Et,
|
|
767
|
+
sup2: $t,
|
|
768
|
+
sup3: Tt,
|
|
769
|
+
szlig: kt,
|
|
770
|
+
thorn: Lt,
|
|
771
|
+
times: Ot,
|
|
772
|
+
uacute: Mt,
|
|
773
|
+
ucirc: It,
|
|
774
|
+
ugrave: Dt,
|
|
775
|
+
uml: Ut,
|
|
776
|
+
uuml: Nt,
|
|
777
|
+
yacute: jt,
|
|
778
|
+
yen: Rt,
|
|
779
|
+
yuml: qt
|
|
780
|
+
}, Ht = {
|
|
781
|
+
0: "�",
|
|
782
|
+
128: "€",
|
|
783
|
+
130: "‚",
|
|
784
|
+
131: "ƒ",
|
|
785
|
+
132: "„",
|
|
786
|
+
133: "…",
|
|
787
|
+
134: "†",
|
|
788
|
+
135: "‡",
|
|
789
|
+
136: "ˆ",
|
|
790
|
+
137: "‰",
|
|
791
|
+
138: "Š",
|
|
792
|
+
139: "‹",
|
|
793
|
+
140: "Œ",
|
|
794
|
+
142: "Ž",
|
|
795
|
+
145: "‘",
|
|
796
|
+
146: "’",
|
|
797
|
+
147: "“",
|
|
798
|
+
148: "”",
|
|
799
|
+
149: "•",
|
|
800
|
+
150: "–",
|
|
801
|
+
151: "—",
|
|
802
|
+
152: "˜",
|
|
803
|
+
153: "™",
|
|
804
|
+
154: "š",
|
|
805
|
+
155: "›",
|
|
806
|
+
156: "œ",
|
|
807
|
+
158: "ž",
|
|
808
|
+
159: "Ÿ"
|
|
809
|
+
};
|
|
810
|
+
var tn = _t;
|
|
811
|
+
function _t(e) {
|
|
812
|
+
var n = typeof e == "string" ? e.charCodeAt(0) : e;
|
|
813
|
+
return n >= 48 && n <= 57;
|
|
814
|
+
}
|
|
815
|
+
var Bt = Wt;
|
|
816
|
+
function Wt(e) {
|
|
817
|
+
var n = typeof e == "string" ? e.charCodeAt(0) : e;
|
|
818
|
+
return n >= 97 && n <= 102 || n >= 65 && n <= 70 || n >= 48 && n <= 57;
|
|
819
|
+
}
|
|
820
|
+
var Ft = Gt;
|
|
821
|
+
function Gt(e) {
|
|
822
|
+
var n = typeof e == "string" ? e.charCodeAt(0) : e;
|
|
823
|
+
return n >= 97 && n <= 122 || n >= 65 && n <= 90;
|
|
824
|
+
}
|
|
825
|
+
var Vt = Ft, Kt = tn, Yt = Xt;
|
|
826
|
+
function Xt(e) {
|
|
827
|
+
return Vt(e) || Kt(e);
|
|
828
|
+
}
|
|
829
|
+
var ce, Jt = 59, Qt = Zt;
|
|
830
|
+
function Zt(e) {
|
|
831
|
+
var n = "&" + e + ";", r;
|
|
832
|
+
return ce = ce || document.createElement("i"), ce.innerHTML = n, r = ce.textContent, r.charCodeAt(r.length - 1) === Jt && e !== "semi" || r === n ? !1 : r;
|
|
833
|
+
}
|
|
834
|
+
var _e = zt, Be = Ht, el = tn, nl = Bt, ln = Yt, rl = Qt, al = hl, tl = {}.hasOwnProperty, Q = String.fromCharCode, ll = Function.prototype, We = {
|
|
835
|
+
warning: null,
|
|
836
|
+
reference: null,
|
|
837
|
+
text: null,
|
|
838
|
+
warningContext: null,
|
|
839
|
+
referenceContext: null,
|
|
840
|
+
textContext: null,
|
|
841
|
+
position: {},
|
|
842
|
+
additional: null,
|
|
843
|
+
attribute: !1,
|
|
844
|
+
nonTerminated: !0
|
|
845
|
+
}, il = 9, Fe = 10, ol = 12, sl = 32, Ge = 38, ul = 59, cl = 60, fl = 61, dl = 35, vl = 88, pl = 120, gl = 65533, Z = "named", Ee = "hexadecimal", $e = "decimal", Te = {};
|
|
846
|
+
Te[Ee] = 16;
|
|
847
|
+
Te[$e] = 10;
|
|
848
|
+
var de = {};
|
|
849
|
+
de[Z] = ln;
|
|
850
|
+
de[$e] = el;
|
|
851
|
+
de[Ee] = nl;
|
|
852
|
+
var on = 1, sn = 2, un = 3, cn = 4, fn = 5, ye = 6, dn = 7, V = {};
|
|
853
|
+
V[on] = "Named character references must be terminated by a semicolon";
|
|
854
|
+
V[sn] = "Numeric character references must be terminated by a semicolon";
|
|
855
|
+
V[un] = "Named character references cannot be empty";
|
|
856
|
+
V[cn] = "Numeric character references cannot be empty";
|
|
857
|
+
V[fn] = "Named character references must be known";
|
|
858
|
+
V[ye] = "Numeric character references cannot be disallowed";
|
|
859
|
+
V[dn] = "Numeric character references cannot be outside the permissible Unicode range";
|
|
860
|
+
function hl(e, n) {
|
|
861
|
+
var r = {}, t, f;
|
|
862
|
+
n || (n = {});
|
|
863
|
+
for (f in We)
|
|
864
|
+
t = n[f], r[f] = t ?? We[f];
|
|
865
|
+
return (r.position.indent || r.position.start) && (r.indent = r.position.indent || [], r.position = r.position.start), ml(e, r);
|
|
866
|
+
}
|
|
867
|
+
function ml(e, n) {
|
|
868
|
+
var r = n.additional, t = n.nonTerminated, f = n.text, v = n.reference, m = n.warning, u = n.textContext, g = n.referenceContext, P = n.warningContext, T = n.position, C = n.indent || [], B = e.length, R = 0, oe = -1, M = T.column || 1, J = T.line || 1, q = "", l = [], a, s, o, i, d, p, c, y, S, I, z, W, _, N, ne, w, k, E, b;
|
|
869
|
+
for (typeof r == "string" && (r = r.charCodeAt(0)), w = $(), y = m ? ve : ll, R--, B++; ++R < B; )
|
|
870
|
+
if (d === Fe && (M = C[oe] || 1), d = e.charCodeAt(R), d === Ge) {
|
|
871
|
+
if (c = e.charCodeAt(R + 1), c === il || c === Fe || c === ol || c === sl || c === Ge || c === cl || c !== c || r && c === r) {
|
|
872
|
+
q += Q(d), M++;
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
for (_ = R + 1, W = _, b = _, c === dl ? (b = ++W, c = e.charCodeAt(b), c === vl || c === pl ? (N = Ee, b = ++W) : N = $e) : N = Z, a = "", z = "", i = "", ne = de[N], b--; ++b < B && (c = e.charCodeAt(b), !!ne(c)); )
|
|
876
|
+
i += Q(c), N === Z && tl.call(_e, i) && (a = i, z = _e[i]);
|
|
877
|
+
o = e.charCodeAt(b) === ul, o && (b++, s = N === Z ? rl(i) : !1, s && (a = i, z = s)), E = 1 + b - _, !o && !t || (i ? N === Z ? (o && !z ? y(fn, 1) : (a !== i && (b = W + a.length, E = 1 + b - W, o = !1), o || (S = a ? on : un, n.attribute ? (c = e.charCodeAt(b), c === fl ? (y(S, E), z = null) : ln(c) ? z = null : y(S, E)) : y(S, E))), p = z) : (o || y(sn, E), p = parseInt(i, Te[N]), yl(p) ? (y(dn, E), p = Q(gl)) : p in Be ? (y(ye, E), p = Be[p]) : (I = "", xl(p) && y(ye, E), p > 65535 && (p -= 65536, I += Q(p >>> 10 | 55296), p = 56320 | p & 1023), p = I + Q(p))) : N !== Z && y(cn, E)), p ? (j(), w = $(), R = b - 1, M += b - _ + 1, l.push(p), k = $(), k.offset++, v && v.call(
|
|
878
|
+
g,
|
|
879
|
+
p,
|
|
880
|
+
{ start: w, end: k },
|
|
881
|
+
e.slice(_ - 1, b)
|
|
882
|
+
), w = k) : (i = e.slice(_ - 1, b), q += i, M += i.length, R = b - 1);
|
|
883
|
+
} else
|
|
884
|
+
d === 10 && (J++, oe++, M = 0), d === d ? (q += Q(d), M++) : j();
|
|
885
|
+
return l.join("");
|
|
886
|
+
function $() {
|
|
887
|
+
return {
|
|
888
|
+
line: J,
|
|
889
|
+
column: M,
|
|
890
|
+
offset: R + (T.offset || 0)
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
function ve(F, K) {
|
|
894
|
+
var G = $();
|
|
895
|
+
G.column += K, G.offset += K, m.call(P, V[F], G, F);
|
|
896
|
+
}
|
|
897
|
+
function j() {
|
|
898
|
+
q && (l.push(q), f && f.call(u, q, { start: w, end: $() }), q = "");
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
function yl(e) {
|
|
902
|
+
return e >= 55296 && e <= 57343 || e > 1114111;
|
|
903
|
+
}
|
|
904
|
+
function xl(e) {
|
|
905
|
+
return e >= 1 && e <= 8 || e === 11 || e >= 13 && e <= 31 || e >= 127 && e <= 159 || e >= 64976 && e <= 65007 || (e & 65535) === 65535 || (e & 65535) === 65534;
|
|
906
|
+
}
|
|
907
|
+
var vn = { exports: {} };
|
|
908
|
+
(function(e) {
|
|
909
|
+
var n = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
910
|
+
/**
|
|
911
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
912
|
+
*
|
|
913
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
914
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
915
|
+
* @namespace
|
|
916
|
+
* @public
|
|
917
|
+
*/
|
|
918
|
+
var r = function(t) {
|
|
919
|
+
var f = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, v = 0, m = {}, u = {
|
|
920
|
+
/**
|
|
921
|
+
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
922
|
+
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
923
|
+
* additional languages or plugins yourself.
|
|
924
|
+
*
|
|
925
|
+
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
|
926
|
+
*
|
|
927
|
+
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
|
928
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
|
929
|
+
*
|
|
930
|
+
* ```js
|
|
931
|
+
* window.Prism = window.Prism || {};
|
|
932
|
+
* Prism.manual = true;
|
|
933
|
+
* // add a new <script> to load Prism's script
|
|
934
|
+
* ```
|
|
935
|
+
*
|
|
936
|
+
* @default false
|
|
937
|
+
* @type {boolean}
|
|
938
|
+
* @memberof Prism
|
|
939
|
+
* @public
|
|
940
|
+
*/
|
|
941
|
+
manual: t.Prism && t.Prism.manual,
|
|
942
|
+
/**
|
|
943
|
+
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
944
|
+
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
945
|
+
* own worker, you don't want it to do this.
|
|
946
|
+
*
|
|
947
|
+
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
|
948
|
+
*
|
|
949
|
+
* You obviously have to change this value before Prism executes. To do this, you can add an
|
|
950
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
|
951
|
+
*
|
|
952
|
+
* ```js
|
|
953
|
+
* window.Prism = window.Prism || {};
|
|
954
|
+
* Prism.disableWorkerMessageHandler = true;
|
|
955
|
+
* // Load Prism's script
|
|
956
|
+
* ```
|
|
957
|
+
*
|
|
958
|
+
* @default false
|
|
959
|
+
* @type {boolean}
|
|
960
|
+
* @memberof Prism
|
|
961
|
+
* @public
|
|
962
|
+
*/
|
|
963
|
+
disableWorkerMessageHandler: t.Prism && t.Prism.disableWorkerMessageHandler,
|
|
964
|
+
/**
|
|
965
|
+
* A namespace for utility methods.
|
|
966
|
+
*
|
|
967
|
+
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
968
|
+
* change or disappear at any time.
|
|
969
|
+
*
|
|
970
|
+
* @namespace
|
|
971
|
+
* @memberof Prism
|
|
972
|
+
*/
|
|
973
|
+
util: {
|
|
974
|
+
encode: function l(a) {
|
|
975
|
+
return a instanceof g ? new g(a.type, l(a.content), a.alias) : Array.isArray(a) ? a.map(l) : a.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
976
|
+
},
|
|
977
|
+
/**
|
|
978
|
+
* Returns the name of the type of the given value.
|
|
979
|
+
*
|
|
980
|
+
* @param {any} o
|
|
981
|
+
* @returns {string}
|
|
982
|
+
* @example
|
|
983
|
+
* type(null) === 'Null'
|
|
984
|
+
* type(undefined) === 'Undefined'
|
|
985
|
+
* type(123) === 'Number'
|
|
986
|
+
* type('foo') === 'String'
|
|
987
|
+
* type(true) === 'Boolean'
|
|
988
|
+
* type([1, 2]) === 'Array'
|
|
989
|
+
* type({}) === 'Object'
|
|
990
|
+
* type(String) === 'Function'
|
|
991
|
+
* type(/abc+/) === 'RegExp'
|
|
992
|
+
*/
|
|
993
|
+
type: function(l) {
|
|
994
|
+
return Object.prototype.toString.call(l).slice(8, -1);
|
|
995
|
+
},
|
|
996
|
+
/**
|
|
997
|
+
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
998
|
+
*
|
|
999
|
+
* @param {Object} obj
|
|
1000
|
+
* @returns {number}
|
|
1001
|
+
*/
|
|
1002
|
+
objId: function(l) {
|
|
1003
|
+
return l.__id || Object.defineProperty(l, "__id", { value: ++v }), l.__id;
|
|
1004
|
+
},
|
|
1005
|
+
/**
|
|
1006
|
+
* Creates a deep clone of the given object.
|
|
1007
|
+
*
|
|
1008
|
+
* The main intended use of this function is to clone language definitions.
|
|
1009
|
+
*
|
|
1010
|
+
* @param {T} o
|
|
1011
|
+
* @param {Record<number, any>} [visited]
|
|
1012
|
+
* @returns {T}
|
|
1013
|
+
* @template T
|
|
1014
|
+
*/
|
|
1015
|
+
clone: function l(a, s) {
|
|
1016
|
+
s = s || {};
|
|
1017
|
+
var o, i;
|
|
1018
|
+
switch (u.util.type(a)) {
|
|
1019
|
+
case "Object":
|
|
1020
|
+
if (i = u.util.objId(a), s[i])
|
|
1021
|
+
return s[i];
|
|
1022
|
+
o = /** @type {Record<string, any>} */
|
|
1023
|
+
{}, s[i] = o;
|
|
1024
|
+
for (var d in a)
|
|
1025
|
+
a.hasOwnProperty(d) && (o[d] = l(a[d], s));
|
|
1026
|
+
return (
|
|
1027
|
+
/** @type {any} */
|
|
1028
|
+
o
|
|
1029
|
+
);
|
|
1030
|
+
case "Array":
|
|
1031
|
+
return i = u.util.objId(a), s[i] ? s[i] : (o = [], s[i] = o, /** @type {Array} */
|
|
1032
|
+
/** @type {any} */
|
|
1033
|
+
a.forEach(function(p, c) {
|
|
1034
|
+
o[c] = l(p, s);
|
|
1035
|
+
}), /** @type {any} */
|
|
1036
|
+
o);
|
|
1037
|
+
default:
|
|
1038
|
+
return a;
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
/**
|
|
1042
|
+
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
1043
|
+
*
|
|
1044
|
+
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
1045
|
+
*
|
|
1046
|
+
* @param {Element} element
|
|
1047
|
+
* @returns {string}
|
|
1048
|
+
*/
|
|
1049
|
+
getLanguage: function(l) {
|
|
1050
|
+
for (; l; ) {
|
|
1051
|
+
var a = f.exec(l.className);
|
|
1052
|
+
if (a)
|
|
1053
|
+
return a[1].toLowerCase();
|
|
1054
|
+
l = l.parentElement;
|
|
1055
|
+
}
|
|
1056
|
+
return "none";
|
|
1057
|
+
},
|
|
1058
|
+
/**
|
|
1059
|
+
* Sets the Prism `language-xxxx` class of the given element.
|
|
1060
|
+
*
|
|
1061
|
+
* @param {Element} element
|
|
1062
|
+
* @param {string} language
|
|
1063
|
+
* @returns {void}
|
|
1064
|
+
*/
|
|
1065
|
+
setLanguage: function(l, a) {
|
|
1066
|
+
l.className = l.className.replace(RegExp(f, "gi"), ""), l.classList.add("language-" + a);
|
|
1067
|
+
},
|
|
1068
|
+
/**
|
|
1069
|
+
* Returns the script element that is currently executing.
|
|
1070
|
+
*
|
|
1071
|
+
* This does __not__ work for line script element.
|
|
1072
|
+
*
|
|
1073
|
+
* @returns {HTMLScriptElement | null}
|
|
1074
|
+
*/
|
|
1075
|
+
currentScript: function() {
|
|
1076
|
+
if (typeof document > "u")
|
|
1077
|
+
return null;
|
|
1078
|
+
if ("currentScript" in document)
|
|
1079
|
+
return (
|
|
1080
|
+
/** @type {any} */
|
|
1081
|
+
document.currentScript
|
|
1082
|
+
);
|
|
1083
|
+
try {
|
|
1084
|
+
throw new Error();
|
|
1085
|
+
} catch (o) {
|
|
1086
|
+
var l = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(o.stack) || [])[1];
|
|
1087
|
+
if (l) {
|
|
1088
|
+
var a = document.getElementsByTagName("script");
|
|
1089
|
+
for (var s in a)
|
|
1090
|
+
if (a[s].src == l)
|
|
1091
|
+
return a[s];
|
|
1092
|
+
}
|
|
1093
|
+
return null;
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
/**
|
|
1097
|
+
* Returns whether a given class is active for `element`.
|
|
1098
|
+
*
|
|
1099
|
+
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
1100
|
+
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
1101
|
+
* given class is just the given class with a `no-` prefix.
|
|
1102
|
+
*
|
|
1103
|
+
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
1104
|
+
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
1105
|
+
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
1106
|
+
*
|
|
1107
|
+
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
1108
|
+
* version of it, the class is considered active.
|
|
1109
|
+
*
|
|
1110
|
+
* @param {Element} element
|
|
1111
|
+
* @param {string} className
|
|
1112
|
+
* @param {boolean} [defaultActivation=false]
|
|
1113
|
+
* @returns {boolean}
|
|
1114
|
+
*/
|
|
1115
|
+
isActive: function(l, a, s) {
|
|
1116
|
+
for (var o = "no-" + a; l; ) {
|
|
1117
|
+
var i = l.classList;
|
|
1118
|
+
if (i.contains(a))
|
|
1119
|
+
return !0;
|
|
1120
|
+
if (i.contains(o))
|
|
1121
|
+
return !1;
|
|
1122
|
+
l = l.parentElement;
|
|
1123
|
+
}
|
|
1124
|
+
return !!s;
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
/**
|
|
1128
|
+
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
1129
|
+
*
|
|
1130
|
+
* @namespace
|
|
1131
|
+
* @memberof Prism
|
|
1132
|
+
* @public
|
|
1133
|
+
*/
|
|
1134
|
+
languages: {
|
|
1135
|
+
/**
|
|
1136
|
+
* The grammar for plain, unformatted text.
|
|
1137
|
+
*/
|
|
1138
|
+
plain: m,
|
|
1139
|
+
plaintext: m,
|
|
1140
|
+
text: m,
|
|
1141
|
+
txt: m,
|
|
1142
|
+
/**
|
|
1143
|
+
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
1144
|
+
*
|
|
1145
|
+
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
1146
|
+
* will be overwritten at its original position.
|
|
1147
|
+
*
|
|
1148
|
+
* ## Best practices
|
|
1149
|
+
*
|
|
1150
|
+
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
1151
|
+
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
1152
|
+
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
1153
|
+
*
|
|
1154
|
+
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
1155
|
+
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
1156
|
+
*
|
|
1157
|
+
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
1158
|
+
* @param {Grammar} redef The new tokens to append.
|
|
1159
|
+
* @returns {Grammar} The new language created.
|
|
1160
|
+
* @public
|
|
1161
|
+
* @example
|
|
1162
|
+
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
1163
|
+
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
1164
|
+
* // at its original position
|
|
1165
|
+
* 'comment': { ... },
|
|
1166
|
+
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
1167
|
+
* 'color': /\b(?:red|green|blue)\b/
|
|
1168
|
+
* });
|
|
1169
|
+
*/
|
|
1170
|
+
extend: function(l, a) {
|
|
1171
|
+
var s = u.util.clone(u.languages[l]);
|
|
1172
|
+
for (var o in a)
|
|
1173
|
+
s[o] = a[o];
|
|
1174
|
+
return s;
|
|
1175
|
+
},
|
|
1176
|
+
/**
|
|
1177
|
+
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
1178
|
+
*
|
|
1179
|
+
* ## Usage
|
|
1180
|
+
*
|
|
1181
|
+
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
1182
|
+
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
1183
|
+
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
1184
|
+
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
1185
|
+
* this:
|
|
1186
|
+
*
|
|
1187
|
+
* ```js
|
|
1188
|
+
* Prism.languages.markup.style = {
|
|
1189
|
+
* // token
|
|
1190
|
+
* };
|
|
1191
|
+
* ```
|
|
1192
|
+
*
|
|
1193
|
+
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
1194
|
+
* before existing tokens. For the CSS example above, you would use it like this:
|
|
1195
|
+
*
|
|
1196
|
+
* ```js
|
|
1197
|
+
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
1198
|
+
* 'style': {
|
|
1199
|
+
* // token
|
|
1200
|
+
* }
|
|
1201
|
+
* });
|
|
1202
|
+
* ```
|
|
1203
|
+
*
|
|
1204
|
+
* ## Special cases
|
|
1205
|
+
*
|
|
1206
|
+
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
1207
|
+
* will be ignored.
|
|
1208
|
+
*
|
|
1209
|
+
* This behavior can be used to insert tokens after `before`:
|
|
1210
|
+
*
|
|
1211
|
+
* ```js
|
|
1212
|
+
* Prism.languages.insertBefore('markup', 'comment', {
|
|
1213
|
+
* 'comment': Prism.languages.markup.comment,
|
|
1214
|
+
* // tokens after 'comment'
|
|
1215
|
+
* });
|
|
1216
|
+
* ```
|
|
1217
|
+
*
|
|
1218
|
+
* ## Limitations
|
|
1219
|
+
*
|
|
1220
|
+
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
1221
|
+
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
1222
|
+
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
1223
|
+
* deleting properties which is necessary to insert at arbitrary positions.
|
|
1224
|
+
*
|
|
1225
|
+
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
1226
|
+
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
1227
|
+
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
1228
|
+
*
|
|
1229
|
+
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
1230
|
+
* you hold the target object in a variable, then the value of the variable will not change.
|
|
1231
|
+
*
|
|
1232
|
+
* ```js
|
|
1233
|
+
* var oldMarkup = Prism.languages.markup;
|
|
1234
|
+
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
1235
|
+
*
|
|
1236
|
+
* assert(oldMarkup !== Prism.languages.markup);
|
|
1237
|
+
* assert(newMarkup === Prism.languages.markup);
|
|
1238
|
+
* ```
|
|
1239
|
+
*
|
|
1240
|
+
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
1241
|
+
* object to be modified.
|
|
1242
|
+
* @param {string} before The key to insert before.
|
|
1243
|
+
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
1244
|
+
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
1245
|
+
* object to be modified.
|
|
1246
|
+
*
|
|
1247
|
+
* Defaults to `Prism.languages`.
|
|
1248
|
+
* @returns {Grammar} The new grammar object.
|
|
1249
|
+
* @public
|
|
1250
|
+
*/
|
|
1251
|
+
insertBefore: function(l, a, s, o) {
|
|
1252
|
+
o = o || /** @type {any} */
|
|
1253
|
+
u.languages;
|
|
1254
|
+
var i = o[l], d = {};
|
|
1255
|
+
for (var p in i)
|
|
1256
|
+
if (i.hasOwnProperty(p)) {
|
|
1257
|
+
if (p == a)
|
|
1258
|
+
for (var c in s)
|
|
1259
|
+
s.hasOwnProperty(c) && (d[c] = s[c]);
|
|
1260
|
+
s.hasOwnProperty(p) || (d[p] = i[p]);
|
|
1261
|
+
}
|
|
1262
|
+
var y = o[l];
|
|
1263
|
+
return o[l] = d, u.languages.DFS(u.languages, function(S, I) {
|
|
1264
|
+
I === y && S != l && (this[S] = d);
|
|
1265
|
+
}), d;
|
|
1266
|
+
},
|
|
1267
|
+
// Traverse a language definition with Depth First Search
|
|
1268
|
+
DFS: function l(a, s, o, i) {
|
|
1269
|
+
i = i || {};
|
|
1270
|
+
var d = u.util.objId;
|
|
1271
|
+
for (var p in a)
|
|
1272
|
+
if (a.hasOwnProperty(p)) {
|
|
1273
|
+
s.call(a, p, a[p], o || p);
|
|
1274
|
+
var c = a[p], y = u.util.type(c);
|
|
1275
|
+
y === "Object" && !i[d(c)] ? (i[d(c)] = !0, l(c, s, null, i)) : y === "Array" && !i[d(c)] && (i[d(c)] = !0, l(c, s, p, i));
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
},
|
|
1279
|
+
plugins: {},
|
|
1280
|
+
/**
|
|
1281
|
+
* This is the most high-level function in Prism’s API.
|
|
1282
|
+
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
|
1283
|
+
* each one of them.
|
|
1284
|
+
*
|
|
1285
|
+
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
|
1286
|
+
*
|
|
1287
|
+
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
|
1288
|
+
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
|
1289
|
+
* @memberof Prism
|
|
1290
|
+
* @public
|
|
1291
|
+
*/
|
|
1292
|
+
highlightAll: function(l, a) {
|
|
1293
|
+
u.highlightAllUnder(document, l, a);
|
|
1294
|
+
},
|
|
1295
|
+
/**
|
|
1296
|
+
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
1297
|
+
* {@link Prism.highlightElement} on each one of them.
|
|
1298
|
+
*
|
|
1299
|
+
* The following hooks will be run:
|
|
1300
|
+
* 1. `before-highlightall`
|
|
1301
|
+
* 2. `before-all-elements-highlight`
|
|
1302
|
+
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
|
1303
|
+
*
|
|
1304
|
+
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
|
1305
|
+
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
|
1306
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
|
1307
|
+
* @memberof Prism
|
|
1308
|
+
* @public
|
|
1309
|
+
*/
|
|
1310
|
+
highlightAllUnder: function(l, a, s) {
|
|
1311
|
+
var o = {
|
|
1312
|
+
callback: s,
|
|
1313
|
+
container: l,
|
|
1314
|
+
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
1315
|
+
};
|
|
1316
|
+
u.hooks.run("before-highlightall", o), o.elements = Array.prototype.slice.apply(o.container.querySelectorAll(o.selector)), u.hooks.run("before-all-elements-highlight", o);
|
|
1317
|
+
for (var i = 0, d; d = o.elements[i++]; )
|
|
1318
|
+
u.highlightElement(d, a === !0, o.callback);
|
|
1319
|
+
},
|
|
1320
|
+
/**
|
|
1321
|
+
* Highlights the code inside a single element.
|
|
1322
|
+
*
|
|
1323
|
+
* The following hooks will be run:
|
|
1324
|
+
* 1. `before-sanity-check`
|
|
1325
|
+
* 2. `before-highlight`
|
|
1326
|
+
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
|
1327
|
+
* 4. `before-insert`
|
|
1328
|
+
* 5. `after-highlight`
|
|
1329
|
+
* 6. `complete`
|
|
1330
|
+
*
|
|
1331
|
+
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
|
1332
|
+
* the element's language.
|
|
1333
|
+
*
|
|
1334
|
+
* @param {Element} element The element containing the code.
|
|
1335
|
+
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
|
1336
|
+
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
|
1337
|
+
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
|
1338
|
+
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
|
1339
|
+
*
|
|
1340
|
+
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
|
1341
|
+
* asynchronous highlighting to work. You can build your own bundle on the
|
|
1342
|
+
* [Download page](https://prismjs.com/download.html).
|
|
1343
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
|
1344
|
+
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
|
1345
|
+
* @memberof Prism
|
|
1346
|
+
* @public
|
|
1347
|
+
*/
|
|
1348
|
+
highlightElement: function(l, a, s) {
|
|
1349
|
+
var o = u.util.getLanguage(l), i = u.languages[o];
|
|
1350
|
+
u.util.setLanguage(l, o);
|
|
1351
|
+
var d = l.parentElement;
|
|
1352
|
+
d && d.nodeName.toLowerCase() === "pre" && u.util.setLanguage(d, o);
|
|
1353
|
+
var p = l.textContent, c = {
|
|
1354
|
+
element: l,
|
|
1355
|
+
language: o,
|
|
1356
|
+
grammar: i,
|
|
1357
|
+
code: p
|
|
1358
|
+
};
|
|
1359
|
+
function y(I) {
|
|
1360
|
+
c.highlightedCode = I, u.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, u.hooks.run("after-highlight", c), u.hooks.run("complete", c), s && s.call(c.element);
|
|
1361
|
+
}
|
|
1362
|
+
if (u.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
|
|
1363
|
+
u.hooks.run("complete", c), s && s.call(c.element);
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1366
|
+
if (u.hooks.run("before-highlight", c), !c.grammar) {
|
|
1367
|
+
y(u.util.encode(c.code));
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
if (a && t.Worker) {
|
|
1371
|
+
var S = new Worker(u.filename);
|
|
1372
|
+
S.onmessage = function(I) {
|
|
1373
|
+
y(I.data);
|
|
1374
|
+
}, S.postMessage(JSON.stringify({
|
|
1375
|
+
language: c.language,
|
|
1376
|
+
code: c.code,
|
|
1377
|
+
immediateClose: !0
|
|
1378
|
+
}));
|
|
1379
|
+
} else
|
|
1380
|
+
y(u.highlight(c.code, c.grammar, c.language));
|
|
1381
|
+
},
|
|
1382
|
+
/**
|
|
1383
|
+
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
1384
|
+
* and the language definitions to use, and returns a string with the HTML produced.
|
|
1385
|
+
*
|
|
1386
|
+
* The following hooks will be run:
|
|
1387
|
+
* 1. `before-tokenize`
|
|
1388
|
+
* 2. `after-tokenize`
|
|
1389
|
+
* 3. `wrap`: On each {@link Token}.
|
|
1390
|
+
*
|
|
1391
|
+
* @param {string} text A string with the code to be highlighted.
|
|
1392
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
1393
|
+
*
|
|
1394
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
1395
|
+
* @param {string} language The name of the language definition passed to `grammar`.
|
|
1396
|
+
* @returns {string} The highlighted HTML.
|
|
1397
|
+
* @memberof Prism
|
|
1398
|
+
* @public
|
|
1399
|
+
* @example
|
|
1400
|
+
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
1401
|
+
*/
|
|
1402
|
+
highlight: function(l, a, s) {
|
|
1403
|
+
var o = {
|
|
1404
|
+
code: l,
|
|
1405
|
+
grammar: a,
|
|
1406
|
+
language: s
|
|
1407
|
+
};
|
|
1408
|
+
if (u.hooks.run("before-tokenize", o), !o.grammar)
|
|
1409
|
+
throw new Error('The language "' + o.language + '" has no grammar.');
|
|
1410
|
+
return o.tokens = u.tokenize(o.code, o.grammar), u.hooks.run("after-tokenize", o), g.stringify(u.util.encode(o.tokens), o.language);
|
|
1411
|
+
},
|
|
1412
|
+
/**
|
|
1413
|
+
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
1414
|
+
* and the language definitions to use, and returns an array with the tokenized code.
|
|
1415
|
+
*
|
|
1416
|
+
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
1417
|
+
*
|
|
1418
|
+
* This method could be useful in other contexts as well, as a very crude parser.
|
|
1419
|
+
*
|
|
1420
|
+
* @param {string} text A string with the code to be highlighted.
|
|
1421
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
1422
|
+
*
|
|
1423
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
1424
|
+
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
1425
|
+
* @memberof Prism
|
|
1426
|
+
* @public
|
|
1427
|
+
* @example
|
|
1428
|
+
* let code = `var foo = 0;`;
|
|
1429
|
+
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
1430
|
+
* tokens.forEach(token => {
|
|
1431
|
+
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
1432
|
+
* console.log(`Found numeric literal: ${token.content}`);
|
|
1433
|
+
* }
|
|
1434
|
+
* });
|
|
1435
|
+
*/
|
|
1436
|
+
tokenize: function(l, a) {
|
|
1437
|
+
var s = a.rest;
|
|
1438
|
+
if (s) {
|
|
1439
|
+
for (var o in s)
|
|
1440
|
+
a[o] = s[o];
|
|
1441
|
+
delete a.rest;
|
|
1442
|
+
}
|
|
1443
|
+
var i = new C();
|
|
1444
|
+
return B(i, i.head, l), T(l, i, a, i.head, 0), oe(i);
|
|
1445
|
+
},
|
|
1446
|
+
/**
|
|
1447
|
+
* @namespace
|
|
1448
|
+
* @memberof Prism
|
|
1449
|
+
* @public
|
|
1450
|
+
*/
|
|
1451
|
+
hooks: {
|
|
1452
|
+
all: {},
|
|
1453
|
+
/**
|
|
1454
|
+
* Adds the given callback to the list of callbacks for the given hook.
|
|
1455
|
+
*
|
|
1456
|
+
* The callback will be invoked when the hook it is registered for is run.
|
|
1457
|
+
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
1458
|
+
*
|
|
1459
|
+
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
1460
|
+
*
|
|
1461
|
+
* @param {string} name The name of the hook.
|
|
1462
|
+
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
1463
|
+
* @public
|
|
1464
|
+
*/
|
|
1465
|
+
add: function(l, a) {
|
|
1466
|
+
var s = u.hooks.all;
|
|
1467
|
+
s[l] = s[l] || [], s[l].push(a);
|
|
1468
|
+
},
|
|
1469
|
+
/**
|
|
1470
|
+
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
1471
|
+
*
|
|
1472
|
+
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
1473
|
+
*
|
|
1474
|
+
* @param {string} name The name of the hook.
|
|
1475
|
+
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
1476
|
+
* @public
|
|
1477
|
+
*/
|
|
1478
|
+
run: function(l, a) {
|
|
1479
|
+
var s = u.hooks.all[l];
|
|
1480
|
+
if (!(!s || !s.length))
|
|
1481
|
+
for (var o = 0, i; i = s[o++]; )
|
|
1482
|
+
i(a);
|
|
1483
|
+
}
|
|
1484
|
+
},
|
|
1485
|
+
Token: g
|
|
1486
|
+
};
|
|
1487
|
+
t.Prism = u;
|
|
1488
|
+
function g(l, a, s, o) {
|
|
1489
|
+
this.type = l, this.content = a, this.alias = s, this.length = (o || "").length | 0;
|
|
1490
|
+
}
|
|
1491
|
+
g.stringify = function l(a, s) {
|
|
1492
|
+
if (typeof a == "string")
|
|
1493
|
+
return a;
|
|
1494
|
+
if (Array.isArray(a)) {
|
|
1495
|
+
var o = "";
|
|
1496
|
+
return a.forEach(function(y) {
|
|
1497
|
+
o += l(y, s);
|
|
1498
|
+
}), o;
|
|
1499
|
+
}
|
|
1500
|
+
var i = {
|
|
1501
|
+
type: a.type,
|
|
1502
|
+
content: l(a.content, s),
|
|
1503
|
+
tag: "span",
|
|
1504
|
+
classes: ["token", a.type],
|
|
1505
|
+
attributes: {},
|
|
1506
|
+
language: s
|
|
1507
|
+
}, d = a.alias;
|
|
1508
|
+
d && (Array.isArray(d) ? Array.prototype.push.apply(i.classes, d) : i.classes.push(d)), u.hooks.run("wrap", i);
|
|
1509
|
+
var p = "";
|
|
1510
|
+
for (var c in i.attributes)
|
|
1511
|
+
p += " " + c + '="' + (i.attributes[c] || "").replace(/"/g, """) + '"';
|
|
1512
|
+
return "<" + i.tag + ' class="' + i.classes.join(" ") + '"' + p + ">" + i.content + "</" + i.tag + ">";
|
|
1513
|
+
};
|
|
1514
|
+
function P(l, a, s, o) {
|
|
1515
|
+
l.lastIndex = a;
|
|
1516
|
+
var i = l.exec(s);
|
|
1517
|
+
if (i && o && i[1]) {
|
|
1518
|
+
var d = i[1].length;
|
|
1519
|
+
i.index += d, i[0] = i[0].slice(d);
|
|
1520
|
+
}
|
|
1521
|
+
return i;
|
|
1522
|
+
}
|
|
1523
|
+
function T(l, a, s, o, i, d) {
|
|
1524
|
+
for (var p in s)
|
|
1525
|
+
if (!(!s.hasOwnProperty(p) || !s[p])) {
|
|
1526
|
+
var c = s[p];
|
|
1527
|
+
c = Array.isArray(c) ? c : [c];
|
|
1528
|
+
for (var y = 0; y < c.length; ++y) {
|
|
1529
|
+
if (d && d.cause == p + "," + y)
|
|
1530
|
+
return;
|
|
1531
|
+
var S = c[y], I = S.inside, z = !!S.lookbehind, W = !!S.greedy, _ = S.alias;
|
|
1532
|
+
if (W && !S.pattern.global) {
|
|
1533
|
+
var N = S.pattern.toString().match(/[imsuy]*$/)[0];
|
|
1534
|
+
S.pattern = RegExp(S.pattern.source, N + "g");
|
|
1535
|
+
}
|
|
1536
|
+
for (var ne = S.pattern || S, w = o.next, k = i; w !== a.tail && !(d && k >= d.reach); k += w.value.length, w = w.next) {
|
|
1537
|
+
var E = w.value;
|
|
1538
|
+
if (a.length > l.length)
|
|
1539
|
+
return;
|
|
1540
|
+
if (!(E instanceof g)) {
|
|
1541
|
+
var b = 1, $;
|
|
1542
|
+
if (W) {
|
|
1543
|
+
if ($ = P(ne, k, l, z), !$ || $.index >= l.length)
|
|
1544
|
+
break;
|
|
1545
|
+
var K = $.index, ve = $.index + $[0].length, j = k;
|
|
1546
|
+
for (j += w.value.length; K >= j; )
|
|
1547
|
+
w = w.next, j += w.value.length;
|
|
1548
|
+
if (j -= w.value.length, k = j, w.value instanceof g)
|
|
1549
|
+
continue;
|
|
1550
|
+
for (var F = w; F !== a.tail && (j < ve || typeof F.value == "string"); F = F.next)
|
|
1551
|
+
b++, j += F.value.length;
|
|
1552
|
+
b--, E = l.slice(k, j), $.index -= k;
|
|
1553
|
+
} else if ($ = P(ne, 0, E, z), !$)
|
|
1554
|
+
continue;
|
|
1555
|
+
var K = $.index, G = $[0], pe = E.slice(0, K), Le = E.slice(K + G.length), ge = k + E.length;
|
|
1556
|
+
d && ge > d.reach && (d.reach = ge);
|
|
1557
|
+
var se = w.prev;
|
|
1558
|
+
pe && (se = B(a, se, pe), k += pe.length), R(a, se, b);
|
|
1559
|
+
var mn = new g(p, I ? u.tokenize(G, I) : G, _, G);
|
|
1560
|
+
if (w = B(a, se, mn), Le && B(a, w, Le), b > 1) {
|
|
1561
|
+
var he = {
|
|
1562
|
+
cause: p + "," + y,
|
|
1563
|
+
reach: ge
|
|
1564
|
+
};
|
|
1565
|
+
T(l, a, s, w.prev, k, he), d && he.reach > d.reach && (d.reach = he.reach);
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
function C() {
|
|
1573
|
+
var l = { value: null, prev: null, next: null }, a = { value: null, prev: l, next: null };
|
|
1574
|
+
l.next = a, this.head = l, this.tail = a, this.length = 0;
|
|
1575
|
+
}
|
|
1576
|
+
function B(l, a, s) {
|
|
1577
|
+
var o = a.next, i = { value: s, prev: a, next: o };
|
|
1578
|
+
return a.next = i, o.prev = i, l.length++, i;
|
|
1579
|
+
}
|
|
1580
|
+
function R(l, a, s) {
|
|
1581
|
+
for (var o = a.next, i = 0; i < s && o !== l.tail; i++)
|
|
1582
|
+
o = o.next;
|
|
1583
|
+
a.next = o, o.prev = a, l.length -= i;
|
|
1584
|
+
}
|
|
1585
|
+
function oe(l) {
|
|
1586
|
+
for (var a = [], s = l.head.next; s !== l.tail; )
|
|
1587
|
+
a.push(s.value), s = s.next;
|
|
1588
|
+
return a;
|
|
1589
|
+
}
|
|
1590
|
+
if (!t.document)
|
|
1591
|
+
return t.addEventListener && (u.disableWorkerMessageHandler || t.addEventListener("message", function(l) {
|
|
1592
|
+
var a = JSON.parse(l.data), s = a.language, o = a.code, i = a.immediateClose;
|
|
1593
|
+
t.postMessage(u.highlight(o, u.languages[s], s)), i && t.close();
|
|
1594
|
+
}, !1)), u;
|
|
1595
|
+
var M = u.util.currentScript();
|
|
1596
|
+
M && (u.filename = M.src, M.hasAttribute("data-manual") && (u.manual = !0));
|
|
1597
|
+
function J() {
|
|
1598
|
+
u.manual || u.highlightAll();
|
|
1599
|
+
}
|
|
1600
|
+
if (!u.manual) {
|
|
1601
|
+
var q = document.readyState;
|
|
1602
|
+
q === "loading" || q === "interactive" && M && M.defer ? document.addEventListener("DOMContentLoaded", J) : window.requestAnimationFrame ? window.requestAnimationFrame(J) : window.setTimeout(J, 16);
|
|
1603
|
+
}
|
|
1604
|
+
return u;
|
|
1605
|
+
}(n);
|
|
1606
|
+
e.exports && (e.exports = r), typeof fe < "u" && (fe.Prism = r);
|
|
1607
|
+
})(vn);
|
|
1608
|
+
var bl = vn.exports, te = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof fe == "object" ? fe : {}, wl = Nl();
|
|
1609
|
+
te.Prism = { manual: !0, disableWorkerMessageHandler: !0 };
|
|
1610
|
+
var Cl = Hr, Sl = al, pn = bl, Al = xn, Pl = bn, El = wn, $l = Cn;
|
|
1611
|
+
wl();
|
|
1612
|
+
var ke = {}.hasOwnProperty;
|
|
1613
|
+
function gn() {
|
|
1614
|
+
}
|
|
1615
|
+
gn.prototype = pn;
|
|
1616
|
+
var A = new gn(), hn = A;
|
|
1617
|
+
A.highlight = kl;
|
|
1618
|
+
A.register = ie;
|
|
1619
|
+
A.alias = Tl;
|
|
1620
|
+
A.registered = Ll;
|
|
1621
|
+
A.listLanguages = Ol;
|
|
1622
|
+
ie(Al);
|
|
1623
|
+
ie(Pl);
|
|
1624
|
+
ie(El);
|
|
1625
|
+
ie($l);
|
|
1626
|
+
A.util.encode = Dl;
|
|
1627
|
+
A.Token.stringify = Ml;
|
|
1628
|
+
function ie(e) {
|
|
1629
|
+
if (typeof e != "function" || !e.displayName)
|
|
1630
|
+
throw new Error("Expected `function` for `grammar`, got `" + e + "`");
|
|
1631
|
+
A.languages[e.displayName] === void 0 && e(A);
|
|
1632
|
+
}
|
|
1633
|
+
function Tl(e, n) {
|
|
1634
|
+
var r = A.languages, t = e, f, v, m, u;
|
|
1635
|
+
n && (t = {}, t[e] = n);
|
|
1636
|
+
for (f in t)
|
|
1637
|
+
for (v = t[f], v = typeof v == "string" ? [v] : v, m = v.length, u = -1; ++u < m; )
|
|
1638
|
+
r[v[u]] = r[f];
|
|
1639
|
+
}
|
|
1640
|
+
function kl(e, n) {
|
|
1641
|
+
var r = pn.highlight, t;
|
|
1642
|
+
if (typeof e != "string")
|
|
1643
|
+
throw new Error("Expected `string` for `value`, got `" + e + "`");
|
|
1644
|
+
if (A.util.type(n) === "Object")
|
|
1645
|
+
t = n, n = null;
|
|
1646
|
+
else {
|
|
1647
|
+
if (typeof n != "string")
|
|
1648
|
+
throw new Error("Expected `string` for `name`, got `" + n + "`");
|
|
1649
|
+
if (ke.call(A.languages, n))
|
|
1650
|
+
t = A.languages[n];
|
|
1651
|
+
else
|
|
1652
|
+
throw new Error("Unknown language: `" + n + "` is not registered");
|
|
1653
|
+
}
|
|
1654
|
+
return r.call(this, e, t, n);
|
|
1655
|
+
}
|
|
1656
|
+
function Ll(e) {
|
|
1657
|
+
if (typeof e != "string")
|
|
1658
|
+
throw new Error("Expected `string` for `language`, got `" + e + "`");
|
|
1659
|
+
return ke.call(A.languages, e);
|
|
1660
|
+
}
|
|
1661
|
+
function Ol() {
|
|
1662
|
+
var e = A.languages, n = [], r;
|
|
1663
|
+
for (r in e)
|
|
1664
|
+
ke.call(e, r) && typeof e[r] == "object" && n.push(r);
|
|
1665
|
+
return n;
|
|
1666
|
+
}
|
|
1667
|
+
function Ml(e, n, r) {
|
|
1668
|
+
var t;
|
|
1669
|
+
return typeof e == "string" ? { type: "text", value: e } : A.util.type(e) === "Array" ? Il(e, n) : (t = {
|
|
1670
|
+
type: e.type,
|
|
1671
|
+
content: A.Token.stringify(e.content, n, r),
|
|
1672
|
+
tag: "span",
|
|
1673
|
+
classes: ["token", e.type],
|
|
1674
|
+
attributes: {},
|
|
1675
|
+
language: n,
|
|
1676
|
+
parent: r
|
|
1677
|
+
}, e.alias && (t.classes = t.classes.concat(e.alias)), A.hooks.run("wrap", t), Cl(
|
|
1678
|
+
t.tag + "." + t.classes.join("."),
|
|
1679
|
+
Ul(t.attributes),
|
|
1680
|
+
t.content
|
|
1681
|
+
));
|
|
1682
|
+
}
|
|
1683
|
+
function Il(e, n) {
|
|
1684
|
+
for (var r = [], t = e.length, f = -1, v; ++f < t; )
|
|
1685
|
+
v = e[f], v !== "" && v !== null && v !== void 0 && r.push(v);
|
|
1686
|
+
for (f = -1, t = r.length; ++f < t; )
|
|
1687
|
+
v = r[f], r[f] = A.Token.stringify(v, n, r);
|
|
1688
|
+
return r;
|
|
1689
|
+
}
|
|
1690
|
+
function Dl(e) {
|
|
1691
|
+
return e;
|
|
1692
|
+
}
|
|
1693
|
+
function Ul(e) {
|
|
1694
|
+
var n;
|
|
1695
|
+
for (n in e)
|
|
1696
|
+
e[n] = Sl(e[n]);
|
|
1697
|
+
return e;
|
|
1698
|
+
}
|
|
1699
|
+
function Nl() {
|
|
1700
|
+
var e = "Prism" in te, n = e ? te.Prism : void 0;
|
|
1701
|
+
return r;
|
|
1702
|
+
function r() {
|
|
1703
|
+
e ? te.Prism = n : delete te.Prism, e = void 0, n = void 0;
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
const jl = /* @__PURE__ */ yn(hn), Bl = /* @__PURE__ */ Sn({
|
|
1707
|
+
__proto__: null,
|
|
1708
|
+
default: jl
|
|
1709
|
+
}, [hn]);
|
|
1710
|
+
export {
|
|
1711
|
+
Bl as c
|
|
1712
|
+
};
|