Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
89
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/accessibility-menu.js
vendored
Normal file
89
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/accessibility-menu.js
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
!function(i, e) {
|
||||
var s, u, a = i.config.menuSettings, t = Function.prototype.bind ? function(e, t) {
|
||||
return e.bind(t);
|
||||
} : function(e, t) {
|
||||
return function() {
|
||||
e.apply(t, arguments);
|
||||
};
|
||||
}, o = Object.keys || function(e) {
|
||||
var t = [];
|
||||
for (var n in e) e.hasOwnProperty(n) && t.push(n);
|
||||
return t;
|
||||
}, n = MathJax.Ajax.config.path;
|
||||
n.a11y || (n.a11y = i.config.root + "/extensions/a11y");
|
||||
var l = e["accessibility-menu"] = {
|
||||
version: "1.6.0",
|
||||
prefix: "",
|
||||
defaults: {},
|
||||
modules: [],
|
||||
MakeOption: function(e) {
|
||||
return l.prefix + e;
|
||||
},
|
||||
GetOption: function(e) {
|
||||
return a[l.MakeOption(e)];
|
||||
},
|
||||
AddDefaults: function() {
|
||||
for (var e, t = o(l.defaults), n = 0; e = t[n]; n++) {
|
||||
var i = l.MakeOption(e);
|
||||
void 0 === a[i] && (a[i] = l.defaults[e]);
|
||||
}
|
||||
},
|
||||
AddMenu: function() {
|
||||
for (var e, t = Array(this.modules.length), n = 0; e = this.modules[n]; n++) t[n] = e.placeHolder;
|
||||
var i, a, o = u.FindId("Accessibility");
|
||||
o ? (t.unshift(s.RULE()), o.submenu.items.push.apply(o.submenu.items, t)) : ((i = (u.FindId("Settings", "Renderer") || {}).submenu) && (t.unshift(s.RULE()),
|
||||
t.unshift(i.items.pop()), t.unshift(i.items.pop())), t.unshift("Accessibility"),
|
||||
o = s.SUBMENU.apply(s.SUBMENU, t), (a = u.IndexOfId("Locale")) ? u.items.splice(a, 0, o) : u.items.push(s.RULE(), o));
|
||||
},
|
||||
Register: function(e) {
|
||||
l.defaults[e.option] = !1, l.modules.push(e);
|
||||
},
|
||||
Startup: function() {
|
||||
s = MathJax.Menu.ITEM, u = MathJax.Menu.menu;
|
||||
for (var e, t = 0; e = this.modules[t]; t++) e.CreateMenu();
|
||||
this.AddMenu();
|
||||
},
|
||||
LoadExtensions: function() {
|
||||
for (var e, t = [], n = 0; e = this.modules[n]; n++) a[e.option] && t.push(e.module);
|
||||
return t.length ? i.Startup.loadArray(t) : null;
|
||||
}
|
||||
}, r = MathJax.Extension.ModuleLoader = MathJax.Object.Subclass({
|
||||
option: "",
|
||||
name: [ "", "" ],
|
||||
module: "",
|
||||
placeHolder: null,
|
||||
submenu: !1,
|
||||
extension: null,
|
||||
Init: function(e, t, n, i, a) {
|
||||
this.option = e, this.name = [ t.replace(/ /g, ""), t ], this.module = n, this.extension = i,
|
||||
this.submenu = a || !1;
|
||||
},
|
||||
CreateMenu: function() {
|
||||
var e = t(this.Load, this);
|
||||
this.submenu ? this.placeHolder = s.SUBMENU(this.name, s.CHECKBOX([ "Activate", "Activate" ], l.MakeOption(this.option), {
|
||||
action: e
|
||||
}), s.RULE(), s.COMMAND([ "OptionsWhenActive", "(Options when Active)" ], null, {
|
||||
disabled: !0
|
||||
})) : this.placeHolder = s.CHECKBOX(this.name, l.MakeOption(this.option), {
|
||||
action: e
|
||||
});
|
||||
},
|
||||
Load: function() {
|
||||
i.Queue([ "Require", MathJax.Ajax, this.module, [ "Enable", this ] ]);
|
||||
},
|
||||
Enable: function(e) {
|
||||
var t = MathJax.Extension[this.extension];
|
||||
t && (t.Enable(!0, !0), MathJax.Menu.saveCookie());
|
||||
}
|
||||
});
|
||||
l.Register(r("collapsible", "Collapsible Math", "[a11y]/collapsible.js", "collapsible")),
|
||||
l.Register(r("autocollapse", "Auto Collapse", "[a11y]/auto-collapse.js", "auto-collapse")),
|
||||
l.Register(r("explorer", "Explorer", "[a11y]/explorer.js", "explorer", !0)), l.AddDefaults(),
|
||||
i.Register.StartupHook("End Extensions", function() {
|
||||
i.Register.StartupHook("MathMenu Ready", function() {
|
||||
l.Startup(), i.Startup.signal.Post("Accessibility Menu Ready");
|
||||
}, 5);
|
||||
}, 5), MathJax.Hub.Register.StartupHook("End Cookie", function() {
|
||||
MathJax.Callback.Queue([ "LoadExtensions", l ], [ "loadComplete", MathJax.Ajax, "[a11y]/accessibility-menu.js" ]);
|
||||
});
|
||||
}(MathJax.Hub, MathJax.Extension);
|
251
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/auto-collapse.js
vendored
Normal file
251
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/auto-collapse.js
vendored
Normal file
|
@ -0,0 +1,251 @@
|
|||
!function(c) {
|
||||
var s = c.config.menuSettings, r = {}, t = MathJax.Ajax.config.path;
|
||||
t.a11y || (t.a11y = c.config.root + "/extensions/a11y");
|
||||
var l = MathJax.Extension["auto-collapse"] = {
|
||||
version: "1.6.0",
|
||||
config: c.CombineConfig("auto-collapse", {
|
||||
disabled: !1
|
||||
}),
|
||||
dependents: [],
|
||||
Enable: function(t, e) {
|
||||
s.autocollapse = !0, e && (r.autocollapse = !0), this.config.disabled = !1, MathJax.Extension.collapsible.Enable(!1, e),
|
||||
t && c.Queue([ "Reprocess", c ], [ "CollapseWideMath", this ]);
|
||||
},
|
||||
Disable: function(t, e) {
|
||||
s.autocollapse = !1, e && (r.autocollapse = !1), this.config.disabled = !0;
|
||||
for (var n = this.dependents.length - 1; 0 <= n; n--) {
|
||||
var o = this.dependents[n];
|
||||
o.Disable && o.Disable(!1, e);
|
||||
}
|
||||
t && c.Queue([ "Rerender", c ]);
|
||||
},
|
||||
Dependent: function(t) {
|
||||
this.dependents.push(t);
|
||||
},
|
||||
Startup: function() {
|
||||
var t = MathJax.Extension.collapsible;
|
||||
t && t.Dependent(this), c.postInputHooks.Add([ "Filter", l ], 150), c.Queue(function() {
|
||||
return l.CollapseWideMath();
|
||||
}), window.addEventListener ? window.addEventListener("resize", l.resizeHandler, !1) : window.attachEvent ? window.attachEvent("onresize", l.resizeHandler) : window.onresize = l.resizeHandler;
|
||||
},
|
||||
Filter: function(t, e, n) {
|
||||
t.enriched && !this.config.disabled && ("block" === t.root.Get("display") || n.parentNode.childNodes.length <= 3) && (t.root.SRE = {
|
||||
action: this.Actions(t.root)
|
||||
});
|
||||
},
|
||||
Actions: function(t) {
|
||||
var e = [];
|
||||
return this.getActions(t, 0, e), this.sortActions(e);
|
||||
},
|
||||
getActions: function(t, e, n) {
|
||||
if (!t.isToken && t.data) {
|
||||
e++;
|
||||
for (var o, i = 0, a = t.data.length; i < a; i++) {
|
||||
t.data[i] && ((o = t.data[i]).collapsible ? (n[e] || (n[e] = []), n[e].push(o),
|
||||
this.getActions(o.data[1], e, n)) : this.getActions(o, e, n));
|
||||
}
|
||||
}
|
||||
},
|
||||
sortActions: function(t) {
|
||||
for (var e = [], n = 0, o = t.length; n < o; n++) t[n] && (e = e.concat(t[n].sort(this.sortActionsBy)));
|
||||
return e;
|
||||
},
|
||||
sortActionsBy: function(t, e) {
|
||||
return (t = t.data[1].complexity) < (e = e.data[1].complexity) ? -1 : e < t ? 1 : 0;
|
||||
},
|
||||
CollapseWideMath: function(t) {
|
||||
if (!this.config.disabled) {
|
||||
this.GetContainerWidths(t);
|
||||
var e = c.getAllJax(t), n = {
|
||||
collapse: [],
|
||||
jax: e,
|
||||
m: e.length,
|
||||
i: 0,
|
||||
changed: !1
|
||||
};
|
||||
return this.collapseState(n);
|
||||
}
|
||||
},
|
||||
collapseState: function(t) {
|
||||
for (var e = t.collapse; t.i < t.m; ) {
|
||||
var n = t.jax[t.i], o = n.root.SRE;
|
||||
if (t.changed = !1, o && o.action.length && (o.cwidth < o.m || o.cwidth > o.M)) {
|
||||
var i = this.getActionWidths(n, t);
|
||||
if (i) return i;
|
||||
this.collapseActions(o, t), t.changed && e.push(n.SourceElement());
|
||||
}
|
||||
t.i++;
|
||||
}
|
||||
if (0 !== e.length) return 1 === e.length && (e = e[0]), c.Rerender(e);
|
||||
},
|
||||
collapseActions: function(t, e) {
|
||||
for (var n = t.width, o = n, i = 1e6, a = t.action.length - 1; 0 <= a; a--) {
|
||||
var s = t.action[a], r = s.selection;
|
||||
n > t.cwidth ? (s.selection = 1, o = s.SREwidth, i = n) : s.selection = 2, n = s.SREwidth,
|
||||
t.DOMupdate ? document.getElementById(s.id).setAttribute("selection", s.selection) : s.selection !== r && (e.changed = !0);
|
||||
}
|
||||
t.m = o, t.M = i;
|
||||
},
|
||||
getActionWidths: function(t, e) {
|
||||
if (!t.root.SRE.actionWidths) {
|
||||
MathJax.OutputJax[t.outputJax].getMetrics(t);
|
||||
try {
|
||||
this.computeActionWidths(t);
|
||||
} catch (t) {
|
||||
if (!t.restart) throw t;
|
||||
return MathJax.Callback.After([ "collapseState", this, e ], t.restart);
|
||||
}
|
||||
e.changed = !0;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
computeActionWidths: function(t) {
|
||||
var e, n = t.root.SRE, o = n.action, i = {};
|
||||
for (n.width = t.sreGetRootWidth(i), e = o.length - 1; 0 <= e; e--) o[e].selection = 2;
|
||||
for (e = o.length - 1; 0 <= e; e--) {
|
||||
var a = o[e];
|
||||
null == a.SREwidth && (a.selection = 1, a.SREwidth = t.sreGetActionWidth(i, a));
|
||||
}
|
||||
n.actionWidths = !0;
|
||||
},
|
||||
GetContainerWidths: function(t) {
|
||||
for (var e, n, o, i = c.getAllJax(t), a = MathJax.HTML.Element("span", {
|
||||
style: {
|
||||
display: "block"
|
||||
}
|
||||
}), s = [], r = 0, l = i.length; r < l; r++) o = (n = i[r]).root, SRE = o.SRE, SRE && SRE.action.length && (null == SRE.width && (n.sreGetMetrics(),
|
||||
SRE.m = SRE.width, SRE.M = 1e6), (e = n.SourceElement()).previousSibling.style.display = "none",
|
||||
e.parentNode.insertBefore(a.cloneNode(!1), e), s.push([ n, e ]));
|
||||
for (r = 0, l = s.length; r < l; r++) n = s[r][0], (e = s[r][1]).previousSibling.offsetWidth && (n.root.SRE.cwidth = e.previousSibling.offsetWidth * n.root.SRE.em);
|
||||
for (r = 0, l = s.length; r < l; r++) n = s[r][0], (e = s[r][1]).parentNode.removeChild(e.previousSibling),
|
||||
e.previousSibling.style.display = "";
|
||||
},
|
||||
timer: null,
|
||||
running: !1,
|
||||
retry: !1,
|
||||
saved_delay: 0,
|
||||
resizeHandler: function(t) {
|
||||
l.config.disabled || (l.running ? l.retry = !0 : (l.timer && clearTimeout(l.timer),
|
||||
l.timer = setTimeout(l.resizeAction, 100)));
|
||||
},
|
||||
resizeAction: function() {
|
||||
l.timer = null, l.running = !0, c.Queue(function() {
|
||||
l.saved_delay = c.processSectionDelay, c.processSectionDelay = 0;
|
||||
}, [ "CollapseWideMath", l ], [ "resizeCheck", l ]);
|
||||
},
|
||||
resizeCheck: function() {
|
||||
l.running = !1, c.processSectionDelay = l.saved_delay, l.retry && (l.retry = !1,
|
||||
setTimeout(l.resizeHandler, 0));
|
||||
}
|
||||
};
|
||||
c.Register.StartupHook("End Extensions", function() {
|
||||
null == s.autocollapse ? s.autocollapse = !l.config.disabled : l.config.disabled = !s.autocollapse,
|
||||
c.Register.StartupHook("MathMenu Ready", function() {
|
||||
r = MathJax.Menu.cookie;
|
||||
var t, e = MathJax.Menu.ITEM, n = MathJax.Menu.menu, o = e.CHECKBOX([ "AutoCollapse", "Auto Collapse" ], "autocollapse", {
|
||||
action: function(t) {
|
||||
l[s.autocollapse ? "Enable" : "Disable"](!0, !0), MathJax.Menu.saveCookie();
|
||||
}
|
||||
}), i = (n.FindId("Accessibility") || {}).submenu;
|
||||
i ? null !== (t = i.IndexOfId("AutoCollapse")) ? i.items[t] = o : (t = i.IndexOfId("CollapsibleMath"),
|
||||
i.items.splice(t + 1, 0, o)) : (t = n.IndexOfId("CollapsibleMath"), n.items.splice(t + 1, 0, o));
|
||||
function a() {
|
||||
l[s.autocollapse ? "Enable" : "Disable"]();
|
||||
}
|
||||
MathJax.Extension.collapse ? a() : MathJax.Hub.Register.StartupHook("Auto Collapse Ready", a);
|
||||
}, 25);
|
||||
}, 25);
|
||||
}(MathJax.Hub), MathJax.ElementJax.Augment({
|
||||
sreGetMetrics: function() {
|
||||
MathJax.OutputJax[this.outputJax].sreGetMetrics(this, this.root.SRE);
|
||||
},
|
||||
sreGetRootWidth: function(t) {
|
||||
return MathJax.OutputJax[this.outputJax].sreGetRootWidth(this, t);
|
||||
},
|
||||
sreGetActionWidth: function(t, e) {
|
||||
return MathJax.OutputJax[this.outputJax].sreGetActionWidth(this, t, e);
|
||||
}
|
||||
}), MathJax.OutputJax.Augment({
|
||||
getMetrics: function() {},
|
||||
sreGetMetrics: function(t, e) {
|
||||
e.cwidth = 1e6, e.width = 0, e.em = 12;
|
||||
},
|
||||
sreGetRootWidth: function(t, e) {
|
||||
return 0;
|
||||
},
|
||||
sreGetActionWidth: function(t, e, n) {
|
||||
return 0;
|
||||
}
|
||||
}), MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready", function() {
|
||||
MathJax.OutputJax["HTML-CSS"].Augment({
|
||||
sreGetMetrics: function(t, e) {
|
||||
e.width = t.root.data[0].HTMLspanElement().parentNode.bbox.w, e.em = 1 / t.HTMLCSS.em / t.HTMLCSS.scale;
|
||||
},
|
||||
sreGetRootWidth: function(t, e) {
|
||||
var n = t.root.data[0].HTMLspanElement();
|
||||
return e.box = n.parentNode, e.box.bbox.w;
|
||||
},
|
||||
sreGetActionWidth: function(t, e, n) {
|
||||
return t.root.data[0].toHTML(e.box).bbox.w;
|
||||
}
|
||||
});
|
||||
}), MathJax.Hub.Register.StartupHook("SVG Jax Ready", function() {
|
||||
MathJax.OutputJax.SVG.Augment({
|
||||
getMetrics: function(t) {
|
||||
this.em = MathJax.ElementJax.mml.mbase.prototype.em = t.SVG.em, this.ex = t.SVG.ex,
|
||||
this.linebreakWidth = t.SVG.lineWidth, this.cwidth = t.SVG.cwidth;
|
||||
},
|
||||
sreGetMetrics: function(t, e) {
|
||||
e.width = t.root.SVGdata.w / 1e3, e.em = 1 / t.SVG.em;
|
||||
},
|
||||
sreGetRootWidth: function(t, e) {
|
||||
return e.span = document.getElementById(t.inputID + "-Frame"), t.root.SVGdata.w / 1e3;
|
||||
},
|
||||
sreGetActionWidth: function(t, e, n) {
|
||||
this.mathDiv = e.span, e.span.appendChild(this.textSVG);
|
||||
try {
|
||||
t.root.data[0].toSVG();
|
||||
} catch (t) {
|
||||
var o = t;
|
||||
}
|
||||
if (e.span.removeChild(this.textSVG), o) throw o;
|
||||
return t.root.data[0].SVGdata.w / 1e3;
|
||||
}
|
||||
});
|
||||
}), MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready", function() {
|
||||
MathJax.OutputJax.CommonHTML.Augment({
|
||||
sreGetMetrics: function(t, e) {
|
||||
e.width = t.root.CHTML.w, e.em = 1 / t.CHTML.em / t.CHTML.scale;
|
||||
},
|
||||
sreGetRootWidth: function(t, e) {
|
||||
return e.span = document.getElementById(t.inputID + "-Frame").firstChild, e.tmp = document.createElement("span"),
|
||||
e.tmp.className = e.span.className, t.root.CHTML.w / t.CHTML.scale;
|
||||
},
|
||||
sreGetActionWidth: function(t, e, n) {
|
||||
e.span.parentNode.replaceChild(e.tmp, e.span), MathJax.OutputJax.CommonHTML.CHTMLnode = e.tmp;
|
||||
try {
|
||||
t.root.data[0].toCommonHTML(e.tmp);
|
||||
} catch (t) {
|
||||
var o = t;
|
||||
}
|
||||
if (e.tmp.parentNode.replaceChild(e.span, e.tmp), o) throw o;
|
||||
return t.root.data[0].CHTML.w / t.CHTML.scale;
|
||||
}
|
||||
});
|
||||
}), MathJax.Hub.Register.StartupHook("NativeMML Jax Ready", function() {
|
||||
MathJax.OutputJax.NativeMML.Augment({
|
||||
sreGetMetrics: function(t, e) {
|
||||
var n = document.getElementById(t.inputID + "-Frame");
|
||||
e.width = n.offsetWidth, e.em = 1, e.DOMupdate = !0;
|
||||
},
|
||||
sreGetRootWidth: function(t, e) {
|
||||
return e.span = document.getElementById(t.inputID + "-Frame").firstChild, e.span.offsetWidth;
|
||||
},
|
||||
sreGetActionWidth: function(t, e, n) {
|
||||
return document.getElementById(n.id).setAttribute("selection", 1), e.span.offsetWidth;
|
||||
}
|
||||
});
|
||||
}), MathJax.Ajax.Require("[a11y]/collapsible.js"), MathJax.Hub.Register.StartupHook("Collapsible Ready", function() {
|
||||
MathJax.Extension["auto-collapse"].Startup(), MathJax.Hub.Startup.signal.Post("Auto Collapse Ready"),
|
||||
MathJax.Ajax.loadComplete("[a11y]/auto-collapse.js");
|
||||
});
|
344
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/collapsible.js
vendored
Normal file
344
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/collapsible.js
vendored
Normal file
|
@ -0,0 +1,344 @@
|
|||
!function(s) {
|
||||
var n, l = s.config.menuSettings, o = {}, r = "data-semantic-complexity", t = MathJax.Ajax.config.path;
|
||||
t.a11y || (t.a11y = s.config.root + "/extensions/a11y");
|
||||
var h = MathJax.Extension.collapsible = {
|
||||
version: "1.6.0",
|
||||
config: s.CombineConfig("collapsible", {
|
||||
disabled: !1
|
||||
}),
|
||||
dependents: [],
|
||||
COMPLEXATTR: r,
|
||||
COMPLEXITY: {
|
||||
TEXT: .5,
|
||||
TOKEN: .5,
|
||||
CHILD: 1,
|
||||
SCRIPT: .8,
|
||||
SQRT: 2,
|
||||
SUBSUP: 2,
|
||||
UNDEROVER: 2,
|
||||
FRACTION: 2,
|
||||
ACTION: 2,
|
||||
PHANTOM: 0,
|
||||
XML: 2,
|
||||
GLYPH: 2
|
||||
},
|
||||
COLLAPSE: {
|
||||
identifier: 3,
|
||||
number: 3,
|
||||
text: 10,
|
||||
infixop: 15,
|
||||
relseq: 15,
|
||||
multirel: 15,
|
||||
fenced: 18,
|
||||
bigop: 20,
|
||||
integral: 20,
|
||||
fraction: 12,
|
||||
sqrt: 9,
|
||||
root: 12,
|
||||
vector: 15,
|
||||
matrix: 15,
|
||||
cases: 15,
|
||||
superscript: 9,
|
||||
subscript: 9,
|
||||
subsup: 9,
|
||||
punctuated: {
|
||||
endpunct: 1e7,
|
||||
startpunct: 1e7,
|
||||
value: 12
|
||||
}
|
||||
},
|
||||
MARKER: {
|
||||
identifier: "x",
|
||||
number: "#",
|
||||
text: "...",
|
||||
appl: {
|
||||
"limit function": "lim",
|
||||
value: "f()"
|
||||
},
|
||||
fraction: "/",
|
||||
sqrt: "\u221a",
|
||||
root: "\u221a",
|
||||
superscript: "\u25fd\u02d9",
|
||||
subscript: "\u25fd.",
|
||||
subsup: "\u25fd:",
|
||||
vector: {
|
||||
binomial: "(:)",
|
||||
determinant: "|:|",
|
||||
value: "\u27e8:\u27e9"
|
||||
},
|
||||
matrix: {
|
||||
squarematrix: "[::]",
|
||||
rowvector: "\u27e8\u22ef\u27e9",
|
||||
columnvector: "\u27e8\u22ee\u27e9",
|
||||
determinant: "|::|",
|
||||
value: "(::)"
|
||||
},
|
||||
cases: "{:",
|
||||
infixop: {
|
||||
addition: "+",
|
||||
subtraction: "\u2212",
|
||||
multiplication: "\u22c5",
|
||||
implicit: "\u22c5",
|
||||
value: "+"
|
||||
},
|
||||
punctuated: {
|
||||
text: "...",
|
||||
value: ","
|
||||
}
|
||||
},
|
||||
Enable: function(t, i) {
|
||||
l.collapsible = !0, i && (o.collapsible = !0), this.config.disabled = !1, MathJax.Extension["semantic-enrich"].Enable(!1, i),
|
||||
t && s.Queue([ "Reprocess", s ]);
|
||||
},
|
||||
Disable: function(t, i) {
|
||||
l.collapsible = !1, i && (o.collapsible = !1), this.config.disabled = !0;
|
||||
for (var e = this.dependents.length - 1; 0 <= e; e--) {
|
||||
var a = this.dependents[e];
|
||||
a.Disable && a.Disable(!1, i);
|
||||
}
|
||||
t && s.Queue([ "Reprocess", s ]);
|
||||
},
|
||||
Dependent: function(t) {
|
||||
this.dependents.push(t);
|
||||
},
|
||||
Startup: function() {
|
||||
n = MathJax.ElementJax.mml;
|
||||
var t = MathJax.Extension["semantic-enrich"];
|
||||
t && t.Dependent(this), s.postInputHooks.Add([ "Filter", h ], 100);
|
||||
},
|
||||
Filter: function(t, i, e) {
|
||||
t.enriched && !this.config.disabled && (t.root = t.root.Collapse(), t.root.inputID = e.id);
|
||||
},
|
||||
Marker: function(t) {
|
||||
return n.mtext("\u25c2" + t + "\u25b8").With({
|
||||
mathcolor: "blue",
|
||||
attr: {},
|
||||
attrNames: []
|
||||
});
|
||||
},
|
||||
MakeAction: function(t, i) {
|
||||
var e = n.maction(t).With({
|
||||
id: this.getActionID(),
|
||||
actiontype: "toggle",
|
||||
complexity: t.getComplexity(),
|
||||
collapsible: !0,
|
||||
attrNames: [ "id", "actiontype", "selection", r ],
|
||||
attr: {},
|
||||
selection: 2
|
||||
});
|
||||
if (e.attr[r] = e.complexity, "math" === i.type) {
|
||||
var a = n.mrow().With({
|
||||
complexity: i.complexity,
|
||||
attrNames: [],
|
||||
attr: {}
|
||||
});
|
||||
a.Append.apply(a, i.data[0].data), i.data[0].data = [];
|
||||
for (var s, l = i.attrNames.length - 1; s = i.attrNames[l]; l--) "data-semantic-" === s.substr(0, 14) && (a.attr[s] = i.attr[s],
|
||||
a.attrNames.push(s), delete i.attr[s], i.attrNames.splice(l, 1));
|
||||
a.complexity = i.complexity, e.Append(a), i.Append(e), i.complexity = e.complexity,
|
||||
e = i;
|
||||
} else e.Append(i);
|
||||
return e;
|
||||
},
|
||||
actionID: 1,
|
||||
getActionID: function() {
|
||||
return "MJX-Collapse-" + this.actionID++;
|
||||
},
|
||||
Collapse: function(t) {
|
||||
t.getComplexity();
|
||||
var i, e, a, s = (t.attr || {})["data-semantic-type"];
|
||||
return s && (this["Collapse_" + s] ? t = this["Collapse_" + s](t) : this.COLLAPSE[s] && this.MARKER[s] && (i = t.attr["data-semantic-role"],
|
||||
"number" != typeof (e = this.COLLAPSE[s]) && (e = e[i] || e.value), t.complexity > e && ("string" != typeof (a = this.MARKER[s]) && (a = a[i] || a.value),
|
||||
t = this.MakeAction(this.Marker(a), t)))), t;
|
||||
},
|
||||
UncollapseChild: function(t, i, e) {
|
||||
if (null == e && (e = 1), this.SplitAttribute(t, "children").length === e) {
|
||||
var a = 1 === t.data.length && t.data[0].inferred ? t.data[0] : t;
|
||||
if (a && a.data[i] && a.data[i].collapsible) return a.SetData(i, a.data[i].data[1]),
|
||||
t.complexity = a.complexity = null, t.getComplexity(), 1;
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
FindChildText: function(t, i) {
|
||||
var e = this.FindChild(t, i);
|
||||
return e ? (e.CoreMO() || e).data.join("") : "?";
|
||||
},
|
||||
FindChild: function(t, i) {
|
||||
if (t) {
|
||||
if (t.attr && t.attr["data-semantic-id"] === i) return t;
|
||||
if (!t.isToken) for (var e = 0, a = t.data.length; e < a; e++) {
|
||||
var s = this.FindChild(t.data[e], i);
|
||||
if (s) return s;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
SplitAttribute: function(t, i) {
|
||||
return (t.attr["data-semantic-" + i] || "").split(/,/);
|
||||
},
|
||||
Collapse_fenced: function(t) {
|
||||
var i;
|
||||
return this.UncollapseChild(t, 1), t.complexity > this.COLLAPSE.fenced && "leftright" === t.attr["data-semantic-role"] && (i = t.data[0].data.join("") + t.data[t.data.length - 1].data.join(""),
|
||||
t = this.MakeAction(this.Marker(i), t)), t;
|
||||
},
|
||||
Collapse_appl: function(t) {
|
||||
var i;
|
||||
return this.UncollapseChild(t, 2, 2) && (i = (i = this.MARKER.appl)[t.attr["data-semantic-role"]] || i.value,
|
||||
t = this.MakeAction(this.Marker(i), t)), t;
|
||||
},
|
||||
Collapse_sqrt: function(t) {
|
||||
return this.UncollapseChild(t, 0), t.complexity > this.COLLAPSE.sqrt && (t = this.MakeAction(this.Marker(this.MARKER.sqrt), t)),
|
||||
t;
|
||||
},
|
||||
Collapse_root: function(t) {
|
||||
return this.UncollapseChild(t, 0), t.complexity > this.COLLAPSE.sqrt && (t = this.MakeAction(this.Marker(this.MARKER.sqrt), t)),
|
||||
t;
|
||||
},
|
||||
Collapse_enclose: function(t) {
|
||||
var i, e;
|
||||
return 1 !== this.SplitAttribute(t, "children").length || (i = 1 === t.data.length && t.data[0].inferred ? t.data[0] : t).data[0] && i.data[0].collapsible && (e = i.data[0],
|
||||
i.SetData(0, e.data[1]), e.SetData(1, t), t = e), t;
|
||||
},
|
||||
Collapse_bigop: function(t) {
|
||||
var i, e;
|
||||
return (t.complexity > this.COLLAPSE.bigop || "mo" !== t.data[0].type) && (i = this.SplitAttribute(t, "content").pop(),
|
||||
e = h.FindChildText(t, i), t = this.MakeAction(this.Marker(e), t)), t;
|
||||
},
|
||||
Collapse_integral: function(t) {
|
||||
var i, e;
|
||||
return (t.complexity > this.COLLAPSE.integral || "mo" !== t.data[0].type) && (i = this.SplitAttribute(t, "content")[0],
|
||||
e = h.FindChildText(t, i), t = this.MakeAction(this.Marker(e), t)), t;
|
||||
},
|
||||
Collapse_relseq: function(t) {
|
||||
var i, e;
|
||||
return t.complexity > this.COLLAPSE.relseq && (i = this.SplitAttribute(t, "content"),
|
||||
e = h.FindChildText(t, i[0]), 1 < i.length && (e += "\u22ef"), t = this.MakeAction(this.Marker(e), t)),
|
||||
t;
|
||||
},
|
||||
Collapse_multirel: function(t) {
|
||||
var i, e;
|
||||
return t.complexity > this.COLLAPSE.multirel && (i = this.SplitAttribute(t, "content"),
|
||||
e = h.FindChildText(t, i[0]) + "\u22ef", t = this.MakeAction(this.Marker(e), t)),
|
||||
t;
|
||||
},
|
||||
Collapse_superscript: function(t) {
|
||||
return this.UncollapseChild(t, 0, 2), t.complexity > this.COLLAPSE.superscript && (t = this.MakeAction(this.Marker(this.MARKER.superscript), t)),
|
||||
t;
|
||||
},
|
||||
Collapse_subscript: function(t) {
|
||||
return this.UncollapseChild(t, 0, 2), t.complexity > this.COLLAPSE.subscript && (t = this.MakeAction(this.Marker(this.MARKER.subscript), t)),
|
||||
t;
|
||||
},
|
||||
Collapse_subsup: function(t) {
|
||||
return this.UncollapseChild(t, 0, 3), t.complexity > this.COLLAPSE.subsup && (t = this.MakeAction(this.Marker(this.MARKER.subsup), t)),
|
||||
t;
|
||||
}
|
||||
};
|
||||
s.Register.StartupHook("End Extensions", function() {
|
||||
null == l.collapsible ? l.collapsible = !h.config.disabled : h.config.disabled = !l.collapsible,
|
||||
s.Register.StartupHook("MathMenu Ready", function() {
|
||||
o = MathJax.Menu.cookie;
|
||||
var t, i = MathJax.Menu.ITEM, e = MathJax.Menu.menu, a = i.CHECKBOX([ "CollapsibleMath", "Collapsible Math" ], "collapsible", {
|
||||
action: function(t) {
|
||||
h[l.collapsible ? "Enable" : "Disable"](!0, !0), MathJax.Menu.saveCookie();
|
||||
}
|
||||
}), s = (e.FindId("Accessibility") || {}).submenu;
|
||||
s ? null !== (t = s.IndexOfId("CollapsibleMath")) ? s.items[t] = a : s.items.push(i.RULE(), a) : (t = e.IndexOfId("About"),
|
||||
e.items.splice(t, 0, a, i.RULE()));
|
||||
}, 15);
|
||||
}, 15);
|
||||
}(MathJax.Hub), MathJax.Ajax.Require("[a11y]/semantic-enrich.js"), MathJax.Hub.Register.StartupHook("Semantic Enrich Ready", function() {
|
||||
var t = MathJax.ElementJax.mml, i = MathJax.Extension.collapsible, a = i.COMPLEXITY, s = i.COMPLEXATTR;
|
||||
i.Startup(), t.mbase.Augment({
|
||||
Collapse: function() {
|
||||
return i.Collapse(this);
|
||||
},
|
||||
getComplexity: function() {
|
||||
if (null == this.complexity) {
|
||||
var t = 0;
|
||||
if (this.isToken) t = a.TEXT * this.data.join("").length + a.TOKEN; else {
|
||||
for (var i = 0, e = this.data.length; i < e; i++) this.data[i] && (this.SetData(i, this.data[i].Collapse()),
|
||||
t += this.data[i].complexity);
|
||||
1 < e && (t += e * a.CHILD);
|
||||
}
|
||||
!this.attrNames || "complexity" in this || this.attrNames.push(s), this.attr && (this.attr[s] = t),
|
||||
this.complexity = t;
|
||||
}
|
||||
return this.complexity;
|
||||
},
|
||||
reportComplexity: function() {
|
||||
!this.attr || !this.attrNames || s in this.attr || (this.attrNames.push(s), this.attr[s] = this.complexity);
|
||||
}
|
||||
}), t.mfrac.Augment({
|
||||
getComplexity: function() {
|
||||
return null == this.complexity && (this.SUPER(arguments).getComplexity.call(this),
|
||||
this.complexity *= a.SCRIPT, this.complexity += a.FRACTION, this.attr[s] = this.complexity),
|
||||
this.complexity;
|
||||
}
|
||||
}), t.msqrt.Augment({
|
||||
getComplexity: function() {
|
||||
return null == this.complexity && (this.SUPER(arguments).getComplexity.call(this),
|
||||
this.complexity += a.SQRT, this.attr[s] = this.complexity), this.complexity;
|
||||
}
|
||||
}), t.mroot.Augment({
|
||||
getComplexity: function() {
|
||||
return null == this.complexity && (this.SUPER(arguments).getComplexity.call(this),
|
||||
this.complexity -= (1 - a.SCRIPT) * this.data[1].getComplexity(), this.complexity += a.SQRT,
|
||||
this.attr[s] = this.complexity), this.complexity;
|
||||
}
|
||||
}), t.msubsup.Augment({
|
||||
getComplexity: function() {
|
||||
var t;
|
||||
return null == this.complexity && (t = 0, this.data[this.sub] && (t = this.data[this.sub].getComplexity() + a.CHILD),
|
||||
this.data[this.sup] && (t = Math.max(this.data[this.sup].getComplexity(), t)), t *= a.SCRIPT,
|
||||
this.data[this.sub] && (t += a.CHILD), this.data[this.sup] && (t += a.CHILD), this.data[this.base] && (t += this.data[this.base].getComplexity() + a.CHILD),
|
||||
this.complexity = t + a.SUBSUP, this.reportComplexity()), this.complexity;
|
||||
}
|
||||
}), t.munderover.Augment({
|
||||
getComplexity: function() {
|
||||
var t;
|
||||
return null == this.complexity && (t = 0, this.data[this.sub] && (t = this.data[this.sub].getComplexity() + a.CHILD),
|
||||
this.data[this.sup] && (t = Math.max(this.data[this.sup].getComplexity(), t)), t *= a.SCRIPT,
|
||||
this.data[this.base] && (t = Math.max(this.data[this.base].getComplexity(), t)),
|
||||
this.data[this.sub] && (t += a.CHILD), this.data[this.sup] && (t += a.CHILD), this.data[this.base] && (t += a.CHILD),
|
||||
this.complexity = t + a.UNDEROVER, this.reportComplexity()), this.complexity;
|
||||
}
|
||||
}), t.mphantom.Augment({
|
||||
getComplexity: function() {
|
||||
return this.complexity = a.PHANTOM, this.reportComplexity(), this.complexity;
|
||||
}
|
||||
}), t.ms.Augment({
|
||||
getComplexity: function() {
|
||||
return this.SUPER(arguments).getComplexity.call(this), this.complexity += this.Get("lquote").length * a.TEXT,
|
||||
this.complexity += this.Get("rquote").length * a.TEXT, this.attr[s] = this.complexity,
|
||||
this.complexity;
|
||||
}
|
||||
}), t.menclose.Augment({
|
||||
getComplexity: function() {
|
||||
return null == this.complexity && (this.SUPER(arguments).getComplexity.call(this),
|
||||
this.complexity += a.ACTION, this.attr[s] = this.complexity), this.complexity;
|
||||
}
|
||||
}), t.maction.Augment({
|
||||
getComplexity: function() {
|
||||
return this.complexity = (this.collapsible ? this.data[0] : this.selected()).getComplexity(),
|
||||
this.reportComplexity(), this.complexity;
|
||||
}
|
||||
}), t.semantics.Augment({
|
||||
getComplexity: function() {
|
||||
return null == this.complexity && (this.complexity = this.data[0] ? this.data[0].getComplexity() : 0,
|
||||
this.reportComplexity()), this.complexity;
|
||||
}
|
||||
}), t["annotation-xml"].Augment({
|
||||
getComplexity: function() {
|
||||
return this.complexity = a.XML, this.reportComplexity(), this.complexity;
|
||||
}
|
||||
}), t.annotation.Augment({
|
||||
getComplexity: function() {
|
||||
return this.complexity = a.XML, this.reportComplexity(), this.complexity;
|
||||
}
|
||||
}), t.mglyph.Augment({
|
||||
getComplexity: function() {
|
||||
return this.complexity = a.GLYPH, this.reportComplexity(), this.complexity;
|
||||
}
|
||||
}), MathJax.Hub.Startup.signal.Post("Collapsible Ready"), MathJax.Ajax.loadComplete("[a11y]/collapsible.js");
|
||||
});
|
417
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/explorer.js
vendored
Normal file
417
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/explorer.js
vendored
Normal file
|
@ -0,0 +1,417 @@
|
|||
MathJax.Hub.Register.StartupHook("Sre Ready", function() {
|
||||
var o, r, s = MathJax.Hub.config.menuSettings, l = {};
|
||||
MathJax.Hub.Register.StartupHook("MathEvents Ready", function() {
|
||||
o = MathJax.Extension.MathEvents.Event.False, r = MathJax.Extension.MathEvents.Event.KEY;
|
||||
});
|
||||
var h = MathJax.Extension.explorer = {
|
||||
version: "1.6.0",
|
||||
dependents: [],
|
||||
defaults: {
|
||||
walker: "table",
|
||||
highlight: "none",
|
||||
background: "blue",
|
||||
foreground: "black",
|
||||
speech: !0,
|
||||
generation: "lazy",
|
||||
subtitle: !1,
|
||||
ruleset: "mathspeak-default"
|
||||
},
|
||||
eagerComplexity: 80,
|
||||
prefix: "Assistive-",
|
||||
hook: null,
|
||||
locHook: null,
|
||||
oldrules: null,
|
||||
addMenuOption: function(e, t) {
|
||||
s[h.prefix + e] = t;
|
||||
},
|
||||
addDefaults: function() {
|
||||
for (var e, t = MathJax.Hub.CombineConfig("explorer", h.defaults), a = Object.keys(t), i = 0; e = a[i]; i++) void 0 === s[h.prefix + e] && h.addMenuOption(e, t[e]);
|
||||
h.setSpeechOption(), u.Reset();
|
||||
},
|
||||
setOption: function(e, t) {
|
||||
s[h.prefix + e] !== t && (h.addMenuOption(e, t), u.Reset());
|
||||
},
|
||||
getOption: function(e) {
|
||||
return s[h.prefix + e];
|
||||
},
|
||||
speechOption: function(e) {
|
||||
h.oldrules !== e.value && (h.setSpeechOption(), u.Regenerate());
|
||||
},
|
||||
setSpeechOption: function() {
|
||||
var e = s[h.prefix + "ruleset"], t = e.split("-");
|
||||
sre.System.getInstance().setupEngine({
|
||||
locale: MathJax.Localization.locale,
|
||||
domain: h.Domain(t[0]),
|
||||
style: t[1]
|
||||
}), h.oldrules = e;
|
||||
},
|
||||
Domain: function(e) {
|
||||
switch (e) {
|
||||
case "chromevox":
|
||||
return "default";
|
||||
|
||||
case "clearspeak":
|
||||
return "clearspeak";
|
||||
|
||||
case "mathspeak":
|
||||
default:
|
||||
return "mathspeak";
|
||||
}
|
||||
},
|
||||
Enable: function(e, t) {
|
||||
s.explorer = !0, t && (l.explorer = !0), MathJax.Extension.collapsible.Enable(!1, t),
|
||||
MathJax.Extension.AssistiveMML && (MathJax.Extension.AssistiveMML.config.disabled = !0,
|
||||
s.assistiveMML = !1, t && (l.assistiveMML = !1)), this.DisableMenus(!1), this.hook || (this.hook = MathJax.Hub.Register.MessageHook("New Math", [ "Register", this.Explorer ])),
|
||||
this.locHook || (this.locHook = MathJax.Hub.Register.MessageHook("Locale Reset", [ "RemoveSpeech", this.Explorer ])),
|
||||
e && MathJax.Hub.Queue([ "Reprocess", MathJax.Hub ]);
|
||||
},
|
||||
Disable: function(e, t) {
|
||||
s.explorer = !1, t && (l.explorer = !1), this.DisableMenus(!0), this.hook && (MathJax.Hub.UnRegister.MessageHook(this.hook),
|
||||
this.hook = null);
|
||||
for (var a = this.dependents.length - 1; 0 <= a; a--) {
|
||||
var i = this.dependents[a];
|
||||
i.Disable && i.Disable(!1, t);
|
||||
}
|
||||
},
|
||||
DisableMenus: function(e) {
|
||||
if (MathJax.Menu) {
|
||||
var t = MathJax.Menu.menu.FindId("Accessibility", "Explorer");
|
||||
if (t) {
|
||||
for (var a, i = (t = t.submenu).items, n = 2; a = i[n]; n++) a.disabled = e;
|
||||
e || !t.FindId("SpeechOutput") || s[h.prefix + "speech"] || (t.FindId("Subtitles").disabled = !0);
|
||||
}
|
||||
}
|
||||
},
|
||||
Dependent: function(e) {
|
||||
this.dependents.push(e);
|
||||
}
|
||||
}, n = MathJax.Object.Subclass({
|
||||
div: null,
|
||||
inner: null,
|
||||
Init: function() {
|
||||
this.div = n.Create("assertive"), this.inner = MathJax.HTML.addElement(this.div, "div");
|
||||
},
|
||||
Add: function() {
|
||||
n.added || (document.body.appendChild(this.div), n.added = !0);
|
||||
},
|
||||
Show: function(e, t) {
|
||||
this.div.classList.add("MJX_LiveRegion_Show");
|
||||
var a = e.getBoundingClientRect(), i = a.bottom + 10 + window.pageYOffset, n = a.left + window.pageXOffset;
|
||||
this.div.style.top = i + "px", this.div.style.left = n + "px";
|
||||
var o = t.colorString();
|
||||
this.inner.style.backgroundColor = o.background, this.inner.style.color = o.foreground;
|
||||
},
|
||||
Hide: function(e) {
|
||||
this.div.classList.remove("MJX_LiveRegion_Show");
|
||||
},
|
||||
Clear: function() {
|
||||
this.Update(""), this.inner.style.top = "", this.inner.style.backgroundColor = "";
|
||||
},
|
||||
Update: function(e) {
|
||||
h.getOption("speech") && n.Update(this.inner, e);
|
||||
}
|
||||
}, {
|
||||
ANNOUNCE: "Navigatable Math in page. Explore with enter or shift space and arrow keys. Expand or collapse elements hitting enter.",
|
||||
announced: !1,
|
||||
added: !1,
|
||||
styles: {
|
||||
".MJX_LiveRegion": {
|
||||
position: "absolute",
|
||||
top: "0",
|
||||
height: "1px",
|
||||
width: "1px",
|
||||
padding: "1px",
|
||||
overflow: "hidden"
|
||||
},
|
||||
".MJX_LiveRegion_Show": {
|
||||
top: "0",
|
||||
position: "absolute",
|
||||
width: "auto",
|
||||
height: "auto",
|
||||
padding: "0px 0px",
|
||||
opacity: 1,
|
||||
"z-index": "202",
|
||||
left: 0,
|
||||
right: 0,
|
||||
margin: "0 auto",
|
||||
"background-color": "white",
|
||||
"box-shadow": "0px 10px 20px #888",
|
||||
border: "2px solid #CCCCCC"
|
||||
}
|
||||
},
|
||||
Create: function(e) {
|
||||
var t = MathJax.HTML.Element("div", {
|
||||
className: "MJX_LiveRegion"
|
||||
});
|
||||
return t.setAttribute("aria-live", e), t;
|
||||
},
|
||||
Update: MathJax.Hub.Browser.isPC ? function(e, t) {
|
||||
e.textContent = "", setTimeout(function() {
|
||||
e.textContent = t;
|
||||
}, 100);
|
||||
} : function(e, t) {
|
||||
e.textContent = "", e.textContent = t;
|
||||
},
|
||||
Announce: function() {
|
||||
var e;
|
||||
h.getOption("speech") && (n.announced = !0, MathJax.Ajax.Styles(n.styles), e = n.Create("polite"),
|
||||
document.body.appendChild(e), n.Update(e, n.ANNOUNCE), setTimeout(function() {
|
||||
document.body.removeChild(e);
|
||||
}, 1e3));
|
||||
}
|
||||
});
|
||||
MathJax.Extension.explorer.LiveRegion = n;
|
||||
var e = MathJax.Ajax.fileURL(MathJax.Ajax.config.path.a11y), u = MathJax.Extension.explorer.Explorer = {
|
||||
liveRegion: n(),
|
||||
walker: null,
|
||||
highlighter: null,
|
||||
hoverer: null,
|
||||
flamer: null,
|
||||
speechDiv: null,
|
||||
earconFile: e + "/invalid_keypress" + (-1 !== [ "Firefox", "Chrome", "Opera" ].indexOf(MathJax.Hub.Browser.name) ? ".ogg" : ".mp3"),
|
||||
expanded: !1,
|
||||
focusoutEvent: MathJax.Hub.Browser.isFirefox ? "blur" : "focusout",
|
||||
focusinEvent: "focus",
|
||||
ignoreFocusOut: !1,
|
||||
jaxCache: {},
|
||||
messageID: null,
|
||||
Reset: function() {
|
||||
u.FlameEnriched();
|
||||
},
|
||||
Register: function(e) {
|
||||
var t, a;
|
||||
!h.hook || (t = document.getElementById(e[1])) && t.id && ((a = MathJax.Hub.getJaxFor(t.id)) && a.enriched && (u.StateChange(t.id, a),
|
||||
u.liveRegion.Add(), u.AddEvent(t)));
|
||||
},
|
||||
StateChange: function(e, t) {
|
||||
u.GetHighlighter(.2);
|
||||
var a = u.jaxCache[e];
|
||||
a && a === t.root || (a && sre.Walker.resetState(e + "-Frame"), u.jaxCache[e] = t.root);
|
||||
},
|
||||
AddAria: function(e) {
|
||||
e.setAttribute("role", "application"), e.setAttribute("aria-label", "Math");
|
||||
},
|
||||
AddHook: function(i) {
|
||||
u.RemoveHook(), u.hook = MathJax.Hub.Register.MessageHook("End Math", function(e) {
|
||||
var t = e[1].id + "-Frame", a = document.getElementById(t);
|
||||
i && t === u.expanded && (u.ActivateWalker(a, i), a.focus(), u.expanded = !1);
|
||||
});
|
||||
},
|
||||
RemoveHook: function() {
|
||||
u.hook && (MathJax.Hub.UnRegister.MessageHook(u.hook), u.hook = null);
|
||||
},
|
||||
AddMessage: function() {
|
||||
return MathJax.Message.Set("Generating Speech Output");
|
||||
},
|
||||
RemoveMessage: function(e) {
|
||||
e && MathJax.Message.Clear(e);
|
||||
},
|
||||
AddEvent: function(e) {
|
||||
var t, a = e.id + "-Frame", i = e.previousSibling;
|
||||
i && (t = i.id !== a ? i.firstElementChild : i, u.AddAria(t), u.AddMouseEvents(t),
|
||||
"MathJax_MathML" === t.className && (t = t.firstElementChild), t && (t.onkeydown = u.Keydown,
|
||||
u.Flame(t), t.addEventListener(u.focusinEvent, function(e) {
|
||||
h.hook && (n.announced || n.Announce());
|
||||
}), t.addEventListener(u.focusoutEvent, function(e) {
|
||||
h.hook && (u.ignoreFocusOut && (u.ignoreFocusOut = !1, "enter" === u.walker.moved) ? e.target.focus() : u.walker && u.DeactivateWalker());
|
||||
}), h.getOption("speech") && u.AddSpeech(t)));
|
||||
},
|
||||
AddSpeech: function(e) {
|
||||
var t = e.id, a = MathJax.Hub.getJaxFor(t).root.toMathML();
|
||||
if (e.getAttribute("haslabel") || u.AddMathLabel(a, t), !e.getAttribute("hasspeech")) switch (MathJax.Hub.config.explorer.generation) {
|
||||
case "eager":
|
||||
u.AddSpeechEager(a, t);
|
||||
break;
|
||||
|
||||
case "mixed":
|
||||
e.querySelectorAll("[data-semantic-complexity]").length >= h.eagerComplexity && u.AddSpeechEager(a, t);
|
||||
}
|
||||
},
|
||||
AddSpeechLazy: function(e) {
|
||||
var t = new sre.TreeSpeechGenerator();
|
||||
t.setRebuilt(u.walker.getRebuilt()), t.getSpeech(u.walker.rootNode, u.walker.getXml()),
|
||||
e.setAttribute("hasspeech", "true");
|
||||
},
|
||||
AddSpeechEager: function(e, t) {
|
||||
u.MakeSpeechTask(e, t, sre.TreeSpeechGenerator, function(e, t) {
|
||||
e.setAttribute("hasspeech", "true");
|
||||
}, 5);
|
||||
},
|
||||
AddMathLabel: function(e, t) {
|
||||
u.MakeSpeechTask(e, t, sre.SummarySpeechGenerator, function(e, t) {
|
||||
e.setAttribute("haslabel", "true"), e.setAttribute("aria-label", t);
|
||||
}, 5);
|
||||
},
|
||||
MakeSpeechTask: function(i, n, o, r, e) {
|
||||
var s = u.AddMessage();
|
||||
setTimeout(function() {
|
||||
var e = new o(), t = document.getElementById(n), a = new sre.DummyWalker(t, e, u.highlighter, i).speech();
|
||||
a && r(t, a), u.RemoveMessage(s);
|
||||
}, e);
|
||||
},
|
||||
Keydown: function(e) {
|
||||
var t = e.keyCode;
|
||||
if (t === r.ESCAPE) {
|
||||
if (!u.walker) return;
|
||||
return u.RemoveHook(), u.DeactivateWalker(), void o(e);
|
||||
}
|
||||
if (u.walker && u.walker.isActive()) {
|
||||
t = t === r.RETURN ? r.DASH : t, void 0 !== u.walker.modifier && (u.walker.modifier = e.shiftKey);
|
||||
var a = u.walker.move(t);
|
||||
if (null === a) return;
|
||||
if (a) {
|
||||
if ("expand" === u.walker.moved) {
|
||||
if (u.expanded = u.walker.node.id, MathJax.Hub.Browser.isEdge) return u.ignoreFocusOut = !0,
|
||||
void u.DeactivateWalker();
|
||||
if (MathJax.Hub.Browser.isFirefox || MathJax.Hub.Browser.isMSIE) return void u.DeactivateWalker();
|
||||
}
|
||||
u.liveRegion.Update(u.walker.speech()), u.Highlight();
|
||||
} else u.PlayEarcon();
|
||||
o(e);
|
||||
} else {
|
||||
var i = e.target;
|
||||
if (t === r.SPACE && !e.shiftKey) return MathJax.Extension.MathEvents.Event.ContextMenu(e, i),
|
||||
void o(e);
|
||||
if (h.hook && (t === r.RETURN || t === r.SPACE && e.shiftKey)) {
|
||||
var n = MathJax.Hub.getJaxFor(i);
|
||||
return u.ActivateWalker(i, n), u.AddHook(n), void o(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
GetHighlighter: function(e) {
|
||||
u.highlighter = sre.HighlighterFactory.highlighter({
|
||||
color: h.getOption("background"),
|
||||
alpha: e
|
||||
}, {
|
||||
color: h.getOption("foreground"),
|
||||
alpha: 1
|
||||
}, {
|
||||
renderer: MathJax.Hub.outputJax["jax/mml"][0].id,
|
||||
browser: MathJax.Hub.Browser.name
|
||||
});
|
||||
},
|
||||
AddMouseEvents: function(e) {
|
||||
sre.HighlighterFactory.addEvents(e, {
|
||||
mouseover: u.MouseOver,
|
||||
mouseout: u.MouseOut
|
||||
}, {
|
||||
renderer: MathJax.Hub.outputJax["jax/mml"][0].id,
|
||||
browser: MathJax.Hub.Browser.name
|
||||
});
|
||||
},
|
||||
MouseOver: function(e) {
|
||||
var t;
|
||||
"none" !== h.getOption("highlight") && ("hover" === h.getOption("highlight") && (t = e.currentTarget,
|
||||
u.GetHighlighter(.1), u.highlighter.highlight([ t ]), u.hoverer = !0), o(e));
|
||||
},
|
||||
MouseOut: function(e) {
|
||||
return u.hoverer && (u.highlighter.unhighlight(), u.hoverer = !1), o(e);
|
||||
},
|
||||
Flame: function(e) {
|
||||
if ("flame" === h.getOption("highlight")) return u.GetHighlighter(.05), u.highlighter.highlightAll(e),
|
||||
void (u.flamer = !0);
|
||||
},
|
||||
UnFlame: function() {
|
||||
u.flamer && (u.highlighter.unhighlightAll(), u.flamer = null);
|
||||
},
|
||||
FlameEnriched: function() {
|
||||
u.UnFlame();
|
||||
for (var e, t = 0, a = MathJax.Hub.getAllJax(); e = a[t]; t++) u.Flame(e.SourceElement().previousSibling);
|
||||
},
|
||||
Walkers: {
|
||||
syntactic: sre.SyntaxWalker,
|
||||
table: sre.TableWalker,
|
||||
semantic: sre.SemanticWalker,
|
||||
none: sre.DummyWalker
|
||||
},
|
||||
ActivateWalker: function(e, t) {
|
||||
var a = h.getOption("speech"), i = h.getOption("walker") ? u.Walkers[MathJax.Hub.config.explorer.walker] : u.Walkers.none, n = a ? new sre.DirectSpeechGenerator() : new sre.DummySpeechGenerator(), o = sre.System.getInstance().engineSetup();
|
||||
n.setOptions({
|
||||
locale: o.locale,
|
||||
domain: o.domain,
|
||||
style: o.style,
|
||||
modality: "speech"
|
||||
}), u.GetHighlighter(.2), u.walker = new i(e, n, u.highlighter, t.root.toMathML()),
|
||||
a && !e.getAttribute("hasspeech") && u.AddSpeechLazy(e), u.walker.activate(), a && (h.getOption("subtitle") && u.liveRegion.Show(e, u.highlighter),
|
||||
u.liveRegion.Update(u.walker.speech())), u.Highlight(), u.ignoreFocusOut && setTimeout(function() {
|
||||
u.ignoreFocusOut = !1;
|
||||
}, 500);
|
||||
},
|
||||
DeactivateWalker: function() {
|
||||
var e = sre.System.getInstance().engineSetup(), t = "clearspeak" === e.domain ? "default" : e.style;
|
||||
h.setOption("ruleset", e.domain + "-" + t), u.liveRegion.Clear(), u.liveRegion.Hide(),
|
||||
u.Unhighlight(), u.currentHighlight = null, u.walker.deactivate(), u.walker = null;
|
||||
},
|
||||
Highlight: function() {
|
||||
u.Unhighlight(), u.highlighter.highlight(u.walker.getFocus().getNodes());
|
||||
},
|
||||
Unhighlight: function() {
|
||||
u.highlighter.unhighlight();
|
||||
},
|
||||
PlayEarcon: function() {
|
||||
new Audio(u.earconFile).play();
|
||||
},
|
||||
SpeechOutput: function() {
|
||||
u.Reset();
|
||||
[ "Subtitles" ].forEach(function(e) {
|
||||
var t = MathJax.Menu.menu.FindId("Accessibility", "Explorer", e);
|
||||
t && (t.disabled = !t.disabled);
|
||||
}), u.Regenerate();
|
||||
},
|
||||
RemoveSpeech: function() {
|
||||
h.setSpeechOption();
|
||||
for (var e, t = 0, a = MathJax.Hub.getAllJax(); e = a[t]; t++) {
|
||||
var i = document.getElementById(e.inputID + "-Frame");
|
||||
i && (i.removeAttribute("hasspeech"), i.removeAttribute("haslabel"));
|
||||
}
|
||||
},
|
||||
Regenerate: function() {
|
||||
for (var e, t = 0, a = MathJax.Hub.getAllJax(); e = a[t]; t++) {
|
||||
var i = document.getElementById(e.inputID + "-Frame");
|
||||
i && (i.removeAttribute("hasspeech"), u.AddSpeech(i));
|
||||
}
|
||||
},
|
||||
Startup: function() {
|
||||
var e = MathJax.Extension.collapsible;
|
||||
e && e.Dependent(h), h.addDefaults();
|
||||
}
|
||||
};
|
||||
MathJax.Hub.Register.StartupHook("End Extensions", function() {
|
||||
h[!1 === s.explorer ? "Disable" : "Enable"](), MathJax.Hub.Startup.signal.Post("Explorer Ready"),
|
||||
MathJax.Hub.Register.StartupHook("MathMenu Ready", function() {
|
||||
l = MathJax.Menu.cookie;
|
||||
var e, t = MathJax.Menu.ITEM, a = MathJax.Menu.menu, i = {
|
||||
action: u.Reset
|
||||
}, n = {
|
||||
action: h.speechOption
|
||||
}, o = t.SUBMENU([ "Explorer", "Explorer" ], t.CHECKBOX([ "Active", "Active" ], "explorer", {
|
||||
action: function(e) {
|
||||
h[s.explorer ? "Enable" : "Disable"](!0, !0), MathJax.Menu.saveCookie();
|
||||
}
|
||||
}), t.RULE(), t.CHECKBOX([ "Walker", "Walker" ], "Assistive-walker"), t.SUBMENU([ "Highlight", "Highlight" ], t.RADIO([ "none", "None" ], "Assistive-highlight", i), t.RADIO([ "hover", "Hover" ], "Assistive-highlight", i), t.RADIO([ "flame", "Flame" ], "Assistive-highlight", i)), t.SUBMENU([ "Background", "Background" ], t.RADIO([ "blue", "Blue" ], "Assistive-background", i), t.RADIO([ "red", "Red" ], "Assistive-background", i), t.RADIO([ "green", "Green" ], "Assistive-background", i), t.RADIO([ "yellow", "Yellow" ], "Assistive-background", i), t.RADIO([ "cyan", "Cyan" ], "Assistive-background", i), t.RADIO([ "magenta", "Magenta" ], "Assistive-background", i), t.RADIO([ "white", "White" ], "Assistive-background", i), t.RADIO([ "black", "Black" ], "Assistive-background", i)), t.SUBMENU([ "Foreground", "Foreground" ], t.RADIO([ "black", "Black" ], "Assistive-foreground", i), t.RADIO([ "white", "White" ], "Assistive-foreground", i), t.RADIO([ "magenta", "Magenta" ], "Assistive-foreground", i), t.RADIO([ "cyan", "Cyan" ], "Assistive-foreground", i), t.RADIO([ "yellow", "Yellow" ], "Assistive-foreground", i), t.RADIO([ "green", "Green" ], "Assistive-foreground", i), t.RADIO([ "red", "Red" ], "Assistive-foreground", i), t.RADIO([ "blue", "Blue" ], "Assistive-foreground", i)), t.RULE(), t.CHECKBOX([ "SpeechOutput", "Speech Output" ], "Assistive-speech", {
|
||||
action: u.SpeechOutput
|
||||
}), t.CHECKBOX([ "Subtitles", "Subtitles" ], "Assistive-subtitle", {
|
||||
disabled: !s["Assistive-speech"]
|
||||
}), t.RULE(), t.SUBMENU([ "Mathspeak", "Mathspeak Rules" ], t.RADIO([ "mathspeak-default", "Verbose" ], "Assistive-ruleset", n), t.RADIO([ "mathspeak-brief", "Brief" ], "Assistive-ruleset", n), t.RADIO([ "mathspeak-sbrief", "Superbrief" ], "Assistive-ruleset", n)), t.RADIO([ "clearspeak-default", "Clearspeak Rules" ], "Assistive-ruleset", n), t.SUBMENU([ "Chromevox", "ChromeVox Rules" ], t.RADIO([ "chromevox-default", "Verbose" ], "Assistive-ruleset", n), t.RADIO([ "chromevox-alternative", "Alternative" ], "Assistive-ruleset", n))), r = (a.FindId("Accessibility") || {}).submenu;
|
||||
r ? null !== (e = r.IndexOfId("Explorer")) ? r.items[e] = o : (e = r.IndexOfId("CollapsibleMath"),
|
||||
r.items.splice(e + 1, 0, o)) : (e = a.IndexOfId("CollapsibleMath"), a.items.splice(e + 1, 0, o)),
|
||||
s.explorer || h.DisableMenus(!0);
|
||||
}, 20);
|
||||
}, 20);
|
||||
}), MathJax.Hub.Register.StartupHook("SVG Jax Ready", function() {
|
||||
MathJax.Hub.Config({
|
||||
SVG: {
|
||||
addMMLclasses: !0
|
||||
}
|
||||
});
|
||||
var t, e = MathJax.OutputJax.SVG;
|
||||
parseFloat(e.version) < 2.7 && (t = e.getJaxFromMath, e.Augment({
|
||||
getJaxFromMath: function(e) {
|
||||
return e.parentNode.className.match(/MathJax_SVG_Display/) && (e = e.parentNode),
|
||||
t.call(this, e);
|
||||
}
|
||||
}));
|
||||
}), MathJax.Ajax.config.path.a11y || (MathJax.Ajax.config.path.a11y = MathJax.Hub.config.root + "/extensions/a11y"),
|
||||
MathJax.Ajax.Require("[a11y]/collapsible.js"), MathJax.Hub.Register.StartupHook("Collapsible Ready", function() {
|
||||
MathJax.Extension.explorer.Explorer.Startup(), MathJax.Ajax.loadComplete("[a11y]/explorer.js");
|
||||
});
|
BIN
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/invalid_keypress.mp3
vendored
Normal file
BIN
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/invalid_keypress.mp3
vendored
Normal file
Binary file not shown.
BIN
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/invalid_keypress.ogg
vendored
Normal file
BIN
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/invalid_keypress.ogg
vendored
Normal file
Binary file not shown.
1631
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathjax-sre.js
vendored
Normal file
1631
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathjax-sre.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/de.js
vendored
Normal file
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/de.js
vendored
Normal file
File diff suppressed because one or more lines are too long
110
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/en.js
vendored
Normal file
110
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/en.js
vendored
Normal file
File diff suppressed because one or more lines are too long
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/es.js
vendored
Normal file
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/es.js
vendored
Normal file
File diff suppressed because one or more lines are too long
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/fr.js
vendored
Normal file
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/fr.js
vendored
Normal file
File diff suppressed because one or more lines are too long
518
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/mathmaps_ie.js
vendored
Normal file
518
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/mathmaps_ie.js
vendored
Normal file
File diff suppressed because one or more lines are too long
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/nemeth.js
vendored
Normal file
104
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/mathmaps/nemeth.js
vendored
Normal file
File diff suppressed because one or more lines are too long
77
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/semantic-enrich.js
vendored
Normal file
77
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/semantic-enrich.js
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
MathJax.Extension["semantic-enrich"] = {
|
||||
version: "1.6.0",
|
||||
config: MathJax.Hub.CombineConfig("semantic-enrich", {
|
||||
disabled: !1
|
||||
}),
|
||||
dependents: [],
|
||||
running: !1,
|
||||
mstyleLookup: {
|
||||
mi: [ "mathvariant" ],
|
||||
mo: [ "mathvariant", "accent", "largeop", "form", "fence", "separator", "movablelimits" ],
|
||||
mn: [ "mathvariant" ],
|
||||
mtext: [ "mathvariant" ],
|
||||
ms: [ "mathvariant" ],
|
||||
mfrac: [ "linethickness" ],
|
||||
mfenced: [ "open", "close", "separators" ],
|
||||
menclose: [ "notation" ],
|
||||
munder: [ "accentunder" ],
|
||||
mover: [ "accent" ],
|
||||
munderover: [ "accent", "accentunder" ]
|
||||
},
|
||||
Filter: function(t, a, e) {
|
||||
if (delete t.enriched, !this.config.disabled) try {
|
||||
this.running = !0;
|
||||
var n = sre.Enrich.semanticMathmlSync(t.root.toMathML());
|
||||
t.root = MathJax.InputJax.MathML.Parse.prototype.MakeMML(n), t.root.inputID = e.id,
|
||||
t.enriched = !0, this.running = !1;
|
||||
} catch (t) {
|
||||
throw this.running = !1, t;
|
||||
}
|
||||
},
|
||||
Enable: function(t, a) {
|
||||
this.config.disabled = !1, t && MathJax.Hub.Queue([ "Reprocess", MathJax.Hub ]);
|
||||
},
|
||||
Disable: function(t, a) {
|
||||
this.config.disabled = !0;
|
||||
for (var e = this.dependents.length - 1; 0 <= e; e--) {
|
||||
var n = this.dependents[e];
|
||||
n.Disable && n.Disable(!1, a);
|
||||
}
|
||||
t && MathJax.Hub.Queue([ "Reprocess", MathJax.Hub ]);
|
||||
},
|
||||
Dependent: function(t) {
|
||||
this.dependents.push(t);
|
||||
}
|
||||
}, function() {
|
||||
var t = MathJax.Ajax.config.path;
|
||||
t.a11y || (t.a11y = HUB.config.root + "/extensions/a11y"), t.SRE || (t.SRE = MathJax.Ajax.fileURL(t.a11y)),
|
||||
MathJax.Ajax.Load("[SRE]/mathjax-sre.js"), MathJax.Hub.Register.StartupHook("Sre Ready", [ "loadComplete", MathJax.Ajax, "[SRE]/mathjax-sre.js" ]);
|
||||
}(), MathJax.Callback.Queue([ "Require", MathJax.Ajax, "[MathJax]/jax/element/mml/jax.js" ], [ "Require", MathJax.Ajax, "[MathJax]/jax/input/MathML/config.js" ], [ "Require", MathJax.Ajax, "[MathJax]/jax/input/MathML/jax.js" ], [ "Require", MathJax.Ajax, "[MathJax]/extensions/toMathML.js" ], MathJax.Hub.Register.StartupHook("Sre Ready", function() {
|
||||
var l = MathJax.ElementJax.mml, c = MathJax.Extension["semantic-enrich"];
|
||||
l.mbase.Augment({
|
||||
toMathMLattributes: function() {
|
||||
var t = "mstyle" === this.type ? l.math.prototype.defaults : this.defaults, a = this.attrNames || l.copyAttributeNames, e = l.skipAttributes, n = l.copyAttributes, s = c.running && c.mstyleLookup[this.type] || [], i = [], h = this.attr || {};
|
||||
if ("math" !== this.type || this.attr && "xmlns" in this.attr || i.push('xmlns="http://www.w3.org/1998/Math/MathML"'),
|
||||
!this.attrNames) for (var r in t) e[r] || n[r] || !t.hasOwnProperty(r) || null != this[r] && this[r] !== t[r] && this.Get(r, null, 1) !== this[r] && this.toMathMLaddAttr(i, r, this[r]);
|
||||
for (var o = 0, u = a.length; o < u; o++) 1 === n[a[o]] && !t.hasOwnProperty(a[o]) || (value = h[a[o]],
|
||||
null == value && (value = this[a[o]]), null != value && this.toMathMLaddAttr(i, a[o], value));
|
||||
for (o = 0, u = s.length; o < u; o++) r = s[o], t.hasOwnProperty(r) && !i["_" + r] && (value = this.Get(r, 1),
|
||||
null != value && this.toMathMLaddAttr(i, r, value));
|
||||
return this.toMathMLclass(i), i.length ? " " + i.join(" ") : "";
|
||||
},
|
||||
toMathMLaddAttr: function(t, a, e) {
|
||||
t.push(a + '="' + this.toMathMLquote(e) + '"'), t["_" + a] = 1;
|
||||
}
|
||||
});
|
||||
var a = l.mo.prototype.setTeXclass;
|
||||
l.mo.Augment({
|
||||
setTeXclass: function(t) {
|
||||
this.getValues("form", "lspace", "rspace");
|
||||
return this.useMMLspacing ? (this.texClass = l.TEXCLASS.NONE, this) : this.attr && this.attr["data-semantic-added"] ? (this.texClass = this.prevClass = l.TEXCLASS.NONE,
|
||||
t) : a.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
}), function() {
|
||||
MathJax.Hub.postInputHooks.Add([ "Filter", MathJax.Extension["semantic-enrich"] ], 50),
|
||||
MathJax.Hub.Startup.signal.Post("Semantic Enrich Ready"), MathJax.Ajax.loadComplete("[a11y]/semantic-enrich.js");
|
||||
});
|
77
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/wgxpath.install.js
vendored
Normal file
77
venv/Lib/site-packages/notebook/static/components/MathJax/extensions/a11y/wgxpath.install.js
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
(function(){'use strict';var k=this;
|
||||
function aa(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
|
||||
b&&"undefined"==typeof a.call)return"object";return b}function l(a){return"string"==typeof a}function ba(a,b,c){return a.call.apply(a.bind,arguments)}function ca(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
|
||||
function da(a,b,c){da=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ba:ca;return da.apply(null,arguments)}function ea(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}
|
||||
function m(a){var b=n;function c(){}c.prototype=b.prototype;a.G=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.F=function(a,c,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[c].apply(a,g)}};/*
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2007 Cybozu Labs, Inc.
|
||||
Copyright (c) 2012 Google Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
*/
|
||||
var fa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function q(a,b){return-1!=a.indexOf(b)}function ga(a,b){return a<b?-1:a>b?1:0};var ha=Array.prototype.indexOf?function(a,b,c){return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(l(a))return l(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},r=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=l(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},ia=Array.prototype.filter?function(a,b,c){return Array.prototype.filter.call(a,
|
||||
b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,g=l(a)?a.split(""):a,h=0;h<d;h++)if(h in g){var p=g[h];b.call(c,p,h,a)&&(e[f++]=p)}return e},t=Array.prototype.reduce?function(a,b,c,d){d&&(b=da(b,d));return Array.prototype.reduce.call(a,b,c)}:function(a,b,c,d){var e=c;r(a,function(c,g){e=b.call(d,e,c,g,a)});return e},ja=Array.prototype.some?function(a,b,c){return Array.prototype.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=l(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;
|
||||
return!1};function ka(a,b){var c;a:{c=a.length;for(var d=l(a)?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){c=e;break a}c=-1}return 0>c?null:l(a)?a.charAt(c):a[c]}function la(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ma(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var u;a:{var na=k.navigator;if(na){var oa=na.userAgent;if(oa){u=oa;break a}}u=""};var pa=q(u,"Opera")||q(u,"OPR"),v=q(u,"Trident")||q(u,"MSIE"),qa=q(u,"Edge"),ra=q(u,"Gecko")&&!(q(u.toLowerCase(),"webkit")&&!q(u,"Edge"))&&!(q(u,"Trident")||q(u,"MSIE"))&&!q(u,"Edge"),sa=q(u.toLowerCase(),"webkit")&&!q(u,"Edge");function ta(){var a=k.document;return a?a.documentMode:void 0}var ua;
|
||||
a:{var va="",wa=function(){var a=u;if(ra)return/rv\:([^\);]+)(\)|;)/.exec(a);if(qa)return/Edge\/([\d\.]+)/.exec(a);if(v)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(sa)return/WebKit\/(\S+)/.exec(a);if(pa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();wa&&(va=wa?wa[1]:"");if(v){var xa=ta();if(null!=xa&&xa>parseFloat(va)){ua=String(xa);break a}}ua=va}var ya={};
|
||||
function za(a){if(!ya[a]){for(var b=0,c=fa(String(ua)).split("."),d=fa(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f<e;f++){var g=c[f]||"",h=d[f]||"",p=/(\d*)(\D*)/g,y=/(\d*)(\D*)/g;do{var D=p.exec(g)||["","",""],X=y.exec(h)||["","",""];if(0==D[0].length&&0==X[0].length)break;b=ga(0==D[1].length?0:parseInt(D[1],10),0==X[1].length?0:parseInt(X[1],10))||ga(0==D[2].length,0==X[2].length)||ga(D[2],X[2])}while(0==b)}ya[a]=0<=b}}
|
||||
var Aa=k.document,Ba=Aa&&v?ta()||("CSS1Compat"==Aa.compatMode?parseInt(ua,10):5):void 0;var w=v&&!(9<=Number(Ba)),Ca=v&&!(8<=Number(Ba));function x(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Da(a,b){var c=Ca&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new x(b,a,b.nodeName,c)};function z(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(w&&"title"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),w&&"title"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b}
|
||||
function A(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Ca&&"class"==b&&(b="className");return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function B(a,b,c,d,e){return(w?Ea:Fa).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new C)}
|
||||
function Ea(a,b,c,d,e){if(a instanceof E||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=Ga(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)A(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||F(e,b);return e}Ha(a,b,c,d,e);return e}
|
||||
function Fa(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!v?(b=b.getElementsByName(d),r(b,function(b){a.a(b)&&F(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),r(b,function(b){b.className==d&&a.a(b)&&F(e,b)})):a instanceof G?Ha(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),r(b,function(a){A(a,c,d)&&F(e,a)}));return e}
|
||||
function Ia(a,b,c,d,e){var f;if((a instanceof E||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=Ga(a);if("*"!=g&&(f=ia(f,function(a){return a.tagName&&a.tagName.toLowerCase()==g}),!f))return e;c&&(f=ia(f,function(a){return A(a,c,d)}));r(f,function(a){"*"==g&&("!"==a.tagName||"*"==g&&1!=a.nodeType)||F(e,a)});return e}return Ja(a,b,c,d,e)}function Ja(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)A(b,c,d)&&a.a(b)&&F(e,b);return e}
|
||||
function Ha(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)A(b,c,d)&&a.a(b)&&F(e,b),Ha(a,b,c,d,e)}function Ga(a){if(a instanceof G){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};!ra&&!v||v&&9<=Number(Ba)||ra&&za("1.9.1");v&&za("9");function Ka(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
|
||||
function La(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(v&&!(9<=Number(Ba))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ma(a,b):!c&&Ka(e,b)?-1*Na(a,b):!d&&Ka(f,a)?Na(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=9==a.nodeType?
|
||||
a:a.ownerDocument||a.document;c=d.createRange();c.selectNode(a);c.collapse(!0);d=d.createRange();d.selectNode(b);d.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,d)}function Na(a,b){var c=a.parentNode;if(c==b)return-1;for(var d=b;d.parentNode!=c;)d=d.parentNode;return Ma(d,a)}function Ma(a,b){for(var c=b;c=c.previousSibling;)if(c==a)return-1;return 1};function C(){this.b=this.a=null;this.l=0}function Oa(a){this.node=a;this.a=this.b=null}function Pa(a,b){if(!a.a)return b;if(!b.a)return a;for(var c=a.a,d=b.a,e=null,f=null,g=0;c&&d;){var f=c.node,h=d.node;f==h||f instanceof x&&h instanceof x&&f.a==h.a?(f=c,c=c.a,d=d.a):0<La(c.node,d.node)?(f=d,d=d.a):(f=c,c=c.a);(f.b=e)?e.a=f:a.a=f;e=f;g++}for(f=c||d;f;)f.b=e,e=e.a=f,g++,f=f.a;a.b=e;a.l=g;return a}function Qa(a,b){var c=new Oa(b);c.a=a.a;a.b?a.a.b=c:a.a=a.b=c;a.a=c;a.l++}
|
||||
function F(a,b){var c=new Oa(b);c.b=a.b;a.a?a.b.a=c:a.a=a.b=c;a.b=c;a.l++}function Ra(a){return(a=a.a)?a.node:null}function Sa(a){return(a=Ra(a))?z(a):""}function H(a,b){return new Ta(a,!!b)}function Ta(a,b){this.f=a;this.b=(this.c=b)?a.b:a.a;this.a=null}function I(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.c?b.b:b.a;return c.node};function n(a){this.i=a;this.b=this.g=!1;this.f=null}function J(a){return"\n "+a.toString().split("\n").join("\n ")}function Ua(a,b){a.g=b}function Va(a,b){a.b=b}function K(a,b){var c=a.a(b);return c instanceof C?+Sa(c):+c}function L(a,b){var c=a.a(b);return c instanceof C?Sa(c):""+c}function M(a,b){var c=a.a(b);return c instanceof C?!!c.l:!!c};function N(a,b,c){n.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==Wa&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,s:b}):this.f={name:b.f.name,s:c})}m(N);
|
||||
function O(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof C&&c instanceof C){b=H(b);for(d=I(b);d;d=I(b))for(e=H(c),f=I(e);f;f=I(e))if(a(z(d),z(f)))return!0;return!1}if(b instanceof C||c instanceof C){b instanceof C?(e=b,d=c):(e=c,d=b);f=H(e);for(var g=typeof d,h=I(f);h;h=I(f)){switch(g){case "number":h=+z(h);break;case "boolean":h=!!z(h);break;case "string":h=z(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e?"boolean"==
|
||||
typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}N.prototype.a=function(a){return this.c.m(this.h,this.o,a)};N.prototype.toString=function(){var a="Binary Expression: "+this.c,a=a+J(this.h);return a+=J(this.o)};function Xa(a,b,c,d){this.a=a;this.w=b;this.i=c;this.m=d}Xa.prototype.toString=function(){return this.a};var Ya={};
|
||||
function P(a,b,c,d){if(Ya.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Xa(a,b,c,d);return Ya[a.toString()]=a}P("div",6,1,function(a,b,c){return K(a,c)/K(b,c)});P("mod",6,1,function(a,b,c){return K(a,c)%K(b,c)});P("*",6,1,function(a,b,c){return K(a,c)*K(b,c)});P("+",5,1,function(a,b,c){return K(a,c)+K(b,c)});P("-",5,1,function(a,b,c){return K(a,c)-K(b,c)});P("<",4,2,function(a,b,c){return O(function(a,b){return a<b},a,b,c)});
|
||||
P(">",4,2,function(a,b,c){return O(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return O(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return O(function(a,b){return a>=b},a,b,c)});var Wa=P("=",3,2,function(a,b,c){return O(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return O(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return M(a,c)&&M(b,c)});P("or",1,2,function(a,b,c){return M(a,c)||M(b,c)});function Q(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function Za(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");n.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}m(Za);Za.prototype.a=function(a){a=this.c.a(a);return $a(this.h,a)};Za.prototype.toString=function(){var a;a="Filter:"+J(this.c);return a+=J(this.h)};function ab(a,b){if(b.length<a.A)throw Error("Function "+a.j+" expects at least"+a.A+" arguments, "+b.length+" given");if(null!==a.v&&b.length>a.v)throw Error("Function "+a.j+" expects at most "+a.v+" arguments, "+b.length+" given");a.B&&r(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});n.call(this,a.i);this.h=a;this.c=b;Ua(this,a.g||ja(b,function(a){return a.g}));Va(this,a.D&&!b.length||a.C&&!!b.length||ja(b,function(a){return a.b}))}m(ab);
|
||||
ab.prototype.a=function(a){return this.h.m.apply(null,la(a,this.c))};ab.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=t(this.c,function(a,b){return a+J(b)},"Arguments:"),a=a+J(b);return a};function bb(a,b,c,d,e,f,g,h,p){this.j=a;this.i=b;this.g=c;this.D=d;this.C=e;this.m=f;this.A=g;this.v=void 0!==h?h:g;this.B=!!p}bb.prototype.toString=function(){return this.j};var cb={};
|
||||
function R(a,b,c,d,e,f,g,h){if(cb.hasOwnProperty(a))throw Error("Function already created: "+a+".");cb[a]=new bb(a,b,c,d,!1,e,f,g,h)}R("boolean",2,!1,!1,function(a,b){return M(b,a)},1);R("ceiling",1,!1,!1,function(a,b){return Math.ceil(K(b,a))},1);R("concat",3,!1,!1,function(a,b){return t(ma(arguments,1),function(b,d){return b+L(d,a)},"")},2,null);R("contains",2,!1,!1,function(a,b,c){return q(L(b,a),L(c,a))},2);R("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0);
|
||||
R("false",2,!1,!1,function(){return!1},0);R("floor",1,!1,!1,function(a,b){return Math.floor(K(b,a))},1);R("id",4,!1,!1,function(a,b){function c(a){if(w){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ka(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=L(b,a).split(/\s+/),f=[];r(d,function(a){a=c(a);!a||0<=ha(f,a)||f.push(a)});f.sort(La);var g=new C;r(f,function(a){F(g,a)});return g},1);
|
||||
R("lang",2,!1,!1,function(){return!1},1);R("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);R("local-name",3,!1,!0,function(a,b){var c=b?Ra(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);R("name",3,!1,!0,function(a,b){var c=b?Ra(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);R("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
|
||||
R("normalize-space",3,!1,!0,function(a,b){return(b?L(b,a):z(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);R("not",2,!1,!1,function(a,b){return!M(b,a)},1);R("number",1,!1,!0,function(a,b){return b?K(b,a):+z(a.a)},0,1);R("position",1,!0,!1,function(a){return a.b},0);R("round",1,!1,!1,function(a,b){return Math.round(K(b,a))},1);R("starts-with",2,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);return 0==b.lastIndexOf(a,0)},2);R("string",3,!1,!0,function(a,b){return b?L(b,a):z(a.a)},0,1);
|
||||
R("string-length",1,!1,!0,function(a,b){return(b?L(b,a):z(a.a)).length},0,1);R("substring",3,!1,!1,function(a,b,c,d){c=K(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?K(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=L(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);R("substring-after",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
|
||||
R("substring-before",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);R("sum",1,!1,!1,function(a,b){for(var c=H(b.a(a)),d=0,e=I(c);e;e=I(c))d+=+z(e);return d},1,1,!0);R("translate",3,!1,!1,function(a,b,c,d){b=L(b,a);c=L(c,a);var e=L(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);R("true",2,!1,!1,function(){return!0},0);function G(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function db(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}G.prototype.a=function(a){return null===this.b||this.b==a.nodeType};G.prototype.f=function(){return this.h};
|
||||
G.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=J(this.c));return a};function eb(a){this.b=a;this.a=0}function fb(a){a=a.match(gb);for(var b=0;b<a.length;b++)hb.test(a[b])&&a.splice(b,1);return new eb(a)}var gb=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,hb=/^\s/;function S(a,b){return a.b[a.a+(b||0)]}function T(a){return a.b[a.a++]}function ib(a){return a.b.length<=a.a};function jb(a){n.call(this,3);this.c=a.substring(1,a.length-1)}m(jb);jb.prototype.a=function(){return this.c};jb.prototype.toString=function(){return"Literal: "+this.c};function E(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}E.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=void 0!==a.localName?a.localName:a.nodeName;return"*"!=this.j&&this.j!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};E.prototype.f=function(){return this.j};
|
||||
E.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function kb(a,b){n.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.u||c.c!=lb||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}m(kb);function mb(){n.call(this,4)}m(mb);mb.prototype.a=function(a){var b=new C;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};mb.prototype.toString=function(){return"Root Helper Expression"};function nb(){n.call(this,4)}m(nb);nb.prototype.a=function(a){var b=new C;F(b,a.a);return b};nb.prototype.toString=function(){return"Context Helper Expression"};
|
||||
function ob(a){return"/"==a||"//"==a}kb.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof C))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.l;c++){var e=a[c],f=H(b,e.c.a),g;if(e.g||e.c!=pb)if(e.g||e.c!=qb)for(g=I(f),b=e.a(new Q(g));null!=(g=I(f));)g=e.a(new Q(g)),b=Pa(b,g);else g=I(f),b=e.a(new Q(g));else{for(g=I(f);(b=I(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new Q(g))}}return b};
|
||||
kb.prototype.toString=function(){var a;a="Path Expression:"+J(this.h);if(this.c.length){var b=t(this.c,function(a,b){return a+J(b)},"Steps:");a+=J(b)}return a};function rb(a){n.call(this,4);this.c=a;Ua(this,ja(this.c,function(a){return a.g}));Va(this,ja(this.c,function(a){return a.b}))}m(rb);rb.prototype.a=function(a){var b=new C;r(this.c,function(c){c=c.a(a);if(!(c instanceof C))throw Error("Path expression must evaluate to NodeSet.");b=Pa(b,c)});return b};rb.prototype.toString=function(){return t(this.c,function(a,b){return a+J(b)},"Union Expression:")};function sb(a,b){this.a=a;this.b=!!b}
|
||||
function $a(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=H(b),f=b.l,g,h=0;g=I(e);h++){var p=a.b?f-h:h+1;g=d.a(new Q(g,p,f));if("number"==typeof g)p=p==g;else if("string"==typeof g||"boolean"==typeof g)p=!!g;else if(g instanceof C)p=0<g.l;else throw Error("Predicate.evaluate returned an unexpected type.");if(!p){p=e;g=p.f;var y=p.a;if(!y)throw Error("Next must be called at least once before remove.");var D=y.b,y=y.a;D?D.a=y:g.a=y;y?y.b=D:g.b=D;g.l--;p.a=null}}return b}
|
||||
sb.prototype.toString=function(){return t(this.a,function(a,b){return a+J(b)},"Predicates:")};function U(a,b,c,d){n.call(this,4);this.c=a;this.o=b;this.h=c||new sb([]);this.u=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.b&&b&&(a=b.name,a=w?a.toLowerCase():a,this.f={name:a,s:b.s});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}m(U);
|
||||
U.prototype.a=function(a){var b=a.a,c=null,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.s?L(c.s,a):null,f=1);if(this.u)if(this.g||this.c!=tb)if(a=H((new U(ub,new G("node"))).a(a)),b=I(a))for(c=this.m(b,d,e,f);null!=(b=I(a));)c=Pa(c,this.m(b,d,e,f));else c=new C;else c=B(this.o,b,d,e),c=$a(this.h,c,f);else c=this.m(a.a,d,e,f);return c};U.prototype.m=function(a,b,c,d){a=this.c.f(this.o,a,b,c);return a=$a(this.h,a,d)};
|
||||
U.prototype.toString=function(){var a;a="Step:"+J("Operator: "+(this.u?"//":"/"));this.c.j&&(a+=J("Axis: "+this.c));a+=J(this.o);if(this.h.a.length){var b=t(this.h.a,function(a,b){return a+J(b)},"Predicates:");a+=J(b)}return a};function vb(a,b,c,d){this.j=a;this.f=b;this.a=c;this.b=d}vb.prototype.toString=function(){return this.j};var wb={};function V(a,b,c,d){if(wb.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new vb(a,b,c,!!d);return wb[a]=b}
|
||||
V("ancestor",function(a,b){for(var c=new C,d=b;d=d.parentNode;)a.a(d)&&Qa(c,d);return c},!0);V("ancestor-or-self",function(a,b){var c=new C,d=b;do a.a(d)&&Qa(c,d);while(d=d.parentNode);return c},!0);
|
||||
var lb=V("attribute",function(a,b){var c=new C,d=a.f();if("style"==d&&w&&b.style)return F(c,new x(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof G&&null===a.b||"*"==d)for(var d=0,f;f=e[d];d++)w?f.nodeValue&&F(c,Da(b,f)):F(c,f);else(f=e.getNamedItem(d))&&(w?f.nodeValue&&F(c,Da(b,f)):F(c,f));return c},!1),tb=V("child",function(a,b,c,d,e){return(w?Ia:Ja).call(null,a,b,l(c)?c:null,l(d)?d:null,e||new C)},!1,!0);V("descendant",B,!1,!0);
|
||||
var ub=V("descendant-or-self",function(a,b,c,d){var e=new C;A(b,c,d)&&a.a(b)&&F(e,b);return B(a,b,c,d,e)},!1,!0),pb=V("following",function(a,b,c,d){var e=new C;do for(var f=b;f=f.nextSibling;)A(f,c,d)&&a.a(f)&&F(e,f),e=B(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);V("following-sibling",function(a,b){for(var c=new C,d=b;d=d.nextSibling;)a.a(d)&&F(c,d);return c},!1);V("namespace",function(){return new C},!1);
|
||||
var xb=V("parent",function(a,b){var c=new C;if(9==b.nodeType)return c;if(2==b.nodeType)return F(c,b.ownerElement),c;var d=b.parentNode;a.a(d)&&F(c,d);return c},!1),qb=V("preceding",function(a,b,c,d){var e=new C,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var p=[];for(b=f[g];b=b.previousSibling;)p.unshift(b);for(var y=0,D=p.length;y<D;y++)b=p[y],A(b,c,d)&&a.a(b)&&F(e,b),e=B(a,b,c,d,e)}return e},!0,!0);
|
||||
V("preceding-sibling",function(a,b){for(var c=new C,d=b;d=d.previousSibling;)a.a(d)&&Qa(c,d);return c},!0);var yb=V("self",function(a,b){var c=new C;a.a(b)&&F(c,b);return c},!1);function zb(a){n.call(this,1);this.c=a;this.g=a.g;this.b=a.b}m(zb);zb.prototype.a=function(a){return-K(this.c,a)};zb.prototype.toString=function(){return"Unary Expression: -"+J(this.c)};function Ab(a){n.call(this,1);this.c=a}m(Ab);Ab.prototype.a=function(){return this.c};Ab.prototype.toString=function(){return"Number: "+this.c};function Bb(a,b){this.a=a;this.b=b}function Cb(a){for(var b,c=[];;){W(a,"Missing right hand side of binary expression.");b=Db(a);var d=T(a.a);if(!d)break;var e=(d=Ya[d]||null)&&d.w;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].w;)b=new N(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new N(c.pop(),c.pop(),b);return b}function W(a,b){if(ib(a.a))throw Error(b);}function Eb(a,b){var c=T(a.a);if(c!=b)throw Error("Bad token, expected: "+b+" got: "+c);}
|
||||
function Fb(a){a=T(a.a);if(")"!=a)throw Error("Bad token: "+a);}function Gb(a){a=T(a.a);if(2>a.length)throw Error("Unclosed literal string");return new jb(a)}
|
||||
function Hb(a){var b,c=[],d;if(ob(S(a.a))){b=T(a.a);d=S(a.a);if("/"==b&&(ib(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new mb;d=new mb;W(a,"Missing next location step.");b=Ib(a,b);c.push(b)}else{a:{b=S(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":T(a.a);b=Cb(a);W(a,'unclosed "("');Eb(a,")");break;case '"':case "'":b=Gb(a);break;default:if(isNaN(+b))if(!db(b)&&/(?![0-9])[\w]/.test(d)&&"("==S(a.a,1)){b=T(a.a);
|
||||
b=cb[b]||null;T(a.a);for(d=[];")"!=S(a.a);){W(a,"Missing function argument list.");d.push(Cb(a));if(","!=S(a.a))break;T(a.a)}W(a,"Unclosed function argument list.");Fb(a);b=new ab(b,d)}else{b=null;break a}else b=new Ab(+T(a.a))}"["==S(a.a)&&(d=new sb(Jb(a)),b=new Za(b,d))}if(b)if(ob(S(a.a)))d=b;else return b;else b=Ib(a,"/"),d=new nb,c.push(b)}for(;ob(S(a.a));)b=T(a.a),W(a,"Missing next location step."),b=Ib(a,b),c.push(b);return new kb(d,c)}
|
||||
function Ib(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==S(a.a))return d=new U(yb,new G("node")),T(a.a),d;if(".."==S(a.a))return d=new U(xb,new G("node")),T(a.a),d;var f;if("@"==S(a.a))f=lb,T(a.a),W(a,"Missing attribute name");else if("::"==S(a.a,1)){if(!/(?![0-9])[\w]/.test(S(a.a).charAt(0)))throw Error("Bad token: "+T(a.a));c=T(a.a);f=wb[c]||null;if(!f)throw Error("No axis with name: "+c);T(a.a);W(a,"Missing node name")}else f=tb;c=S(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("==
|
||||
S(a.a,1)){if(!db(c))throw Error("Invalid node type: "+c);c=T(a.a);if(!db(c))throw Error("Invalid type name: "+c);Eb(a,"(");W(a,"Bad nodetype");e=S(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Gb(a);W(a,"Bad nodetype");Fb(a);c=new G(c,g)}else if(c=T(a.a),e=c.indexOf(":"),-1==e)c=new E(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new E(c,h)}else throw Error("Bad token: "+T(a.a));e=new sb(Jb(a),f.a);return d||
|
||||
new U(f,c,e,"//"==b)}function Jb(a){for(var b=[];"["==S(a.a);){T(a.a);W(a,"Missing predicate expression.");var c=Cb(a);b.push(c);W(a,"Unclosed predicate expression.");Eb(a,"]")}return b}function Db(a){if("-"==S(a.a))return T(a.a),new zb(Db(a));var b=Hb(a);if("|"!=S(a.a))a=b;else{for(b=[b];"|"==T(a.a);)W(a,"Missing next union location path."),b.push(Hb(a));a.a.a--;a=new rb(b)}return a};function Kb(a){switch(a.nodeType){case 1:return ea(Lb,a);case 9:return Kb(a.documentElement);case 11:case 10:case 6:case 12:return Mb;default:return a.parentNode?Kb(a.parentNode):Mb}}function Mb(){return null}function Lb(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Lb(a.parentNode,b):null};function Nb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=fb(a);if(ib(c))throw Error("Invalid XPath expression.");b?"function"==aa(b)||(b=da(b.lookupNamespaceURI,b)):b=function(){return null};var d=Cb(new Bb(c,b));if(!ib(c))throw Error("Bad token: "+T(c));this.evaluate=function(a,b){var c=d.a(new Q(a));return new Y(c,b)}}
|
||||
function Y(a,b){if(0==b)if(a instanceof C)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof C))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof C?Sa(a):""+a;break;case 1:this.numberValue=a instanceof C?+Sa(a):+a;break;case 3:this.booleanValue=a instanceof C?0<a.l:!!a;break;case 4:case 5:case 6:case 7:var d=
|
||||
H(a);c=[];for(var e=I(d);e;e=I(d))c.push(e instanceof x?e.a:e);this.snapshotLength=a.l;this.invalidIteratorState=!1;break;case 8:case 9:d=Ra(a);this.singleNodeValue=d instanceof x?d.a:d;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length||
|
||||
0>a?null:c[a]}}Y.ANY_TYPE=0;Y.NUMBER_TYPE=1;Y.STRING_TYPE=2;Y.BOOLEAN_TYPE=3;Y.UNORDERED_NODE_ITERATOR_TYPE=4;Y.ORDERED_NODE_ITERATOR_TYPE=5;Y.UNORDERED_NODE_SNAPSHOT_TYPE=6;Y.ORDERED_NODE_SNAPSHOT_TYPE=7;Y.ANY_UNORDERED_NODE_TYPE=8;Y.FIRST_ORDERED_NODE_TYPE=9;function Ob(a){this.lookupNamespaceURI=Kb(a)}
|
||||
function Pb(a,b){var c=a||k,d=c.Document&&c.Document.prototype||c.document;if(!d.evaluate||b)c.XPathResult=Y,d.evaluate=function(a,b,c,d){return(new Nb(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Nb(a,b)},d.createNSResolver=function(a){return new Ob(a)}}var Qb=["wgxpath","install"],Z=k;Qb[0]in Z||!Z.execScript||Z.execScript("var "+Qb[0]);for(var Rb;Qb.length&&(Rb=Qb.shift());)Qb.length||void 0===Pb?Z[Rb]?Z=Z[Rb]:Z=Z[Rb]={}:Z[Rb]=Pb;}).call(this)
|
Loading…
Add table
Add a link
Reference in a new issue